/* Cardvane design tokens. Every size, color and timing below comes from here. */
:root {
  /* Quiet premium (Nov 15 redesign): neutral surfaces, near-black ink, and color only where it means something:
     green = confirmed (posted), amber = estimate, red = destructive. The cards are the only colorful objects. */
  --bg: #f2f2f0;
  --surface: #ffffff;
  --surface-2: #e7e7e4;       /* fills: search, segmented, secondary buttons */
  --surface-3: #d9d9d5;
  --text: #111213;
  --text-2: #64666a;          /* secondary text: 5.2:1 on --bg */
  --text-3: #9c9ea2;          /* placeholders, chevrons, dimmed rows */
  --line: rgba(17, 18, 19, 0.09);
  --ink: #111213;             /* primary buttons */
  --on-ink: #ffffff;
  --accent: #136b4d;          /* posted / confirmed, links, focus */
  --accent-soft: rgba(19, 107, 77, 0.1);
  --estimate: #8a5a0b;
  --estimate-soft: rgba(176, 116, 22, 0.12);
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.1);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.12), 0 16px 32px -16px rgba(0, 0, 0, 0.45);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 14px;
  --r-xl: 14px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, Roboto, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);   /* close to a critically damped spring */
  /* Deliberate card travel, requested after build 32 felt rushed. */
  --duration-card-open: 550ms;
  --duration-card-close: 500ms;
  --duration-card-flip: 450ms;
  --tabbar-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #151517;
    --surface-2: #1f1f22;
    --surface-3: #2c2c30;
    --text: #f4f4f2;
    --text-2: #9a9ca0;
    --text-3: #66686c;
    --line: rgba(255, 255, 255, 0.09);
    --ink: #f4f4f2;
    --on-ink: #000000;
    --accent: #4fc995;
    --accent-soft: rgba(79, 201, 149, 0.13);
    --estimate: #f0b45c;
    --estimate-soft: rgba(240, 180, 92, 0.13);
    --danger: #ff8a80;
    --danger-soft: rgba(255, 138, 128, 0.12);
    --shadow-1: none;
    --shadow-2: none;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 32px -16px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
  }
}

/* ---- platform baseline (mobile-native) ---- */
* { box-sizing: border-box; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.42 var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
input, select, textarea { font: inherit; font-size: 17px; color: var(--text); }
button { font: inherit; color: inherit; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
a { color: inherit; }
[hidden] { display: none !important; }
/* Inside the app shell: scroll rubber-bands like any iPhone screen, and a long press doesn't select labels.
   Fields and the text meant for copying stay selectable. The website keeps normal browser behavior. */
html:has(body.native-tabs) { overscroll-behavior-y: auto; }
body.native-tabs { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.native-tabs :is(input, textarea, [contenteditable]) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.native-tabs img { -webkit-user-drag: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.icon { width: 22px; height: 22px; flex: none; }
.icon-lg { width: 32px; height: 32px; }
.icon-xl { width: 44px; height: 44px; }

/* ---- shell ---- */
.app { min-height: 100dvh; }
.screen {
  padding: calc(env(safe-area-inset-top, 0px) + var(--s-5)) var(--s-5) calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--s-8));
  max-width: 560px;
  margin: 0 auto;
  animation: screen-in 260ms var(--ease-out);
}
body.onboarding .tabbar, body.native-tabs .tabbar { display: none; }
body.onboarding .screen, body.doc .screen { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--s-8)); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

/* ---- type: tracking tightens as size grows ---- */
.eyebrow { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 var(--s-1); }
.display { font-size: 40px; line-height: 1.04; font-weight: 750; letter-spacing: -0.035em; margin: 0 0 var(--s-3); text-wrap: balance; }
.large-title { font-size: 32px; line-height: 1.08; font-weight: 700; letter-spacing: -0.028em; margin: 0; text-wrap: balance; }
.title { font-size: 28px; line-height: 1.12; font-weight: 700; letter-spacing: -0.024em; margin: var(--s-3) 0 var(--s-2); text-wrap: balance; }
.subtitle, .lede { color: var(--text-2); font-size: 16px; line-height: 1.45; margin: var(--s-2) 0 var(--s-6); text-wrap: pretty; }
.lede { font-size: 17px; }
.section { margin-top: var(--s-8); }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text-2); margin: 0 var(--s-1) var(--s-2); }
.section-footer, .fine { font-size: 13px; line-height: 1.4; color: var(--text-2); margin: var(--s-2) var(--s-1) 0; }
.fine { text-align: center; }
.link { color: var(--accent); font-weight: 500; text-decoration: none; }
.link:active { opacity: 0.6; }

.header { margin-bottom: var(--s-6); }
.header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); }
.header .subtitle { margin: var(--s-2) 0 0; }

/* ---- tab bar: a translucent layer content scrolls under ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px var(--s-2) env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--line);
}
.tab {
  display: grid; justify-items: center; gap: 2px; min-height: var(--tabbar-h);
  padding: 6px 0 4px; background: none; border: 0; color: var(--text-3);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.tab .icon { width: 25px; height: 25px; }
.tab[aria-selected="true"] { color: var(--text); }
.tab:active { transform: scale(0.94); }
.tab-icon { position: relative; display: grid; place-items: center; }
.tab .badge {
  position: absolute; transform: translate(14px, -2px); min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 17px;
}

/* ---- buttons: feedback on press, never on release ---- */
.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 50px; padding: 0 var(--s-5); border-radius: var(--r-md); border: 0; cursor: pointer;
  font-size: 17px; font-weight: 600; letter-spacing: -0.012em;
  transition: transform 110ms var(--ease-out), opacity 160ms, background 160ms;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.plain { background: none; color: var(--text-2); font-weight: 500; font-size: 16px; min-height: 44px; }
