/* CentralChamber - Sacred Theme (from PersonalSignalMirror) */

:root {
  --bg: #0b0f18;
  --panel: rgba(15, 19, 33, 0.94);
  --card: rgba(17, 22, 36, 0.9);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --glass-blur: 12px;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --accent: #70d9bf;
  --accent-2: #7fa5ff;
  --accent-hot: #ff7eb6;
  --accent-warm: #f2c26b;
  --accent-purple: #9333ea;
  --text: #e9f1ff;
  --muted: #98a6c4;
  --focus: #f3f6ff;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 22px rgba(0, 0, 0, 0.22);
  --glow: 0 0 18px rgba(112, 217, 191, 0.2);
  --glow-purple: 0 0 18px rgba(147, 51, 234, 0.25);
  --surface-contrast: #0f1726;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #0b1020 0%, #0a0d18 55%, #080b12 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

/* Layout */
.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #7fd0ff, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Status indicator */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.875rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(112, 217, 191, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--accent-hot);
  box-shadow: 0 0 12px rgba(255, 126, 182, 0.6);
  animation: none;
}

.status-dot.working {
  background: var(--accent-warm);
  box-shadow: 0 0 12px rgba(242, 194, 107, 0.6);
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-soft);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Main grid layout */
.main-grid {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  gap: 1.25rem;
  min-height: calc(100vh - 140px);
}

@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* Projects panel */
.projects-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.project-item:hover {
  background: var(--glass-strong);
  border-color: var(--border-strong);
  transform: translateX(4px);
}

.project-item.active {
  background: linear-gradient(135deg, rgba(112, 217, 191, 0.1), rgba(127, 165, 255, 0.08));
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.project-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(94, 242, 201, 0.18), rgba(109, 141, 255, 0.14));
  border: 1px solid var(--border);
  font-size: 1rem;
}

.project-name {
  font-weight: 500;
  font-size: 0.9375rem;
}

.project-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Session timeline */
.session-panel {
  display: flex;
  flex-direction: column;
}

.timeline {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.timeline-item.from-orchestrator {
  border-left: 3px solid var(--accent-purple);
}

.timeline-item.from-agent {
  border-left: 3px solid var(--accent);
}

.timeline-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--glass-strong);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.timeline-text {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Agent status panel */
.agents-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.agent-card {
  padding: 1rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.agent-card.active {
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.agent-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.agent-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 1.125rem;
  color: var(--surface-contrast);
}

.agent-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.agent-status {
  font-size: 0.75rem;
  color: var(--muted);
}

.agent-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--glass);
  border-radius: 6px;
}

.stat-label {
  color: var(--muted);
}

.stat-value {
  font-weight: 600;
}

/* Buttons */
button, .btn {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: var(--surface-contrast);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-soft), var(--glow);
  transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

button.ghost, .btn.ghost {
  background: var(--glass);
  color: var(--text);
  box-shadow: none;
}

button.ghost:hover, .btn.ghost:hover {
  background: var(--glass-strong);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Input fields */
input, select, textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.75rem 1rem;
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  backdrop-filter: blur(calc(var(--glass-blur) / 2));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(112, 217, 191, 0.15);
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
}

/* Fix select dropdown options in dark mode */
select option {
  background: #1a1f2e;
  color: var(--text);
}

select optgroup {
  background: #151922;
  color: var(--muted);
}

/* Orchestrator connection panel */
.orchestrator-panel {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.08), rgba(127, 165, 255, 0.05));
  border-color: rgba(147, 51, 234, 0.2);
}

.orchestrator-panel .card-title {
  background: linear-gradient(135deg, #9333ea, #7fa5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-text {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.empty-subtext {
  font-size: 0.875rem;
  opacity: 0.7;
  line-height: 1.6;
}

/* Pill badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  font-size: 0.75rem;
  font-weight: 500;
}

.pill.python { border-color: rgba(53, 114, 165, 0.4); color: #3572A5; }
.pill.typescript { border-color: rgba(49, 120, 198, 0.4); color: #3178c6; }
.pill.javascript { border-color: rgba(241, 224, 90, 0.4); color: #f1e05a; }
.pill.go { border-color: rgba(0, 173, 216, 0.4); color: #00ADD8; }

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Project Config Panel */
.config-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.config-header h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
}

