/* ============================================================
   FDA INTEL — v0.5
   Glassnode-style light intel + Mercury left sidebar
   ============================================================ */
:root {
  /* surfaces */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --surface-3: #f0f0f2;
  --surface-hover: #f4f4f5;

  /* borders */
  --border: #ececef;
  --border-strong: #dcdce0;
  --border-emphasis: #1f1f23;

  /* text */
  --text: #0a0a0b;
  --text-2: #3f3f46;
  --text-3: #71717a;
  --text-4: #a1a1aa;
  --text-5: #d4d4d8;

  /* accent — used sparingly */
  --accent: #1f1f23;          /* primary action background (Mercury-style dark ink) */
  --accent-hover: #000;
  --accent-text: #ffffff;
  --brand: #5b3df5;           /* indigo highlight for scores / active states */
  --brand-bg: #5b3df50f;
  --brand-border: #5b3df533;

  /* signals */
  --positive: #059669;
  --positive-bg: #05966910;
  --negative: #dc2626;
  --negative-bg: #dc262610;
  --warning: #d97706;
  --warning-bg: #d9770610;
  --info: #2563eb;
  --info-bg: #2563eb10;
  --neutral: #71717a;
  --neutral-bg: #71717a10;

  /* shape */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(20,20,30,0.06), 0 1px 3px rgba(20,20,30,0.04);
  --shadow-lg: 0 24px 48px rgba(20,20,30,0.12), 0 8px 20px rgba(20,20,30,0.08);

  --t-fast: 100ms ease;
  --t: 160ms ease;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }
body {
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03", "tnum";
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ============================== SIDEBAR ============================== */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
}
.sb-logo {
  width: 30px; height: 30px;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.sb-brand-text { min-width: 0; }
.sb-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
.sb-tag {
  font-size: 10.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin-top: 1px;
}

.sb-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
  padding: 0 8px 4px;
}

.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-link {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
  position: relative;
}
.sb-link:hover { background: var(--surface-hover); color: var(--text); }
.sb-link.active {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}
.sb-link svg { color: var(--text-3); flex-shrink: 0; }
.sb-link.active svg { color: var(--text); }
.sb-link span:first-of-type { flex: 1; }
.sb-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
}
.sb-link.active .sb-pill { background: var(--surface); color: var(--text); }

.sb-quick { margin-top: auto; }
.sb-quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: inherit;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
}
.sb-quick-btn:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text); }
.sb-quick-btn span { flex: 1; text-align: left; }
.sb-quick-btn kbd {
  font-family: var(--font-mono);
  font-size: 9.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-3);
}

.sb-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 11.5px;
}
.sb-stat-label { color: var(--text-3); }
.sb-stat-value { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.sb-stat-value.mono { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); }
.sb-live { display: flex; align-items: center; gap: 7px; padding: 6px 8px; margin-top: 4px; }

.pulse {
  width: 6px; height: 6px;
  background: var(--positive);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--positive);
  animation: pulse-ring 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  flex-shrink: 0;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(5, 150, 105, 0); }
}

/* ============================== PAGE ============================== */
.page {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px 36px 40px;
  gap: 20px;
  background: var(--bg);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-4);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}
.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-head-actions { display: flex; align-items: center; gap: 8px; }

/* ============================== BUTTONS ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-4); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
}

/* ============================== BRIEF + KPI ============================== */
.brief-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  position: relative;
}
.brief-row::before {
  content: "";
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.brief-text {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  padding-left: 4px;
}
.brief-text .hl { color: var(--accent); font-weight: 600; }
.brief-text .pos { color: var(--positive); font-weight: 600; }
.brief-text .neg { color: var(--negative); font-weight: 600; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 6px;
}
.kpi-row-vals {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kpi-value.danger { color: var(--negative); }
.kpi-delta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
}
.kpi-delta.pos { color: var(--positive); background: var(--positive-bg); }
.kpi-delta.neg { color: var(--negative); background: var(--negative-bg); }
.kpi-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ============================== CARDS ============================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
}
.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card-sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
}
.card-head-actions { display: flex; align-items: center; gap: 8px; }

/* ============================== COMMAND GRID ============================== */
.cc-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  min-height: 0;
  flex: 1;
}
.spotlight-card, .ticker-card { min-height: 400px; }

/* ============================== SEG (segmented control) ============================== */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.seg-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
/* Visual cue when the All/clear button is in its default state */
.seg-btn[data-value=""].active {
  background: var(--accent);
  color: var(--accent-text);
}

