/* === Brand Tokens (Design B) === */
:root {
  /* Colors */
  --primary: #E63946;
  --primary-light: #EF6B77;
  --primary-dark: #C4202E;
  --secondary: #FF9F43;
  --cta: #00E676;
  --cta-dark: #00C853;
  --cyan: #00D4FF;
  --yellow: #FFE033;
  --error: #FF5252;
  --warning: #FFAB00;
  --info: #448AFF;

  /* Surfaces */
  --bg: #FFFFFF;
  --surface: #F5F5F5;
  --surface-hover: #EBEBEB;
  --border: #E0E0E0;

  /* Text */
  --text-primary: #1A1A1E;
  --text-muted: #757575;
  --text-dim: #9E9E9E;

  /* Glow */
  --glow: rgba(230, 57, 70, 0.08);
  --glow-strong: rgba(230, 57, 70, 0.15);

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace; /* unused — kept for reference */

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-glow: 0 0 30px var(--glow);
  --shadow-glow-strong: 0 0 48px var(--glow-strong);
  --shadow-elevation: 0 4px 24px rgba(0, 0, 0, 0.08);

  /* Derived (hardcoded-color replacements) */
  --cta-text: #FFFFFF;
  --cta-glow: rgba(230, 57, 70, 0.2);
  --cta-glow-strong: rgba(230, 57, 70, 0.3);
  --edge-color: #C0C0C0;
}

