/* ============================================================
   JiffyScore AI — application chrome
   App-specific layout on top of the JiffyResources design system.
   DS tokens/components are loaded first; this adds the shell,
   data panels, score data-art, and responsive behaviour.
   ============================================================ */

/* reset the body for an app (DS base is fine, but kill smooth-scroll jump) */
body { min-height: 100vh; }

/* ---- App scalars ---------------------------------------- */
:root {
  --rail-w: 250px;
  --rail-collapsed: 76px;
  --topbar-h: 64px;
}

/* ============================================================
   SHELL
   ============================================================ */
.js-shell {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.4s var(--ease-out-expo);
}
.js-shell.is-collapsed { grid-template-columns: var(--rail-collapsed) 1fr; }

/* ---- Sidebar rail --------------------------------------- */
.js-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--off) 100%);
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
  z-index: 60;
}
.js-rail-head {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-h);
  padding: 0 18px;
  flex: none;
  border-bottom: 1px solid var(--line-soft);
}
.js-rail-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid; place-items: center;
  flex: none;
  box-shadow: var(--glow-gold);
}
.js-rail-mark img { width: 100%; height: 100%; object-fit: cover; }
.js-rail-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1;
}
.js-rail-word small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 500;
  margin-top: 3px;
}
.is-collapsed .js-rail-word { opacity: 0; pointer-events: none; }

.js-rail-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 12px 20px; }
.js-rail-scroll::-webkit-scrollbar { width: 6px; }
.js-rail-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.js-navgroup { margin-bottom: 8px; }
.js-navgroup-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 14px 12px 7px;
  white-space: nowrap;
  overflow: hidden;
}
.is-collapsed .js-navgroup-label { opacity: 0; height: 0; padding: 8px 0 0; }

.js-navitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background 0.25s, color 0.25s;
  white-space: nowrap;
  margin-bottom: 1px;
}
.js-navitem svg { width: 19px; height: 19px; flex: none; stroke-width: 1.9; }
.js-navitem:hover { background: var(--surface-2); color: var(--ink); }
.js-navitem.is-active {
  background: color-mix(in oklch, var(--gold-soft) 100%, transparent);
  color: var(--gold);
  font-weight: 600;
}
.js-navitem.is-active::before {
  content: '';
  position: absolute;
  left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
  box-shadow: var(--glow-gold);
}
.js-navitem .js-navlabel { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.is-collapsed .js-navitem .js-navlabel { opacity: 0; width: 0; }
.is-collapsed .js-navitem { justify-content: center; padding: 11px; }
.js-navitem .js-navbadge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--lime-gradient);
  color: var(--on-lime);
}
.is-collapsed .js-navitem .js-navbadge { display: none; }

.js-rail-foot { flex: none; padding: 12px; border-top: 1px solid var(--line-soft); }

/* ============================================================
   MAIN COLUMN + TOPBAR
   ============================================================ */
.js-main { min-width: 0; display: flex; flex-direction: column; }

.js-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 26px;
  background: color-mix(in oklch, var(--off) 82%, transparent);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.js-iconbtn {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  flex: none;
  position: relative;
}
.js-iconbtn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-soft); }
.js-iconbtn svg { width: 19px; height: 19px; }
.js-iconbtn .js-dot-alert {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--coral);
  border: 2px solid var(--off);
}

.js-crumbs { display: flex; align-items: center; gap: 9px; min-width: 0; }
.js-crumbs .c-sep { color: var(--mute); }
.js-crumbs .c-muted { color: var(--mute); font-size: 13px; }
.js-crumbs .c-now {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.js-topsearch { position: relative; flex: 1; max-width: 420px; }
.js-topsearch input {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: var(--bg-2);
  color: var(--ink);
  padding: 9px 14px 9px 40px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-family: inherit;
  transition: box-shadow 0.3s, border 0.3s;
}
.js-topsearch input::placeholder { color: var(--mute); }
.js-topsearch input:focus { outline: 0; border-color: var(--gold); box-shadow: var(--glow-gold); }
.js-topsearch svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--mute); }
.js-spacer { flex: 1; }

/* ---- role switcher -------------------------------------- */
.js-roleswitch { position: relative; flex: none; }
.js-roleswitch-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  transition: border-color 0.25s, background 0.25s;
}
.js-roleswitch-btn:hover { border-color: var(--gold); background: var(--surface-2); }
.js-roleswitch-btn .rs-glyph {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: var(--gold); color: var(--on-lime);
}
.js-roleswitch-btn .rs-meta { text-align: left; line-height: 1.15; }
.js-roleswitch-btn .rs-meta .rs-name { font-size: 13px; font-weight: 600; }
.js-roleswitch-btn .rs-meta .rs-role { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.js-roleswitch-btn svg { width: 15px; height: 15px; color: var(--mute); }

.js-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 264px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 8px;
  z-index: 90;
  animation: js-pop 0.22s var(--ease-out-expo);
}
@keyframes js-pop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
.js-menu-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); padding: 10px 12px 6px; }
.js-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-md);
  cursor: pointer; transition: background 0.2s;
}
.js-menu-item:hover { background: var(--surface-2); }
.js-menu-item .mi-glyph {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--gold); border: 1px solid var(--line-soft);
}
.js-menu-item.is-active .mi-glyph { background: var(--gold); color: var(--on-lime); border-color: transparent; }
.js-menu-item .mi-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.js-menu-item .mi-desc { font-size: 11.5px; color: var(--ink-soft); margin-top: 1px; }
.js-menu-item .mi-check { margin-left: auto; color: var(--lime); display: none; }
.js-menu-item.is-active .mi-check { display: block; }

/* ============================================================
   VIEW CONTAINER
   ============================================================ */
.js-view { padding: 34px 40px 90px; max-width: 1320px; margin: 0 auto; width: 100%; animation: js-fade 0.5s var(--ease-out-expo); }
.js-view--wide { max-width: 1560px; }
@keyframes js-fade { from { transform: translateY(10px); } to { transform: translateY(0); } }

.js-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 30px; }
.js-pagehead h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 12px 0 0;
  color: var(--ink);
}
.js-pagehead h1 em { color: var(--gold); font-style: normal; }
.js-pagehead .sub { color: var(--ink-soft); font-size: 15px; margin: 10px 0 0; max-width: 62ch; line-height: 1.55; }
.js-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   STAT STRIP
   ============================================================ */
