:root {
  --bg: #f7f8fa; --surface: #ffffff; --text: #1b2330; --muted: #5b6676; --border: #d5dbe4;
  --accent: #1f5fbf; --accent-text: #ffffff; --ok: #1b7a3d; --ok-bg: #e6f4ea; --bad: #b3261e; --bad-bg: #fce8e6; --warn-bg: #fff4d6; --warn-text: #5c4400;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d; --surface: #1b212b; --text: #e8ecf2; --muted: #a2adbd; --border: #333d4d;
    --accent: #6ea4f4; --accent-text: #0b1220; --ok: #6fd48f; --ok-bg: #16301f; --bad: #ff8a80; --bad-bg: #3a1c1a; --warn-bg: #3b3210; --warn-text: #f1de9a;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
header.site { background: var(--surface); border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 0; padding-bottom: 0; }
header.site .brand { font-weight: 700; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
header.site nav a { display: inline-flex; align-items: center; min-height: 44px; }
header.site nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
header.site nav a[aria-current="page"] { font-weight: 700; color: var(--text); text-decoration: none; }
main { padding: 24px 0 40px; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 1.35rem; margin: 32px 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin: 12px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.muted { color: var(--muted); }
.banner { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-weight: 600; }
button, .btn { font: inherit; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px; padding: 10px 18px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, .btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 12px; padding: 12px; }
legend { padding: 0 6px; font-weight: 600; }
.q-text { white-space: pre-line; margin: 0 0 12px; }
.q-meta { font-size: .875rem; color: var(--muted); margin-bottom: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; min-height: 44px; }
.choice input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.choice.correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.tag { font-weight: 700; font-size: .85rem; }
.badge-variant { display: inline-block; padding: 0 .5em; border: 1px solid currentColor; border-radius: 999px; font-size: .75rem; }
.feedback { margin-top: 12px; }
.feedback .verdict { font-weight: 700; }
.feedback .verdict.ok { color: var(--ok); } .feedback .verdict.bad { color: var(--bad); }
.hint { border-left: 4px solid var(--accent); padding: 4px 12px; margin: 10px 0; }
.expl { white-space: pre-line; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.price { font-size: 1.8rem; font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.topics { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
footer.site { border-top: 1px solid var(--border); background: var(--surface); padding: 20px 0 28px; font-size: .875rem; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 480px) { h1 { font-size: 1.55rem; } .status-bar { padding: 4px 0; gap: 4px 12px; } html { scroll-padding-top: 4rem; } }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); color: var(--text); padding: 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 6px; z-index: 5; }
.skip:focus { top: 8px; }
legend:focus, .feedback:focus, #break-title:focus { outline: none; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.timer.up { color: var(--bad); border-color: var(--bad); }
.status-bar { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.navgrid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); margin: 8px 0 16px; }
.navgrid button { padding: 4px; min-height: 44px; background: transparent; color: var(--text); border: 1px solid var(--border); position: relative; }
.navgrid button.answered { background: var(--ok-bg); border-color: var(--ok); }
.navgrid button.flagged::after { content: "⚑"; position: absolute; top: 0; right: 3px; font-size: .75rem; color: var(--bad); }
.navgrid button[aria-current="true"] { outline: 3px solid var(--accent); outline-offset: 1px; font-weight: 700; }
.typed { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.typed.correct { border-color: var(--ok); background: var(--ok-bg); }
.typed.wrong { border-color: var(--bad); background: var(--bad-bg); }
.num-input, #seed { font: inherit; min-height: 44px; min-width: 12ch; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: inherit; }
.mode-toggle { margin: 0 0 12px; }
.banner a, p[role="status"] a { display: inline-block; padding: 10px 0; line-height: 24px; }

/* Sign-in form (Nikola 12.11): the email field takes the full width and the button sits below it, never over the address. */
#login-form label { display: block; margin-bottom: 12px; }
#login-form input[type=email] { display: block; box-sizing: border-box; width: 100%; max-width: 28rem; margin-top: 4px; font: inherit; min-height: 44px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: inherit; }

/* glados-lead 14.11 #1 (3): plan boxes of different heights (3 vs 2 checkboxes) end with the disclosure + button at the same line.
   The disclosure stays directly above the button (D195 §1a); the free space goes above the disclosure. */
.plans > form.card { display: flex; flex-direction: column; }
.plans > form.card > .disclosure { margin-top: auto; }
.plans > form.card > button { align-self: flex-start; }
