/* MusicStudio — STRUCTURE and COMPONENTS. Layout and states only: every colour, font, size, radius and
 * shadow is a var() from tokens.css (test/pwa.test.mjs enforces it). A design restyles by replacing
 * tokens.css; the class names below are the contract the views render (surface map:
 * TheForge Projects/MusicStudio/design/04-surface-map.md).
 *
 * The shell is rows — bar · main (the one scroller) · demo strip · tabs — so nothing can ever hide under a
 * bar, whatever the text size. No vh units: the height chain is html → body → #app at 100%. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: var(--fw-normal) var(--fs-md) / var(--lh) var(--font-body);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overflow: hidden; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
p, .lead, .section-title, .banner .grow, .srow-meta, .ob-opt .grow > span { text-wrap: pretty; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--info); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { height: 100%; display: flex; flex-direction: column; }
.boot { margin: auto; color: var(--ink-3); font-size: var(--fs-sm); }

/* ── top bar (frame) ─────────────────────────────────────────────────────────────────────────────────── */
.bar { flex: none; position: relative; z-index: 3; min-height: var(--bar-h); display: grid; grid-template-columns: calc(2 * var(--tap)) 1fr calc(2 * var(--tap)); align-items: center;
  gap: var(--space-1); padding: calc(2px + env(safe-area-inset-top)) 6px 2px; background: var(--frame); box-shadow: var(--edge-below); }
.bar > div:first-child { display: flex; justify-content: flex-start; }
.bar > div:last-child { display: flex; justify-content: flex-end; }
.bar-title { text-align: center; min-width: 0; line-height: 1.15; }
.bar-title h1 { margin: 0; font: var(--fw-bold) var(--fs-lg) / 1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title .sub { color: var(--ink-2); font-size: var(--fs-xs); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border: 0; background: none; border-radius: var(--radius-pill); color: var(--ink); padding: 0; text-decoration: none; }
.icon-btn:active { background: var(--surface-3); }
.icon-btn svg, .btn svg, .act svg { width: 22px; height: 22px; }

/* ── the one scroller ────────────────────────────────────────────────────────────────────────────────── */
.main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; position: relative; }
.page { max-width: var(--content-max); margin: 0 auto; padding: var(--space-3) var(--gutter) calc(var(--space-6) + 40px); }

/* ── bottom tabs (frame) ─────────────────────────────────────────────────────────────────────────────── */
.tabs { flex: none; position: relative; z-index: 3; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-height: var(--tabs-h); background: var(--frame);
  box-shadow: var(--edge-above); padding-bottom: env(safe-area-inset-bottom); }
.tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); text-decoration: none; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); font-weight: var(--fw-bold); }

/* ── the demo strip: a row of the shell, never over content ──────────────────────────────────────────── */
.demo-strip { flex: none; display: flex; align-items: center; justify-content: center; gap: 2px; min-height: var(--demo-h); padding: 0 var(--space-2);
  background: var(--demo-bg); color: var(--ink-3); font-size: var(--fs-xs); overflow-x: auto; scrollbar-width: none; }
.no-tabs .demo-strip { padding-bottom: env(safe-area-inset-bottom); }
.demo-strip .lbl { flex: none; padding-right: 4px; }
.demo-pill { flex: none; border: 0; background: none; color: var(--ink-3); font-size: var(--fs-xs); padding: 0 8px; min-height: var(--tap); border-radius: var(--radius-pill); }
.demo-pill[aria-pressed="true"] { color: var(--ink); font-weight: var(--fw-bold); }

/* ── shared blocks ───────────────────────────────────────────────────────────────────────────────────── */
.section-title { margin: var(--space-5) 0 var(--space-2); font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--ink-2); display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.section-title:first-child { margin-top: var(--space-2); }
.section-title .act-link { font-weight: var(--fw-medium); }
.card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.card + .card { margin-top: var(--space-3); }
.card-pad { padding: var(--space-3) var(--space-4); }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.strong { font-weight: var(--fw-bold); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.money { white-space: nowrap; }
.empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--ink-3); }
.stack > * + * { margin-top: var(--space-3); }
.row-split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.gap-top { margin-top: var(--space-3); }
.act-link { min-width: var(--tap); border: 0; background: none; padding: 0 var(--space-1); min-height: var(--tap); color: var(--ink); font-weight: var(--fw-semi); font-size: var(--fs-sm); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

/* banners: porcelain, a small silver ring holding a glyph in its state colour */
.banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-3); border-radius: var(--radius-md); margin-bottom: var(--space-3);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); text-decoration: none; }
.banner .grow { flex: 1; min-width: 0; }
.banner-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--metal-ring-soft); box-shadow: var(--key-shadow-sm); position: relative; color: var(--ink-2); }
.banner-ic::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.banner-ic svg { position: relative; width: 16px; height: 16px; }
.banner.info .banner-ic, .banner.offline .banner-ic { color: var(--info); }
.banner.warn .banner-ic { color: var(--warn); }
.banner.danger .banner-ic { color: var(--danger); }
.banner.ok .banner-ic { color: var(--done-ink); }
.banner.danger { background: var(--danger-soft); }
.banner > svg { flex: none; width: 18px; height: 18px; color: var(--ink-3); }

/* badges: small words */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semi);
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--done-soft); color: var(--done-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--ink); }

/* chips: pills; picked = ink */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll::after { content: ""; flex: 0 0 var(--space-2); }
.chip { position: relative; min-width: var(--tap); justify-content: center; flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface); box-shadow: var(--ring-hair); color: var(--ink);
  border-radius: var(--radius-pill); padding: 0 14px; font-size: var(--fs-sm); font-weight: var(--fw-medium); min-height: var(--tap); text-decoration: none; white-space: nowrap; }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--sel-bg); color: var(--sel-ink); box-shadow: var(--sel-ring); font-weight: var(--fw-semi); }
