/*
 * RivetCards marketing site — shared stylesheet for /, /privacy, /support and /terms.
 * Tokens mirror src/index.css (@theme) and ios/RivetCardsApp/DesignSystem/Theme.swift
 * (light + dark). System font stacks only: no web font downloads, CSP stays 'self'.
 * Direction: ink/paper monochrome; colour is a signal (rating tone marks, the coral rivet).
 */

:root {
  --paper: #f4f5fa;
  --surface: #ffffff;
  --sunken: #e9ebf3;
  --ink: #1a1f2e;
  --muted: #5b6278;
  --line: #d9dcea;
  --indigo: #4148c4;
  --indigo-soft: #e6e7fb;
  --coral: #e2533c;
  --coral-soft: #fde6e0;
  --coral-deep: #c03a26;
  --amber: #a86a06;
  --amber-soft: #fbefd6;
  --amber-deep: #8a5604;
  --green: #1d7f54;
  --green-soft: #dff2e8;
  --green-deep: #166443;

  /* Index-card stock for the demo (warm paper, as on the logo's front card). */
  --card-stock: #fffdf6;
  --card-rule: #e3e6f3;
  /* Atlas plate (occlusion diagram). */
  --plate: #fbfaf7;
  --plate-stroke: #1a1f2e;
  --plate-label-bg: #ffffff;
  --mask: #1a1f2e;
  --mask-text: #f4f5fa;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter,
    "Bitstream Charter", "Noto Serif", Georgia, ui-serif, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --wrap: 1180px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f131d;
    --surface: #181e2c;
    --sunken: #22293a;
    --ink: #f1f3f9;
    --muted: #9ba3b8;
    --line: #2d364d;
    --indigo: #6c74f2;
    --indigo-soft: #232852;
    --coral: #f06c56;
    --coral-soft: #42201b;
    --coral-deep: #f58775;
    --amber: #eab308;
    --amber-soft: #3d2c0b;
    --amber-deep: #facc15;
    --green: #34d399;
    --green-soft: #13392a;
    --green-deep: #6ee7b7;
    --card-stock: #1b2131;
    --card-rule: #262e42;
    --plate: #151a27;
    --plate-stroke: #e6e9f2;
    --plate-label-bg: #1b2131;
    --mask: #e6e9f2;
    --mask-text: #10141f;
    color-scheme: dark;
  }
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--font-sans);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
code, .mono { font-family: var(--font-mono); font-size: 0.88em; }
code { background: var(--sunken); padding: 0.08em 0.36em; border-radius: 5px; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--indigo-soft); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.serif { font-family: var(--font-display); }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: var(--radius);
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none;
  border: 1px solid transparent; white-space: nowrap; transition: background-color 150ms ease, border-color 150ms ease;
}
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--line)); }
.btn-sm { min-height: 44px; padding: 9px 16px; font-size: 14px; }
.btn[aria-disabled="true"] { cursor: default; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: none; align-items: center; gap: 4px; }
.site-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--sunken); }
@media (min-width: 900px) { .site-nav { display: flex; } }

