/* Plus Jakarta Sans, served from our own site so visitors' browsers never contact Google (SIL Open Font License, fonts/OFL.txt) */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2"); }

/* Themes: calm colors that keep attention on the question. Each unlockable theme only swaps these tokens. */
:root, [data-theme="sky"] {
  --bg: #f4f7fc; --surface: #ffffff; --surface-2: #eef3fb; --text: #18223a; --muted: #5b6782;
  --primary: #2f62d9; --primary-ink: #ffffff; --primary-soft: #e3ebfc; --accent: #f4a93b;
  --good: #1d8a5a; --good-soft: #e3f5ec; --bad: #c2453d; --bad-soft: #fcebea; --border: #dfe5f0;
  --shadow: 0 1px 2px rgba(24, 34, 58, .06), 0 6px 20px rgba(24, 34, 58, .06); color-scheme: light;
}
[data-theme="mint"] { --bg: #f2f8f6; --surface-2: #e8f4ef; --primary: #13866b; --primary-soft: #dcf1ea; --accent: #e9a23b; }
[data-theme="sunset"] { --bg: #fcf6f2; --surface-2: #f9ece4; --primary: #c9563a; --primary-soft: #f9e2d9; --accent: #7a5bd6; }
[data-theme="crimson"] { --bg: #ffffff; --surface-2: #fbeff1; --primary: #c8102e; --primary-ink: #ffffff; --primary-soft: #fde4e8; --accent: #f4a93b; --border: #f0dde1; }
[data-theme="noir"] {
  --bg: #0b0b0b; --surface: #161616; --surface-2: #202020; --text: #f5f1e6; --muted: #b7ad95;
  --primary: #d4af37; --primary-ink: #111111; --primary-soft: #3a3115; --accent: #f2d27a;
  --good: #5cc98b; --good-soft: #17301f; --bad: #ff7b72; --bad-soft: #3a1d1f; --border: #2e2a20;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
[data-theme="midnight"], [data-theme="galaxy"] {
  --bg: #0f1424; --surface: #171e33; --surface-2: #1e2742; --text: #e8ecf6; --muted: #9aa5c2;
  --primary: #7aa2ff; --primary-ink: #0f1424; --primary-soft: #253259; --accent: #f4b860;
  --good: #49c58c; --good-soft: #173527; --bad: #ff7b72; --bad-soft: #3a1d1f; --border: #2a3456;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}
[data-theme="galaxy"] { --bg: #140f26; --surface: #1d1636; --surface-2: #261d45; --primary: #b18cff; --primary-soft: #33275c; --border: #362a5c; }

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* layout rules like display:grid must not un-hide elements */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; letter-spacing: -.02em; }
.brand b { color: #13a38b; }
#nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#nav a, .tabbar a { text-decoration: none; color: var(--muted); font-weight: 600; padding: 8px 12px; border-radius: 10px; font-size: .95rem; }
#nav a.active, .tabbar a.active { color: var(--primary); background: var(--primary-soft); }
.tabbar { display: none; }

main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 40px; }
main:focus { outline: none; }
.footer { text-align: center; padding: 16px; border-top: 1px solid var(--border); }
.footer p { margin: .3em 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 700; padding: 11px 18px; border-radius: 12px; background: var(--primary); color: var(--primary-ink);
  text-decoration: none; min-height: 44px;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem;
  padding: 7px 13px; border-radius: 999px; cursor: pointer; min-height: 36px; text-decoration: none; display: inline-flex; align-items: center;
}
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.chip:disabled { opacity: .45; cursor: not-allowed; }

label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 4px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: 20px; min-height: 20px; margin-top: 2px; flex: none; }
.form { display: grid; gap: 14px; }
.err { color: var(--bad); font-weight: 600; }

.hero { padding: 28px 0 12px; display: grid; gap: 24px; grid-template-columns: 1.2fr 1fr; align-items: center; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-card { background: linear-gradient(160deg, var(--primary-soft), var(--surface)); }
.feature .icon { font-size: 1.8rem; }
.badge-pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge-pill.good { background: var(--good-soft); color: var(--good); }
.badge-pill.premium { background: var(--accent); color: #241a05; }

.stat { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.bar.good > span { background: var(--good); }

/* Practice */
.practice { max-width: 760px; margin: 0 auto; }
.controls { display: grid; gap: 10px; margin-bottom: 16px; }
.controls .label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.qmeta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.passage { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; white-space: pre-line; }
.qtext { font-size: 1.12rem; font-weight: 600; margin-bottom: 16px; }
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; font: inherit; width: 100%; padding: 13px 14px;
  border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; min-height: 52px;
}
.choice:hover:not(:disabled) { border-color: var(--primary); }
.choice .letter { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice:disabled { cursor: default; }
.feedback { margin-top: 16px; border-radius: 14px; padding: 16px; }
.feedback.good { background: var(--good-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback h3 { margin-bottom: .3em; }
.whywrong { background: var(--surface); border-radius: 12px; padding: 12px 14px; margin: 10px 0; border-left: 4px solid var(--bad); }
details { background: var(--surface); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
summary { cursor: pointer; font-weight: 700; }
.events { margin-top: 10px; display: grid; gap: 6px; }
.event { background: var(--surface); border-radius: 10px; padding: 8px 12px; font-weight: 600; }

/* Charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.topic { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.topic:last-child { border-bottom: 0; }
.topic .bar { grid-column: 1 / -1; }

/* Leaderboard */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tr.me td { background: var(--primary-soft); font-weight: 700; }

/* Rewards */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.swatch { border: 2px solid var(--border); border-radius: 14px; padding: 10px; text-align: center; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.swatch[aria-pressed="true"] { border-color: var(--primary); }
.swatch:disabled { opacity: .55; cursor: not-allowed; }
.swatch .dot { width: 100%; height: 34px; border-radius: 10px; margin-bottom: 6px; }
.avatar { font-size: 1.8rem; }

/* Chat */
.chat { max-width: 760px; margin: 0 auto; }
.askctx { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.askctx .qtext { font-size: 1rem; margin: 4px 0 6px; }
.askctx .passage { background: var(--surface); margin-bottom: 8px; }
.askctx ol { margin: 0 0 6px; padding-left: 22px; }
.msgs { display: grid; gap: 10px; min-height: 260px; max-height: 58vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { justify-self: end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.msg.assistant { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer textarea { min-height: 48px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); z-index: 20;
}
.toast.show { opacity: 1; }
dialog { border: 0; border-radius: 18px; padding: 24px; max-width: min(520px, calc(100% - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 15, 30, .45); }

/* Small "Premium" tag on locked buttons, so it's clear they lead to the plans page */
.ptag { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--accent); color: #241a05; border-radius: 999px; padding: 2px 7px; margin-left: 2px; }

.nextsat {
  display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; font-size: 1rem;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border: 2px solid var(--accent); border-left-width: 8px;
}
.nextsat > span:nth-child(2) { flex: 1; }
.nextsat span.small { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.calbadge { font-size: 1.8rem; line-height: 1; }
.nextsat.urgent { background: var(--bad-soft); border-color: var(--bad); }
.registered { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--good-soft); color: var(--text); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; margin-left: 6px; }
@media (max-width: 760px) { .nextsat { flex-wrap: wrap; } }
.nextsat.urgent span.small { color: var(--bad); }

/* Home: greeting with stat chips, one main action, small tiles */
.homehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.homehead h1 { margin: 0; }
.statchips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.statchip { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 1.05rem; }
.mainaction { margin-bottom: 16px; border: 2px solid var(--primary); }
.mainaction h2 { font-size: 1.5rem; margin-bottom: 4px; }
.mainaction .row { margin-top: 12px; }
.btn.big { padding: 14px 24px; font-size: 1.1rem; border-radius: 14px; }
.tiles .tile { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tilehead { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile .bar { width: 100%; }

/* Focus mode while answering questions: no menu, header or footer; a slim bar on top */
body.focusmode { padding-left: 0; }
body.focusmode .topbar, body.focusmode .tabbar, body.focusmode .footer { display: none; }
body.focusmode main { padding-top: 12px; }
.focusbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 8px 0 12px; }
.focusbar #summary { margin-right: auto; font-size: .85rem; }
.practice .controls.card { margin-bottom: 16px; }

.superscore { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-radius: 10px; padding: 8px 12px; margin: 0; }

/* Where Am I? results */
.topicrow { padding: 10px 0; border-bottom: 1px solid var(--border); }
.topicrow:last-child { border-bottom: 0; }
.lvl { font-weight: 700; font-size: .9rem; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.lvl-strong { background: var(--good-soft); color: var(--good); }
.lvl-mid { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--text); }
.lvl-focus { background: var(--bad-soft); color: var(--bad); }

/* Premium plan choices on the Account page */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan { display: grid; gap: 2px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.plan:hover { border-color: var(--primary); }
.plan .price { font-size: 1.2rem; font-weight: 800; color: var(--primary); }

/* Daily quote and tip banner (Home only) */
.banner {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px;
  padding: 18px 20px; border-radius: 18px; color: var(--primary-ink);
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--accent)));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 30%, transparent);
}
.banner p { margin: 0; }
.banner .quote { font-weight: 800; font-size: 1.2rem; line-height: 1.35; margin-bottom: 8px; }
.banner .small { opacity: .92; }
.banner .btn.ghost { background: transparent; color: var(--primary-ink); border-color: color-mix(in srgb, var(--primary-ink) 45%, transparent); }

/* Data tables in questions, and the typed-answer box */
.table-wrap { overflow-x: auto; margin-bottom: 14px; }
table.data { width: auto; min-width: 60%; border: 1px solid var(--border); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.data th { background: var(--surface-2); color: var(--text); text-transform: none; letter-spacing: 0; font-size: .9rem; }
table.data td, table.data th { padding: 8px 14px; text-align: center; }
table.data tr:last-child td { border-bottom: 0; }
.spr input { max-width: 220px; font-size: 1.15rem; font-weight: 700; }

/* "Watch it" step-by-step player */
dialog.wide { max-width: min(680px, calc(100% - 32px)); width: 100%; }
.board { display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 4px 2px; margin: 8px 0 12px; }
.wstep { background: var(--surface-2); border-radius: 14px; padding: 12px 16px; opacity: .55; font-size: 1rem; transition: opacity .3s; }
.wstep.current { opacity: 1; background: var(--primary-soft); font-size: 1.12rem; box-shadow: inset 4px 0 0 var(--primary); }
.wtitle { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.wstep mark { background: var(--accent); color: #241a05; padding: 0 5px; border-radius: 6px; font-weight: 700; }
.wstep s { color: var(--bad); }
.voice-pick { margin-top: 10px; }
.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.dots span.on { background: var(--primary); }

.certificate {
  max-width: 820px; margin: 0 auto; text-align: center; padding: 48px 32px; border: 10px double var(--primary);
  border-radius: 8px; background: #fffdf7; color: #1e2433;
}
.certificate h1 { font-size: 2.4rem; }
.certificate .who { font-size: 2rem; font-weight: 800; color: #2f62d9; margin: .4em 0; }
.draft { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 12px; font-weight: 700; margin-bottom: 16px; }
.empty { text-align: center; padding: 30px 10px; }

/* Computers and tablets: the menu is a fixed left sidebar. Phones keep the bottom tab bar (below). */
@media (min-width: 761px) {
  body { padding-left: 232px; }
  .topbar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 232px; z-index: 5; overflow-y: auto;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 20px;
    padding: 22px 14px; border-bottom: 0; border-right: 1px solid var(--border);
  }
  .brand { padding: 4px 12px; font-size: 1.3rem; }
  #nav { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; }
  #nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; font-size: 1rem; }
  #nav a span { font-size: 1.15rem; width: 1.4em; text-align: center; }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  #nav { display: none; }
  .tabbar {
    display: flex; justify-content: space-around; position: sticky; bottom: 0; background: var(--surface);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 5;
  }
  .tabbar a { display: grid; justify-items: center; font-size: .72rem; padding: 4px 6px; }
  .tabbar a span { font-size: 1.25rem; }
  main { padding: 16px 16px 28px; }
  .card { padding: 16px; border-radius: 16px; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .topbar, .tabbar, .footer, .no-print { display: none !important; }
  body { background: #fff; padding-left: 0; }
  main { padding: 0; }
}
.stars{color:#f5a623;font-size:1.1rem;letter-spacing:2px}

/* Test mode: the digital SAT's layout (timer bar, passage beside question, question grid), in ScoreKind's own look */
.testmode { display: flex; flex-direction: column; min-height: calc(100vh - 40px); }
.testbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 8px 0 12px; border-bottom: 1px solid var(--border); }
.testbar > .row { justify-content: flex-end; }
.timer { text-align: center; display: grid; justify-items: center; }
.timer #clock { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.testq { flex: 1; padding: 20px 0; }
.testq .passage, .testq .qtext, .testq .choice, .treview .qtext { font-family: Georgia, "Times New Roman", serif; }
.testq .qtext { font-weight: 400; font-size: 1.08rem; }
.testq.split { display: grid; grid-template-columns: 1fr 1fr; }
.testq.split > .tpassage { padding-right: 24px; border-right: 3px solid var(--border); }
.testq.split > .tquestion { padding-left: 24px; }
.testq:not(.split) > .tquestion { max-width: 720px; margin: 0 auto; width: 100%; }
.tqhead { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-bottom: 14px; }
.qnum { background: var(--text); color: var(--bg); font-weight: 800; border-radius: 6px; min-width: 28px; text-align: center; padding: 0 6px; }
.choicewrap { display: flex; gap: 8px; align-items: center; }
.choicewrap .choice { flex: 1; }
.choicewrap.crossed .choice { opacity: .45; text-decoration: line-through; }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.strike { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; font-size: .8rem; }
.testfoot { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); background: var(--bg); }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 10px; }
.qgrid button { position: relative; height: 44px; border: 1px dashed var(--muted); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.qgrid button.done { background: var(--primary); color: var(--primary-ink); border: 1px solid var(--primary); }
.qgrid button.flag::after { content: "🔖"; position: absolute; top: -9px; right: -6px; font-size: .8rem; }
.qgrid button.cur { outline: 2px solid var(--text); outline-offset: 2px; }
.treview { border-bottom: 1px solid var(--border); padding: 8px 0; }
.treview summary { cursor: pointer; }
@media (max-width: 760px) {
  .testbar { grid-template-columns: 1fr auto; }
  .testbar > .row { grid-column: 1 / -1; justify-content: flex-start; }
  .testq.split { grid-template-columns: 1fr; }
  .testq.split > .tpassage { padding: 0 0 16px; border-right: 0; border-bottom: 3px solid var(--border); }
  .testq.split > .tquestion { padding: 16px 0 0; }
}

/* Math in Practice and Where Am I?: question left, answers right. Focus mode hides the menu, so the page can be wider. */
body.focusmode .practice { max-width: 1100px; }
.qsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.qsplit > :first-child { padding-right: 24px; border-right: 3px solid var(--border); }
.qsplit > :last-child { padding-left: 24px; }
@media (max-width: 760px) {
  .qsplit { grid-template-columns: 1fr; }
  .qsplit > :first-child { padding: 0 0 12px; border-right: 0; border-bottom: 3px solid var(--border); margin-bottom: 12px; }
  .qsplit > :last-child { padding-left: 0; }
}

/* Practice: section, mode, topic and difficulty as compact dropdowns in the top bar */
.pickers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-right: auto; }
.pickers select { width: auto; max-width: 15rem; min-height: 36px; padding: 6px 10px; border-radius: 999px; font-size: .85rem; cursor: pointer; }

/* Top-right bar: who is logged in, and Log out */
.userbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; max-width: 1040px; margin: 0 auto; padding: 12px 16px 0; width: 100%; }
.userbar .who { text-decoration: none; color: var(--muted); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
body.focusmode .userbar { display: none; }
@media print { .userbar { display: none !important; } }

/* Account settings: one row per setting group, opened on click, with its current value on the right */
.settings { padding: 0; }
.settings details { border-bottom: 1px solid var(--border); padding: 0 20px; }
.settings details:last-child { border-bottom: 0; }
.settings summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; cursor: pointer; font-weight: 700; list-style: none; }
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: "›"; color: var(--muted); font-size: 1.3rem; transition: transform .15s; }
.settings details[open] summary::after { transform: rotate(90deg); }
.settings summary .muted { margin-left: auto; font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.settings details > :not(summary) { margin-bottom: 18px; }