.btn.danger { background: none; color: var(--danger); font-weight: 500; font-size: 16px; min-height: 44px; }
.btn.wide { width: 100%; }
.btn.large { min-height: 58px; font-size: 18px; border-radius: 18px; }
.btn.small { min-height: 38px; padding: 0 var(--s-4); font-size: 15px; border-radius: var(--r-sm); }
.btn.plain.small, .btn.danger.small { padding: 0 var(--s-2); min-height: 36px; }
.btn .icon { width: 20px; height: 20px; }
/* "Show more" / "All purchases" under a list: a text link, not another slab */
.btn.more { margin-top: var(--s-1); background: none; color: var(--accent); font-weight: 500; font-size: 16px; min-height: 44px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 20px; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--text); flex: none;
  transition: transform 110ms var(--ease-out);
}
.icon-btn:active { transform: scale(0.92); }
.nav-back {
  display: inline-flex; align-items: center; gap: 2px; margin: 0 0 var(--s-2) -6px; padding: 6px 8px 6px 2px;
  background: none; border: 0; color: var(--accent); font-size: 17px; text-decoration: none; cursor: pointer;
}
.nav-back .icon { width: 24px; height: 24px; }
.nav-back:active { opacity: 0.5; }

.actions { display: grid; gap: var(--s-1); margin-top: var(--s-6); justify-items: center; }
.actions .btn.wide + .btn { margin-top: var(--s-1); }

/* ---- lists ---- */
.group {
  background: var(--surface); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-1);
}
.group.plain { background: none; box-shadow: none; border: 0; }
.group.plain .row { padding-left: 0; padding-right: 0; }
.group.plain .row + .row { border-top: 0; }
.group.spaced { margin-top: var(--s-4); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px;
  padding: var(--s-3) var(--s-4); background: none; border: 0; text-align: left; color: inherit;
}
.row + .row, .confirm + .confirm, .earn + .earn { border-top: 0.5px solid var(--line); }
.row.tappable { cursor: pointer; transition: background 120ms var(--ease-out); }
.row.tappable:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-title { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; line-height: 1.35; color: var(--text-2); }
.row-end { color: var(--text-2); font-size: 15px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; flex: none; }
.row .chev { width: 18px; height: 18px; opacity: 0.4; }
.row .check { width: 22px; height: 22px; color: var(--accent); opacity: 0; transform: scale(0.6); transition: opacity 140ms, transform 200ms var(--ease-out); }
.row.option[aria-pressed="true"] .check { opacity: 1; transform: none; }
.row.option[aria-pressed="true"] { background: var(--accent-soft); }
.row.blocked .row-title { color: var(--text-2); }
.glyph {
  width: 26px; height: 26px; display: grid; place-items: center; flex: none;
  background: none; font-size: 15px; font-weight: 600; color: var(--text-2);
}
.glyph .icon { width: 22px; height: 22px; stroke-width: 1.7; }
/* Icons are line art in the secondary color, never tinted tiles: the rate and the card carry the color. */
.row-title .fav-mark { margin-left: 6px; vertical-align: -1px; }
.row-title .fav-mark .icon { width: 13px; height: 13px; }
/* the winning card at a store, on its row */
.row-pick { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.row-pick .swatch { width: 38px; border-radius: 5px; }
.row-rate { font-size: 16px; font-weight: 600; min-width: 2.6em; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.group.plain .glyph { color: var(--text-2); }

.skeleton .glyph, .skeleton .bar {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.skeleton .bar { height: 12px; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.status-line { color: var(--text-2); font-size: 15px; margin: var(--s-3) var(--s-1); min-height: 1.4em; }
.status-line:empty { margin: var(--s-2) 0; min-height: 0; }

/* ---- inputs (16px or larger, so iOS never zooms) ---- */
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; min-height: 44px;
  background: var(--surface-2); border-radius: 12px; border: 0;
  transition: box-shadow 160ms;
}
.search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 10px 0; }
.search input::placeholder, .input::placeholder { color: var(--text-3); }
.search > .icon { color: var(--text-3); width: 20px; height: 20px; }
.find-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin-top: var(--s-2); }  /* minmax: the chip row scrolls instead of widening the page */
.find-form .search { min-height: 44px; }
.find-extra { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.find-extra:empty { display: none; }
/* Nearby · Categories · Recent: the three views under the search field. */
.nearby-views { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin-top: var(--s-4); }
.nearby-views[hidden] { display: none; }
.nearby-status { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.nearby-status .status-line { margin: 0 var(--s-1); flex: 1; min-width: 0; }
.nearby-status .btn { flex: none; }
.nearby-start { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.nearby-start .section-footer { text-align: center; }
.row.everyday .row-title, .row.everyday .row-rate { color: var(--text-2); font-weight: 500; }
.row.everyday .glyph, .row.everyday .swatch { opacity: 0.55; }
.suggest:empty { display: none; }

.field { display: grid; gap: 6px; margin: var(--s-5) 0 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 var(--s-1); }
.field-hint { font-size: 13px; color: var(--text-2); padding: 0 var(--s-1); }
.input {
  width: 100%; min-height: 48px; padding: 0 var(--s-4); border-radius: 12px; border: 0;
  background: var(--surface); box-shadow: var(--shadow-1); outline: none; transition: box-shadow 160ms;
}
.input:focus { box-shadow: 0 0 0 2px var(--accent); }
/* iOS draws date inputs natively: wider than their box, shorter, centered. Make them match the text fields. */
.input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 48px; line-height: 48px; text-align: left; color: var(--text); }
.input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; }
.textarea { padding: 14px var(--s-4); min-height: 96px; resize: none; line-height: 1.4; }
.select {
  min-height: 40px; padding: 0 30px 0 var(--s-3); border-radius: var(--r-sm); border: 0.5px solid var(--line); max-width: 52%;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a877e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 16px;
  appearance: none; -webkit-appearance: none; font-size: 16px;
}

.chips { display: flex; gap: var(--s-2); overflow-x: auto; padding: 2px; margin: 0 -2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; cursor: pointer; scroll-snap-align: start;
  background: var(--surface-2); border: 0; font-size: 15px; font-weight: 500;
  transition: background 140ms, color 140ms, transform 110ms var(--ease-out);
}
.chip:active { transform: scale(0.96); }
.offer-chips { margin: 0 0 var(--s-3); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: transparent; }

.setting-row { min-height: 60px; }
.setting-row label.row-main { cursor: pointer; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--surface-3); transition: background 200ms var(--ease-out); pointer-events: none; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 240ms var(--ease-out);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: var(--s-1); flex: none; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 20px; cursor: pointer; }
.stepper button:active { transform: scale(0.92); background: var(--surface-3); }
.stepper output { min-width: 48px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- status ---- */
/* How sure a rate is: posted (green check), bank category (grey), estimate (amber). Icon, color and words all differ. */
.pill { display: flex; align-items: flex-start; gap: 6px; padding: 0; font-size: 14px; font-weight: 500; line-height: 1.35; }
.pill .icon { width: 17px; height: 17px; margin-top: 1px; }
.pill.verified { color: var(--accent); }
.pill.coded { color: var(--text-2); }
.pill.estimate { color: var(--estimate); }
.callout { display: grid; gap: 2px; margin-top: var(--s-3); padding: 14px var(--s-4); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); font-size: 15px; line-height: 1.4; }
.callout.action { margin: 0 0 var(--s-3); }
.callout.kind-question { margin: var(--s-3) 0; }
.callout.kind-question .actions-inline { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.callout.kind-question .btn { flex: 1; }
.badge-pill { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 8px; flex: none; letter-spacing: 0; }
.badge-pill.estimate { color: var(--estimate); background: var(--estimate-soft); }
.badge-pill.verified { color: var(--accent); background: var(--accent-soft); }
.badge-pill.danger { color: var(--danger); background: var(--danger-soft); }
.empty { text-align: center; padding: var(--s-8) var(--s-3) var(--s-2); display: grid; justify-items: center; gap: var(--s-2); }
.empty-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: var(--s-2) 0 0; }
.empty-text { color: var(--text-2); margin: 0 0 var(--s-3); max-width: 32ch; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-1); }
.stat-num { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--text-2); }