.chip input { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.chips.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.chips.days .chip { padding: 0; min-width: 0; }
.chip.big { min-height: 52px; padding: 0 18px; font-size: var(--fs-md); font-weight: var(--fw-semi); }
.chip.quiet { background: none; box-shadow: none; color: var(--ink-2); padding: 0 10px; }
.chip .n { color: inherit; opacity: .75; font-weight: var(--fw-normal); }
.chip.face { padding-left: 4px; }
.chip.face .avatar { width: 34px; height: 34px; font-size: var(--fs-xs); }
.chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* avatars: an <img> laid over initials, so a missing photo shows initials with no flash */
.avatar { position: relative; flex: none; width: var(--row-avatar); height: var(--row-avatar); border-radius: 50%; overflow: hidden; background: var(--avatar-bg);
  color: var(--avatar-ink); display: grid; place-items: center; font-weight: var(--fw-semi); font-size: var(--fs-sm); box-shadow: var(--avatar-ring); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: var(--hero-avatar); height: var(--hero-avatar); font-size: var(--fs-xxl); border-radius: var(--radius-lg); }
.avatar.sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar.xs { width: 26px; height: 26px; font-size: 10px; }
/* a class: its members' faces, stacked */
.faces { position: relative; flex: none; width: var(--row-avatar); height: var(--row-avatar); }
.faces .avatar { position: absolute; width: 30px; height: 30px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
.faces .avatar:nth-child(1) { left: 0; top: 0; }
.faces .avatar:nth-child(2) { right: 0; top: 4px; }
.faces .avatar:nth-child(3) { left: 9px; bottom: 0; }
.faces.sm { width: 34px; height: 34px; }
.faces.sm .avatar { width: 22px; height: 22px; font-size: 9px; }
.faces.sm .avatar:nth-child(3) { left: 6px; }

/* buttons */
.btn { white-space: nowrap; min-width: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--tap); padding: 0 var(--space-4); border-radius: var(--radius-sm);
  border: 0; box-shadow: var(--ring-hair); background: var(--surface); color: var(--ink); font-weight: var(--fw-semi); text-decoration: none; text-align: center; }
.btn:active { background: var(--surface-3); transform: translateY(1px); }
.btn.primary { background: var(--primary-bg); color: var(--primary-ink); box-shadow: none; }
.btn.primary:active { background: var(--primary-pressed); }
.btn.danger { color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); background: var(--surface); }
.btn.quiet { box-shadow: none; background: none; color: var(--ink-2); }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: var(--tap); padding: 0 var(--space-3); font-size: var(--fs-sm); }
.btn[disabled], .btn.is-pending { opacity: .55; pointer-events: none; }
.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }
.btn-row.end { justify-content: flex-end; }
.btn-row.end > .btn { flex: none; }

/* ── THE KEY: a soft-white face set in a gold ring. Go, and every check. Ticked = baby blue + a big tick ── */
.key { position: relative; flex: none; width: var(--key); height: var(--key); padding: 0; border: 0; border-radius: 50%; background: var(--metal-ring); box-shadow: var(--key-shadow);
  color: var(--go-ink); display: grid; place-items: center; transition: transform .09s ease-out; }
.key-face { position: absolute; inset: 4.5px; border-radius: 50%; background: var(--key-face); box-shadow: var(--face-inset); display: grid; place-items: center; transition: box-shadow .09s, background .2s; }
.key .go-label { position: relative; font-weight: var(--fw-bold); font-size: var(--fs-name); letter-spacing: .01em; }
.tick { display: none; width: var(--tick-w); height: var(--tick-h); fill: none; stroke: var(--tick); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; position: relative; }
.key:active, .key.is-pending { transform: scale(.955); }
.key:active .key-face, .key.is-pending .key-face { box-shadow: var(--face-inset-pressed); }
.key.done .key-face { background: var(--done-face); box-shadow: var(--face-inset-done); }
.key.done .go-label { display: none; }
.key.done .tick { display: block; }
.key.just .tick path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .38s .05s cubic-bezier(.3, .6, .4, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
/* the check key: the same key at 40 px around a real checkbox */
.check { position: relative; flex: none; width: var(--check-key); height: var(--check-key); min-height: 0; aspect-ratio: 1; align-self: center; border-radius: 50%; background: var(--metal-ring); box-shadow: var(--key-shadow-sm); display: inline-grid; place-items: center; cursor: pointer; }
.check input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.check .key-face { inset: 3.5px; }
.check .tick { width: 24px; height: 19px; stroke-width: 3.2; }
.check input:checked + .key-face { background: var(--done-face); box-shadow: var(--face-inset-done); }
.check input:checked + .key-face .tick { display: block; }
.check.ink input:checked + .key-face { background: var(--done-face); box-shadow: var(--face-inset-done); }
.check:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.check-hit { display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap); }
/* the small key: a state mark on a calendar card (not pressable) */
.mini-key { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--metal-ring-soft); box-shadow: var(--key-shadow-sm); }
.mini-key::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--key-face); box-shadow: var(--face-inset); }
.mini-key.done::before { background: var(--done-face); box-shadow: var(--face-inset-done); }
.mini-key .tick { display: none; position: absolute; left: 6px; top: 8px; width: 20px; height: 16px; stroke-width: 3; }
.mini-key.done .tick { display: block; }
.mini-key.off { background: none; box-shadow: inset 0 0 0 1.5px var(--ring-dash); }
.mini-key.off::before { display: none; }

