/* Rory member web portal. Tokens mirror the app (app/lib/design/tokens.dart,
   app/lib/style.dart): the Precision page ground, the app's type, spacing and radius
   scales, and the credit union's colors on every control. Colors live in
   variables so dark mode is one override block. Layout stays the portal's
   own two-column servicing shape on desktop. */

:root {
  color-scheme: light;
  /* Credit union brand, set from /api/tenant (Rory until it loads). */
  --brand: #2e3dff;
  --brand-soft: #eaecff;
  --brand-dark-accent: #98a2ff;
  /* Brand roles, as the app's BrandContext: accent for text and outlines,
     tint for soft fills. Dark mode swaps both to the lighter accent. */
  --brand-accent: var(--brand);
  --brand-accent-end: var(--brand-end, var(--brand-accent)); /* progress gradient end */
  --brand-tint: var(--brand-soft);
  --brand-accent-deep: color-mix(in srgb, var(--brand-accent) 75%, #000);
  --brand-glow: color-mix(in srgb, var(--brand) 35%, transparent);
  --on-brand: #ffffff;
  --on-ink: #ffffff;
  --logo-tile: #ffffff; /* logos sit on white in both themes */

  --ink: #142b63;
  --ink2: #3d4569;
  --muted: #5d6688;
  --bg: #f4f5fc;
  --surface: #ffffff;
  --border: #e4e7f1;
  --border-subtle: #edeff7;
  --control-border: #777f9b;
  --radio-ring: #777f9b;
  --grabber: #d5d8e4;
  --ask-tile: #ffffff;
  --scrim: rgba(20, 43, 99, 0.45);
  --processing: #fdf3d7;
  --processing-ink: #8a5a00;
  --earned-tint: #e3f8ee;
  --success: #087344;
  --success-deep: #087344;
  --success-soft: #e3f8ee;
  --warning: #f59e0b;
  --warning-deep: #8a5a00;
  --warning-soft: #fdf3d7;
  /* The app's error colors: every destructive or error red uses these. */
  --danger: #e5484d;
  --danger-deep: #b42318; /* text and icons: 6.6:1 on white, 5.8:1 on --danger-soft */
  --danger-soft: #fdecea;
  --toast: var(--ink);
  /* Dark tiles with white text (the Up next bar): ink, the raised surface in dark. */
  --ink-surface: var(--ink);
  --success-on-ink: #4adb97;
  --on-status: #ffffff; /* glyph on a solid success or error fill */

  --shadow-card: 0 4px 12px rgba(20, 43, 99, 0.06);
  --shadow-counter: 0 4px 6px rgba(20, 43, 99, 0.06);
  --shadow-nav: 0 2px 12px rgba(20, 43, 99, 0.05);
  --shadow-lift: 0 14px 30px -14px rgba(20, 43, 99, 0.14), 0 1px 2px rgba(20, 43, 99, 0.04);
  --shadow-pop: 0 10px 30px rgba(20, 43, 99, 0.12);

  /* Radii (RoryRadius): chip 12, row 14, card 16, soft 18, snapshot 20,
     sheet 28, status tag 6. */
  --r-tag: 6px;
  --r-xs: 12px;
  --r-sm: 14px;
  --r-md: 16px;
  --r-soft: 18px;
  --r-lg: 20px;
  --r-sheet: 28px;
  /* Borders (RoryBorder): hairline 1, regular 1.5. */
  --b-regular: 1.5px;
  /* Motion (RoryMotion). */
  --t-base: 200ms;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
}

/* Dark: the app's dark tokens. index.html sets data-theme before first
   paint, from the saved choice or the device setting. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-accent: var(--brand-dark-accent);
  --brand-accent-end: var(--brand-dark-accent-end, var(--brand-accent));
  --brand-accent-deep: var(--brand-dark-accent);
  --brand-tint: color-mix(in srgb, var(--brand-dark-accent) 20%, var(--surface));
  --ink: #eef1ff;
  --ink2: #c7cdea;
  --muted: #a6add1;
  --bg: #070d24;
  --surface: #141c3e;
  --border: #2a3364;
  --border-subtle: #1b2450;
  --control-border: #8793bc;
  --radio-ring: #8793bc;
  --ask-tile: #f0f4ff;
  --scrim: rgba(0, 0, 0, 0.6);
  --processing: #33270e;
  --processing-ink: #ffc53d;
  --earned-tint: #123326;
  --success: #4adb97;
  --on-status: #070d24;
  --grabber: #8793bc;
  --success-deep: #4adb97;
  --success-soft: #123326;
  --warning: #ffc53d;
  --warning-deep: #ffc53d;
  --warning-soft: #33270e;
  --danger: #ff6b70;
  --danger-deep: #ff6b70;
  --danger-soft: #3a1518;
  --toast: #232c5c;
  --ink-surface: #232c5c;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.33);
  --shadow-counter: 0 4px 6px rgba(0, 0, 0, 0.33);
  --shadow-nav: 0 2px 12px rgba(0, 0, 0, 0.33);
  --shadow-lift: 0 14px 30px -14px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
button, input, select, textarea { color: inherit; }
a { color: var(--brand-accent); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Keyboard focus: one visible treatment for every interactive element. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [role="button"]:focus-visible, .btn:focus-visible,
.choice:focus-visible, .chip:focus-visible, .pay-radio:focus-visible, .pm-item:focus-visible, .sheet-row:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Top bar: lockup, centered tabs (desktop), points, inbox, Ask Rory, avatar.
   At phone width the tabs and Ask Rory's tile float at the bottom. */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 72px; padding: 12px 40px; background: var(--surface); border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; z-index: 5; }
.lockup { display: flex; align-items: center; gap: 12px; }
/* Initials tile is only the fallback; a real logo renders at its natural
   aspect ratio, untiled, and may take horizontal space. In dark mode the
   logo sits on a white tile so dark marks stay readable. */
.fi-mark { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.fi-mark.has-logo { width: auto; max-width: 180px; height: 42px; background: none; border-radius: 0; overflow: visible; }
.fi-mark.has-logo img { height: 100%; width: auto; max-width: 180px; object-fit: contain; }
:root[data-theme="dark"] .fi-mark.has-logo { background: var(--logo-tile); border-radius: var(--r-xs); padding: 4px 8px; height: 44px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.icon-btn { position: relative; border: 0; background: none; color: var(--ink); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--border-subtle); }
.member-chip { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand-tint); color: var(--brand-accent); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-family: inherit; }

/* Tabs: one raised pill, the current tab on the brand tint. */
.tabs { display: flex; align-items: center; gap: 14px; }
.tab-pill { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
/* 15px labels: the approved web frame's size for desktop tabs. */
.tab { display: flex; align-items: center; gap: 8px; height: 40px; border: 0; background: none; border-radius: 999px; padding: 0 18px; font: inherit; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease); }
.tab .ic { width: 20px; height: 20px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { background: var(--brand-tint); color: var(--brand-accent); font-weight: 600; }
/* Ask Rory's tile: light in both themes, since the navy mark needs it. */
.ask-tile { width: 44px; height: 44px; flex: none; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--ask-tile); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ask-tile img { width: 38px; height: 38px; object-fit: contain; }
.tabs .ask-tile { display: none; }

/* Points: the number in the text color, the gold coin 3px after it, the coin
   2px taller than the type. The counter is the one pill points wear. */
.pts-num { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.coin { width: calc(1em + 2px); height: calc(1em + 2px); flex: none; }
/* On a brand fill the number takes the fill's text color. */
.btn.primary .pts-num, #toast .pts-num { color: inherit; }
.pts-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); cursor: pointer; background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px 4px 6px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-counter); transition: background-color 170ms ease-out; }
.pts-chip .coin { width: 20px; height: 20px; }
.pts-chip.earned { background: var(--earned-tint); }

/* Menus (the hero ⋮) */
.menu { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); width: 230px; padding: 6px; z-index: 10; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--brand-tint); color: var(--brand-accent); }
.menu-item .ic { width: 16px; height: 16px; }