.dot {
  width: 6px; height: 6px;
  background: var(--text-4);
  border-radius: 50%;
}
.dot-live {
  background: var(--positive);
  box-shadow: 0 0 0 0 var(--positive);
  animation: pulse-ring 1.8s infinite;
}

/* ============================== SPOTLIGHT (top candidates) ============================== */
.spotlight-list {
  overflow-y: auto;
  flex: 1;
}
.spot-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
}
.spot-row:last-child { border-bottom: none; }
.spot-row:hover { background: var(--surface-2); }

.spot-main { min-width: 0; }
.spot-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.spot-rank {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}
.spot-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.spot-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 99px;
}
.spot-tag.greenfield { color: var(--positive); background: var(--positive-bg); border: 1px solid var(--positive-bg); }
.spot-tag.has-mdl { color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border); }
.spot-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.spot-sig {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
}
.spot-sig strong { color: var(--text); font-weight: 600; }
.spot-sig.danger { color: var(--negative); background: var(--negative-bg); border-color: transparent; }
.spot-sig.danger strong { color: var(--negative); }

.spot-spark {
  width: 100px;
  height: 32px;
  display: block;
}
.spot-spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spot-spark .area { fill: rgba(31, 31, 35, 0.06); stroke: none; }
.spot-spark.danger path { stroke: var(--negative); }
.spot-spark.danger .area { fill: rgba(220, 38, 38, 0.08); }

.spot-score {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.03em;
  min-width: 56px;
  text-align: right;
}
.spot-score.med { color: var(--accent); }
.spot-score.high { color: var(--negative); }

/* ============================== TICKER ============================== */
.ticker-list {
  overflow-y: auto;
  flex: 1;
}
.ticker-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
  animation: ticker-in 200ms ease;
}
@keyframes ticker-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: translateX(0); }
}
.ticker-row:last-child { border-bottom: none; }
.ticker-row:hover { background: var(--surface-2); }
.ticker-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  align-self: start;
  margin-top: 1px;
}
.ticker-tag.recall, .ticker-tag.wl, .ticker-tag.label   { color: var(--negative); background: var(--negative-bg); }
.ticker-tag.trial, .ticker-tag.fda                       { color: var(--warning); background: var(--warning-bg); }
.ticker-tag.sec                                          { color: var(--info);    background: var(--info-bg); }
.ticker-tag.news                                         { color: var(--brand);   background: var(--brand-bg); }
.ticker-tag.ctis                                         { color: var(--brand);   background: var(--brand-bg); }
.ticker-body { min-width: 0; }
.ticker-title {
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ticker-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-4);
  margin-top: 3px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.ticker-time {
  color: var(--text-4);
}
.ticker-dot { width: 3px; height: 3px; background: var(--text-5); border-radius: 50%; }

/* ============================== HUNT ============================== */
.hunt-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.hunt-row {
  display: grid;
  grid-template-columns: 60px 1fr 110px 90px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
}
.hunt-row:last-child { border-bottom: none; }
.hunt-row:hover { background: var(--surface-2); }
.hunt-score {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.02em;
}
.hunt-score.med { color: var(--accent); }
.hunt-score.high { color: var(--negative); }

/* Compact horizontal score bar replaces fake sparkline */
.score-meter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.score-meter-track {
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.score-meter-fill {
  height: 100%;
  background: var(--text-3);
  border-radius: 99px;
  transition: width 300ms ease;
}
.score-meter.med .score-meter-fill { background: var(--accent); }
.score-meter.high .score-meter-fill { background: var(--negative); }
.score-meter-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-4);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hunt-body { min-width: 0; }
.hunt-drug { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; }
.hunt-sig { display: flex; gap: 5px; flex-wrap: wrap; }
.hunt-sig-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 99px;
}
.hunt-sig-chip strong { color: var(--text); font-weight: 600; }
.hunt-spark { width: 80px; height: 28px; }
.hunt-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 99px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.hunt-tag-link:hover { filter: brightness(0.92); }
.hunt-tag.greenfield { color: var(--positive); background: var(--positive-bg); }
.hunt-tag.has-mdl { color: var(--text-3); background: var(--surface-3); }