/* ── students list (the teacher's home) ──────────────────────────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.keys { position: relative; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); background: var(--surface); box-shadow: 0 1px 0 var(--line), 0 -1px 0 var(--line); }
.keys::before { content: ""; position: absolute; top: 0; bottom: 0; right: calc(var(--gutter) + var(--key) / 2 - 2px); width: 4px; background: var(--metal-rod); box-shadow: var(--rod-shadow); pointer-events: none; }
.keys.selecting::before { display: none; }
.srow { position: relative; display: flex; align-items: center; gap: var(--space-3); padding: 6px 0; min-height: 70px; }
.srow + .srow::before { content: ""; position: absolute; top: 0; left: calc(var(--row-avatar) + var(--space-3)); right: calc(var(--key) + var(--space-2)); height: 1px; background: var(--line); }
.srow-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); border: 0; background: none; padding: var(--space-1) 0; text-align: left;
  color: inherit; text-decoration: none; min-height: 56px; }
.srow-text { min-width: 0; flex: 1; }
.srow-name, .srow-meta, .srow-done { display: block; }
.srow-name { font-weight: var(--fw-semi); font-size: var(--fs-name); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow-meta { color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.srow-meta .is-today { color: var(--ink); font-weight: var(--fw-bold); }
.srow-done { color: var(--done-ink); font-size: var(--fs-sm); font-weight: var(--fw-semi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.srow-wait { color: var(--info); font-size: var(--fs-xs); font-weight: var(--fw-semi); display: block; }
.srow .key, .srow .check-hit { position: relative; z-index: 1; }
.srow .check-hit { width: var(--key); }
a.tl, a.kv, a.inv-open { color: inherit; text-decoration: none; }
/* Go outside a row (profile, add, onboarding): the same key language, as a wide bar */
.go { flex: none; }
.go.xl { position: relative; width: 100%; height: 56px; border: 0; border-radius: var(--radius-pill); background: var(--metal-ring); box-shadow: var(--key-shadow); padding: 0;
  font-weight: var(--fw-bold); font-size: var(--fs-lg); color: var(--go-ink); display: grid; place-items: center; transition: transform .09s ease-out; }
.go.xl::before { content: ""; position: absolute; inset: 4px; border-radius: var(--radius-pill); background: var(--key-face); box-shadow: var(--face-inset); }
.go.xl .lbl { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; }
.go.xl:active, .go.xl.is-pending { transform: scale(.98); }
.go.xl:active::before { box-shadow: var(--face-inset-pressed); }
.go.xl.done::before { background: var(--done-face); box-shadow: var(--face-inset-done); }
.go.xl.done { color: var(--tick); }
.go.xl .tick { display: inline-block; width: 24px; height: 19px; }

/* the list's tools: sort · select, and a picked group's header */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: var(--space-1) 0; }
.list-tools .act-link { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.list-tools .act-link svg { width: 16px; height: 16px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: var(--space-2) 0 var(--space-1); }
.group-head strong { font-size: var(--fs-md); }

/* the select-several bar: an overlay over the tab bar */
.selbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--demo-h) + env(safe-area-inset-bottom)); z-index: 30; padding: 0 var(--space-2) var(--space-2); display: flex; justify-content: center; pointer-events: none; }
.selbar-in { pointer-events: auto; width: 100%; max-width: 560px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-radius: var(--radius-md); background: var(--toast-bg); color: var(--toast-ink); box-shadow: var(--shadow-toast); }
.selbar-in .grow { flex: 1; min-width: 70px; font-weight: var(--fw-semi); }
.selbar-in .btn { background: var(--toast-btn-bg); color: var(--toast-ink); box-shadow: none; }
.selbar-in .btn[disabled] { opacity: .45; }

/* ── profile ─────────────────────────────────────────────────────────────────────────────────────────── */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1); padding: var(--space-2) 0 var(--space-2); }
.hero h2 { margin: var(--space-2) 0 0; font: var(--fw-bold) var(--fs-xxl) / 1.15 var(--font-display); }
.hero .sub { color: var(--ink-2); font-size: var(--fs-sm); }
.hero .chips { justify-content: center; margin-top: var(--space-1); }
.hero .chips .chip { min-height: 32px; padding: 0 12px; font-size: var(--fs-xs); }
.hero .chips button.chip { min-height: var(--tap); }
.hero-line { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-2); font-size: var(--fs-sm); min-height: var(--tap); padding: 0 var(--space-2); border-radius: var(--radius-sm); }
.hero-line svg { width: 16px; height: 16px; }
.hero-line:active { background: var(--surface-3); }
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) auto; max-width: 380px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink); text-decoration: none; font-size: var(--fs-xs); font-weight: var(--fw-medium); min-height: 72px; }
.act-ring { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--ring-hair), var(--shadow-1); }
.act-ring svg { position: relative; }
.act:active .act-ring { transform: scale(.955); }
.act.off { color: var(--ink-3); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: var(--radius-md); background: var(--surface-2); margin: var(--space-3) 0; }
.seg button, .seg a { border: 0; background: none; min-height: var(--tap); display: grid; place-items: center; padding: 0 4px; border-radius: calc(var(--radius-md) - 3px); color: var(--ink-2); font-size: var(--fs-sm);
  font-weight: var(--fw-medium); text-align: center; text-decoration: none; white-space: nowrap; }
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: var(--fw-semi); }
/* section tabs (profile, family): text tabs with an ink underline */
.seg.tabs-u { position: sticky; top: calc(-1 * var(--space-3)); z-index: 2; background: var(--bg); border-radius: 0; padding: 0; gap: 0; margin: var(--space-3) calc(-1 * var(--gutter)) 0;
  box-shadow: inset 0 -1px 0 var(--line); }
.seg.tabs-u a { border-radius: 0; min-height: var(--tap); position: relative; color: var(--ink-3); }
.seg.tabs-u a[aria-current="page"] { background: none; box-shadow: none; color: var(--ink); font-weight: var(--fw-bold); }
.seg.tabs-u a[aria-current="page"]::after { content: ""; position: absolute; left: 16%; right: 16%; bottom: 0; height: 3px; border-radius: 2px; background: var(--metal-bar); }
.swipe { touch-action: pan-y; min-height: 240px; padding-top: var(--space-2); }