/* Layout */
.page { max-width: 1020px; margin: 0 auto; padding: 24px 20px 44px; }
.columns { display: flex; gap: 12px; margin-top: 12px; align-items: flex-start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Loan header */
.link { color: var(--brand-accent); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link .ic { width: 15px; height: 15px; }
.link-btn { border: 0; background: none; color: var(--brand-accent); font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px; font-family: inherit; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Pay card */
.due-amount { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.scheduled { color: var(--muted); font-style: italic; }

/* Buttons */
.btn { border: var(--b-regular) solid var(--border); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 12px 20px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 8px 20px -4px var(--brand-glow); }
.btn.primary:hover, .qa.primary:hover { filter: brightness(0.92); }
.btn.big { min-height: 56px; padding: 14px 20px; font-size: 16px; }
/* Safari draws Apple's own Pay button; the rest is size and shape. */
.apple-pay-btn { display: block; width: 100%; height: 52px; border: 0; border-radius: 12px; cursor: pointer; -webkit-appearance: -apple-pay-button; -apple-pay-button-type: pay; -apple-pay-button-style: black; }
.apple-pay-btn:disabled { opacity: 0.5; cursor: default; }
:root[data-theme="dark"] .apple-pay-btn { -apple-pay-button-style: white; }
.btn.block { width: 100%; }
.btn:hover { background: var(--border-subtle); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.btn .ic { width: 16px; height: 16px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-tag); padding: 4px 8px; font-size: 11px; font-weight: 700; width: fit-content; letter-spacing: 0.01em; }
.ok-pill { background: var(--success-soft); color: var(--success-deep); }

/* Payment methods */
.mask::before { content: "\2022\2022"; color: var(--muted); }
.check-address { font-weight: 700; line-height: 1.6; margin: 0; }

/* Payments ledger */
.payments-list { display: flex; flex-direction: column; }
.pay-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.pay-row:last-child { border-bottom: 0; }
.pay-ico { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--border-subtle); color: var(--muted); }
.pay-ico.next { background: var(--brand-tint); color: var(--brand-accent); }
.pay-ico .ic { width: 16px; height: 16px; }
.pay-label { flex: 1; min-width: 0; font-weight: 600; }
.pay-amount { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--r-sheet); width: 440px; max-width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px; position: relative; box-shadow: var(--shadow-pop); }
.modal-x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--border-subtle); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.modal-x .ic { width: 15px; height: 15px; }
.modal h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.modal .sub { color: var(--muted); margin: 0 0 20px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; font-weight: 700; }
.choice:hover { border-color: var(--brand-accent); }
.choice .sub-line, .cu-row .sub-line, .loan-row .sub-line, .option-row .sub-line { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.choice .current-tag { color: var(--brand-accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.amount-input { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 12px 16px; margin-bottom: 14px; font-size: 24px; font-weight: 700; }
.amount-input input { border: 0; outline: 0; font: inherit; width: 100%; background: none; }
.amount-input:focus-within, .landing-input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--brand-tint); }
.confirm-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 14px; }
.confirm-row:last-of-type { border-bottom: 0; margin-bottom: 14px; }
.confirm-row .v { font-weight: 700; }
.center { text-align: center; }

/* Stat tiles */
.stat { flex: 1 1 0; min-width: 0; background: var(--border-subtle); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-value { font-weight: 700; font-variant-numeric: tabular-nums; }

.progress { height: 8px; border-radius: 999px; background: var(--border-subtle); overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; border-radius: 999px; }
/* Every progress fill: the brand easing into its gradient end. */
.progress-fill, .rw-bar > * { background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent-end)); }

/* Toast */
/* Below the header bar, clear of the points chip. */
.toast { position: fixed; top: calc(80px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--toast); color: var(--on-ink); padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 600; text-align: center; z-index: 50; box-shadow: var(--shadow-pop); }

