/* Keeps app design system
   Structure from the Wise design system (tokens by role, one accent CTA per screen, docked footer,
   bottom sheets, list items, wheel picker), themed with Keeps blue, ink and Helvetica.
   Used by every page except the landing page (index.html keeps keeps.css). */

/* ============ 1 · Tokens ============ */
:root {
  /* colour · semantic (never use raw hex below this block) */
  --bg-screen: #e6efff;            /* page */
  --bg-elevated: #ffffff;          /* cards, sheets */
  --bg-neutral: #edf2fd;           /* fills inside cards, neutral buttons, wheel band */
  --bg-neutral-hover: #e1e9fb;
  --bg-neutral-active: #d4def6;
  --border-neutral: rgba(11, 11, 12, .12);
  --border-input: #868685;
  --content-primary: #0b0b0c;
  --content-secondary: #45474d;
  --content-tertiary: #6b6e78;     /* placeholders and "Optional" only */
  --content-link: #0043d6;
  --interactive-accent: #004ef7;   /* the one primary button per screen */
  --interactive-accent-hover: #0044d9;
  --interactive-accent-active: #003ab9;
  --interactive-control: #ffffff;  /* label on accent */
  --interactive-primary: #002a8c;  /* selection, focus, checked states */
  --interactive-secondary: #d9e5ff;/* secondary button fill */
  --interactive-secondary-hover: #c9daff;
  --interactive-on-secondary: #002a8c;
  --sentiment-negative: #c0261b;
  --sentiment-negative-surface: #fdecea;
  --sentiment-positive: #1d7a35;
  --sentiment-positive-surface: #e4f4e8;
  --sentiment-warning: #f5c400;
  --sentiment-warning-surface: #fff5d1;
  --expressive-pink: #ff7ac6;
  --expressive-orange: #ff4d0d;
  --scrim: rgba(11, 11, 12, .48);
  --focus-ring: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--interactive-primary);

  /* type · Helvetica for everything (brand). Display = heavy, tight. */
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --t-display-l: 700 3rem/0.92 var(--font);        /* 48 / success moments */
  --t-display-m: 700 2.5rem/0.95 var(--font);      /* 40 */
  --t-screen: 700 1.875rem/2.25rem var(--font);    /* 30/36 · one h1 per screen */
  --t-section: 700 1.5rem/2rem var(--font);        /* 24/32 · h2 */
  --t-sub: 700 1.375rem/1.75rem var(--font);       /* 22/28 · h3, sheet titles */
  --t-body-title: 700 1.125rem/1.5rem var(--font); /* 18/24 · card titles */
  --t-group: 700 .875rem/1.375rem var(--font);     /* 14/22 · list group titles */
  --t-body-l: 400 1rem/1.5rem var(--font);         /* 16/24 */
  --t-body-l-bold: 600 1rem/1.5rem var(--font);
  --t-body: 400 .875rem/1.375rem var(--font);      /* 14/22 */
  --t-body-bold: 600 .875rem/1.375rem var(--font);
  --track-tight: -.02em;

  /* spacing (founder's spec) */
  --sp-between-text: .5rem;        /* 8 */
  --sp-display-bottom: 1rem;       /* 16 */
  --sp-text-to-component: 1rem;    /* 16 */
  --sp-content-to-button: 1.5rem;  /* 24 */
  --sp-between-sections: 2rem;     /* 32 */
  --sp-component: 1rem;            /* 16 */
  --sp-between-cards: .75rem;      /* 12 */
  --sp-between-chips: .5rem;       /* 8 */
  --gutter: 1rem;                  /* page edge on phones; cards carry their own 24 */
  --pad-s: 1rem; --pad-m: 1.5rem; --pad-l: 2rem;

  /* size */
  --btn-l: 3rem; --btn-m: 2.5rem; --btn-s: 2rem; --btn-dock: 3.5rem;
  --input-h: 3.5rem;
  --touch: 44px;
  --icon: 1.5rem; --icon-s: 1rem;

  /* radius (mobile; desktop steps up below) */
  --r-s: 10px; --r-m: 16px; --r-l: 24px; --r-xl: 32px; --r-full: 999px;

  /* motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: 150ms; --dur: 250ms; --dur-slow: 400ms;
}
@media (min-width: 768px) { :root { --r-s: 16px; --r-m: 20px; --r-l: 30px; --r-xl: 40px; --gutter: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; } }

/* ============ 2 · Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-screen); color: var(--content-primary); font: var(--t-body-l); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
img, video, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--content-link); font-weight: 600; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-s); }
[hidden], .hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: var(--icon); height: var(--icon); flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.s { width: var(--icon-s); height: var(--icon-s); }

/* type roles */
.t-display { font: var(--t-display-l); letter-spacing: -.035em; }
.t-screen { font: var(--t-screen); letter-spacing: var(--track-tight); }
.t-section { font: var(--t-section); letter-spacing: var(--track-tight); }
.t-sub { font: var(--t-sub); letter-spacing: var(--track-tight); }
.t-body-title { font: var(--t-body-title); letter-spacing: -.01em; }
.t-group { font: var(--t-group); color: var(--content-secondary); }
.t-body { font: var(--t-body); color: var(--content-secondary); }
.t-lead { font: var(--t-body-l); color: var(--content-secondary); }
.muted { color: var(--content-secondary); }
.optional { font-weight: 400; color: var(--content-tertiary); }