.js-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.js-stat {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  transition: transform 0.5s var(--ease-out-expo), border-color 0.3s, box-shadow 0.4s;
}
.js-stat:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--shadow-2); }
.js-stat .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); display: flex; align-items: center; gap: 8px; }
.js-stat .k svg { width: 14px; height: 14px; color: var(--gold); }
.js-stat .v { font-family: var(--font-display); font-weight: 700; font-size: 42px; line-height: 1; color: var(--ink); margin: 12px 0 4px; letter-spacing: -0.02em; }
.js-stat .sub { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.js-stat .sub .up { color: var(--lime); font-family: var(--font-mono); font-weight: 600; }
.js-stat .sub .dn { color: var(--coral); font-family: var(--font-mono); font-weight: 600; }

/* ============================================================
   CARD HEADER (in-app section headers)
   ============================================================ */
.js-panel { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 26px 28px; }
.js-panel--raised { background: linear-gradient(165deg, var(--cream) 0%, var(--bg-2) 100%); border-color: var(--line); }
.js-panelhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.js-panelhead > div:first-child { flex: 1; min-width: 0; }
.js-panelhead > .js-head-actions { flex: none; }
.js-panelhead h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; margin: 6px 0 0; color: var(--ink); }
.js-panelhead h3 em { color: var(--gold); font-style: normal; }
.js-panelhead .pdesc { font-size: 13px; color: var(--ink-soft); margin: 7px 0 0; max-width: 56ch; line-height: 1.5; }

/* ============================================================
   PIPELINE / STEPPER
   ============================================================ */
.js-pipeline { display: flex; align-items: stretch; gap: 0; background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 8px; overflow-x: auto; }
.js-pipe-step {
  flex: 1; min-width: 130px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}
.js-pipe-step:hover { background: var(--surface-2); }
.js-pipe-step .ps-top { display: flex; align-items: center; gap: 10px; }
.js-pipe-num {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); color: var(--ink-soft); background: var(--bg-2);
}
.js-pipe-step.is-done .js-pipe-num { background: var(--emerald-soft); color: var(--emerald); border-color: transparent; }
.js-pipe-step.is-current .js-pipe-num { background: var(--lime-gradient); color: var(--on-lime); border-color: transparent; box-shadow: var(--glow-lime); }
.js-pipe-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.js-pipe-step.is-todo .js-pipe-name { color: var(--ink-soft); }
.js-pipe-state { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 9px; padding-left: 36px; }
.js-pipe-step.is-done .js-pipe-state { color: var(--emerald); }
.js-pipe-step.is-current .js-pipe-state { color: var(--lime); }
.js-pipe-step.is-todo .js-pipe-state { color: var(--mute); }
.js-pipe-step:not(:last-child)::after {
  content: ''; position: absolute; right: -1px; top: 18px; bottom: 18px; width: 1px; background: var(--line-soft);
}

/* ============================================================
   SCORE DATA-ART
   ============================================================ */
/* big hero dial wrapper */
.js-scorehero {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 36px;
  align-items: center;
}
.dial--xl { width: 320px; height: 320px; }
.dial--xl .num { font-size: 104px; }
.dial--sm { width: 132px; height: 132px; }
.dial--sm .num { font-size: 44px; }

/* radial mini gauge grid for 7 dimensions */
.js-gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.js-gauge {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
  text-align: center;
  cursor: default;
  transition: transform 0.45s var(--ease-out-expo), border-color 0.3s, box-shadow 0.4s;
  position: relative;
}
.js-gauge:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--glow-gold); }
.js-gauge .g-ring { width: 96px; height: 96px; margin: 0 auto 12px; position: relative; }
.js-gauge .g-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.js-gauge .g-ring .g-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 28px; color: var(--ink); }
.js-gauge .g-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.js-gauge .g-key { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin-top: 4px; }
.js-gauge .g-why {
  font-size: 11px; color: var(--ink-soft); line-height: 1.45;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.5s var(--ease-out-expo), opacity 0.4s, margin-top 0.4s;
}
.js-gauge:hover .g-why { max-height: 120px; opacity: 1; margin-top: 10px; }

/* radar / spider chart */
.js-radar { width: 100%; max-width: 460px; margin: 0 auto; display: block; }

/* generic dotted data-art backdrop */
.js-artback { position: relative; overflow: hidden; }
.js-artback::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
  mask-image: radial-gradient(circle at 80% 20%, black, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 80% 20%, black, transparent 70%);
}

/* ============================================================
   LIST ROWS (clients, audits, history)
   ============================================================ */
.js-rows { display: flex; flex-direction: column; gap: 10px; }
.js-rowcard {
  display: grid;
  align-items: center;
  gap: 20px;
  padding: 16px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.3s, transform 0.4s var(--ease-out-expo), box-shadow 0.4s;
}
.js-rowcard:hover { border-color: var(--line); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.js-rowcard .rc-title { font-weight: 600; color: var(--ink); font-size: 15px; }
.js-rowcard .rc-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.js-rowcard .rc-mono { font-family: var(--font-mono); font-size: 13px; color: var(--gold); font-weight: 600; }

/* mini score chip used in rows */
.js-scorechip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  padding: 5px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line-soft); background: var(--bg-2);
}
.js-scorechip .sc-ring { width: 10px; height: 10px; border-radius: 50%; }

/* ============================================================
   TABLE
   ============================================================ */
.js-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.js-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--mute); font-weight: 500;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.js-table td { padding: 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); vertical-align: top; }
.js-table tr:last-child td { border-bottom: 0; }
.js-table tr:hover td { background: color-mix(in oklch, var(--surface-2) 40%, transparent); }
.js-table .t-strong { color: var(--ink); font-weight: 600; }
.js-table-wrap { overflow-x: auto; border-radius: var(--r-md); }

/* ============================================================
   GAP / GUIDANCE CARDS
   ============================================================ */
