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

:root {
  --navy: #0b1f3a;
  --navy-2: #112447;
  --navy-3: #1a3260;
  --gold: #b8972a;
  --gold-light: #d4ad3a;
  --gold-dim: rgba(184, 151, 42, 0.12);
  --gold-border: rgba(184, 151, 42, 0.3);
  --bg: #f0f2f7;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef0f5;
  --border: #dde1ea;
  --border-2: #c8cdd9;
  --text-primary: #0b1f3a;
  --text-secondary: #4a5568;
  --text-muted: #8c95a8;
  --accent: #1a56c8;
  --accent-dim: rgba(26, 86, 200, 0.07);
  --accent-border: rgba(26, 86, 200, 0.2);
  --green: #047857;
  --green-dim: rgba(4, 120, 87, 0.08);
  --amber: #b45309;
  --amber-dim: rgba(180, 83, 9, 0.08);
  --red: #b91c1c;
  --red-dim: rgba(185, 28, 28, 0.07);
  --purple: #5b21b6;
  --purple-dim: rgba(91, 33, 182, 0.08);
  --sidebar-w: 200px;
  --radius: 12px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 3px rgba(11,31,58,0.06), 0 1px 2px rgba(11,31,58,0.04);
  --shadow-md: 0 4px 16px rgba(11,31,58,0.08), 0 1px 4px rgba(11,31,58,0.04);
}