/* timeline + entries */
.entry { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.entry dl { margin: var(--space-2) 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); font-size: var(--fs-sm); }
.entry dt { color: var(--ink-3); }
.entry dd { margin: 0; }
.tl { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 56px; padding: var(--space-2) 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: inherit; }
.tl .grow { flex: 1; min-width: 0; }
.tl .srow-name.wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.tl-icon svg { width: 18px; height: 18px; }
.tl-icon.pay { background: var(--done-soft); color: var(--done-ink); }

/* key/value rows (contact) */
.kv { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 48px; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-2); font-size: var(--fs-sm); }
.kv .v { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.kv .v a { display: inline-block; padding: 12px 0; }
.kv > span:first-child { min-width: 0; flex: 1; }
.kv > .v:last-child { flex: none; }
a.kv:active { background: var(--surface-3); }
button.kv { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.kv:last-child { border-bottom: 0; }
button.kv:active { background: var(--surface-3); }
button.kv svg { width: 20px; height: 20px; color: var(--ink-3); }

/* ── the calendar: an agenda, days stacked down the page (Sonic's Schedule-view example) ─────────────── */
.agenda { margin: 0 calc(-1 * var(--space-1)); }
.ag-month { margin: var(--space-5) 0 var(--space-2); padding-left: 56px; font: var(--fw-bold) var(--fs-xl) / 1.2 var(--font-display); }
.ag-month:first-child { margin-top: var(--space-2); }
.ag-week { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: var(--space-3) 0 var(--space-1); padding-left: 56px; color: var(--ink-2); font-size: var(--fs-sm); }
.ag-week.cancelled { color: var(--warn); font-weight: var(--fw-semi); }
.ag-day { display: grid; grid-template-columns: 48px 1fr; gap: var(--space-2); padding: var(--space-2) 0; }
.ag-date { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; }
.ag-date .wd { font-size: var(--fs-xs); color: var(--ink-2); font-weight: var(--fw-medium); }
.ag-date .dn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; font: var(--fw-semi) var(--fs-xl) / 1 var(--font-display); }
.ag-day.today .wd { color: var(--ink); font-weight: var(--fw-bold); }
.ag-day.today .dn { border-radius: 50%; background: var(--metal-ring); box-shadow: var(--key-shadow-sm); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.ag-day.today .dn::before { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--key-face); box-shadow: var(--face-inset); }
.ag-day.today .dn span { position: relative; }
.ag-items { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ag-none { color: var(--ink-3); font-size: var(--fs-sm); padding: 10px 0; }
.ag-now { position: relative; height: 2px; margin: 2px 0; background: var(--accent); border-radius: 1px; }
.ag-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--metal-ring); box-shadow: var(--key-shadow-sm); }
.ag-card { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 56px; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-1); text-align: left; color: inherit; text-decoration: none; }
.ag-card:active { background: var(--surface-3); }
.ag-card .grow { flex: 1; min-width: 0; }
.ag-card .nm { display: block; font-weight: var(--fw-semi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-card .tm { display: block; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-card.taught .tm { color: var(--done-ink); font-weight: var(--fw-medium); }
.ag-card.missed .tm { color: var(--warn); font-weight: var(--fw-medium); }
.ag-card.cancelled { background: none; box-shadow: inset 0 0 0 1px var(--ring-dash); }
.ag-card.cancelled .nm { text-decoration: line-through; color: var(--ink-2); font-weight: var(--fw-medium); }
.ag-card.cancelled .avatar, .ag-card.cancelled .faces { opacity: .55; }
.ag-more { display: flex; justify-content: center; margin: var(--space-3) 0; }

/* the weekly slot card (a student's Schedule tab) */
.slot { display: flex; align-items: center; gap: var(--space-3); }
.slot .grow { flex: 1; min-width: 0; }
.slot-big { font: var(--fw-bold) var(--fs-lg) / 1.2 var(--font-display); }

/* ── the lesson page ─────────────────────────────────────────────────────────────────────────────────── */
.lesson-head { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) 0 var(--space-3); }
.lesson-head .grow { flex: 1; min-width: 0; }
.lesson-head h2 { margin: 0; font: var(--fw-bold) var(--fs-xl) / 1.2 var(--font-display); }
.lens { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: var(--space-2); }
.len { min-width: 60px; min-height: 52px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--ring-hair); font-size: var(--fs-lg); font-weight: var(--fw-semi);
  display: inline-grid; place-items: center; position: relative; cursor: pointer; }
.len small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: inherit; opacity: .8; display: block; margin-top: -4px; }
.len[aria-pressed="true"], .len:has(input:checked) { background: var(--sel-bg); color: var(--sel-ink); box-shadow: var(--sel-ring); }
.len input { position: absolute; left: 0; top: 0; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.len:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: var(--space-2); }
.stepper .input { width: 96px; text-align: center; font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.stepper .btn { width: 52px; min-height: 52px; font-size: var(--fs-xl); padding: 0; }
.upload { display: flex; align-items: center; justify-content: center; gap: var(--space-2); width: 100%; min-height: 52px; border-radius: var(--radius-md); border: 1.5px dashed var(--ring-dash);
  background: var(--surface); color: var(--ink); font-weight: var(--fw-semi); cursor: pointer; }
.upload svg { width: 20px; height: 20px; }
.upload:active { background: var(--surface-3); }

/* ── reports ─────────────────────────────────────────────────────────────────────────────────────────── */
.fam-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); border-bottom: 1px solid var(--line); }
.line { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 52px; padding: var(--space-2) var(--space-4); border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); color: inherit; }
.line:last-child { border-bottom: 0; }
.line .grow { flex: 1; min-width: 0; }
.line svg { width: 16px; height: 16px; }
/* round 6 N6: Unbilled's Select all · Approve & send stay at the bottom while she scrolls — fixed above the tabs, as the select bar */
.sendbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--demo-h) + env(safe-area-inset-bottom)); z-index: 30; padding: var(--space-2) var(--gutter); background: var(--bg); box-shadow: var(--edge-above); }
.sendbar .btn-row { max-width: var(--content-max); margin: 0 auto; flex-wrap: nowrap; }
.sendbar .btn { flex: 1 1 auto; }
.sendbar .btn.primary { flex-grow: 2; }
.page:has(.sendbar) { padding-bottom: calc(var(--space-6) + 40px + 72px); }
.inv { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.inv:last-child { border-bottom: 0; }
.inv-open { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: var(--space-1) 0; min-height: var(--tap); color: inherit; }
.period { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.period:last-child { border-bottom: 0; }
.period .grow { flex: 1; min-width: 0; }
.fam-head .check-hit { flex: none; display: inline-grid; min-width: var(--tap); }
.fam-head .check input[type=checkbox] { width: 100%; height: 100%; }
.fam-head .grow { flex: 1; min-width: 0; }
/* long names ellipsize on a 360-px phone, line by line (a <br> still breaks under nowrap) */
.fam-head .grow, .period .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.period .act-link { flex: none; }
/* a late fee wherever it shows: a review card's charge row, a period's extra, an invoice line (was `.inv .fee` only) */
.fee { color: var(--warn); font-weight: var(--fw-semi); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.tile { padding: var(--space-3) var(--space-4); }
.tile .n { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.tiles > .card + .card { margin-top: 0; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: var(--space-2); height: 120px; padding: var(--space-3) var(--space-4) var(--space-2); }
.bars .b { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: var(--fs-xs); color: var(--ink-2); }
.bars .fill { width: 100%; max-width: 36px; background: var(--metal-bar); border-radius: 4px 4px 0 0; min-height: 2px; box-shadow: var(--key-shadow-sm); }
table.lines { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.lines th, table.lines td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); text-align: left; }
table.lines th { color: var(--ink-2); font-weight: var(--fw-medium); font-size: var(--fs-xs); }
table.lines td.money, table.lines th.money { text-align: right; }
table.lines tfoot td { font-weight: var(--fw-bold); border-bottom: 0; }

/* ── forms ───────────────────────────────────────────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: var(--space-3); }
.field > span { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 5px; font-weight: var(--fw-medium); }
.field input, .field select, .field textarea, .input { width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 10px 14px; border: 0; box-shadow: var(--ring-hair); border-radius: var(--radius-sm);
  background: var(--surface); font-size: max(16px, var(--fs-md)); }
.field input[type=radio], .field input[type=checkbox] { width: 22px; min-width: 0; min-height: 0; padding: 0; box-shadow: none; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.field textarea { min-height: 88px; resize: vertical; }
.field .hint { display: block; color: var(--ink-3); font-size: var(--fs-xs); margin-top: 5px; }
.field.big input { font-size: var(--fs-xl); font-weight: var(--fw-bold); text-align: center; min-height: 56px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.two > *, .three > * { min-width: 0; }
.three { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr); gap: var(--space-2); }
.radio { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); cursor: pointer; }
.radio:last-child { border-bottom: 0; }
.radio input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.radio .grow { flex: 1; min-width: 0; }
.radio .inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.radio .inline select, .radio .inline input { width: auto; min-height: var(--tap); padding: 4px 10px; border: 0; box-shadow: var(--ring-hair); border-radius: var(--radius-sm); background: var(--surface); }
details.more { margin: var(--space-3) 0; }
details.more > summary { cursor: pointer; color: var(--ink); font-weight: var(--fw-semi); min-height: var(--tap); display: flex; align-items: center; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; box-shadow: var(--ring-hair); font-weight: var(--fw-bold); }
details.more[open] > summary::before { content: "–"; }
fieldset.card { border: 0; margin: 0 0 var(--space-3); min-width: 0; }
fieldset.card { padding-top: var(--space-1); }
fieldset.card > legend { float: left; width: 100%; padding: var(--space-3) 0 var(--space-2); margin: 0; }
fieldset.card > legend ~ * { clear: both; }
fieldset.card > .two { width: 100%; }
.error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: var(--fs-sm); margin-bottom: var(--space-3); }
.google { display: flex; align-items: center; justify-content: center; gap: var(--space-3); width: 100%; min-height: 52px; border-radius: var(--radius-pill);
  border: 0; box-shadow: var(--ring-hair); background: var(--surface); font-weight: var(--fw-semi); }
.google .g { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--fw-bold); background: var(--surface-2); font-size: var(--fs-sm); }
.suggest { margin: -6px 0 var(--space-3); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.suggest button { display: block; width: 100%; min-height: var(--tap); padding: var(--space-2) var(--space-3); border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: var(--fs-sm); }
.suggest button:last-child { border-bottom: 0; }
.suggest .xsmall { display: block; }

/* ── sheets (bottom on a phone, centred on a big screen) ─────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; animation: fade .22s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: calc(100% - 48px); overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-3) var(--gutter) calc(var(--space-5) + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); overscroll-behavior: contain; animation: rise .28s cubic-bezier(.2, .8, .25, 1); }
.sheet h3 { margin: 0 0 var(--space-3); font: var(--fw-bold) var(--fs-xl) / 1.25 var(--font-display); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--metal-bar); margin: 0 auto var(--space-3); }
.sheet .lead { color: var(--ink-2); font-size: var(--fs-sm); margin: -4px 0 var(--space-3); }
.pick { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-1) 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick:last-child { border-bottom: 0; }
.pick .grow { flex: 1; min-width: 0; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 700px) { .scrim { align-items: center; } .sheet { border-radius: var(--radius-lg); } }

/* ── toast: the 5-second undo. Deep blue after a tick, ink otherwise ───────────────────────────────────── */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--demo-h) + 10px + env(safe-area-inset-bottom)); z-index: 30; display: flex; justify-content: center; padding: 0 var(--space-2); pointer-events: none; }
.no-tabs .toast-wrap { bottom: calc(var(--demo-h) + 10px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--space-2); width: 100%; max-width: 560px; min-height: 56px;
  background: var(--toast-bg); color: var(--toast-ink); border-radius: var(--radius-md); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4); box-shadow: var(--shadow-toast); animation: rise .26s cubic-bezier(.2, .8, .25, 1); }