/* ── Sign-in and claim ───────────────────────────────────────────────────── */
body.landing-mode .topbar, body.landing-mode .page, body.landing-mode .up-next { display: none; }
.landing { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; overflow-y: auto; background: linear-gradient(180deg, var(--brand-tint), var(--bg) 70%); z-index: 40; }
.landing.hidden { display: none; }
.landing-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-lg); padding: 32px 32px 24px; box-shadow: var(--shadow-pop); text-align: center; }
.landing-card h1 { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.landing-input { width: 100%; box-sizing: border-box; border: var(--b-regular) solid var(--border); border-radius: var(--r-sm); padding: 14px; font: inherit; font-size: 16px; margin-bottom: 10px; background: var(--surface); color: var(--ink); }
.landing-error { color: var(--danger-deep); font-size: 13px; font-weight: 600; margin: 10px 0 0; }

/* Sign-in sits beside the welcome panel; claim steps are one centered card.
   Below 860px both are one column with the actions at the bottom. */
.auth { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; overflow-y: auto; background: var(--bg); }
.auth-hero { display: flex; flex-direction: column; padding: 48px 64px 40px; background: linear-gradient(180deg, var(--brand-tint), var(--bg)); }
.auth-rory { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; }
.auth-rory img { width: 36px; height: 36px; border-radius: 10px; }
.auth-headline { margin: auto 0 0; font-size: 48px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; }
.auth-headline span { color: var(--brand-accent); }
.auth-pitch { margin: 20px 0 0; max-width: 440px; color: var(--muted); font-size: 18px; }
/* The art has clear space round the sea lion: at 300px it draws about 230px wide, 44px in. */
.auth-hero-art { width: 300px; margin: 24px 0 auto; }
.auth-powered { margin: 0; color: var(--muted); font-size: 13px; }
.auth-main { display: flex; flex-direction: column; align-items: center; padding: 48px 32px 24px; min-height: 100dvh; background: var(--surface); }
.auth-top, .auth-step, .auth .landing-legal { width: 100%; max-width: 440px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.auth-top .fi-mark.has-logo { height: 32px; }
.auth-switch { font-size: 13px; color: var(--muted); font-weight: 600; }
.auth-step { display: flex; flex-direction: column; margin-bottom: auto; padding-top: 40px; }
.auth .landing-legal { margin-top: 32px; }
.auth.card-mode { grid-template-columns: 1fr; background: var(--bg); }
.auth.card-mode .auth-main, :root[data-theme="dark"] .auth-main { background: none; }
.auth.card-mode .auth-hero { display: none; }
.auth.card-mode .auth-top { justify-content: center; max-width: 560px; }
.auth.card-mode .auth-step { max-width: 560px; margin-top: 20px; padding: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.auth-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; border: 0; background: none; padding: 4px 0; margin-bottom: 16px; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
.auth-eyebrow { margin: 0 0 12px; color: var(--brand-accent); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.auth-title { margin: 0 0 12px; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 16px; }
.auth-fine { margin: 2px 0 16px; color: var(--muted); font-size: 12px; }
.auth-alt { margin: 4px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.auth-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; }
.auth-actions .link-btn { text-decoration: none; }
.auth-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-progress span { flex: 1; height: 4px; border-radius: 999px; background: var(--border-subtle); }
.auth-progress span.on { background: var(--brand); }
.auth-step-label { margin: 0 0 16px; font-size: 13px; font-weight: 600; }
.auth-field { display: block; margin-bottom: 14px; position: relative; }
.auth-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.auth-field .landing-input { margin: 0; padding: 12px 16px; font-weight: 600; }
.auth-field .landing-input.invalid { border-color: var(--danger); }
.auth-help { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.auth-help.error { color: var(--danger-deep); font-weight: 600; }
/* Date of birth and ZIP share a row. */
.field-pair { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; }
.field-toggle { position: absolute; right: 12px; bottom: 12px; font-size: 12px; }
.segmented { display: flex; padding: 4px; margin-bottom: 20px; border-radius: 999px; background: var(--brand-tint); }
.segmented button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 10px; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-card); }

/* Six code boxes over one input that takes typing, paste and autofill. */
.otp { position: relative; margin-bottom: 12px; }
.otp input { position: absolute; inset: 0; width: 100%; opacity: 0; border: 0; font-size: 16px; cursor: text; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; max-width: 400px; }
.otp-boxes span { display: flex; align-items: center; justify-content: center; aspect-ratio: 7 / 8; max-height: 64px; border: var(--b-regular) solid var(--border); border-radius: var(--r-sm); background: var(--surface); font-size: 24px; font-weight: 700; }
.otp-boxes span.at { border-color: var(--brand-accent); }
.otp.error .otp-boxes span { border-color: var(--danger); color: var(--danger-deep); }
.otp.ok .otp-boxes span { border-color: var(--brand-accent); }
.otp-msg { margin: 0 0 8px; min-height: 0; font-size: 14px; font-weight: 600; }
.otp-msg.error { color: var(--danger-deep); }
.otp-msg.ok { color: var(--brand-accent); }
.resend-line { margin: 0 0 16px; font-size: 13px; font-weight: 600; }
.resend-line .link-btn { padding: 0; font-size: 13px; }

/* Rows: credit unions and loans pick one; claim options open one. Inside
   the claim card they are plain rows with thin dividers. */
.cu-list { display: grid; gap: 10px; margin: 12px 0; }
.cu-row, .loan-row { display: flex; align-items: center; gap: 12px; width: 100%; border: var(--b-regular) solid var(--border); border-radius: var(--r-md); background: var(--surface); padding: 14px 16px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.cu-row[aria-checked="true"] { border-color: var(--brand-accent); background: var(--brand-tint); }
.cu-name, .loan-row-info { flex: 1; font-weight: 600; font-size: 15px; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: var(--b-regular) solid var(--control-border); flex: none; }
[aria-checked="true"] > .radio { border: 6px solid var(--brand); }
.loan-rows, .option-rows { display: flex; flex-direction: column; margin: 8px 0 16px; }
.loan-row, .option-row { border: 0; border-radius: 0; border-top: 1px solid var(--border-subtle); padding: 14px 0; background: none; }
.loan-row:first-child, .option-row:first-child { border-top: 0; }
.option-row { display: flex; align-items: center; gap: 14px; width: 100%; font: inherit; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.option-row.static { cursor: default; }
.option-ico { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-xs); background: var(--brand-tint); color: var(--brand-accent); flex: none; }
.option-info { flex: 1; display: flex; flex-direction: column; }
.option-title { font-weight: 600; font-size: 15px; }
.option-row > .ic { color: var(--muted); }

/* Moments: art, title, a line, one action. */
.auth-moment { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 0 8px; }
.moment-art { width: 180px; margin-bottom: 20px; }
.moment-art.inline { align-self: center; width: 160px; margin: 8px 0 24px; }
.dots { display: flex; gap: 8px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: dot 1s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.moment-counter { align-self: flex-end; cursor: default; }
.burst { position: relative; display: flex; justify-content: center; }
.burst-confetti { position: absolute; top: 50%; left: 50%; width: 240px; transform: translate(-50%, -50%); animation: burst 2s var(--ease) both; pointer-events: none; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; } 15% { opacity: 1; } 35% { transform: translate(-50%, -50%) scale(1.15); } 80% { transform: translate(-50%, calc(-50% + 30px)) scale(1.15); opacity: 0; } 100% { opacity: 0; } }
.auth-moment .pts-num { font-size: 24px; }
.sub-line .pts-num { font-size: inherit; }
/* Navy spot art sinks into the dark page: it sits on a light round ground, as in the app. */
:root[data-theme="dark"] .moment-art, :root[data-theme="dark"] .done-art { background: #f0f4ff; border-radius: 50%; padding: 20px; }
/* The sign-in sea lion stays on the page: a thin light edge and a soft glow keep it readable. */
:root[data-theme="dark"] .auth-hero-art { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 24px rgba(160, 170, 255, 0.28)); }

/* Your car: the co-brand, the car on its tint, two plain rows. */
.cobrand { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }
.cobrand img { height: 20px; border-radius: 4px; }
.car-stage { display: flex; justify-content: center; padding: 16px; border-radius: var(--r-md); background: var(--brand-tint); }
.car-stage img { max-width: 100%; height: 140px; object-fit: contain; }
.car-name { margin: 16px 0 4px; font-size: 18px; font-weight: 700; }
.plain-rows { margin-bottom: 12px; }
.plain-row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.plain-row:first-child { border-top: 0; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-main { padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); background: none; }
  .auth-top { margin-top: 0; }
  .auth.card-mode .auth-top { justify-content: flex-start; }
  .auth-step, .auth.card-mode .auth-step { flex: 1; margin: 0; padding: 24px 0 0; border: 0; background: none; }
  .auth.card-mode { background: var(--bg); }
  .auth-actions { margin-top: auto; padding-top: 24px; }
  .auth-title { font-size: 30px; }
  .otp-boxes { gap: 8px; }
}

/* ── Structured ledger rows ──────────────────────────────────────────────── */
.pay-label { display: grid; gap: 2px; }
.pay-meta { font-size: 12px; color: var(--muted); font-weight: 500; }
.pay-right { display: grid; gap: 2px; justify-items: end; }
.pill.processing { background: var(--processing); color: var(--processing-ink); }
.pill.scheduled { background: var(--brand-tint); color: var(--brand-accent); }
.pill.neutral { background: var(--border-subtle); color: var(--muted); }
.pill.brand-pill { background: var(--brand-tint); color: var(--brand-accent); }

/* ── Payment date cards + scheduled management ───────────────────────────── */
.when-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.when-grid .choice { margin-bottom: 0; }
.choice.selected { border-color: var(--brand-accent); background: var(--brand-tint); }
.fee-note { color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; margin: 12px 0; }
.choice.danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger-deep); }
.choice.danger .sub-line { color: color-mix(in srgb, var(--danger-deep) 75%, transparent); }
.confirm-row .v.green { color: var(--success); }

/* ── Confirmation blue stage (matches the app's success screen) ──────────── */

/* ── Calendar date picker (app's "Pay · Pick a date") ────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; justify-items: center; margin-bottom: 6px; }
.cal-head span { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }
.cal-cell { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cal-cell:hover { background: var(--border-subtle); }
.cal-cell.off { color: var(--border); cursor: default; pointer-events: none; }
.cal-cell.due { box-shadow: inset 0 0 0 2px var(--brand-accent); }
.cal-cell.grace { background: var(--brand-tint); color: var(--brand-accent); }
.cal-cell.sel, .cal-cell.grace.sel { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.cal-legend { display: flex; justify-content: center; gap: 20px; font-size: 12px; color: var(--muted); margin: 10px 0 2px; }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.cal-legend .dot.ring { box-shadow: inset 0 0 0 2px var(--brand-accent); }
.cal-legend .dot.tint { background: var(--brand-tint); }
.cal-banner { display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; font-weight: 600; margin: 10px 0; }
.cal-banner.ok { background: var(--success-soft); color: var(--success-deep); }
.cal-banner.ok .ic { width: 13px; height: 13px; }
.cal-banner.warn { background: var(--warning-soft); color: var(--warning-deep); }
.cal-cell:disabled { opacity: 1; }
.cal-cell.today:not(.sel) { text-decoration: underline; text-underline-offset: 4px; }
.cal-cell:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 8px; }
.cal-nav .cal-month { margin: 0; font-weight: 600; color: var(--ink); }
.cal-arrow { width: 36px; height: 36px; border: 1.5px solid var(--border); border-radius: 50%; background: none; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cal-arrow:hover:not(:disabled) { background: var(--border-subtle); }
.cal-arrow:disabled { opacity: 0.35; cursor: default; }
.cal-arrow .ic { width: 16px; height: 16px; }
#cal-next:disabled { opacity: 0.45; cursor: default; }

.inst-chip { width: 34px; height: 34px; border-radius: 9px; color: var(--on-brand); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.inst-chip img { width: 100%; height: 100%; object-fit: contain; background: var(--logo-tile); }

/* ── Mobile (phones) ─────────────────────────────────────────────────────────
   The 860px query above stacks the columns; this block makes the portal feel
   native on a phone: no iOS focus-zoom (inputs ≥16px), modals become bottom
   sheets, tighter chrome, and safe-area padding. */
@media (max-width: 520px) {
  .page { padding: 16px 14px 36px; }
  .card { padding: 16px; border-radius: 16px; }
  .columns { gap: 14px; margin-top: 14px; }

  /* Tighter hero + smaller tenant logo so the topbar/hero fit an iPhone. */
  .hero-card { padding: 20px 16px; }
  .car-thumb { width: 72px; }
  .hero-vehicle { font-size: 20px; }
  .fi-mark { width: 38px; height: 38px; font-size: 14px; }
  .fi-mark.has-logo { max-width: 132px; height: 32px; }
  .fi-mark.has-logo img { max-width: 132px; }
  .top-actions { gap: 8px; }

  /* iOS Safari zooms any focused input under 16px — hold the line at 16. */
  .landing-input, .amount-input input, select, textarea { font-size: 16px; }

  /* Dialogs read as bottom sheets on phones. The backdrop tracks the
     VISIBLE viewport (JS sets top/height from visualViewport) so an open
     iOS keyboard pushes the sheet up instead of hiding it. */
  .modal-backdrop { align-items: flex-end; padding: 0; height: 100dvh; bottom: auto; }
  .modal {
    width: 100%; max-height: 86dvh;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 32px 20px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .modal::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 36px; height: 4px; border-radius: 999px; background: var(--grabber); }

  .cal-grid { gap: 2px; }
}

/* Fine-print consent block (auto-pay modal) */
.fineprint { margin: 14px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.fineprint strong { color: var(--ink); font-weight: 700; }
.fineprint ul { margin: 6px 0 8px; padding-left: 16px; display: grid; gap: 4px; }
.fineprint a { color: var(--brand-accent); font-weight: 700; }

/* Sign-in: remember device + passkey affordances */
.remember-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0 10px; cursor: pointer; }
.remember-row input { width: 16px; height: 16px; accent-color: var(--brand-accent); }

/* ── v2 dashboard ──────────────────────────────────────────────────────────*/
.state-banner { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.state-banner .ic { width: 16px; height: 16px; }
.state-banner.info { background: var(--brand-tint); color: var(--brand-accent); }
.state-banner.ok { background: var(--success-soft); color: var(--success-deep); }
.state-banner.due, .state-banner.danger { background: var(--danger-soft); color: var(--danger-deep); }

.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 32px; margin-bottom: 12px; box-shadow: var(--shadow-card); }
.hero-identity { display: flex; align-items: center; gap: 16px; }
.car-thumb { width: 116px; flex: none; }
.car-thumb img { width: 100%; height: auto; display: block; }
.hero-id-col { flex: 1; min-width: 0; }
.hero-vehicle { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.hero-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.payoff-chip { border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.hero-divider { height: 1px; background: var(--border-subtle); margin: 20px 0; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat-value { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.btn.tile { background: var(--brand-tint); border-color: var(--brand-tint); color: var(--brand-accent); }
.btn.tile:hover { background: color-mix(in srgb, var(--brand-accent) 10%, var(--brand-tint)); }
.loan-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 40px; margin-top: 20px; }
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.detail-v { font-size: 14px; font-weight: 600; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; }

.col-activity { flex: 6; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.col-rail { flex: 4; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.row-card { flex-direction: row; align-items: center; gap: 12px; cursor: pointer; border-radius: var(--r-sm); padding: 12px 12px 12px 14px; }
.row-ico { color: var(--muted); }
.row-ico .ic { width: 20px; height: 20px; }
/* min-width: 0 lets the text column shrink inside the flex row — without it
   long titles/subs push past the card edge and get cut off on mobile. */
.row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; font-size: 14px; }
.row-sub { color: var(--muted); font-size: 12px; }
.row-chev { width: 16px; height: 16px; color: var(--muted); }
.portal-foot { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.45; margin: 20px auto 0; max-width: 640px; }
.portal-foot a { color: var(--brand-accent); font-weight: 600; }

.rewards-card { background: var(--brand-tint); border-color: var(--brand-tint); }
.rewards-card h2.deep { color: var(--brand-accent); }
.rewards-bal { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; }

/* ── v2 full-page views (Rewards, Activity) ────────────────────────────────*/
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.back-link .ic { width: 15px; height: 15px; }
/* Page views are stacked sections — the column gap is the rhythm between
   cards (rows inside a card manage their own spacing). */
#page-view { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
#page-view > * { margin-top: 0; margin-bottom: 0; }

.page-title { font-size: 38px; line-height: 44px; letter-spacing: -0.015em; font-weight: 700; margin: 4px 0 4px; }
@media (max-width: 860px) { .page-title { font-size: 28px; line-height: 34px; } }
.page-sub { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 20px 2px 8px; }

.list-card { padding: 4px 20px; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 14px 0; font: inherit; text-align: left; cursor: pointer; border-top: 1px solid var(--border-subtle); }
.list-card .list-row:first-child { border-top: 0; }
.list-row.static { cursor: default; }
.list-row[disabled] { opacity: 0.5; cursor: not-allowed; }
.list-ico { width: 36px; height: 36px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-accent); display: flex; align-items: center; justify-content: center; flex: none; }
.list-ico .ic { width: 17px; height: 17px; }
.list-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; }
.list-sub { color: var(--muted); font-size: 12px; }

.upcoming-card { display: flex; flex-direction: column; gap: 12px; }
.upcoming-head { display: flex; align-items: center; gap: 12px; }
.upcoming-info { display: flex; flex-direction: column; }
.upcoming-amt { font-size: 24px; font-weight: 700; }
.upcoming-actions { display: flex; gap: 10px; }
.upcoming-actions .btn { flex: 1; }
.btn.danger-soft { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger-deep); }

.filter-chips { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
/* Moov's field-level card iframe, embedded in our add-card modal. */
moov-card-link { display: block; margin: 6px 0 12px; }


/* Account rows shared by the payment methods page and the pay-from sheets:
   linked accounts, radio choices and the dashed "add" rows. */
.pm-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 0;
  background: none; border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit;
}
div.pm-item { cursor: default; }
.pm-item + .pm-item { border-top: 1px solid var(--border-subtle); }
.pm-ico, .add-ico { width: 44px; height: 44px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; flex: none; }
.pm-ico { background: var(--brand-tint); color: var(--brand-accent); }
.pm-ico .ic, .add-ico .ic { width: 24px; height: 24px; }
.pm-ico.small .ic { width: 20px; height: 20px; }
.add-ico { border: 1.5px dashed color-mix(in srgb, var(--brand-accent) 70%, transparent); color: var(--brand-accent); }
.pm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-title { font-weight: 600; font-size: 16px; color: var(--ink); }
.pm-sub { font-size: 13px; color: var(--muted); }
.add-title { font-weight: 600; font-size: 16px; color: var(--brand-accent); }
.add-row:hover .add-title { text-decoration: underline; }
.pm-tag { padding: 4px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-accent-deep); font-size: 12px; font-weight: 600; }
.pm-reconnect { color: var(--brand-accent); font-size: 13px; font-weight: 600; }
.pm-chev { width: 14px; height: 14px; color: var(--muted); }
.pm-radio { width: 24px; height: 24px; border-radius: 50%; border: var(--b-regular) solid var(--radio-ring); flex: none; display: flex; align-items: center; justify-content: center; }
.pm-item.sel .pm-radio { border: 2px solid var(--brand-accent); }
.pm-item.sel .pm-radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-accent); }
.pm-list { gap: 0; padding-top: 2px; padding-bottom: 2px; }
/* The bank actions sheet: plain text rows. */
.sheet-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 0; border: 0; background: none; text-align: left; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
.sheet-row + .sheet-row { border-top: 1px solid var(--border-subtle); }
.sheet-row.danger { color: var(--danger-deep); }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--brand-accent); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ── Claim consent rows ─────────────────────────────────────────────────────*/
.consent-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink); text-align: left; margin: 8px 0; cursor: pointer; }
.consent-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-accent); flex: none; }
.consent-row a { color: var(--brand-accent); font-weight: 600; }
.landing-legal { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); text-align: center; max-width: 400px; }
.landing-legal a { color: var(--muted); text-decoration: underline; }