/* ============================== FEED ============================== */
.search-wrap { position: relative; display: flex; align-items: center; width: 240px; }
.search-wrap svg { position: absolute; left: 9px; color: var(--text-4); pointer-events: none; }
.search-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px 6px 28px;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color var(--t-fast);
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text-4); }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.feed-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feed-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
}
.feed-row:last-child { border-bottom: none; }
.feed-row:hover, .feed-row.expanded { background: var(--surface-2); }
.feed-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge.region-US     { color: var(--info);    background: var(--info-bg); }
.badge.region-EU     { color: var(--brand);   background: var(--brand-bg); }
.badge.region-GLOBAL { color: var(--positive); background: var(--positive-bg); }
.badge.status-TERMINATED, .badge.status-HALTED, .badge.status-REVOKED,
.badge.status-RECALL_CLASS_I, .badge.status-WARNING_LETTER, .badge.status-BOXED_WARNING_LABEL {
  color: var(--negative); background: var(--negative-bg);
}
.badge.status-WITHDRAWN, .badge.status-SUSPENDED, .badge.status-EXPIRED,
.badge.status-RECALL_CLASS_II, .badge.status-SAFETY_COMMUNICATION, .badge.status-FDA_ALERT,
.badge.status-FDA_RECALL_ALERT {
  color: var(--warning); background: var(--warning-bg);
}
.badge.status-COMPLETE_RESPONSE_LETTER, .badge.status-RECALL_CLASS_III, .badge.status-RECALL,
.badge.status-NEWS, .badge.status-APPROVAL, .badge.status-SEC_8K_DISCLOSURE,
.badge.status-COURT_FILING, .badge.status-FDA_REGISTER_NOTICE, .badge.status-FDA_ADCOM_MEETING,
.badge.status-FDA_WITHDRAWAL_NOTICE, .badge.status-FDA_LABELING_CHANGE, .badge.status-FDA_CRL_NOTICE {
  color: var(--text-3); background: var(--surface-3);
}
.badge.status-LITIGATION_SIGNAL {
  color: var(--negative);
  background: linear-gradient(90deg, var(--negative-bg), var(--warning-bg));
}
.badge.status-LITIGATION_SIGNAL::before { content: "⚖ "; }
.source-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.date-pill {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
}
.feed-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 4px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-row.expanded .feed-title { -webkit-line-clamp: unset; overflow: visible; }
.feed-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-3);
}
.feed-meta strong { color: var(--text-4); font-weight: 500; text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.06em; margin-right: 4px; }
.feed-meta a { color: var(--accent); text-decoration: none; font-family: var(--font-mono); font-size: 10.5px; }
.feed-meta a:hover { text-decoration: underline; }

.why, .summary-box, .litigation-detail {
  margin-top: 8px;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.45;
  display: none;
  border-radius: var(--radius-sm);
}
.feed-row.expanded .why,
.feed-row.expanded .summary-box,
.feed-row.expanded .litigation-detail { display: block; }
.why { background: var(--warning-bg); border-left: 2px solid var(--warning); color: var(--text-2); }
.why::before {
  content: "REASON";
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--warning);
  margin-bottom: 4px;
}
.summary-box { border-left: 2px solid var(--border-strong); color: var(--text-2); padding-left: 12px; }
.litigation-detail {
  background: var(--negative-bg);
  border: 1px solid var(--negative-bg);
}
.litigation-detail .lit-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--negative); text-transform: uppercase;
  margin-bottom: 6px;
}
.litigation-detail .score {
  background: var(--surface); padding: 1px 7px; border-radius: 4px; font-size: 10px;
}
.litigation-detail .signals { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.signal-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 99px;
  color: var(--text-3);
}
.litigation-detail .rationale { color: var(--text-2); line-height: 1.45; margin-top: 4px; font-size: 11.5px; }

/* ============================== CHAT ============================== */
.chat-page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  padding: 28px 36px 0;
  overflow: hidden;
}

