/* ─────────────────────────────────────────────────────────────────────────
   gotipsy/styles.css — app stylesheet.

   Layered as:
     1) @import the tokens — colors, type, spacing, density, radius,
        and per-accent overrides live in ./styles/tokens.css.
     2) Base reset.
     3) Motion tokens — short transitions reused across components.
     4) Component styles — appbar, verdict, sections, ask cards, login,
        search, recent + trending lists. Ported from
        mockup/GoTipsy+GoWeightless/gotipsy-explorer.html so the
        live app and the style explorer stay byte-identical.
     5) Bottom sheet — reused from gowokeless via ./sheet.js.
     6) Utility / state styles (loading, error, toasts).
   ───────────────────────────────────────────────────────────────────── */

@import url("./styles/tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* The SPA mount. tokens.css's .app-root block owns the theme variable
   defaults; the modifier classes (.dark / .density-* / .radius-*) and
   the [data-accent="..."] override sets are applied here by main.js. */
.app-root {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Motion — small, deliberately conservative. Same names as gowokeless
   so reused components (the bottom sheet) keep working. */
.app-root {
  --t-quick: 80ms;
  --t-base:  140ms;
  --ease:    cubic-bezier(.2, .8, .2, 1);
}

/* ── Top app bar ─────────────────────────────────────────────────────── */
/* Hidden inside native iOS wrapper — the native shell paints its own
   nav bar; the web appbar would double up. */
body[data-chrome="native"] .appbar { display: none; }

.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;
}
/* Fallback for browsers without backdrop-filter / color-mix support. */
@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;
  -webkit-tap-highlight-color: transparent;
}
.appbar .brand .dot{ color: var(--accent); }
.appbar .row{ display:flex; gap: 8px; align-items:center; }
.appbar .appbar-left{
  display: flex; align-items: center; gap: 4px;
  /* Pull the back chevron toward the page edge so the visible glyph
     lines up with the padding edge of the topbar. */
  margin-left: -8px;
}
.appbar-back svg{ width: 24px; height: 24px; }
/* Back chevron suppresses hover/active backgrounds — the page is
   animating away the moment it's pressed, so the flash reads as a
   glitch. Other appbar icons keep their highlight. */
.appbar-back{ -webkit-tap-highlight-color: transparent; }
.appbar-back:hover, .appbar-back:active{ background: transparent; }

/* Brand is non-clickable when already on the home view. */
.appbar .brand.brand-on-home{
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.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);
  font: 500 13px/1 var(--body);
}
.iconbtn svg{ width: 26px; height: 26px; display: block; }
@media (hover: hover) {
  .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);
}
@media (hover: hover) {
  .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);
}
@media (hover: hover) {
  .iconbtn.solid:hover{ filter: brightness(1.04); }
}

