/* WhichCard — visual language locked to docs/mockups/whichcard-mockup-v1.html */

/* Warmth pass 2026-08: the page/surface tints, the winner gradient and the section-label
   colour are all TOKENS. Nothing below them moved — the layout is the approved mock. */
:root {
  --page:#faf9f6; --surface:#fffdf9; --ink:#0b0b0b; --ink-2:#52514e; --muted:#898781;
  --label:#8b8375;                        /* section labels — warm gray, not blue-gray */
  --hairline:#e3e0d7; --border:rgba(11,11,11,0.10);
  --accent:#2a78d6; --accent-deep:#1c5cab; --accent-wash:#cde2fb;
  --good:#0ca30c; --good-text:#006300; --warn:#fab219; --serious:#ec835a; --critical:#d03b3b;
  --warn-bg:#fdf1d4; --warn-ink:#8a5a00; --crit-bg:#fbe3e3; --crit-ink:#a02020;
  --shadow:0 10px 24px rgba(28,92,171,.28);
  --soft:0 2px 10px rgba(60,48,28,.07);   /* result rows — warm, barely there */
  --winner:linear-gradient(140deg,#0e3160 0%,#1a5cb2 46%,#2f86e8 84%,#3f95f0 100%);
  /* the utility bar is black in both themes — var(--ink) inverts, these don't */
  --bar-bg:#0b0b0b; --bar-ink:#cfcdc6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page:#0d0d0d; --surface:#1a1a19; --ink:#ffffff; --ink-2:#b8b6b0; --muted:#8a8880;
    --label:#948f83;
    --hairline:#2e2e2c; --border:rgba(255,255,255,0.12);
    --accent:#5ea0ea; --accent-deep:#9cc6f4; --accent-wash:#16304d;
    --good:#38c438; --good-text:#6fe06f; --critical:#f06a6a;
    --warn-bg:#3a2d10; --warn-ink:#ffd483; --crit-bg:#3b1a1a; --crit-ink:#ff9a9a;
    --shadow:0 10px 24px rgba(0,0,0,.5);
    --soft:0 2px 10px rgba(0,0,0,.32);
    --winner:linear-gradient(140deg,#0b2245 0%,#1a5cb2 50%,#2f86e8 88%,#3a90ec 100%);
    --bar-bg:#000000; --bar-ink:#b8b6b0;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page); color: var(--ink);
  min-height: 100dvh; overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.app {
  max-width: 560px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--page);
}
@media (min-width: 600px) {
  .app { border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline); }
}
.content {
  flex: 1; padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.apphead { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 0; }
.apphead .logo { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.apphead .logo em { color: var(--accent); font-style: normal; }
.house {
  font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 99px; padding: 5px 10px;
  display: inline-flex; align-items: center; gap: 5px;
}
.house b { color: var(--good-text); letter-spacing: .02em; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--muted); flex: 0 0 auto; }
.dot.synced { background: var(--good); }
.dot.pending { background: var(--warn); }
.dot.offline { background: var(--serious); }
.dot.local { background: var(--muted); }

.h-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; gap: 8px; }
.h-row h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }

/* ---------- search ---------- */
.search {
  background: var(--surface); border: 1.5px solid var(--accent); border-radius: 14px;
  padding: 10px 12px; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 1px 2px rgba(11,11,11,.04);
}
.search input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 15px; font-weight: 600; min-width: 0;
}
.search input::placeholder { color: var(--muted); font-weight: 500; }
.search .ico { color: var(--muted); font-size: 15px; }
.search .clear { color: var(--muted); font-size: 15px; padding: 0 2px; }
.resolved { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); padding: 0 4px; flex-wrap: wrap; }
.resolved .pill {
  background: var(--accent-wash); color: var(--accent-deep); font-weight: 700;
  border-radius: 99px; padding: 2px 8px; font-size: 11px;
}
/* "What counts as Groceries?" — the receipt for the resolved-category pill */
.hintbtn {
  font-size: 11px; font-weight: 700; color: var(--accent-deep);
  border: 1px solid var(--accent-wash); background: transparent;
  border-radius: 99px; padding: 2px 9px; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 2px;
}
.hintbtn:active { transform: scale(.97); }