/* ── Full-page Make a payment ──────────────────────────────────────────────*/
.pay-form { display: flex; flex-direction: column; }
.pay-form .section-label { margin: 6px 2px 6px; }
.pay-form .section-label:first-child { margin-top: 0; }
.pay-when { display: flex; gap: 10px; }
.pay-when .pay-radio { flex: 1; }
.pay-radio { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; margin-bottom: 8px; }
.pay-radio:not(.static):hover { border-color: var(--brand-accent); }
.pay-radio.sel { border-color: var(--brand-accent); background: var(--brand-tint); }
.pay-radio.static { cursor: default; }
.pay-radio .radio { width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--control-border); flex: none; }
.pay-radio.sel .radio { border-color: var(--brand-accent); border-width: 5px; }
.pr-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pr-title { font-weight: 600; font-size: 14px; }
.pr-sub { color: var(--muted); font-size: 12px; }
.amount-input.mini { font-size: 14px; padding: 6px 10px; margin: 0; }
.amount-input.mini input { width: 90px; }
.fee-note.center { text-align: center; }
#pay-pick { align-self: flex-start; margin: 2px 0 6px; }

/* ── Review + confirmation pages ───────────────────────────────────────────*/
.review-card { display: flex; flex-direction: column; }
.review-card .confirm-row { display: flex; justify-content: space-between; padding: 12px 0; font-size: 13px; border-top: 1px solid var(--border-subtle); border-bottom: 0; }
.review-card .confirm-row:first-child { border-top: 0; }
.review-card .confirm-row .v { font-weight: 600; }
.review-card .confirm-row.total { font-weight: 700; font-size: 14px; }
.review-card .confirm-row.total .v { font-weight: 700; }
.review-card .fee-note { margin: 12px 0; }
.center-link { align-self: center; margin-top: 10px; }
.page-title.center, .page-sub.center { text-align: center; }
.confirm-page { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 460px; margin: 40px auto 0; text-align: center; }
.confirm-check { width: 64px; height: 64px; border-radius: 999px; background: var(--success-soft); color: var(--success-deep); display: flex; align-items: center; justify-content: center; }
.confirm-check .ic { width: 30px; height: 30px; }
.earned-line { margin: 0 0 20px; font-size: 16px; font-weight: 600; text-align: center; }