/* ── Verdict / hero ──────────────────────────────────────────────────── */
.verdict{
  padding: 28px var(--pad) 24px;
  border-bottom: 1px solid var(--line);
}
.verdict .meta-row{
  display:flex; gap: 8px; flex-wrap: wrap;
  font: 500 10.5px/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 .meta-row .pill{
  color: var(--accent); border: 1px solid var(--accent);
  padding: 3px 7px; border-radius: var(--r-sm);
  font-weight:600; letter-spacing:.12em;
}

.verdict h1.title{
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  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 .producer{
  margin: 8px 0 0;
  font: 500 13px/1.45 var(--body);
  color: var(--fg);
}
.verdict .producer .sep{ color: var(--line-strong); margin: 0 6px; }
.verdict .sub{
  margin: 4px 0 0;
  font: 400 13px/1.45 var(--body);
  color: var(--fg-muted);
}

.score-row{
  margin-top: 24px;
  display:flex; align-items:flex-end; justify-content: space-between;
  gap: 16px;
}
.score-num{
  font-family: var(--display);
  font-weight: 800;
  font-size: 88px;
  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: 26px; line-height: 1; color: var(--fg-faint);
  font-weight: 500; letter-spacing: -.02em;
  margin-left: 4px; padding-bottom: 6px;
}
.score-side{
  text-align: right;
  display:flex; flex-direction:column; gap: 6px; align-items:flex-end;
}
.verdict-label{
  display:inline-flex; align-items:center; gap: 6px;
  padding: 5px 9px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-fg);
  font: 600 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.verdict-tier{
  font: 500 11px/1.2 var(--mono); letter-spacing: .08em;
  color: var(--fg-muted); text-transform: uppercase;
}

.summary{
  margin-top: 22px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -.005em;
  color: var(--fg);
  text-wrap: pretty;
}
.summary::before{
  content:"\201C";
  font-family: var(--display);
  font-size: 44px;
  line-height: 0;
  color: var(--accent);
  margin-right: 4px;
  vertical-align: -10px;
}

/* community strip — sits under summary, social/Vivino-y */
.community{
  margin-top: 22px;
  display:grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-left: calc(var(--pad) * -1);
  margin-right: calc(var(--pad) * -1);
}
.community .cell{
  background: var(--bg);
  padding: 12px var(--pad);
  display:flex; flex-direction:column; gap: 2px; align-items:flex-start;
}
.community .cell .num{
  font-family: var(--display);
  font-weight: 700; font-size: 22px;
  letter-spacing: -.02em; color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.community .cell .lbl{
  font: 500 9.5px/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* ── Sections ────────────────────────────────────────────────────────── */
.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 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); }

/* tasting-profile spec sheet */
.specs{
  display:grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.specs .row{
  display:flex; justify-content:space-between; align-items:baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.specs .row:nth-child(odd){ padding-right: 14px; border-right: 1px solid var(--line); }
.specs .row:nth-child(even){ padding-left: 14px; }
.specs .k{
  font: 500 10px/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-muted);
}
.specs .v{
  font: 500 13px/1.2 var(--body);
  color: var(--fg);
  text-align:right;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* tasting axes (sweetness, acid, etc.) */
.axes{ display:flex; flex-direction:column; gap: 12px; margin-top: 6px; }
.axis{ display:flex; flex-direction:column; gap: 6px; }
.axis .lbls{
  display:flex; justify-content:space-between; align-items:baseline;
  font: 500 10.5px/1 var(--mono); letter-spacing: .08em;
  color: var(--fg-muted); text-transform: uppercase;
}
.axis .lbls b{ color: var(--fg); font-weight: 600; }
.axis .track{
  height: 6px; border-radius: 999px;
  background: var(--line); position: relative;
}
.axis .fill{
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent); border-radius: 999px;
}
.axis .pin{
  position:absolute; top: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.axis .scale{
  display:flex; justify-content:space-between;
  font: 500 9.5px/1 var(--mono); letter-spacing: .06em;
  color: var(--fg-faint); text-transform: lowercase;
}

.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;
}
.tag.on{ color: var(--fg); border-color: var(--fg); }

/* ── Ask follow-ups (chips that expand) ──────────────────────────────── */
.ask-section{
  padding: 24px var(--pad) 26px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.app-root.dark .ask-section{ background: var(--surface); }
.ask-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;
}
.ask-section .kicker .num{ color: var(--accent); }
.ask-section h2{
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600; font-size: 20px; line-height: 1.2;
  letter-spacing: -.015em;
}
.ask-grid{
  display:flex; flex-wrap: wrap; gap: 8px;
}
.ask-chip{
  appearance: none; cursor: default;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 13px;
  font: 500 13px/1.2 var(--body);
  display:inline-flex; align-items:center; gap: 8px;
  text-align:left;
}
.ask-chip:hover{ border-color: var(--accent); color: var(--accent); }
.ask-chip.active{
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
}
.ask-chip .ic{
  width: 14px; height: 14px; flex-shrink: 0;
}

/* expanded answer card */
.answer-card{
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 16px 14px;
}
.answer-card .q{
  font: 600 10.5px/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.answer-card .a{
  font-family: var(--display);
  font-weight: 400; font-size: 17px; line-height: 1.4;
  letter-spacing: -.005em;
  color: var(--fg);
  text-wrap: pretty;
  margin: 0 0 10px;
}
.answer-card .a em{ font-style: italic; }

/* dish-input row that appears after "I'm eating X" chip */
.dish-input-wrap{
  margin-top: 12px;
  display:flex; align-items:center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 12px;
  height: 44px;
}
.dish-input-wrap svg{ width:16px; height:16px; color: var(--fg-muted); }
.dish-input-wrap input{
  flex: 1; height: 100%; min-width: 0;
  border: 0; background: transparent; color: var(--fg);
  font: 500 14px/1 var(--body); outline: none;
}
.dish-input-wrap input::placeholder{ color: var(--fg-faint); }
.dish-input-wrap .go{
  appearance:none; border:0; cursor:default;
  background: var(--accent); color: var(--accent-fg);
  height: 28px; padding: 0 10px; border-radius: var(--r-sm);
  font: 600 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}

/* pairing verdict (when answer is "yes/work") */
.pair-verdict{
  display:inline-flex; align-items:center; gap: 6px;
  padding: 4px 8px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-fg);
  font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 6px;
}
.pair-verdict.maybe{ background: var(--surface-2); color: var(--fg); border:1px solid var(--line-strong); }

/* sub-bullets in answer */
.answer-card ul{
  margin: 6px 0 0; padding: 0; list-style: none;
  display:flex; flex-direction:column; gap: 6px;
}
.answer-card ul li{
  padding-left: 14px; position: relative;
  font: 400 13.5px/1.45 var(--body); color: var(--fg);
}
.answer-card ul li::before{
  content:""; position:absolute; left: 0; top: 9px;
  width: 6px; height: 1px; background: var(--accent);
}
.answer-card ul li b{ font-weight:600; }
.answer-card ul li span{ color: var(--fg-muted); margin-left: 4px; }

/* ── Login screen ────────────────────────────────────────────────────── */
.login{
  min-height: 100%; display: flex; flex-direction: column;
  padding: 64px var(--pad) 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: 34px; 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;
}
.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 — mirrors gowokeless. */
.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);
}

/* ── Settings — reuses .login vocabulary with row-based content ─────── */
.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 labels visually align in a column down the right edge. */
.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);
}
.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);
}
.settings-list .version-url{
  font: 400 11.5px/1.4 var(--mono) !important;
  word-break: break-all;
}