/* ---------- chips ----------
 * The row scrolls horizontally on a phone. Every resting position has to land on a
 * chip BOUNDARY: a chip sliced down the middle at the left edge is unreadable and
 * reads as a typo ("Utilities" -> "Jtilities"). scroll-padding + a start snap does
 * that for finger-scrolling; renderBest() aligns the active chip the same way.
 */
.chips {
  display: flex; gap: 6px; padding: 2px 0 5px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  scroll-padding-inline: 0; scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; }
.chip {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 99px;
  padding: 7px 12px; white-space: nowrap; scroll-snap-align: start;
}
.chip.on { background: var(--ink); color: var(--page); border-color: var(--ink); }
.chip:active { transform: scale(.97); }
/* the category row is a filter, not a commitment: the active chip tints instead of
   inverting, so the emoji stays legible and the row stays calm */
#cat-chips .chip.on, #ben-filters .chip.on {
  background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent);
  font-weight: 700;
}

/* From a laptop there is room for the whole taxonomy — wrap it instead of hiding
   two thirds of it behind a horizontal scroll nobody discovers with a mouse. */
@media (min-width: 900px) {
  .chips { flex-wrap: wrap; overflow-x: visible; scroll-snap-type: none; }
}

/* ---------- winner ---------- */
.winner {
  border-radius: 18px; padding: 16px 16px 14px; color: #fff;
  background: var(--winner); box-shadow: var(--shadow);
}
.winner .use { font-size: 10px; font-weight: 800; letter-spacing: .14em; opacity: .85; }
.winner .row1 { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 6px; gap: 10px; }
.winner .name { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.winner .holder {
  font-size: 10px; font-weight: 700; background: rgba(255,255,255,.2);
  border-radius: 99px; padding: 3px 8px; margin-left: 8px; vertical-align: 2px;
}
.winner .rate { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
.winner .rate small { font-size: 14px; font-weight: 700; }
.winner .unitnote { font-size: 10px; font-weight: 600; opacity: .8; text-align: right; margin-top: -2px; }
.winner .why { font-size: 12px; opacity: .92; margin-top: 4px; }
/* a genuine tie, presented rather than resolved by sort order */
.winner .tieline {
  font-size: 11.5px; margin-top: 6px; padding: 4px 9px; display: inline-block;
  background: rgba(255,255,255,.14); border-radius: 99px;
}
.winner .tieline b { font-weight: 750; }
.winner .cav { font-size: 11px; opacity: .9; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.winner .cav b { font-weight: 700; }
.capbar { margin-top: 12px; }
.capbar .lbl { display: flex; justify-content: space-between; font-size: 11px; opacity: .9; margin-bottom: 5px; gap: 8px; }
.capbar .track { height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); }
.capbar .fill { height: 5px; border-radius: 3px; background: #fff; }

/* ---------- one-tap spend log on the winner ---------- */
.qlopen {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  background: var(--surface); border: 1px dashed var(--accent); border-radius: 13px;
  padding: 10px 13px; font-size: 12.5px; font-weight: 700; color: var(--accent-deep);
}
.qlopen span { font-size: 10.5px; font-weight: 600; color: var(--muted); margin-left: auto; }
.quicklog { background: var(--surface); border: 1.5px solid var(--accent); border-radius: 13px; padding: 10px 11px; }
.qlrow { display: flex; align-items: center; gap: 7px; }
.qlcur { font-size: 15px; font-weight: 800; color: var(--muted); }
.qlrow input {
  flex: 1; min-width: 0; background: var(--page); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 9px 11px; font-size: 15px; font-weight: 700; outline: none;
}
.qlrow input:focus { border-color: var(--accent); }
.qlsave {
  background: var(--accent); color: #fff; border-radius: 10px;
  padding: 9px 15px; font-size: 13px; font-weight: 800; flex: 0 0 auto;
}
.qlx { color: var(--muted); font-size: 15px; padding: 4px 2px; flex: 0 0 auto; }
.qlnote { font-size: 10.5px; color: var(--muted); margin-top: 7px; line-height: 1.4; }
.qlnote b { color: var(--ink-2); font-weight: 700; }

/* ---------- runner list ---------- */
.runners {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  overflow: hidden; box-shadow: var(--soft);
}
.runner {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border-bottom: 1px solid var(--hairline); width: 100%; text-align: left;
}
.runner:last-child { border-bottom: none; }
.runner.dim { opacity: .55; }
.mini { width: 38px; height: 26px; border-radius: 5px; flex: 0 0 auto; }
/* results carry slightly bigger art with one squared-off corner — a card, not a swatch */
.runner .mini {
  width: 44px; height: 30px; border-radius: 7px 3px 7px 7px;
  box-shadow: 0 1px 2px rgba(11,11,11,.22), inset 0 1px 0 rgba(255,255,255,.18);
}

/* the rest of the ranking, behind the same affordance as the picker's accordion */
.showall {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 11px 13px; font-size: 12px; font-weight: 700; color: var(--accent-deep);
  border-top: 1px solid var(--hairline); background: var(--page);
}
.showall .chev {
  font-size: 15px; line-height: 1; display: inline-block;
  transform: rotate(90deg); transition: transform .15s;
}
.runners.open .showall .chev { transform: rotate(-90deg); }
.showall:active { background: var(--surface); }

/* ---------- "you could earn more" (one row, dismissible) ---------- */
.applyhint {
  display: flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 5px 6px 5px 10px; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--accent-wash) 38%, var(--surface));
  border: 1px solid var(--accent-wash); font-size: 10.5px; line-height: 1.3; color: var(--ink-2);
}
.applyhint .hi { font-size: 12px; flex: 0 0 auto; }
/* wraps rather than ellipsizing: a rate or a fee must never be the thing that gets cut,
   so on a narrow phone the strip grows a line instead of losing a number */
.applyhint .ht { flex: 1 1 auto; min-width: 0; }
.applyhint .ht b { font-weight: 750; color: var(--ink); }
.applyhint .ht i { font-style: normal; color: var(--muted); }
.applyhint .hmath {
  flex: 0 0 auto; font-weight: 750; color: var(--accent-deep);
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
}
.applyhint .hgo {
  flex: 0 0 auto; font-size: 10px; font-weight: 650; color: var(--muted);
  text-decoration: none; white-space: nowrap;
}
.applyhint .hx { flex: 0 0 auto; color: var(--muted); font-size: 12px; padding: 6px 3px; }
/* the issuer link is always there; its LABEL only earns its width when there is room */
.applyhint .hgw { display: none; }
@media (min-width: 470px) { .applyhint .hgw { display: inline; } }
.runner .nm { font-size: 13.5px; font-weight: 650; }
.runner .why { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.runner .rcav { font-size: 10.5px; color: var(--muted); opacity: .85; margin-top: 2px; line-height: 1.35; }
.runner .rt { margin-left: auto; font-size: 14px; font-weight: 750; color: var(--ink-2); text-align: right; white-space: nowrap; }
.runner .rt small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }
.holdtag {
  font-size: 9.5px; font-weight: 700; color: var(--ink-2); background: var(--page);
  border: 1px solid var(--hairline); border-radius: 99px; padding: 1.5px 6px;
  margin-left: 6px; vertical-align: 1px;
}
.footnote { font-size: 10.5px; color: var(--muted); padding: 0 6px; line-height: 1.45; }
.notebar {
  font-size: 11.5px; color: var(--warn-ink); background: var(--warn-bg);
  border-radius: 12px; padding: 9px 12px; line-height: 1.4;
}

/* ---------- benefits ---------- */
.stat-row { display: flex; gap: 10px; }
.tile { flex: 1; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 11px 13px; }
.tile .v { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.tile .k { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.tile.warn .v { color: var(--warn-ink); }
.cardgroup { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; overflow: hidden; }
.cg-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border-bottom: 1px solid var(--hairline); background: var(--page);
}
.cg-head .nm { font-size: 13.5px; font-weight: 750; }
.cg-head .prog { margin-left: auto; font-size: 11px; font-weight: 650; color: var(--ink-2); }
.ben {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px;
  border-bottom: 1px solid var(--hairline); width: 100%; text-align: left;
}
.ben:last-child { border-bottom: none; }
.box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--muted); flex: 0 0 auto; margin-top: 1px; }
.box.ck { background: var(--good); border-color: var(--good); position: relative; }
.box.ck::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 800; position: absolute; top: -1px; left: 3.5px; }
.ben .t { font-size: 13px; font-weight: 600; }
.ben.done .t { color: var(--muted); text-decoration: line-through; }
.ben .s { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.ben .s b { color: var(--good-text); font-weight: 650; }
.amt { margin-left: auto; font-size: 13px; font-weight: 750; text-align: right; white-space: nowrap; }
.ben.done .amt { color: var(--muted); }
.due {
  display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 700;
  border-radius: 99px; padding: 2px 7px; margin-left: 6px; vertical-align: 1px; white-space: nowrap;
}
.due.warn { background: var(--warn-bg); color: var(--warn-ink); }
.due.crit { background: var(--crit-bg); color: var(--crit-ink); }
.ben.action .t { font-weight: 700; }
/* small caps, warm gray — a label, not a heading. all-small-caps also folds the
   already-uppercase strings the JS emits ("TO-DO", "YOUR TOP CARDS"). */
.sectitle {
  font-size: 12.5px; font-weight: 750; letter-spacing: .07em;
  font-variant-caps: all-small-caps; color: var(--label); padding: 6px 6px 0;
}

/* ---------- annual-fee verdict ---------- */
.verdict {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
  overflow: hidden; border-left-width: 4px;
}
.verdict + .verdict { margin-top: 10px; }
.verdict.keep, .verdict.onpace { border-left-color: var(--good); }
.verdict.review { border-left-color: var(--warn); }
.verdict.risk { border-left-color: var(--critical); }
.vhead {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border-bottom: 1px solid var(--hairline); background: var(--page);
}
.vhead .vnm { font-size: 13.5px; font-weight: 750; min-width: 0; }
.vbadge {
  margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  border-radius: 99px; padding: 3px 9px; white-space: nowrap;
  background: var(--warn-bg); color: var(--warn-ink);
}
.verdict.keep .vbadge, .verdict.onpace .vbadge { background: rgba(12,163,12,.14); color: var(--good-text); }
.verdict.risk .vbadge { background: var(--crit-bg); color: var(--crit-ink); }
.vbody { padding: 11px 13px 13px; }
.vline { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.vline b { color: var(--ink); font-weight: 750; }
.vbar { height: 6px; border-radius: 99px; background: var(--hairline); overflow: hidden; margin: 9px 0 8px; }
.vbar i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.verdict.review .vbar i { background: var(--warn); }
.verdict.risk .vbar i { background: var(--critical); }
.vsub { font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.vsub b { color: var(--ink); font-weight: 700; }
.vbreak { font-size: 10.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.vaction, .vdown, .vnudge {
  font-size: 11.5px; line-height: 1.5; border-radius: 11px; padding: 9px 11px; margin-top: 9px;
}
.vaction { background: var(--crit-bg); color: var(--crit-ink); }
.vaction b { color: var(--crit-ink); font-weight: 800; }
.vdown { background: var(--page); color: var(--ink-2); border: 1px solid var(--hairline); }
.vdown b { color: var(--ink); font-weight: 750; }
.vnudge { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- a full-width link out of the app (signup offers) ---------- */
.linkrow {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 12px 14px;
  width: 100%; text-align: left;                 /* the import row is a <button>, not an <a> */
}
.linkrow .t { font-size: 13.5px; font-weight: 750; color: var(--accent-deep); }
.linkrow .s { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

/* card-linked offers — same row rhythm as the to-dos, but the row holds a link */
.ben.offer .t { font-weight: 700; }
.ben.offer.done .t { color: var(--muted); text-decoration: line-through; }
.boxbtn { padding: 0; flex: 0 0 auto; margin-top: 1px; display: block; }
.boxbtn .box { display: block; }
.olink {
  margin-left: auto; align-self: center; font-size: 11px; font-weight: 700; text-decoration: none;
  color: var(--accent-deep); background: var(--accent-wash); border-radius: 99px;
  padding: 6px 11px; white-space: nowrap;
}

/* ---------- my cards ---------- */
.mycard {
  display: flex; align-items: center; gap: 11px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 14px; padding: 11px 13px;
  width: 100%; text-align: left;
}
.mycard.sock { opacity: .6; }
.art { width: 46px; height: 30px; border-radius: 6px; flex: 0 0 auto; }
.mycard .nm { font-size: 13.5px; font-weight: 700; }
.mycard .st { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.35; }
.mycard .st b { font-weight: 700; }
.mycard .chev { margin-left: auto; color: var(--muted); font-size: 16px; }
.addbtn {
  border: 1.5px dashed var(--accent); color: var(--accent-deep); border-radius: 14px;
  padding: 13px; text-align: center; font-size: 13.5px; font-weight: 700;
  background: var(--accent-wash); width: 100%;
}
.addhint { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: -4px; }
.syncbox { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 13px; }
.syncbox .k { font-size: 11px; font-weight: 700; color: var(--ink-2); letter-spacing: .06em; }
.syncbox .code { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.syncbox .cd {
  font-size: 17px; font-weight: 800; letter-spacing: .04em; background: var(--page);
  border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 12px;
}
.syncbox .cp { margin-left: auto; background: var(--ink); color: var(--page); font-size: 12px; font-weight: 700; border-radius: 10px; padding: 9px 14px; }
.syncbox .s { font-size: 10.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.syncrow { display: flex; gap: 8px; margin-top: 8px; }
.syncrow input {
  flex: 1; min-width: 0; background: var(--page); border: 1px solid var(--hairline);
  border-radius: 10px; padding: 9px 11px; font-size: 13px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; outline: none;
}

/* ---------- bottom nav ---------- */
.nav {
  display: flex; border-top: 1px solid var(--hairline); background: var(--surface);
  padding: 8px 8px calc(14px + env(safe-area-inset-bottom)); position: sticky; bottom: 0;
}
.nav button { flex: 1; text-align: center; font-size: 10.5px; font-weight: 650; color: var(--muted); padding: 4px 0; }
.nav button.on { color: var(--accent-deep); }
.nav .ic { font-size: 18px; display: block; margin-bottom: 2px; }

/* ---------- first run ---------- */
.hero { padding: 22px 8px 4px; }
.hero .brand { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.hero .brand em { color: var(--accent); font-style: normal; }
.hero h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.hero p { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.45; }
.pick {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 13px; padding: 10px 12px; width: 100%;
  text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-wash) 45%, var(--surface)); }
.pick .pkbody { min-width: 0; flex: 1; }
.pick .nm { font-size: 13px; font-weight: 650; }
.pick .iss { font-size: 10.5px; color: var(--muted); }
.pick .ck { margin-left: auto; width: 20px; height: 20px; border-radius: 99px; border: 1.5px solid var(--hairline); flex: 0 0 auto; }
.pick.on .ck { background: var(--accent); border-color: var(--accent); position: relative; }
.pick.on .ck::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 800; position: absolute; top: 0; left: 3.5px; }
.pick .cnt { font-size: 10px; font-weight: 700; color: var(--muted); margin-left: auto; margin-right: 4px; white-space: nowrap; }
.pick .copies {
  font-size: 10.5px; font-weight: 700; color: var(--accent-deep); background: var(--page);
  border: 1px solid var(--accent); border-radius: 99px; padding: 4px 9px; margin-left: auto;
  white-space: nowrap; flex: 0 0 auto;
}
.pick .stepper {
  display: inline-flex; align-items: center; gap: 2px; margin-left: auto; flex: 0 0 auto;
  background: var(--page); border: 1px solid var(--accent); border-radius: 99px; padding: 2px;
}
.pick .stepper b { font-size: 12px; font-weight: 800; min-width: 16px; text-align: center; color: var(--accent-deep); }
.stepbtn {
  width: 24px; height: 24px; border-radius: 99px; font-size: 15px; font-weight: 800; line-height: 1;
  color: var(--accent-deep); background: var(--accent-wash);
}
.stepbtn:disabled { opacity: .35; }
.badge {
  display: inline-block; font-size: 8.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 99px; padding: 2px 6px; margin-left: 6px; vertical-align: 1px; white-space: nowrap;
}
.badge.gf { background: var(--warn-bg); color: var(--warn-ink); }
.badge.so { background: var(--accent-wash); color: var(--accent-deep); }
.badge.uv { background: transparent; color: var(--muted); border: 1px solid var(--hairline); font-weight: 700; }
.grouphd {
  font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 8px 6px 1px;
}
.grouphd:first-child { padding-top: 2px; }

/* ---------- issuer accordion (the picker's default state) ---------- */
.acchd {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 13px;
  padding: 12px; -webkit-tap-highlight-color: transparent;
}
.acchd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acchd:active { background: var(--page); }
.acchd .ai { font-size: 13.5px; font-weight: 700; min-width: 0; }
.acchd .an { font-size: 10.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.acchd .asel {
  margin-left: auto; font-size: 9.5px; font-weight: 800; letter-spacing: .03em;
  background: var(--accent-wash); color: var(--accent-deep);
  border-radius: 99px; padding: 3px 8px; white-space: nowrap;
}
.acchd .chev {
  margin-left: auto; color: var(--muted); font-size: 17px; line-height: 1; flex: 0 0 auto;
  transition: transform .15s; transform: rotate(90deg);
}
.acchd .asel + .chev { margin-left: 0; }
.acc.open .acchd { border-color: var(--accent); background: var(--page); }
.acc.open .acchd .ai { color: var(--accent-deep); }
.acc.open .acchd .chev { transform: rotate(-90deg); }
.accbody { display: flex; flex-direction: column; gap: 7px; padding: 7px 0 3px 10px; }
.cta {
  background: var(--accent); color: #fff; border-radius: 14px; text-align: center;
  font-size: 15px; font-weight: 800; padding: 14px; box-shadow: 0 8px 18px rgba(42,120,214,.3); width: 100%;
}
.cta:disabled { opacity: .45; box-shadow: none; }
.ghostbtn {
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2);
  border-radius: 12px; padding: 11px; font-size: 13px; font-weight: 700; width: 100%;
}
/* first run: secondary by design — it sits above the fold but must never read as
   the primary action, which is picking cards */
.joinbtn {
  border: 1px dashed var(--hairline); background: transparent; color: var(--ink-2);
  border-radius: 11px; padding: 9px 12px; font-size: 12px; font-weight: 650;
  width: 100%; text-align: center; margin-top: -3px;
}
.joinbtn:active { background: var(--surface); }
/* the picker list is long now (44 issuers), so the CTA rides the bottom of the
   viewport instead of hiding under it */
.frfoot {
  position: sticky; bottom: 0; z-index: 5; margin: -8px -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--page) 68%, transparent);
}
.scrolllist { display: flex; flex-direction: column; gap: 7px; }

/* ---------- sheet ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(11,11,11,.45);
}
.sheet {
  background: var(--page); width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; overflow: hidden;
  animation: rise .18s ease-out;
}
@keyframes rise { from { transform: translateY(14px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px;
  border-bottom: 1px solid var(--hairline); background: var(--surface);
}
.sheet-head h4 { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; flex: 1; }
.sheet-head .x { font-size: 20px; color: var(--muted); line-height: 1; padding: 2px 4px; }
.sheet-body { overflow-y: auto; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 14px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); background: var(--surface); display: flex; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .lab { font-size: 12.5px; font-weight: 750; }
.field > .help { font-size: 11px; color: var(--muted); line-height: 1.45; }
.field input[type=text], .field input[type=number], .field select {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 11px;
  padding: 10px 12px; font-size: 14px; outline: none; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 11px 12px; }
.toggle .lab { font-size: 13px; font-weight: 650; flex: 1; }
.sw { width: 44px; height: 26px; border-radius: 99px; background: var(--hairline); position: relative; flex: 0 0 auto; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.sw.on { background: var(--good); }
.sw.on::after { left: 21px; }
.dangerbtn { color: var(--critical); border: 1px solid var(--hairline); background: var(--surface); border-radius: 12px; padding: 11px; font-size: 13px; font-weight: 700; width: 100%; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-2); padding: 3px 2px; }
.kv b { font-weight: 700; color: var(--ink); }
.empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 26px 18px; line-height: 1.5; }
/* ---------- report-an-error form (sheet body) ---------- */
.reportform textarea {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 11px;
  padding: 10px 12px; font-size: 14px; outline: none; width: 100%; min-height: 108px;
  resize: vertical; font-family: inherit;
}
.reportform textarea:focus { border-color: var(--accent); }
.reportform .cnt { font-size: 10.5px; color: var(--muted); text-align: right; }
.reportform .ok {
  background: var(--accent-wash); color: var(--accent-deep); border-radius: 12px;
  padding: 14px; font-size: 13px; font-weight: 650; line-height: 1.5;
}
.reportform .err { font-size: 11.5px; color: var(--critical); }

/* ---------- statement import (sheet) ---------- */
.privbanner {
  background: var(--accent-wash); color: var(--accent-deep); border-radius: 12px;
  padding: 11px 13px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
}
#imp-file {
  background: var(--surface); border: 1px dashed var(--hairline); border-radius: 11px;
  padding: 14px 12px; font-size: 12.5px; width: 100%;
}
.impfile {
  border: 1px solid var(--hairline); background: var(--surface); border-radius: 13px;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 5px;
}
.impfile .nm { font-size: 13px; font-weight: 750; word-break: break-all; }
.impfile .s { font-size: 11px; color: var(--muted); line-height: 1.45; }
.impfile .s.warn { color: var(--warn-ink); }
.impfile .lab { font-size: 11.5px; font-weight: 700; margin-top: 4px; }
.impfile select {
  background: var(--page); border: 1px solid var(--hairline); border-radius: 10px;
  padding: 9px 10px; font-size: 13px; width: 100%;
}
.impstat {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 13px;
  padding: 11px 13px; font-size: 13px; line-height: 1.5;
}
.impstat .s { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.imptable { display: flex; flex-direction: column; gap: 4px; }
.improw { display: grid; grid-template-columns: 1fr 78px auto; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 2px; }
.improw .c { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.improw .bar { height: 7px; border-radius: 99px; background: var(--hairline); overflow: hidden; }
.improw .bar i { display: block; height: 100%; background: var(--accent); }
.improw .v { font-weight: 750; font-variant-numeric: tabular-nums; }
.improw .v small { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.impmis {
  border: 1px solid var(--crit-ink); background: var(--crit-bg); color: var(--crit-ink);
  border-radius: 14px; padding: 12px 13px; display: flex; flex-direction: column; gap: 6px;
}
.impmis.clean { border-color: var(--good); background: var(--surface); color: var(--ink); }
.impmis .k { font-size: 10px; font-weight: 800; letter-spacing: .07em; opacity: .85; }
.impmis .big { font-size: 20px; font-weight: 850; letter-spacing: -0.02em; }
.impmis .big.ok { color: var(--good-text); }
.impmis .s { font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.impmis .fine { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.impmis .misl { display: flex; flex-direction: column; gap: 5px; }
.impmis .misrow {
  background: var(--surface); border-radius: 10px; padding: 8px 10px;
  font-size: 11.5px; color: var(--ink); line-height: 1.45;
}
.impmis .misrow .x { font-weight: 800; color: var(--critical); margin-right: 4px; }
.impuncat {
  border-top: 1px solid var(--hairline); padding: 9px 2px 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.impuncat .nm { font-size: 12.5px; font-weight: 750; display: flex; justify-content: space-between; gap: 8px; text-transform: capitalize; }
.impuncat .nm span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: none; white-space: nowrap; }
.impuncat .chip { font-size: 11px; padding: 5px 9px; }

/* ---------- about row (mobile: the footer links live at the foot of My Cards) ---------- */
.aboutrow { padding: 2px 6px 4px; }
.aboutrow .k { font-size: 11px; font-weight: 700; color: var(--ink-2); letter-spacing: .06em; }
.aboutrow .ln { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; }
.aboutrow a, .aboutrow button {
  font-size: 11.5px; font-weight: 650; color: var(--accent-deep);
  text-decoration: underline; text-underline-offset: 2px; padding: 0;
}
.aboutrow .paid { font-size: 10.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ================================================================== *
 * DESKTOP SITE CHROME (>= 900px only — below that this is the PWA,
 * unchanged: bottom tabs, no header, no footer)
 * ================================================================== */
.sitechrome, .sitefoot { display: none; }

@media (min-width: 900px) {
  .sitechrome { display: block; }
  .sitebar {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    background: var(--bar-bg); color: var(--bar-ink); font-size: 11.5px; padding: 7px 28px;
  }
  .sitebar a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
  .sitenav {
    display: flex; align-items: center; gap: 26px; background: var(--surface);
    border-bottom: 1px solid var(--hairline); padding: 14px 28px;
  }
  .sitenav .logo { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
  .sitenav .logo em { color: var(--accent); font-style: normal; }
  .sitenav .links { display: flex; gap: 22px; align-items: center; }
  .sitenav .links a, .sitenav .links button {
    font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none;
    padding-bottom: 3px; border-bottom: 2.5px solid transparent;
  }
  .sitenav .links a:hover, .sitenav .links button:hover { color: var(--ink); }
  .sitenav .links .on { color: var(--accent-deep); border-bottom-color: var(--accent); }

  .sitefoot {
    display: block; background: var(--surface); border-top: 1px solid var(--hairline);
    padding: 20px 28px 26px; font-size: 11.5px; color: var(--muted);
  }
  .sitefoot .links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
  .sitefoot .links a, .sitefoot .links button {
    font-size: 12px; font-weight: 650; color: var(--ink-2);
    text-decoration: underline; text-underline-offset: 2px; padding: 0;
  }
  .sitefoot p { max-width: 900px; line-height: 1.55; }

  /* the app column keeps its phone width; the chrome frames it */
  .app { min-height: calc(100dvh - 190px); }
  .apphead .logo { display: none; }          /* the site nav already carries it */
  .apphead .house { margin-left: auto; }
  .aboutrow { display: none; }               /* the footer says all of this */
}

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: var(--ink); color: var(--page); font-size: 12.5px; font-weight: 650;
  padding: 10px 16px; border-radius: 99px; z-index: 60; box-shadow: 0 6px 18px rgba(0,0,0,.3);
  max-width: 90vw; text-align: center;
}