.toast.tick { background: var(--toast-tick-bg); color: var(--toast-tick-ink); }
.toast .grow { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: 1.3; }
.toast .grow strong { display: block; font-size: var(--fs-md); }
.toast .undo { flex: none; border: 0; background: var(--toast-btn-bg); color: inherit; border-radius: var(--radius-sm); font-weight: var(--fw-bold); min-height: 48px; padding: 0 14px; font-size: var(--fs-sm); }
.toast .timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--toast-drain); transform-origin: left center; animation: drain var(--undo-ms, 5000ms) linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── email preview (the mock's outbox) ───────────────────────────────────────────────────────────────── */
.mail { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); overflow: hidden; }
.mail-head { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.mail-head > div:not(.subj) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-head .subj { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: var(--space-2); }
.mail-body { padding: var(--space-4); }
.mail-body p { margin: 0 0 var(--space-3); white-space: pre-wrap; }
.mail-inv { border-radius: var(--radius-sm); box-shadow: var(--ring-hair); margin: var(--space-3) 0; overflow: hidden; }
.mail-inv .top { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-3); background: var(--surface-2); font-size: var(--fs-sm); }

/* ── family side ─────────────────────────────────────────────────────────────────────────────────────── */
.fam-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-bottom: var(--space-3); }
.fam-card { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-1); text-decoration: none; color: inherit; min-height: 84px; }
.fam-card .k { font-size: var(--fs-xs); color: var(--ink-2); font-weight: var(--fw-medium); }
.fam-card .v { font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1.2; }
.fam-card .s { font-size: var(--fs-xs); color: var(--ink-2); }
.fam-card.owing .v { color: var(--warn); }
.fam-card.paid .v { color: var(--done-ink); display: flex; align-items: center; gap: 6px; }
.fam-card.paid .mini-key { width: 22px; height: 22px; }
.fam-card.paid .mini-key .tick { left: 5px; top: 6px; width: 12px; height: 10px; }