.js-gap {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--mute);
  border-radius: var(--r-md);
  padding: 18px 22px;
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s;
}
.js-gap:hover { transform: translateX(3px); box-shadow: var(--shadow-2); }
.js-gap.sev-critical, .js-gap.sev-high { border-left-color: var(--coral); }
.js-gap.sev-medium { border-left-color: var(--gold); }
.js-gap.sev-low { border-left-color: var(--emerald); }
.js-gap h4 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 0 0 8px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.js-gap .meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.js-gap p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 8px; }
.js-gap .action { font-size: 13px; color: var(--ink); background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px 14px; line-height: 1.5; }
.js-gap .action b { color: var(--gold); font-weight: 600; }

/* ============================================================
   ASSET CARDS (approve / reject)
   ============================================================ */
.js-asset {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.3s, box-shadow 0.4s;
}
.js-asset.is-approved { border-color: rgba(123,220,140,0.4); box-shadow: 0 0 0 1px rgba(123,220,140,0.18); }
.js-asset.is-rejected { opacity: 0.55; }
.js-asset .a-type { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.js-asset h4 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 4px 0 0; color: var(--ink); }
.js-asset .a-body { font-size: 13px; color: var(--ink-soft); line-height: 1.55; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 13px 15px; max-height: 150px; overflow: auto; font-family: var(--font-mono); white-space: pre-wrap; }
.js-asset .a-actions { display: flex; gap: 8px; margin-top: auto; }

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */
.js-empty {
  text-align: center;
  padding: 54px 32px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
}
.js-empty .e-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-soft); display: grid; place-items: center; margin: 0 auto 18px; color: var(--gold); }
.js-empty .e-ico svg { width: 26px; height: 26px; }
.js-empty h4 { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin: 0 0 8px; color: var(--ink); }
.js-empty p { font-size: 13.5px; color: var(--ink-soft); max-width: 42ch; margin: 0 auto 20px; line-height: 1.55; }

.js-skel { background: linear-gradient(100deg, var(--surface-2) 30%, var(--cream-2) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: js-shine 1.4s ease-in-out infinite; border-radius: var(--r-sm); }
@keyframes js-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* spinner */
.js-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold); animation: js-rot 0.8s linear infinite; display: inline-block; }
@keyframes js-rot { to { transform: rotate(360deg); } }

/* ============================================================
   GENERIC UTILITIES
   ============================================================ */
.js-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.js-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.js-cols-main { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.muted2 { color: var(--ink-soft); }
.js-divider { height: 1px; background: var(--line-soft); margin: 26px 0; border: 0; }
.js-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.js-link-gold { color: var(--gold); font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.js-link-gold svg { flex: none; }
.js-link-gold:hover { text-decoration: underline; }

/* mono number */
.js-num { font-family: var(--font-mono); font-weight: 600; }

/* section anchor subnav for report */
.js-subnav { position: sticky; top: var(--topbar-h); z-index: 30; display: flex; gap: 6px; padding: 12px 0; background: color-mix(in oklch, var(--off) 90%, transparent); backdrop-filter: blur(10px); margin-bottom: 6px; overflow-x: auto; }
.js-subnav a { font-size: 12.5px; color: var(--ink-soft); padding: 7px 14px; border-radius: var(--r-pill); white-space: nowrap; cursor: pointer; transition: background 0.25s, color 0.25s; border: 1px solid transparent; }
.js-subnav a:hover { background: var(--surface-2); color: var(--ink); }
.js-subnav a.is-active { background: var(--gold-soft); color: var(--gold); border-color: var(--line-soft); font-weight: 600; }

/* ============================================================
   MOBILE NAV (drawer + bottom bar) — hidden on desktop
   ============================================================ */
.js-backdrop { display: none; }
.js-mobnav { display: none; }
.js-hamburger { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .js-cols-main { grid-template-columns: 1fr; }
  .js-scorehero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}
@media (max-width: 1080px) {
  .js-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  /* collapse the shell to single column; sidebar becomes a drawer */
  .js-shell, .js-shell.is-collapsed { grid-template-columns: 1fr; }
  .js-rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--rail-w);
    transform: translateX(-100%);
    transition: transform 0.4s var(--ease-out-expo);
    box-shadow: var(--shadow-3);
  }
  .js-shell.is-drawer-open .js-rail { transform: translateX(0); }
  .is-collapsed .js-rail-word { opacity: 1; }
  .is-collapsed .js-navitem .js-navlabel { opacity: 1; width: auto; }
  .is-collapsed .js-navitem { justify-content: flex-start; padding: 10px 12px; }
  .is-collapsed .js-navgroup-label { opacity: 1; height: auto; padding: 14px 12px 7px; }
  .js-backdrop {
    display: block;
    position: fixed; inset: 0; z-index: 55;
    background: rgba(4, 12, 8, 0.6);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
  }
  .js-shell.is-drawer-open .js-backdrop { opacity: 1; pointer-events: auto; }
  .js-hamburger { display: grid; }
  .js-collapse-btn { display: none; }
  .js-view { padding: 24px 20px 110px; }
  .js-grid-2, .js-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .js-topsearch { display: none; }
  /* bottom tab bar */
  .js-mobnav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 58;
    background: color-mix(in oklch, var(--bg-2) 94%, transparent);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--line-soft);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .js-mobnav button {
    flex: 1; background: transparent; border: 0;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 2px; color: var(--ink-soft); font-size: 10px; font-weight: 500;
    border-radius: var(--r-md);
  }
  .js-mobnav button svg { width: 21px; height: 21px; }
  .js-mobnav button.is-active { color: var(--gold); }
}
@media (max-width: 720px) {
  .js-pagehead h1 { font-size: 28px; }
  .js-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .js-view { padding: 20px 16px 110px; }
  .js-stat .v { font-size: 34px; }
  .js-roleswitch-btn .rs-meta { display: none; }
}
@media (max-width: 520px) {
  .js-stats { grid-template-columns: 1fr; }
}

/* ---- login responsive ---- */
.seg-opt { white-space: nowrap; }

/* ============================================================
   PREFERENCES SLIDE-OVER
   ============================================================ */
.pref-backdrop {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(4, 12, 8, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease-out-quart);
}
.pref-backdrop.is-open { opacity: 1; pointer-events: auto; }