/* ── Documents & statements page (608:272) ─────────────────────────────────*/
.doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.doc-head .payoff-chip { white-space: nowrap; margin-top: 6px; }
.paperless { margin-bottom: 20px; }
.row-ico.leaf { width: 40px; height: 40px; border-radius: 999px; background: var(--success-soft); color: var(--success-deep); display: flex; align-items: center; justify-content: center; }
.doc-layout { display: flex; gap: 24px; align-items: flex-start; }
.doc-rail { flex: none; width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.doc-cat { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 12px 12px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; }
.doc-cat:hover { background: var(--bg); }
.doc-cat.active { background: var(--brand-tint); color: var(--brand-accent); }
.doc-cat-ico { display: flex; }
.doc-cat-ico .ic { width: 17px; height: 17px; }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.year-chip { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; }
.doc-cols { display: grid; grid-template-columns: 130px 1fr 140px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--muted); padding: 6px 0; }
.doc-cols .right { text-align: right; }
.doc-list { display: flex; flex-direction: column; }
.doc-row { display: grid; grid-template-columns: 130px 1fr 140px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.doc-date { color: var(--muted); }
.doc-name { font-weight: 600; }
.doc-meta { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.doc-actions { display: flex; gap: 14px; justify-content: flex-end; }
.doc-actions .link-btn { font-size: 13px; padding: 0; }

/* ── Expandable payment rows + status colors ───────────────────────────────*/
.pay-item { border-top: 1px solid var(--border-subtle); }
.pay-item:first-child { border-top: 0; }
.pay-row.expandable { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; padding: 14px 0; display: flex; align-items: center; gap: 12px; }
.pay-ico { width: 34px; height: 34px; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex: none; }
.pay-ico .ic { width: 16px; height: 16px; }
.pay-ico.done { background: var(--success-soft); color: var(--success-deep); }
.pay-ico.pending { background: var(--brand-tint); color: var(--brand-accent); }
.pay-ico.returned { background: var(--danger-soft); color: var(--danger-deep); }
.pay-ico.next { background: var(--brand-tint); color: var(--brand-accent); }
.exp-chev { width: 16px; height: 16px; color: var(--muted); transition: transform 0.15s; }
.pay-row.open .exp-chev { transform: rotate(180deg); }
.pill.returned { background: var(--danger-soft); color: var(--danger-deep); }
.pay-detail { padding: 4px 0 16px 46px; }
.pd-grid { display: flex; gap: 32px; flex-wrap: wrap; }
.pd-timeline { display: flex; flex-direction: column; gap: 14px; }
.pd-step { position: relative; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); }
.pd-step.done { color: var(--ink); font-weight: 600; }
.pd-dot { position: relative; width: 11px; height: 11px; margin-top: 2px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); flex: none; z-index: 1; }
/* lineage: a line linking each step to the next, colored once the step posts */
.pd-step:not(:last-child) .pd-dot::after { content: ""; position: absolute; left: 50%; top: 11px; transform: translateX(-50%); width: 2px; height: 24px; background: var(--border); }
.pd-step.done:not(:last-child) .pd-dot::after { background: var(--success); }
.pd-step.done .pd-dot { background: var(--success); border-color: var(--success); }
.pd-step.now .pd-dot { background: var(--warning); border-color: var(--warning); }
.pd-step.now:not(:last-child) .pd-dot::after { background: linear-gradient(to bottom, var(--warning), var(--border)); }
.pd-step.bad .pd-dot { background: var(--danger); border-color: var(--danger); }
.pd-facts { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.pd-kv { display: flex; justify-content: space-between; font-size: 13px; }
.pd-kv span:first-child { color: var(--muted); }
.pd-kv span:last-child { font-weight: 600; }
.pay-detail .link-btn { padding: 8px 0 0; font-size: 13px; }

/* ── Document viewer (typeset paper) ───────────────────────────────────────*/
.doc-view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.paper { max-width: 640px; margin: 0 auto; padding: 32px 36px; gap: 8px; box-shadow: var(--shadow-card); }
.paper-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 8px; }
.paper-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.paper h3 { margin: 6px 0 2px; font-size: 20px; font-weight: 700; }
.paper-sub { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.paper hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 8px 0; }
.paper-kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.paper-kv span:first-child { color: var(--muted); }
.paper-kv span:last-child { font-weight: 600; }
.paper-para { font-size: 14px; line-height: 1.6; margin: 8px 0; }
.paper-note { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 10px; }
.paper-foot { font-size: 11px; color: var(--muted); margin-top: 16px; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
/* Documents print in light whatever the theme. */
@media print {
  :root, :root[data-theme="dark"] { --ink: #142b63; --ink2: #3d4569; --muted: #5d6688; --bg: #ffffff; --surface: #ffffff; --border: #e4e7f1; --border-subtle: #edeff7; --brand-accent: var(--brand); }
  .topbar, .back-link, .doc-view-head .btn, #toast { display: none !important; }
  .paper { box-shadow: none; border: 0; }
}
/* Tighter rewards rail card: title + balance share the head row, so the
   card is three compact lines instead of a stretched stack. */
.rewards-card { gap: 6px; }
.rewards-card .btn { margin-top: 6px; }
.rewards-card .rewards-bal { font-size: 16px; }
/* Clickable home lockup */
.lockup { cursor: pointer; }


/* ── Profile and Passkeys & devices ───────────────────────────────────────── */
/* Plain rows edge to edge inside one card, 44px icon tiles. */
.list-card.flush { padding: 0; gap: 0; overflow: hidden; }
.list-card.flush .list-row, .detail-card .list-row { padding: 14px 16px; gap: 14px; border-top-color: var(--border); color: inherit; text-decoration: none; }
.list-ico.tile { width: 44px; height: 44px; border-radius: var(--r-sm); }
.list-ico.tile .ic { width: 22px; height: 22px; }
.list-card.flush .list-title, .detail-card .list-title { font-size: 16px; }
.list-card.flush .list-sub, .detail-card .list-sub { font-size: 13px; }
.list-row .row-chev { width: 20px; height: 20px; flex: none; }
.pill.round { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.group-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.profile-cols { display: grid; grid-template-columns: 380px 1fr; gap: 32px; align-items: start; }
.profile-menu { display: flex; flex-direction: column; gap: 24px; }
.profile-group { display: flex; flex-direction: column; gap: 10px; }
.profile-head { flex-direction: row; align-items: center; gap: 16px; padding: 20px; }
.profile-avatar { width: 60px; height: 60px; flex: none; border-radius: 50%; background: var(--brand-tint); color: var(--brand-accent); font-size: 20px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-back { display: none; }
.detail-card { padding: 0; gap: 0; overflow: hidden; }
.detail-head { display: flex; flex-direction: column; gap: 2px; padding: 22px 20px 16px; font-size: 14px; }
.detail-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.detail-row { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid var(--border); }
.detail-label { flex: 1; font-weight: 600; }
.detail-value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.detail-pad { padding: 14px 16px 16px; border-top: 1px solid var(--border); margin: 0; }
.detail-section { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; border-top: 1px solid var(--border); }
.detail-section + .list-row { border-top: 0; }
.detail-note { margin: 0; padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.detail-empty { margin: 0; padding: 24px 20px; border-top: 1px solid var(--border); text-align: center; }
.inbox-row.read .list-title { font-weight: 500; color: var(--muted); }
.inbox-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--brand-accent); }
.btn.chip-btn { min-width: 96px; padding: 8px 18px; font-size: 14px; font-weight: 600; flex: none; }
.detail-pad .btn.tile { min-width: 180px; font-size: 15px; font-weight: 600; }
.sec-cols { display: grid; grid-template-columns: 1fr 400px; gap: 32px; align-items: start; }
.sec-col { display: flex; flex-direction: column; gap: 24px; }
.sec-col + .sec-col { gap: 16px; }
.sec-col > .card:not(.detail-card) { padding: 20px; gap: 12px; }
.sec-col > .card:not(.detail-card) > .btn { align-self: flex-start; min-width: 220px; font-size: 15px; font-weight: 600; }
.sec-h { margin: 0; font-size: 18px; font-weight: 700; }
.danger-card { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.danger-card .sec-h { color: var(--danger-deep); }
@media (max-width: 860px) {
  .profile-cols, .sec-cols { grid-template-columns: 1fr; gap: 16px; }
  /* Phone: the list, or one detail with a way back. */
  .profile-cols:not(.has-detail) .profile-detail, .profile-cols.has-detail .profile-menu { display: none; }
  .profile-title.on-detail { display: none; }
  .profile-back { display: inline-flex; }
}

/* Secondary links */
.muted-link { display: block; margin: 14px auto 0; color: var(--muted); font-size: 13px; }

/* The ⋮ hero menu shows only in the stacked layout below. */
.hero-more-wrap { display: none; }

/* ── Tablet / stacked layout (≤860px) ──────────────────────────────────────*/
@media (max-width: 860px) {
  /* Bottom tabs: the pill and Ask Rory's tile float over the page, which
     keeps room under its last card so nothing hides behind them. */
  .topbar { grid-template-columns: 1fr auto; }
  .topbar { min-height: 62px; padding: 14px 16px; }
  .toast { top: calc(70px + env(safe-area-inset-top)); }
  .tabs { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 6; gap: 10px; height: 62px; }
  .tab-pill { flex: 1; height: 100%; padding: 8px; border-color: var(--border-subtle); border-radius: var(--r-lg); box-shadow: var(--shadow-nav); }
  .tab { flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 100%; padding: 0; border-radius: var(--r-md); font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--ink2); }
  .tabs .ask-tile { display: flex; width: 62px; height: 62px; border-color: var(--border-subtle); border-radius: var(--r-lg); box-shadow: var(--shadow-nav); }
  .tabs .ask-tile img { width: 44px; height: 44px; }
  .member-chip { width: 34px; height: 34px; }
  .top-actions .ask-tile { display: none; }
  .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

  .columns { flex-direction: column; }

  .col-rail { max-width: none; }
  /* Identity stacks: car + name on the first line, payoff chip on its own
     full-width line so the vehicle name never gets crushed to one word/line. */
  .hero-identity { flex-wrap: wrap; align-items: flex-start; gap: 14px; }
  .hero-id-col { min-width: 150px; }
  .payoff-chip { order: 3; flex-basis: 100%; text-align: center; white-space: normal; }
  .loan-details { grid-template-columns: repeat(2, 1fr); }

  /* One primary action on mobile ("Make a payment"); the rest move into the
     ⋮ menu so the card isn't a stack of five buttons. */
  .hero-card { position: relative; }
  .hero-more-wrap { display: block; position: absolute; top: 12px; right: 12px; z-index: 6; }
  .hero-more { width: 34px; height: 34px; background: var(--border-subtle); }
  .hero-identity { padding-right: 40px; }
  #hero-menu { top: 42px; }
  #autopay-cta, #details-btn, .hero-foot { display: none; }

  .doc-layout { flex-direction: column; }
  .doc-rail { width: 100%; flex-direction: row; overflow-x: auto; }
}

/* ── v4 (Sept 2026): hero line, quick actions, soft card, snapshot, setup,
   step pages, Concierge, Rewards. Tokens per docs/app-v4-migration.md 5b. ── */
.hero-v4 { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero-due { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-line { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.hero-line .ic { width: 14px; height: 14px; }
.hero-line.muted { color: var(--ink2); }
.hero-line.ink { color: var(--ink); font-weight: 600; }
.hero-line.red { color: var(--danger-deep); font-weight: 600; }
.hero-line.green { color: var(--success-deep); font-weight: 600; }
.grace-bar { position: relative; width: 220px; height: 4px; border-radius: 999px; background: var(--danger-soft); margin: 6px 0 22px; }
.grace-bar .grace-fill { height: 100%; border-radius: 999px; background: var(--danger); }
.grace-bar .grace-label { position: absolute; top: 8px; left: 0; font-size: 11px; color: var(--muted); white-space: nowrap; }
.quick-actions { display: flex; gap: 10px; flex: none; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 118px; padding: 14px 8px 12px; border: 0; border-radius: var(--r-md); background: var(--surface); color: var(--ink2); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-card); }
.qa .ic { width: 22px; height: 22px; color: var(--brand-accent); }
.qa:hover { background: var(--brand-tint); }
.qa.primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 20px -4px var(--brand-glow); }
.qa.primary .ic { color: var(--on-brand); }
.hero-foot { gap: 14px; }

.soft-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-soft); padding: 16px; margin-bottom: 12px; }
.soft-card.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.soft-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--brand-accent); display: flex; align-items: center; justify-content: center; flex: none; }
.soft-card.danger .soft-ico { background: var(--surface); color: var(--danger-deep); }
.soft-ico .ic { width: 20px; height: 20px; }
.soft-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.soft-title { font-size: 14px; font-weight: 600; }
.soft-body p { margin: 0; font-size: 13px; line-height: 17px; color: var(--ink2); }
.btn.soft-pill { align-self: flex-start; margin-top: 4px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--brand-accent); background: var(--surface); border-color: var(--border); box-shadow: none; }