.config-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.config-row label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-row input,
.config-row select,
.config-row textarea {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.port-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.port-input-group input {
  flex: 1;
}

.port-status {
  font-size: 0.75rem;
  white-space: nowrap;
}

.port-status.running {
  color: var(--accent);
}

.port-status.stopped {
  color: var(--muted);
}

.config-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

button.small {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

/* Projects list scrollable */
.projects-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Relay Card */
.relay-card {
  background: linear-gradient(135deg, rgba(242, 194, 107, 0.08), rgba(255, 126, 182, 0.05));
  border-color: rgba(242, 194, 107, 0.2);
}

.relay-card .card-title {
  background: linear-gradient(135deg, var(--accent-warm), var(--accent-hot));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.relay-status {
  padding: 0.5rem 0.75rem;
  background: var(--glass);
  border-radius: 8px;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Danger Mode Toggle */
.danger-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--glass);
  border-radius: 8px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.toggle-label input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-label input:checked + .toggle-slider {
  background: var(--accent-hot);
}

.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.toggle-text {
  font-size: 0.8125rem;
  font-weight: 500;
}

.danger-warning {
  font-size: 0.75rem;
  color: var(--accent-hot);
  animation: pulse 1.5s ease-in-out infinite;
}

/* Conversation Messages (Agent Output in Timeline) */
.conversation-message {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease;
}

.conversation-message.from-codex {
  border-left: 3px solid #10a37f;
}

.conversation-message.from-claude {
  border-left: 3px solid #7c3aed;
}

.conv-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.conv-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: 0.75rem;
  color: white;
}

.conv-agent {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

.conv-time {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--muted);
}

.conv-content {
  max-height: 400px;
  overflow-y: auto;
}

.conv-content pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface-contrast);
  padding: 0.75rem;
  border-radius: 6px;
  margin: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Agent status colors */
.agent-status.working {
  color: #f59e0b;
}

.agent-status.done {
  color: #10b981;
}

.agent-status.idle {
  color: var(--muted);
}

/* Responsive */
@media (max-width: 720px) {
  body {
    padding: 1rem;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

/* ============================================================
   API Clients & Subscriptions Modal Styles
   ============================================================ */

.api-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.api-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.api-tab-btn:hover {
  background: var(--surface-contrast);
  color: var(--text);
}

.api-tab-btn.active {
  background: var(--accent);
  color: white;
}

.api-tab-content {
  animation: fadeIn 0.2s ease;
}

.api-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.api-section-header h3 {
  margin: 0;
}

.api-empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.api-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--muted);
}

/* Create Forms */
.create-form {
  background: var(--surface-contrast);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-row {
  margin-bottom: 0.75rem;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* API Client Cards */
.api-clients-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.api-client-card {
  background: var(--surface-contrast);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.api-client-card.inactive {
  opacity: 0.6;
}

.api-client-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.api-client-name {
  font-weight: 600;
  font-size: 1rem;
}

.api-client-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.api-client-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.api-client-status.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.api-client-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.api-client-detail {
  font-size: 0.85rem;
}

.api-client-detail .label {
  color: var(--muted);
  margin-right: 0.5rem;
}

.api-client-detail code {
  background: var(--surface-raised);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.api-client-detail .badge {
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.api-client-detail .badge.basic {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.api-client-detail .badge.admin {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.api-client-desc {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.api-client-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* Subscription Cards */
.subscriptions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.subscription-provider-group {
  background: var(--surface-contrast);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.provider-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.provider-icon {
  font-size: 1.25rem;
}

.provider-name {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.subscription-card {
  background: var(--surface-raised);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

.subscription-card:last-child {
  margin-bottom: 0;
}

.subscription-card.inactive {
  opacity: 0.6;
}

.subscription-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.subscription-name {
  font-weight: 500;
}

.subscription-status {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.subscription-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.subscription-status.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.subscription-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.subscription-detail .label {
  color: var(--muted);
  margin-right: 0.25rem;
}

.subscription-notes {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.subscription-actions {
  display: flex;
  gap: 0.5rem;
}

/* API Key Display */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-contrast);
  padding: 0.75rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.api-key-display code {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

/* Usage Stats */
.usage-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.usage-stat-card {
  background: var(--surface-contrast);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.usage-stat-card.warning {
  border: 1px solid var(--accent-hot);
}

.usage-stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.usage-stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.usage-section {
  margin-bottom: 1.5rem;
}

.usage-section h4 {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.usage-table th,
.usage-table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.usage-table th {
  color: var(--muted);
  font-weight: 500;
}

.usage-table tr.inactive {
  opacity: 0.6;
}

.endpoint-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.endpoint-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.endpoint-name {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 120px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.endpoint-bar-fill {
  flex: 1;
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  min-width: 4px;
}

.endpoint-count {
  font-size: 0.75rem;
  color: var(--text);
  min-width: 40px;
  text-align: right;
}

/* Button variants */
.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: var(--accent-hot);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: #10b981;
}

.btn-success:hover {
  background: #059669;
}

.btn-secondary {
  background: var(--surface-contrast);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-raised);
}

/* ============================================
   Bug 8.9 Fix: Mobile Responsive Design
   ============================================ */

/* Hamburger menu button - hidden by default */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-btn span {
  width: 100%;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
}

/* Tablet breakpoint (1024px) */
@media (max-width: 1024px) {
  .hamburger-btn {
    display: flex;
  }

  .mobile-overlay {
    display: block;
    pointer-events: none;
  }

  .mobile-overlay.active {
    pointer-events: auto;
  }

  /* Make sidebar a slide-out drawer */
  .sidebar,
  #project-list-panel {
    position: fixed;
    left: -300px;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    background: var(--panel);
    border-right: 1px solid var(--border);
  }

  .sidebar.open,
  #project-list-panel.open {
    left: 0;
  }

  /* Main content takes full width */
  .main-content,
  .app-shell {
    max-width: 100%;
    padding: 0 0.75rem;
  }

  /* Adjust relay panels */
  .relay-panels,
  .conversation-split {
    flex-direction: column;
  }

  .relay-panel,
  .conversation-panel {
    width: 100%;
    max-width: 100%;
  }
}

/* Mobile breakpoint (768px) */
@media (max-width: 768px) {
  body {
    padding: 0.75rem;
    font-size: 14px;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .app-title {
    font-size: 1.25rem;
  }

  /* Stack header controls */
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }

  /* Touch-friendly buttons */
  button,
  .btn,
  input[type="submit"],
  select {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 0.75rem 1rem;
  }

  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 0.75rem;
  }

  /* Wrap relay controls */
  .relay-controls,
  .action-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .relay-controls button,
  .action-buttons button {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 100px;
  }

  /* Output panels - smaller on mobile */
  .output-panel,
  .relay-output {
    max-height: 300px;
  }

  /* Scrollable tables */
  .table-container,
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modal adjustments */
  .modal-content,
  .dialog-content {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    margin: 5vh auto;
  }

  /* Card adjustments */
  .project-card,
  .relay-card,
  .card {
    padding: 0.75rem;
  }

  /* Smaller status badges */
  .status-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Stack form groups */
  .form-row,
  .form-group-row {
    flex-direction: column;
  }

  /* Conversation view adjustments */
  .conversation-message {
    padding: 0.75rem;
  }

  .conversation-input textarea {
    min-height: 80px;
  }

  /* Tab navigation */
  .tabs,
  .tab-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .tab,
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* Small mobile breakpoint (480px) */
@media (max-width: 480px) {
  body {
    padding: 0.5rem;
  }

  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.1rem; }
  h3 { font-size: 1rem; }

  .app-title {
    font-size: 1.1rem;
  }

  /* Full-width buttons on very small screens */
  .relay-controls button,
  .action-buttons button {
    flex: 1 1 100%;
  }

  /* Reduce padding */
  .project-card,
  .relay-card,
  .card {
    padding: 0.5rem;
  }

  .relay-panel,
  .output-panel {
    padding: 0.5rem;
  }

  /* Smaller font for output */
  .output-content,
  pre,
  code {
    font-size: 12px;
  }

  /* Modal nearly full screen */
  .modal-content,
  .dialog-content {
    width: 100vw;
    max-width: 100vw;
    height: 95vh;
    max-height: 95vh;
    margin: 2.5vh 0;
    border-radius: 8px 8px 0 0;
  }
}

/* Landscape phone adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-content,
  .dialog-content {
    max-height: 85vh;
  }

  .output-panel,
  .relay-output {
    max-height: 200px;
  }
}