.pref-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 121;
  width: min(468px, 94vw);
  display: flex; flex-direction: column;
  background: var(--off);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transform: translateX(102%);
  transition: transform 0.5s var(--ease-out-expo);
}
.pref-panel.is-open { transform: translateX(0); }
.pref-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--lime-gradient); z-index: 2;
}

.pref-head { padding: 30px 32px 22px; border-bottom: 1px solid var(--line-soft); position: relative; flex: none; }
.pref-head .eyebrow { margin-bottom: 12px; }
.pref-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 38px; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.pref-close {
  position: absolute; top: 28px; right: 28px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--ink-soft);
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.pref-close:hover { background: var(--surface-2); color: var(--ink); transform: rotate(90deg); }

.pref-body { flex: 1; overflow-y: auto; padding: 8px 32px 24px; }
.pref-body::-webkit-scrollbar { width: 7px; }
.pref-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.pref-sect { padding: 24px 0; border-bottom: 1px solid var(--line-soft); }
.pref-sect:last-child { border-bottom: 0; }
.pref-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.pref-desc { font-size: 13.5px; color: var(--ink-soft); margin: 8px 0 16px; line-height: 1.5; }

.pref-seg { display: flex; background: var(--bg-2); padding: 5px; border-radius: var(--r-pill); gap: 4px; border: 1px solid var(--line-soft); }
.pref-seg button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  padding: 12px 10px; border-radius: var(--r-pill);
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.pref-seg button svg { width: 16px; height: 16px; }
.pref-seg button.is-on { background: var(--gold-soft); color: var(--gold); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.pref-seg button.is-on.tone-lime { background: var(--lime-gradient); color: var(--on-lime); box-shadow: var(--glow-lime); }

.pref-palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pref-palette {
  text-align: left; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 18px; position: relative;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s, background 0.3s;
}
.pref-palette:hover { transform: translateY(-2px); border-color: var(--line); }
.pref-palette.is-on { border-color: var(--gold); box-shadow: var(--glow-gold); background: var(--gold-soft); }
.pref-palette .pp-dots { display: flex; gap: 7px; margin-bottom: 14px; }
.pref-palette .pp-dots span { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); }
.pref-palette .pp-name { font-size: 15px; font-weight: 600; color: var(--ink); }
.pref-palette .pp-meta { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.pref-palette .pp-check {
  position: absolute; top: 16px; right: 16px; color: var(--gold);
  opacity: 0; transform: scale(0.6); transition: opacity 0.25s, transform 0.25s var(--ease-spring);
}
.pref-palette.is-on .pp-check { opacity: 1; transform: scale(1); }

.pref-foot {
  flex: none; display: flex; gap: 12px; padding: 18px 32px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft); background: var(--off);
}
.pref-foot .btn { flex: 1; justify-content: center; }

@media (max-width: 520px) {
  .pref-head h2 { font-size: 30px; }
  .pref-body, .pref-head, .pref-foot { padding-left: 22px; padding-right: 22px; }
}

/* ============================================================
   SCORE LAB — "why this score?" drawer + what-if simulator
   ============================================================ */
.lab-backdrop {
  position: fixed; inset: 0; z-index: 130;
  background: rgba(4, 12, 8, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease-out-quart);
}
.lab-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* affordance on gauges / dials */
.lab-why { position: absolute; cursor: pointer; }
.js-gauge { cursor: pointer; }
.lab-why-pill {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); background: var(--gold-soft); border: 1px solid var(--line-soft);
  padding: 4px 9px; border-radius: var(--r-pill);
  opacity: 0; transform: translateY(-3px); transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.js-gauge:hover .lab-why-pill { opacity: 1; transform: none; }
.lab-dial-trigger { cursor: pointer; position: relative; }
.lab-dial-hint {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold); background: var(--white); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: var(--r-pill); box-shadow: var(--shadow-2);
  opacity: 0; transition: opacity 0.3s, transform 0.3s; white-space: nowrap;
}
.lab-dial-trigger:hover .lab-dial-hint { opacity: 1; transform: translateX(-50%) translateY(4px); }

/* ---- A · forensic side-drawer ---- */
.lab-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 131;
  width: min(560px, 96vw);
  background: var(--off);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transform: translateX(102%);
  transition: transform 0.55s var(--ease-out-expo);
  display: flex; flex-direction: column;
}
.lab-drawer.is-open { transform: translateX(0); }
.lab-drawer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--lime-gradient); z-index: 4; }
.lab-drawer-inner { display: flex; flex-direction: column; height: 100%; }

.lab-head { position: relative; flex: none; padding: 28px 30px 20px; border-bottom: 1px solid var(--line-soft); }
.lab-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: -0.02em; margin: 10px 0 0; color: var(--ink); }
.lab-head h2 em { color: var(--gold); font-style: normal; }
.lab-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin: 10px 0 0; max-width: 52ch; }
.lab-sub b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }
.lab-close {
  position: absolute; top: 24px; right: 24px;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--ink-soft);
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.lab-close:hover { background: var(--surface-2); color: var(--ink); transform: rotate(90deg); }

.lab-body { flex: 1; overflow-y: auto; padding: 22px 30px 30px; }
.lab-body::-webkit-scrollbar { width: 7px; }
.lab-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.lab-dialrow { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; margin-bottom: 26px; }
.lab-formula { min-width: 0; }
.lab-code {
  display: block; font-family: var(--font-mono); font-size: 12.5px; color: var(--gold);
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: 11px 13px; line-height: 1.5; word-break: break-word;
}
.lab-fnote { font-size: 12px; color: var(--ink-soft); line-height: 1.5; margin: 10px 0 0; }

/* LabDial */
.lab-dial { position: relative; flex: none; }
.lab-dial svg { width: 100%; height: 100%; }
.ld-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ld-num { font-family: var(--font-display); font-weight: 700; line-height: 0.9; font-size: 46px; letter-spacing: -0.02em; }
.lab-dial[style*="196"] .ld-num { font-size: 70px; }
.ld-lbl { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); margin-top: 6px; }
.ld-delta { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--lime); margin-top: 5px; }
.ld-delta span { color: var(--mute); font-weight: 400; }
.ld-delta--flat { color: var(--mute); }