/* family.js — a student's home has ONE card (Next lesson): full width, not half */
.person { display: block; padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .xsmall { display: block; overflow-wrap: anywhere; }
.fam-cards.one { grid-template-columns: 1fr; }
/* the intake's "Your address · Only if lessons are at your home": the hint sits on the title's line */
.section-title .hint { font-weight: var(--fw-normal); color: var(--ink-3); text-align: right; }

/* onboarding: one question per screen, big answers; a tap answers and moves on */
.ob { max-width: 460px; margin: 0 auto; }
.ob-q { margin: var(--space-2) 0 var(--space-4); font: var(--fw-bold) var(--fs-xxl) / 1.2 var(--font-display); text-align: center; }
.ob-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.ob-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: var(--space-2) 4px; border: 0; border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink); font-weight: var(--fw-semi); font-size: var(--fs-sm); }
.ob-tile svg:not(.tick) { width: 34px; height: 34px; color: var(--gold-ink); }
.ob-tile .tick { position: absolute; top: 7px; right: 7px; width: 20px; height: 16px; stroke-width: 3; }
.ob-tile[aria-pressed="true"] { background: var(--sel-bg); box-shadow: var(--sel-ring); }
.ob-tile[aria-pressed="true"] .tick { display: block; }
.ob-tile:active, .ob-opt:active { transform: translateY(1px); }
.ob-other { display: flex; gap: var(--space-2); margin: var(--space-3) 0 0; }
.ob-other .input { flex: 1; }
.ob-next { min-height: 56px; font-size: var(--fs-lg); margin-top: var(--space-4); }
.ob-opts { display: flex; flex-direction: column; gap: var(--space-3); }
.ob-opt { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 92px; padding: var(--space-3) var(--space-4); border: 0; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-1); text-align: left; color: var(--ink); }
.ob-opt .grow { flex: 1; min-width: 0; }
.ob-opt .grow strong { display: block; font-size: var(--fs-xl); line-height: 1.2; }
.ob-opt .grow > span { display: block; color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; }
.ob-opt .act-ring { flex: none; }
.ob-opt[aria-pressed="true"] { background: var(--sel-bg); box-shadow: var(--sel-ring); }
.ob-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.len.ob-len { min-height: 88px; font-size: var(--fs-xxl); font-weight: var(--fw-bold); }
.ob-skip { text-align: center; margin-top: var(--space-4); }
.ob-amount { display: flex; align-items: baseline; justify-content: center; gap: 2px; font: var(--fw-bold) var(--fs-hero) / 1.1 var(--font-display); margin-top: var(--space-4); }
.ob-amount input { width: 4.2ch; min-height: 64px; border: 0; border-bottom: 2px solid var(--metal-edge); background: none; font: inherit; text-align: center; color: var(--ink); }
.ob-amount input:focus { outline: none; border-bottom-color: var(--accent); }
.ob-per { text-align: center; color: var(--ink-2); margin: var(--space-2) 0 0; }
.input.ob-name { font-size: var(--fs-xl); font-weight: var(--fw-semi); text-align: center; min-height: 60px; margin-bottom: var(--space-2); }

/* onboarding / steps */
.welcome { text-align: center; padding: var(--space-6) 0 var(--space-4); }
.welcome h2 { margin: 0 0 var(--space-2); font: var(--fw-bold) var(--fs-xxl) / 1.15 var(--font-display); }
.steps { display: flex; gap: 6px; justify-content: center; margin: var(--space-2) 0 var(--space-4); }
.steps i { width: 32px; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--metal-bar); box-shadow: var(--rod-shadow); }

