:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17122f;
  background: #f4f2fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, a { font: inherit; }
.hidden { display: none !important; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus { position: fixed; z-index: 20; inset: 1rem auto auto 1rem; }
.app-header { background: #100060; color: white; padding: 1rem; }
.header-inner, .progress-meta, .section-heading, .welcome-actions, .column-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand-mark, .success-icon { font-weight: 800; }
.brand-copy p, .brand-copy h1, .surface h2 { margin: 0; }
.page-shell { width: min(70rem, calc(100% - 2rem)); margin: 2rem auto; }
.surface { padding: clamp(1.25rem, 4vw, 2.5rem); border-radius: 1rem; background: white; box-shadow: 0 .75rem 2rem #26145d14; }
.centered { text-align: center; }
.intro-grid, .test-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); gap: 1rem; }
.button, .text-button, .proctor-indicator { min-height: 44px; border-radius: .65rem; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .75rem 1.15rem; border: 1px solid #261187; text-decoration: none; }
.button-primary { color: white; background: #261187; }
.button-secondary { color: #261187; background: white; }
.keypad { display: grid; grid-template-columns: repeat(5, minmax(2.75rem, 1fr)); gap: .5rem; margin-block: 1rem; }
.keypad button { min-height: 3rem; }
.number-stack { min-height: 12rem; display: grid; place-items: center; font-size: 2rem; }
.number-stack { width: min(100%, 15rem); margin-inline: auto; align-content: center; gap: .3rem; padding: 1rem; border: 1px solid #ddd8eb; border-radius: .85rem; background: #faf9fe; }
.number-row { display: grid; width: 100%; min-height: 2.35rem; place-items: center; border-radius: .45rem; color: #817b91; font-weight: 800; font-variant-numeric: tabular-nums; }
.number-row.is-pair { color: #100060; background: #eeeaff; }
.answer-row { display: grid; width: 100%; min-height: 2.35rem; place-items: center; border: 2px dashed #a9a0ca; border-radius: .45rem; color: #261187; font-weight: 800; }
.practice-card, .test-card { max-width: 48rem; margin-inline: auto; }
.stage-help, .feedback { text-align: center; color: #625c70; }
.feedback { min-height: 1.5rem; font-weight: 750; }
.feedback.correct { color: #116344; }
.feedback.wrong { color: #9c251f; }
.step-badge { flex: 0 0 auto; padding: .35rem .65rem; border-radius: 999px; color: #261187; background: #eeeaff; font-size: .8rem; font-weight: 800; }
.keypad button { border: 1px solid #bdb5d3; border-radius: .55rem; color: #100060; background: white; font-weight: 800; cursor: pointer; }
.keypad button:hover { border-color: #261187; background: #f2effc; }
.button:disabled, .keypad button:disabled { cursor: not-allowed; opacity: .45; }
.instruction-box { margin-block: 1.25rem; padding: 1rem; border-left: 4px solid #261187; background: #f8f7fc; }
.example { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; width: fit-content; margin-top: 1.25rem; padding: 1rem; border-radius: .75rem; background: #f2effc; }
.summary-card p, .test-note p { color: #625c70; }
.summary-card hr { border: 0; border-top: 1px solid #e2ddec; }
.completion-link { margin-top: 1rem; }
.proctor-indicator.align-left { right: auto; left: 1rem; }
dialog::backdrop { background: #100060aa; backdrop-filter: blur(3px); }
.dialog-body { padding: 1.5rem; text-align: center; }
.dialog-icon { display: grid; width: 3.5rem; height: 3.5rem; margin-inline: auto; place-items: center; border-radius: 50%; color: #116344; background: #e8f7ef; font-size: 1.7rem; }
:focus-visible { outline: 3px solid #e1bd00; outline-offset: 3px; }
.progress-track { overflow: hidden; height: .5rem; border-radius: 999px; background: #ffffff33; }
.progress-value { height: 100%; width: 0; background: #78e6c2; }
.proctor-indicator { position: fixed; right: 1rem; bottom: 1rem; padding: .65rem .9rem; border: 0; color: white; background: #272238; }
dialog { border: 0; border-radius: 1rem; max-width: 28rem; }

@media (max-width: 720px) {
  .intro-grid, .test-layout { grid-template-columns: 1fr; }
  .page-shell { margin-block: 1rem 5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .spinner { width: 2rem; height: 2rem; margin: 0 auto 1rem; border: .2rem solid #ddd5ff; border-top-color: #261187; border-radius: 50%; animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(1turn); } }
}