/* Conversations live inside the main sidebar under Analyst */
.sb-chat-block {
  margin-top: 4px;
  padding: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow: hidden;
}
.sb-chat-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: 22px;       /* indent under Analyst */
  padding: 5px 9px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-text);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
}
.sb-chat-new:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.sb-conv-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  max-height: 38vh;
  margin-left: 22px;
  padding-top: 4px;
}
.conv-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--t-fast);
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.conv-item:hover { background: var(--surface-hover); }
.conv-item.active { background: var(--surface-3); }
.conv-item-body { min-width: 0; flex: 1; }
.conv-item-title {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  display: block;
}
.conv-item.active .conv-item-title { font-weight: 600; }
.conv-item-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-4);
  margin-top: 1px;
}
.conv-item-del {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-4);
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
  border-radius: 3px;
  transition: all var(--t-fast);
  flex-shrink: 0;
  line-height: 1;
}
.conv-item:hover .conv-item-del { opacity: 1; }
.conv-item-del:hover { color: var(--negative); background: var(--negative-bg); }
.conv-empty {
  padding: 10px 8px;
  font-size: 11px;
  color: var(--text-4);
  margin-left: 22px;
}
.chat-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;             /* THIS is the scrollable area */
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;                /* critical for grid+overflow to behave */
}
.chat-empty {
  margin: auto 0;
  padding: 30px 0;
  text-align: center;
}
.chat-empty-icon {
  width: 50px; height: 50px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.chat-empty h3 {
  font-size: 16px; font-weight: 600; margin: 0 0 6px;
  letter-spacing: -0.01em; color: var(--text);
}
.chat-empty p {
  color: var(--text-3);
  font-size: 12.5px; margin: 0 auto 20px;
  max-width: 360px;
}
.suggested { display: flex; flex-direction: column; gap: 6px; max-width: 380px; margin: 0 auto; }
.suggestion {
  font-family: inherit;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 13px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
}
.suggestion:hover { background: var(--surface-2); border-color: var(--text-4); }

.msg {
  max-width: 92%;
  padding: 9px 14px;
  border-radius: var(--radius);
  line-height: 1.55;
  font-size: 13px;
  word-wrap: break-word;
  animation: msg-in 200ms ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg.user {
  background: var(--accent);
  color: var(--accent-text);
  align-self: flex-end;
}
.msg.user a { color: white; }
.msg.assistant {
  align-self: flex-start;
  padding: 4px 0;
  color: var(--text);
}
.msg.assistant strong { color: var(--text); font-weight: 700; }
.msg.assistant em { color: var(--text-3); }
.msg.assistant h3 { font-size: 13px; margin: 14px 0 6px; font-weight: 700; }
.msg.assistant table { border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.msg.assistant th, .msg.assistant td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--border); }
.msg.assistant th { font-weight: 700; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.msg.assistant ul, .msg.assistant ol { margin: 6px 0; padding-left: 20px; }
.msg.assistant li { margin: 3px 0; }
.msg.assistant pre { background: var(--surface-2); border: 1px solid var(--border); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 11.5px; font-family: var(--font-mono); margin: 8px 0; }
.msg.assistant code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px; font-size: 11.5px; font-family: var(--font-mono); }
.msg.assistant pre code { background: none; border: none; padding: 0; }
.msg.assistant a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.msg.thinking {
  color: var(--text-3);
  font-style: italic;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.dots { display: inline-flex; gap: 3px; }
.dots span {
  width: 4px; height: 4px; background: var(--text-3); border-radius: 50%;
  animation: dot-bounce 1.4s infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 14px;
  padding: 4px 0 20px;
  background: var(--bg);
  position: sticky;
  bottom: 0;
}
.chat-form-wrap {
  flex: 1;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.chat-form-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 31, 35, 0.06);
}
.chat-form textarea {
  width: 100%;
  resize: none;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 14px 56px 14px 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  min-height: 72px;
  max-height: 240px;
  outline: none;
  display: block;
}
.chat-form textarea::placeholder { color: var(--text-4); }
.btn-send {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px; height: 36px;
  padding: 0;
  display: grid; place-items: center;
  flex-shrink: 0;
  border-radius: var(--radius);
}

/* ============================== SEARCH PAGE ============================== */
.search-page {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;                /* lock to viewport so only the results scroll */
  padding-bottom: 0;
  overflow: hidden;
}
.search-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}
.search-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.filter-block { display: flex; flex-direction: column; gap: 6px; }
.filter-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-2);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.filter-hint {
  font-size: 10px;
  color: var(--text-4);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.filter-block input[type="text"],
.filter-block input[type="number"],
.filter-block input[type="date"],
.filter-block select,
.filter-block textarea {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color var(--t-fast);
  width: 100%;
}
.filter-block input:focus,
.filter-block select:focus,
.filter-block textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 31, 35, 0.06);
}
.filter-range { display: flex; align-items: center; gap: 6px; }
.filter-sep { color: var(--text-4); font-size: 11px; }