/* ── round 3: billing ahead / after, future billings, makeups, "coming?", one-time charges (design/06-billing-round) ── */
/* the student row: a makeup owed is the row's third line, amber (needs you) */
.srow-owed { color: var(--warn); font-size: var(--fs-xs); font-weight: var(--fw-semi); display: block; margin-top: 1px; }
/* a banner that is one tap (the profile's makeup owed) */
button.banner { width: 100%; border: 0; text-align: left; color: inherit; font: inherit; }
button.banner:active { background: var(--surface-3); }
/* calendar cards: the family's answer and the makeup mark, at the card's right; a family's card asks "Coming?" */
.ag-tags { flex: none; display: inline-flex; gap: 4px; }
.ag-ask { flex: none; font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--accent); }
a.ag-card { color: inherit; text-decoration: none; }
/* a bill's lines that are not buttons; a small heading inside a card; a credit's true minus */
.line.plain { min-height: 44px; }
.line-head { padding: var(--space-2) var(--space-4) 2px; font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--ink-2); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.money.credit { color: var(--ink); font-weight: var(--fw-semi); }
.period-head .money { flex: none; font-weight: var(--fw-semi); }
.card + .card[data-period], .card[data-period] + .card { margin-top: var(--space-3); }
table.lines tr.sub td { padding-top: var(--space-3); font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--ink-2); background: var(--surface-2); }
/* Months (future billings): one card a month, one big number; open = its students */
.mo-lead { margin: 0 0 var(--space-3); }
.mo-card { margin-bottom: var(--space-3); overflow: hidden; }
.card.mo-card + .card.mo-card { margin-top: 0; }
.mo-head { display: flex; align-items: center; gap: var(--space-3); min-height: 60px; padding: var(--space-3) var(--space-3) var(--space-2) var(--space-4); color: inherit; text-decoration: none; }
a.mo-head:active { background: var(--surface-3); }
.mo-head > svg { flex: none; width: 16px; height: 16px; color: var(--ink-3); }
.mo-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.mo-name { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.mo-exp { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.mo-exp .money { font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.mo-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); padding: 0 var(--space-4) var(--space-3); }
.mo-fig { display: flex; flex-direction: column; min-width: 0; }
.mo-fig .money { font-size: var(--fs-sm); font-weight: var(--fw-semi); }
.mo-none { padding: 0 var(--space-4) var(--space-3); }
.mo-rows { border-top: 1px solid var(--line); }
.mo-rows .line { padding-left: var(--space-3); }
.mo-rows .line > svg { flex: none; color: var(--ink-3); }
.mo-rows .right { flex: none; text-align: right; }
/* "coming?" — the family's page: two huge buttons (keys: they sink, never glow) and one line */
.cf { text-align: center; padding-top: var(--space-4); }
.cf .avatar.lg { width: 72px; height: 72px; margin: 0 auto var(--space-2); font-size: var(--fs-xl); }
.cf-q { margin: 0; font: var(--fw-bold) var(--fs-xxl) / 1.2 var(--font-display); }
.cf-when { margin: var(--space-2) 0 var(--space-5); font-size: var(--fs-xl); font-weight: var(--fw-semi); }
.cf-when span { display: block; font-size: var(--fs-md); font-weight: var(--fw-normal); color: var(--ink-2); margin-top: 2px; }
.cf-btns { display: flex; flex-direction: column; gap: var(--space-3); }
.cf-btn { display: flex; align-items: center; gap: var(--space-4); width: 100%; min-height: 88px; padding: 0 var(--space-5); border: 0; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink); font: var(--fw-bold) var(--fs-xl) / 1.2 var(--font-display); text-align: left; transition: transform .09s ease-out; }
.cf-btn:active, .cf-btn.is-pending { transform: scale(.97); }
.cf-key { position: relative; flex: none; width: var(--key); height: var(--key); border-radius: 50%; background: var(--metal-ring); box-shadow: var(--key-shadow); display: grid; place-items: center; }
.cf-key::before { content: ""; position: absolute; inset: 4.5px; border-radius: 50%; background: var(--key-face); box-shadow: var(--face-inset); }
.cf-btn:active .cf-key::before { box-shadow: var(--face-inset-pressed); }
.cf-key .tick, .cf-key svg { position: relative; display: block; }
.cf-key .tick { width: 30px; height: 24px; }
.cf-key svg:not(.tick) { width: 24px; height: 24px; stroke-width: 2.4; color: var(--ink-2); }
.cf-btn.yes .cf-key::before { background: var(--done-face); box-shadow: var(--face-inset-done); }
.cf-btn.yes[aria-pressed="true"] { background: var(--sel-bg); box-shadow: var(--sel-ring); }
.cf-btn.yes[aria-pressed="true"] .cf-key::before { background: var(--done-face); box-shadow: var(--face-inset-done); }
.cf-btn.no[aria-pressed="true"] { background: var(--warn-soft); box-shadow: inset 0 0 0 1.5px var(--warn); color: var(--warn); }
.cf-btn.no[aria-pressed="true"] .cf-key svg { color: var(--warn); }
.cf-line { margin: var(--space-4) 0 var(--space-2); color: var(--ink-2); }
.cf .more { text-align: left; }
.welcome.cf h2 { font-size: var(--fs-xl); }

