/* ─────────────────────────────────────────────────────────────────────────
   GoApps — editorial component styles.
   Tokens live in styles/tokens.css. This file is the component layer:
   appbar, verdict, section, login, fields, buttons, search, results,
   error states, scan-in-progress, etc.
   Mirrors mockup/style-explorer.html lines 171-649.
   ───────────────────────────────────────────────────────────────────────── */

@import "./styles/tokens.css";

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
  /* Suppress iOS Safari's rubber-band overscroll. Without this the
     entire page (including the sticky appbar) gets dragged when the
     user pulls past the top — looks like a layout bug even though
     it's the OS doing it. `none` cleanly stops the scroll chain
     without breaking pull-to-refresh on Android (which respects
     the page-level setting anyway). */
  overscroll-behavior: none;
}
body {
  background: var(--bg, #faf8f3);
  color: var(--fg, #18171a);
  font-family: var(--body, "Inter Tight", ui-sans-serif, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Page-scroll lock while the details sheet is open. Toggled from JS
   via a van.derive on detailsOpenState — covers every open/close
   path including ESC, dev console, navigation, animated close. */
body.sheet-open {
  overflow: hidden;
  /* iOS Safari ignores plain overflow:hidden in some contexts;
     touch-action belt-and-braces. */
  touch-action: none;
}
#app { min-height: 100%; height: 100%; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* ─────────────────────────────────────────────────────────────────────────
   App root — anchors all CSS variables.
   The body gets data-chrome="native" when running inside an iOS/Android
   webview shell; in that mode the in-app appbar is hidden because the
   native shell renders its own.
   ───────────────────────────────────────────────────────────────────────── */
.app-root {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  display: flex;
  flex-direction: column;
  /* `clip` prevents horizontal overflow without making this element a
     scroll container — that's the critical difference vs `hidden`,
     which would shift `position: sticky`'s reference frame onto
     .app-root and break the sticky appbar. */
  overflow-x: clip;
}

/* Native chrome mode: hide the web appbar; let the native shell own it. */
body[data-chrome="native"] .appbar { display: none; }

/* (Old .native-share-btn rules removed — we now have a single in-page
   share button (.meta-passlink, near the bottom of this file) that lives
   inside the verdict's meta-row alongside the info circle. Capability-
   detects in JS: native bridge → OS share sheet, navigator.share →
   OS share sheet, else clipboard. Same button, every platform.) */

/* ─────────────────────────────────────────────────────────────────────────
   Appbar — sticky top chrome.
   ───────────────────────────────────────────────────────────────────────── */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) var(--pad) 14px;
  border-bottom: 1px solid var(--line);
  /* Frosted glass: theme bg at low opacity + heavy backdrop blur lets the
     scrolling content peek through with an iOS-style soft veil. */
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 5;
}
/* Share view gets an even more pronounced frosted look — visitors
   landing here are scanning a verdict, and a strong sticky header
   reinforces "you're reading something fixed, not navigating." */
.app-root.view-share .appbar {
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  backdrop-filter: blur(36px) saturate(200%);
}
/* Fallback for browsers without backdrop-filter / color-mix support — go
   back to a solid bg so the header is still legible. */
@supports not (backdrop-filter: blur(1px)) {
  .appbar { background: var(--bg); }
}
.appbar .brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.01em;
  line-height: 1;
  cursor: pointer;
}
.appbar .brand .dot { color: var(--accent); }
.appbar .row { display: flex; gap: 8px; align-items: center; }

/* Icon buttons — usable both inside the appbar and elsewhere
   (e.g. Settings rows). The square 44x44 default suits the appbar;
   the .framed and .solid modifiers turn them into pill text buttons. */
.iconbtn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background var(--t-quick) var(--ease), filter var(--t-quick) var(--ease);
  font: 500 13px/1 var(--body);
}
.iconbtn svg { width: 26px; height: 26px; display: block; }
.iconbtn:hover { background: var(--accent-tint); }
.iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.iconbtn.framed {
  border: 1px solid var(--line-strong);
  background: transparent;
  width: auto;
  height: 36px;
  padding: 0 14px;
  font: 500 13px/1 var(--body);
  color: var(--fg);
  border-radius: var(--r-sm);
}
.iconbtn.framed:hover { background: var(--accent-tint); }
.iconbtn.solid {
  background: var(--accent);
  color: var(--accent-fg);
  width: auto;
  height: 36px;
  padding: 0 14px;
  border: 0;
  font: 600 13px/1 var(--body);
  border-radius: var(--r-sm);
}
.iconbtn.solid:hover { filter: brightness(1.04); }
.appbar .meta-mono {
  font: 500 12px/1 var(--mono);
  color: var(--fg-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-right: 8px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Verdict block — the scan-result hero.
   ───────────────────────────────────────────────────────────────────────── */
.verdict {
  padding: 28px var(--pad) 24px;
  border-bottom: 1px solid var(--line);
}
.verdict .meta-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 18px;
}
.verdict .meta-row .sep { color: var(--line-strong); }
.verdict h1.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-wrap: balance;
}
.verdict h1.title em {
  font-family: var(--display-italic);
  font-style: italic;
  font-weight: 500;
}
.verdict .sub {
  margin: 8px 0 0;
  font: 400 13.5px/1.45 var(--body);
  color: var(--fg-muted);
}
.score-row {
  /* More breathing room above the headline number — needed especially
     now that the tone-rail sits right above instead of plain title. */
  margin-top: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.score-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 96px;
  line-height: .82;
  letter-spacing: -0.045em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: flex-end;
}
.score-num .denom {
  font-size: 28px;
  line-height: 1;
  color: var(--fg-faint);
  font-weight: 500;
  letter-spacing: -.02em;
  margin-left: 4px;
  padding-bottom: 8px;
}
.score-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
/* Overline label — small mono kicker that names what the pill below means.
   Same vocabulary as the section kickers and meta-rows. */
