:root {
  --bg: #07111f;
  --panel: #0f1c2f;
  --panel-2: #13243c;
  --line: #203756;
  --text: #edf4ff;
  --muted: #a8bbd6;
  --accent: #53b4ff;
  --accent-soft: rgba(83,180,255,.14);
  --accent-strong: #7ec6ff;
  --green: #39d98a;
  --red: #ff8c8c;
  --warn: #ffb547;
  --shadow: 0 16px 48px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(180deg, #040b15 0%, #08111f 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(17,29,49,.96), rgba(12,21,35,.96));
  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; }
.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(83,180,255,.4);
  border-radius: 999px;
  background: rgba(83,180,255,.06);
  transition: border-color .15s, color .15s, background .15s;
}
.hero-util-links a:hover { border-color: var(--accent); color: var(--accent); background: rgba(83,180,255,.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; min-height: 0; }
.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: #f97316; }
.hero-pill.med  { border-color: rgba(234,179,8,.45);  color: #eab308; }
.hero-pill.low  { border-color: var(--line); color: var(--muted); }
.hero-pill:hover, .hero-pill:focus { 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: #03101f; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(83,180,255,.3); }
.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 (sticky nav) --------------------------------------------- */
.mobile-command-bar {
  position: sticky; top: 8px; z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
}
.nav-chip {
  padding: 9px 8px; border-radius: 999px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; text-align: center;
  text-decoration: none; cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.nav-chip.active,
.nav-chip:hover { color: #fff; background: var(--accent-soft); border-color: var(--accent); }
.nav-chip.full-row { grid-column: 1 / -1; }

/* --- Quick view / stats --------------------------------------------------- */
.quick-view-head {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  margin-bottom: 14px; flex-wrap: wrap;
}
.section-label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 600; display: block; margin-bottom: 4px; }
.section-title { font-size: 1.15rem; font-weight: 700; }
.timestamp { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card {
  padding: 14px; border-radius: 16px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  transition: border-color .12s ease;
}
.stat-card:hover { border-color: var(--accent); }
.stat-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: #fff; }

.top-signal-row {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.mini-signal-card {
  padding: 14px; border-radius: 16px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.mini-signal-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.mini-signal-card h3 { font-size: 1.15rem; font-weight: 700; color: #fff; }
.mini-signal-card p { font-size: 0.85rem; color: var(--muted); margin: 0; }
.signal-kicker { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.mini-signal-meta { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Generic chrome ------------------------------------------------------- */
.brief-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.tag {
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.tag-btn { cursor: pointer; transition: background .12s ease; }
.tag-btn:hover { background: rgba(83,180,255,.28); }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.move { font-weight: 700; font-variant-numeric: tabular-nums; }
.move.up { color: var(--green); }
.move.down { color: var(--red); }
.empty-state { color: var(--muted); font-size: 0.9rem; padding: 16px; text-align: center; }
.source-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.source-list a { font-size: 0.82rem; color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* --- Lens / view selector panel ------------------------------------------- */
.lens-panel { padding-top: 10px; padding-bottom: 10px; }
.lens-panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.lens-panel-note { font-size: 0.78rem; color: var(--muted); }
.lens-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.lens-chip {
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.82rem; font-weight: 500;
  transition: all .12s ease;
}
.lens-chip.active { color: #fff; background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.lens-chip:hover { color: #fff; border-color: var(--accent); }

.brief-grid { display: flex; flex-direction: column; gap: 12px; }
.brief-item-card {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px;
  padding: 16px; border-radius: 16px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.brief-num {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--accent); color: #03101f;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1rem;
}
.brief-item-card h3 { margin-bottom: 6px; color: #fff; }

.detail-grid { display: grid; gap: 8px; }
.detail-grid.two-up { grid-template-columns: 1fr; }
.compact-grid { margin-top: 8px; }
@media (min-width: 720px) { .detail-grid.two-up { grid-template-columns: repeat(2, 1fr); } }
.detail-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.detail-box b { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.detail-box span { color: var(--text); font-size: 0.88rem; line-height: 1.45; }

.news-grid {
  display: grid; gap: 10px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.news-card {
  padding: 14px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.news-card.compact-card { padding: 12px; }
.news-card h3 { font-size: 0.95rem; color: #fff; margin-bottom: 2px; }
.news-card p { font-size: 0.84rem; margin: 0; }
.news-head { display: flex; gap: 8px; justify-content: space-between; align-items: baseline; }
.source-name { font-size: 0.75rem; color: var(--accent); font-weight: 600; letter-spacing: 0.04em; }

/* --- Materials panel ------------------------------------------------------ */
/*
 * Material chips: CSS grid with uniform cells — guarantees they never
 * overflow the panel or visually escape the container.
 */
.material-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-bottom: 14px;
  max-width: 100%;
}
.material-chip {
  padding: 9px 10px; border-radius: 12px;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.85rem; font-weight: 500;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all .12s ease;
}
.material-chip:hover { color: #fff; border-color: var(--accent); }
.material-chip.active {
  color: #03101f; background: var(--accent); border-color: var(--accent);
  font-weight: 700;
}

.materials-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.material-card {
  padding: 14px; border-radius: 16px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; transition: border-color .12s ease, transform .12s ease;
}
.material-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.material-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 6px 18px rgba(83,180,255,.18);
}
.material-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.material-card h3 {
  color: #fff;
  font-size: 1.05rem; font-weight: 700;
}
.material-category { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.material-condition { color: var(--warn); font-size: 0.82rem; font-weight: 600; margin: 0; }
.material-blurb { color: var(--muted); font-size: 0.85rem; margin: 0; }
.material-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 8px; }

/* --- Featured material-detail panel (decision engine) -------------------- */
.featured-panel {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(83,180,255,.18) inset, var(--shadow);
  padding: 22px;
}

.material-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.material-detail-title h2 {
  font-size: 1.75rem; font-weight: 800;
  color: #fff; margin: 2px 0 6px;
  letter-spacing: -0.01em;
}
.material-detail-sub { font-size: 0.82rem; color: var(--muted); }
.material-detail-badge {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
  padding: 10px 14px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  min-width: 180px;
}
.material-detail-condition { color: #fff; font-size: 0.95rem; font-weight: 700; text-align: right; }
.material-detail-signal { color: var(--accent-strong); font-size: 0.78rem; font-weight: 600; text-align: right; }

.material-price-strip {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  padding: 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  margin-bottom: 16px;
}
.material-price-strip.supply-watch { grid-template-columns: 1fr; }
.price-cell { display: flex; flex-direction: column; gap: 4px; }
.price-cell-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.price-cell-value { color: #fff; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.price-cell-value.small { font-size: 0.88rem; font-weight: 500; color: var(--muted); line-height: 1.35; }
.price-cell-value.move { font-variant-numeric: tabular-nums; }

.decision-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .decision-grid { grid-template-columns: repeat(2, 1fr); } }
.decision-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.decision-box b { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.decision-box span { color: var(--text); font-size: 0.95rem; line-height: 1.5; }
.decision-box.primary { background: linear-gradient(180deg, rgba(83,180,255,.1), rgba(83,180,255,.03)); border-color: var(--accent); }
.decision-box.action { background: rgba(255,181,71,.07); border-color: rgba(255,181,71,.45); }
.decision-box.action b { color: var(--warn); }

.related-context {
  display: flex; flex-direction: column; gap: 10px;
}
.related-context .section-label { margin-bottom: 0; }

/* Flash effect when switching materials — makes the content swap legible */
@keyframes detailFlash {
  0%   { box-shadow: 0 0 0 1px rgba(83,180,255,.18) inset, 0 0 0 4px rgba(83,180,255,.35); }
  100% { box-shadow: 0 0 0 1px rgba(83,180,255,.18) inset, var(--shadow); }
}
.featured-panel.flash { animation: detailFlash 0.7s ease-out; }

/* --- Signals -------------------------------------------------------------- */
.signal-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .signal-grid { grid-template-columns: repeat(2, 1fr); } }
.signal-card {
  padding: 16px; border-radius: 16px;
  background: var(--panel-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; transition: border-color .12s ease, transform .12s ease;
}
.signal-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.signal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.signal-head h3 { color: #fff; margin: 4px 0; }
.benchmark { font-size: 0.8rem; color: var(--muted); }
.signal-aside { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.price-now { color: #fff; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-now.small { font-size: 0.95rem; }

.metric-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
@media (min-width: 520px) { .metric-row { grid-template-columns: repeat(4, 1fr); } }
.metric-box {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.metric-box b { color: var(--accent); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.metric-box span { font-size: 0.86rem; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }

/* --- Methodology panel ---------------------------------------------------- */
.methodology-panel .section-label { margin-bottom: 4px; }
.methodology-panel .section-title { margin-bottom: 14px; }

/* --- Footer --------------------------------------------------------------- */
.site-footer {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; padding: 16px 20px;
}
.footer-left { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.footer-muted { color: var(--muted); font-size: 0.85rem; }

/* --- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 10px 16px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--accent);
  color: #fff; font-size: 0.88rem; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: all .24s ease; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Desktop tightening --------------------------------------------------- */
@media (min-width: 900px) {
  .page-shell { padding-top: 24px; }
  .panel { padding: 24px; }
  .hero { flex-direction: row; justify-content: space-between; align-items: center; }
  .hero-actions { flex-shrink: 0; }
  h1 { font-size: 2.4rem; }
  .featured-panel { padding: 28px; }
}

/* =============================================================================
   Ship 1 additions
   ========================================================================= */

/* Subhead below hero */
.subhead-muted {
  font-size: 0.85rem; color: var(--muted); margin-top: 8px;
}

/* Live feed status block with colored dot */
.feed-status-block {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 0.78rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}
.feed-status-row { display: flex; align-items: center; gap: 8px; }
.feed-status-detail {
  font-size: 0.72rem; color: var(--muted); opacity: 0.78;
  padding-left: 16px;
  line-height: 1.45;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--warn);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,181,71,.22);
}
.status-dot.live { background: var(--green); box-shadow: 0 0 0 2px rgba(57,217,138,.22); }
.status-dot.partial { background: var(--warn); box-shadow: 0 0 0 2px rgba(255,181,71,.22); }
.status-dot.fallback { background: var(--red); box-shadow: 0 0 0 2px rgba(255,140,140,.22); }

/* Section dividers inside the Today panel */
.section-divider {
  margin: 24px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.section-divider .section-label { margin-bottom: 2px; }
.section-note {
  font-size: 0.82rem; color: var(--muted); margin: 0;
  line-height: 1.4;
}

/* Signal & Policy Watch strip (replaces price strip for non-fuel materials) */
.material-signal-strip {
  padding: 14px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(83,180,255,.06), rgba(83,180,255,.02));
  border: 1px solid rgba(83,180,255,.35);
  margin-bottom: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.signal-strip-head {
  display: flex; flex-direction: column; gap: 2px;
}
.signal-strip-head .signal-strip-value {
  color: #fff; font-weight: 700; font-size: 1.05rem;
}
.signal-strip-body {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.signal-strip-item {
  display: flex; flex-direction: column; gap: 3px;
}
.signal-strip-value {
  color: #fff; font-weight: 600; font-size: 0.95rem; line-height: 1.35;
}
.signal-strip-value.small {
  font-weight: 500; font-size: 0.85rem; color: var(--text);
}
.signal-strip-value.direction {
  color: var(--warn); text-transform: capitalize;
}
.signal-strip-note {
  font-size: 0.78rem; color: var(--muted); font-style: italic;
  line-height: 1.45;
  padding-top: 8px; border-top: 1px dashed var(--line);
}

/* Source / geography / timestamp badges */
.source-badge-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.source-badge-row.tight { margin: 6px 0 0; }
.source-badge {
  padding: 3px 9px; border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em;
}
.source-badge.geo {
  background: rgba(83,180,255,.08); border-color: rgba(83,180,255,.35);
  color: var(--accent-strong);
}
.source-badge.time { color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-source-badge {
  font-size: 0.68rem; color: var(--muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Signal-mode mini-signal card */
.mini-signal-card h3.signal-mode {
  font-size: 1.1rem; font-weight: 700;
  color: var(--warn); text-transform: capitalize;
}
.tag.subtle {
  background: transparent; color: var(--muted); border-color: var(--line);
}
.price-now.small.signal-mode {
  color: var(--warn); text-transform: capitalize;
}
.signal-mode-note {
  font-size: 0.72rem; color: var(--muted); margin-top: 2px;
}

/* Movers cards */
.mover-card { cursor: pointer; }
.mover-card:hover { border-color: var(--accent); }

/* Search tab */
.search-panel { padding: 22px; }
.search-box-wrap {
  position: relative; margin-bottom: 14px;
}
.search-box {
  width: 100%;
  padding: 14px 42px 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.search-box::placeholder { color: var(--muted); }
.search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(83,180,255,.14);
}
.search-clear {
  position: absolute; top: 50%; right: 10px;
  transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 1.2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .12s ease, background .12s ease;
}
.search-clear:hover { color: #fff; background: var(--panel); }

.search-hint {
  padding: 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px dashed var(--line);
  color: var(--muted); font-size: 0.9rem; line-height: 1.5;
}
.search-categories {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.search-cat-chip {
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 500;
  transition: all .12s ease;
}
.search-cat-chip:hover {
  color: #fff; background: var(--accent-soft); border-color: var(--accent);
}

.search-result-count {
  font-size: 0.78rem; color: var(--muted); margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.search-result-card {
  padding: 14px 16px; border-radius: 14px;
  background: var(--panel-2); border: 1px solid var(--line);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .12s ease, transform .12s ease;
}
.search-result-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.search-result-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 4px;
}
.search-result-head h3 { color: #fff; font-size: 1.05rem; font-weight: 700; }
.search-result-condition {
  color: var(--warn); font-size: 0.82rem; font-weight: 600; margin: 0 0 6px;
}
.search-result-blurb {
  color: var(--muted); font-size: 0.88rem; margin: 0 0 10px;
}
.search-result-meta {
  display: flex; flex-direction: column; gap: 4px;
}
.search-result-meta-item {
  font-size: 0.8rem; color: var(--text); line-height: 1.4;
}
.search-result-meta-item b {
  color: var(--accent); font-weight: 700; margin-right: 4px;
  font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.search-empty {
  padding: 24px; text-align: center; color: var(--muted);
  border-radius: 12px; background: var(--panel-2);
  border: 1px dashed var(--line);
}

/* Disclaimer panel */
.disclaimer-panel {
  padding: 16px 20px;
  background: rgba(255,181,71,.04);
  border-color: rgba(255,181,71,.28);
}
.disclaimer-panel .section-label { color: var(--warn); }
.disclaimer-text {
  color: var(--muted); font-size: 0.82rem; line-height: 1.55;
  margin: 6px 0 0;
}
.disclaimer-text a { color: var(--accent); text-decoration: underline; }

/* Footer enhancements */
.footer-right {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.footer-right a {
  color: var(--muted); font-size: 0.85rem;
  text-decoration: none;
  transition: color .12s ease;
}
.footer-right a:hover { color: var(--accent); text-decoration: underline; }

/* Legal pages (terms, privacy) */
.legal-panel { padding: 28px; }
.legal-panel h2.section-title {
  margin-top: 28px; margin-bottom: 8px;
  font-size: 1.1rem; color: #fff;
}
.legal-panel h2.section-title:first-of-type { margin-top: 0; }
.legal-panel p {
  color: var(--text); font-size: 0.95rem; line-height: 1.65;
  margin: 0 0 12px;
}
.legal-panel a { color: var(--accent); }
.legal-list {
  padding-left: 20px; margin: 0 0 12px;
}
.legal-list li {
  color: var(--text); font-size: 0.95rem; line-height: 1.65;
  margin-bottom: 6px;
}
.legal-list li b { color: #fff; }
.legal-footer {
  margin-top: 28px !important; padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.82rem; font-style: italic;
}

/* =========================================================================
   GENERATION 1 — Credibility layer additions
   - "Since you last visited" banner (habit hook)
   - Per-material Impact-to-me calculator (free-tier value layer)
   ========================================================================= */

/* "Since you last visited" banner — appears above hero when prior session detected */
.visit-banner {
  background: linear-gradient(135deg, rgba(83,180,255,.10), rgba(83,180,255,.04));
  border: 1px solid rgba(83,180,255,.32);
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 8px;
}
.visit-banner[hidden] { display: none; }
.visit-banner-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.visit-banner-eyebrow {
  font-size: 0.72rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-strong); font-weight: 600;
}
.visit-banner-dismiss {
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(255,255,255,.04); color: var(--muted);
  font-size: 1.1rem; line-height: 1; display: grid; place-items: center;
  border: 1px solid var(--line);
  transition: background .15s;
}
.visit-banner-dismiss:hover { background: rgba(255,255,255,.10); color: var(--text); }
.visit-banner-body { display: flex; flex-direction: column; gap: 8px; }
.visit-banner-body strong { color: var(--text); font-size: 0.95rem; font-weight: 600; }
.visit-banner-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.visit-chip {
  background: rgba(83,180,255,.14);
  color: var(--accent-strong);
  border: 1px solid rgba(83,180,255,.30);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem; font-weight: 500;
  transition: background .15s;
}
.visit-chip:hover { background: rgba(83,180,255,.22); }
.visit-chip-more {
  font-size: 0.74rem; color: var(--muted); padding-left: 4px;
}

/* Impact-to-me calculator — sits between decision-grid and linked-context */
.impact-calc {
  margin-top: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(83,180,255,.06), rgba(83,180,255,.02));
  border: 1px solid rgba(83,180,255,.22);
  border-radius: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.impact-calc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
}
.impact-calc-title {
  font-size: 1rem; font-weight: 600; color: var(--text);
  margin-top: 2px;
}
.impact-calc-tag {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(83,180,255,.14); color: var(--accent-strong);
  border: 1px solid rgba(83,180,255,.28);
  border-radius: 999px; padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.impact-calc-body { display: flex; flex-direction: column; gap: 12px; }
.impact-calc-input { display: flex; flex-direction: column; gap: 6px; }
.impact-calc-input-label {
  font-size: 0.74rem; color: var(--muted);
  letter-spacing: .02em;
}
.impact-calc-input-wrap {
  display: flex; align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.impact-calc-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(83,180,255,.18);
}
.impact-calc-prefix {
  padding: 0 10px 0 14px;
  color: var(--muted); font-weight: 600;
  font-size: 0.95rem;
}
.impact-calc-field {
  flex: 1; min-width: 0;
  background: transparent;
  border: none; outline: none;
  color: var(--text);
  padding: 11px 14px 11px 0;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.impact-calc-field::-webkit-outer-spin-button,
.impact-calc-field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.impact-calc-field { -moz-appearance: textfield; }
.impact-calc-output {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
}
.impact-calc-output-cell {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.impact-calc-output-cell.primary {
  background: rgba(83,180,255,.10);
  border-color: rgba(83,180,255,.30);
}
.impact-calc-output-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
}
.impact-calc-output-value {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.impact-calc-output-value.low { color: var(--green); }
.impact-calc-output-value.base { color: var(--accent-strong); font-size: 1.15rem; }
.impact-calc-output-value.high { color: var(--warn); }
.impact-calc-output-label-row {
  font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; line-height: 1.4;
}
.impact-calc-note {
  font-size: 0.74rem; color: var(--muted); line-height: 1.55;
  margin: 0; padding: 0;
}

/* Mobile tweaks */
@media (max-width: 540px) {
  .impact-calc-output { grid-template-columns: 1fr; }
  .impact-calc-output-value.base { font-size: 1.05rem; }
}

/* --- Scroll-margin fix for sticky nav ---------------------------------------
 * The mobile-command-bar is position:sticky;top:8px and wraps to TWO rows on
 * narrow phones (Today/Signals on row 1, Materials/Search on row 2 — visible
 * in iOS Safari at <420px), giving it ~140px of total height. Anchored
 * sections (#today, #materials, #material-detail, #signals, #search) need
 * scroll-margin-top sized for that worst case so headings never hide under
 * the nav on hash navigation, Tab focus jumps, or any browser-native scroll. */
section[id], #material-detail {
  scroll-margin-top: 160px;
}
@media (min-width: 600px) {
  section[id], #material-detail {
    scroll-margin-top: 96px;
  }
}