/* ============ 3 · Layout ============ */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; height: 3.5rem; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg-screen) 88%, transparent); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); }
.appbar .logo { display: flex; align-items: center; color: var(--content-primary); }
.appbar .logo svg { height: 1.25rem; width: auto; }
.appbar .end { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.appbar .title { font: var(--t-body-l-bold); }
.private { display: inline-flex; align-items: center; gap: .375rem; height: 2rem; padding: 0 .75rem 0 .625rem; border-radius: var(--r-full); background: var(--bg-elevated); font: var(--t-body-bold); }
.private .ico { width: 1rem; height: 1rem; stroke-width: 2; }

.page { width: 100%; max-width: 35rem; margin: 0 auto; padding: .5rem var(--gutter) 6rem; display: grid; gap: var(--sp-between-cards); }
.page.wide { max-width: 64rem; }
.page-head { padding: var(--sp-component) .25rem var(--sp-component); display: grid; gap: var(--sp-between-text); }
.stack { display: grid; gap: var(--sp-component); }
.stack-s { display: grid; gap: var(--sp-between-text); }
.row { display: flex; align-items: center; gap: var(--sp-between-chips); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ============ 4 · Container card ============ */
.card { background: var(--bg-elevated); border-radius: var(--r-l); padding: var(--pad-m); display: grid; gap: var(--sp-component); min-width: 0; }
.card.tight { padding: var(--pad-s); }
.card.flush { padding: .5rem 0; gap: 0; }
.card > .card-head { display: grid; gap: var(--sp-between-text); }
.card.neutral { background: var(--bg-neutral); }
.card-link { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* ============ 5 · Buttons ============
   Heuristic (Wise): one Primary (accent) per screen for the main job. Secondary for the next most likely
   action. Secondary neutral for safe alternatives. Tertiary (text) for low-emphasis exits like "Skip".
   Large 48 = page actions (full width on phones). Medium 40 = inside cards. Small 32 = inside list items.
   Stacked: primary on top. Side by side: primary on the right. Destructive confirms use Negative. */
.btn { --h: var(--btn-l); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: var(--h); min-width: var(--h); padding: 0 1.5rem; border-radius: var(--r-full); border: 0;
  font: var(--t-body-l-bold); letter-spacing: 0; text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  background: var(--interactive-accent); color: var(--interactive-control);
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.btn:hover { background: var(--interactive-accent-hover); }
.btn:active { background: var(--interactive-accent-active); transform: scale(.98); }
.btn.md { --h: var(--btn-m); padding: 0 1rem; font: var(--t-body-bold); }
.btn.sm { --h: var(--btn-s); padding: 0 .875rem; font: var(--t-body-bold); }
.btn.sm::after { content: ""; position: absolute; inset: calc((var(--touch) - var(--btn-s)) / -2) 0; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: var(--interactive-secondary); color: var(--interactive-on-secondary); }
.btn.secondary:hover { background: var(--interactive-secondary-hover); }
.btn.neutral { background: var(--bg-neutral); color: var(--content-primary); }
.btn.neutral:hover { background: var(--bg-neutral-hover); }
.btn.tertiary { background: transparent; color: var(--content-primary); }
.btn.tertiary:hover { background: var(--bg-neutral); }
.btn.negative { background: var(--sentiment-negative); color: #fff; }
.btn.on-dark { background: #fff; color: var(--interactive-accent); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before { content: ""; position: absolute; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid var(--interactive-control); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.secondary.is-loading::before, .btn.neutral.is-loading::before, .btn.tertiary.is-loading::before { border-color: var(--interactive-primary); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .ico { width: 1.25rem; height: 1.25rem; }
.icon-btn { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: var(--r-full); background: var(--bg-neutral); color: var(--content-primary); flex: none; }
.icon-btn:hover { background: var(--bg-neutral-hover); }
.icon-btn.sm { width: 2rem; height: 2rem; }
.icon-btn.sm::after { content: ""; position: absolute; inset: -6px; }
.icon-btn.sm { position: relative; }
.icon-btn .ico { width: 1.25rem; height: 1.25rem; stroke-width: 2; }
.icon-btn.ghost { background: var(--bg-elevated); }
.btn-stack { display: grid; gap: var(--sp-between-text); }
.btn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-between-text); }
.link-btn { font: var(--t-body-bold); color: var(--content-link); text-decoration: underline; text-underline-offset: 3px; padding: .5rem 0; }

/* Docked footer: the step's main action, always reachable above the keyboard on phones */
.dock { position: sticky; bottom: 0; z-index: 20; margin: var(--sp-content-to-button) calc(-1 * var(--gutter)) -6rem; padding: var(--pad-s) var(--gutter) calc(var(--pad-s) + env(safe-area-inset-bottom));
  background: var(--bg-elevated); box-shadow: 0 -1px 0 var(--border-neutral); display: grid; gap: var(--sp-between-text); }
@media (min-width: 768px) { .dock { position: static; margin: var(--sp-content-to-button) 0 0; padding: 0; background: none; box-shadow: none; } }

/* ============ 6 · Inputs ============ */
.field { display: grid; gap: .5rem; min-width: 0; }
.field > label, .field > .lbl { font: var(--t-body-l-bold); }
.input, .field input:not([type="radio"]):not([type="checkbox"]):not([type="file"]), .field textarea, .field select {
  width: 100%; min-height: var(--input-h); padding: 0 1rem; border: 1px solid var(--border-input); border-radius: var(--r-s);
  background: var(--bg-elevated); font: var(--t-body-l); color: var(--content-primary); -webkit-appearance: none; appearance: none;
  transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.field textarea { padding: .875rem 1rem; min-height: 7rem; resize: vertical; line-height: 1.5rem; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--content-tertiary); }
.input:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--interactive-primary); box-shadow: inset 0 0 0 2px var(--interactive-primary); }
.field .help { font: var(--t-body); color: var(--content-secondary); }
.field.invalid input, .field.invalid textarea, .field.invalid .picker-field { border-color: var(--sentiment-negative); box-shadow: inset 0 0 0 1px var(--sentiment-negative); }
.msg-err { display: flex; gap: .5rem; align-items: flex-start; font: var(--t-body); color: var(--sentiment-negative); }
.msg-err:empty { display: none; }
.msg-err::before { content: "!"; flex: none; display: grid; place-items: center; width: 1.125rem; height: 1.125rem; margin-top: .125rem; border-radius: 50%; background: var(--sentiment-negative); color: #fff; font: 700 .75rem/1 var(--font); }
.count { font: var(--t-body); color: var(--content-tertiary); text-align: right; }

/* Read-only field that opens a picker (date, list) */
.picker-field { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; min-height: var(--input-h); padding: 0 1rem;
  border: 1px solid var(--border-input); border-radius: var(--r-s); background: var(--bg-elevated); font: var(--t-body-l); text-align: left; color: var(--content-primary); }
.picker-field .ph { color: var(--content-tertiary); }
.picker-field[aria-expanded="true"] { border-color: var(--interactive-primary); box-shadow: inset 0 0 0 2px var(--interactive-primary); }

/* Chips: one choice from a short set (feeling) */
/* checkbox row: an unticked choice, label to the right */
.check { display: flex; gap: .75rem; align-items: flex-start; font: var(--t-body); color: var(--content-primary); cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin: .125rem 0 0; accent-color: var(--interactive-primary); flex: none; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-between-chips); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: .375rem; height: 2.5rem; padding: 0 1rem; border-radius: var(--r-full);
  box-shadow: inset 0 0 0 1px var(--border-input); font: var(--t-body-bold); cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.chip span:hover { background: var(--bg-neutral); }
.chip input:checked + span { background: var(--interactive-primary); color: #fff; box-shadow: none; }
.chip input:focus-visible + span { box-shadow: var(--focus-ring); }

/* Segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: var(--r-full); background: var(--bg-neutral); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; height: 2.5rem; border-radius: var(--r-full); font: var(--t-body-bold); color: var(--content-secondary); cursor: pointer; }
.seg input:checked + span { background: var(--bg-elevated); color: var(--content-primary); box-shadow: 0 1px 3px rgba(11,11,12,.12); }

/* ============ 7 · List item ============ */
.list { display: grid; }
.list.boxed { background: var(--bg-elevated); border-radius: var(--r-l); padding: .5rem 0; }
.li { display: flex; align-items: center; gap: 1rem; width: 100%; min-height: 4.5rem; padding: .75rem 1rem; border-radius: var(--r-m);
  text-align: left; color: var(--content-primary); text-decoration: none; font-weight: 400; }
.list.boxed .li { border-radius: 0; padding-left: var(--pad-m); padding-right: var(--pad-m); }
button.li, a.li, label.li { cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
button.li:hover, a.li:hover, label.li:hover { background: var(--bg-neutral); }
.li .txt { flex: 1; min-width: 0; display: grid; gap: .25rem; }
.li .ttl { font: var(--t-body-l-bold); }
.li .dsc { font: var(--t-body); color: var(--content-secondary); }
.li .val { font: var(--t-body-l-bold); text-align: right; white-space: nowrap; }
.li .val small { display: block; font: var(--t-body); color: var(--content-secondary); }
.li .chev { width: 1.5rem; height: 1.5rem; color: var(--content-primary); flex: none; }
.li.locked .chev { display: none; }
.li .radio { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--border-input); display: grid; place-items: center; }
.li input:checked ~ .radio { box-shadow: inset 0 0 0 2px var(--interactive-primary); }
.li input:checked ~ .radio::after { content: ""; width: .75rem; height: .75rem; border-radius: 50%; background: var(--interactive-primary); }
.li input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.li:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.li .prompt { display: inline-flex; align-items: center; gap: .375rem; margin-top: .25rem; justify-self: start; padding: .25rem .5rem; border-radius: var(--r-s); font: var(--t-body); background: var(--bg-neutral); }
.li .prompt.positive { background: var(--sentiment-positive-surface); color: var(--sentiment-positive); }
.li.spot-empty { box-shadow: inset 0 0 0 1px var(--border-neutral); background: repeating-linear-gradient(0deg, transparent 0 0); border: 1px dashed var(--border-input); }
.list-title { padding: 0 var(--pad-m); margin: .5rem 0 .25rem; }

/* ============ 8 · Avatar ============ */
.av { --s: 3rem; flex: none; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--bg-neutral); color: var(--interactive-primary); font: 700 calc(var(--s) * .38)/1 var(--font); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.s40 { --s: 2.5rem; } .av.s56 { --s: 3.5rem; } .av.s72 { --s: 4.5rem; } .av.s96 { --s: 6rem; }
.av .ico { width: 50%; height: 50%; }
.av.accent { background: var(--interactive-accent); color: #fff; }

/* ============ 9 · Alerts and prompts ============ */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem; border-radius: var(--r-m); background: var(--bg-neutral); font: var(--t-body); color: var(--content-primary); }
.alert .ico { width: 1.25rem; height: 1.25rem; margin-top: .0625rem; }
.alert b { font-weight: 700; }
.alert.warning { background: var(--sentiment-warning-surface); }
.alert.positive { background: var(--sentiment-positive-surface); }
.alert.negative { background: var(--sentiment-negative-surface); }
.alert.negative .ico { color: var(--sentiment-negative); }
.alert.positive .ico { color: var(--sentiment-positive); }
.badge { display: inline-flex; align-items: center; gap: .375rem; height: 1.75rem; padding: 0 .625rem; border-radius: var(--r-full); font: var(--t-body-bold); background: var(--bg-neutral); color: var(--content-primary); white-space: nowrap; }
.badge.live { background: var(--sentiment-positive-surface); color: var(--sentiment-positive); }
.badge.live::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.badge.accent { background: var(--interactive-accent); color: #fff; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .badge.live::before { animation: none; } }

/* ============ 10 · Progress (setup steps) ============ */
.steps { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: .375rem; }
.steps li { display: grid; gap: .375rem; font: var(--t-body); color: var(--content-secondary); }
.steps li::before { content: ""; height: 4px; border-radius: var(--r-full); background: var(--bg-elevated); }
.steps li.done::before, .steps li.now::before { background: var(--interactive-accent); }
.steps li.now { color: var(--content-primary); font-weight: 700; }

/* ============ 11 · Bottom sheet (dialog) ============ */
.sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: min(92dvh, 100% - 2rem); margin: 0; padding: 0; border: 0;
  border-radius: var(--r-l) var(--r-l) 0 0; background: var(--bg-elevated); color: var(--content-primary); overflow: hidden; display: flex; flex-direction: column; }
.sheet:not([open]) { display: none; }
/* keyboard up (set by ui.js): sit on top of it, and never be taller than what's left */
.sheet.kb { translate: 0 calc(-1 * var(--kb, 0px)); max-height: calc(var(--vvh, 100dvh) - .5rem); transition: translate var(--dur) var(--ease); }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { animation: sheet-in var(--dur-slow) var(--ease); }
.sheet[open]::backdrop { animation: fade-in var(--dur) var(--ease); }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet .sh-top { display: flex; justify-content: flex-end; padding: var(--pad-s) var(--pad-s) 0; }
.sheet .sh-body { align-content: start; overflow-y: auto; overscroll-behavior: contain; padding: .25rem var(--pad-s) var(--pad-m); display: grid; gap: var(--sp-component); }
.sheet .sh-head { display: grid; gap: var(--sp-between-text); }
.sheet .sh-foot { padding: var(--pad-s) var(--pad-s) calc(var(--pad-s) + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--border-neutral); display: grid; gap: var(--sp-between-text); }
.sheet.full { height: 100dvh; max-height: 100dvh; border-radius: 0; }
.sheet.full .sh-body { flex: 1; }
@media (min-width: 768px) {
  .sheet { inset: 0; margin: auto; width: min(30rem, 100% - 3rem); max-height: min(85vh, 50rem); border-radius: var(--r-l); }
  .sheet.full { width: min(36rem, 100% - 3rem); height: auto; max-height: 88vh; border-radius: var(--r-l); }
  .sheet[open] { animation: pop-in var(--dur) var(--ease); }
  .sheet .sh-body { padding: .25rem var(--pad-m) var(--pad-m); }
  .sheet .sh-foot { padding: var(--pad-s) var(--pad-m) var(--pad-m); }
  @keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
}
body:has(dialog[open]) { overflow: hidden; }

/* ============ 12 · Date/time wheel ============ */
.wheel { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 12.5rem; }
.wheel::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2.5rem; margin-top: -1.25rem; border-radius: var(--r-s); background: var(--bg-neutral); pointer-events: none; }
.wheel .col { position: relative; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; padding: 5rem 0; text-align: center;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); }
.wheel .col::-webkit-scrollbar { display: none; }
.wheel .col:focus-visible { box-shadow: none; outline: 2px solid var(--interactive-primary); outline-offset: -2px; border-radius: var(--r-s); }
.wheel .opt { height: 2.5rem; display: grid; place-items: center; scroll-snap-align: center; font: var(--t-body-l); color: var(--content-secondary); white-space: nowrap; cursor: pointer; }
.wheel .opt.on { font-weight: 700; color: var(--content-primary); }
.wheel .col.wide { flex: 2; }
.wheel.cols-4 { grid-template-columns: 2.2fr 1fr 1fr 1fr; grid-auto-flow: row; }

/* ============ 13 · Upload rows ============ */
.files { display: grid; gap: .5rem; }
.files:empty { display: none; }
.files li { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; padding: .75rem 1rem; border-radius: var(--r-m); background: var(--bg-neutral); font: var(--t-body); }
.files .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .st { font-weight: 600; color: var(--content-secondary); }
.files .st.ok { color: var(--sentiment-positive); }
.files .st.err { color: var(--sentiment-negative); grid-column: 1 / -1; }
.files .meta { color: var(--content-secondary); }
.files .bar2 { grid-column: 1 / -1; height: 4px; border-radius: var(--r-full); background: var(--bg-elevated); overflow: hidden; }
.files .bar2 i { display: block; height: 100%; background: var(--interactive-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }

/* drop zone */
.drop { position: relative; display: grid; justify-items: center; gap: .5rem; padding: var(--pad-m); border-radius: var(--r-m); border: 1.5px dashed var(--border-input); text-align: center; cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.drop:hover, .drop.over { background: var(--bg-neutral); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .t-body { max-width: 22rem; }

/* ============ 14 · Toast ============ */
.toast { position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  padding: .75rem 1.25rem; border-radius: var(--r-full); background: var(--content-primary); color: #fff; font: var(--t-body-bold); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ============ 15 · Video player ============ */
.player { position: relative; border-radius: var(--r-m); overflow: hidden; background: #000; }
.player video { width: 100%; aspect-ratio: 16 / 9; background: #000; object-fit: contain; }
.player.portrait { max-width: 22rem; margin: 0 auto; }
.player.portrait video { aspect-ratio: 9 / 16; max-height: 72vh; }
.player .cast { position: absolute; top: .75rem; right: .75rem; z-index: 2; }

/* ============ 16 · Misc ============ */
.divider { height: 1px; background: var(--border-neutral); border: 0; margin: 0; }
.kv { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
.kv > * { display: grid; gap: .125rem; padding: 0 .75rem; text-align: center; }
.kv > * + * { box-shadow: -1px 0 0 var(--border-neutral); }
.kv b { font: var(--t-body-title); letter-spacing: -.01em; }
.kv span { font: var(--t-body); color: var(--content-secondary); }
.demo-banner { position: fixed; z-index: 90; left: 50%; bottom: 6rem; transform: translateX(-50%); padding: .375rem .75rem; border-radius: var(--r-full); background: var(--sentiment-warning); font: var(--t-body-bold); pointer-events: none; }
.foot { padding: 1.5rem var(--gutter) 2rem; text-align: center; font: var(--t-body); color: var(--content-secondary); }
.foot a { font-weight: 600; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; margin-top: .5rem; }
.confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; }

/* Negative secondary: destructive but not the main path. Red text on neutral, per Wise. */
.btn.secondary.negative { background: var(--sentiment-negative-surface); color: var(--sentiment-negative); }
.btn.secondary.negative:hover { background: #fadad6; }
.btn.secondary.negative.is-loading::before { border-color: var(--sentiment-negative); border-right-color: transparent; }

/* Policy pages: one card per section, Wise help-centre style */
.doc { max-width: 44rem; }
.doc .card { gap: .5rem; }
.doc .card p, .doc .card li { font: var(--t-body-l); color: var(--content-primary); }
.doc .card ul { display: grid; gap: .5rem; padding-left: 1.25rem; list-style: disc; }
.doc .card a { color: var(--content-link); }
.doc-tabs { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; }
.doc-tabs::-webkit-scrollbar { display: none; }
.doc-tabs a { flex: none; height: 2.5rem; display: inline-flex; align-items: center; padding: 0 1rem; border-radius: var(--r-full); background: var(--bg-elevated); font: var(--t-body-bold); color: var(--content-primary); text-decoration: none; }
.doc-tabs a[aria-current="page"] { background: var(--content-primary); color: var(--bg-elevated); }

/* Boxed lists clip their rows, so a hovered row follows the card's rounded corners. Focus ring goes inside. */
.list.boxed { overflow: hidden; }
.list.boxed .li:focus-visible { box-shadow: inset 0 0 0 2px var(--interactive-primary); }
/* No widowed words: balance headings, keep short last lines off body copy */
h1, h2, h3, .t-screen, .t-section, .t-sub, .t-body-title { text-wrap: balance; }
p, .help, .t-body, .t-lead, .dsc, li { text-wrap: pretty; }

/* Skeleton loaders: the page's shape while data arrives */
.sk-wrap { display: grid; gap: var(--sp-between-cards); }
.sk-card { display: grid; gap: .75rem; }
.sk-row { display: flex; gap: 1rem; align-items: center; }
.sk-col { flex: 1; display: grid; gap: .5rem; }
.sk { display: block; border-radius: var(--r-s); background: linear-gradient(90deg, var(--bg-neutral) 0%, #f4f7fe 50%, var(--bg-neutral) 100%) 0 0 / 200% 100%; animation: sk 1.4s ease-in-out infinite; }
.sk-av { width: 4.5rem; height: 4.5rem; border-radius: 50%; flex: none; }
.sk-av.s { width: 2.5rem; height: 2.5rem; }
.sk-line { height: .875rem; }
.sk-line.tall { height: 1.5rem; }
.sk-block { height: 4.5rem; border-radius: var(--r-m); }
.sk-btn { height: 3rem; border-radius: var(--r-full); }
.sk-photo { aspect-ratio: 16 / 9; border-radius: var(--r-m); }
.w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w70 { width: 70%; } .w90 { width: 90%; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