.verdict-overline {
  font: 500 11px/1.2 var(--mono);
  letter-spacing: .08em;
  color: var(--fg-muted);
  text-transform: uppercase;
}
/* Tiny circular 'i' button living inside the verdict's meta-row,
   right after the age rating. Italic Fraunces 'i' inside an
   accent-tint disc — same visual language as the details sheet's
   kicker badge but sized to match the small mono caps around it. */
.meta-info {
  appearance: none;
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font: 700 13px/1 var(--display);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  transition: background var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.meta-info:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--accent-tint));
  transform: scale(1.12);
}
.meta-info:active { transform: scale(0.92); }
.meta-info:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Share button — sibling of .meta-info in the verdict's meta-row.
   Same disc shape; the icon swaps the italic 'i' for the iOS-style
   share glyph. Slightly bigger so the SVG paths read well at the
   small size. Universal in-page button: capability-detects in JS to
   pick bridge / navigator.share / clipboard. */
.meta-passlink {
  appearance: none;
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  transition: background var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.meta-passlink:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--accent-tint));
  transform: scale(1.1);
}
.meta-passlink:active { transform: scale(0.92); }
.meta-passlink:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.meta-passlink svg {
  width: 13px;
  height: 13px;
}
/* Verdict pill — the dynamic claim ("Heavily woke" / "Largely clear" / …)
   colored by tier. Slightly bigger than .rating-pill so it reads as the
   page's headline judgment, not a section detail. Tone classes reuse
   the same palette from .rating-pill. */
.verdict-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font: 600 12px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.verdict-pill.tone-ok      { background: var(--ok-tint);      color: var(--ok); }
.verdict-pill.tone-warning { background: var(--warning-tint); color: var(--warning); }
.verdict-pill.tone-danger  { background: var(--danger-tint);  color: var(--danger); }
.verdict-pill.tone-strong  { background: var(--danger-tint);  color: var(--danger);
                             box-shadow: inset 0 0 0 1px var(--danger); }
