:root {
  color-scheme: light;
  --ground: #edf1f6;
  --paper: #fff;
  --rail: #e3eaf3;
  --ink: #172943;
  --muted: #465973;
  --line: #bdc9d9;
  --control: #7589a6;
  --blue: #164b92;
  --blue-dark: #0e356d;
  --focus: #1157b2;
  --bad: #8a2d30;
  --bad-bg: #fff3f2;
  --good: #166044;
  --good-bg: #eaf7f0;
  --radius: 8px;
  font: 100%/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--ground);
  accent-color: var(--blue);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
::selection { background: #cadffa; color: #102947; }
:focus-visible, [tabindex="-1"]:focus { outline: 3px solid var(--focus); outline-offset: 4px; }
:where(h1, h2, h3, p, ol) { margin: 0; }
:where(p, h1, h2, h3, li, span, button, select) { overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; letter-spacing: -.025em; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1rem; }
button, input, select { font: inherit; }
.frame { width: min(calc(100% - 64px), 1120px); margin-inline: auto; }
.muted { color: var(--muted); }
.source { white-space: pre-wrap; }

.skip-link { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 8px 14px; background: var(--paper); color: var(--blue-dark); }
.skip-link:not(:focus) { clip-path: inset(50%); }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar, .brand, .account { display: flex; align-items: center; }
.topbar { justify-content: space-between; min-height: 74px; gap: 16px; padding-block: 10px; }
.brand { gap: 12px; font-weight: 750; line-height: 1.2; }
.brand-mark { display: grid; flex: none; width: 39px; height: 39px; place-items: center; border-radius: 6px; background: var(--blue); color: #fff; }
.account { gap: 14px; min-width: 0; font-size: .9rem; justify-content: flex-end; }
#account-name { min-width: 0; }
.account button { flex: none; }
.main { padding-block: 54px 64px; }

.sheet, .split-login { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.sheet { min-width: 0; }
.boot { max-width: 540px; padding: 32px; }
.boot p { margin-block: 8px 16px; }
.split-login { display: grid; grid-template-columns: 1.05fr 1fr; margin: 24px auto 0; max-width: 960px; box-shadow: 0 13px 30px #21395616; }
.intro, .login-form { padding: 48px; min-width: 0; }
.intro { color: #fff; background: #17375f; border-radius: 7px 0 0 7px; }
.intro h2 { font-size: 2.1rem; max-width: 15ch; letter-spacing: -.025em; }
.intro > p { margin-top: 15px; max-width: 36ch; color: #e0eafb; }
.path-list { list-style: decimal-leading-zero; margin-top: 38px; padding-inline-start: 32px; color: #eaf2fe; }
.path-list li { padding: 12px 0 12px 8px; border-top: 1px solid #61799b; }
.path-list li::marker { font-weight: 750; color: #afc9ed; font-variant-numeric: tabular-nums; }
.login-form > p, .section-head > p { margin-top: 8px; }
.login-form form { margin-top: 26px; }
.login-form .primary { width: 100%; margin-top: 8px; }

.field { display: grid; gap: 6px; margin-bottom: 18px; min-width: 0; }
.field label { font-weight: 700; }
.field input, .field select { width: 100%; min-width: 0; min-height: 46px; padding: 9px 12px; border: 1px solid var(--control); border-radius: 6px; color: var(--ink); background: var(--paper); caret-color: var(--blue); }
.field input[readonly], .field select:disabled { background: #edf1f6; }
.field select { padding-inline-end: 24px; text-overflow: ellipsis; }
.button { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; border: 1px solid transparent; border-radius: 6px; padding: 8px 17px; font-weight: 700; line-height: 1.35; cursor: pointer; }
.primary { background: var(--blue); color: #fff; }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.primary:active:not(:disabled) { background: #082957; }
.secondary { background: var(--paper); border-color: var(--control); color: var(--blue-dark); }
.secondary:hover:not(:disabled) { background: #eef4fb; }
.secondary:active:not(:disabled) { background: #dbe8f8; }
.button:disabled { cursor: default; background: #dce5ef; border-color: var(--line); color: var(--muted); }
.message { color: var(--bad); white-space: pre-wrap; font-weight: 650; }
.message:not(:empty), .status:not(:empty) { margin-block: 0 16px; }
.message:empty, .status:empty { margin: 0; }

.section-head { margin-bottom: 24px; }
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 285px); gap: 26px; align-items: start; }
.padded { padding: 32px; }
.sidebar { padding: 23px; border: 1px solid var(--line); background: var(--rail); border-radius: var(--radius); overflow-wrap: anywhere; }
.sidebar h2 { margin-bottom: 14px; }
.side-emphasis { font-weight: 700; white-space: pre-wrap; }
.sidebar .muted, .sidebar .count { font-size: .92rem; }
.sidebar .count { margin-top: 6px; color: var(--muted); }
.sidebar label { display: block; margin-top: 22px; font-weight: 650; font-size: .9rem; }
.sidebar progress { display: block; width: 100%; height: 10px; margin-top: 8px; border: 0; border-radius: 99px; color: var(--blue); background: #c4d1e2; appearance: none; overflow: hidden; }
progress::-webkit-progress-bar { background: #c4d1e2; }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
.round-label { color: var(--blue-dark); margin-top: 8px; font-size: .9rem; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.question-position { margin-bottom: 10px; color: var(--muted); font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.question-sheet h1 { font-size: 1.52rem; line-height: 1.4; max-width: 64ch; }
#answer-hint { margin-top: 13px; }
.answers { display: grid; gap: 9px; margin-top: 16px; }
.answer { display: grid; grid-template-columns: 2.1rem minmax(0,1fr); gap: 12px; align-items: start; width: 100%; padding: 10px 13px; min-height: 51px; border: 1px solid var(--control); border-radius: 6px; color: var(--ink); background: #fff; text-align: start; cursor: pointer; }
.answer:hover:not([aria-disabled="true"]) { border-color: var(--blue); background: #eef4fc; }
.answer:active:not([aria-disabled="true"]) { background: #dce9f9; }
.answer[aria-disabled="true"] { cursor: default; }
.answer-letter { align-self: start; min-height: 28px; display: grid; place-items: center; background: #e8eef6; border-radius: 4px; font-size: .9rem; font-weight: 750; color: var(--blue-dark); }
.answer-label { padding-top: 1px; }
.answer-state { display: block; font-weight: 750; font-size: .9rem; }
.answer[data-state="pending"] { border-color: var(--blue); background: #eef4fc; }
.answer[data-state="wrong"] { border-color: #ab6466; background: var(--bad-bg); }
.answer[data-state="wrong"] .answer-state { color: var(--bad); }
.answer[data-state="correct"] { border-color: #51836c; background: var(--good-bg); }
.answer[data-state="correct"] .answer-state { color: var(--good); }
#grade-status:not(:empty), #grade-error:not(:empty) { margin-block: 14px 0; }
.feedback { border-top: 1px solid var(--line); margin-top: 25px; padding-top: 22px; }
.feedback[data-result="wrong"] h2 { color: var(--bad); }
.feedback[data-result="correct"] h2 { color: var(--good); }
.answer-summary { margin-top: 8px; }
.worked-answer h3 { margin-block: 19px 5px; }
.worked-answer p, .worked-answer ol { max-width: 70ch; }
.formula { padding: 11px 14px; background: #edf3fb; border-radius: 5px; }
.steps { padding-inline-start: 1.55rem; }
.steps li { white-space: pre-wrap; padding-inline-start: 3px; }
.steps li + li { margin-top: 4px; }
.result-sheet { max-width: 670px; }
.score { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-weight: 750; }
.score strong { color: var(--blue-dark); font-size: 2.4rem; font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.035em; }
.result-sheet > .muted { margin-top: 8px; }

@media (max-width: 800px) {
  .frame { width: min(calc(100% - 40px), 1120px); }
  .main { padding-block: 35px 48px; }
  .intro, .login-form, .padded { padding: 28px; }
  .study-grid { grid-template-columns: minmax(0, 1fr) minmax(180px, 220px); gap: 16px; }
}
@media (max-width: 620px) {
  .frame { width: calc(100% - 28px); }
  .topbar { min-height: 62px; }
  .account { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand { gap: 7px; flex: 0 0 auto; max-width: 50%; }
  .brand > span { overflow-wrap: normal; }
  #account-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .account .button { padding-inline: 10px; }
  .main { padding-block: 21px 34px; }
  h1 { font-size: 1.7rem; }
  .split-login { display: flex; flex-direction: column; margin-top: 0; }
  .login-form { order: -1; }
  .intro { border-radius: 0 0 7px 7px; }
  .intro h2 { font-size: 1.45rem; }
  .intro > p { margin-top: 8px; }
  .path-list { margin-top: 15px; }
  .intro, .login-form, .padded, .sidebar { padding: 20px; }
  .study-grid { grid-template-columns: minmax(0, 1fr); }
  .question-sheet h1 { font-size: 1.25rem; }
}

.question-image{display:block;max-width:100%;height:auto;margin:.75rem 0;border:1px solid #ddd;border-radius:6px;background:#fff}
.question-image[hidden]{display:none}

.marks { display: flex; gap: 10px; margin: 18px 0 0; }
.mark { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.mark dt { font-size: .8rem; color: var(--muted); }
.mark dd { margin: 2px 0 0; font-size: 1.5rem; font-weight: 750; }
.mark.good { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.mark.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.mark.good dt, .mark.bad dt { color: inherit; }
.result-marks { max-width: 480px; margin-block: 16px 8px; }
.review { margin-top: 28px; }
.review-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 14px; }
.review-item { padding: 20px 24px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: var(--radius); }
.review-prompt { font-weight: 600; margin: 6px 0 10px; }
.review-answer { margin: 6px 0; padding: 8px 12px; border-radius: 6px; }
.review-answer.wrong { background: var(--bad-bg); color: var(--bad); }
.review-answer.correct { background: var(--good-bg); color: var(--good); }
.review-details { margin-top: 10px; }
.review-details summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.bank { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.bank-sets { margin: 8px 0 14px; padding-left: 18px; font-size: .88rem; color: var(--muted); max-height: 220px; overflow: auto; }
.bank .button { width: 100%; margin-top: 8px; }

/* Phone sign-in, plan, payment */
.button.small { min-height: 36px; padding: 5px 12px; font-size: .88rem; }
.plan-badge { padding: 3px 9px; border-radius: 99px; background: var(--rail); color: var(--muted); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.plan-badge[data-paid="true"] { background: var(--good-bg); color: var(--good); }
#code-form .action-row { margin-top: 12px; }
#code-form .secondary { flex: 1 1 auto; }
.trial-note { margin-top: 14px; padding: 10px 12px; border-radius: 6px; background: #fff7e6; color: #6b4a00; font-size: .9rem; }
.link-button { padding: 0; border: 0; background: none; color: var(--blue-dark); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.pay-sheet { max-width: 560px; margin-inline: auto; }
.pay-price { margin-block: 10px 12px; font-size: 1.1rem; }
.pay-price strong { font-size: 1.8rem; letter-spacing: -.02em; }
.pay-step { margin-top: 18px; font-weight: 700; }
.pay-qr { display: block; width: min(260px, 100%); aspect-ratio: 1; margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; image-rendering: pixelated; }
.pay-banks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.bank-link { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--control); border-radius: 6px; color: var(--blue-dark); font-weight: 650; text-decoration: none; font-size: .9rem; }
.bank-link:hover { background: #eef4fb; }
.upsell { margin-top: 24px; padding: 16px; border-radius: 6px; background: #fff7e6; color: #4d3500; }
.upsell .button { margin-top: 12px; }

/* Study: timer, bookmark, navigator */
.question-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.question-bar .question-position { margin: 0 auto 0 0; }
.timer { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--rail); font-weight: 750; font-variant-numeric: tabular-nums; }
.timer[data-level="mid"] { background: #fff1d6; color: #6b4a00; }
.timer[data-level="low"] { background: var(--bad-bg); color: var(--bad); }
.bookmark { gap: 6px; }
.bookmark[aria-pressed="true"] { background: #fff1d6; border-color: #c98a00; color: #6b4a00; }
.bookmark[aria-pressed="true"] svg { fill: currentColor; }
.nav-row { justify-content: space-between; }
.nav-row .button { flex: 1 1 140px; }
.navigator-title { margin-top: 24px; font-size: .95rem; }
.navigator { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; max-height: 320px; overflow-y: auto; }
.nav-cell { position: relative; width: 100%; min-height: 40px; border: 1px solid var(--control); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.nav-cell:hover { border-color: var(--blue); }
.nav-cell[data-status="good"] { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.nav-cell[data-status="bad"] { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.nav-cell[data-marked="true"]::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #c98a00; }
.nav-cell[aria-current="step"] { outline: 3px solid var(--blue); outline-offset: 1px; }
.navigator-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; font-size: .8rem; }
.key { display: inline-block; width: 10px; height: 10px; margin-inline-end: -6px; border-radius: 3px; }
.key-good { background: var(--good); }
.key-bad { background: var(--bad); }
.key-mark { background: #c98a00; border-radius: 50%; }
.side-actions { margin-top: 18px; }
.side-actions .button { width: 100%; }

@media (max-width: 760px) {
  .account { gap: 8px; }
  .plan-badge { display: none; }
}

h1[tabindex="-1"]:focus:not(:focus-visible), h2[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.nav-cell[aria-current="step"] { outline-offset: -1px; box-shadow: inset 0 0 0 1px var(--blue); }
.intro-trial { margin-top: 24px; color: #e0eafb; font-weight: 650; }

.device-note { font-size: .9rem; padding: 8px 12px; border-left: 3px solid var(--blue, #2563eb); background: rgba(37,99,235,.06); border-radius: 4px; }
.device-limit { margin: 14px 0; padding: 16px 18px; border: 1px solid var(--bad); background: var(--bad-bg); border-radius: 8px; }
.device-limit h2 { font-size: 1.02rem; margin: 0 0 6px; color: var(--bad); }
.device-limit p { margin: 0 0 12px; }
.device-limit .message { margin: 10px 0 0; color: inherit; }

.bank-link { gap: 10px; }
.bank-link img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; flex: none; background: #fff; }