/* ---- onboarding ---- */
.onboarding-step { display: flex; flex-direction: column; min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 72px); }
.onboarding-step .footer-actions { margin-top: auto; padding-top: var(--s-8); display: grid; gap: var(--s-2); justify-items: center; }
.footer-actions .link { padding: var(--s-2); font-size: 15px; }
.footer-actions.sticky {
  position: sticky; bottom: 0; margin: auto calc(-1 * var(--s-5)) calc(-1 * var(--s-8)); padding: var(--s-4) var(--s-5) calc(env(safe-area-inset-bottom, 0px) + var(--s-4));
  background: linear-gradient(to bottom, transparent, var(--bg) 28%);
}
.dots { display: flex; gap: 6px; margin: var(--s-2) 0 var(--s-2); }
.dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--surface-3); transition: width 300ms var(--ease-out), background 300ms; }
.dots span.done { background: var(--text-3); }
.dots span.on { width: 24px; background: var(--ink); }
/* card height (width / 1.586) plus the fan's 52px of offset and its rotation */
.hero-stack { position: relative; width: min(300px, 82%); height: calc(min(300px, 82vw) / 1.586 + 76px); margin: var(--s-4) auto var(--s-4); }
.hero-stack .card-art {
  position: absolute; left: 0; right: 0; top: 0;
  transform: translateY(calc(var(--i) * 26px)) rotate(calc((var(--i) - 1) * -5deg));
  animation: deal 700ms var(--ease-sheet) both; animation-delay: calc(var(--i) * 90ms);
}
@keyframes deal { from { opacity: 0; transform: translateY(70px) rotate(0deg) scale(0.94); } }
.hero-stack.small { height: 150px; width: 200px; margin: 0 auto var(--s-4); }
.illustration { width: 96px; height: 96px; border-radius: 30px; display: grid; place-items: center; margin: var(--s-10) 0 var(--s-4); background: var(--surface-2); color: var(--text); }
.picker { display: grid; gap: var(--s-2); }
.picker .section { margin-top: var(--s-5); }

/* ---- card art ---- */
.card-art {
  position: relative; aspect-ratio: 1.586; border-radius: 6.5cqi; border-radius: 13px; overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: var(--fg, #fff);
  box-shadow: var(--shadow-card);
}
.card-art::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 45%);
}
.card-art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.18); }
.card-art { container-type: inline-size; }
.card-art .art-issuer { position: absolute; top: 9%; left: 8%; right: 8%; font-size: max(8px, 4.6cqi); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; }
.card-art .art-name { position: absolute; top: calc(9% + max(12px, 6.6cqi)); left: 8%; right: 8%; font-size: max(11px, 7cqi); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-art .art-network { position: absolute; right: 8%; bottom: 9%; font-size: max(8px, 4.8cqi); font-weight: 700; font-style: italic; letter-spacing: 0.03em; opacity: 0.9; }
.card-art .art-summary { position: absolute; left: 8%; right: 30%; bottom: 9%; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: max(10px, 5cqi); font-weight: 600; opacity: 0.94; }
.art-earn { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.art-earn .icon { width: 1.25em; height: 1.25em; stroke-width: 2; }
.swatch { width: 38px; aspect-ratio: 1.586; border-radius: 5px; flex: none; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.25); }

/* ---- recommendation ---- */
/* The recommendation keeps one clear focal point; details expand in place. */
.recommendation-heading { display: flex; align-items: flex-start; gap: 12px; }
.recommendation-heading .sheet-title { flex: 1; min-width: 0; font-size: 25px; line-height: 1.16; margin: 4px 0 0; }
.favorite-control { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px;
  padding: 10px; border: 0; border-radius: 50%; background: none; color: var(--text-3); cursor: pointer; }
.favorite-control[aria-pressed="true"] { color: var(--text); }
.favorite-control[aria-pressed="true"] .icon { fill: currentColor; }
.favorite-control:active { transform: scale(0.97); }
.store-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; margin-top: 2px; }
.category-control { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 44px; padding: 0;
  border: 0; background: none; font-size: 14px; color: var(--text-2); text-align: left; }