/* Version label + inline copy affordance. Small, muted by default so
   it doesn't compete with the row's other text; lights up on hover. */
.settings-list .version-head{
  display: inline-flex; align-items: center; gap: 6px;
}
.settings-list .version-copy{
  appearance: none; background: transparent; border: 0;
  padding: 4px; cursor: pointer;
  color: var(--fg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  transition: background var(--t-quick) var(--ease),
              color var(--t-quick) var(--ease);
}
@media (hover: hover) {
  .settings-list .version-copy:hover{
    color: var(--fg);
    background: var(--accent-tint);
  }
}
.settings-list .version-copy:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.settings-list .version-copy svg{
  width: 14px; height: 14px; display: block;
}

/* Expanded version block — only renders when SPA running ≠ deployed
   or we're inside the native wrapper. Each line carries one
   identifier (Web / API / App), label-then-value, mono so SHAs
   are readable and copy-paste-able into a bug report. */
.settings-list .version-stack{
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 2px;
}
.settings-list .version-line{
  display: flex; align-items: baseline; gap: 8px;
  font: 400 12.5px/1.35 var(--mono);
  color: var(--fg);
}
.settings-list .version-label{
  flex-shrink: 0; width: 32px;
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
}
.settings-list .version-value{
  word-break: break-all;
}

/* Inline editorial-style link: subtle accent underline, slightly
   thicker on hover. Used in the Account row's privacy-policy copy. */
.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;
}

/* ── Segmented control — iOS-style three-button selector ─────────────── */
.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; }

.btn-block{
  appearance: none; border: 0; cursor: default;
  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;
}
.btn-block.ghost{ background: transparent; color: var(--fg); border: 1px solid var(--line-strong); }

/* ── 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);
  -webkit-tap-highlight-color: transparent;
}
.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;
  -webkit-tap-highlight-color: transparent;
}
.searchbar input::placeholder{ color: var(--fg-faint); }
/* Hide WebKit/Chromium's native clear button on type=search; we render
   our own .clear so the native one would just duplicate it. */
.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 input:disabled{ opacity: .55; cursor: not-allowed; }

.searchbar .clear{
  appearance:none; border: 0; background: transparent; color: var(--fg-muted);
  width: 24px; height: 24px; border-radius: 12px; padding: 0;
  display:flex; align-items:center; justify-content:center;
  cursor: pointer;
}
.searchbar .clear:hover{ background: var(--line); color: var(--fg); }
.searchbar .clear svg{ width: 16px; height: 16px; }

/* Primary submit disc — accent fill + arrow, the right-side counterpart
   to the magnifier on the left. */