.lab-sect { padding: 20px 0; border-top: 1px solid var(--line-soft); }
.lab-secthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.lab-reset { background: transparent; border: 0; color: var(--gold); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; cursor: pointer; }
.lab-reset:hover { text-decoration: underline; }

/* FactorBar */
.lab-factor { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.lab-factor:last-child { border-bottom: 0; }
.lf-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.lf-name { font-size: 13.5px; font-weight: 600; color: var(--ink); flex: 1; min-width: 0; }
.lf-weight { font-family: var(--font-mono); font-size: 10.5px; color: var(--mute); flex: none; }
.lf-vals { font-family: var(--font-mono); font-size: 13px; font-weight: 600; flex: none; display: inline-flex; align-items: center; gap: 5px; }
.lf-arrow { color: var(--mute); }
.lf-track { position: relative; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.lf-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 99px; transition: width 0.6s var(--ease-out-expo); }
.lf-gain { position: absolute; top: 0; height: 100%; background: var(--lime-gradient); border-radius: 99px; box-shadow: var(--glow-lime); transition: left 0.6s var(--ease-out-expo), width 0.6s var(--ease-out-expo); }
.lf-meta { margin-top: 8px; }
.lf-why { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.lf-evid { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }
.lf-evid .js-tag { color: var(--gold); margin-right: 6px; }

/* dimension overview rows (total focus) */
.lab-dimlist { display: flex; flex-direction: column; gap: 12px; }
.lab-dimrow { display: flex; align-items: center; gap: 12px; }
.ldr-name { font-size: 12.5px; color: var(--ink); width: 124px; flex: none; }
.ldr-name i { font-family: var(--font-mono); font-style: normal; font-size: 9.5px; color: var(--mute); margin-left: 4px; }
.ldr-val { font-family: var(--font-mono); font-size: 12px; font-weight: 600; flex: none; display: inline-flex; align-items: center; gap: 4px; width: 78px; justify-content: flex-end; }

/* FixToggle */
.lab-fixes { display: flex; flex-direction: column; gap: 10px; }
.lab-fix {
  display: flex; gap: 12px; text-align: left; cursor: pointer;
  background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 14px 15px; transition: border-color 0.25s, background 0.25s, transform 0.3s;
}
.lab-fix:hover { border-color: var(--line); transform: translateY(-2px); }
.lab-fix.is-on { border-color: var(--lime); background: color-mix(in oklch, var(--lime) 8%, var(--white)); }
.fx-check {
  width: 22px; height: 22px; border-radius: 7px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--line); display: grid; place-items: center; color: var(--on-lime);
  transition: background 0.25s, border-color 0.25s;
}
.lab-fix.is-on .fx-check { background: var(--lime-gradient); border-color: transparent; box-shadow: var(--glow-lime); }
.fx-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.fx-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.fx-tags { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.fx-effort { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-soft); color: var(--ink-soft); }
.fx-effort--low { color: var(--emerald); border-color: color-mix(in oklch, var(--emerald) 40%, transparent); }
.fx-effort--med { color: var(--gold); border-color: color-mix(in oklch, var(--gold) 40%, transparent); }
.fx-lift { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--lime); }

/* drawer footer */
.lab-foot {
  flex: none; padding: 16px 30px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft); background: var(--off);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.lf-score { display: flex; align-items: center; gap: 9px; }
.lf-score .js-tag { color: var(--mute); }
.lf-now { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--ink-soft); }
.lf-proj { font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: -0.02em; transition: color 0.3s; }
.lf-deltabig { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--on-lime); background: var(--lime-gradient); padding: 3px 9px; border-radius: 99px; white-space: nowrap; display: inline-block; box-shadow: var(--glow-lime); }

/* ---- B · editorial takeover sheet ---- */
.lab-sheet {
  position: fixed; top: 50%; left: 50%; z-index: 131;
  width: min(1000px, 94vw); max-height: 92vh; overflow: hidden;
  background: var(--off); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  transform: translate(-50%, -46%) scale(0.97); opacity: 0; pointer-events: none;
  transition: transform 0.55s var(--ease-out-expo), opacity 0.4s;
}
.lab-sheet.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.lab-sheet::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--lime-gradient); z-index: 4; }
.lab-sheet-inner { max-height: 92vh; overflow-y: auto; }
.lab-sheet-inner::-webkit-scrollbar { width: 8px; }
.lab-sheet-inner::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.lab-close--sheet { z-index: 6; }

.es-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; min-height: 480px; }
.es-why { padding: 40px 38px; border-right: 1px solid var(--line-soft); }
.es-h { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 3vw, 42px); letter-spacing: -0.02em; line-height: 1.04; margin: 14px 0 0; color: var(--ink); }
.es-h em { color: var(--gold); font-style: normal; }
.es-lead { font-size: 15px; color: var(--ink-soft); line-height: 1.6; margin: 16px 0 26px; max-width: 42ch; }
.es-lead b { color: var(--ink); }

.es-dimlist { display: flex; flex-direction: column; gap: 14px; }
.es-dimrow { display: flex; align-items: center; gap: 14px; }
.ed-name { font-size: 13px; color: var(--ink); width: 120px; flex: none; }
.ed-val { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--ink); flex: none; width: 30px; text-align: right; }

.es-factors { display: flex; flex-direction: column; gap: 2px; }
.es-factor { padding: 14px 0; border-bottom: 1px solid var(--line-soft); transition: padding 0.3s; }
.es-factor:last-child { border-bottom: 0; }
.es-factor.is-lifted { padding-left: 14px; border-left: 2px solid var(--lime); }
.ef-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ef-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.ef-val { font-family: var(--font-display); font-weight: 700; font-size: 22px; transition: color 0.3s; }
.ef-evid { font-size: 12px; color: var(--ink-soft); line-height: 1.5; margin: 6px 0 0; }

.es-sim { padding: 40px 38px; background: linear-gradient(165deg, var(--cream) 0%, var(--bg-2) 100%); display: flex; flex-direction: column; gap: 22px; }
.es-dialwrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.es-projnote { font-size: 13px; color: var(--ink-soft); text-align: center; line-height: 1.5; margin: 0; }
.es-projnote b { color: var(--lime); font-family: var(--font-mono); }
.es-packhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.es-fixes { display: flex; flex-direction: column; gap: 10px; }
.lab-fix--card { background: var(--white); }
.es-timeline { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 16px 18px; }
.es-tlabels { display: flex; justify-content: space-between; margin-top: 6px; }
.es-tlabels .es-proj { color: var(--lime); font-weight: 600; }