/* ---------- hero ---------- */
.hero { padding: 40px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; }
@media (min-width: 1040px) {
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; align-items: center; }
}
.kicker { font-size: 15px; color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.rivet { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); flex: none; }
.hero h1 {
  margin-top: 18px; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.6rem, 6.4vw, 4.4rem); line-height: 1.02; letter-spacing: -0.022em;
}
.hero h1 em { font-style: italic; font-weight: 500; }
.hero .lede { margin-top: 22px; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 34em; }
.hero .lede strong { color: var(--ink); font-weight: 600; }
.cta-row { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta-note { margin-top: 14px; font-size: 14px; color: var(--muted); }
@media (max-width: 520px) { .cta-row .btn { width: 100%; } }

.facts { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.facts div { padding: 14px 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.facts div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.facts b { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 2px; }

/* ---------- demo (study desk) ---------- */
.try { min-width: 0; }
.try-label { display: flex; align-items: center; gap: 10px; margin: 0 0 14px 14px; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 19px; letter-spacing: -0.005em; }
.desk { position: relative; padding: 14px 0 0 14px; }
.desk::before, .desk::after {
  content: ""; position: absolute; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.desk::before { inset: 0 14px 28px 0; opacity: 0.55; }
.desk::after { inset: 7px 7px 21px 7px; opacity: 0.8; }
.demo {
  position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0;
}
.demo:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.demo-deck { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-deck small { font-weight: 400; color: var(--muted); }
.counts { display: inline-flex; gap: 10px; font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }
.counts span { display: inline-flex; align-items: center; gap: 5px; }
.counts i { width: 7px; height: 7px; border-radius: 2px; display: block; }
.counts .c-new i { background: var(--indigo); }
.counts .c-learn i { background: var(--coral); }
.counts .c-due i { background: var(--green); }
.counts .active { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.demo-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.index-card {
  position: relative; background: var(--card-stock); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 18px 16px; min-height: 280px; display: flex; flex-direction: column; gap: 14px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--card-rule) 31px, var(--card-rule) 32px);
  background-position: 0 17px;
}
.card-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); min-height: 30px; margin: -4px -18px 0; padding: 0 18px 10px; border-bottom: 1.5px solid color-mix(in srgb, var(--coral) 55%, transparent); }
.card-meta .tag { font-family: var(--font-mono); font-size: 11.5px; }
.card-face { font-family: var(--font-display); font-size: 21px; line-height: 1.5; color: var(--ink); }
.card-face .cloze-hidden {
  display: inline-block; padding: 0 0.45em; border-radius: 5px; background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line); font-family: var(--font-sans); font-size: 0.8em; font-weight: 600;
}
.card-face .cloze-revealed { display: inline-block; padding: 0 0.3em; border-radius: 5px; background: var(--green-soft); font-weight: 600; }
.card-back { padding-top: 12px; border-top: 1px dashed var(--line); font-size: 15px; line-height: 1.55; color: var(--ink); }
.card-back .src { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-style: italic; }

.mode-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.mode-seg button { white-space: nowrap; border: 0; background: none; min-height: 28px; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mode-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Atlas plate + occlusion masks */
.plate { position: relative; width: 100%; aspect-ratio: 800 / 520; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--plate); }
.plate svg { width: 100%; height: 100%; }
.plate .p-stroke { stroke: var(--plate-stroke); }
.plate .p-label rect { fill: var(--plate-label-bg); stroke: var(--plate-stroke); stroke-opacity: 0.35; }
.plate .p-label text { fill: var(--plate-stroke); font-family: var(--font-sans); font-weight: 700; font-size: 16px; }
.plate .p-caption { fill: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 14px; }
.plate .p-leader { stroke: var(--muted); }
.mask {
  position: absolute; border-radius: 6px; background: var(--mask); color: var(--mask-text);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  transition: opacity 180ms ease, background-color 180ms ease;
}
.mask.target { background: var(--coral); color: #fff; outline: 2px solid var(--coral); outline-offset: 2px; }
.mask.target.revealed { background: transparent; outline: 2px solid var(--coral); color: transparent; }
.mask.off { opacity: 0; }

.answer-row { display: flex; flex-direction: column; gap: 8px; }
.reveal-btn { width: 100%; }
.kbd { font-family: var(--font-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 1.6; background: var(--surface); }
.btn-ink .kbd { color: inherit; background: transparent; border-color: color-mix(in srgb, var(--paper) 40%, transparent); }

/* RatingScale (mirrors src/components/RatingScale.tsx) */
.rating { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rating button {
  position: relative; min-height: 60px; padding: 6px 4px 12px; border: 0; border-left: 1px solid var(--line); background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: background-color 150ms ease;
}
.rating button:first-child { border-left: 0; border-radius: 11px 0 0 11px; }
.rating button:last-child { border-radius: 0 11px 11px 0; }
.rating button::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 6px; height: 2px; border-radius: 2px; background: var(--tone); }
.rating button:hover { background: color-mix(in srgb, var(--tone-soft) 55%, transparent); }
.rating button:active { background: var(--tone-soft); }
.rating button:focus-visible { outline-offset: -3px; z-index: 1; }
.rating .r-label { font-size: 14px; font-weight: 600; line-height: 1.2; }
.rating .r-ivl { font-family: var(--font-mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rating .r-key { position: absolute; top: 5px; right: 7px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); display: none; }
@media (min-width: 640px) { .rating .r-key { display: block; } }
.tone-again { --tone: var(--coral); --tone-soft: var(--coral-soft); }
.tone-hard { --tone: var(--amber); --tone-soft: var(--amber-soft); }
.tone-good { --tone: var(--green); --tone-soft: var(--green-soft); }
.tone-easy { --tone: var(--indigo); --tone-soft: var(--indigo-soft); }

.demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); min-height: 48px; }
.link-btn { border: 0; background: none; padding: 0 6px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); border-radius: 6px; }
.link-btn:disabled { color: var(--muted); opacity: 0.6; cursor: default; }
.demo-status { min-width: 0; }

.done { padding: 8px 4px; display: flex; flex-direction: column; gap: 14px; }
.done h3 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.done dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.done dt { color: var(--muted); }
.done dd { margin: 0; font-weight: 600; }
.done ul { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.done li { padding-left: 14px; border-left: 2px solid var(--coral); }
.done .btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-caption { margin-top: 14px; padding-left: 14px; font-size: 13px; color: var(--muted); font-family: var(--font-display); font-style: italic; }

/* ---------- sections ---------- */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.section.alt { background: var(--surface); }
@media (min-width: 1040px) { .section { padding: 104px 0; } }
.fig { font-family: var(--font-display); font-style: italic; font-size: 15px; color: var(--muted); }
.section-head { max-width: 46rem; }
.section-head h2 { margin-top: 10px; font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.018em; }
.section-head p { margin-top: 16px; font-size: 17px; color: var(--muted); max-width: 40rem; }

.plates { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 860px) { .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plate-item { padding: 28px 0 36px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 860px) {
  .plate-item:nth-child(odd) { padding-right: 40px; border-right: 1px solid var(--line); }
  .plate-item:nth-child(even) { padding-left: 40px; }
}
.plate-item h3 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.plate-item p { color: var(--muted); font-size: 16px; }
.plate-item .where { font-size: 13px; color: var(--muted); }
.plate-item .where b { color: var(--ink); font-weight: 600; }

/* Finals Mode calculator */
.calc { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.section.alt .calc { background: var(--paper); }
.calc label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.calc .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.calc input[type="range"] { width: 100%; accent-color: var(--ink); min-height: 32px; }
.calc output { font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.calc .result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.calc .result div { font-size: 12.5px; color: var(--muted); line-height: 1.35; padding-right: 8px; }
.calc .result div + div { padding-left: 10px; border-left: 1px solid var(--line); }
.calc .result b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; align-items: end; height: 56px; }
.bars span { display: block; background: var(--ink); border-radius: 2px 2px 0 0; min-height: 2px; }
.bars span.exam { background: var(--coral); }
.bars-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }

/* Mini occlusion modes illustration */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.modes figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.modes figcaption { font-size: 12.5px; color: var(--muted); }
.modes figcaption b { color: var(--ink); }
.mini { position: relative; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 8px; background: var(--plate); overflow: hidden; }
.mini i { position: absolute; border-radius: 3px; background: var(--mask); }
.mini i.t { background: var(--coral); }
.mini i.ghost { background: transparent; border: 1px dashed color-mix(in srgb, var(--muted) 70%, transparent); }
.mini svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- switching / migration ledger ---------- */
.ledger { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 860px) { .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; } }
.ledger-col { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.ledger-col h3 { font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.ledger-col h3 .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ledger-col.in h3 .dot { background: var(--green); }
.ledger-col.out h3 .dot { background: var(--amber); }
.ledger-col ul { list-style: none; margin-top: 14px; display: flex; flex-direction: column; }
.ledger-col li { padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 4px 16px; }
.ledger-col li b { font-weight: 600; }
.ledger-col li span { color: var(--muted); }
@media (max-width: 560px) { .ledger-col li { grid-template-columns: minmax(0, 1fr); } }

/* ---------- data / formats table ---------- */
.data-grid { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 960px) { .data-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; } }
.promises { list-style: none; display: flex; flex-direction: column; }
.promises li { padding: 16px 0; border-top: 1px solid var(--line); }
.promises li:last-child { border-bottom: 1px solid var(--line); }
.promises b { display: block; font-weight: 650; font-size: 16px; }
.promises span { display: block; margin-top: 3px; color: var(--muted); font-size: 15px; }
.promises span.mono { display: inline; margin: 0; color: inherit; font-size: 0.88em; }
.formats-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; align-self: start; }
table.formats { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.formats caption { text-align: left; padding: 14px 16px; font-weight: 650; border-bottom: 1px solid var(--line); }
.formats th, .formats td { text-align: left; vertical-align: top; padding: 12px 16px; border-top: 1px solid var(--line); }
.formats thead th { border-top: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--paper); }
.formats tbody th { white-space: nowrap; font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; }
.formats .yes { color: var(--green-deep); font-weight: 600; }
.formats .no { color: var(--muted); }
/* Narrow screens: each format becomes its own stacked record, no horizontal scroll. */
@media (max-width: 640px) {
  table.formats, .formats caption, .formats tbody, .formats tr, .formats th, .formats td { display: block; }
  .formats thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .formats tbody tr { padding: 14px 16px; border-top: 1px solid var(--line); }
  .formats tbody tr:first-child { border-top: 0; }
  .formats tbody th { padding: 0 0 8px; border: 0; font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
  .formats td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; padding: 6px 0 0; border: 0; }
  .formats td::before { content: attr(data-label); font-size: 12.5px; font-weight: 600; color: var(--muted); padding-top: 1px; }
}

/* ---------- pricing (single iOS plan) ---------- */
.pricing { margin-top: 44px; max-width: 980px; border: 1px solid color-mix(in srgb, var(--ink) 70%, transparent); border-radius: var(--radius); background: var(--surface); }
.tiers { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .tiers { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); } }
.tier { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.tier p { color: var(--muted); font-size: 15.5px; max-width: 30rem; }
.tier p strong { color: var(--ink); font-weight: 600; }
.tier-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 15px; font-weight: 600; }
.tier.pro { background: color-mix(in srgb, var(--coral-soft) 45%, transparent); border-top: 1px solid var(--line); }
@media (min-width: 760px) { .tier.pro { border-top: 0; border-left: 1px solid var(--line); border-radius: 0 var(--radius) 0 0; } }
.tier-step { display: flex; align-items: center; justify-content: center; color: var(--coral-deep, var(--ink)); }
.tier-step svg { width: 26px; height: 26px; }
@media (max-width: 759px) { .tier-step { display: none; } }
.badge { font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; white-space: nowrap; background: var(--surface); }
.amount { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.amount b { font-family: var(--font-display); font-size: 54px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.amount span { color: var(--muted); font-size: 14px; }
.pricing-foot { border-top: 1px solid var(--line); padding: 22px 26px 26px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center; }
@media (min-width: 760px) { .pricing-foot { grid-template-columns: minmax(0, 1fr) auto; gap: 32px; } }
.ticks { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 24px; font-size: 15px; }
@media (min-width: 620px) { .ticks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ticks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
.ticks svg { width: 16px; height: 16px; margin-top: 4px; }
.pricing-foot .btn { width: 100%; }
@media (min-width: 760px) { .pricing-foot .btn { width: auto; } }
.fine { margin-top: 18px; font-size: 13.5px; color: var(--muted); max-width: 980px; }

/* ---------- FAQ ---------- */
.faq { margin-top: 40px; max-width: 860px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; min-height: 60px; padding: 16px 40px 16px 0; position: relative;
  font-weight: 600; font-size: 17px; display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 20px; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq .ans { padding: 0 0 20px; color: var(--muted); font-size: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 46rem; }
.faq .ans a { color: var(--ink); }

/* ---------- closing CTA ---------- */
.closer { padding: 80px 0; border-top: 1px solid var(--line); }
.closer .wrap { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.closer h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.04; letter-spacing: -0.02em; max-width: 18ch; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 40px 0 28px; font-size: 14px; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 860px) { .foot-grid { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); } }
.foot-grid h4 { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.foot-grid ul { list-style: none; display: flex; flex-direction: column; }
.foot-grid a { min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-tag { margin-top: 10px; font-family: var(--font-display); font-style: italic; font-size: 16px; color: var(--ink); }
.foot-legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.tech { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 0 16px; }
.tech summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--ink); }
.tech .tech-body { padding: 4px 0 14px; display: flex; flex-direction: column; gap: 8px; line-height: 1.6; }

/* ---------- document pages (privacy / support / terms) ---------- */
.doc { padding: 48px 0 80px; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 980px) { .doc-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; } }
.doc-toc { font-size: 14px; }
.doc-toc ol { list-style: none; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.doc-toc a { display: flex; min-height: 36px; align-items: center; padding-left: 14px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); }
.doc-toc a:hover { color: var(--ink); border-left-color: var(--ink); }
@media (min-width: 980px) { .doc-toc nav { position: sticky; top: 96px; } }
@media (max-width: 979px) { .doc-toc { display: none; } }
.doc-head h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.06; letter-spacing: -0.02em; }
.doc-head p { margin-top: 12px; color: var(--muted); font-size: 17px; max-width: 42rem; }
.doc-head .meta { margin-top: 14px; font-size: 13.5px; color: var(--muted); font-family: var(--font-mono); }
.summary-box { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px 22px; }
.summary-box h2 { font-size: 15px; font-weight: 650; }
.summary-box ul { margin-top: 10px; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15.5px; }
.summary-box li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
.summary-box svg { width: 16px; height: 16px; margin-top: 5px; }
.prose { max-width: 44rem; }
.prose section { padding-top: 36px; }
.prose h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.prose h3 { margin-top: 20px; font-size: 16px; font-weight: 650; }
.prose p, .prose ul, .prose ol { margin-top: 12px; font-size: 16.5px; line-height: 1.7; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose a { text-underline-offset: 3px; }
.prose .note { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); font-size: 15px; }
.contact-cards { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 720px) { .contact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.contact h2 { font-size: 15px; font-weight: 650; }
.contact p { color: var(--muted); font-size: 14.5px; }
.contact .addr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.contact .addr a { font-family: var(--font-mono); font-size: 15px; font-weight: 600; text-underline-offset: 3px; overflow-wrap: anywhere; }
.copy-btn { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; min-height: 44px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.diag { margin-top: 12px; font-family: var(--font-mono); font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.prose .faq { margin-top: 16px; }
.prose .faq summary { font-size: 16px; min-height: 54px; padding-top: 12px; padding-bottom: 12px; }
.prose .faq .ans p, .prose .faq .ans ul, .prose .faq .ans ol { margin-top: 0; font-size: 15.5px; }

/* 404 */
.lost { padding: 96px 0; }
.lost h1 { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 600; letter-spacing: -0.02em; }
.lost p { margin-top: 14px; color: var(--muted); font-size: 17px; }
.lost .cta-row { margin-top: 24px; }

/* iOS "coming soon" status note (replaced by a real App Store / TestFlight link when iosStatus allows).
   It is deliberately not styled as a button: in this state "Try a card" is the only action. */
.ios-soon { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; font-size: 14.5px; color: var(--muted); }
.ios-soon svg { width: 16px; height: 16px; flex: none; }
.cta-row .ios-soon { order: 2; }
.pricing-foot .ios-soon { justify-content: center; }