.snapshot { border-radius: var(--r-lg); box-shadow: var(--shadow-lift); gap: 12px; }
.snapshot h2 { font-size: 14px; font-weight: 600; }
.snap-row { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 96px; height: 96px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: conic-gradient(from 225deg, var(--brand-accent) 0deg var(--deg, 150deg), var(--border-subtle) var(--deg, 150deg) 270deg, transparent 270deg 360deg); }
.ring-hole { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-pct { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.ring-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.09em; margin-top: 4px; }
.facts { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fact { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.fact strong { color: var(--ink); font-size: 14px; font-weight: 700; }
.pay-ahead-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: var(--brand-tint); color: var(--brand-accent); border-radius: var(--r-xs); padding: 12px 10px 12px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
.pay-ahead-row span { flex: 1; }
.pay-ahead-row .ic { width: 14px; height: 14px; }
.pay-ahead-row:hover { background: color-mix(in srgb, var(--brand-accent) 10%, var(--brand-tint)); }

/* Activity rows (v4): date leads, type and source under it, pill or pts right. */
.pay-row.v4 { padding: 10px 0; gap: 10px; align-items: center; }
.pay-row.v4 .pay-label > span:first-child { font-size: 13px; font-weight: 600; }
.pay-row.v4.upcoming .pay-label, .pay-row.v4.upcoming .pay-amount { opacity: 0.8; }
.pay-row.v4 .pay-amount { font-size: 13px; font-weight: 600; }
.btn.tile.view-all { align-self: center; padding: 10px 20px; font-size: 13px; font-weight: 600; border-radius: 999px; margin-top: 2px; }

/* Up next: the next setup step on every tab. Desktop: a slim bar under the
   top nav, full content width. Phone: floats above the tabs. */
.up-next { display: flex; align-items: center; gap: 12px; width: calc(100% - 40px); max-width: 980px; min-height: 48px; margin: 12px auto 0; padding: 8px 10px 8px 20px; border: 0; border-radius: var(--r-soft); background: var(--ink-surface); color: var(--on-ink); font: inherit; text-align: left; cursor: pointer; position: sticky; top: 72px; z-index: 4; }
.un-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.un-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.un-label { flex: none; font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--success-on-ink); }
.un-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.un-segs { display: flex; gap: 4px; }
.un-segs span { flex: 1; height: 4px; border-radius: 2px; background: rgb(255 255 255 / 25%); }
.un-segs span.done { background: var(--success-on-ink); }
.un-go { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; flex: none; }
@media (max-width: 860px) {
  /* A pinned primary floats where the Up next bar would, over the tabs. */
  .step-wrap.pinned { padding-bottom: 72px; }
  /* Focus scrolls a control clear of the pinned button and the tabs. */
  html:has(#page-view:not(.hidden) .step-wrap.pinned) { scroll-padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .step-wrap.pinned #step-primary { position: fixed; left: 16px; right: 16px; bottom: calc(88px + env(safe-area-inset-bottom)); width: auto; z-index: 6; }
  .up-next { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(88px + env(safe-area-inset-bottom)); width: auto; max-width: none; min-height: 56px; margin: 0; z-index: 6; }
  body.has-up-next .page { padding-bottom: calc(176px + env(safe-area-inset-bottom)); }
}

/* "Finish setting up": plain rows with thin dividers. */
.sheet-head { display: flex; align-items: center; gap: 12px; margin: 0 40px 14px 0; }
.sheet-head h3 { margin: 0; }
.count-pill { background: var(--brand-tint); color: var(--brand-accent); border-radius: 999px; padding: 3px 9px; font-size: 13px; font-weight: 700; }
.setup-rows { display: flex; flex-direction: column; margin-top: 8px; }
.setup-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 20px 0; border: 0; border-top: 1px solid var(--border-subtle); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
div.setup-row { cursor: default; }
.setup-row .check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--control-border); flex: none; display: flex; align-items: center; justify-content: center; }
.setup-row.done .check, .check.done { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.check.done { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.setup-row .check .ic, .check.done .ic { width: 12px; height: 12px; stroke-width: 3; }
.setup-title { flex: 1; font-size: 16px; font-weight: 600; }
.setup-row.done .setup-title { color: var(--muted); text-decoration: line-through; }
.setup-row .row-chev { flex: none; }
.btn.sm { padding: 8px 14px; font-size: 13px; font-weight: 600; align-self: flex-start; }

/* Step pages */
/* Header and content share one column, centered; the Auto Pay review uses
   the page's full width for its two columns. */
.step-wrap { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.step-wrap.wide { max-width: none; }
.step-wrap .back-link { margin: 0; align-self: flex-start; }
.step-progress { display: flex; flex-direction: column; gap: 8px; }
.step-label { font-size: 14px; font-weight: 600; }
.step-progress .progress { height: 6px; margin: 0; }
.step-segs { display: flex; gap: 6px; max-width: 360px; }
.step-segs span { flex: 1; height: 4px; border-radius: 999px; background: var(--brand-accent); }
.step-body { display: flex; flex-direction: column; gap: 12px; }
.step-body .page-title { font-size: 24px; line-height: 31px; margin: 8px 0 0; }
.step-body .page-sub { font-size: 14px; line-height: 20px; color: var(--ink2); margin: 0 0 6px; }
.step-note { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; }

/* Payment choice: one card per option; the savings strip is the card's own top edge. */
.pick-card { position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--r-soft); background: var(--surface); font: inherit; color: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.pick-card.rec, .pick-card:has(input:checked) { border: var(--b-regular) solid var(--brand-accent); }
.pick-card:has(input:focus-visible) { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.pick-group { display: flex; flex-direction: column; gap: 12px; }
.pick-band { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 600; }
/* Blue only marks the pick: the band goes light while Pay manually is picked. */
.pick-card:has(input:not(:checked)) .pick-band { background: var(--brand-tint); color: var(--ink); }
/* The rate arrow sways 2px and back while Auto Pay is picked (one cycle
   every 3 s, ease-in-out sine); still otherwise. */
.sway { display: inline-block; }
.pick-card:has(input:checked) .sway { animation: sway 1.5s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate; }
@keyframes sway { to { transform: translateX(2px); } }
/* A chevron's hint: 3px out and back after a 1 s rest, every 5 s. */
.row-chev.nudge { animation: nudge 5s infinite; }
@keyframes nudge {
  0%, 20% { transform: translateX(0); animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1); }
  31% { transform: translateX(3px); animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1); }
  42%, 100% { transform: translateX(0); }
}
/* The radio is invisible but spans its card, so focus scrolls the whole card into view. */
.pick-card > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.pick-body { display: flex; align-items: center; gap: 14px; padding: 18px; }
.pick-ico { width: 44px; height: 44px; border-radius: var(--r-xs); background: var(--brand-tint); color: var(--brand-accent); display: flex; align-items: center; justify-content: center; flex: none; }
.pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pick-eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); }
.pick-card.rec .pick-eyebrow { color: var(--brand-accent); }
.pick-title { font-size: 16px; font-weight: 600; }
.pick-sub { font-size: 13px; color: var(--muted); }
.plain-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
/* The claim card's hairline between loan terms and the payment rows. */
.plain-row.terms-split { border-top: 1px solid var(--border-subtle); margin-top: 6px; }
.save-amt { color: var(--success-deep); }

/* Auto Pay panel: the facts card, then the total, the extra and the
   authorization. Two columns on a desktop page; one in the sheet. */
.ap { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 861px) {
  .step-body .ap { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
}
.ap-card { gap: 0; padding: 6px 22px; }
.ap-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border-subtle); font-size: 14px; }
.ap-row:first-child { border-top: 0; }
.ap-k { color: var(--muted); }
.ap-v { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; font-weight: 500; }
.ap-rate { white-space: nowrap; }
.ap-note { max-width: 220px; font-size: 12px; font-weight: 400; color: var(--muted); }
.from-pill { display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; background: var(--brand-tint); color: var(--brand-accent); padding: 6px 10px 6px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.from-pill .ic { width: 14px; height: 14px; }
.ap-side { display: flex; flex-direction: column; gap: 16px; }
.ap-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--brand-tint); border-radius: var(--r-soft); padding: 18px 20px; }
.ap-total-info { display: flex; flex-direction: column; gap: 4px; }
.ap-total-label { color: var(--brand-accent); font-size: 16px; font-weight: 700; }
.ap-reward { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.ap-total-amt { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.extra-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.extra-info { display: flex; flex-direction: column; cursor: pointer; }
.extra-title { font-size: 16px; font-weight: 600; }
.switch { position: relative; width: 46px; height: 28px; flex: none; border: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: background var(--t-base) var(--ease); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 43, 99, 0.2); transition: transform var(--t-base) var(--ease); }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip.soft { background: var(--brand-tint); border-color: var(--brand-tint); color: var(--brand-accent); font-size: 12px; padding: 6px 10px; }
.effect-line { margin: 0 0 6px; background: var(--brand-tint); color: var(--brand-accent); border-radius: var(--r-xs); padding: 10px 12px; font-size: 13px; font-weight: 600; }
.ap-auth { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.ap-actions { display: flex; flex-direction: column; }
.consent-card { background: var(--brand-tint); border-radius: var(--r-xs); padding: 12px; }

/* Insurance, address, paperless */
.lien-card { gap: 8px; }
.lien-block { margin: 0; font-size: 14px; line-height: 1.5; }
.lien-copy { justify-content: center; gap: 8px; padding-bottom: 0; color: var(--brand-accent); font-weight: 600; }
.addr-card { flex-direction: row; align-items: center; gap: 12px; }
.check-list { display: flex; flex-direction: column; gap: 12px; }
.check-item { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.muted-link { color: var(--muted); font-size: 13px; font-weight: 500; }
/* A setup step's one way out, the same on every step. */
.step-not-now { display: block; min-height: 44px; margin: 0 auto; color: var(--muted); font-size: 15px; font-weight: 500; }
.step-row .list-title { flex: 1; }

/* Done: "You're all set" */
.done-page { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.done-art { width: 160px; height: 160px; align-self: center; object-fit: contain; }
.done-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
button.done-row { cursor: pointer; }
.done-row.done { padding-bottom: 16px; border-bottom: 1px solid var(--border-subtle); }
.done-ring { width: 18px; height: 18px; flex: none; border: 2px solid var(--muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.done-row.done .done-ring { width: 22px; height: 22px; border: 0; background: var(--success); color: var(--on-status); }
.done-ring .ic { width: 12px; height: 12px; stroke-width: 3; }
.done-row.next .done-ring { border-color: var(--brand-accent); }
.done-row.next .done-title { color: var(--brand-accent); }
.done-info { flex: 1; display: flex; flex-direction: column; }
.done-title { font-size: 15px; font-weight: 600; }
.done-page .btn { margin-top: 20px; }

/* Change a payment: day grid */
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-grid .day { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; height: 40px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }
.day-grid .day.sel { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.modal .choice .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.choice.static { cursor: default; opacity: 0.6; }
a.choice { text-decoration: none; color: inherit; }
button.choice { width: 100%; background: none; font: inherit; font-weight: 700; text-align: left; }

/* Concierge */
.ask-card { gap: 10px; }
.ask-head { display: flex; align-items: center; gap: 10px; }
/* Ask Rory mark: navy art, so it sits on the light Ask ground in both themes. */
.rory-mark { width: 36px; height: 36px; flex: none; object-fit: contain; border-radius: 50%; background: var(--ask-tile); }
.rory-mark.sm { width: 26px; height: 26px; }
.ask-input { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 999px; padding: 6px 6px 6px 14px; }
.ask-input input { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; outline: none; min-width: 0; }
.ask-go { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ask-go .ic { width: 14px; height: 14px; }
.ask-bubble { align-self: flex-end; background: var(--brand-tint); color: var(--brand-accent); border-radius: 18px; padding: 10px 14px; font-size: 14px; font-weight: 600; margin: 6px 0; }
.ask-reply { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; }
.ask-reply p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.offer-chip { display: inline-flex; background: var(--brand-tint); color: var(--brand-accent); border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; width: fit-content; margin-bottom: 4px; }
.car-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.car-img { width: 128px; height: 70px; object-fit: contain; }
.value-card { border-radius: var(--r-lg); gap: 8px; }
.value-card.revealed { background: var(--brand-tint); border-color: var(--brand-tint); box-shadow: none; }
.value-big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.range { position: relative; height: 24px; margin: 8px 0 2px; }
.range::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: 999px; background: var(--surface); }
.range-band { position: absolute; left: 20%; right: 20%; top: 10px; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--brand-accent) 35%, var(--surface)); }
.range-dot { position: absolute; top: 6px; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); border: 2px solid var(--surface); }
.range-dot.yours { background: var(--brand-accent); }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* Rewards and Explore */
.rw-cols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; align-items: start; }
.rw-stack { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.rw-section { display: flex; flex-direction: column; gap: 14px; }
.rw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rw-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.rw-head .link-btn { font-size: 15px; font-weight: 600; padding: 0; }
.rw-narrow { max-width: 640px; }
.rw-empty { margin: 0; padding: 16px; font-size: 14px; }
.rw-points { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: var(--r-md); background: var(--surface); }
.rw-where { display: flex; align-items: center; gap: 6px; font-weight: 400; padding-top: 12px; border-top: 1px solid var(--border-subtle); color: var(--muted); font-size: 13px; text-align: left; }
.rw-where .ic { width: 15px; height: 15px; }
.rw-balance .pts-num { gap: 6px; font-size: 56px; font-weight: 700; line-height: 1.15; }
.rw-balance .coin { width: 46px; height: 46px; }
/* The hero coin's light glint: a soft cream band, tilted 25deg, crossing the
   coin once each time Rewards opens (the coin art's own sweep). */
.coin-glint { position: relative; display: inline-flex; flex: none; border-radius: 50%; overflow: hidden; }
.coin-glint::after {
  content: ""; position: absolute; top: -14%; bottom: -14%; left: 30%; width: 40%; pointer-events: none;
  background: linear-gradient(90deg, rgb(255 253 245 / 0) 0%, rgb(255 253 245 / 0.12) 28%, rgb(255 253 245 / 0.42) 50%, rgb(255 253 245 / 0.12) 72%, rgb(255 253 245 / 0) 100%);
  transform: rotate(25deg) translateX(-180%);
  animation: coin-glint 1.05s cubic-bezier(0.37, 0, 0.63, 1) 0.25s both;
}
@keyframes coin-glint { to { transform: rotate(25deg) translateX(180%); } }
@media (prefers-reduced-motion: reduce) { .coin-glint::after { display: none; } }
.pts-chip.on-rewards { display: none; }
.rw-worth { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.rw-progress { display: flex; flex-direction: column; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 600; }
.rw-bar { display: flex; height: 8px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; }
.rw-bar > * { display: block; height: 100%; border-radius: 4px; }
.rw-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.rw-actions .btn { min-height: 48px; padding: 0 24px; font-size: 16px; font-weight: 600; }
#rw-redeem { min-width: 150px; }
#rw-loan { min-width: 170px; }
.rw-card { display: flex; width: 100%; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-card); font: inherit; color: inherit; text-align: left; }
button.rw-card { cursor: pointer; }
button.rw-card:hover { border-color: var(--brand-accent); }
.offer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.offer-tile { align-items: center; gap: 12px; padding: 18px; }
.offer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.offer-title { font-size: 17px; font-weight: 700; line-height: 22px; }
.rw-link { color: var(--brand-accent); font-size: 15px; font-weight: 600; }
.offer-art { width: 92px; height: 92px; object-fit: contain; flex: none; }
/* Tenant art waits, hidden, while it is put in the credit union's colors. */
img[data-painted="pending"] { visibility: hidden; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.lesson-tile { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
.lesson-name { font-size: 16px; font-weight: 600; line-height: 21px; }
.lesson-min { color: var(--muted); font-size: 13px; }
.lesson-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.lesson-coins { font-weight: 700; }
.lesson-coins.earned { color: var(--success-deep); }
.lesson-pts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.lesson-pts .coin { width: 15px; height: 15px; }
.lesson-pts > span:not(.pts-num) { color: var(--muted); font-size: 13px; font-weight: 400; }
.lesson-pts.earned { color: var(--success-deep); }
.lesson-pts .ic { width: 15px; height: 15px; }
.history-pts { font-size: 15px; font-weight: 700; flex: none; }
.history-pts .coin { width: 16px; height: 16px; }
.held-card { flex-direction: column; gap: 8px; padding: 18px 20px; }
.held-line { display: flex; justify-content: space-between; gap: 12px; }
.held-card .list-sub.ok { color: var(--success-deep); }
/* Lesson player */
.lesson-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.lesson-wrap > .btn { align-self: flex-start; }
.lesson-wrap .progress { margin: 0; }
.lesson-step { padding: 24px; }
.lesson-step.center { align-items: center; text-align: center; }
.lesson-step.passed { background: var(--brand-tint); border-color: var(--brand-accent); }
.lesson-step.passed .list-ico.tile { background: var(--brand); color: var(--on-brand); }
.lesson-step .muted { margin: 0; }
.list-ico.tile.big { width: 56px; height: 56px; }
.list-ico.tile.big .ic { width: 26px; height: 26px; }
.lesson-fact { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.5; }
.lesson-prompt { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--surface); font: inherit; font-size: 15px; color: var(--ink); text-align: left; cursor: pointer; }
.quiz-opt:hover:not(:disabled) { border-color: var(--brand-accent); }
.quiz-opt:disabled { cursor: default; }
.quiz-mark { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--border-subtle); color: var(--on-brand); flex: none; }
.quiz-mark .ic { width: 14px; height: 14px; }
.quiz-opt.right { border-color: var(--success); background: var(--success-soft); }
.quiz-opt.right .quiz-mark { background: var(--success); color: var(--on-status); }
.quiz-opt.wrong { border-color: var(--danger); }
.quiz-opt.wrong .quiz-mark { background: var(--danger); color: var(--on-status); }
.quiz-opt.dim { opacity: 0.55; }
.quiz-feedback { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--border-subtle); color: var(--muted); font-size: 14px; font-weight: 600; }
.quiz-feedback.right { background: var(--success-soft); color: var(--success-deep); }
.stat-row { display: flex; gap: 10px; }
/* Institution page */
.inst-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 28px; padding: 28px 32px; border-radius: var(--r-lg); background: var(--brand); color: var(--on-brand); }
.inst-seal { display: flex; align-items: center; justify-content: center; min-width: 72px; height: 72px; padding: 0 12px; border-radius: var(--r-md); background: #fff; color: var(--brand); font-size: 20px; font-weight: 700; box-sizing: border-box; }
.inst-seal img { max-width: 120px; max-height: 48px; }
.inst-hero h1 { margin: 6px 0 0; font-size: 28px; line-height: 34px; }
.inst-hero p { margin: 0; max-width: 640px; font-size: 15px; font-weight: 600; line-height: 1.45; opacity: 0.9; }
.inst-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.inst-chips span { padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--on-brand) 16%, transparent); font-size: 14px; font-weight: 700; }
/* Calculator sheets */
.calc-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 36px; }
.calc-head h3 { margin: 0; }
.calc-head .sub { margin: 2px 0 16px; }
.calc-hero { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand-accent); font-size: 13px; }
.calc-hero strong { color: var(--ink); font-size: 28px; line-height: 1.2; }
.calc-control { margin-top: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.calc-control-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.calc-control-head b { font-size: 12px; }
.calc-value { margin: 6px 0 10px; font-size: 22px; font-weight: 700; }
.calc-control input[type="range"] { width: 100%; accent-color: var(--brand); }
.calc-range { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.calc-result { margin: 18px 4px 6px; font-size: 15px; line-height: 1.45; }

@media (max-width: 860px) {
  .hero-v4 { flex-direction: column; align-items: stretch; gap: 16px; }
  .quick-actions { display: flex; }
  .qa { flex: 1; width: auto; }
  #hero-menu [data-hero="autopay"], #hero-menu [data-hero="change"] { display: none; }
  .step-body { max-width: none; }
  /* Rewards on a phone: one column; Learn & earn reads as a list. */
  .rw-cols { grid-template-columns: 1fr; gap: 16px; }
  .rw-stack { gap: 16px; }
  .rw-points { padding: 20px; }
  .rw-balance .pts-num { font-size: 44px; }
  .rw-balance .coin { width: 36px; height: 36px; }
  .rw-actions .btn { flex: 1; min-width: 0; }
  .offer-grid { grid-template-columns: 1fr; gap: 12px; }
  .rw-section .lesson-grid { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
  .rw-section .lesson-tile { display: grid; grid-template-columns: 44px 1fr auto; grid-template-areas: "ico name pts" "ico min pts"; column-gap: 14px; row-gap: 2px; align-items: center; padding: 14px 16px; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
  .rw-section .lesson-tile:first-child { border-top: 0; }
  .rw-section .lesson-tile .list-ico { grid-area: ico; }
  .rw-section .lesson-name { grid-area: name; }
  .rw-section .lesson-min { grid-area: min; }
  .rw-section .lesson-pts { grid-area: pts; font-size: 15px; font-weight: 700; }
  .rw-section .lesson-pts .coin { width: 16px; height: 16px; }
  .rw-section .lesson-pts > span:not(.pts-num) { display: none; }
  .rw-section .lesson-pts .pts-num::before { content: "+"; }
  /* The lesson's Next stays above the tab bar (and the Up Next bar) as it scrolls. */
  .lesson-wrap > #ls-next { position: sticky; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 2; align-self: stretch; box-shadow: 0 0 0 12px var(--bg); }
  body.has-up-next .lesson-wrap > #ls-next { bottom: calc(156px + env(safe-area-inset-bottom)); }
}

/* A dialog is open: freeze the page behind it so focusing a field can't
   scroll the document (iOS Safari jumped to the top and hid the sheet). */
html.modal-open, body.modal-open { overflow: hidden; overscroll-behavior: none; }

/* Reduced motion: state changes land without movement. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  /* Endless hints stand still: a near-zero duration would only jitter. */
  .sway, .nudge { animation: none !important; }
}