/* === Reset === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

::selection {
  background: rgba(230, 57, 70, 0.3);
  color: #fff;
}

/* === Layout === */
.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* === Login === */
.login-container {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* === Forms === */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.form-input {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input::placeholder {
  color: var(--text-dim);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

/* === Buttons === */
.btn {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--cta);
  color: var(--cta-text);
  font-weight: 700;
  box-shadow: 0 0 24px var(--cta-glow);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 40px var(--cta-glow-strong);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* === Errors === */
.login-error:empty {
  display: none;
}

.error-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--error);
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

/* === Credentials Card === */
.credentials-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

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

.credentials-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.credentials-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.5rem;
}

.credentials-field-display {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.credentials-field-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.credentials-field-value {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.credentials-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.credentials-form-grid .full-width {
  grid-column: 1 / -1;
}

.credentials-extra-fields {
  margin-top: 0.75rem;
}

.credentials-extra-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.credentials-extra-row .form-input {
  flex: 1;
}

@media (max-width: 600px) {
  .credentials-form-grid {
    grid-template-columns: 1fr;
  }
}

/* === Page links === */
.login-link {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 1.25rem;
}

.login-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.login-link a:hover {
  color: var(--primary-light);
}

.forgot-password-link {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.375rem;
  text-decoration: none;
}

.forgot-password-link:hover {
  color: var(--primary);
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  gap: 0.75rem;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.login-divider span {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-github {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem 1rem;
  background: #24292e;
  color: #fff;
  border: 1px solid #1b1f23;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-github:hover {
  background: #2f363d;
  color: #fff;
}

/* === App Layout === */
.app-layout {
  display: flex;
  height: 100vh;
}

.app-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

/* === Sidebar === */
.sidebar {
  width: 240px;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  transition: width 0.2s;
  overflow: hidden;
}

.sidebar.sidebar-collapsed {
  width: 60px;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: inherit;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  overflow-y: auto;
  min-height: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  transition: color 0.15s, background 0.15s;
}

.sidebar-nav a:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.sidebar-nav a.active {
  color: var(--text-primary);
  border-left-color: var(--primary);
}

.sidebar-separator {
  border-top: 1px solid var(--border);
  margin: 0.5rem 0;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.25rem 1rem;
  display: block;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  position: relative;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  min-width: 0;
  cursor: pointer;
}

.sidebar-user-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sidebar-menu-btn {
  font-family: var(--font-display);
  width: 100%;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.sidebar-menu-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar-avatar-img {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-avatar.avatar-sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 0.7rem;
}

.sidebar-avatar-img.avatar-sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
}

.sidebar-avatar.avatar-md {
  width: 40px;
  height: 40px;
  min-width: 40px;
  font-size: 0.85rem;
}

.sidebar-avatar-img.avatar-md {
  width: 40px;
  height: 40px;
  min-width: 40px;
}

.sidebar-avatar-img.account-avatar-large {
  width: 64px;
  height: 64px;
  min-width: 64px;
}

.sidebar-user-info {
  display: flex; flex-direction: column; min-width: 0;
}
.sidebar-username {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-tenant {
  font-size: 0.625rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-collapse-btn {
  font-family: inherit;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: border-color 0.15s, color 0.15s;
}

.sidebar-collapse-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* === Sidebar Icons === */
.sidebar-icon {
  display: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
}

.sidebar-collapsed .sidebar-icon {
  display: block;
}

.sidebar-collapsed .sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide labels when sidebar is collapsed */
.sidebar-collapsed .sidebar-label {
  display: none;
}

.sidebar-collapsed .sidebar-header {
  padding: 1.25rem 0.5rem;
  justify-content: center;
}

.sidebar-collapsed .sidebar-logo {
  display: none;
}

.sidebar-collapsed .sidebar-nav a {
  padding: 0.5rem;
  border-left: none;
  text-align: center;
}

.sidebar-collapsed .sidebar-footer {
  padding: 0.75rem 0.5rem;
}

.sidebar-version {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
  text-align: center;
  margin-top: 0.5rem;
  user-select: all;
}


/* === Mobile Menu Button === */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  cursor: pointer;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .sidebar.sidebar-collapsed {
    width: 0;
    border-right: none;
  }
}

/* === Agents Filter Bar === */
.agents-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.agents-filter-bar .form-select {
  font-size: 0.85rem;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  max-width: 200px;
}
.agents-filter-bar .form-input {
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
}

/* === Agents Table === */
.agents-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.agents-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--primary);
  color: var(--text-dim);
  white-space: nowrap;
}

.agents-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.agents-table tbody tr:last-child td {
  border-bottom: none;
}

.agents-table tr:hover {
  background: var(--surface-hover);
}

.agents-table a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.agents-table a:hover {
  color: var(--primary);
}

.sortable-th {
  cursor: pointer;
}
.sortable-th a {
  text-decoration: none;
  color: inherit;
}
.sortable-th a:hover {
  color: var(--primary);
}
.sort-indicator {
  font-size: 0.65rem;
  color: var(--primary);
  margin-left: 0.15rem;
}

.agents-table .project-link {
  font-weight: 400;
  color: var(--text-muted);
}

/* === Role Badges === */
.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border: none;
  border-radius: var(--radius-pill);
}
.badge-green { color: #22C55E; background: rgba(34, 197, 94, 0.12); }
.badge-gray  { color: #9CA3AF; background: rgba(107, 114, 128, 0.12); }

/* === Status Badges === */
.status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border: none;
  border-radius: var(--radius-pill);
}

.status-pending {
  color: #9CA3AF;
  background: rgba(107, 114, 128, 0.12);
}

.status-running {
  color: #448AFF;
  background: rgba(68, 138, 255, 0.12);
}

.status-waiting {
  color: #FFAB00;
  background: rgba(255, 171, 0, 0.12);
}

.status-amber {
  color: #FFAB00;
  background: rgba(255, 171, 0, 0.12);
}

.status-completed {
  color: #00E676;
  background: rgba(0, 230, 118, 0.12);
}

.status-stopped {
  color: #78909C;
  background: rgba(120, 144, 156, 0.12);
}

.status-failed {
  color: #FF5252;
  background: rgba(255, 82, 82, 0.12);
}

.status-warning {
  color: #FFAB00;
  background: rgba(255, 171, 0, 0.12);
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.pagination a,
.pagination span {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s;
}

.pagination a:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--primary);
}

.pagination .disabled {
  color: var(--text-dim);
  border-color: var(--border);
  background: var(--bg);
  cursor: not-allowed;
  pointer-events: none;
}

/* === Back Link === */
.back-link {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.15s;
}

.back-link:hover {
  color: var(--primary);
}

/* === Section Title === */
.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

#agent-status-fragment { margin-bottom: 1rem; }

/* === Agent Meta === */
.agent-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.meta-value {
  font-size: 0.9rem;
}

.meta-prompt {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-prompt .meta-value {
  white-space: pre-wrap;
  word-break: break-word;
}

.meta-prompt-collapse {
  font-size: 0.9rem;
}

.meta-prompt-collapse summary {
  cursor: pointer;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.meta-prompt-collapse summary:hover {
  color: var(--text-primary);
}

.meta-prompt-collapse[open] summary {
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

/* === Conversation Grid === */
.conv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.35rem;
  margin-bottom: 2rem;
}

/* Full-width parts */
.conv-prompt,
.conv-text,
.conv-screenshot {
  grid-column: 1 / -1;
}

/* Prompt collapse */
.conv-prompt {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.conv-prompt summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  list-style: none;
}

.conv-prompt summary::-webkit-details-marker {
  display: none;
}

.conv-prompt .msg-text {
  padding: 0 0.75rem 0.75rem;
}

/* All card types share base style */
.conv-call,
.conv-resp,
.conv-text,
.conv-thinking {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  min-width: 0;
}

/* Text card */
.conv-text {
  padding: 0.6rem 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

/* Summaries (call, response, thinking) */
.conv-call summary,
.conv-resp summary,
.conv-thinking summary {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0.4rem 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-call summary:hover,
.conv-resp summary:hover,
.conv-thinking summary:hover {
  color: var(--text-primary);
}

/* Open card: expand full-width, push subsequent cards down */
.conv-call[open],
.conv-resp[open],
.conv-thinking[open] {
  grid-column: 1 / -1;
}

.conv-call[open] summary,
.conv-resp[open] summary,
.conv-thinking[open] summary {
  padding: 0.5rem 0.75rem 0.25rem;
  white-space: normal;
  color: var(--text-primary);
}

/* Expanded content (inline, not positioned) */
.conv-call pre,
.conv-resp pre {
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 0.75rem;
  margin: 0.25rem 0.75rem 0.75rem;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.7rem;
  line-height: 1.4;
  border-radius: var(--radius-sm);
}

.conv-thinking .msg-thinking-text {
  padding: 0.5rem 0.75rem 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
}

/* Screenshot */
.conv-screenshot {
  max-width: 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: zoom-in;
}

/* === Agent Result Card === */
.agent-result {
  margin-top: 1rem;
  padding: 1.5rem;
  border: 1px solid;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.agent-result-success {
  background: rgba(0, 230, 118, 0.06);
  border-color: rgba(0, 230, 118, 0.3);
}
.agent-result-failure {
  background: rgba(255, 82, 82, 0.06);
  border-color: rgba(255, 82, 82, 0.3);
}
.agent-result-warning {
  background: rgba(255, 171, 0, 0.06);
  border-color: rgba(255, 171, 0, 0.3);
}
.agent-result-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}
.agent-result-success .agent-result-title { color: var(--cta); }
.agent-result-failure .agent-result-title { color: var(--error); }
.agent-result-warning .agent-result-title { color: var(--warning); }
.agent-result-text {
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.agent-result-success .agent-result-text { color: var(--cta); }
.agent-result-failure .agent-result-text { color: var(--error); }
.agent-result-warning .agent-result-text { color: var(--warning); }

/* === Agent Summary (legacy classes kept for positive/negative lists) === */

/* === Agent Video Recording === */
.agent-video {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
media-player.agent-video-player {
  height: 160px;
  background: #000;
}

.msg-role {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* === Tool Icons === */
.tool-icon {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.3rem;
}

.tool-icon-nav     { background: rgba(68, 138, 255, 0.15);  color: #448AFF; }
.tool-icon-interact{ background: rgba(230, 57, 70, 0.12);   color: var(--primary); }
.tool-icon-observe { background: rgba(0, 212, 255, 0.15);   color: var(--cyan); }
.tool-icon-wait    { background: rgba(255, 171, 0, 0.15);   color: var(--warning); }
.tool-icon-js      { background: rgba(255, 224, 51, 0.15);  color: #D4A800; }
.tool-icon-file    { background: rgba(0, 230, 118, 0.12);   color: var(--cta); }
.tool-icon-net     { background: rgba(124, 58, 237, 0.12);  color: #7c3aed; }
.tool-icon-done    { background: rgba(0, 230, 118, 0.15);   color: var(--cta); }
.tool-icon-meta    { background: rgba(107, 114, 128, 0.12); color: var(--text-dim); }
.tool-icon-thinking{ background: rgba(167, 139, 250, 0.15); color: #a78bfa; }

/* === Lightbox === */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 95vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* === Live Badge === */
.vnc-live-badge {
  display: inline-block;
  color: #fff;
  background: #dc2626;
  padding: 0.1rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.vnc-ended {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* === Meta Live Link === */
.meta-live-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
}

.meta-live-link:hover {
  text-decoration: underline;
}

/* === Full-Page Browser View === */
.browser-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4rem);
}

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

.browser-header .back-link {
  margin-bottom: 0;
}

.browser-screen {
  flex: 1;
  min-height: 0;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

#vnc-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* === Page Header (title + action) === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header .page-title,
.page-header .section-title { margin-bottom: 0; }

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* === Create Agent Form === */
.create-form {
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.create-error:empty { display: none; }
.upload-error:empty { display: none; }
.upload-error {
  margin-top: 0.75rem;
}


.form-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.form-select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 2rem 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23757575' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 12px;
}
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.form-textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* === Dashboard === */
.dash-section { margin-bottom: 2rem; }
.dash-empty { font-size: 0.85rem; color: var(--text-dim); padding: 1rem 0; }

/* CTA banner */
.dash-cta {
  background: rgba(230, 57, 70, 0.06);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dash-cta-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}
.dash-cta-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 1rem;
  max-width: 400px;
  margin: 0 auto;
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.empty-state-icon {
  width: 3rem;
  height: 3rem;
  color: var(--text-dim);
  margin: 0 auto 1rem;
  display: block;
}
.empty-state-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}
.empty-state-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}
.empty-state-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Getting started checklist */
.dash-getting-started {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Header with progress */
.dash-gs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.dash-gs-header-text { flex: 1; }
.dash-gs-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.dash-gs-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.dash-gs-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.dash-gs-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 160px;
}
.dash-gs-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border);
}
.dash-gs-progress-fill {
  height: 100%;
  background: var(--cta-dark);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}
.dash-gs-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Steps – vertical timeline */
.dash-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-step {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 4.5rem;
}

/* Rail: indicator + connector line */
.dash-step-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2.5rem;
  flex-shrink: 0;
}
.dash-step-indicator {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text-dim);
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}
.dash-step-done .dash-step-indicator {
  background: var(--cta-dark);
  border-color: var(--cta-dark);
  color: #fff;
}
.dash-step-connector {
  flex: 1;
  width: 2px;
  background: var(--border);
  min-height: 1rem;
}
.dash-step-done .dash-step-connector {
  background: var(--cta-dark);
}
.dash-step:last-child .dash-step-connector {
  display: none;
}

/* Body: content + action */
.dash-step-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  padding: 0.15rem 0 0.15rem 1rem;
  margin-bottom: 0;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.dash-step:not(.dash-step-done) .dash-step-body:hover {
  background: var(--surface);
}
.dash-step-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}
.dash-step-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.dash-step-done .dash-step-title {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--text-dim);
}
.dash-step-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.dash-step-body .btn {
  flex-shrink: 0;
}

/* Dismiss button */
.dash-gs-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.dash-gs-dismiss:hover {
  color: var(--text-primary);
  background: var(--surface);
}

/* Responsive: stack header on small screens */
@media (max-width: 600px) {
  .dash-gs-header { flex-direction: column; gap: 1rem; }
  .dash-gs-progress { align-items: flex-start; min-width: unset; width: 100%; }
}

/* Quota bar */
.quota-bar-container { display: flex; align-items: center; gap: 1rem; }
.quota-bar { flex: 1; height: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.quota-bar-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; border-radius: var(--radius-pill); }
.quota-text { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; color: var(--text-muted); }

/* Dashboard card list */
.dash-list { display: flex; flex-direction: column; gap: 0.5rem; }
.dash-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); text-decoration: none; color: var(--text-primary); transition: border-color 0.2s, transform 0.15s; }
.dash-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.dash-card-text { flex: 1; font-size: 0.85rem; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dash-card-meta { font-size: 0.7rem; color: var(--text-dim); white-space: nowrap; }

/* Draft status badge (experiments — mirrors .status-pending) */
.status-draft { color: #9CA3AF; background: rgba(107, 114, 128, 0.12); }

/* === Project Health Dashboard === */

/* Project selector bar */
.dash-project-bar {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dash-project-bar .form-select {
  max-width: 280px;
  font-weight: 600;
}

/* Health strip */
.dash-health-strip {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}
.health-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 110px;
}
.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.health-healthy .health-dot { background: var(--cta); box-shadow: 0 0 6px var(--cta); }
.health-healthy { color: var(--cta-dark); }
.health-degraded .health-dot { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.health-degraded { color: #E6A700; }
.health-failing .health-dot { background: var(--error); box-shadow: 0 0 6px var(--error); }
.health-failing { color: var(--error); }
.health-low_coverage .health-dot { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.health-low_coverage { color: #E6A700; }
.health-unknown .health-dot { background: var(--text-dim); }
.health-unknown { color: var(--text-dim); }

.health-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.health-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.health-stat-value.risk-count {
  color: var(--warning);
}
.health-stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sparkline */
.sparkline {
  width: 80px;
  height: 24px;
  margin-top: 0.15rem;
}

/* Two-panel layout */
.dash-panels {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .dash-panels { grid-template-columns: 1fr; }
  .dash-health-strip { flex-wrap: wrap; gap: 1rem; }
}
.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.dash-panel .section-title { margin-bottom: 1rem; }

/* Runs table */
.dash-runs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.dash-runs-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.dash-runs-table td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.dash-runs-table tbody tr:last-child td { border-bottom: none; }
.dash-run-time { color: var(--text-dim); white-space: nowrap; font-size: 0.75rem; }
.dash-run-link { color: var(--text-primary); text-decoration: none; font-weight: 600; }
.dash-run-link:hover { color: var(--primary); }
.dash-run-steps { color: var(--text-dim); text-align: right; }

/* Coverage pages list */
.dash-pages-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-page-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.5rem;
  border-left: 3px solid var(--border);
}
.dash-page-passed  { border-left-color: var(--cta); }
.dash-page-failed  { border-left-color: var(--error); }
.dash-page-warning { border-left-color: var(--warning); }
.dash-page-never   { border-left-color: var(--text-dim); }

.dash-page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-passed  { background: var(--cta); }
.dot-failed  { background: var(--error); }
.dot-warning { background: var(--warning); }
.dot-never   { background: var(--text-dim); }

.dash-page-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-page-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-page-url {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-page-status {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* Risks */
.dash-risks { margin-bottom: 1.5rem; }
.dash-risks .section-title { margin-bottom: 0.75rem; }
.dash-risks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dash-risk-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.risk-failure { border-left: 3px solid var(--error); }
.risk-qa_issue { border-left: 3px solid var(--warning); }
.risk-coverage_gap { border-left: 3px solid var(--text-dim); }
.risk-flaky { border-left: 3px solid var(--info); }
.risk-stale { border-left: 3px solid var(--warning); }

.dash-risk-icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1.2;
}
.dash-risk-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.dash-risk-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}
.dash-risk-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-risk-link {
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  align-self: center;
}
.dash-risk-link:hover { text-decoration: underline; }

/* --- Dashboard: page meta (run counts, sparkline, flaky badge) --- */
.dash-page-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-page-runs {
  font-variant-numeric: tabular-nums;
}
.dash-page-flaky-badge {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--info);
  color: #fff;
}
.mini-sparkline {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  height: 12px;
}
.mini-spark-pass,
.mini-spark-fail {
  display: inline-block;
  width: 3px;
  height: 10px;
  border-radius: 1px;
}
.mini-spark-pass { background: var(--cta); }
.mini-spark-fail { background: var(--error); }

/* --- Dashboard: page action (Test button) --- */
.dash-page-action {
  flex-shrink: 0;
  margin: 0;
}

/* --- Dashboard: page groups (subpage folding) --- */
.dash-page-group { border-left: 3px solid var(--border); }
.dash-page-group.dash-page-passed  { border-left-color: var(--cta); }
.dash-page-group.dash-page-failed  { border-left-color: var(--error); }
.dash-page-group.dash-page-warning { border-left-color: var(--warning); }
.dash-page-group.dash-page-never   { border-left-color: var(--text-dim); }
.dash-page-group-summary { display:flex; align-items:center; gap:0.75rem; padding:0.5rem; cursor:pointer; list-style:none; }
.dash-page-group-summary::-webkit-details-marker { display:none; }
.dash-page-group-summary .dash-page-status { margin-left:auto; }
.dash-page-group-summary .dash-page-action { margin-left:0; }
.dash-page-group-count { font-size:0.7rem; color:var(--text-dim); white-space:nowrap; }
.dash-page-group-children { padding-left:1.25rem; }
.dash-page-group-children .dash-page-item { border-left-width:2px; padding-left:0.25rem; }

/* --- Dashboard: agent link on coverage pages --- */
.dash-page-agent-link { color:inherit; text-decoration:none; }
.dash-page-agent-link:hover { text-decoration:underline; color:var(--primary); }

/* --- Dashboard: Journeys section --- */
.dash-journeys { margin-bottom: 1.5rem; }
.dash-journeys-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.dash-journeys-header .section-title { margin-bottom: 0; }
.section-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 0.25rem;
}
.section-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
}
.section-link:hover { color: var(--primary); text-decoration: underline; }
.dash-journeys-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dash-journey-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.dash-journey-row:last-child { border-bottom: none; }
.dash-journey-overflow[style*="display: none"] { display: none; }
.dash-journey-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}
.dash-journey-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.dash-journey-name:hover {
  text-decoration: underline;
  color: var(--primary);
}
.dash-journey-importance {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  line-height: 1.3;
}
.importance-critical { background: rgba(230, 57, 70, 0.12); color: var(--primary); }
.importance-high     { background: rgba(255, 159, 67, 0.12); color: var(--secondary); }
.importance-medium   { background: rgba(68, 138, 255, 0.12); color: var(--info); }
.importance-low      { background: rgba(158, 158, 158, 0.12); color: var(--text-dim); }
.dash-journeys-toggle {
  display: block;
  width: 100%;
  padding: 0.4rem;
  margin-top: 0.25rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  text-align: center;
}
.dash-journeys-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-xs {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* === App Map Card Grid === */
.app-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.app-map-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-left-color: var(--text-dim);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.app-map-node:hover {
  border-color: var(--text-muted);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.app-map-node--blue  { border-left-color: var(--info); }
.app-map-node--olive { border-left-color: var(--cta); }
.app-map-node--amber { border-left-color: var(--warning); }
.app-map-node--red   { border-left-color: var(--error); }
.app-map-node--purple{ border-left-color: #7c3aed; }
.app-map-node--muted { border-left-color: var(--text-dim); }
.app-map-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.app-map-node-title { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.app-map-node-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}
.app-map-node-url { font-size: 0.8rem; color: var(--text-dim); word-break: break-all; }
.app-map-node-actions { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.app-map-action-tag {
  font-size: 0.7rem;
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.1rem 0.4rem;
  color: var(--primary);
}
.app-map-node-notes { font-size: 0.8rem; color: var(--text-dim); font-style: italic; }
.btn-dismiss {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  transition: color 0.15s, border-color 0.15s;
}
.btn-dismiss:hover {
  color: var(--error);
  border-color: var(--error);
}

.btn-inline-edit {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.1rem 0.25rem;
  transition: color 0.15s;
}
.btn-inline-edit:hover {
  color: var(--primary);
}

/* === App Map Graph === */
.appmap-container {
  position: relative;
  height: 80vh;
  min-height: 600px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 1.5rem;
}
.appmap-dashboard { height: 500px; min-height: unset; }
.appmap-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.appmap-svg {
  position: absolute;
  top: 0;
  left: 0;
}
.appmap-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  cursor: pointer;
  pointer-events: stroke;
}
.appmap-edge {
  fill: none;
  stroke: var(--edge-color);
  stroke-width: 1.5;
  pointer-events: none;
}
.appmap-arrow { fill: var(--edge-color); pointer-events: none; }
.appmap-edge-label-fo {
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.appmap-edge-label-fo.appmap-edge-label-visible { opacity: 1; }
.appmap-edge-label {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  box-shadow: var(--shadow-elevation);
}
.appmap-node {
  position: absolute;
  top: 0;
  left: 0;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: default;
  box-sizing: border-box;
  min-width: 240px;
  background: var(--surface);
  color: var(--text-primary);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.appmap-node:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.4); border-color: var(--primary); z-index: 100; }
.appmap-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}
.appmap-node-title {
  font-weight: 700;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.appmap-node-type {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid;
  padding: 0.05rem 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.appmap-node-url {
  font-size: 0.7rem;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appmap-node-actions {
  font-size: 0.65rem;
  color: var(--text-dim);
}
/* Collapse toggle */
.appmap-node-toggle {
  cursor: pointer;
  font-size: 0.6rem;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  user-select: none;
}
.appmap-node-toggle:hover { color: var(--text-primary); }
/* Collapsed summary badge */
.appmap-node-summary {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--surface-hover);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-top: 0.1rem;
}
.appmap-node-summary-errors { color: var(--error); font-weight: 700; }
.appmap-node-collapsed { border-style: solid; border-right-width: 4px; }
/* Tooltip */
.appmap-tooltip {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.6rem;
  min-width: 180px;
  max-width: 300px;
  z-index: 200;
  box-shadow: var(--shadow-elevation);
  font-size: 0.75rem;
}
.appmap-node:hover .appmap-tooltip { display: block; }
.appmap-tooltip-title { font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; }
.appmap-tooltip-title:not(:first-child) { margin-top: 0.4rem; }
.appmap-tooltip-item { color: var(--text-muted); padding-left: 0.4rem; }
/* Focus / dim */
.appmap-focus-active .appmap-node.appmap-dimmed { opacity: 0.2; }
.appmap-focus-active .appmap-edge.appmap-dimmed { stroke-opacity: 0.1; }
.appmap-focus-active .appmap-arrow.appmap-dimmed { fill-opacity: 0.1; }
.appmap-focus-active .appmap-edge.appmap-focused { stroke: var(--primary); stroke-width: 2.5; }
.appmap-focus-active .appmap-arrow.appmap-focused { fill: var(--primary); }
.appmap-metadata {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
}
.appmap-metadata-item strong { color: var(--text-primary); }
.appmap-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  display: flex;
  gap: 0.25rem;
}
.appmap-control-btn {
  width: 28px;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.appmap-control-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.appmap-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.9rem;
}
.appmap-loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 300px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.appmap-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: appmap-spin 0.8s linear infinite;
}
@keyframes appmap-spin { to { transform: rotate(360deg); } }
.appmap-live-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--cta-dark);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: appmap-pulse 2s ease-in-out infinite;
}
@keyframes appmap-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.appmap-progress-bar {
  position: relative;
  height: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
  overflow: hidden;
}
.appmap-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cta-dark), var(--cta));
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
}
.appmap-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  pointer-events: none;
}
.appmap-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.appmap-dashboard-header .section-title { margin: 0; }
.appmap-dashboard-link { font-size: 0.85rem; color: var(--primary); font-weight: 600; }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  margin: 1rem;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  font-family: inherit;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dim);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem;
}