.filter-chips { display: flex; flex-direction: column; gap: 5px; }
.chk {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
}
.chk input[type="checkbox"] {
  appearance: none;
  width: 13px; height: 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.chk input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.chk input[type="checkbox"]:checked::after {
  content: "✓";
  color: white;
  font-size: 10px;
  font-weight: 700;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  line-height: 1;
}

.search-results {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.search-results .feed-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ============================== WATCHLIST ============================== */
.watchlist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.watch-row {
  display: grid;
  grid-template-columns: 70px 1fr auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
  position: relative;
}
.watch-row:last-child { border-bottom: none; }
.watch-row:hover { background: var(--surface-2); }
.watch-row.inactive { opacity: 0.55; }
.watch-row::after {
  content: "→ View matches";
  position: absolute;
  right: 110px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-4);
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.watch-row:hover::after { opacity: 1; }
.watch-kind-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 99px;
  text-align: center;
  background: var(--surface-3);
  color: var(--text-2);
}
.watch-kind-tag.drug { color: var(--brand); background: var(--brand-bg); }
.watch-kind-tag.sponsor { color: var(--info); background: var(--info-bg); }
.watch-kind-tag.condition { color: var(--positive); background: var(--positive-bg); }
.watch-kind-tag.keyword { color: var(--warning); background: var(--warning-bg); }
.watch-kind-tag.nct { color: var(--text-2); background: var(--surface-3); }
.watch-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.watch-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.watch-stat {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  min-width: 60px;
}
.watch-stat-num { font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.watch-stat-num.unread { color: var(--negative); }
.watch-stat-lbl { font-size: 9.5px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 1px; }
.watch-action {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.watch-action:hover { border-color: var(--negative); color: var(--negative); }

/* ============================== ALERTS ============================== */
.alerts-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.alert-row {
  display: grid;
  grid-template-columns: 14px auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t-fast);
}
.alert-row:last-child { border-bottom: none; }
.alert-row:hover { background: var(--surface-2); }
.alert-unread-dot {
  width: 8px; height: 8px;
  background: var(--negative);
  border-radius: 50%;
}
.alert-row.read .alert-unread-dot { background: transparent; }
.alert-watch-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--brand-bg);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  white-space: nowrap;
}
.alert-body { min-width: 0; }
.alert-title {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.alert-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-4);
  display: flex;
  gap: 10px;
  align-items: center;
}
.alert-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

.sb-pill.alert-badge {
  background: var(--negative-bg);
  color: var(--negative);
  font-weight: 700;
}
.sb-pill.alert-badge.zero {
  background: var(--surface-3);
  color: var(--text-4);
  font-weight: 400;
}

/* ============================== QUICK SEARCH ============================== */
.qs-modal {
  position: fixed; inset: 0;
  background: rgba(20,20,30,0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 120px;
  animation: fade-in 100ms;
}
.qs-content {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 600px;
  max-width: calc(100% - 40px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.qs-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
}
.qs-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.qs-input-wrap input::placeholder { color: var(--text-4); }
.qs-input-wrap kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-3);
}
.qs-results { max-height: 50vh; overflow-y: auto; }
.qs-hint { padding: 14px 18px; color: var(--text-3); font-size: 12px; }
.qs-result {
  padding: 11px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background var(--t-fast);
}
.qs-result:last-child { border-bottom: none; }
.qs-result:hover, .qs-result.active { background: var(--surface-2); }
.qs-result-name { font-weight: 500; color: var(--text); }
.qs-result-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* ============================== DOSSIER MODAL ============================== */
.dossier-modal {
  position: fixed; inset: 0;
  background: rgba(20,20,30,0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in 150ms;
}
.dossier-content {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 880px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  padding: 28px 32px;
  box-shadow: var(--shadow-lg);
}
.dossier-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.dossier-meta-line {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dossier-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 6px 0 18px;
}
.dossier-section { margin-bottom: 18px; }
.dossier-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-3);
  margin: 0 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.dossier-section .dossier-body { font-size: 13px; line-height: 1.55; color: var(--text); }