.verdict-pill.tone-neutral { background: var(--surface-2);    color: var(--fg-muted); }
.summary {
  /* This is body copy — multiple sentences the reader actually reads.
     Display serif at 19px white-on-black was glare-y and slowed
     reading. Switched to the body face for clarity, dropped a touch
     in size, opened the line-height, and softened the color from
     pure --fg to a slightly muted off-white. Editorial quotation
     marks still come from the display face for flavour. */
  margin-top: 22px;
  font-family: var(--body);
  font-weight: 400;
  font-size: 16.5px;
  line-height: 1.55;
  letter-spacing: 0;
  color: color-mix(in srgb, var(--fg) 88%, var(--fg-muted));
  text-wrap: pretty;
}
.summary::before {
  content: "“";
  font-family: var(--display);
  font-size: 44px;
  line-height: 0;
  color: var(--accent);
  margin-right: 4px;
  vertical-align: -10px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Tone + bias rail — sits between the verdict summary and the details
   trigger. A short partial-width accent bar leads into a single line
   that pairs the model's tone descriptor with a bias pill.
   ───────────────────────────────────────────────────────────────────────── */
.tone-rail {
  /* Sits directly below the title — tighter than when it lived under
     a full paragraph of summary copy. */
  margin-top: 18px;
}
.tone-rail-divider {
  width: 64px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  margin-bottom: 14px;
}
.tone-rail-body {
  /* Tone text and bias pill stack vertically — the pill is always on
     its own line below the italic blurb. With the previous flex-wrap
     behaviour, a short blurb left horizontal slack and the pill would
     sit beside it; that read as inconsistent because it depended on
     blurb length. Vertical stack is the predictable layout. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.4;
  color: var(--fg);
}
.tone-rail-body .tone-text {
  font-style: italic;
  font-family: var(--display-italic, var(--display));
  color: var(--fg);
}
.bias-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--line);
  white-space: nowrap;
}
/* Two-segment pill content: "BIAS · Mixed" — the label is the
   quiet half (so the user knows what the value means at a glance);
   the value is the loud half. */
.bias-pill .bias-pill-label {
  opacity: .7;
  font-weight: 500;
}
.bias-pill .bias-pill-sep {
  opacity: .5;
}
.bias-pill .bias-pill-value {
  font-weight: 700;
}
/* Subtle tonal differentiation — the bias values aren't "good" or
   "bad" so we keep this whisper-quiet. Each pill picks up a slight
   accent tint matching its enum value. */
.bias-pill.bias-progressive { background: var(--warning-tint); color: var(--warning); border-color: transparent; }
.bias-pill.bias-conservative { background: var(--ok-tint);      color: var(--ok);      border-color: transparent; }
.bias-pill.bias-mixed        { background: var(--accent-tint);  color: var(--accent);  border-color: transparent; }
.bias-pill.bias-neutral      { background: var(--surface-2);    color: var(--fg-muted); border-color: var(--line); }

/* ─────────────────────────────────────────────────────────────────────────
   Details bottom sheet — slide-up overlay with credits / tone / bias /
   language. Backdrop fades in; sheet translates from below the
   viewport. Two-column key/value table inside, editorial typography.
   ───────────────────────────────────────────────────────────────────────── */
.sheet-host {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  /* Translucent overlay — dims the page underneath instead of replacing
     it. The keyframe animates opacity from 0 to 1 only to drive the
     fade-in; the colour itself is alpha-blended (rgba) so even at
     opacity:1 the page still shows through. */
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: auto;
  animation: sheet-fade-in .22s var(--ease) forwards;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78vh;
  /* Flex column so the header (handle + kicker + X) stays pinned at
     the top while the body scrolls inside. Padding is 0 here — each
     section owns its own padding so the body's scroll edge can sit
     flush with .sheet's right edge (no gap between scrollbar and
     content padding). */
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -16px 48px -16px rgba(0,0,0,.35);
  pointer-events: auto;
  transform: translateY(100%);
  animation: sheet-slide-up .28s var(--ease) forwards;
}
.sheet-handle {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  /* Owns its own top spacing now that .sheet's padding is 0. */
  margin: 14px auto 0;
  opacity: .7;
  flex: 0 0 auto;
}
/* Pinned header — handle's sibling, sits above the scrolling body.
   Translucent + blurred so content scrolling underneath shows through
   subtly (same posture as the dashboard topbar). The transparent
   border-bottom flips solid via the .scrolled class on .sheet so the
   divider only appears when there's something to divide. The kicker
   and close button are flex siblings, justify-content:space-between
   so the X right-aligns and shares the kicker's vertical center. */
.sheet-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* Slightly tighter top padding because the kicker now shares the
     row with the close button — 32px tall — and we don't want the
     header to grow too large. */
  padding: 12px var(--pad);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color .14s var(--ease);
  /* Stays above the scrolling body so its blur reads correctly. */
  position: relative;
  z-index: 1;
}
.sheet.scrolled .sheet-header {
  border-bottom-color: var(--line);
}
.sheet-close {
  /* Lives inside .sheet-header now as a flex sibling of .sheet-kicker.
     This shares its vertical baseline with the "Details" title so
     the X visually centers on it instead of sitting up by the
     drag handle. */
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
  flex: 0 0 auto;
}
.sheet-close:hover {
  background: var(--surface-2);
  color: var(--fg);
}
.sheet-close svg {
  width: 16px;
  height: 16px;
}
.sheet-body {
  /* Scrolling region. Flex grows it to fill the remaining sheet
     height; min-height: 0 is the grid/flex-child escape hatch that
     lets overflow-y: auto kick in instead of the body growing to
     content height. Horizontal padding lives here so the rows
     align with the header's content. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px var(--pad) 32px;
}
.sheet-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 11.5px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  /* Header owns the bottom spacing now; keep this 0 so we don't
     compound padding inside .sheet-header. */
  margin-bottom: 0;
}
.sheet-kicker .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font: 700 11px/1 var(--mono);
  font-style: italic;
}
.sheet-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  /* No per-row border — visual separation comes from whitespace
     alone. Dividers are reserved for grouping (identity vs credits). */
  padding: 10px 0;
}
.sheet-key {
  font: 500 10.5px/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding-top: 3px;
}
.sheet-val {
  font: 400 15.5px/1.45 var(--body);
  color: var(--fg);
  text-wrap: pretty;
}
.sheet-val .sub {
  margin-top: 2px;
  color: var(--fg);
}
.sheet-divider {
  /* Slightly lighter than --line so it whispers rather than shouts.
     Pure full-width is fine here — it's the ONE divider in the sheet. */
  height: 1px;
  background: var(--line);
  margin: 18px 0 10px;
  opacity: .7;
}

/* Prose row — used for the search-mode description block. The default
   .sheet-val sets nowrap-friendly defaults intended for short value
   strings (names, years); the description is 4-5 sentences and needs
   relaxed leading and a slightly muted tone so the eye reads it as
   context, not headline. */
.sheet-row.sheet-row-prose .sheet-val.sheet-prose {
  font: 400 14px/1.55 var(--body);
  color: var(--fg-muted);
  white-space: pre-wrap;
}

@keyframes sheet-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sheet-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes sheet-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes sheet-slide-down {
  from { transform: translateY(0); }
  to   { transform: translateY(100%); }
}

