:root {
  font-family: "DM Sans", Inter, system-ui, sans-serif;
  color: var(--brand-navy);
  background: var(--brand-paper);
  --blue: var(--brand-violet);
  --blue-dark: var(--brand-navy);
  --line: var(--brand-line);
  --muted: #516078;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 3px solid var(--brand-focus); outline-offset: 3px; }
a { color: var(--blue); text-underline-offset: 4px; }
.skip { position: fixed; top: -60px; left: 16px; z-index: 5; background: white; padding: 10px; }
.skip:focus { top: 8px; }
.site-header { background: white; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1240px; margin: auto; padding: 0 34px; height: 70px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; display: flex; gap: 10px; align-items: center; letter-spacing: -.03em; }
.library { font-size: 14px; font-weight: 700; text-decoration: none; }
.library:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); max-width: 1240px; margin: auto; padding: 32px 34px 60px; gap: 27px; align-items: start; }
.sidebar { display: grid; gap: 16px; }
.progress-card, #topic-menu { background: white; border: 1px solid var(--line); border-radius: 16px; }
.progress-card { padding: 17px 16px; }
.progress-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
#progress-text { color: var(--muted); font-variant-numeric: tabular-nums; }
progress { display: block; appearance: none; width: 100%; height: 7px; border: 0; border-radius: 99px; overflow: hidden; margin-top: 11px; background: #edf1f9; }
progress::-webkit-progress-bar { background: #edf1f9; }
progress::-webkit-progress-value { background: var(--brand-focus); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--brand-focus); }
#topic-menu > summary { display: none; }
#topics { padding: 7px 9px 11px; }
.topic-group h2 { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; margin: 14px 9px 5px; }
.topic { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 9px; border: 0; border-radius: 8px; background: transparent; text-align: left; color: #273657; font-size: 13px; line-height: 1.2; min-height: 36px; }
.topic:hover { background: #f3f5fb; }
.topic[aria-current=true] { background: var(--brand-tint); color: var(--blue-dark); font-weight: 800; }
.topic-count { color: #576687; font-size: 11px; font-variant-numeric: tabular-nums; }
.hero { border-radius: 21px; padding: 29px 34px 28px; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.hero::before, .hero::after { content: ""; z-index: -1; position: absolute; border-radius: 50%; transform: rotate(-28deg); border: 1px solid #7860dc55; pointer-events: none; }
.hero::before { width: 365px; height: 174px; right: -100px; top: -8px; box-shadow: 0 0 0 15px #7860dc1c, 0 0 0 30px #7860dc17, 0 0 0 45px #7860dc11, 0 0 0 60px #7860dc0a; }
.hero::after { width: 122px; height: 55px; right: 78px; top: 41px; background: #7860dc18; }
.hero h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(42px, 5vw, 68px); line-height: .98; letter-spacing: -.055em; margin: 0; }
.hero p { line-height: 1.5; margin: 14px 0 0; font-size: 14px; }
.shuffle { white-space: nowrap; background: #e4d9ff; border: 0; border-radius: 10px; color: #17244b; font-size: 13px; font-weight: 800; padding: 11px 13px; }
.shuffle:hover { background: #d8c9fc; }
.shuffle span { margin-right: 4px; font-size: 17px; }
.practice { margin-top: 21px; background: white; border: 1px solid var(--line); border-radius: 18px; overflow: clip; scroll-margin-top: 16px; }
.practice-head { padding: 15px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.topic-label { color: var(--blue); font-weight: 800; }
.topic-label a { text-decoration: none; }
.topic-label a:hover { text-decoration: underline; }
.stage-count { color: var(--muted); font-weight: 700; }
.practice-body { padding: 20px 24px; }
.drill-title { font-size: clamp(21px, 3vw, 29px); letter-spacing: -.035em; line-height: 1.14; margin: 0 0 12px; }
.scenario { border-left: 3px solid #8a6cdc; border-radius: 0 9px 9px 0; background: #f3eeff; padding: 12px 15px; line-height: 1.55; font-size: 15px; margin: 0 0 14px; }
.instruction { font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.controls button, .pager button, .answer button { min-height: 40px; border: 1px solid #ccd5e7; border-radius: 9px; color: var(--blue-dark); background: white; font-size: 13px; font-weight: 750; padding: 8px 12px; }
.controls button:hover, .pager button:hover:not(:disabled), .answer button:hover { background: #f3eeff; }
.controls button.primary, .answer button.primary, .pager button.primary { color: white; background: var(--blue-dark); border-color: var(--blue-dark); }
.controls button.primary:hover, .answer button.primary:hover, .pager button.primary:hover { background: var(--brand-violet); }
.timer { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2ch; font-size: 13px; }
.hint, .answer, .followup { padding: 12px 15px; border-radius: 10px; margin: 14px 0 0; line-height: 1.55; font-size: 14px; }
.hint { background: #fff0f7; }
.answer { background: #f3eeff; }
.followup { background: #eaf8fa; }
.answer p, .followup p { margin: 5px 0 0; }
.answer button { margin-top: 10px; }
.draft { display: block; margin: 2px 0 14px; font-size: 13px; font-weight: 700; }
textarea { display: block; width: 100%; margin-top: 6px; padding: 10px; min-height: 88px; resize: vertical; border: 1px solid #b8c5df; border-radius: 9px; color: #17244b; font-size: 14px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 24px; border-top: 1px solid var(--line); background: #fbfcfe; }
.pager button:disabled { opacity: .45; }
.pager .primary { margin-left: auto; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 205px minmax(0, 1fr); gap: 14px; padding: 18px 18px 40px; }
  .header-inner { padding: 0 18px; }
  .hero { padding: 24px; }
  .hero { align-items: start; flex-direction: column; }
}
@media (max-width: 620px) {
  .layout { grid-template-columns: 1fr; }
  .header-inner { height: 58px; }
  .sidebar { grid-template-columns: 1fr; gap: 8px; }
  #topic-menu > summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 15px; font-weight: 750; font-size: 13px; list-style: none; }
  #topic-menu > summary::-webkit-details-marker { display: none; }
  #topics { border-top: 1px solid var(--line); }
  .progress-card { padding: 12px 15px; }
  .hero { border-radius: 16px; }
  .desktop { display: none; }
  .practice-head, .practice-body, .pager { padding-left: 16px; padding-right: 16px; }
}
[hidden] { display: none !important; }
.controls button:disabled { opacity: .48; }
#timer-status { font-size: 13px; color: var(--muted); }

@media (max-width: 370px) {
  .header-inner { gap: 10px; }
  .brand, .library { font-size: 13px; }
}