/* ── round 3, after the look and Sonic's phone: sizes bounded, fewer words, how a student pays ── */
/* a row's trailing icon is always 16 px (round 2: Records drew it ~240 px on Android); test/sizes.mjs gates it */
.kv > svg { flex: none; width: 16px; height: 16px; color: var(--ink-3); }
/* every amount in a list ends on the same edge: a row with no chevron keeps its room */
.line .trail { flex: none; width: 16px; }
.srow-meta .quiet { color: var(--ink-3); font-weight: var(--fw-normal); }
.ag-card.cancelled .tm { white-space: normal; }
.ag-chev { flex: none; display: grid; color: var(--ink-3); }
.ag-chev svg { width: 16px; height: 16px; }
.fam-ask { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: var(--fw-semi); }
.fam-ask svg { width: 14px; height: 14px; }
/* Owing: the amount over its Mark paid, so the family and its due date get the width */
.inv-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
/* headings never leave their last word alone */
.ob-q, .cf-q, .sheet h3, .welcome h2, .hero h2, .bar-title h1 { text-wrap: balance; }
/* an explanation on a second tap: a small (i) */
details.info { display: inline-block; vertical-align: middle; }
details.info[open] { display: block; }
details.info > summary { list-style: none; position: relative; display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); margin: -12px 0 -12px -8px; cursor: pointer;
  color: var(--ink-2); font-size: var(--fs-xs); font-weight: var(--fw-bold); }
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary::before { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
details.info > span { display: block; margin: 0 0 6px; font-size: var(--fs-xs); font-weight: var(--fw-normal); color: var(--ink-2); }
/* a setting's own fields show only while it is on; a flat fee's amount only while it is chosen */
.radio:has(input[name=byLengthOn]:not(:checked)) .inline, .pay .radio:has(input[name=monthKind][value=fixed]:not(:checked)) .inline { display: none; }
.fam-head > .trail, .mo-head > .trail { flex: none; width: 16px; }
/* how a student pays: two big choices first; the details only under the one chosen */
.pay .reveal { display: none; margin-top: var(--space-3); }
.pay:has(input[name=pay][value=lesson]:checked) .reveal[data-for=lesson], .pay:has(input[name=pay][value=month]:checked) .reveal[data-for=month] { display: block; }
.pay-pick .chip.big { flex: 1 1 0; }

/* ── round 6 ── */
/* N4 the "can't come" note: a real box, the column's full width, a few lines, Send under it */
.note-box { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.note-box textarea.input { width: 100%; min-height: 104px; resize: vertical; font-size: var(--fs-md); line-height: 1.4; }
/* N2 a note is one row that opens it; the read view: the note in full, the pencil at the top right (hers only) */
.note-row .srow-meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.note-row > svg { flex: none; width: 18px; height: 18px; color: var(--ink-3); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sheet-head h3 { margin: 0; }
.note-dl { margin: var(--space-3) 0 0; display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); }
.note-dl dt { color: var(--ink-3); font-size: var(--fs-sm); }
.note-dl dd { margin: 0; }
/* Nn a family's answer or "I've paid" she hasn't seen: a dot on the calendar button */
.icon-btn { position: relative; }
.icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--frame); }
.news .news-line { color: inherit; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 2px 0; }
.news .news-more { color: var(--ink-2); display: block; font-size: var(--fs-sm); padding: 2px 0; }
.news .act-link { flex: none; }
/* the Select bar holds its count and four actions on one line at 360 px */
.selbar-in { flex-wrap: nowrap; gap: 6px; padding-left: var(--space-3); }
.selbar-in .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selbar-in .btn.small { padding: 0 10px; flex: none; }
/* a toast rises above a fixed bar, never over it */
body:has(.sendbar) .toast-wrap, body:has(.selbar) .toast-wrap { bottom: calc(var(--tabs-h) + var(--demo-h) + 84px + env(safe-area-inset-bottom)); }
.card > .tl:last-child, .card-pad > .tl:last-child { border-bottom: 0; }
.sendbar .btn[disabled] { opacity: .45; }
/* Na how new students pay: the flat fee's amount only while it is chosen */
.new-pay .new-flat { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--space-2); }
.new-pay .new-flat .input { width: 110px; min-height: var(--tap); }
.new-pay:has(input[name=newPay][value=flat]:not(:checked)) .new-flat { display: none; }
/* Ni the invite's "Is this right?" */
.is-right { margin: var(--space-3) 0; }
.is-right strong { display: block; font-size: var(--fs-lg); }

/* round 7 (spec/14): paying online and studio policies */
.page-h { margin: var(--space-2) 0 var(--space-3); font: var(--fw-bold) var(--fs-xl) / 1.2 var(--font-display); text-wrap: balance; }
.policy-text { line-height: 1.5; overflow-wrap: anywhere; }
.policy-text p { margin: 0 0 var(--space-2); }
.policy-text p:last-child { margin-bottom: 0; }
[data-testid="autopay-card"] { margin-bottom: var(--space-3); }
[data-testid="autopay-card"] > span { min-width: 0; }
[data-testid="demo-bank"] { align-items: center; margin-bottom: var(--space-3); }
.kv .v svg { vertical-align: middle; }

@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .key:active, .go.xl:active { transform: none; } }

/* ── the privacy and terms pages (public/privacy/, public/terms/: static, no script) and their links (lane R1) ──── */
body.doc { height: auto; min-height: 100%; overflow: visible; }
.doc-bar { background: var(--frame); border-bottom: 1px solid var(--line); padding: 0 var(--gutter); }
.doc-home { display: inline-block; padding: var(--space-3) 0; min-height: var(--tap); font: var(--fw-bold) var(--fs-lg) / 1.2 var(--font-display); color: var(--ink); text-decoration: none; }
.doc-page { max-width: var(--content-max); margin: 0 auto; padding: var(--space-4) var(--gutter) var(--space-5); overflow-wrap: anywhere; }
.doc-page h1 { margin: var(--space-2) 0 var(--space-1); font: var(--fw-bold) var(--fs-xxl) / 1.15 var(--font-display); }
.doc-page h2 { margin: var(--space-5) 0 var(--space-2); font: var(--fw-bold) var(--fs-lg) / 1.25 var(--font-display); }
.doc-page h3 { margin: var(--space-4) 0 var(--space-1); font-size: var(--fs-md); font-weight: var(--fw-semi); color: var(--ink-2); }
.doc-page p, .doc-page ul { margin: 0 0 var(--space-3); }
.doc-page ul { padding-left: 1.25em; }
.doc-page li + li { margin-top: var(--space-1); }
.doc-meta { color: var(--ink-3); font-size: var(--fs-sm); }
.doc-foot, .legal-links { text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }
.doc-foot { padding: var(--space-3) var(--gutter) var(--space-6); border-top: 1px solid var(--line); }
.doc-foot a, .legal-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: var(--space-3) var(--space-2); color: var(--ink-2); }   /* RVR1-6: a tap target, as .doc-home */
.legal-links { margin: var(--space-5) 0 0; }