/* When .sheet-host has the .closing class, swap entry animations for
   exit animations. The JS adds the class, waits the animation
   duration, then unmounts the sheet — gives us a real slide-down
   instead of the DOM just vanishing. */
.sheet-host.closing .sheet-backdrop {
  animation: sheet-fade-out .22s var(--ease) forwards;
}
.sheet-host.closing .sheet {
  animation: sheet-slide-down .26s var(--ease) forwards;
}

/* Wider key column on desktop — there's more room. */
@media (min-width: 880px) {
  .sheet {
    max-width: 560px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-radius: 18px 18px 0 0;
    animation: sheet-slide-up-desktop .28s var(--ease) forwards;
  }
  .sheet-row {
    grid-template-columns: 160px 1fr;
  }
  /* Desktop keeps the horizontal centering during exit animation, so
     the sheet slides straight down rather than off to the side. */
  .sheet-host.closing .sheet {
    animation: sheet-slide-down-desktop .26s var(--ease) forwards;
  }
}
@keyframes sheet-slide-up-desktop {
  from { transform: translateX(-50%) translateY(100%); }
  to   { transform: translateX(-50%) translateY(0); }
}
@keyframes sheet-slide-down-desktop {
  from { transform: translateX(-50%) translateY(0); }
  to   { transform: translateX(-50%) translateY(100%); }
}

/* ─────────────────────────────────────────────────────────────────────────
   Section — the analysis blocks within a scan result.
   ───────────────────────────────────────────────────────────────────────── */
.section {
  padding: var(--section-gap) var(--pad);
  border-bottom: 1px solid var(--line);
}
.section:last-child {
  border-bottom: 0;
  padding-bottom: 60px;
}
.section .kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 10.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 14px;
}
.section .kicker .num { color: var(--accent); }
.section .kicker .rule { display: none; }
.section h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.015em;
}
.section p {
  margin: 0 0 var(--para-gap);
  font-family: var(--body);
  font-weight: 400;
  font-size: 14.5px;
  line-height: var(--lh-body);
  color: var(--fg);
  text-wrap: pretty;
}
.section p + p { margin-top: var(--para-gap); }
.section p.muted { color: var(--fg-muted); }
.section ul {
  margin: 0 0 var(--para-gap);
  padding-left: 20px;
  list-style: none;
}
.section ul li {
  position: relative;
  margin: 0 0 6px;
  font: 400 14px/var(--lh-body) var(--body);
  color: var(--fg);
  text-wrap: pretty;
  /* AI structured-output occasionally returns long unbroken strings
     (Gemini's JSON mode has been seen to drop inter-token spaces in
     a single bullet while the surrounding bullets are fine). Without
     a wrap-anywhere directive that one bullet overflows the right
     edge of the card. `overflow-wrap: anywhere` lets the browser
     break inside a "word" if there's no other choice — readability
     is still hurt by missing spaces, but at least the layout stays
     intact. Pairs with `word-break: normal` so well-formed text
     keeps its natural break behavior. */
  overflow-wrap: anywhere;
  min-width: 0;
}
.section ul li::before {
  content: "·";
  position: absolute;
  left: -14px;
  color: var(--accent);
  font-weight: 700;
}
.section .pull {
  margin: 14px 0 6px;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: var(--accent-tint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 16.5px;
  line-height: 1.45;
}

/* ─── Assessment section: unified header with rating pill ────────────── */
/* Used for scan-result section blocks. Drops the small mono kicker rail
   in favor of a single bold header (number + title) with the rating
   floated right as a pastel tone pill. */
.section.assessment-section .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section.assessment-section .section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.section.assessment-section .section-title .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.section.assessment-section .section-title h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--fg);
  text-wrap: balance;
}
.section.assessment-section .section-body p {
  margin: 0 0 var(--para-gap);
  font: 400 14.5px/var(--lh-body) var(--body);
  color: var(--fg);
  text-wrap: pretty;
  /* Same belt-and-braces guard as the bullets — a `findings`
     paragraph can hit the same Gemini space-drop quirk. Wrap-anywhere
     keeps the layout intact even if the model emits a 600-char
     space-free run. */
  overflow-wrap: anywhere;
}
.section.assessment-section .section-body p.muted { color: var(--fg-muted); }

/* ─── Rating pill ─────────────────────────────────────────────────────── */
.rating-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font: 600 10.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rating-pill.tone-ok       { background: var(--ok-tint);      color: var(--ok); }
.rating-pill.tone-warning  { background: var(--warning-tint); color: var(--warning); }
.rating-pill.tone-danger   { background: var(--danger-tint);  color: var(--danger); }
.rating-pill.tone-strong   { background: var(--danger-tint);  color: var(--danger);
                             box-shadow: inset 0 0 0 1px var(--danger); }
.rating-pill.tone-neutral  { background: var(--surface-2);    color: var(--fg-muted); }

/* ─────────────────────────────────────────────────────────────────────────
   Tags — used in section content and as filter chips.
   ───────────────────────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.tag {
  font: 500 11px/1 var(--mono);
  letter-spacing: .04em;
  padding: 6px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--fg-muted);
  background: transparent;
  text-transform: lowercase;
  cursor: default;
}
.tag.on { color: var(--fg); border-color: var(--fg); }

/* ─────────────────────────────────────────────────────────────────────────
   Login screen — also reused for verify, error states, settings.
   ───────────────────────────────────────────────────────────────────────── */