/* ---- Steal the citation (reuses .lab-drawer shell) ---- */
.steal-q { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; line-height: 1.15; margin: 10px 0 0; color: var(--ink); }
.steal-compare { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 26px; }
.steal-col { background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 16px 17px; }
.steal-col--them { border-color: color-mix(in oklch, var(--lime) 35%, var(--line-soft)); background: color-mix(in oklch, var(--lime) 5%, var(--white)); }
.steal-colhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.steal-who { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--mute); text-transform: uppercase; }
.steal-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: var(--r-pill); letter-spacing: 0.02em; }
.steal-badge .dot { width: 6px; height: 6px; border-radius: 99px; }
.steal-badge--cited { background: color-mix(in oklch, var(--lime) 16%, transparent); color: var(--lime-deep); }
.steal-badge--cited .dot { background: var(--lime); }
.steal-badge--weak { background: color-mix(in oklch, var(--amber) 16%, transparent); color: var(--amber); }
.steal-badge--weak .dot { background: var(--amber); }
.steal-badge--absent { background: color-mix(in oklch, var(--coral) 14%, transparent); color: var(--coral); }
.steal-badge--absent .dot { background: var(--coral); }
.steal-passage { margin: 0; padding: 0 0 0 13px; border-left: 2px solid var(--line); font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); font-family: var(--font-body); }
.steal-passage--cited { border-left-color: var(--lime); color: var(--ink); }
.steal-passage--you { border-left-color: var(--amber); }
.steal-empty { display: flex; align-items: center; gap: 10px; padding: 14px 0 4px; color: var(--mute); font-size: 13px; font-style: italic; }
.steal-empty svg { flex: none; color: var(--coral); }
.steal-why { font-size: 12px; line-height: 1.5; color: var(--ink-soft); margin: 12px 0 0; }
.steal-why .js-tag { display: block; margin-bottom: 4px; }
.steal-vs { display: flex; align-items: center; justify-content: center; }
.steal-vs span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--mute); text-transform: uppercase; padding: 2px 0; }

.steal-moves { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: none; }
.steal-move { display: flex; gap: 13px; }
.sm-num { flex: none; width: 24px; height: 24px; border-radius: 7px; background: color-mix(in oklch, var(--gold) 14%, transparent); color: var(--gold); font-family: var(--font-mono); font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-top: 1px; }
.sm-body { display: flex; flex-direction: column; gap: 3px; }
.sm-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.sm-detail { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.steal-foot-note { display: flex; align-items: center; gap: 10px; min-width: 0; }
.steal-fixname { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* a stealable Visibility row gets a quiet "steal" affordance */
.js-steal-row { cursor: pointer; }
.js-steal-cta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--gold); white-space: nowrap; transition: gap 0.25s; }
.js-steal-row:hover .js-steal-cta { gap: 9px; }

/* ---- Guided tour (spotlight coachmarks) ---- */
.tour-root { position: fixed; inset: 0; z-index: 200; }
.tour-catch { position: absolute; inset: 0; }
.tour-spot {
  position: fixed; border-radius: var(--r-md);
  box-shadow: 0 0 0 9999px rgba(4, 12, 8, 0.74), 0 0 0 2px var(--gold), var(--glow-gold);
  pointer-events: none;
  transition: top 0.45s var(--ease-out-expo), left 0.45s var(--ease-out-expo), width 0.45s var(--ease-out-expo), height 0.45s var(--ease-out-expo);
}
.tour-tip {
  position: fixed; background: var(--off); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 20px 16px; box-shadow: var(--shadow-3);
  transition: top 0.4s var(--ease-out-expo), left 0.4s var(--ease-out-expo);
}
.tour-tip::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--lime-gradient); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.tour-tiphead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tour-skip { background: none; border: 0; color: var(--mute); font-size: 12px; cursor: pointer; padding: 2px 4px; transition: color 0.2s; }
.tour-skip:hover { color: var(--ink); }
.tour-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 6px; }
.tour-body { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 14px; }
.tour-dots { display: flex; gap: 6px; margin-bottom: 14px; }
.tour-dot { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: background 0.3s, width 0.3s; }
.tour-dot.is-on { width: 18px; background: var(--gold); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-back { background: none; border: 0; color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 4px; transition: color 0.2s; }
.tour-back:hover { color: var(--ink); }

/* richer first-run hero */
.fr-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; margin-bottom: 22px; }
.fr-steps { display: flex; flex-direction: column; gap: 0; }
.fr-step { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.fr-step:last-child { border-bottom: 0; }
.fr-num { flex: none; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in oklch, var(--gold) 13%, transparent); color: var(--gold); font-family: var(--font-mono); font-weight: 600; font-size: 13px; display: grid; place-items: center; }
.fr-stepbody { display: flex; flex-direction: column; gap: 3px; }
.fr-steplabel { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.fr-stepdesc { font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 860px) { .fr-hero { grid-template-columns: 1fr; } }

@media (max-width: 820px) {
  .es-grid { grid-template-columns: 1fr; }
  .es-why { border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 32px 26px; }
  .es-sim { padding: 32px 26px; }
  .lab-dialrow { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}
@media (max-width: 520px) {
  .lab-head, .lab-body, .lab-foot { padding-left: 20px; padding-right: 20px; }
  .lab-foot { flex-direction: column; align-items: stretch; }
  .lab-foot .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   LOGIN — responsive split + emblem hero
   ============================================================ */
.js-login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.js-login-brand {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--cream) 0%, var(--off) 100%);
  border-right: 1px solid var(--line);
  padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between;
}
.js-login-glow { position: absolute; inset: 0; background: radial-gradient(circle at 75% 15%, var(--gold-soft), transparent 55%), radial-gradient(circle at 20% 90%, rgba(141,230,90,0.10), transparent 50%); }
.js-login-emblem {
  position: absolute; width: 560px; max-width: 80%; right: -120px; bottom: -90px;
  opacity: 0.14; pointer-events: none; filter: saturate(1.1);
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 78%);
          mask-image: radial-gradient(circle, #000 55%, transparent 78%);
}
.js-login-mark { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--glow-gold); flex: none; }
.js-login-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.js-login-form { display: grid; place-items: center; padding: 40px 32px; }
.js-login-formmark { display: none; align-items: center; gap: 10px; margin-bottom: 24px; }