.modal-body .form-group + .form-group {
  margin-top: 0.75rem;
}

.modal-card-wide {
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
}

.agent-report-btn {
  margin-top: 0.5rem;
  align-self: flex-start;
}

/* Markdown report styles */
.report-content {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.report-content h1,
.report-content h2,
.report-content h3,
.report-content h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
}

.report-content h1 { font-size: 1.4rem; }
.report-content h2 { font-size: 1.2rem; }
.report-content h3 { font-size: 1.05rem; }

.report-content p {
  margin-bottom: 0.75rem;
}

.report-content ul,
.report-content ol {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.report-content li {
  margin-bottom: 0.25rem;
}

.report-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.report-content code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--surface);
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
}

.report-content pre code {
  background: none;
  padding: 0;
}

.report-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.report-content th,
.report-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.report-content th {
  background: var(--surface);
  font-weight: 600;
}

.report-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
  color: var(--text-muted);
}

/* === Account Page === */
.account-section {
  margin-bottom: 2rem;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 600px;
}

.account-card-danger {
  border-color: rgba(255, 82, 82, 0.3);
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.account-muted {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.account-avatar-preview {
  margin-bottom: 1rem;
}

.account-avatar-img {
  object-fit: cover;
  border: 1px solid var(--border);
}

.account-avatar-large {
  width: 64px;
  height: 64px;
  min-width: 64px;
  font-size: 1.25rem;
}

/* === API Key Display === */
.api-key-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.api-key-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cta);
  word-break: break-all;
}