.login {
  min-height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) var(--pad)
           calc(env(safe-area-inset-bottom, 0px) + 32px);
}
.login .brand-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.login .brand-mark .dot { color: var(--accent); }
.login .tag {
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 48px;
  border: 0;
  padding: 0;
  background: transparent;
}
.login h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.login h1 em {
  font-family: var(--display-italic);
  font-style: italic;
  font-weight: 500;
}
.login p.lead {
  margin: 0 0 32px;
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
}
.field-label {
  display: block;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.field {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--line-strong);
  color: var(--fg);
  font: 500 17px/1 var(--body);
  outline: none;
  border-radius: 0;
  transition: border-color var(--t-quick) var(--ease);
}
.field::placeholder { color: var(--fg-faint); }
.field:focus { border-bottom-color: var(--accent); }
.login .actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login .fineprint {
  margin-top: auto;
  padding-top: 32px;
  font: 400 12px/1.5 var(--body);
  color: var(--fg-muted);
  text-wrap: pretty;
}
.login .fineprint a {
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
}

/* "Check your email" inline-success state. */
.login .sent {
  margin: 8px 0 0;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--accent-tint);
}
.login .sent b {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.login .sent span {
  font: 400 13px/1.5 var(--body);
  color: var(--fg-muted);
}

/* ─────────────────────────────────────────────────────────────────────────
   Buttons.
   ───────────────────────────────────────────────────────────────────────── */
.btn-block {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  height: 52px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-fg);
  font: 600 14px/1 var(--body);
  letter-spacing: .005em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter var(--t-quick) var(--ease);
}

/* (Old .share-inline / .share-inline-btn / .section-share rules
   removed — the bottom-of-page Share section was deleted in favor
   of the inline .meta-passlink button at the top of the verdict.
   Report section's collapsed state below still uses the same
   visual pattern, just no longer paired with a sibling.) */

/* ─────────────────────────────────────────────────────────────────────
   Report section — sits at the bottom of the assess view as the
   last block. Inline expansion: collapsed = single line + Report
   button; expanded = four enum reasons + Cancel. Lower visual
   weight than the Share affordance up top, since it's a "by the
   way, this seems wrong" path rather than a primary action.
   ───────────────────────────────────────────────────────────────────── */

/* Collapsed state: text on left, button on right. */
.report-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-report .report-inline-text {
  margin: 0;
  flex: 1 1 240px;
  font: 400 14px/1.45 var(--body);
  color: var(--fg-muted);
  text-wrap: pretty;
}
.report-inline-btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  flex-shrink: 0;
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: transparent;
  color: var(--fg);
  font: 600 12.5px/1 var(--body);
  letter-spacing: .01em;
  transition: background var(--t-quick) var(--ease),
              color var(--t-quick) var(--ease),
              border-color var(--t-quick) var(--ease);
}
.report-inline-btn:hover {
  background: var(--accent-tint);
  color: var(--accent);
  border-color: var(--accent);
}

