/* Call Screener: calm, legible, phone-first. Atkinson Hyperlegible was designed for low-vision readability,
   which suits family members of all ages. Status colors carry meaning; everything else stays quiet. */
:root {
  --bg: #eef2f3;
  --surface: #ffffff;
  --ink: #17242e;
  --muted: #56646e;
  --line: #d3dce0;
  --accent: #0f6e74;
  --accent-ink: #ffffff;
  --go: #1e7b4f;
  --note: #2c5da8;
  --warn: #a35f10;
  --stop: #a33a3a;
  --quiet: #6b7780;
  --radius-s: 6px;
  --radius-m: 12px;
  --tabs-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e181d;
    --surface: #16232a;
    --ink: #e4ecef;
    --muted: #9aaab3;
    --line: #2a3a43;
    --accent: #4fb3b9;
    --accent-ink: #062126;
    --go: #5cc492;
    --note: #7ea6ec;
    --warn: #e0a556;
    --stop: #ec8a8a;
    --quiet: #8e9aa3;
  }
}

* { box-sizing: border-box; }
/* No accidental zoom in the Home Screen app: no double-tap zoom here, and the viewport's maximum-scale=1
   stops iOS zooming into a field on focus. (iOS still allows a deliberate pinch, for accessibility.) */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
body.has-tabs { padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
/* +14px below the safe area: iOS blurs a band under the status bar in Home Screen apps that otherwise covers the title. */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-top: calc(env(safe-area-inset-top) + 14px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 640px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
body.wide .top-inner, body.wide main { max-width: 960px; }
.top h1 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; flex: 1; font-variant-numeric: tabular-nums; }
.top-link { font-size: 15px; text-decoration: none; font-weight: 700; }
.back { display: grid; place-items: center; width: 36px; height: 36px; margin-left: -8px; border-radius: 50%; color: var(--ink); }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 640px; margin: 0 auto; padding: 16px 20px 24px; }
main > section, main > form > section { margin-top: 32px; }
main > :first-child, main > form:first-child > section:first-child { margin-top: 0; }
h2 { font-size: 18px; margin: 0 0 8px; line-height: 1.3; }
p { margin: 0 0 12px; }
.lede { font-size: 19px; line-height: 1.45; max-width: 34em; }
.hint { color: var(--muted); font-size: 15px; display: block; }
p.hint { margin-top: 6px; }

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; max-width: 160px; height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current='page'] { color: var(--accent); }

/* App shell for pages with tabs: the page itself never scrolls; only <main> does. iOS Home Screen apps
   misplace position:fixed bars during momentum scroll and after the keyboard closes, so the tab bar is a
   normal flex row at the bottom instead of a fixed element. */