.copy-success {
  color: var(--cta);
}

/* === Integrations Page === */
.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 1.25rem;
}

.integration-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow: hidden;
}

.integration-card-disabled {
  opacity: 0.6;
}

.integration-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.integration-icon {
  flex-shrink: 0;
  color: var(--text);
}

.integration-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.integration-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.25rem 0 0;
}

.integration-card-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.integration-account {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

.integration-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0.25rem 0 0;
}

.integration-features {
  margin: 0.75rem 0 1.25rem;
}

.integration-features ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.integration-features li {
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.integration-docs-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
}

.integration-docs-link:hover {
  text-decoration: underline;
}

.integration-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

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

.integration-hint a:hover {
  text-decoration: underline;
}

.integration-sync-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--status-completed-bg, rgba(34, 197, 94, 0.1));
  border: 1px solid var(--status-completed-border, rgba(34, 197, 94, 0.25));
  border-radius: 6px;
  font-size: 0.8rem;
}

.sync-result-title {
  font-weight: 600;
  color: var(--text);
}

.sync-result-stat {
  color: var(--text-dim);
}

.sync-result-warn {
  color: var(--warning, #f59e0b);
}

.integration-sync-error {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px;
  font-size: 0.8rem;
}

.sync-error-title {
  font-weight: 600;
  color: var(--danger, #ef4444);
}

.sync-error-detail {
  color: var(--text-dim);
  word-break: break-word;
}

.integration-next-steps {
  margin-bottom: 0.75rem;
}

.integration-sync-form {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--surface-alt, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: 6px;
}

.integration-sync-form > .form-help:first-child {
  margin-bottom: 0.75rem;
}

.sync-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sync-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.sync-form-field .form-input-sm {
  min-width: 0;
  width: 100%;
}

/* Saved sync config summary */
.integration-sync-saved {
  margin-bottom: 0.75rem;
  padding: 1rem;
  background: var(--surface-alt, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: 6px;
}

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

.sync-saved-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sync-status-dot.sync-status-active {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.sync-status-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.sync-last-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.sync-saved-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}

.sync-saved-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sync-saved-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sync-saved-value {
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
}

.sync-saved-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.sync-config-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.sync-config-row:last-child {
  margin-bottom: 0;
}

.sync-add-config {
  margin-top: 1rem;
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0;
}

/* Support Setup page */
.setup-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.setup-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.setup-subheading {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.form-label-sm {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
}

.form-input-sm {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.form-input-sm:focus {
  outline: none;
  border-color: var(--accent);
}

/* === Pricing Page === */
.pricing-subtitle {
  text-align: center;
  margin-bottom: 1.5rem;
}

.pricing-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.pricing-toggle-group {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.pricing-toggle-btn {
  padding: 0.4rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pricing-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(230, 57, 70, 0.3);
}

.pricing-container {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
}

.pricing-card {
  flex: 1;
  min-width: 260px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevation);
  border-color: var(--primary-light);
}

.pricing-card-featured {
  border: 2px solid var(--primary);
  box-shadow: 0 0 24px rgba(230, 57, 70, 0.12);
  transform: scale(1.03);
}

.pricing-card-featured:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 0 30px rgba(230, 57, 70, 0.18), var(--shadow-elevation);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.85rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.pricing-plan-name {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.pricing-price {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.pricing-price-interval {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-description {
  text-align: center;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pricing-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: 1.25rem;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  width: 100%;
  font-size: 0.85rem;
}

.pricing-feature {
  padding: 0.3rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.pricing-feature-check {
  color: var(--cta);
  flex-shrink: 0;
}

.pricing-cta {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.pricing-cta .btn {
  width: 100%;
  text-align: center;
}

@media (max-width: 768px) {
  .pricing-container {
    flex-direction: column;
    align-items: center;
  }
  .pricing-card {
    max-width: 100%;
    width: 100%;
  }
  .pricing-card-featured {
    transform: none;
  }
  .pricing-card-featured:hover {
    transform: translateY(-4px);
  }
}

/* === Button Variants === */
.btn-danger {
  background: var(--error);
  color: #fff;
  box-shadow: none;
}

.btn-danger:hover:not(:disabled) {
  background: #E04545;
  box-shadow: 0 0 24px rgba(255, 82, 82, 0.25);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
}

.btn-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}
.btn-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-journey {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.btn-journey:hover {
  background: var(--primary);
  color: var(--bg);
}

/* === Success Text === */
.success-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cta);
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

/* === File Browser === */
.files-scopes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 800px;
}

.files-scope-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, transform 0.15s;
}

.files-scope-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.files-scope-label {
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.files-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.files-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}

.files-breadcrumb a:hover {
  color: var(--primary);
}

.files-breadcrumb-sep {
  color: var(--text-dim);
}

.files-entity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.files-entity-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, transform 0.15s;
}

.files-entity-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.files-entity-icon {
  min-width: 24px;
}

.files-entity-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.files-entity-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.files-entity-id {
  font-size: 0.7rem;
  color: var(--text-dim);
}

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

.files-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--primary);
  color: var(--text-dim);
  white-space: nowrap;
}

.files-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.files-table tr:hover {
  background: var(--surface-hover);
}

.files-icon-col {
  width: 32px;
}

.files-icon {
  width: 32px;
}

.files-menu-col {
  width: 40px;
}

.files-name-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.files-name-link:hover {
  color: var(--primary);
}

.files-size {
  color: var(--text-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.files-menu-btn {
  font-family: inherit;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.files-menu-btn:hover {
  color: var(--text-primary);
}

.files-context-menu {
  position: fixed;
  z-index: 800;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevation);
  min-width: 140px;
}

.files-ctx-btn {
  font-family: var(--font-display);
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.files-ctx-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.files-ctx-btn-danger {
  color: var(--error);
}

.files-ctx-btn-danger:hover {
  background: rgba(255, 82, 82, 0.08);
}

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

/* File Picker (modal) — reuses .files-table styles */
.fp {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  height: 500px;
  overflow: hidden;
}
.fp-breadcrumb {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.fp-breadcrumb button {
  appearance: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  font-family: inherit;
  line-height: inherit;
  text-decoration: none;
}
.fp-breadcrumb button:hover {
  color: var(--primary);
  text-decoration: underline;
}
.fp-breadcrumb > span {
  color: var(--text-primary);
  font-weight: 600;
}
.fp-breadcrumb-sep {
  color: var(--text-dim);
}
.fp-table-wrap {
  flex: 1;
  overflow-y: auto;
}
.fp-table td:first-child {
  width: 20px;
  padding-left: 0.5rem;
  padding-right: 0.75rem;
}
.fp-table .files-icon {
  width: 24px;
  padding-left: 0;
  padding-right: 0.25rem;
}
.fp-row--selected {
  background: rgba(230, 57, 70, 0.06);
}
.fp-row--selected:hover {
  background: rgba(230, 57, 70, 0.10);
}
.fp-row-back td {
  color: var(--text-muted);
}
.fp-check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.fp-row--selected .fp-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.fp-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.fp-upload {
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  flex-shrink: 0;
}
.fp-upload-zone {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.fp-upload-text strong {
  color: var(--primary);
}
.fp-upload-zone:hover,
.fp-upload-zone--drag {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(230, 57, 70, 0.04);
}

@media (max-width: 768px) {
  .files-scopes {
    grid-template-columns: 1fr;
  }
}

/* === Docs === */
.docs-layout {
  display: flex;
  min-height: 100vh;
}

.docs-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.docs-sidebar.docs-sidebar-hidden {
  margin-left: -260px;
}

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

.docs-logo {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.docs-logo:hover {
  color: var(--primary);
}

.docs-sidebar-close {
  font-family: inherit;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dim);
  line-height: 1;
  display: none;
}

.docs-sidebar-title {
  padding: 1rem 1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.docs-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0;
  overflow-y: auto;
}

.docs-nav a {
  display: block;
  padding: 0.45rem 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.docs-nav a:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.docs-nav a.active {
  color: var(--text-primary);
  border-left-color: var(--primary);
}

.docs-sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.docs-signin-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
}

.docs-signin-link:hover {
  color: var(--primary);
}

.docs-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-width: 900px;
}

.docs-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  cursor: pointer;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

/* Docs page elements */
.docs-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.docs-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 700px;
}

.docs-intro code {
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--primary);
}

.docs-section-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Cards */
.docs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.docs-auth-card {
  border-color: rgba(230, 57, 70, 0.3);
}

.docs-card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.docs-card-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.docs-card-text code {
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--primary);
}

.docs-card-text a {
  color: var(--primary);
  font-weight: 600;
}

/* Section cards grid */
.docs-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.docs-section-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, transform 0.15s;
}

.docs-section-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.docs-section-card-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
}

.docs-section-card-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docs-section-card-count {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}

/* API key input card */
.docs-apikey-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.docs-apikey-card .form-input {
  width: 100%;
  margin-top: 0.25rem;
}

.docs-apikey-card .form-hint a {
  color: var(--primary);
  font-weight: 600;
}

/* Endpoint section */
.docs-endpoint {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
  scroll-margin-top: 1rem;
}

.docs-endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0 0.75rem;
  flex-wrap: wrap;
}

.docs-method-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border: none;
  border-radius: var(--radius-pill);
  min-width: 55px;
  text-align: center;
}

.docs-method-get {
  color: #448AFF;
  background: rgba(68, 138, 255, 0.12);
}

.docs-method-post {
  color: #00E676;
  background: rgba(0, 230, 118, 0.12);
}

.docs-method-patch {
  color: #FFAB00;
  background: rgba(255, 171, 0, 0.12);
}

.docs-method-delete {
  color: #FF5252;
  background: rgba(255, 82, 82, 0.12);
}

.docs-method-tool {
  color: #B388FF;
  background: rgba(179, 136, 255, 0.12);
}

.docs-method-resource {
  color: #64FFDA;
  background: rgba(100, 255, 218, 0.12);
}

.docs-method-prompt {
  color: #FF80AB;
  background: rgba(255, 128, 171, 0.12);
}

.docs-endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.docs-endpoint-summary {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.docs-endpoint-desc {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Params table */
.docs-params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.docs-params-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--primary);
  color: var(--text-dim);
  white-space: nowrap;
}

.docs-params-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}