body {
  font-family: 'DM Sans', 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 15.5px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light);
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.sidebar-nav { padding: 8px 16px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.nav-item.active {
  background: rgba(184,151,42,0.13);
  color: var(--gold-light);
  border-color: rgba(184,151,42,0.25);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 12px 16px;
}

.sidebar-footer {
  padding: 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.version-badge {
  display: inline-block;
  padding: 3px 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: 10.5px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sidebar-note { font-size: 11px; color: rgba(255,255,255,0.3); line-height: 1.6; }

/* ── Main ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 0;
  max-width: calc(100vw - var(--sidebar-w));
  display: flex;
  flex-direction: column;
}

/* ── Top Bar ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-left { display: flex; flex-direction: column; }
.topbar-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.topbar-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.header-badge {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #0b1f3a 0%, #1a3260 100%);
  border: 1px solid rgba(184,151,42,0.35);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-light);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(11,31,58,0.18);
}
.ai-dot {
  width: 8px; height: 8px;
  background: var(--gold-light);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
  box-shadow: 0 0 6px rgba(212,173,58,0.7);
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(212,173,58,0.7); }
  50% { opacity: 0.5; box-shadow: 0 0 12px rgba(212,173,58,0.4); }
}

/* ── AI Hero Banner ── */
.ai-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3260 60%, #0f2a52 100%);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(11,31,58,0.18);
}
.ai-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(184,151,42,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.ai-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 30%;
  width: 300px; height: 200px;
  background: radial-gradient(circle, rgba(26,86,200,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.ai-hero-left { position: relative; z-index: 1; }
.ai-hero-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.ai-hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.3;
  margin-bottom: 8px;
}
.ai-hero-desc {
  font-size: 13.5px;
  color: rgba(255,255,255,0.55);
  max-width: 500px;
  line-height: 1.6;
}
.ai-hero-stats {
  display: flex;
  gap: 28px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.ai-stat {
  text-align: center;
  padding: 14px 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}
.ai-stat-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
}
.ai-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── Page Content ── */
.page-content { padding: 32px 40px; }

/* ── Section Label ── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Panels ── */
.criteria-panel, .results-panel, .catalog-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.panel-header { margin-bottom: 20px; }
.panel-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.panel-desc { font-size: 14px; color: var(--text-secondary); margin-top: 6px; line-height: 1.6; }

/* ── Quick Filters ── */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.filter-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.filter-chip {
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.filter-chip:hover {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  color: var(--gold);
}

/* ── Textarea ── */
.input-group { position: relative; }
.criteria-textarea {
  width: 100%;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  min-height: 110px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.criteria-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: #fff;
}
.criteria-textarea::placeholder { color: var(--text-muted); }

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.char-count { font-size: 11.5px; color: var(--text-muted); }

.run-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 26px;
  background: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'DM Sans', inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(11,31,58,0.2);
  letter-spacing: 0.02em;
}
.run-btn:hover {
  background: var(--navy-3);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11,31,58,0.22);
}
.run-btn:active { transform: translateY(0); }
.run-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Loading ── */
.loading-state {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.loading-spinner {
  width: 34px; height: 34px;
  border: 2.5px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.loading-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }

/* ── Results Header ── */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
}
.ai-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  font-style: italic;
  max-width: 640px;
  line-height: 1.6;
  padding: 12px 16px;
  background: linear-gradient(to right, rgba(11,31,58,0.03), transparent);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.results-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 4px;
}
.results-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ── Table ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.results-table { width: 100%; border-collapse: collapse; }
.results-table thead {
  background: var(--navy);
}
.results-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  border-bottom: none;
  white-space: nowrap;
}
.results-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.results-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.results-table td {
  padding: 18px 20px;
  font-size: 14.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr:nth-child(even) { background: var(--surface-2); }
.results-table tbody tr { transition: background 0.12s; }
.results-table tbody tr:hover { background: #eef2ff; }

/* ── Rank ── */
.rank-cell {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
}
.rank-1 { background: #fef3c7; color: #92400e; border: 1.5px solid #fcd34d; }
.rank-2 { background: #f1f5f9; color: #334155; border: 1.5px solid #cbd5e1; }
.rank-3 { background: #fdf4e7; color: #7c3522; border: 1.5px solid #f5c99c; }
.rank-other { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Target Name ── */
.target-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}
.target-disease {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Badges ── */
.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.stage-fda {
  background: #d1fae5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
}
.stage-clinical {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #fde68a;
}
.stage-discovery {
  background: #ede9fe;
  color: #3b0764;
  border: 1px solid #c4b5fd;
}

.localization-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.loc-surface { background: #dbeafe; color: #1e3a8a; }
.loc-intracellular { background: #fee2e2; color: #7f1d1d; }

.kidney-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-low { background: #10b981; }
.dot-moderate { background: #f59e0b; }
.dot-high { background: #ef4444; }

/* ── Score ── */
.score-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 90px; }
.score-label {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1;
}
.score-bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 2px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.score-high .score-label { color: #059669; }
.score-high .score-fill { background: linear-gradient(to right, #10b981, #34d399); }
.score-mid .score-label { color: #d97706; }
.score-mid .score-fill { background: linear-gradient(to right, #f59e0b, #fbbf24); }
.score-low .score-label { color: #dc2626; }
.score-low .score-fill { background: linear-gradient(to right, #ef4444, #f87171); }

.rationale-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 360px;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 90px 40px;
  text-align: center;
}
.empty-icon {
  width: 76px; height: 76px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  color: var(--text-muted);
}
.empty-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.empty-desc {
  font-size: 13.5px;
  line-height: 1.7;
  max-width: 380px;
  color: var(--text-muted);
}

/* ── Catalog ── */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-sm);
}
.catalog-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.catalog-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}
.catalog-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.1px;
}
.catalog-card-disease {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}
.catalog-card-notes {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.catalog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

/* ── Interpretation Panel ── */
.interp-panel {
  background: linear-gradient(to right, rgba(26,86,200,0.04), transparent);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
  margin-bottom: 18px;
}
.interp-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.interp-body { display: flex; flex-direction: column; gap: 6px; }
.interp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.interp-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
}
.interp-chip-exclude {
  background: var(--red-dim);
  border-color: rgba(185,28,28,0.2);
  color: var(--red);
}
.interp-reasoning {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}
.interp-stats {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.interp-relax-warn {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--amber);
  margin-top: 4px;
}

/* ── Hard Filters ── */
.hard-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.hf-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.hf-groups { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; }
.hf-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.hf-group { display: flex; align-items: center; gap: 8px; }
.hf-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.hf-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.hf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  user-select: none;
}
.hf-chip input { display: none; }
.hf-chip:hover { border-color: var(--border-2); color: var(--text-primary); }
.hf-chip:has(input:checked) {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
}

/* ── Sources button ── */
.sources-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  font-family: inherit;
}
.sources-btn:hover { background: var(--surface-2); color: var(--text-secondary); border-color: var(--border-2); }
.sources-btn[aria-expanded="true"] { background: var(--accent-dim); border-color: var(--accent-border); color: var(--accent); }
.sources-arrow { font-size: 10px; }

/* ── Citation row ── */
.citation-row td { padding: 0 !important; border-bottom: 1px solid var(--border); }
.cit-panel {
  padding: 14px 20px 14px 56px;
  background: linear-gradient(to right, var(--surface-2), var(--surface));
  border-top: 1px solid var(--border);
}
.cit-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cit-rows { display: flex; flex-direction: column; gap: 6px; }
.cit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.cit-label {
  font-weight: 600;
  color: var(--text-secondary);
  width: 170px;
  flex-shrink: 0;
}
.cit-value { color: var(--text-primary); font-weight: 500; min-width: 80px; }
.cit-arrow { color: var(--text-muted); font-size: 11px; }
.cit-source { color: var(--text-muted); font-size: 12px; }
.cit-ver {
  display: inline-block;
  padding: 1px 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}
.cit-empty { font-size: 12.5px; color: var(--text-muted); font-style: italic; }

/* ── CSV button ── */
.csv-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.csv-btn:hover { background: var(--surface-2); border-color: var(--border-2); color: var(--text-primary); }

/* ── nTPM value in kidney col ── */
.tpm-val {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 2px;
}

/* ── Localization secreted badge ── */
.loc-secreted { background: #fef9c3; color: #713f12; }

/* ── OT score chip in catalog ── */
.catalog-score {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 20px;
}

/* ── History sidebar section ── */
.sidebar-history {
  padding: 16px 16px 4px;
}
.history-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  margin-bottom: 8px;
  padding: 0 4px;
}
.history-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all 0.12s;
  margin-bottom: 2px;
  font-family: inherit;
}
.history-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
.history-date {
  font-size: 10px;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.history-snippet {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-count {
  font-size: 10.5px;
  color: rgba(255,255,255,0.25);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Hamburger ── */
.topbar-left-group { display: flex; align-items: center; gap: 14px; }
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.5);
  z-index: 9;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Mobile Sidebar ── */
.sidebar.open { transform: translateX(0) !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 10;
  }

  .main { margin-left: 0; max-width: 100vw; }

  .topbar { padding: 0 16px; height: 60px; }
  .topbar-title { font-size: 16px; }
  .topbar-sub { display: none; }
  .header-badge { padding: 7px 12px; font-size: 11px; gap: 7px; }

  .page-content { padding: 16px; }

  /* AI Hero: stack vertically */
  .ai-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
    gap: 20px;
  }
  .ai-hero-title { font-size: 18px; }
  .ai-hero-desc { font-size: 13px; }
  .ai-hero-stats { width: 100%; justify-content: space-between; gap: 10px; }
  .ai-stat { flex: 1; padding: 12px 8px; }
  .ai-stat-value { font-size: 22px; }
  .ai-stat-label { font-size: 10px; }

  /* Panels */
  .criteria-panel, .results-panel, .catalog-panel { padding: 18px 16px; }
  .panel-title { font-size: 16px; }
  .panel-desc { font-size: 13px; }

  /* Quick filters: scroll horizontally */
  .quick-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .quick-filters::-webkit-scrollbar { display: none; }
  .filter-label { display: none; }

  /* Input / button */
  .criteria-textarea { font-size: 15px; }
  .input-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .char-count { text-align: right; }
  .run-btn { justify-content: center; padding: 13px; font-size: 15px; }

  /* Results header: stack */
  .results-header { flex-direction: column; gap: 12px; }
  .results-meta { align-self: flex-start; }
  .ai-summary { max-width: 100%; }

  /* Table: horizontal scroll with min widths */
  .table-wrapper { border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
  .results-table th { padding: 12px 14px; font-size: 10px; }
  .results-table td { padding: 14px 14px; font-size: 13px; }
  .target-name { font-size: 13.5px; }
  .rationale-text { max-width: 220px; font-size: 12.5px; }
  .score-label { font-size: 20px; }

  /* Catalog: single column */
  .catalog-grid { grid-template-columns: 1fr; }

  /* Empty state */
  .empty-state { padding: 60px 20px; }
  .empty-title { font-size: 16px; }
}

/* ── Phase 3: T/B Ratio cell ── */
.tb-val {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.tb-high { color: #065f46; background: #d1fae5; }
.tb-mid  { color: #92400e; background: #fef3c7; }
.tb-low  { color: #991b1b; background: #fee2e2; }
.tb-na   { color: var(--text-muted); font-size: 13px; font-weight: 400; }
.tb-cancer {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ── Phase 3: target badges (internalization, depmap) ── */
.target-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.badge-internal {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.badge-internal-yes { background: #dbeafe; color: #1e40af; }
.badge-internal-no  { background: #f3f4f6; color: #6b7280; }
.badge-shedding {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.badge-shedding-yes { background: #fee2e2; color: #991b1b; }
.badge-shedding-no  { background: #dcfce7; color: #166534; }
.badge-mouse {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fef9c3;
  color: #713f12;
  letter-spacing: 0.02em;
}
.badge-depmap {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ede9fe;
  color: #5b21b6;
  letter-spacing: 0.02em;
}

/* ── Phase 3: citation evidence quote ── */
.cit-evidence {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 6px 12px 6px 36px;
  margin-top: -4px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
  line-height: 1.5;
}
.cit-pmid-link {
  font-style: normal;
  color: var(--accent);
  font-size: 11px;
  text-decoration: none;
  margin-left: 6px;
}
.cit-pmid-link:hover { text-decoration: underline; }

/* ── Scorecard button ── */
.action-cell { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.scorecard-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.scorecard-btn:hover { background: var(--accent-dim); border-color: var(--accent-border); }

/* ── Scorecard expand row ── */
.scorecard-row td { padding: 0; border-bottom: 2px solid var(--accent-border); }

.sc-panel {
  padding: 16px 20px;
  background: linear-gradient(to right, rgba(26,86,200,0.03), transparent);
}
.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sc-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.sc-total {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sc-total-green { color: var(--green); }
.sc-total-amber { color: var(--amber); }
.sc-total-red   { color: var(--red); }

.sc-dims { display: flex; flex-direction: column; gap: 10px; }

.sc-dim { display: flex; flex-direction: column; gap: 4px; }
.sc-dim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sc-dim-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.sc-dim-score {
  font-size: 11.5px;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}
.sc-score-green { color: var(--green); }
.sc-score-amber { color: var(--amber); }
.sc-score-red   { color: var(--red); }

.sc-bar-track {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.sc-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.sc-bar-green { background: var(--green); }
.sc-bar-amber { background: var(--amber); }
.sc-bar-red   { background: var(--red); }

.sc-dim-note {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sc-empty {
  padding: 12px 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Confidence badge ── */
.conf-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  flex-wrap: wrap;
}
.conf-pct {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.conf-high { background: var(--green-dim); color: var(--green); }
.conf-mid  { background: var(--amber-dim); color: var(--amber); }
.conf-low  { background: var(--red-dim);   color: var(--red);   }
.conf-source {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
}
.conf-warn {
  font-size: 11px;
  cursor: help;
  color: var(--amber);
}

/* ── Report button ── */
.report-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--navy-3);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.report-btn:hover { background: var(--gold-dim); border-color: var(--gold-border); }

/* ── Report expand row ── */
.report-row td { padding: 0; border-bottom: 2px solid var(--gold-border); }

.report-panel {
  padding: 20px 24px;
  background: linear-gradient(to right, var(--gold-dim), transparent);
}
.report-loading, .report-error {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
  font-style: italic;
}
.report-error { color: var(--red); font-style: normal; }

.report-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gold-border);
}
.report-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  flex: 1;
}
.report-date {
  font-size: 11px;
  color: var(--text-muted);
}
.report-copy-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.report-copy-btn:hover { background: var(--surface-2); }

.report-section {
  margin-bottom: 16px;
}
.report-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.report-section-body {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.65;
}
.report-refs {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 18px;
}
.report-pmid {
  color: var(--accent);
  text-decoration: none;
  font-size: 11.5px;
}
.report-pmid:hover { text-decoration: underline; }
.report-pmid-unverified {
  color: var(--amber);
  font-size: 11.5px;
  cursor: help;
}
.report-refs-note {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Report Summary Block ─────────────────────────────────────────── */
.report-summary {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--bg-card);
}
.rs-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rs-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rs-group:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.rs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.rs-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.rs-value {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: right;
}
.rs-yes   { color: var(--green,  #22c55e); }
.rs-no    { color: var(--red,    #ef4444); }
.rs-unknown { color: var(--text-muted); font-weight: 400; }
.rs-query-cancer { color: var(--gold-light, #c9a84c); font-weight: 600; }
.rs-fda       { color: var(--green, #22c55e); font-weight: 600; }
.rs-clinical  { color: var(--amber, #f59e0b); font-weight: 600; }
.rs-discovery { color: var(--text-muted); font-weight: 400; }
.rs-exp-low  { color: var(--green,  #22c55e); }
.rs-exp-mod  { color: var(--amber,  #f59e0b); }
.rs-exp-high { color: var(--red,    #ef4444); }
.rs-notice {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(245, 158, 11, 0.07);
  border-left: 3px solid var(--amber, #f59e0b);
  border-radius: 3px;
  font-size: 10.5px;
  color: var(--text-secondary, #6b7280);
  line-height: 1.5;
}

/* ── Auth (Phase 1) ─────────────────────────────────────────────────────── */
#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
}
#auth-overlay.hidden { display: none; }

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  padding: 34px 32px 28px;
  text-align: center;
}
.auth-brand {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.2px;
}
.auth-sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-fields { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.auth-fields input {
  width: 100%;
  padding: 11px 13px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-fields input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
  background: var(--surface);
}
.auth-error {
  min-height: 16px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--red);
  line-height: 1.4;
}
.auth-primary {
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.auth-primary:hover { background: var(--navy-3); }
.auth-primary:disabled { opacity: 0.55; cursor: default; }
.auth-google {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.auth-google:hover { background: var(--surface-2); }
.auth-toggle {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.auth-toggle span { color: var(--gold); font-weight: 600; }
.auth-config-warn {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.auth-config-warn code {
  background: var(--surface-3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* User chip in sidebar footer */
.user-chip { margin-bottom: 10px; }
.user-chip:empty { display: none; }
.user-email {
  font-size: 11.5px;
  color: rgba(255,255,255,0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.user-signout {
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  padding: 5px 11px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-signout:hover { background: rgba(255,255,255,0.16); }

/* ── Usage meter (sidebar) ──────────────────────────────────────────────── */
.usage-badge { margin-bottom: 12px; }
.usage-badge:empty { display: none; }
.usage-plan {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.usage-plan-paid { color: var(--green, #10b981); }
.usage-line {
  font-size: 11.5px;
  color: rgba(255,255,255,0.62);
  line-height: 1.5;
}
.usage-line span { color: rgba(255,255,255,0.92); font-weight: 600; }
.usage-upgrade {
  margin-top: 9px;
  width: 100%;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--navy);
  background: var(--gold-light);
  border: none;
  border-radius: 6px;
  padding: 7px 0;
  cursor: pointer;
  transition: background 0.15s;
}
.usage-upgrade:hover { background: var(--gold); }

/* ── Upgrade modal ──────────────────────────────────────────────────────── */
.upgrade-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 31, 58, 0.55);
  backdrop-filter: blur(3px);
}
.upgrade-modal-overlay.hidden { display: none; }
.upgrade-modal {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0,0,0,0.4);
  padding: 32px 32px 26px;
}
.upgrade-close {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
}
.upgrade-close:hover { color: var(--text-primary); }
.upgrade-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--navy);
}
.upgrade-msg {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.upgrade-tiers {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.upgrade-tier {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
}
.upgrade-tier-featured {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.upgrade-tier-badge {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--gold-light);
  padding: 2px 9px;
  border-radius: 20px;
}
.upgrade-tier-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.upgrade-tier-price {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
}
.upgrade-tier-desc {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.upgrade-cta {
  margin-top: 16px;
  width: 100%;
  padding: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.upgrade-cta:hover { background: var(--surface-3); }
.upgrade-cta-primary {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}
.upgrade-cta-primary:hover { background: var(--navy-3); }
.upgrade-note {
  margin-top: 16px;
  min-height: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.upgrade-note a { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .upgrade-tiers { grid-template-columns: 1fr; }
}

/* ── Billing extras (Phase 3) ───────────────────────────────────────────── */
.usage-manage {
  margin-top: 7px;
  width: 100%;
  font-size: 11px;
  font-family: inherit;
  color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  padding: 6px 0;
  cursor: pointer;
  transition: background 0.15s;
}
.usage-manage:hover { background: rgba(255,255,255,0.14); }

.tiq-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 1200;
  background: var(--navy);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.tiq-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Credit-pack purchase (credit-only billing) ─────────────────────────── */
.upgrade-modal-narrow { max-width: 460px; }
.credit-pack {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 18px 18px;
}
.credit-pack-icon { font-size: 26px; line-height: 1; }
.credit-pack-body { flex: 1; }
.credit-pack-name { font-size: 14.5px; font-weight: 700; color: var(--text-primary); }
.credit-pack-desc { margin-top: 3px; font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.credit-pack .upgrade-cta { margin-top: 0; width: auto; white-space: nowrap; padding: 9px 16px; }