body.has-tabs { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
body.has-tabs .top { position: static; flex: none; }
body.has-tabs main {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  width: 100%; max-width: none; margin: 0;
  padding: 16px max(20px, calc((100% - 600px) / 2)) 24px; /* same 600px content column as before */
}
body.has-tabs.wide main { padding-inline: max(20px, calc((100% - 920px) / 2)); }
body.has-tabs .tabs { position: static; flex: none; }
.balances { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.balances li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.balance-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
h2 .top-link { margin-left: 8px; font-size: 14px; }
.choice .hint + .hint { margin-top: 2px; }
.checklist { margin: 0 0 12px; padding-left: 20px; }
.checklist li { margin-bottom: 6px; }
details.explain { margin-top: 12px; }
details.explain summary { cursor: pointer; font-weight: 700; color: var(--accent); }
details.explain p { font-size: 15px; margin-top: 8px; }
.report-link { margin-top: 24px; }
.os-switch { margin: -4px 0 16px; }
button.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.os-pick .actions { margin-top: 8px; }
.top .help-link { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); text-decoration: none; font-weight: 700; font-size: 16px; flex: none; }
details.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq div { margin-top: 8px; }
details.faq p { margin: 0; }
main > p.version { margin-top: 48px; text-align: center; font-size: 13px; }

/* Pull to refresh (public/app.js): first child of <main>, grows as you pull. It must not change the spacing of
   whatever follows it, so the next element keeps its first-child margin. */
main > .ptr + * { margin-top: 0; }
.ptr { height: 0; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; color: var(--muted); font-size: 14px; font-weight: 700; }
.ptr span { padding-bottom: 10px; }
.ptr.ready { color: var(--accent); }

/* ---------- controls ---------- */
.btn, .btn-quiet, .btn-danger, .seg button {
  font: inherit; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: var(--radius-s);
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
}
.btn { background: var(--accent); color: var(--accent-ink); }
.btn-quiet { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-danger { background: transparent; color: var(--stop); border-color: color-mix(in srgb, var(--stop) 40%, transparent); }
.btn-wide { width: 100%; margin-top: 24px; }
.btn[disabled], .btn.is-disabled, .btn-quiet[disabled] { opacity: .45; pointer-events: none; }
.file-btn { position: relative; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.actions form { margin: 0; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { background: var(--surface); color: var(--ink); border-color: var(--line); flex: 1; min-width: 80px; min-height: 42px; padding: 8px 12px; white-space: nowrap; }

.stack { display: grid; gap: 18px; }
.narrow { max-width: 420px; }
.field { display: grid; gap: 6px; }
.field-label, legend { font-weight: 700; font-size: 15px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input:not([type]), textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius-s);
  padding: 11px 12px; width: 100%; min-height: 48px;
  font-size: max(16px, 1em); /* under 16px, iOS zooms the page when the field is tapped */
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.choices { display: grid; gap: 8px; }
.choices legend { margin-bottom: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.choice > span { display: grid; gap: 2px; }

.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 22px; height: 22px; margin-top: 2px; flex: none; }
.toggle-text { display: grid; gap: 2px; }

.inline-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.inline-add input { flex: 1 1 160px; }

/* ---------- notices ---------- */
.flash { background: color-mix(in srgb, var(--go) 12%, var(--surface)); border-left: 4px solid var(--go); padding: 10px 14px; border-radius: var(--radius-s); }
.flash-error { background: color-mix(in srgb, var(--stop) 12%, var(--surface)); border-left-color: var(--stop); }
.notice { display: block; background: var(--surface); border: 1.5px solid var(--line); padding: 14px 16px; border-radius: var(--radius-m); margin-bottom: 12px; color: var(--ink); text-decoration: none; }
.notice-action { border-color: var(--accent); font-weight: 700; color: var(--accent); }
.notice-warn { border-color: var(--warn); }

.expecting { background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius-m); padding: 14px 16px; margin-bottom: 20px; }
.expecting p { font-size: 15px; color: var(--muted); }
.expecting h2 { font-size: 16px; margin-bottom: 2px; }
.expecting.on { border-style: solid; border-color: var(--go); }
.expecting.on p { color: var(--ink); }

/* ---------- call log: the one bold element ---------- */
.calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.call {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 14px 16px 14px 18px; background: var(--surface); color: var(--ink); text-decoration: none;
  border-left: 6px solid var(--tone, var(--quiet));
}
.calls li:first-child .call { border-top-right-radius: var(--radius-m); }
.calls li:last-child .call { border-bottom-right-radius: var(--radius-m); }
.call-main { display: grid; gap: 2px; min-width: 0; }
.call-who { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.call-what { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-side { display: grid; justify-items: end; gap: 2px; flex: none; }
.call-verdict { font-weight: 700; font-size: 14px; color: var(--tone, var(--quiet)); }
.call-side time { color: var(--muted); font-size: 13px; }
.tone-go { --tone: var(--go); }
.tone-note { --tone: var(--note); }
.tone-warn { --tone: var(--warn); }
.tone-stop { --tone: var(--stop); }
.tone-quiet { --tone: var(--quiet); }

.chip { display: inline-block; font-weight: 700; font-size: 14px; color: var(--tone); border: 1.5px solid currentColor; border-radius: 999px; padding: 2px 10px; }

.empty { text-align: left; padding: 32px 4px; }
.empty p:first-child { font-size: 19px; font-weight: 700; }
.empty-inline { color: var(--muted); font-size: 15px; }

/* ---------- call detail ---------- */
.call-head { margin-top: 4px; }
.call-when { color: var(--muted); margin: 8px 0 4px; font-size: 15px; }
.call-summary { font-size: 20px; line-height: 1.4; font-weight: 700; }
.message { margin: 20px 0; background: var(--surface); border-left: 6px solid var(--note); border-radius: 0 var(--radius-m) var(--radius-m) 0; padding: 16px 18px; }
.message p { font-size: 18px; margin: 0; }
.message footer { color: var(--muted); font-size: 15px; margin-top: 10px; }
.message.urgent { border-left-color: var(--stop); }
.urgent-tag { display: inline-block; color: var(--stop); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.vm { margin-top: 20px; }
.vm .message { margin: 8px 0 12px; }
.player { margin: 8px 0; }
.player audio { width: 100%; }
.player.enhanced { display: flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.player-toggle { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.player-toggle svg { width: 18px; height: 18px; }
.player-seek { flex: 1; min-width: 0; margin: 0; accent-color: var(--accent); }
.player-route { flex: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px; min-height: 32px; cursor: pointer; }
.player.enhanced { padding-right: 8px; }
.player-delete { margin: -2px 0 8px; text-align: right; font-size: 14px; }
.player-time { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.transcript { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.transcript li { max-width: 85%; padding: 10px 14px; border-radius: var(--radius-m); background: var(--surface); font-size: 16px; }
.transcript .who { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.transcript .caller { justify-self: end; background: color-mix(in srgb, var(--note) 14%, var(--surface)); border-bottom-right-radius: 3px; }
.transcript .assistant { border-bottom-left-radius: 3px; }
.reasons { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.feedback .seg { max-width: 280px; }

/* ---------- lists ---------- */
.entries { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius-m); }
.entries li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.entries li:first-child { border-top: 0; }
.entries li > span { display: grid; font-variant-numeric: tabular-nums; }
.entries form { margin: 0; }
.entries .btn-quiet { min-height: 38px; padding: 6px 12px; font-size: 15px; }

/* ---------- setup wizard ---------- */
.steps { list-style: none; padding: 0; margin: 24px 0 0; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding-bottom: 28px; position: relative; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: var(--line); }
.step-mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line); background: var(--surface); color: var(--muted); }
.step.done .step-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step.done .step-mark { font-size: 0; }
.step.done .step-mark::after { content: '✓'; font-size: 18px; }
.step.disabled .step-body { opacity: .55; }
.step h2 { display: flex; gap: 10px; align-items: baseline; margin-top: 5px; }
.step-state { font-size: 14px; color: var(--accent); font-weight: 700; }
.code-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.dial-code { font-size: 24px; font-weight: 700; letter-spacing: .04em; background: var(--surface); border: 1.5px solid var(--line); padding: 8px 14px; border-radius: var(--radius-s); font-variant-numeric: tabular-nums; user-select: all; }
code { font-family: inherit; font-weight: 700; }

/* ---------- budget meter ---------- */
.meter { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter-high span { background: var(--warn); }
.meter-full span { background: var(--stop); }

/* ---------- admin ---------- */
.people { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.person { display: grid; gap: 10px; background: var(--surface); border-radius: var(--radius-m); padding: 14px 16px; text-decoration: none; color: var(--ink); border: 1.5px solid transparent; }
.person:hover { border-color: var(--line); }
.person-who { display: grid; }
.person-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.person-spend .meter { margin-top: 0; }
@media (min-width: 760px) {
  .person { grid-template-columns: 1.2fr 2fr 1fr; align-items: center; }
}
.facts { list-style: none; padding: 0; margin: 8px 0 12px; background: var(--surface); border-radius: var(--radius-m); }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.facts li:first-child { border-top: 0; }
.facts span { color: var(--muted); }
.facts strong { text-align: right; }

.auth { margin-top: 24px; }

@media (prefers-reduced-motion: no-preference) {
  .flash { animation: flash-in .25s ease-out; }
  @keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }
}

/* ---------- admin: health & analytics ---------- */
/* Chart series: validated categorical palette (dataviz reference slots 1-4), stepped separately for dark. */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; }
@media (prefers-color-scheme: dark) { :root { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; } }

.health-status { margin-bottom: 8px; }
.issues { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.issues li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1.5px solid var(--tone); border-radius: var(--radius-m); padding: 12px 14px; }
.issues li .chip { flex: none; }
.issues p { margin: 4px 0 0; white-space: pre-line; }
.all-clear { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin: 0 0 8px; }

.period-seg { margin: 16px 0; }
.period-seg a { flex: 1; min-width: 72px; min-height: 42px; display: flex; align-items: center; justify-content: center; padding: 8px 6px; white-space: nowrap; font-size: 15px; border: 1.5px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; }
.period-seg a[aria-current] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.tiles li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tiles .tile-warn { border-color: var(--warn); }
.tile-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile-label { color: var(--muted); font-size: 15px; }

.legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.s1 { background: var(--series-1); } .s2 { background: var(--series-2); } .s3 { background: var(--series-3); } .s4 { background: var(--series-4); }

.chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 14px 8px 40px; }
.chart-plot { position: relative; height: 200px; }
.chart-grid, .chart-base { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.chart-base { bottom: 0; border-top-style: solid; }
.chart-grid span, .chart-base span { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-bars { position: absolute; inset: 0; display: flex; gap: 2px; align-items: flex-end; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; cursor: default; border-radius: 4px 4px 0 0; }
.bar:hover, .bar:focus-visible { background: color-mix(in srgb, var(--ink) 6%, transparent); outline: none; }
.bar-stack { width: 100%; max-width: 28px; margin: 0 auto; display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.bar-stack span { display: block; min-height: 2px; }
.chart-x { display: flex; gap: 2px; margin-top: 6px; }
.chart-x span { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: visible; }

.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 14px; line-height: 1.4; padding: 8px 10px; border-radius: var(--radius-s); white-space: pre-line; max-width: 240px; box-shadow: 0 4px 14px rgb(0 0 0 / 0.2); }

.table-view { margin-top: 10px; }
.table-view summary { cursor: pointer; color: var(--accent); font-weight: 700; }
.table-scroll { overflow-x: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.table-scroll table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.table-scroll th, .table-scroll td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-scroll thead th { color: var(--muted); font-weight: 700; font-size: 14px; }
.table-scroll tbody tr:last-child > * { border-bottom: 0; }
.table-scroll td.detail { white-space: normal; min-width: 220px; color: var(--muted); }
.problem-counts { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.health-status .test-alert { margin: 0 0 4px; }

/* ---------- onboarding wizard ---------- */
.wizard { display: flex; flex-direction: column; gap: 4px; min-height: calc(100dvh - 140px); }
.wizard-progress { display: grid; gap: 4px; margin-bottom: 8px; }
.wizard-progress .meter { margin: 0; height: 6px; }
.wizard-title { font-size: 26px; line-height: 1.2; margin: 8px 0 8px; }
.wizard .step-body, .wizard [data-wizard-step] { flex: 1; }
.wizard [data-wizard-step] { flex: 1; }
.wizard-choices { display: grid; gap: 12px; margin-top: 16px; }
.wizard-choices .btn { min-height: 56px; font-size: 19px; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 24px; }
.wizard-nav form { margin: 0; }
.wizard .mark-done { margin: 0; }
.wizard .os-switch { margin: 20px 0 0; }
.code-input { font-size: 28px; letter-spacing: .2em; font-variant-numeric: tabular-nums; text-align: center; }
@media (max-width: 440px) { .dial-code { font-size: 19px; padding: 8px 10px; letter-spacing: .02em; } }

/* Install how-to: Safari's own buttons, drawn as small keycaps so people can match them on screen. */
.install-steps { padding-left: 22px; margin: 4px 0 12px; display: grid; gap: 10px; }
.ui-key { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 700; white-space: nowrap; line-height: 1.5; }
.ui-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Terms of Service and Privacy Policy pages, and the agree screen before setup. */
.legal { max-width: 40em; line-height: 1.55; }
.legal h2 { font-size: 20px; margin: 32px 0 8px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul, .accept-points { padding-left: 1.25em; }
.legal li { margin: 6px 0; }
.accept-points { display: grid; gap: 10px; margin: 8px 0 16px; line-height: 1.45; }
.legal-links { text-align: center; }

/* Health page: server disk, memory, and CPU. */
.resources { display: grid; gap: 10px; }
.resource { display: grid; grid-template-columns: 5.5em 1fr; align-items: center; gap: 2px 12px; }
.resource .meter { margin: 0; }
.resource .hint { grid-column: 2; font-size: 13px; }