.docs-params-table code {
  font-size: 0.8rem;
  font-weight: 600;
}

.docs-param-default {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Section subheadings */
.docs-section-subheading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 1.25rem 0 0.5rem;
}

/* Status codes table */
.docs-status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.docs-status-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--primary);
  color: var(--text-dim);
  white-space: nowrap;
}

.docs-status-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
}

.docs-status-table code {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Response example block */
.docs-response-example {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  overflow-x: auto;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.docs-response-example code {
  font-size: inherit;
  color: inherit;
  background: none;
  padding: 0;
}

/* cURL preview */
.docs-curl-container {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0;
  overflow: hidden;
}

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

.docs-curl-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.docs-copy-btn {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.docs-copy-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.docs-llm-card {
  border-color: var(--border);
  margin-top: 1.5rem;
}

.docs-llm-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.docs-llm-copy-btn {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--cta) !important;
  color: var(--cta-text) !important;
  border: none !important;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.15s, transform 0.15s;
  box-shadow: 0 0 24px var(--cta-glow);
}

.docs-llm-copy-btn:hover {
  box-shadow: 0 0 40px var(--cta-glow-strong) !important;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .docs-llm-card-body {
    flex-direction: column;
    align-items: stretch;
  }
  .docs-llm-copy-btn {
    text-align: center;
  }
}

.docs-curl-text {
  padding: 0.75rem;
  color: var(--cta);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  margin: 0;
}

/* Try-it panel */
.docs-tryit-toggle {
  font-family: var(--font-display);
  display: block;
  width: 100%;
  padding: 0.5rem 0;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
}

.docs-tryit-toggle:hover {
  background: var(--surface-hover);
}

.docs-tryit-panel {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.docs-tryit-panel .form-input-sm {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.docs-required {
  color: #dc2626;
}

.docs-execute-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Response display */
.docs-response-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.docs-response-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.docs-response-status {
  font-size: 0.8rem;
  font-weight: 700;
}

.docs-response-body {
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 0.75rem;
  margin-top: 0.25rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* In-page TOC */
.docs-toc {
  margin-bottom: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.docs-toc-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.docs-toc-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.docs-toc-link:hover {
  color: var(--primary);
}

.docs-toc-link code {
  font-size: 0.8rem;
  font-weight: 600;
}

.docs-toc-summary {
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* Small method badge (TOC + sidebar) */
.docs-method-badge-sm {
  font-size: 0.55rem;
  padding: 0.1rem 0.3rem;
  min-width: 40px;
}

/* Sidebar endpoint links — use .docs-nav a prefix to override .docs-nav a base styles */
.docs-nav a.docs-nav-endpoint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 1rem 0.25rem 2rem;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-nav a.docs-nav-endpoint:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.docs-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0;
}

/* Getting started option cards */
.docs-getting-started-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}

@media (max-width: 600px) {
  .docs-getting-started-grid { grid-template-columns: 1fr; }
}

.docs-getting-started-card {
  display: block;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.docs-getting-started-card:hover {
  border-color: var(--primary);
}

.docs-getting-started-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.docs-getting-started-card-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}

.docs-getting-started-card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
}

/* Tool selector pills */
.docs-tool-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.docs-tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.docs-tool-pill:hover {
  color: var(--text-primary);
  border-color: var(--text-dim);
}

.docs-tool-pill.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.docs-tool-pill svg {
  flex-shrink: 0;
}

.docs-mcp-group-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin: 1.5rem 0 0.5rem;
  padding: 0;
}

/* Doc link (creation pages) */
.docs-link {
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.docs-link:hover {
  text-decoration: underline;
}

/* Section notes */
.docs-notes {
  margin-bottom: 1.5rem;
}

.docs-notes-heading {
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  scroll-margin-top: 1rem;
}

.docs-notes-subheading {
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}

.docs-notes-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.5rem;
  max-width: 700px;
}

.docs-notes-text code {
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--primary);
}

.docs-notes-text em {
  color: var(--text-dim);
}

.docs-notes-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.docs-notes-list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 3px solid var(--primary);
  margin-bottom: 0.25rem;
}

.docs-notes-list li code {
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--primary);
}