.searchbar .submit{
  appearance:none; border: 0;
  background: var(--accent); color: var(--accent-fg);
  width: 32px; height: 32px; border-radius: 16px; padding: 0;
  display:flex; align-items:center; justify-content:center;
  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; }

.searchbar .cam{
  appearance:none; border: 0; background: transparent; color: var(--fg);
  width: 32px; height: 32px; border-radius: 16px; padding: 0;
  display:flex; align-items:center; justify-content:center;
  cursor: pointer; flex-shrink: 0;
}
.searchbar .cam:hover{ background: var(--line); }
.searchbar .cam svg{ width: 18px; height: 18px; color: var(--fg); }

.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{ opacity: .5; cursor: default; }
.typefilter button svg{ width: 14px; height: 14px; }

.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{
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600; font-size: 16px; line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--fg);
}
.recent-list{ display: flex; flex-direction: column; }
.recent-item{
  appearance: none; border: 0; background: transparent;
  width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--body); color: var(--fg);
  transition: background var(--t-quick) var(--ease);
}
.recent-item:hover{ background: var(--accent-tint); }
.recent-item:last-child{ border-bottom: 0; }
.recent-item .l{ display:flex; flex-direction: column; gap: 4px; min-width: 0; }
.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;
}

/* ── Bottom sheet ──────────────────────────────────────────────────────
   Reused from gowokeless (apps/gowokeless/web/app/styles.css:553+);
   the sheet.js component drives transform / progress / scrolled-class
   imperatively, so all we need here is the visual chrome.
   ───────────────────────────────────────────────────────────────────── */
.bsheet-host {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: 100;
  pointer-events: none;
}
.bsheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
}
.bsheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 95vh; height: 95lvh;
  max-height: 95vh; max-height: 95lvh;
  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%);
}
.bsheet-handle {
  height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  padding-top: 6px;
}
.bsheet-handle:active { cursor: grabbing; }
.bsheet-handle-bar {
  width: 44px; height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  opacity: .7;
}
.bsheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--pad) calc(32px + env(safe-area-inset-bottom));
}
.sheet-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 calc(-1 * var(--pad));
  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 var(--t-base) var(--ease);
}
.bsheet.scrolled .sheet-header { border-bottom-color: var(--line); }
.sheet-close {
  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-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);
  margin-bottom: 0;
}
body.sheet-open { overflow: hidden; }

/* ── Loading / error / empty states ──────────────────────────────────── */
.center-pane {
  min-height: 60vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 32px var(--pad);
  gap: 14px;
}
.center-pane h2 {
  margin: 0; font-family: var(--display);
  font-weight: 600; font-size: 22px; line-height: 1.2;
  letter-spacing: -.015em;
}
.center-pane p {
  margin: 0; font-family: var(--body);
  font-size: 14px; line-height: 1.55;
  color: var(--fg-muted);
  max-width: 28em;
}
.center-pane .spinner {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: tipsy-spin 720ms linear infinite;
}
@keyframes tipsy-spin { to { transform: rotate(360deg); } }
.center-pane .countdown {
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-faint);
}
.center-pane .actions { display: flex; gap: 12px; margin-top: 8px; }

.search-results {
  padding: 14px var(--pad) var(--pad);
  display: flex; flex-direction: column;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  cursor: pointer;
}
.search-row:last-child { border-bottom: 0; }
.search-row:hover { background: var(--accent-tint); }
.search-row .l { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.search-row .l .title {
  font: 500 15px/1.2 var(--body);
  color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-row .l .meta {
  font: 500 10px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-muted);
  display: flex; gap: 8px; flex-wrap: wrap;
}
.search-row .l .meta .sep { color: var(--line-strong); }
.search-row .l .desc {
  font: 400 13px/1.4 var(--body);
  color: var(--fg-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-row .r {
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  align-self: start;
  padding-top: 2px;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────────
   Wider viewports — same content, different rhythm. Mirrors gowokeless's
   desktop reflow at styles.css ~2241: bumps the gutter, caps the main
   column at 920px and centers it, narrows auth/error screens to ~520px
   for editorial readability, and shortens the appbar's vertical padding.
   ───────────────────────────────────────────────────────────────────── */
@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;
  }
  /* Auth + error pages are editorial single-column reads — narrower
     than the search/result viewport. */
  .login {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
}