@media (max-width: 860px) {
  .js-login { grid-template-columns: 1fr; }
  .js-login-brand { display: none; }
  .js-login-formmark { display: flex; }
  .js-login-form { padding: 32px 22px; align-items: start; padding-top: 7vh; }
}

@media (max-width: 380px) {
  .js-login-form { padding: 28px 16px; padding-top: 5vh; }
}

/* ============================================================
   ENGINE TRENDS — AI source share small-multiples (#4)
   ============================================================ */
.js-engtrends { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.js-engtrends.is-compact { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.js-engcard {
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 16px 16px 13px; display: flex; flex-direction: column; gap: 9px;
  transition: border-color 0.3s, transform 0.4s var(--ease-out-expo);
}
.js-engcard:hover { border-color: var(--line); transform: translateY(-2px); }
.ec-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ec-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec-trend { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; flex: none; }
.ec-figs { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.ec-cites { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -0.02em; }
.ec-unit { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.ec-mult { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--lime); margin-left: auto; }
.ec-spark { margin: 2px 0; }
.ec-foot { display: flex; justify-content: space-between; gap: 8px; }

/* ============================================================
   RECOMMENDATIONS — pack projection (#3)
   ============================================================ */
.js-packproj {
  display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center;
  background: linear-gradient(165deg, var(--cream) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 26px; margin-bottom: 20px;
}
.pp-dialwrap { flex: none; }
.pp-body { min-width: 0; }
.pp-scoreline { display: flex; align-items: center; gap: 12px; margin: 8px 0 8px; flex-wrap: wrap; }
.pp-now { font-family: var(--font-display); font-weight: 700; font-size: 30px; color: var(--ink-soft); line-height: 1; }
.pp-proj { font-family: var(--font-display); font-weight: 700; font-size: 44px; letter-spacing: -0.02em; line-height: 1; transition: color 0.4s; }
.pp-note { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin: 0; max-width: 60ch; }

.a-projrow { display: flex; align-items: center; gap: 12px; }
.a-lift { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--lime); }
.a-lift svg { width: 13px; height: 13px; }
.a-lift--none { color: var(--ink-soft); }

/* ============================================================
   WHAT SHIPPED — closed-loop report (#3)
   ============================================================ */
.js-ship { display: flex; flex-direction: column; }
.js-shipitem { display: grid; grid-template-columns: 22px 1fr; gap: 14px; }
.si-rail { position: relative; display: flex; justify-content: center; }
.si-rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line-soft); }
.js-shipitem:first-child .si-rail::before { top: 9px; }
.js-shipitem:last-child .si-rail::before { bottom: calc(100% - 9px); }
.si-dot { position: relative; z-index: 1; width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; background: var(--lime); box-shadow: var(--glow-lime); border: 2px solid var(--off); }
.si-body { padding: 0 0 22px; min-width: 0; }
.js-shipitem:last-child .si-body { padding-bottom: 0; }
.si-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.si-label { font-size: 15px; font-weight: 600; color: var(--ink); }
.si-earn { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--lime); flex: none; }
.si-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 8px; }
.si-engine { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.si-detail { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin: 0; max-width: 72ch; }

/* ============================================================
   IN THE ANSWER — answer-engine preview (#2)
   ============================================================ */
.ans-layout { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }

.ans-rail { display: flex; flex-direction: column; gap: 8px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.ans-qitem {
  text-align: left; cursor: pointer; background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 14px 15px; display: flex; flex-direction: column; gap: 9px;
  transition: border-color 0.25s, transform 0.35s var(--ease-out-expo), background 0.25s;
}
.ans-qitem:hover { border-color: var(--line); transform: translateY(-1px); }
.ans-qitem.is-active { border-color: var(--gold); background: var(--gold-soft); box-shadow: var(--glow-gold); }
.aq-q { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.aq-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aq-engine { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--mute); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ans-stage { min-width: 0; }
.ans-prompt {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-pill);
  padding: 11px 18px; margin-bottom: 16px;
}
.ans-promptlabel { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); flex: none; }
.ans-promptq { font-size: 15px; color: var(--ink); font-weight: 500; }

.ans-toggle { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--r-pill); padding: 4px; gap: 4px; margin-bottom: 18px; }
.ans-tg {
  border: 0; background: transparent; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); padding: 9px 20px; border-radius: var(--r-pill); transition: background 0.3s, color 0.3s, box-shadow 0.3s; white-space: nowrap;
}
.ans-tg.is-on { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line); }
.ans-tg--after.is-on { background: var(--lime-gradient); color: var(--on-lime); box-shadow: var(--glow-lime); }

.ans-own { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 16px; border-radius: var(--r-md); background: color-mix(in oklch, var(--lime) 9%, var(--white)); border: 1px solid color-mix(in oklch, var(--lime) 35%, var(--line-soft)); font-size: 13.5px; color: var(--ink); }
.ans-own svg { color: var(--lime); flex: none; }

/* the answer card itself */
.ans-card {
  background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  padding: 26px 28px; position: relative; overflow: hidden;
  animation: js-fade 0.45s var(--ease-out-expo);
}
.ans-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--eng); opacity: 0.85; }
.ans-cardtop { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.ans-mark { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--off); }
.ans-engmeta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ans-engname { font-size: 15px; font-weight: 700; color: var(--ink); font-family: var(--font-display); }
.ans-engsub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.ans-aibadge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); border: 1px solid var(--line-soft); border-radius: var(--r-pill); padding: 5px 11px; flex: none; }
.ans-aidot { width: 6px; height: 6px; border-radius: 50%; background: var(--eng); }

.ans-text { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 22px; }
.ans-strong { color: var(--ink); font-weight: 600; }
.ans-ent { color: var(--ink); font-weight: 600; }
.ans-ent.is-you { color: var(--lime-deep); font-weight: 700; text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--lime) 60%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ans-sup { font-family: var(--font-mono); font-size: 9px; font-weight: 600; color: var(--gold); vertical-align: super; margin-left: 1px; text-decoration: none; display: inline-block; }
.ans-ent.is-you .ans-sup { color: var(--lime-deep); }