/* CI/CD flow diagram */
.docs-flow-diagram {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface-alt, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

.docs-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 120px;
  text-align: center;
}

.docs-flow-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.docs-flow-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.docs-flow-detail {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.3;
}

.docs-flow-arrow {
  font-size: 1.2rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .docs-flow-diagram { flex-direction: column; }
  .docs-flow-arrow { transform: rotate(90deg); }
}

.docs-notes-code {
  margin: 0.5rem 0;
}

.docs-notes-code pre {
  background: var(--bg);
  color: var(--cta);
  font-family: var(--font-mono);
  padding: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.docs-field-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85rem;
}

.docs-field-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
}

.docs-field-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
  line-height: 1.5;
}

.docs-field-table td:first-child {
  white-space: nowrap;
  width: 160px;
}

.docs-field-table code {
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Changelog */
.changelog-version {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--cta);
}

.changelog-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 0.75rem;
}

.changelog-entries {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.changelog-entry {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1.5;
}

.changelog-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.changelog-tag-new {
  background: var(--cta);
  color: white;
}

.changelog-tag-improved {
  background: #3b82f6;
  color: white;
}

.changelog-tag-fixed {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.changelog-entry-content {
  color: var(--text);
  font-size: 0.9rem;
}

.changelog-entry-body {
  color: var(--text-muted);
}

/* Mobile */
@media (max-width: 768px) {
  .docs-sidebar {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .docs-sidebar.docs-sidebar-hidden {
    margin-left: -260px;
  }

  .docs-sidebar-close {
    display: block;
  }

  .docs-mobile-toggle {
    display: block;
  }

  .docs-content {
    max-width: 100%;
  }

  .docs-endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* === Error Page === */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  gap: 1rem;
}

.error-code {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.error-message {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
}

.error-detail {
  font-size: 0.85rem;
  color: var(--text-dim);
  max-width: 400px;
}

/* === Code Block === */
.code-block {
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-mono);
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* === Workspace Banner === */
.workspace-banner {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.workspace-banner a {
  color: var(--cta);
  text-decoration: underline;
}

/* === Clarification Banner === */
.clarification-banner {
  background: rgba(255, 171, 0, 0.08);
  border: 1px solid rgba(255, 171, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.clarification-banner h3 {
  color: var(--warning);
}
.clarification-banner h3 {
  margin: 0;
  font-size: 0.95rem;
}
.clarification-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.clarification-icon {
  font-size: 1.1rem;
}
.clarification-question {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
}

/* === Issue loading bar === */
.issue-loading-bar {
  position: relative;
  height: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.issue-loading-bar-fill {
  position: absolute;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--cta-dark), var(--cta));
  border-radius: var(--radius-pill);
  animation: issue-loading-slide 1.2s ease-in-out infinite;
}
@keyframes issue-loading-slide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* === Regression Runs (Support) === */
.reg-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.reg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 80px;
}
.reg-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
}
.reg-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.reg-passed { color: var(--cta-dark); }
.reg-failed { color: var(--error); }

.reg-runs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.reg-run {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.reg-run-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  background: var(--surface);
  transition: background 0.15s;
}
.reg-run-header:hover {
  background: var(--surface-hover);
}
.reg-run-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.reg-run-time {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
.reg-run-repo {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reg-run-version {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--cta-dark);
  background: rgba(0, 200, 83, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.reg-run-id {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.reg-run-stats {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.reg-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.reg-total {
  background: var(--surface-hover);
  color: var(--text-muted);
}
.reg-pass {
  background: rgba(0, 200, 83, 0.12);
  color: var(--cta-dark);
}
.reg-fail {
  background: rgba(255, 82, 82, 0.12);
  color: var(--error);
}
.reg-running {
  background: rgba(68, 138, 255, 0.12);
  color: var(--info);
}
.reg-run-chevron {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.reg-run-chevron.reg-open {
  transform: rotate(90deg);
}

.reg-run-agents {
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.reg-agent {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}
.reg-agent:hover {
  background: var(--surface);
}
.reg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-passed  { background: var(--cta-dark); }
.dot-failed  { background: var(--error); }
.dot-error   { background: var(--warning); }
.dot-running { background: var(--info); }
.reg-agent-name {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reg-agent-name:hover {
  color: var(--primary);
  text-decoration: underline;
}
.reg-agent-status {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.reg-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1rem 0;
}
.reg-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}
.reg-page-btn:hover {
  background: var(--surface-hover);
  border-color: var(--text-dim);
}
.reg-page-info {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* === Journey Health Board === */
.health-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.health-page-header h1 { font-size: 1.5rem; font-weight: 700; }
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.health-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  transition: all 0.15s;
  font-family: var(--font-display);
  text-decoration: none;
}
.health-btn:hover { border-color: var(--text-primary); }
.health-btn-primary {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
}
.health-btn-primary:hover { opacity: 0.9; color: white; }

/* Hero health strip */
.health-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.health-hero.hero-degraded {
  border-color: rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--surface) 40%);
}
.health-hero.hero-broken {
  border-color: rgba(230, 57, 70, 0.2);
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.06) 0%, var(--surface) 40%);
}
.health-hero-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 1;
  min-width: 0;
}
.health-icon { width: 48px; height: 48px; flex-shrink: 0; }
.health-headline h2 { font-size: 1.25rem; font-weight: 700; }
.health-headline p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.health-stats {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}
.health-stat { text-align: center; }
.health-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.health-stat-label {
  font-size: 0.6875rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.125rem;
}
.health-stat-value.green { color: var(--cta-dark); }
.health-stat-value.amber { color: var(--warning); }
.health-stat-value.red { color: var(--primary); }

/* Alert banners */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
}
.alert-banner.alert-amber {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #92400e;
}
.alert-banner.alert-red {
  background: rgba(230, 57, 70, 0.06);
  border: 1px solid rgba(230, 57, 70, 0.2);
  color: #991b1b;
}
.alert-banner.alert-blue {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #1e40af;
}
.alert-banner.alert-green {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #166534;
}
.alert-banner svg { flex-shrink: 0; }
.alert-banner .alert-action {
  margin-left: auto;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  flex-shrink: 0;
}
.alert-banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}
.alert-dismiss {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 0.25rem;
  flex-shrink: 0;
}
.alert-dismiss:hover { opacity: 1; }

/* Searchable select dropdown */
.searchable-select {
  position: relative;
}
.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-top: 2px;
}
.searchable-select-option {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  cursor: pointer;
}
.searchable-select-option:hover { background: var(--bg-secondary, #f8fafc); }
.searchable-select-option.selected { background: var(--bg-secondary, #f1f5f9); font-weight: 600; }
/* Bulk actions bar */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 6px);
  font-size: 0.8125rem;
}
.bulk-count { font-weight: 600; }

.searchable-select-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary, #94a3b8);
}

/* Section headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
  margin-top: 0.5rem;
}
.section-header h3 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.section-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}
.section-badge.critical { background: rgba(230, 57, 70, 0.06); color: var(--primary); border: 1px solid rgba(230, 57, 70, 0.2); }
.section-badge.important { background: rgba(245, 158, 11, 0.08); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.section-badge.other { background: rgba(68, 138, 255, 0.08); color: var(--info); border: 1px solid rgba(68, 138, 255, 0.2); }
.section-line { flex: 1; height: 1px; background: var(--border); }

/* Journey cards */
.journey-grid { display: grid; gap: 0.75rem; margin-bottom: 1.75rem; }
.journey-grid.critical-grid { grid-template-columns: 1fr; }
.journey-grid.other-grid { grid-template-columns: 1fr 1fr; }

.journey-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
  display: block;
}
.journey-card:hover {
  border-color: var(--text-dim);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.journey-card.critical-card { border-left: 3px solid var(--cta-dark); }
.journey-card.critical-card.card-failing {
  border-left-color: var(--primary);
  background: linear-gradient(90deg, rgba(230, 57, 70, 0.06) 0%, var(--surface) 8%);
}
.journey-card.critical-card.card-flaky { border-left-color: var(--warning); }

.journey-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.journey-card-title { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.journey-card-title h4 { font-size: 0.9375rem; font-weight: 600; }
.journey-card-actions { display: flex; align-items: center; gap: 0.5rem; }

.journey-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
}
.journey-status.passing { background: rgba(0, 200, 83, 0.08); color: var(--cta-dark); }
.journey-status.failing { background: rgba(230, 57, 70, 0.06); color: var(--primary); }
.journey-status.flaky { background: rgba(245, 158, 11, 0.08); color: var(--warning); }
.journey-status.running { background: rgba(68, 138, 255, 0.08); color: var(--info); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.passing .status-dot { background: var(--cta-dark); }
.failing .status-dot { background: var(--primary); }
.flaky .status-dot { background: var(--warning); }
.running .status-dot { background: var(--info); animation: pulse-running 1.5s ease-in-out infinite; }

.journey-card-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.journey-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* Heatmap */
.heatmap { display: flex; gap: 3px; align-items: center; }
.heatmap-cell {
  width: 18px; height: 18px; border-radius: 3px;
  transition: transform 0.1s;
}
.heatmap-cell.pass { background: var(--cta-dark); opacity: 0.8; }
.heatmap-cell.fail { background: var(--primary); opacity: 0.8; }
.heatmap-cell.running { background: var(--info); opacity: 0.8; animation: pulse-running 1.5s ease-in-out infinite; }
.heatmap-cell.skip { background: var(--border); }
.heatmap-cell:hover { opacity: 1; transform: scale(1.15); }
.heatmap-cell.latest { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor; }
.heatmap-cell.latest.pass { color: var(--cta-dark); }
.heatmap-cell.latest.fail { color: var(--primary); }
.heatmap-cell.latest.running { color: var(--info); }
@keyframes pulse-running { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
a.heatmap-cell { display: block; text-decoration: none; }
.heatmap-label {
  font-size: 0.6875rem; color: var(--text-dim);
  margin-left: 0.5rem; font-family: var(--font-mono);
}

/* Badges */
.checkpoint-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.6875rem; font-weight: 600;
  padding: 0.2rem 0.5rem; border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.08); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.2);
}
.checkpoint-badge.cp-warning { background: rgba(245, 158, 11, 0.08); color: var(--warning); border-color: rgba(245, 158, 11, 0.2); }
.checkpoint-badge.cp-fail { background: rgba(230, 57, 70, 0.06); color: var(--primary); border-color: rgba(230, 57, 70, 0.2); }
.regression-tag {
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.125rem 0.375rem; border-radius: 3px;
  background: var(--primary); color: white;
}
.version-pill {
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  background: rgba(68, 138, 255, 0.08); color: var(--info); border: 1px solid rgba(68, 138, 255, 0.2);
}

/* Failure reason */
.failure-reason {
  font-size: 0.75rem; color: var(--primary);
  background: rgba(230, 57, 70, 0.06); padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm); border: 1px solid rgba(230, 57, 70, 0.2);
  margin-top: 0.625rem;
  display: flex; align-items: flex-start; gap: 0.5rem; line-height: 1.4;
  flex-wrap: wrap;
}
.failure-reason > div { flex: 1; min-width: 0; }
.failure-reason strong { font-weight: 700; }

/* Interactive card elements */
.journey-card-name-link {
  text-decoration: none; color: inherit;
}
.journey-card-name-link:hover h4 { text-decoration: underline; }

.card-action-btns {
  display: flex; align-items: center; gap: 0.375rem;
}

.health-btn-sm {
  font-size: 0.6875rem; font-weight: 600; font-family: inherit;
  padding: 0.2rem 0.5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.25rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-decoration: none; line-height: 1.4;
}
.health-btn-sm:hover { border-color: var(--text-dim); color: var(--text); }
.health-btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }
.health-btn-sm-icon { padding: 0.3rem 0.4rem; line-height: 0; }

.health-btn-run {
  border-color: rgba(0, 200, 83, 0.3); color: var(--cta-dark);
}
.health-btn-run:hover { border-color: var(--cta-dark); background: rgba(0, 200, 83, 0.06); }

.health-btn-queued {
  border-color: rgba(37, 99, 235, 0.3); color: #2563eb;
}
.health-btn-queued:hover { border-color: #2563eb; background: rgba(37, 99, 235, 0.06); }

.failure-investigate-link {
  font-size: 0.6875rem; font-weight: 600; color: var(--primary);
  text-decoration: none; white-space: nowrap; margin-left: auto;
}
.failure-investigate-link:hover { text-decoration: underline; }

.run-all-result {
  font-size: 0.8125rem; font-weight: 600; color: var(--cta-dark);
  display: inline-flex; align-items: center;
}
.run-all-result a { color: var(--cta-dark); font-weight: 500; }

.stale-warning {
  font-size: 0.75rem; color: var(--warning);
  display: flex; align-items: center; gap: 0.3rem;
}

/* Trend chart */
.trend-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
}
.trend-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.trend-header h3 { font-size: 0.875rem; font-weight: 600; }
.trend-period { display: flex; gap: 0.25rem; }
.trend-period button {
  font-size: 0.6875rem; padding: 0.2rem 0.625rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 500; color: var(--text-muted); font-family: var(--font-display);
}
.trend-period button.active { background: var(--text-primary); color: white; border-color: var(--text-primary); }
.trend-chart { height: 100px; display: flex; align-items: flex-end; gap: 4px; padding: 1rem 0.25rem 0; }
.trend-bar {
  flex: 1; border-radius: 3px 3px 0 0; position: relative;
  min-height: 4px; transition: opacity 0.15s;
}
.trend-bar:hover { opacity: 0.8; }
.trend-bar .trend-tooltip {
  display: none; position: absolute; bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%); background: var(--text-primary);
  color: white; font-size: 0.625rem; padding: 0.25rem 0.5rem;
  border-radius: 4px; white-space: nowrap; font-family: var(--font-mono); z-index: 10;
}
.trend-bar:hover .trend-tooltip { display: block; }
.trend-bar-empty {
  background: var(--border); height: 3px !important; min-height: 3px; border-radius: 1px;
  align-self: flex-end;
}
.trend-pct {
  position: absolute; top: -1.1rem; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; font-family: var(--font-mono); color: var(--text-dim);
  white-space: nowrap;
}
.trend-labels {
  display: flex; justify-content: space-between; margin-top: 0.5rem;
  font-size: 0.625rem; color: var(--text-dim); font-family: var(--font-mono);
}