button.category-control { cursor: pointer; }
.category-source { font-size: 11px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-2); }
.category-control .chev, .store-address .chev { width: 12px; height: 12px; }
.store-distance { font-size: 13px; color: var(--text-2); }
.store-address { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; font-size: 13px; color: var(--text-2); margin-top: -2px; }
.store-address .link { display: inline-flex; align-items: center; min-height: 44px; gap: 2px; }
.rec-hero { display: grid; gap: 14px; justify-items: center; margin: 18px 0 22px; padding: 0; }
.recommendation-label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.recommendation-caption { display: flex; align-items: center; justify-content: center; gap: 12px; width: min(100%, 360px); }
.recommendation-caption .badge-pill { font-size: 10px; padding: 2px 7px; }
.reward-card { position: relative; width: min(100%, 280px); aspect-ratio: 1.586; perspective: 1000px; }
.reward-card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform var(--duration-card-flip) var(--ease-in-out); }
.reward-card.is-flipped .reward-card-inner { transform: rotateY(180deg); }
.card-front, .card-back { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 14px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-front { padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.rec-hero .card-art { width: 100%; height: 100%; box-shadow: var(--shadow-card); }
.card-back { transform: rotateY(180deg); background: var(--surface); border: 1px solid var(--line); padding: 14px 16px;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; touch-action: pan-y; cursor: pointer; }
.card-back-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px;
  border: 0; background: none; padding: 0 0 8px; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.card-back-title .badge-pill { font-size: 10px; padding: 2px 7px; }
.card-back .reward-notes { padding: 0; font-size: 12px; line-height: 1.45; }
.card-back .card-back-reason { color: var(--text); font-weight: 500; }
.card-back .terms-line { margin: 0 0 12px; }
.reward-card.instant .reward-card-inner { transition: none; }
@media (prefers-reduced-motion: reduce) { .reward-card-inner { transition: none; } }
.rate { text-align: center; }
.rate-big { font-size: 52px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.rate-big.unavailable { font-size: 26px; }
.rate-sub { color: var(--text-2); margin-top: 8px; font-size: 15px; line-height: 1.4; }
.payment-details, .amount-details { border-bottom: 1px solid var(--line); }
.recommendation summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 0;
  list-style: none; cursor: pointer; font-size: 14px; }
.recommendation summary::-webkit-details-marker { display: none; }
.recommendation summary > :first-child { flex: 1; }
.recommendation summary .chev { width: 15px; height: 15px; color: var(--text-2); flex: none; }
.recommendation details[open] > summary .chev { transform: rotate(90deg); }
.recommendation summary .badge-pill { font-size: 11px; padding: 3px 8px; }
.payment-card-name { max-width: 62%; text-align: right; color: var(--text-2); overflow-wrap: anywhere; }
.optional-label { font-size: 13px; color: var(--text-2); }
.reward-notes { padding: 0 0 16px; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.reward-notes p { margin: 0 0 10px; }
.reward-notes .terms-line { text-align: left; margin: 14px 0 0; font-size: inherit; }
.payment-details .group { margin-bottom: 12px; }
.payment-details .row-title { font-size: 14px; }
.payment-details .row-sub { font-size: 12px; }
.amount-details .field { padding-bottom: 12px; }
.recommendation-actions { margin-top: 20px; }
.recommendation-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 12px; margin-top: 8px; }
.recommendation-footer .btn { font-size: 12px; padding: 10px 4px; min-height: 44px; color: var(--text-2); }

/* ---- did it post? ---- */
.confirm { padding: var(--s-4); display: grid; gap: var(--s-3); }
.confirm-head { display: flex; gap: var(--s-3); align-items: center; }
/* Posted: the top of a purchase opens it (correct, refund, delete). */
.confirm-head.tappable { width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.confirm-head .row-chev { margin-left: auto; color: var(--text-3); display: flex; }
.confirm-head .row-chev .icon { width: 18px; height: 18px; }
.destructive-row .row-title, .destructive-row .glyph { color: var(--danger); }
.confirm-q { font-size: 16px; margin: 0; }
.confirm-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.confirm-actions .btn { flex: 1; }
.confirm-actions .btn.plain { flex: none; }
.confirm-actions.multipliers { display: grid; grid-template-columns: repeat(3, 1fr); }
.result { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 10px; }
.result.right { color: var(--accent); background: var(--accent-soft); }
.result.wrong { color: var(--danger); background: var(--danger-soft); }
.result.flag { color: var(--estimate); background: var(--estimate-soft); }
.result .icon { width: 16px; height: 16px; }
#screen-check .stats + .section, #screen-check .section + .btn { margin-top: var(--s-6); }

/* ---- wallet: an overlapping stack, each card showing its top strip ---- */
.stack { container-type: inline-size; max-width: 400px; margin: 0 auto; }
.stack-card {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 16px;
  position: relative; text-align: left; transform-origin: top left;
}
.stack-card .card-art { transition: transform 160ms var(--ease-out); }
.stack-card:active .card-art { transform: scale(0.98); }
.stack > .stack-card + .stack-card { margin-top: calc(76px - 100cqw / 1.586); }  /* card height is width / 1.586 */
.pile { overflow: hidden; }
.pile > .stack-card + .stack-card { margin-top: calc(30px - 100cqw / 1.586); }
.wallet-face { border-radius: 16px; }
/* In the stack only the top strip of each card shows, so issuer and name sit in the first 70px. */
.wallet-face .art-issuer { top: 16px; left: 18px; font-size: 11px; }
.wallet-face .art-name { top: 33px; left: 18px; right: 18px; font-size: 19px; font-weight: 600; }
.wallet-face .art-summary { left: 18px; bottom: 16px; font-size: 14px; }
.wallet-face .art-network { right: 18px; bottom: 17px; font-size: 13px; }
.detail { margin: 18px 0 var(--s-1); }
.detail-meta { margin: 0 var(--s-1) 10px; font-size: 14px; color: var(--text-2); }
.earn { display: flex; align-items: center; gap: 14px; padding: var(--s-3) var(--s-4); min-height: 56px; }
.earn-rate { min-width: 54px; text-align: right; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---- sheet: dims and pushes the page back ---- */
.sheet-layer { position: fixed; inset: 0; z-index: 20; }
.backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.36); opacity: 0; transition: opacity 360ms var(--ease-sheet); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 600px; margin: 0 auto;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 14px 14px 0 0; outline: none;
  transform: translateY(100%); transition: transform 460ms var(--ease-sheet);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}
/* Full page (Profile and its pages): top to bottom, with a close button; still swipes down to close. */
.sheet.full { top: env(safe-area-inset-top, 0px); max-height: none; border-radius: var(--r-xl) var(--r-xl) 0 0; }
/* Full pages close with "Done" on iPhone (top right) and ✕ elsewhere (top left), as each platform does. */
.sheet-close { display: none; position: absolute; top: 10px; left: 8px; z-index: 2; min-width: 44px; height: 44px; padding: 10px;
  border: 0; border-radius: 22px; background: none; color: var(--text); cursor: pointer; font: inherit; }
.sheet-close svg { width: 24px; height: 24px; display: block; }
.sheet-close .done { display: none; font-size: 17px; font-weight: 600; color: var(--accent); }
.platform-ios .sheet-close { left: auto; right: 8px; padding: 10px 12px; }
.platform-ios .sheet-close svg { display: none; }
.platform-ios .sheet-close .done { display: inline; }
.sheet.full .sheet-close { display: block; }
.sheet.full .grabber { height: 22px; }
.sheet.full .sheet-body { padding-top: 40px; }
.sheet-layer.open .backdrop { opacity: 1; }
.sheet-layer.open .sheet { transform: translateY(0); }
.app { transition: transform 460ms var(--ease-sheet), filter 460ms; transform-origin: 50% 0; }
body.sheet-open .app > .screen { transform: scale(0.97); filter: brightness(0.96); transition: transform 460ms var(--ease-sheet), filter 460ms; }
.grabber { display: grid; place-items: center; height: 30px; flex: none; touch-action: none; cursor: grab; }
.grabber span { width: 38px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text) 18%, transparent); }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 2px var(--s-5) calc(env(safe-area-inset-bottom, 0px) + var(--s-6));
}
.sheet-title { font-size: 28px; font-weight: 700; letter-spacing: -0.024em; margin: 2px 0 2px; overflow-wrap: anywhere; text-wrap: balance; }
.sheet-sub { color: var(--text-2); margin: 0 0 18px; font-size: 15px; }
.sheet-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); margin: var(--s-2) 0 var(--s-3); }
.sheet .section { margin-top: var(--s-6); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px); z-index: 30;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); padding: var(--s-3) 18px; border-radius: var(--r-md);
  background: var(--ink); color: var(--on-ink); font-size: 15px; font-weight: 500; box-shadow: var(--shadow-card);
  transition: opacity 200ms var(--ease-out), transform 260ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- documents (privacy) ---- */