/* token streaming — engine "generates" the answer word by word */
.ans-tok { display: inline; }
@media (prefers-reduced-motion: no-preference) {
  .ans-card.is-streaming .ans-tok { opacity: 0; animation: ans-tok-in 0.38s var(--ease-out-quart) both; animation-delay: calc(var(--i) * 26ms); }
}
@keyframes ans-tok-in { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
.ans-caret { display: inline-block; width: 8px; height: 1.05em; transform: translateY(2px); margin-left: 2px; background: var(--eng); border-radius: 2px; animation: ans-caret-blink 0.9s steps(2) infinite; }
@keyframes ans-caret-blink { 50% { opacity: 0; } }

/* sources + verdict reveal after the answer finishes streaming */
.ans-reveal { opacity: 0; transform: translateY(8px); transition: opacity 0.45s var(--ease-out-quart), transform 0.45s var(--ease-out-quart); }
.ans-reveal.is-in { opacity: 1; transform: none; }

/* head-to-head: you vs competitor */
.ans-vs { display: flex; align-items: stretch; gap: 12px; margin-bottom: 18px; }
.ans-vscard { flex: 1; min-width: 0; border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 12px 15px; display: flex; flex-direction: column; gap: 5px; background: var(--bg-2); }
.ans-vscard.is-win { border-color: color-mix(in oklch, var(--lime) 45%, transparent); background: color-mix(in oklch, var(--lime) 8%, var(--white)); }
.ans-vscard.is-lose { border-color: color-mix(in oklch, var(--coral) 32%, transparent); background: color-mix(in oklch, var(--coral) 6%, var(--white)); }
.ans-vscard.is-comp { border-style: dashed; }
.vs-who { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.vs-state { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.ans-vsbadge { align-self: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase; flex: none; }
.ans-railtag { padding: 0 4px 10px; }

.ans-srchead { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 12px; border-top: 1px solid var(--line-soft); }
.ans-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ans-src { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: var(--r-sm); border: 1px solid var(--line-soft); background: var(--bg-2); }
.ans-src.is-you { border-color: color-mix(in oklch, var(--lime) 40%, transparent); background: color-mix(in oklch, var(--lime) 7%, var(--white)); }
.ans-srcnum { width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line-soft); }
.ans-src.is-cited .ans-srcnum { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.ans-src.is-you.is-cited .ans-srcnum { background: var(--lime-gradient); color: var(--on-lime); }
.ans-srcbody { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ans-srcname { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.ans-youtag { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-lime); background: var(--lime-gradient); padding: 1px 6px; border-radius: 99px; }
.ans-srcdom { font-family: var(--font-mono); font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ans-srccited { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); flex: none; }
.ans-src.is-you .ans-srccited { color: var(--lime-deep); }

.ans-verdict { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding: 13px 16px; border-radius: var(--r-md); font-size: 13.5px; line-height: 1.5; color: var(--ink); background: color-mix(in oklch, var(--amber) 9%, var(--bg-2)); border: 1px solid color-mix(in oklch, var(--amber) 24%, var(--line-soft)); }
.ans-verdict svg { color: var(--amber); flex: none; margin-top: 1px; }
.ans-verdict.is-good { background: color-mix(in oklch, var(--lime) 9%, var(--bg-2)); border-color: color-mix(in oklch, var(--lime) 30%, var(--line-soft)); }
.ans-verdict.is-good svg { color: var(--lime); }

.ans-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding: 16px 20px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line-soft); }
.ans-actbody { display: flex; align-items: center; gap: 11px; min-width: 0; flex-wrap: wrap; }
.ans-fixname { font-size: 14px; font-weight: 600; color: var(--ink); }

@media (max-width: 1080px) {
  .js-engtrends { grid-template-columns: repeat(2, 1fr); }
  .ans-layout { grid-template-columns: 1fr; }
  .ans-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .ans-rail .js-tag { width: 100%; }
  .ans-qitem { flex: 1; min-width: 220px; }
}
@media (max-width: 600px) {
  .js-engtrends, .js-engtrends.is-compact { grid-template-columns: 1fr; }
  .js-packproj { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .ans-card { padding: 20px 18px; }
  .ans-text { font-size: 15px; }
  .ans-vs { flex-direction: column; gap: 8px; }
  .ans-vsbadge { align-self: flex-start; }
  .ans-action { flex-direction: column; align-items: stretch; }
  .ans-action .row { justify-content: stretch; }
  .ans-action .row .btn { flex: 1; justify-content: center; }
}

/* ============================================================
   MOBILE HARDENING — neutralize inline grid widths that would
   otherwise overflow narrow viewports (rowcards, stat strips).
   ============================================================ */
@media (max-width: 720px) {
  /* list rows: drop the inline multi-column grid, flow + wrap instead */
  .js-rowcard { display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
  .js-rowcard > div:has(.rc-title) { flex: 1 1 150px; min-width: 0; }
  .js-rowcard .rc-sub { white-space: normal; overflow-wrap: anywhere; }
  .js-rowcard .rc-title { overflow-wrap: anywhere; }
  /* stat strips forced to 3-up inline → 2-up on phones */
  .js-view .js-stats { grid-template-columns: 1fr 1fr !important; }
  /* score hero + lab rows already collapse; keep figures from overflowing */
  .js-num, .rc-mono { overflow-wrap: anywhere; }
  /* pagehead actions wrap under the title */
  .js-pagehead { flex-wrap: wrap; }
  .js-head-actions { flex-wrap: wrap; }
  /* recommendation asset code blocks: break long tokens so cards fit */
  .js-asset { min-width: 0; }
  .js-asset .a-body { overflow-wrap: anywhere; word-break: break-word; }
  .a-projrow { flex-wrap: wrap; }
}
@media (max-width: 460px) {
  .js-view .js-stats { grid-template-columns: 1fr !important; }
  .ans-prompt { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ans-toggle { width: 100%; }
  .ans-toggle .ans-tg { flex: 1; text-align: center; }
}