/* Add journey CTA */
.add-journey-cta {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 1.5rem; text-align: center; color: var(--text-dim);
  cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.add-journey-cta:hover { border-color: var(--info); color: var(--info); background: rgba(68, 138, 255, 0.08); }
.add-journey-cta .cta-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.add-journey-cta p { font-size: 0.8125rem; font-weight: 500; }

@media (max-width: 768px) {
  .health-hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .health-stats { margin-left: 0; }
  .journey-grid.other-grid { grid-template-columns: 1fr; }
  .health-page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

/* === Guided Journey Creation === */
.guided-form {
  max-width: 640px;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.guided-examples {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.guided-example-card {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.guided-example-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(230, 57, 70, 0.05);
}

.guided-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 1rem;
}
.guided-preview-steps {
  display: flex; flex-direction: column; gap: 0.5rem;
}
.guided-preview-step {
  display: flex; align-items: center; gap: 0.5rem;
}
.guided-preview-step-num {
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  min-width: 1.25rem; text-align: center;
}
.guided-preview-step .form-input {
  flex: 1;
}
.guided-preview-prompt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  color: var(--text-muted);
}

/* === Vidstack / video player overrides === */
media-player.agent-video-player {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  --plyr-color-main: var(--primary);
  --plyr-video-background: #000;
  --plyr-menu-background: var(--bg-card);
  --plyr-menu-color: var(--text);
}
.agent-video { display: flex; flex-direction: column; gap: 0.25rem; }

/* Skip-idle button (inside Vidstack control bar) */
.skip-idle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 8px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  width: auto;
}
.skip-idle-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.skip-idle-btn.active { color: #fff; }
.skip-idle-btn.active .skip-idle-icon { opacity: 1; }
.skip-idle-btn:not(.active) .skip-idle-icon { opacity: 0.4; }
.skip-idle-icon { font-size: 0.85rem; line-height: 1; }
.skip-idle-label { font-weight: 500; letter-spacing: 0.02em; }

/* Skip-idle toast notification */
.skip-idle-toast {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 50;
}
.skip-idle-toast.visible { opacity: 1; }

/* Video processing indicator */
.agent-video-processing { display: flex; flex-direction: column; gap: 0.5rem; }
.progress-bar-infinite {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-infinite::after {
  content: '';
  display: block;
  height: 100%;
  width: 30%;
  background: var(--primary);
  border-radius: 2px;
  animation: progress-slide 1.5s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* === Chat Panel === */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  height: calc(100vh - 180px); /* Scale with viewport, leave room for sidebar header + project bar */
  max-height: 800px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-body);
}
.chat-header-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.chat-reset-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.chat-reset-btn:hover { color: var(--danger); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-msg {
  max-width: 85%;
  animation: chatFadeIn 0.2s ease;
}
@keyframes chatFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.chat-msg-user {
  align-self: flex-end;
}
.chat-msg-user .chat-msg-content {
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}
.chat-msg-assistant {
  align-self: flex-start;
}
.chat-msg-assistant .chat-msg-content {
  background: var(--bg-body);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  font-size: 0.875rem;
  line-height: 1.6;
  border: 1px solid var(--border);
  overflow-wrap: break-word;
  word-break: break-word;
}
.chat-msg-assistant .chat-msg-content ol,
.chat-msg-assistant .chat-msg-content ul {
  padding-left: 1.5rem;
  margin: 0.25rem 0;
}
.chat-msg-assistant .chat-msg-content p { margin: 0 0 0.5rem; }
.chat-msg-assistant .chat-msg-content p:last-child { margin-bottom: 0; }
.chat-msg-assistant .chat-msg-content code {
  background: rgba(0,0,0,0.06);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.8rem;
}
.chat-msg-assistant .chat-msg-content pre {
  background: var(--bg-code, #1e1e1e);
  color: var(--text-code, #d4d4d4);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.8rem;
  margin: 0.5rem 0;
}
.chat-msg-assistant .chat-msg-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 0.5rem 0;
}
.chat-msg-assistant .chat-msg-content th,
.chat-msg-assistant .chat-msg-content td {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  text-align: left;
}
.chat-msg-assistant .chat-msg-content th { background: var(--bg-body); font-weight: 600; }

.chat-tool-indicator {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.chat-tool-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 100px;
  background: var(--bg-body);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 0.5rem 0.75rem;
}
.chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chatBounce 1.2s infinite ease-in-out;
}
.chat-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-input-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-body);
}
.chat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--primary); }
.chat-input:disabled { opacity: 0.6; }

