:root {
  --bg: #05090f;
  --panel: #0c1420;
  --panel-2: #111d2e;
  --line: #1e3050;
  --text: #e8f0fc;
  --muted: #8ba4c8;
  --accent: #f59e0b;
  --accent-soft: rgba(245,158,11,.14);
  --accent-strong: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --warn: #fb923c;
  --shadow: 0 16px 48px rgba(0,0,0,.32);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(180deg, #030710 0%, #07111f 100%);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: #fff; }
h1 { font-size: 2.1rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; line-height: 1.25; font-weight: 700; }
h3 { font-size: 1rem; line-height: 1.3; font-weight: 600; }
p { margin: 0; color: var(--muted); line-height: 1.55; }

.page-shell {
  width: min(1180px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 16px 0 72px;
  display: flex; flex-direction: column; gap: 16px;
}

.panel {
  background: linear-gradient(180deg, rgba(15,25,45,.97), rgba(10,18,32,.97));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}

/* --- Hero ------------------------------------------------------------------ */
.hero { display: flex; flex-direction: column; gap: 14px; }
.hero-copy .eyebrow { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero-copy h1 { margin: 6px 0 8px; }
.subhead { font-size: 0.98rem; max-width: 62ch; }
.subhead-muted { font-size: 0.88rem; color: var(--muted); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-util-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hero-util-links a {
  font-size: 0.95rem; font-weight: 700; color: var(--text); text-decoration: none;
  padding: 8px 18px; border: 1px solid rgba(245,158,11,.4);
  border-radius: 999px; background: rgba(245,158,11,.06);
  transition: border-color .15s, color .15s, background .15s;
}
.hero-util-links a:hover { border-color: var(--accent); color: var(--accent); background: rgba(245,158,11,.12); }
.hero-free-note { font-size: 0.92rem; color: var(--text); }
.hero-free-note a { color: var(--accent); font-weight: 700; text-decoration: none; }
.hero-free-note a:hover { text-decoration: underline; }
.hero-signal-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hero-pill { font-size: 0.78rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); cursor: pointer; transition: border-color .15s, color .15s; user-select: none; }
.hero-pill strong { font-weight: 700; }
.hero-pill.high { border-color: rgba(249,115,22,.45); color: #fb923c; }
.hero-pill.critical { border-color: rgba(239,68,68,.5); color: #f87171; }
.hero-pill.med  { border-color: rgba(245,158,11,.45); color: #f59e0b; }
.hero-pill.low  { border-color: var(--line); color: var(--muted); }
.hero-pill:hover { border-color: var(--accent); color: var(--accent); outline: none; }
.hero-brand-panel { padding: 0; overflow: hidden; margin-top: 4px; text-align: center; }
.hero-brand-img { width: 100%; max-width: 520px; height: auto; display: inline-block; border-radius: 18px; }
.btn {
  padding: 11px 18px; border-radius: 999px; font-weight: 600;
  font-size: 0.92rem; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn.primary { background: var(--accent); color: #03080f; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245,158,11,.35); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* --- Command bar ----------------------------------------------------------- */
.mobile-command-bar {
  position: sticky; top: 8px; z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px; padding: 10px;
  backdrop-filter: blur(18px);
  background: rgba(8,14,26,.92);
}
.nav-chip {
  padding: 9px 12px; border-radius: 12px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
  transition: border-color .15s, color .15s, background .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-chip.active, .nav-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.nav-chip.full-row { grid-column: 1 / -1; }

/* --- Stats ----------------------------------------------------------------- */
.quick-view { display: flex; flex-direction: column; gap: 16px; }
.quick-view-head { display: flex; flex-direction: column; gap: 10px; }
.section-label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.section-title { font-size: 1.1rem; font-weight: 700; color: #fff; margin-top: 2px; }
.feed-status-block { display: flex; flex-direction: column; gap: 4px; }
.feed-status-row { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.live { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.fallback { background: var(--warn); }
.status-text { font-size: 0.82rem; color: var(--muted); }
.feed-status-detail { font-size: 0.78rem; color: var(--muted); opacity: .7; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; transition: border-color .15s, background .15s; text-align: left;
}
.stat-card:hover { border-color: var(--accent); background: rgba(245,158,11,.06); }
.stat-label { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: #fff; }

.top-signal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.top-signal-chip {
  font-size: 0.8rem; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.top-signal-chip.critical { border-color: rgba(239,68,68,.5); color: #f87171; }
.top-signal-chip.high { border-color: rgba(249,115,22,.45); color: #fb923c; }
.top-signal-chip.medium { border-color: rgba(245,158,11,.45); color: #f59e0b; }
.top-signal-chip:hover { border-color: var(--accent); color: var(--accent); }

/* --- Lens panel ------------------------------------------------------------ */
.lens-panel { display: flex; flex-direction: column; gap: 10px; }
.lens-panel-head { display: flex; justify-content: space-between; align-items: center; }
.lens-panel-note { font-size: 0.8rem; color: var(--muted); }
.lens-row { display: flex; flex-wrap: wrap; gap: 8px; }
.lens-chip {
  padding: 8px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
  cursor: pointer; transition: all .15s;
}
.lens-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.lens-chip:hover:not(.active) { border-color: var(--muted); color: var(--text); }

/* --- Brief / Today --------------------------------------------------------- */
.brief-panel, .brief-head { display: flex; flex-direction: column; gap: 16px; }
.brief-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
.brief-grid { display: flex; flex-direction: column; gap: 12px; }
.brief-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.brief-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brief-headline { font-size: 0.95rem; font-weight: 700; color: #fff; }
.brief-summary { font-size: 0.88rem; color: var(--muted); }
.brief-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.brief-source { font-size: 0.76rem; color: var(--muted); }

.section-divider { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.section-note { font-size: 0.82rem; color: var(--muted); }
.news-grid { display: flex; flex-direction: column; gap: 10px; }
.news-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.news-title { font-size: 0.92rem; font-weight: 600; color: #fff; }
.news-summary { font-size: 0.84rem; color: var(--muted); }
.news-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-source { font-size: 0.75rem; color: var(--muted); }
.news-link { font-size: 0.75rem; color: var(--accent); }

/* --- Domains (equivalent to Materials) ------------------------------------- */
.domains-panel { display: flex; flex-direction: column; gap: 16px; }
.domain-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-chip {
  padding: 7px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.domain-chip.active, .domain-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.domains-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 680px) { .domains-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .domains-grid { grid-template-columns: repeat(3, 1fr); } }

.domain-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.domain-card:hover, .domain-card.selected { border-color: var(--accent); background: rgba(245,158,11,.05); }
.domain-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.domain-category { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.domain-card h3 { font-size: 0.97rem; }
.domain-condition { font-size: 0.82rem; color: var(--text); font-style: italic; }
.domain-blurb { font-size: 0.82rem; color: var(--muted); }
.domain-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.timestamp { font-size: 0.75rem; color: var(--muted); }

/* --- Domain detail --------------------------------------------------------- */
.featured-panel { display: flex; flex-direction: column; gap: 14px; }
.domain-detail-head { display: flex; flex-direction: column; gap: 10px; }
.domain-detail-title .section-label { margin-bottom: 2px; }
.domain-detail-title h2 { font-size: 1.35rem; }
.domain-detail-sub { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.domain-detail-badge { display: flex; flex-direction: column; gap: 4px; }
.domain-detail-condition { font-size: 0.9rem; color: var(--text); font-weight: 600; }
.domain-detail-signal { font-size: 0.82rem; color: var(--muted); }

.decision-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .decision-grid { grid-template-columns: repeat(2, 1fr); } }
.decision-box {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.decision-box.primary { border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.05); }
.decision-box.action { border-color: rgba(52,211,153,.25); background: rgba(52,211,153,.04); }
.decision-box b { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.decision-box span { font-size: 0.88rem; color: var(--text); line-height: 1.5; }

/* --- Signal list ----------------------------------------------------------- */
.signal-grid { display: flex; flex-direction: column; gap: 10px; }
.signal-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.signal-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.signal-name { font-size: 0.92rem; font-weight: 700; color: #fff; }
.signal-summary { font-size: 0.84rem; color: var(--muted); }
.signal-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.signal-source { font-size: 0.75rem; color: var(--muted); }

/* --- Tags ------------------------------------------------------------------ */
.tag {
  display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
}
.tag.critical { border-color: rgba(239,68,68,.5); color: #f87171; background: rgba(239,68,68,.07); }
.tag.high { border-color: rgba(249,115,22,.45); color: #fb923c; background: rgba(249,115,22,.07); }
.tag.medium { border-color: rgba(245,158,11,.45); color: #f59e0b; background: rgba(245,158,11,.07); }
.tag.watch { border-color: var(--line); color: var(--muted); }
.tag.pro-lock { border-color: rgba(245,158,11,.4); color: var(--accent); cursor: pointer; }

/* --- Search ---------------------------------------------------------------- */
.search-panel { display: flex; flex-direction: column; gap: 14px; }
.search-box-wrap { position: relative; }
.search-box {
  width: 100%; padding: 12px 40px 12px 16px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 14px; color: var(--text);
  font-size: 0.95rem; outline: none; transition: border-color .15s;
}
.search-box:focus { border-color: var(--accent); }
.search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-hint { font-size: 0.85rem; color: var(--muted); }

/* --- Methodology ----------------------------------------------------------- */
.methodology-panel { display: flex; flex-direction: column; gap: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.detail-grid.two-up { grid-template-columns: 1fr; }
@media (min-width: 600px) { .detail-grid.two-up { grid-template-columns: repeat(2, 1fr); } }
.detail-box {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.detail-box b { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.detail-box span { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* --- Disclaimer / Footer --------------------------------------------------- */
.disclaimer-panel { padding: 16px 20px; }
.disclaimer-text { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }
.disclaimer-text a { color: var(--accent); }
.site-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 20px; }
.footer-left { display: flex; flex-direction: column; gap: 2px; }
.footer-muted { font-size: 0.78rem; color: var(--muted); }
.footer-right { display: flex; gap: 16px; }
.footer-right a { font-size: 0.82rem; color: var(--muted); }
.footer-right a:hover { color: var(--text); }

/* --- Toast ----------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 12px;
  padding: 10px 20px; font-size: 0.88rem; color: var(--text); z-index: 100;
  transition: transform .3s ease; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* --- Visit banner ---------------------------------------------------------- */
.visit-banner { padding: 12px 18px; background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.3); }
.visit-banner p { font-size: 0.85rem; color: var(--text); }

/* --- Upgrade prompt -------------------------------------------------------- */
.upgrade-prompt {
  background: rgba(245,158,11,.07); border: 1px solid rgba(245,158,11,.3);
  border-radius: 14px; padding: 14px 18px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.upgrade-prompt p { font-size: 0.88rem; color: var(--text); }
.upgrade-prompt .btn { flex-shrink: 0; }
