/* The account page: the app's light and Midnight tokens on a quiet,
   single-column page. Type carries the hierarchy; one accent marks the main action. */
:root, body[data-theme="slate"] {
  --paper:#F7F8FA; --paper-2:#EEF0F3; --card:#FCFCFD;
  --rule:#D5DAE1; --rule-2:#E2E5EA;
  --ink:#141922; --ink-2:#3B4452; --muted:#5B6472;
  --accent:#2F5BEA; --accent-ink:#2448C0; --accent-tint:#E3E9FB;
  --danger:#A3392F;
  --serif:"Manrope",system-ui,-apple-system,"Segoe UI",sans-serif;
  --sans:"Manrope",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"JetBrains Mono",ui-monospace,"Cascadia Mono",Consolas,monospace;
}
body[data-theme="midnight"] {
  --paper:#0F1218; --paper-2:#141922; --card:#161B24;
  --rule:#2C3442; --rule-2:#262D3A;
  --ink:#E8EAEE; --ink-2:#C3CAD6; --muted:#9AA3B2;
  --accent:#7C9BFF; --accent-ink:#A9BDFF; --accent-tint:#273352;
  --danger:#F09A8E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 28px 20px 96px; }
.wrap.wide { max-width: 680px; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--rule); }
.back:hover { color: var(--accent-ink); border-color: currentColor; }

section { margin-top: 40px; }
.kicker { font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--muted); margin: 0 0 6px; }
h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 6vw, 40px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.01em; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.3; margin: 40px 0 10px; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 14px; color: var(--ink-2); max-width: 62ch; }
.lede { font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.aside { font-size: 14px; color: var(--muted); }
ul.plain { margin: 0 0 16px; padding-left: 1.1em; color: var(--ink-2); max-width: 62ch; }
ul.plain li { margin: 0 0 6px; }
a { color: var(--accent-ink); }

form { margin: 24px 0 0; }
.field { display: block; margin: 0 0 18px; }
.field > span { display: block; font-weight: 500; font-size: 14px; margin: 0 0 6px; color: var(--ink); }
.field small { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--rule); border-radius: 8px; padding: 11px 12px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1 1 220px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; color: var(--ink-2); }
.check input { margin-top: 5px; accent-color: var(--accent); }
/* Radio and checkbox groups: a plain list under a label, no box. */
.choices { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.choices legend { font-weight: 500; font-size: 14px; margin: 0 0 8px; padding: 0; color: var(--ink); }
.choices .check { margin-bottom: 8px; }
.total { font-family: var(--serif); font-size: 17px; color: var(--ink); margin: 0 0 18px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 15px;
  color: var(--paper); background: var(--accent); border: 0; border-radius: 8px;
  padding: 11px 20px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-text {
  font: inherit; font-size: 15px; background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px;
}
.btn-text.danger { color: var(--danger); }
/* A second way in (Google) or a quieter action: same shape, no accent fill. */
.btn-quiet { color: var(--ink); background: var(--card); border: 1px solid var(--rule); }
.btn-quiet:hover { filter: none; border-color: var(--ink-2); }
.google-slot { min-height: 44px; margin: 6px 0 0; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin: 18px 0 0; max-width: none; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--rule-2); }
.actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; margin: 4px 0 12px; }
.ok { color: var(--accent-ink); font-size: 14px; }
/* The account page in groups: each part's name and a line on the left, what to do on the right,
   a hairline between parts. On a phone the name sits above. */
.wrap.account { max-width: 880px; }
.page-head { margin-bottom: 12px; }
.page-head .ok:empty, .page-head .error:empty { min-height: 0; margin: 0; }
.group { display: grid; gap: 6px 40px; padding: 28px 0; border-top: 1px solid var(--rule-2); }
@media (min-width: 760px) { .group { grid-template-columns: 200px minmax(0, 1fr); } }
.group-head h2 { font-size: 18px; margin: 0 0 4px; }
.group-head p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0 0 8px; }
.group-body > :last-child { margin-bottom: 0; }
.group-body .actions { margin-top: 0; }
.group .students { margin: 0 0 16px; }
.group .students li { padding: 12px 0; }
.group .students li:first-child { padding-top: 0; border-top: 0; }
.group .students li:last-child { border-bottom: 0; }
.group .students .name { font-size: 18px; }
.group .total { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.group-body .error:empty { min-height: 0; margin: 0; }
.page-foot { margin: 0; max-width: none; padding-top: 24px; border-top: 1px solid var(--rule-2); }

/* A choice as a tile: the native box or circle stays, so one-or-more and just-one still read
   differently. The chosen tile takes the accent's tint. */
.options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.option {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; cursor: pointer;
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px;
}
.option:hover { border-color: var(--ink-2); }
.option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-tint); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.option input { margin: 4px 0 0; accent-color: var(--accent); flex: none; }
.option input:focus-visible { outline: none; }
.opt-text { display: flex; flex-direction: column; min-width: 0; }
.opt-name { font-weight: 600; color: var(--ink); line-height: 1.4; }
.opt-price { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--ink); margin-top: 6px; line-height: 1.2; }
.opt-per { font-size: 14px; color: var(--muted); }
.choices + .aside { margin-top: 10px; }

/* A code for free time (ADR 0020): folded until it's wanted. */
.code { margin: 28px 0 0; }
.code summary { cursor: pointer; font-weight: 500; color: var(--ink); width: fit-content; }
.code .row { margin: 12px 0; }
.code .choices { margin-top: 8px; }
.group .code { margin: 0 0 16px; }
.group #hm-code .code { margin-top: 20px; }

/* A code or password to copy down: the one place mono earns its keep. */
.secret {
  font-family: var(--mono); font-size: 19px; letter-spacing: 0.04em; color: var(--ink);
  background: var(--accent-tint); border-radius: 8px; padding: 14px 16px; margin: 0 0 12px;
  word-break: break-word;
}

/* The family list: rows separated by space and a hairline, no cards. */
.students { list-style: none; margin: 8px 0 24px; padding: 0; }
.students li { padding: 18px 0; border-top: 1px solid var(--rule-2); }
.students li:last-child { border-bottom: 1px solid var(--rule-2); }
.students .name { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--ink); }
/* A book that's paid for opens its practice; the arrow shows on hover. */
.students a.name { display: block; text-decoration: none; }
.students a.name::after { content: " →"; opacity: 0; transition: opacity .12s ease; }
.students a.name:hover { color: var(--accent-ink); }
.students a.name:hover::after, .students a.name:focus-visible::after { opacity: 1; }
.students .meta { font-size: 14px; color: var(--muted); margin: 2px 0 8px; }
.students .meta code { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.students .actions { gap: 16px; font-size: 14px; }
.students .actions .btn-text { font-size: 14px; }

/* The sign-in card prints on its own. */
.card-sheet { border: 1px solid var(--rule); border-radius: 12px; padding: 24px; background: var(--card); }
.card-sheet dl { margin: 0; }
.card-sheet dt { font-size: 13px; color: var(--muted); margin-top: 14px; }
.card-sheet dd { margin: 2px 0 0; font-family: var(--mono); font-size: 20px; color: var(--ink); word-break: break-word; }
.card-sheet dd:first-of-type { font-family: var(--serif); font-weight: 700; font-size: 22px; }
@media print {
  body { background: #FFFFFF; }
  body * { visibility: hidden; }
  .card-sheet, .card-sheet * { visibility: visible; }
  .card-sheet { position: absolute; left: 0; top: 0; width: 100%; border: 1px solid #000000; color: #000000; }
}