.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.chat-send-btn:hover { opacity: 0.9; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Message segments (activity log) */
.chat-seg-text { }
.chat-seg-text:not(:first-child) { margin-top: 0.5rem; }
.chat-seg-tool {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  margin: 0.4rem 0;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
}
.chat-seg-tool-icon { font-size: 0.7rem; }
.chat-seg-tool-name { font-family: var(--font-mono); }
.chat-seg-tool-ok { color: var(--success, #22c55e); }
.chat-seg-tool-spin { animation: chatBounce 1.2s infinite; }

/* Rich response cards */
.chat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  margin: 0.4rem 0;
  font-size: 0.8rem;
}
.chat-card-header {
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}
.chat-card-row {
  padding: 0.15rem 0;
  color: var(--text-primary);
}
.chat-card-row a { color: var(--primary); text-decoration: none; }
.chat-card-row a:hover { text-decoration: underline; }
.chat-card-muted { color: var(--text-muted); font-size: 0.75rem; }
.chat-card-choices { background: transparent; border: none; padding: 0; }
.chat-choices { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.chat-choice-btn {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 100px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chat-choice-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Conversation list + new chat */
.chat-new-btn, .chat-conv-list-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.chat-new-btn:hover { color: var(--primary); }
.chat-conv-list-btn:hover { color: var(--text-primary); }
.chat-conv-list {
  border-bottom: 1px solid var(--border);
  background: var(--bg-body);
  max-height: 200px;
  overflow-y: auto;
}
.chat-conv-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.1s;
}
.chat-conv-item:hover { background: var(--bg-card); }
.chat-conv-title {
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}
.chat-conv-date {
  color: var(--text-muted);
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* Suggestion chips */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-body);
  flex-shrink: 0;
}
.chat-suggestion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  line-height: 1.4;
}
.chat-suggestion:hover {
  border-color: var(--primary);
  background: var(--bg-body);
}

/* Compact mode (collapsible, used when health board is visible) */
.chat-panel-compact { height: auto; min-height: 0; margin-bottom: 1.5rem; }
.chat-panel-compact .chat-messages { max-height: 300px; }
.chat-panel-collapsed { height: auto !important; min-height: 0 !important; }
.chat-chevron { transition: transform 0.2s; }
.chat-chevron-open { transform: rotate(180deg); }

/* === Chat Sidebar (right panel, all non-dashboard pages) === */
.chat-sidebar {
  width: 380px;
  min-width: 380px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  transition: width 0.15s, min-width 0.15s;
}
.chat-sidebar-closed {
  width: 44px;
  min-width: 44px;
}
.chat-sidebar-closed-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.chat-sidebar-closed-strip:hover { color: var(--primary); background: var(--bg-body); }
.chat-sidebar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-width: 0; /* prevent flex overflow */
}
.chat-sidebar-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}
.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-body);
  flex-shrink: 0;
}
.chat-sidebar-title {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
}
.chat-sidebar-panel .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chat-sidebar-panel .chat-msg { max-width: 100%; }
.chat-sidebar-panel .chat-msg-content {
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}
/* Tables in sidebar: horizontal scroll instead of column crush */
.chat-sidebar-panel .chat-msg-content table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 0.75rem;
}
.chat-sidebar-panel .chat-msg-content th,
.chat-sidebar-panel .chat-msg-content td {
  padding: 0.25rem 0.5rem;
}
.chat-sidebar-panel .chat-msg-content pre {
  overflow-x: auto;
  font-size: 0.75rem;
}
.chat-sidebar-panel .chat-msg-content h1 { font-size: 1rem; }
.chat-sidebar-panel .chat-msg-content h2 { font-size: 0.9rem; }
.chat-sidebar-panel .chat-msg-content h3 { font-size: 0.85rem; }
.chat-sidebar-panel .chat-input-form {
  padding: 0.5rem 0.75rem;
  flex-shrink: 0;
}
.chat-sidebar-panel .chat-input {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
}
.chat-sidebar-panel .chat-suggestion {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}
.chat-sidebar-panel .chat-seg-tool {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

@media (max-width: 1024px) {
  .chat-sidebar { display: none; }
}

/* === Chat Dashboard (full viewport) === */
.chat-dashboard {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  max-width: 800px;
  margin: 0 auto;
}
.chat-dashboard .chat-panel {
  flex: 1;
  height: auto;
  max-height: none;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.chat-dashboard .chat-header {
  border-bottom: none;
  background: transparent;
  padding: 0.5rem 0;
}
.chat-dashboard .chat-header .chat-header-title { display: none; }
.chat-dashboard .chat-messages { max-height: none; }
.chat-dashboard .chat-input-form {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 1rem;
}
.chat-dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}
.chat-dash-project {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.chat-dash-select {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.chat-dash-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.chat-dash-link:hover { color: var(--primary); }

/* === Alpine cloak === */
[x-cloak] {
  display: none !important;
}