/* Expanded state. */
.report-expanded {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-report .report-prompt {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 17px;
  color: var(--fg);
}
.report-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-loading {
  margin: 0;
  font: 400 13.5px/1.4 var(--body);
  color: var(--fg-muted);
  font-style: italic;
}
.report-reason {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font: 500 14px/1.3 var(--body);
  cursor: pointer;
  transition: background var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease);
}
.report-reason:hover:not(:disabled) {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent);
}
.report-reason:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.report-cancel-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.report-cancel-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 6px 10px;
  font: 500 13px/1 var(--body);
  border-radius: var(--r-sm);
  transition: color var(--t-base) var(--ease);
}
.report-cancel-btn:hover:not(:disabled) { color: var(--fg); }
.report-cancel-btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-block:hover:not(:disabled) { filter: brightness(1.04); }
.btn-block:active { filter: brightness(.96); }
.btn-block:disabled { opacity: .6; cursor: not-allowed; }
.btn-block.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  height: 48px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  font: 600 13.5px/1 var(--body);
  letter-spacing: .005em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter var(--t-quick) var(--ease);
}
.btn.primary { background: var(--accent); color: var(--accent-fg); flex: 1; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line-strong); }
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn:active { filter: brightness(.96); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────────────────────
   Search screen.
   ───────────────────────────────────────────────────────────────────────── */
.searchbar-wrap {
  padding: calc(env(safe-area-inset-top, 0px) + 24px) var(--pad) 0;
}
.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  background: var(--surface-2);
  border-radius: var(--r-md);
}
.searchbar svg {
  width: 20px;
  height: 20px;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.searchbar input {
  flex: 1;
  height: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: 500 16px/1 var(--body);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.searchbar input::placeholder { color: var(--fg-faint); }
/* Hide the WebKit/Chromium-default clear button on <input type="search">.
   We render our own .clear button inside the .searchbar with consistent
   styling, so the native one would just duplicate the affordance. */
.searchbar input::-webkit-search-cancel-button,
.searchbar input::-webkit-search-decoration,
.searchbar input::-webkit-search-results-button,
.searchbar input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.searchbar .clear {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.searchbar .clear:hover { background: var(--line); color: var(--fg); }

/* Primary "submit search" button inside the input — accent disc with a
   white arrow, the right-side counterpart to the magnifier on the left.
   The accent color signals "this is the action," distinguishing it from
   the muted clear (×) sitting next to it. */
.searchbar .submit {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: var(--accent-fg);
  width: 32px;
  height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.searchbar .submit:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
  transform: scale(1.05);
}
.searchbar .submit:active { transform: scale(0.96); }
.searchbar .submit svg { width: 16px; height: 16px; color: currentColor; }

/* Cancel variant — same disc, swapped to a neutral/recessed fill so
   the user reads the swap as "this is now a different action," not
   "still the search button." Hover stays subtle; we don't want
   cancelling to feel like a destructive flourish. */
.searchbar .submit.cancel {
  background: var(--surface-3, var(--line));
  color: var(--fg);
}
.searchbar .submit.cancel:hover {
  background: var(--line);
  transform: scale(1.05);
}

/* Disabled state for the input while a search is in flight. Slight
   opacity drop is the only visual signal — the bigger cue is the
   submit→cancel swap to its right. */
.searchbar input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Worst-case-remaining hint at the foot of the search loading panel.
   Muted by default — supporting copy, not a focal element — with the
   countdown number itself in a tabular monospace so it doesn't jitter
   width as the digits change each second. */
.timeout-hint {
  margin-top: 18px;
  font: 500 13px/1.4 var(--body);
  color: var(--fg-faint);
  text-align: center;
}
.timeout-mono {
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
}

.typefilter {
  display: flex;
  gap: 8px;
  padding: 14px var(--pad) 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.typefilter::-webkit-scrollbar { display: none; }
.typefilter button {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font: 500 12.5px/1 var(--body);
  letter-spacing: .005em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: capitalize;
  transition: background var(--t-quick) var(--ease), color var(--t-quick) var(--ease);
}
.typefilter button.on {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.typefilter button:disabled {
  /* Match the searchbar input's disabled feel when a search is in
     flight — same dim-out, no hover, default cursor. Keeps the
     active pill recognisable but signals "wait, locked." */
  opacity: .5;
  cursor: default;
}
.typefilter button svg { width: 14px; height: 14px; }

/* Empty / home state. */
.empty-search {
  padding: 56px var(--pad) var(--pad);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.empty-search .meta {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.empty-search h2 {
  /* Bottom margin opens up some air between the heading and the
     first row in the list — without it the heading butts right
     up against the selection box. */
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -.005em;
  color: var(--fg-muted);
  text-transform: none;
}

.recent-list {
  display: flex;
  flex-direction: column;
}
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  margin: 0 calc(var(--pad) * -1);
  border-bottom: 1px solid var(--line);
  font-family: var(--body);
  cursor: pointer;
  transition: background var(--t-quick) var(--ease);
  appearance: none;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  width: calc(100% + var(--pad) * 2);
  text-align: left;
  color: var(--fg);
}
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: var(--accent-tint); }
.recent-item .l {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.recent-item .l b {
  font: 500 14.5px/1.2 var(--body);
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-item .l span {
  font: 500 10px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.recent-item .score-mini {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-left: 12px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Results list.
   ───────────────────────────────────────────────────────────────────────── */
.results { display: flex; flex-direction: column; }
.results .resmeta {
  padding: 36px var(--pad) 24px;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.res-row {
  display: grid;
  /* Three tracks: lead (idx + optional info, stacked), body (flex),
     chevron (auto). The info button used to live next to the chevron;
     it's been moved into the lead column so its tap target sits well
     clear of the chevron's. */
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 16px var(--pad);
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--t-quick) var(--ease);
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: var(--body);
  color: var(--fg);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  appearance: none;
}
.res-row:hover { background: var(--accent-tint); }
.res-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Lead column — idx pinned at the row top (so it aligns with the
   title baseline like it always has), info button vertically
   centered against the body. align-self: stretch makes the column
   span the full row height so the absolutely-positioned info button
   has a meaningful 50% to center against. */
.res-row .res-lead {
  position: relative;
  align-self: stretch;
  text-align: center;
}
.res-row .idx {
  font: 500 11px/1.4 var(--mono);
  color: var(--fg-muted);
  /* Same 4px nudge the idx had before the lead refactor — lines its
     baseline up with the title's first row. */
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}
.res-row .res-lead .res-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.res-row .body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.res-row .title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--fg);
  text-wrap: balance;
}
.res-row .meta {
  font: 400 12.5px/1.4 var(--body);
  color: var(--fg-muted);
  text-wrap: pretty;
}
.res-row .meta .tt {
  color: var(--fg);
  font-weight: 500;
  margin-right: 6px;
}
/* Description block beneath the meta line — line-clamped to keep
   each search result a roughly fixed-height card. The clamp value
   is density-aware: compact gets 2 lines, regular and roomy both
   get 3 (the user spec — roomy doesn't go further; once you're
   past 3 lines you're competing with the verdict view that opens
   on click). The display:-webkit-box / -webkit-line-clamp combo is
   the de-facto cross-browser line-clamp; works in every modern
   browser including iOS Safari. */
.res-row .desc {
  font: 400 13px/1.45 var(--body);
  color: var(--fg-muted);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Default to the regular-density clamp; the .density-compact
     selector below overrides it when the user picks compact. */
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.density-compact .res-row .desc {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.res-row .arrow {
  color: var(--fg-muted);
  align-self: center;
  width: 18px;
  height: 18px;
}

/* Per-row "i" affordance — opens the details sheet for a search row
   so the user can disambiguate similar titles before tapping
   through to assess. Visually descends from .meta-info (the verdict
   view's info circle) — same italic-i glyph and disc chrome — but
   slightly larger to be tap-friendly inside a list row, and aligned
   centered with the row body. */
.res-row .res-info {
  appearance: none;
  border: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font: 700 12px/1 var(--display);
  font-style: italic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  align-self: center;
  transition: background var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.res-row .res-info:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--accent-tint));
  /* Compose with the centering translate so the button doesn't
     jump to the corner on hover when it's absolutely positioned in
     the lead column. */
  transform: translate(-50%, -50%) scale(1.08);
}
.res-row .res-info:active {
  transform: translate(-50%, -50%) scale(0.92);
}
.res-row .res-info:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Scan in progress — the wait moment.
   ───────────────────────────────────────────────────────────────────────── */
.assess-loading {
  padding: 32px var(--pad) 60px;
  border-bottom: 1px solid var(--line);
}
.assess-loading .meta-row {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.assess-loading .meta-row .live {
  color: var(--accent);
  animation: pulse 1.4s var(--ease) infinite;
}
.assess-loading h1.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-wrap: balance;
}
.assess-loading h1.title em {
  font-family: var(--display-italic);
  font-style: italic;
  font-weight: 500;
}
.assess-loading .sub {
  margin: 8px 0 0;
  font: 400 13.5px/1.45 var(--body);
  color: var(--fg-muted);
}
.assess-loading .stage-line {
  margin-top: 32px;
  font: 600 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 16px;
}
.assess-loading .stage-line .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s var(--ease) infinite;
  flex-shrink: 0;
}
.assess-loading .stage-line .label {
  transition: opacity var(--t-base) var(--ease);
}
.assess-loading .skeleton {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.assess-loading .skeleton .bar {
  height: 14px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--accent-tint) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.assess-loading .skeleton .bar.short { width: 60%; }
.assess-loading .skeleton .bar.medium { width: 85%; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Error states — stealth 404, oops, offline, rate-limited, unavailable,
   auth-expired, empty results. All share the same vocabulary as .login.
   ───────────────────────────────────────────────────────────────────────── */
.errscreen {
  min-height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) var(--pad)
           calc(env(safe-area-inset-bottom, 0px) + 32px);
}
.errscreen .err-kicker {
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 24px;
}
.errscreen .err-kicker .num {
  color: var(--accent);
  margin-right: 8px;
}
.errscreen h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.errscreen h1 em {
  font-family: var(--display-italic);
  font-style: italic;
  font-weight: 500;
}
.errscreen p.lead {
  margin: 0 0 32px;
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-muted);
  text-wrap: pretty;
}
.errscreen .actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.errscreen .fineprint {
  margin-top: auto;
  padding-top: 32px;
  font: 400 12px/1.5 var(--body);
  color: var(--fg-muted);
  text-wrap: pretty;
  /* Long unbroken tokens (cache-key hashes, URLs, request IDs) would
     otherwise blow past the right padding because there's no space
     for the browser to break on. `overflow-wrap: anywhere` lets the
     browser break inside the token whenever it needs to fit. */
  overflow-wrap: anywhere;
}
.errscreen .fineprint code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  color: var(--fg);
}
.errscreen .countdown {
  font: 500 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-top: 8px;
}
.errscreen .countdown .n { color: var(--accent); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────────────
   Settings — uses .login vocabulary with simple rows.
   ───────────────────────────────────────────────────────────────────────── */
/* Tighten the vertical breathing room around the "Settings" overline.
   The .login base has 64px above (auth screens want that space for the
   brand-mark and editorial wash); .login .tag has 48px below (auth
   screens want a beat between the overline and the H1). Settings is
   denser content with the appbar already framing the screen — half
   the breathing room reads better. Scope to .login.settings so auth
   screens are untouched. */
.login.settings {
  padding-top: calc(env(safe-area-inset-top, 0px) + 32px);
}
.login.settings .tag {
  margin-bottom: 24px;
}

.settings-list .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.settings-list .row:last-child { border-bottom: 0; }

/* Pin every framed button in the Settings rows to a shared min-width
   so Sign out / Refresh / Clear visually align in a column down the
   right edge. 100px comfortably fits "Sign out" (the widest current
   label) at 13px body / 14px x-padding; "Refresh" and "Clear" stretch
   to match. If we ever add a longer label, bump this up. */
.settings-list .row .iconbtn.framed {
  min-width: 100px;
}
.settings-list .row .l {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.settings-list .row .l b {
  font: 500 14.5px/1.2 var(--body);
  color: var(--fg);
}
.settings-list .row .l span {
  font: 400 12.5px/1.4 var(--body);
  color: var(--fg-muted);
}

/* Inline editorial-style link: subtle accent underline, slightly
   thicker on hover. Used in the Account row's "see our privacy
   policy" copy and reusable elsewhere a sentence-level link is
   needed without it screaming for attention. */
.inline-link {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-base) var(--ease),
              text-decoration-thickness var(--t-base) var(--ease);
}
.inline-link:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}
/* Right-side label/value column — mirrors .l but right-aligned. Used
   for the API URL info on the Version row in dev mode. */
.settings-list .row .r {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  align-items: flex-end;
  text-align: right;
}
.settings-list .row .r b {
  font: 500 14.5px/1.2 var(--body);
  color: var(--fg);
}
.settings-list .row .r span {
  font: 400 12.5px/1.4 var(--body);
  color: var(--fg-muted);
}
/* Active API URL value (dev only). Small monospace so a long URL
   visually reads as a technical fact, not body copy. */
.settings-list .version-url {
  font: 400 11.5px/1.4 var(--mono) !important;
  word-break: break-all;
}

/* ─────────────────────────────────────────────────────────────────────────
   Segmented control — iOS-style three-button selector. Used in
   settings for theme + density. The selected segment looks like a
   small "card" lifted out of the track.
   ───────────────────────────────────────────────────────────────────────── */
.segmented {
  display: inline-flex;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}
.segmented .seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-muted);
  width: 38px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background var(--t-base) var(--ease),
              color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}
.segmented .seg-btn:hover { color: var(--fg); }
.segmented .seg-btn.on {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.segmented .seg-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.segmented .seg-btn svg {
  width: 18px;
  height: 18px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Boot / loading shell — shown briefly before the first viewState resolves.
   ───────────────────────────────────────────────────────────────────────── */
.boot {
  min-height: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
}
.boot .brand-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -.02em;
  color: var(--fg);
  opacity: .6;
}
.boot .brand-mark .dot {
  color: var(--accent);
  animation: pulse 1.2s var(--ease) infinite;
}

/* ─────────────────────────────────────────────────────────────────────────
   Status pill — non-blocking confirmations (e.g. "Link copied").
   Reserved for genuinely transient feedback; errors get full screens.
   ───────────────────────────────────────────────────────────────────────── */
.status-pill {
  position: fixed;
  /* Pinned just below the appbar's bottom divider — sits high on
     the page where users expect transient feedback. Appbar is
     ~54px tall; a small negative offset overlaps the divider line
     so the pill reads as belonging to the header band rather than
     floating in the content area. iOS notch still respected via
     safe-area-inset-top. */
  top: calc(env(safe-area-inset-top, 0px) + 44px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: var(--fg);
  color: var(--bg);
  border-radius: 999px;
  font: 500 13px/1.3 var(--body);
  letter-spacing: .005em;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
  animation: drop var(--t-base) var(--ease);
  /* Wrap on long messages (e.g. AI-supplied no_results details).
     Cap width so a verbose explanation doesn't run edge to edge. */
  max-width: min(560px, calc(100% - 32px));
  text-align: center;
  white-space: normal;
}
@keyframes drop {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ─────────────────────────────────────────────────────────────────────────
   Desktop reflow — same content, different rhythm. Trigger via the
   .desk class on .app-root, applied by JS at >= 880px viewport.
   Mirrors mockup/style-explorer.html lines 631-649.
   ───────────────────────────────────────────────────────────────────────── */
@media (min-width: 880px) {
  .app-root {
    --pad: 40px;
  }
  main.app-main {
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
  }
  .appbar {
    padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
    padding-bottom: 14px;
  }
  .verdict {
    padding: 36px var(--pad);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 36px;
    align-items: start;
  }
  .verdict .meta-row {
    grid-column: 1 / -1;
  }
  .verdict h1.title { font-size: 56px; }
  .verdict .summary { font-size: 18px; grid-column: 1 / -1; }
  .score-num { font-size: 144px; }
  .score-num .denom { font-size: 38px; padding-bottom: 14px; }
  .section {
    padding: var(--section-gap) var(--pad);
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 36px;
  }
  .section .kicker {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 0;
  }
  .section h2 { font-size: 26px; }
  .section p { font-size: 16px; }

  /* Assessment sections opt out of the 2-col rail layout — their
     unified .section-head spans full width. */
  .section.assessment-section {
    display: block;
  }
  .section.assessment-section .section-title .num,
  .section.assessment-section .section-title h2 {
    font-size: 26px;
  }
  .section.assessment-section .section-body p { font-size: 16px; }
  .login, .errscreen {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
  .assess-loading { padding: 56px var(--pad) 80px; }
  .assess-loading h1.title { font-size: 56px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Reduced motion — respect user preference.
   ───────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