.group.prose { padding: var(--s-1) var(--s-4); }
.group.prose p { margin: var(--s-3) 0; line-height: 1.5; font-size: 16px; }
body.doc .section-title { margin-top: var(--s-8); }

/* ---- input and preference adaptations ---- */
@media (hover: hover) and (pointer: fine) {
  .row.tappable:hover { background: var(--surface-2); }
  .chip:hover { border-color: var(--text-3); }
  .btn.secondary:hover { background: var(--surface-2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .sheet { transition: opacity 200ms !important; }
  body.sheet-open .app > .screen { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(17, 18, 19, 0.3); --text-2: #3d3f42; }
  .group, .btn.secondary, .search, .input { border-width: 1px; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --line: rgba(255, 255, 255, 0.3); --text-2: #c4c6ca; }
}

/* ---- this month ---- */
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: var(--s-2); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 600ms var(--ease-out); }
.progress.estimate span { background: var(--estimate); }
.progress.done span { background: var(--text-3); }
.tracker { padding: 14px var(--s-4); display: grid; gap: 2px; }
.tracker + .tracker { border-top: 0.5px solid var(--line); }
.tracker-head { display: flex; align-items: center; gap: var(--s-3); }
.tracker-head .row-main { gap: 1px; }
.tracker-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.tracker .warn { color: var(--estimate); font-weight: 600; }
.tracker .actions-inline { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.month-picker { display: flex; align-items: center; gap: var(--s-1); }
.money { font-variant-numeric: tabular-nums; }
.money.missed { color: var(--estimate); }
.money.earned { color: var(--accent); }
.stat.hero { grid-column: span 3; display: flex; align-items: baseline; justify-content: space-between; }
.stat.hero .stat-num { font-size: 34px; }
.stats.month { grid-template-columns: repeat(2, 1fr); }
.stats.month .stat.hero { grid-column: span 2; }
.banner { display: flex; gap: var(--s-3); align-items: flex-start; padding: 14px var(--s-4); margin-bottom: var(--s-4); border-radius: var(--r-lg);
  background: var(--estimate-soft); color: var(--text); }
.banner .icon { color: var(--estimate); margin-top: 1px; }
.banner strong { display: block; }
.banner .row-sub { margin-top: 2px; }
.banner .actions-inline { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.group.spaced-bottom { margin-bottom: var(--s-3); }

/* "You're at Safeway?": the one-tap pick when the phone is sure which store it's in */
/* A deep green tile with the card itself: the one thing on the screen that says "use this". */
.here { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 var(--s-4); padding: 14px;
        border: 0; border-radius: var(--r-md); color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow: hidden;
        background: var(--surface); box-shadow: var(--shadow-1);
        transition: transform 160ms var(--ease-out); animation: here-in 520ms var(--ease-sheet) both; }
.here:active { transform: scale(0.98); }
@keyframes here-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.here-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.here .eyebrow { color: var(--accent); font-size: 12px; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.here-pick { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.here-rate { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin-top: 2px; color: var(--text-2); font-size: 13px; }
.here-rate strong { color: var(--text); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.here-art { width: 92px; flex: none; order: -1; }
.here-art .card-art { box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.5); }
/* A small card face: issuer only, since the name is on the tile beside it. */
.card-art.mini { border-radius: 9px; }
.card-art.mini .art-name, .card-art.mini .art-network, .card-art.mini .art-summary { display: none; }
.card-art.mini .art-issuer { font-size: 7px; top: 14%; }
.store-where { display: flex; flex-wrap: wrap; gap: 2px var(--s-3); margin: 0 0 var(--s-2); font-size: 15px; color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .here:active { transform: none; opacity: 0.8; } }
.terms-line { margin: var(--s-2) 0 0; text-align: center; font-size: 13px; color: var(--text-2); }
.fav-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.fav-btn .icon, .fav-mark .icon { width: 16px; height: 16px; }
.fav-btn[aria-pressed="true"] .icon, .fav-mark .icon { fill: currentColor; }
.fav-mark { display: inline-flex; color: var(--accent); }
.fallback { display: grid; gap: 4px; padding: 14px var(--s-4); margin-bottom: var(--s-3); border-radius: var(--r-lg); background: var(--surface-2); }
.fallback .actions-inline { display: flex; gap: var(--s-2); margin: var(--s-2) 0 2px; }
.confirm.look .confirm-head { align-items: flex-start; }
.confirm.look .swatch { margin-top: 3px; }
.confirm.look .row-sub { line-height: 1.4; }
/* why a pick is as sure as it says: tap the evidence to read it */
.evidence summary { list-style: none; cursor: pointer; }
.evidence summary::-webkit-details-marker { display: none; }
.evidence .why { margin: var(--s-2) 2px 0; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.field .select { width: 100%; }
.copy-field { display: grid; gap: 6px; margin-bottom: var(--s-3); }
.copy-row { display: flex; gap: var(--s-2); align-items: center; }
/* a link shown whole: one tap selects all of it, and no text field means no zoom on iPhone */
.copy-text { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2);
             font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2);
             overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; max-height: 4.2em; overflow: hidden; }
.steps { margin: var(--s-2) 0 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 15px; line-height: 1.4; }

/* A quiet, personal wallet: soft surfaces, a clear primary action, and a recognizable profile. */
.header-row > div:first-child { min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.eyebrow { overflow-wrap: anywhere; }
.profile-avatar { border: 0; background: var(--surface-2); color: var(--text); flex: none;
  border-radius: 50%; width: 36px; height: 36px; padding: 0; font: 600 14px/1 var(--font);
  cursor: pointer; transition: transform 120ms var(--ease-out); }
.profile-avatar:active { transform: scale(0.96); }
.profile-portrait { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  margin: 0 0 24px; background: var(--surface-2); color: var(--text); font-size: 22px; font-weight: 600; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 7px) 20px 7px;
  color: var(--estimate); background: var(--estimate-soft); font-size: 12px; font-weight: 600; }
.demo-banner .btn { color: var(--estimate); white-space: nowrap; }
.demo-banner:not([hidden]) ~ .screen { padding-top: 24px; }
.widget-preview { display: flex; align-items: center; gap: 18px; padding: 26px; margin: 0 0 26px;
  color: white; background: linear-gradient(135deg, #174b3b, #102e28); border-radius: 26px;
  box-shadow: 0 12px 30px -14px rgba(20, 63, 52, .4); }
.widget-preview > div { display: grid; gap: 7px; min-width: 0; }
.widget-preview span { font-size: 13px; color: #c5dcd0; }
.widget-preview strong { font-size: 23px; line-height: 1.15; letter-spacing: -.03em; }
.widget-preview small { font-size: 11px; color: #c5dcd0; }
.setup-details { margin-top: 24px; }
.setup-details summary { color: var(--accent); cursor: pointer; font-size: 14px; min-height: 44px; display: flex; align-items: center; }
.group { box-shadow: var(--shadow-1); }
.onboarding-screen .footer-actions { gap: 12px; }
@media (prefers-reduced-motion: reduce) { .profile-avatar:active { transform: none; } }
/* Search results: one quiet line under the name, so five results fit on screen */
.suggest .row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- This month: the verdict, one move, quiet credits ---- */
.month-hero { padding: var(--s-4); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.verdict { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.verdict .icon { width: 24px; height: 24px; flex: none; }
.verdict.good .icon { color: var(--accent); }
.verdict.missed .icon { color: var(--estimate); }
.verdict-why { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 0.5px solid var(--line); }
.figure { display: grid; gap: 2px; }
.figure-num { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.figure-label { font-size: 13px; color: var(--text-2); }
.verdict-note { margin: var(--s-3) 0 0; font-size: 13px; color: var(--text-2); }
.one-move { margin-top: var(--s-3); padding: var(--s-4); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); display: grid; gap: var(--s-3); }
.one-move .eyebrow { color: var(--text-2); }
.one-move-body { display: flex; gap: var(--s-3); align-items: center; }
.one-move-title { display: block; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.one-move .actions-inline { margin: 0; }
.credit-row .row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { --p: 1; position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-content: center; text-align: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1turn), var(--line) 0); }
.ring::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.ring.urgent { background: conic-gradient(var(--estimate) calc(var(--p) * 1turn), var(--line) 0); }
.ring-num, .ring-unit { position: relative; line-height: 1; }
.ring-num { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-unit { font-size: 8px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
.one-move .row-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* The recommended card catches the light once as the store opens: a quiet "this one". Off with Reduce Motion. */
.rec-hero .card-art::after {
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.24) 50%, transparent 62%) no-repeat;
  box-shadow: none; transform: translateX(-100%);
  animation: card-sheen 900ms ease-in-out 180ms 1 both;
}
@keyframes card-sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .rec-hero .card-art::after { animation: none; background: none; } }
.fee-value { padding: var(--s-4); margin-bottom: var(--s-4); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.fee-value .verdict { font-size: 18px; }
.fee-value .verdict.neutral { color: var(--text-2); }
.claim-draft { margin: var(--s-3) 0; padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); font: inherit; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; max-height: 46vh; overflow: auto; }
.fee-value .verdict .icon { width: 20px; height: 20px; }
.fee-value .figures { margin-top: var(--s-3); padding-top: var(--s-3); }
.btn.map-btn { margin-bottom: var(--s-3); }

/* ---- setup checklist ---- */
.setup { display: grid; gap: var(--s-3); margin: var(--s-2) 0 var(--s-4); padding: var(--s-4); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1); }
.setup-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.setup-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.setup-count { font-size: 14px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.setup .group { box-shadow: none; border: 0; background: none; }
.setup .row { padding-left: 0; padding-right: 0; }
.setup .btn.plain { justify-self: start; min-height: 32px; padding: 0; }

/* Wallet: one overview, with less-used details disclosed on demand. */
.wallet-disclosure { margin: 12px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.wallet-disclosure > summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 14px 16px; cursor: pointer; list-style: none; }
.wallet-disclosure > summary::-webkit-details-marker { display: none; }
.wallet-disclosure > summary > .icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-2); }
.wallet-disclosure[open] > summary > .icon { transform: rotate(90deg); }
.disclosure-body { padding: 0 12px 14px; }
.disclosure-body .group { box-shadow: none; }
.benefit-link { font-size: 13px; padding: 10px 0 10px 8px; }
.picker-controls { display: grid; gap: 10px; }
.issuer-filter { width: 100%; min-height: 44px; }
.missing-card .input { margin: 8px 0 12px; }
.detail .section { margin-top: 18px; }

.date-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.date-range input { min-width: 0; width: 100%; }
.history-card { margin: 12px 0; max-width: 100%; }
.stack-card { transform-origin: top left; }

/* ---- segmented control (Appearance) ---- */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px;
  border-radius: 9px; background: var(--surface-2); padding: 2px; }
.segment { position: relative; display: grid; }
.segment input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segment span { display: grid; place-items: center; min-height: 32px; border-radius: 7px; font-size: 14px; font-weight: 600;
  color: var(--text-2); transition: background 200ms var(--ease-out), color 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.segment input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- profile: one compact header, then short rows ---- */
.profile-head { display: flex; align-items: center; gap: 16px; margin: 0 0 var(--s-6); }
.profile-head .profile-portrait { width: 64px; height: 64px; margin: 0; font-size: 21px; flex: none; }
.profile-head > div { flex: 1; min-width: 0; }
.profile-head .sheet-title { margin: 0; overflow-wrap: anywhere; }
.profile-head .sheet-sub { margin: 2px 0 0; }
.btn.destructive { color: var(--danger); }
/* Help center: one question per row; the answer opens under it. */
.help-list { display: grid; margin: var(--s-2) 0 var(--s-5); border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--shadow-1); overflow: hidden; }
.help-item + .help-item { border-top: 0.5px solid var(--line); }
.help-item summary { padding: 14px var(--s-4); font-weight: 600; cursor: pointer; list-style: none; display: flex;
  justify-content: space-between; gap: var(--s-3); }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "+"; color: var(--text-3); font-weight: 400; }
.help-item[open] summary::after { content: "−"; }
.help-item p { margin: 0; padding: 0 var(--s-4) 14px; color: var(--text-2); line-height: 1.45; }
.about-head { display: grid; justify-items: center; text-align: center; gap: 4px; margin: var(--s-2) 0 var(--s-5); }
.about-head .app-icon-art { width: 84px; height: 84px; border-radius: 19px; margin-bottom: var(--s-2); }
.icon-thumb { display: block; margin-right: 4px; }
.icon-thumb .app-icon-art { width: 34px; height: 34px; border-radius: 8px; }
.about-head .sheet-sub { max-width: 30ch; }
.about-head .version-line { margin: 0; }
.version-line { text-align: center; color: var(--text-3); font-size: 12px; margin: var(--s-2) 0 var(--s-4); }

/* ---- motion: new things arrive, nothing re-animates on a re-render (all off with Reduce Motion) ---- */
.stagger > .row { animation: row-in 420ms var(--ease-out) both; }
.stagger > .row:nth-child(2) { animation-delay: 40ms; } .stagger > .row:nth-child(3) { animation-delay: 80ms; }
.stagger > .row:nth-child(4) { animation-delay: 120ms; } .stagger > .row:nth-child(5) { animation-delay: 160ms; }
.stagger > .row:nth-child(n+6) { animation-delay: 200ms; }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } }
.sheet-body.swap > * { animation: swap-in 280ms var(--ease-out) both; }
@keyframes swap-in { from { opacity: 0; transform: translateY(6px); } }
/* onboarding steps slide the way you're going */
.onboarding-step.enter-forward { animation: step-forward 380ms var(--ease-out) both; }
.onboarding-step.enter-back { animation: step-back 380ms var(--ease-out) both; }
@keyframes step-forward { from { opacity: 0; transform: translateX(28px); } }
@keyframes step-back { from { opacity: 0; transform: translateX(-28px); } }
body.onboarding .screen { animation: none; overflow-x: clip; }
.group.plain.features .row { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
.group.plain.features .glyph { width: 36px; height: 36px; border-radius: 11px; }
.step-ready .hero-stack.small { margin-top: var(--s-4); }
.step-ready .row-title { font-weight: 600; }

/* ---- app icon choices (Profile → Appearance) ---- */
.app-icons-label { margin: var(--s-5) 0 var(--s-2); }
.app-icons { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.app-icons.large { gap: var(--s-3); margin: var(--s-4) 0 var(--s-6); }
.app-icon { position: relative; display: grid; justify-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 0; box-shadow: var(--shadow-1); cursor: pointer;
  transition: box-shadow 200ms var(--ease-out), transform 120ms var(--ease-out); }
.app-icon:active { transform: scale(0.97); }
.app-icon input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.app-icon:has(input:checked) { box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); }
.app-icon:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
/* The icon's own SVG already has its rounded corners; this only sizes it and adds a soft lift. */
.app-icon-art { display: block; width: 60px; height: 60px; border-radius: 14px; pointer-events: none;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35); }
.app-icon-name { font-size: 13px; font-weight: 600; color: var(--text-2); }
.app-icon:has(input:checked) .app-icon-name { color: var(--text); }
.row.everyday .row-rate { background: var(--surface-2); }
.section .segmented + .group { margin-top: var(--s-3); }
/* Purchases (under Wallet): a back link above the large title. */
.back-link { display: inline-flex; align-items: center; gap: 2px; margin: var(--s-2) 0 0 -6px; padding: 8px 6px; border: 0; background: none;
  color: var(--accent); font: inherit; font-size: 17px; cursor: pointer; }
.back-link .icon { width: 22px; height: 22px; }
.confirm.quiet .fine { margin: 6px 0 0; color: var(--text-3); }
/* Perks → Your spending: month arrows inside the section. */
.month-picker.inline { display: flex; align-items: center; justify-content: space-between; margin: 0 0 var(--s-3); }
.month-picker.inline span { font-weight: 600; }

/* Card detail tabs (Earn · Perks · Settings) under the open card */
.detail .segmented { margin: 4px 0 var(--s-3); }
.card-pane > .group + .group, .card-pane > .section-footer + .group { margin-top: var(--s-3); }
.card-pane .section { margin-top: 18px; }
.earn .row-main { flex: 1 1 auto; min-width: 0; }

/* Pick tab → Autopick (iPhone app): a quiet text button above the title; shows the time left while it runs */
.topline { display: flex; justify-content: flex-end; align-items: center; min-height: 32px; margin-bottom: -4px; }
.topline:empty { display: none; }
.autopick-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin: -6px -6px -6px 0; padding: 0 6px; border: 0; border-radius: 10px;
  background: none; color: var(--accent); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; }
.autopick-btn .icon { width: 15px; height: 15px; }
.autopick-btn .icon:last-child:not(:first-child) { color: var(--text-3); }
.autopick-btn:active { opacity: 0.5; }
.autopick-left { font-variant-numeric: tabular-nums; }

/* ---- platforms: one design, each phone's own conventions ---- */
/* iPhone: inset separators like Settings, system green switches. */
.platform-ios .group > .row + .row { border-top: 0; background-image: linear-gradient(var(--line), var(--line));
  background-size: calc(100% - 16px) 0.5px; background-position: right top; background-repeat: no-repeat; }
.platform-ios .switch input:checked + span { background: #34c759; }
/* Android: Roboto, pill buttons, outlined segmented control, ripple-style press instead of shrinking. */
.platform-android body { font-family: Roboto, system-ui, sans-serif; letter-spacing: 0; }
.platform-android .large-title, .platform-android .sheet-title, .platform-android .display { font-weight: 500; letter-spacing: -0.01em; }
.platform-android .btn { border-radius: 999px; font-weight: 500; letter-spacing: 0.01em; }
.platform-android .btn:active:not(:disabled), .platform-android .tab:active { transform: none; filter: brightness(0.92); }
.platform-android .row.tappable:active { background: color-mix(in srgb, var(--text) 8%, transparent); }
.platform-android .search { border-radius: 999px; padding-left: 16px; }
.platform-android .segmented { padding: 0; gap: 0; background: none; border: 1px solid var(--text-3); border-radius: 999px; overflow: hidden; }
.platform-android .segment span { border-radius: 0; min-height: 40px; font-weight: 500; }
.platform-android .segment + .segment span { border-left: 1px solid var(--text-3); }
.platform-android .segment input:checked + span { background: var(--accent-soft); box-shadow: none; }
.platform-android .sheet { border-radius: 28px 28px 0 0; }
.platform-android .tab[aria-selected="true"] .tab-icon { background: var(--surface-2); border-radius: 16px; }
.platform-android .tab-icon { width: 64px; height: 32px; }

/* ---- wide screens (the website): tabs become a side rail, a store opens beside the list ---- */
@media (min-width: 1024px) {
  .tabbar { top: 0; bottom: 0; right: auto; width: 232px; grid-template-columns: none; align-content: start; gap: 2px;
    padding: 28px 14px; border-top: 0; border-right: 0.5px solid var(--line); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tab { grid-auto-flow: column; justify-content: start; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 500; }
  .tab .icon { width: 21px; height: 21px; }
  .tab[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-1); }
  .tab:active { transform: none; }
  .screen { margin-left: max(232px, calc((100vw - 232px - 560px) / 2 + 232px)); margin-right: auto; padding-bottom: var(--s-10); }
  body:not(.onboarding) .demo-banner { margin-left: max(232px, calc((100vw - 232px - 560px) / 2 + 232px)); margin-right: auto; }
}
@media (min-width: 1240px) {
  /* Three columns: rail, list, and the open store as a panel on the right; the list stays usable. */
  .screen, body:not(.onboarding) .demo-banner { margin-left: 264px; }
  .sheet-layer:not(:has(.sheet.full)) { left: auto; width: 460px; }
  .sheet-layer:not(:has(.sheet.full)) .backdrop { display: none; }
  .sheet:not(.full) { top: 0; max-height: none; max-width: none; border-radius: 0; border-left: 0.5px solid var(--line); box-shadow: none; }
  body.sheet-open:not(:has(.sheet.full)) .app > .screen { transform: none; filter: none; }
  /* No backdrop to tap beside a panel, so it gets the close button too. */
  .sheet:not(.full) .sheet-close { display: block; }
  .sheet:not(.full) .sheet-body { padding-top: 40px; }
  .sheet:not(.full) .grabber { display: none; }
}

/* Perks summary, deadlines in words, and values on the right of settings rows */
.summary { padding: var(--s-4); margin-bottom: var(--s-2); background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.summary-num { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.summary-sub { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.days-left { font-size: 15px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.days-left.warn { color: var(--estimate); font-weight: 600; }
.row-value { font-size: 15px; color: var(--text-2); white-space: nowrap; }
.header-row .large-title { margin-top: 2px; }

/* Pick's search bar (Nov 15): opens the Search tab, styled like the field it replaced */
.search-bar { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: 0 0 var(--s-4);
  padding: 0 12px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text-3);
  font: inherit; font-size: 17px; text-align: left; cursor: pointer; }
.search-bar .icon { width: 18px; height: 18px; }
.platform-android .search-bar { border-radius: 999px; }
.search-stores[hidden] { display: none; }
.search-hint { text-align: center; margin-top: var(--s-6); }
.search-stores .suggest:not(:empty) { margin-bottom: var(--s-3); }
.search-local:empty + .search-stores .section { margin-top: var(--s-2); }
/* Benefits tab (Nov 16): full descriptions, the Terms link at the top right */
.benefit-row { align-items: flex-start; }
.benefit-row .row-sub { white-space: normal; }
.benefit-missing { margin-top: var(--s-4); }
.benefit-icon { display: flex; flex: none; width: 22px; padding-top: 1px; color: var(--text-2); }
.benefit-icon .icon { width: 20px; height: 20px; }
/* Offer import review (Nov 16) */
.import-card .select { width: 100%; }
.row.needs-fix .row-sub { color: var(--estimate); }