.dossier-section pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  margin: 6px 0;
}
.dossier-trend {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 100px;
  padding: 22px 0 28px;   /* more top room for the count labels above each bar */
  margin-top: 8px;
}
.dossier-trend-bar { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.dossier-trend-bar.partial { opacity: 0.35; }
.dossier-trend-bar.danger { background: var(--negative); }
.dossier-trend-bar .label {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; color: var(--text-4);
  font-family: var(--font-mono); white-space: nowrap;
}
.dossier-trend-bar .count {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text-2);
  font-family: var(--font-mono); font-weight: 600;
  white-space: nowrap;
}
.dossier-trend-bar.partial .count { color: var(--text-4); }
.dossier-close {
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer; padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}
.dossier-close:hover { color: var(--text); border-color: var(--text-3); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ============================== FEEDBACK BUTTON ============================== */
.feedback-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--accent-text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 50;
  transition: all var(--t-fast);
}
.feedback-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* ============================== LOGIN ============================== */
body.login-body {
  display: block;
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface-2) 100%);
}
.login-shell {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.login-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.login-name { font-size: 18px; font-weight: 700; color: var(--text); }
.login-tag { font-size: 11.5px; color: var(--text-3); font-family: var(--font-mono); margin-top: 2px; }
.login-form { display: flex; flex-direction: column; }
.login-form input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31,31,35,0.06);
}
.login-form .filter-label {
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-2);
}
.login-error {
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--negative-bg);
  color: var(--negative);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.login-submit { margin-top: 18px; padding: 11px; font-size: 14px; justify-content: center; }
.login-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 20px;
}

/* ============================== RESPONSIVE ============================== */
@media (max-width: 1100px) {
  .cc-grid { grid-template-columns: 1fr; }
  .search-layout { grid-template-columns: 1fr; }
  .search-filters {
    position: static;
    max-height: 360px;
  }
}

/* Tablet / phone */
@media (max-width: 800px) {
  body { grid-template-columns: 1fr; }

  /* Sidebar collapses into a top bar with horizontal-scrollable nav */
  .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    z-index: 30;
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sb-section, .sb-footer, .sb-quick, .sb-tag, .sb-stat, .sb-chat-block, .sb-brand-text { display: none; }
  .sb-nav { flex-direction: row; gap: 4px; flex-wrap: nowrap; flex-shrink: 0; }
  .sb-brand { flex-shrink: 0; margin-right: 8px; padding: 0; gap: 0; }
  .sb-link {
    padding: 6px 9px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .sb-link span:first-of-type { font-size: 12px; }

  /* All pages reserve top padding for the fixed nav */
  .page { padding: 64px 14px 20px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head-actions { width: 100%; flex-wrap: wrap; }

  /* Cards take full width, stack */
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 20px; }

  .cc-grid { gap: 12px; }
  .spotlight-card, .ticker-card { min-height: 0; }
  .spot-row { grid-template-columns: 1fr auto; gap: 10px; padding: 12px 14px; }
  .spot-row .score-meter { display: none; }

  .hunt-row {
    grid-template-columns: 50px 1fr auto;
    gap: 10px;
    padding: 12px;
  }
  .hunt-row .score-meter { display: none; }
  .hunt-score { font-size: 18px; }

  /* Search becomes top filters + results below */
  .chat-page { padding: 64px 12px 0; }
  .chat-layout { grid-template-columns: 1fr; }

  /* Dossier modal full-screen on phone */
  .dossier-modal { padding: 0; }
  .dossier-content {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
    padding: 20px 16px;
  }
  .dossier-title { font-size: 22px; }
  .dossier-trend { height: 84px; gap: 3px; }

  /* Quick-search modal */
  .qs-modal { padding-top: 60px; padding-left: 12px; padding-right: 12px; }

  /* Feedback button stays bottom-right but smaller */
  .feedback-btn { bottom: 12px; right: 12px; }

  /* Touch-friendly tap targets — at least 36-44px on key buttons */
  .btn { padding: 8px 14px; }
  .btn-primary { padding: 9px 16px; }
  .seg-btn { padding: 6px 12px; }
  .chk { padding: 6px 0; }      /* easier checkbox tap */

  /* Watch + alert rows simplify */
  .watch-row {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 12px;
  }
  .watch-row .watch-stat { display: none; }
  .alert-row { grid-template-columns: 10px 1fr; gap: 10px; padding: 12px; }
  .alert-row .alert-watch-tag, .alert-row .alert-time { display: none; }

  /* Filter row in feed wraps cleanly */
  .filter-row, .filters { gap: 6px; }
  .seg { flex-wrap: wrap; }

  /* Login card */
  .login-card { padding: 24px 22px; }
}
