:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: #16243b;
  background: #f3f6fa;
  font-size: 16px;
  line-height: 1.6;
  --ink: #16243b;
  --muted: #566581;
  --line: #dce4ef;
  --blue: #244dcc;
  --blue-dark: #1b3cad;
  --night: #131f38;
  --paper: #fff;
  --shadow: 0 6px 24px #172a4f0b;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #5875ff; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.22; letter-spacing: -.035em; }
h2 { font-size: 1.3rem; line-height: 1.3; }
h3 { font-size: 1.135rem; line-height: 1.35; }
small { font-size: .86rem; }
summary { cursor: pointer; }
.muted { color: var(--muted); }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus { position: fixed; left: 12px; top: 12px; z-index: 20; padding: 8px 14px; background: white; }
.panel { border: 1px solid var(--line); background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .94rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.primary { background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.secondary { color: #263b70; background: #f6f8fc; border-color: #d4deef; }
.secondary:hover { background: #eaf0fd; border-color: #aebbdf; }
.tertiary { background: transparent; color: var(--muted); }
.tertiary:hover { background: #eef2f8; }
.button:disabled { opacity: .55; cursor: default; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 4;
  width: 220px;
  display: flex;
  flex-direction: column;
  padding: 28px 17px 19px;
  background: var(--night);
  color: #f7faff;
  overflow-y: auto;
}
.brand, .login-brand { display: flex; gap: 11px; align-items: center; color: inherit; font-size: 1.32rem; font-weight: 750; letter-spacing: -.012em; text-decoration: none; }
.brand { padding: 0 9px; margin-bottom: 30px; }
.brand-text { display: flex; flex-direction: column; gap: 4px; line-height: 1.15; white-space: nowrap; }
.brand-text small { color: #c7d5f1; font-size: .82rem; font-weight: 550; }
.brand-icon { width: 35px; height: 35px; flex: 0 0 35px; position: relative; border-radius: 9px; background: #dce5ff; overflow: hidden; }
.brand-icon::before, .brand-icon::after { content: ""; position: absolute; inset: 9px; border: 2px solid #244dcc; border-radius: 3px; }
.brand-icon::after { transform: rotate(45deg) scale(.78); }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: #cbd5e9;
  text-decoration: none;
  border-radius: 9px;
  font-weight: 550;
  font-size: .96rem;
  min-height: 43px;
}
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #26395c; color: #fff; }
.nav-icon { color: #a9c3fb; font-size: 1.27rem; width: 20px; text-align: center; line-height: 1; }
.sidebar-account { margin-top: auto; padding: 17px 2px 0; border-top: 1px solid #354563; display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.user-chip { color: inherit; display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; }
.user-chip > span + span { min-width: 0; }
.user-chip strong, .user-chip small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: .88rem; }
.user-chip small { font-size: .77rem; color: #b6c5de; }
.user-chip:hover small { color: white; text-decoration: underline; }
.avatar { background: #d9e4ff; color: #223f83; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; font-size: .9rem; font-weight: 700; }
.sign-out { border: none; background: transparent; color: #cbd5e9; padding: 6px; white-space: nowrap; font-size: .83rem; }
.sign-out:hover { color: white; text-decoration: underline; }
.main { margin-left: 220px; padding: 34px clamp(22px, 4vw, 58px) 56px; min-width: 0; }
.main > * { width: min(100%, 1260px); margin-inline: auto; }
.main > a.back-link { display: block; }
.section { margin-top: 31px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-title > span { font-size: .9rem; }
.page-heading { margin: 0 auto 25px; }
.page-heading p { color: var(--muted); margin-top: 8px; }
.compact { margin-bottom: 18px; }
.split-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; }
.back-link, .subtle-link { width: fit-content; font-size: .9rem; text-decoration: none; font-weight: 650; }
.main > .back-link { width: min(100%, 1260px); margin-bottom: 12px; }
.back-link:hover, .subtle-link:hover { text-decoration: underline; }

.welcome {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(106deg, #172855 6%, #1f397b 65%, #284c9e);
  border-radius: 18px;
  color: white;
  padding: clamp(24px, 4vw, 39px) clamp(22px, 4vw, 42px);
}
.welcome h1 { position: relative; font-size: clamp(1.85rem, 3.5vw, 2.7rem); }
.welcome p { position: relative; margin-top: 10px; color: #e1eaff; }
.bank-total { position: relative; width: fit-content; margin-top: 19px; border: 1px solid #a8c4ff57; border-radius: 7px; padding: 3px 10px; background: #152e6d8a; color: #eef3ff; font-size: .88rem; }
.bank-total span { margin-inline: 5px; color: #c4d6ff; }
.welcome-art { position: absolute; z-index: -1; inset: 0 0 0 auto; width: 39%; background-image: radial-gradient(#a7c2ff55 1.2px, transparent 1.2px); background-size: 17px 17px; mask-image: linear-gradient(90deg, transparent, #000 40%); }
.welcome-art div, .welcome-art i { position: absolute; width: 210px; height: 210px; border: 1px solid #a0bfff90; border-radius: 50%; right: 37px; top: -32px; }
.welcome-art i { top: 44px; right: -13px; border-color: #91cdfab3; }
.welcome-art b { position: absolute; width: 10px; height: 10px; background: #aec4ff; border-radius: 50%; right: 86px; top: 48px; box-shadow: -142px 84px 0 -1px #9bf4df; }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 15px 19px; border-color: #b8cbf4; background: #f8faff; }
.resume .muted { font-size: .9rem; margin-top: 2px; }
.metric-grid {
  margin-top: 19px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}
.metric-grid > div { padding: 13px 19px; }
.metric-grid > div + div { border-left: 1px solid var(--line); }
.metric-grid span { display: block; color: var(--muted); font-size: .88rem; }
.metric-grid strong { display: block; font-size: 1.48rem; line-height: 1.35; margin-top: 3px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.metric-grid strong small { color: var(--muted); font-weight: 550; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.module-card {
  --tone: #1d5ec0;
  --tone-bg: #e6efff;
  display: flex;
  flex-direction: column;
  padding: 17px 17px 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.module-card:hover { border-color: #8aa4df; box-shadow: 0 6px 18px #172a4f18; }
.tone-2 { --tone: #007560; --tone-bg: #e0f5eb; }
.tone-3 { --tone: #6443a5; --tone-bg: #eee7fb; }
.tone-4 { --tone: #9a4d05; --tone-bg: #fff0d7; }
.tone-5 { --tone: #8b3262; --tone-bg: #fce9f2; }
.tone-6 { --tone: #1d708f; --tone-bg: #e2f4fa; }
.module-top, .module-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.module-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--tone); background: var(--tone-bg); border-radius: 11px; font-size: 1.45rem; font-family: "Cambria Math", Georgia, serif; font-weight: 700; }
.count-chip { font-size: .82rem; color: #465879; background: #eef2f8; padding: 3px 8px; border-radius: 6px; }
.module-card h3 { margin-top: 13px; }
.module-card p { font-size: .88rem; color: var(--muted); margin: 5px 0 14px; }
.module-bottom { padding-top: 12px; border-top: 1px solid #e6edf6; margin-top: auto; font-size: .86rem; color: var(--muted); }
.module-bottom strong { color: var(--blue); font-weight: 650; }

.fields { display: grid; gap: 8px; }
.fields label:not(:first-of-type) { padding-top: 6px; }
label, .teacher-fields label { color: #263750; font-weight: 620; font-size: .95rem; }
input:not([type=radio], [type=hidden]), select, textarea {
  width: 100%;
  min-height: 45px;
  padding: 8px 11px;
  border: 1px solid #bac9df;
  border-radius: 8px;
  background-color: #fff;
  color: var(--ink);
}
select {
  appearance: none;
  padding-right: 31px;
  background-image: linear-gradient(45deg, transparent 51%, #456083 52%), linear-gradient(135deg, #456083 52%, transparent 53%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 6px;
  background-repeat: no-repeat;
}
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 25px; max-width: 880px; margin-left: 0; }
.setup-section { display: grid; align-content: start; gap: 8px; }
.setup-section h2 { margin-bottom: 7px; }
.setup-section label:not(:first-of-type), .inset-field { margin-top: 7px; }
.settings-submit { grid-column: 1 / -1; padding-top: 15px; border-top: 1px solid var(--line); }
.account-panel { padding: 23px; max-width: 500px; margin-left: 0; }
.account-panel h2 { margin-bottom: 13px; }
.account-panel .button, .disclosure .fields .button { justify-self: start; margin-top: 6px; }
.notice { padding: 11px 14px; border-radius: 9px; border: 1px solid #a8d9cb; background: #e9f7f2; color: #14594b; margin-bottom: 15px; }
.notice-error { color: #8c2636; background: #fff0f1; border-color: #edbcc4; }

.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 226px; gap: 17px; align-items: start; }
.question-stack, .review-content { min-width: 0; }
.question-card { padding: clamp(16px, 2.5vw, 27px); margin-bottom: 12px; }
.question-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.question-top h2 { flex: none; }
.source-line { color: var(--muted); font-size: .82rem; margin: 8px 0 16px; overflow-wrap: anywhere; }
.question-stem { font-size: 1.075rem; line-height: 1.82; overflow-wrap: anywhere; }
.question-stem > p, .solution > p { overflow-x: auto; }
.question-stem p + p, .solution p + p { margin-top: 8px; }
.question-stem p[lang] { color: #42536f; }
.question-stem math, .option-content math, .solution math { font-family: "Cambria Math", "STIX Two Math", math; }
.question-table { overflow-x: auto; margin-block: 10px; }
.question-table table { border-collapse: collapse; width: auto; margin: 2px; }
.question-table td { padding: 4px 9px; border: 1px solid #b9c7db; text-align: center; }
.diagram { max-width: 100%; height: auto; vertical-align: middle; margin: 4px 0; object-fit: contain; }
.answer-options { display: grid; gap: 7px; margin: 18px 0 0; border: 0; padding: 0; min-width: 0; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  border: 1px solid #cbd5e7;
  border-radius: 9px;
  padding: 7px 10px;
  background: #fafcff;
  font-size: 1rem;
  font-weight: 450;
  overflow-wrap: anywhere;
}
label.option { cursor: pointer; }
label.option:hover { background: #edf3ff; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option:has(input:focus-visible) { outline: 3px solid #5875ff; outline-offset: 2px; }
.option:has(input:checked) { border-color: #637ee6; background: #e9efff; }
.option-letter { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border-radius: 6px; background: #e8eef8; color: #273a64; font-weight: 750; }
.option:has(input:checked) .option-letter { background: var(--blue); color: white; }
.option-content { min-width: 0; }
.choice-note { color: var(--muted); font-size: .82rem; margin-left: auto; text-align: right; flex: 0 0 auto; }
.choice-note + .choice-note { margin-left: 2px; }
.option-correct { background: #eaf8ef; border-color: #a5d5b7; }
.option-correct .option-letter { background: #c8ebd4; color: #155737; }
.option-incorrect { background: #fff0f1; border-color: #e7b4bd; }
.option-incorrect .option-letter { background: #f6d6dc; color: #8e2738; }
.question-buttons { justify-content: space-between; gap: 9px; }
.enhanced .question-buttons { display: flex; }
.answer-card { position: sticky; top: 18px; display: grid; gap: 12px; padding: 15px; }
.answer-card h2 { font-size: 1.13rem; }
.answer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.answer-number {
  display: grid;
  place-items: center;
  min-height: 33px;
  border: 1px solid #d7dfed;
  border-radius: 6px;
  color: #3e4c6e;
  background: #f6f8fc;
  font-size: .88rem;
  text-decoration: none;
}
.answer-number.answered { background: #dbe7ff; border-color: #b7caf7; color: #173e9c; font-weight: 600; }
.answer-number:hover, .answer-number[aria-current] { border-color: var(--blue); outline: 1px solid var(--blue); outline-offset: 0; }
.timer { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 9px 8px; border-radius: 8px; background: #eaf0ff; color: #264692; }
.timer span { font-size: .83rem; font-weight: 650; }
.timer strong { font-size: 1.27rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.timer.is-low { background: #fff0e8; color: #a14119; }
.save-state, #progress { font-size: .83rem; color: var(--muted); }
.save-state[data-problem=true] { color: #9a3340; }
.retry-button { width: 100%; }
.enhance-only { display: none; }
.enhanced .enhance-only:not(.question-buttons) { display: block; }
.enhanced .enhance-only.button { display: inline-flex; }
dialog { max-width: min(430px, calc(100% - 30px)); padding: 21px; }
dialog::backdrop { background: #0c163b68; }
dialog p { margin: 9px 0 18px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.review-stack { display: grid; gap: 10px; }
.review-stack .section-title { margin-bottom: 3px; }
.review-item { scroll-margin: 16px; }
.review-item summary { display: flex; align-items: center; gap: 10px; padding: 13px 17px; }
.review-item summary::before { content: ""; width: 8px; height: 8px; margin-right: 3px; border-right: 2px solid #4a638d; border-bottom: 2px solid #4a638d; transform: rotate(-45deg); flex: 0 0 8px; }
.review-item[open] summary::before { transform: rotate(45deg); }
.review-item summary > strong { white-space: nowrap; }
.review-item summary > span:not(.status-chip) { font-size: .88rem; color: var(--muted); }
.review-item summary .status-chip { margin-left: auto; }
.review-content { border-top: 1px solid var(--line); padding: 8px 18px 18px; }
.review-content > .muted { margin-top: 12px; font-size: .88rem; }
.solution { margin-top: 10px; padding: 13px 15px; background: #f0f5fd; border-left: 3px solid #7796d9; border-radius: 7px; overflow-wrap: anywhere; }
.solution h3 { margin-bottom: 6px; }
.solution .reference { color: var(--muted); font-size: .84rem; margin-top: 10px; }
.status-chip { display: inline-block; border-radius: 5px; padding: 2px 8px; color: #4b5e78; background: #eff3fa; font-size: .82rem; white-space: nowrap; }
.status-chip.correct { color: #176747; background: #e5f5ed; }
.status-chip.incorrect { color: #8e3142; background: #fbe8eb; }

.list-panel { overflow: hidden; }
.list-link { display: flex; justify-content: space-between; align-items: center; gap: 11px; padding: 11px 15px; text-decoration: none; color: var(--ink); }
.list-link + .list-link { border-top: 1px solid var(--line); }
.list-link:hover, .list-link:focus-visible { background: #edf3ff; }
.list-link strong, .list-link small { display: block; overflow-wrap: anywhere; }
.list-link small, .records small { color: var(--muted); }
.list-link .score, .records .score { color: #2749a5; font-weight: 700; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.records { width: 100%; border-spacing: 0; text-align: left; }
.records th, .records td { padding: 11px 15px; white-space: nowrap; font-size: .9rem; }
.records th { color: var(--muted); background: #f6f8fc; font-weight: 650; }
.records td { border-top: 1px solid var(--line); }
.records small { display: block; }
.records a { text-decoration: none; font-weight: 650; }
.records a:hover { text-decoration: underline; }
.records .recipient-names { max-width: 20rem; white-space: normal; overflow-wrap: anywhere; }
.task-detail-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.task-revoke { max-width: 23rem; }
.task-revoke summary { padding: 8px; color: #992e41; font-weight: 650; }
.task-revoke form { padding: 12px; background: #fff0f1; border-radius: 8px; }
.task-revoke form p { margin: 0 0 10px; }
.task-revoke button { color: #992e41; }
.pagination { display: flex; margin-top: 13px; }
.empty { padding: 28px 20px; text-align: center; }
.empty p { color: var(--muted); margin-top: 8px; }
.empty .button { margin-top: 13px; }
.empty-inline { padding: 13px 16px; color: var(--muted); }
.filter-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 13px; }
.filter-tabs a { padding: 5px 11px; border-radius: 7px; text-decoration: none; color: var(--muted); border: 1px solid #d9e3f4; background: white; font-size: .9rem; }
.filter-tabs a[aria-current], .filter-tabs a:hover { color: #20489e; background: #e7efff; border-color: #b9cef4; }
.disclosure { padding: 13px 17px; }
.disclosure summary { font-size: 1rem; font-weight: 650; }
.disclosure .fields { max-width: 410px; margin-top: 13px; }
.teacher-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) max-content; align-items: end; gap: 11px; margin-top: 14px; }
.teacher-fields label { display: block; margin-bottom: 6px; }
.audit-summary { padding: 16px 17px; margin-bottom: 15px; }
.audit-summary > p { margin-top: 7px; font-size: .9rem; }
.audit-summary-empty { font-weight: 620; }
.audit-summary-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 14px; margin-top: 15px; }
.audit-summary-groups ul { list-style: none; margin: 8px 0 0; padding: 0; }
.audit-summary-groups li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.audit-summary-groups a { font-weight: 650; overflow-wrap: anywhere; }
.audit-summary-groups small { color: var(--muted); }
.audit-filter { display: flex; flex-wrap: wrap; align-items: end; gap: 11px; padding: 14px 17px; }
.audit-filter label { display: block; margin-bottom: 6px; }
.audit-query { flex: 1 1 230px; min-width: 0; }
.audit-status { display: inline-block; padding: 3px 9px; border-radius: 6px; font-weight: 650; }
.audit-status-success { color: #17613c; background: #e6f5ed; }
.audit-status-failure { color: #992e41; background: #fdeef0; }
.audit-status-limited, .audit-status-denied { color: #794509; background: #fff2d8; }
.audit-pagination { gap: 8px; flex-wrap: wrap; }
.arena-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.arena-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid #344a82;
  border-radius: 20px;
  background: linear-gradient(120deg, #142144 8%, #243b77 61%, #47306b);
  color: #fff;
  box-shadow: 0 10px 24px #1c2a501c;
}
.arena-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 55%;
  background: radial-gradient(circle at 83% 12%, #ffd09955, transparent 33%), repeating-linear-gradient(125deg, transparent 0 18px, #a6c5ff36 18px 19px, transparent 19px 32px);
  mask-image: linear-gradient(90deg, transparent, #000);
  content: "";
}
.arena-hero p { margin-top: 8px; color: #e3edff; }
.arena-play-heading, .arena-result { margin-bottom: 19px; }
.task-result { background: linear-gradient(120deg, #182857 6%, #29407a 62%, #493273); }
.task-result h1 { overflow-wrap: anywhere; }
.task-feedback { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-top: 18px; padding-top: 15px; border-top: 1px solid #a9bded55; }
.task-feedback .task-feedback-message { flex: 1 1 21rem; margin: 0; }
.task-feedback-message strong { display: block; color: #fff; font-size: 1.2rem; }
.task-feedback .button { flex: 0 0 auto; }
.result-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.review-stack { scroll-margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .result-confetti { display: none; } }
.arena-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 15px; }
.arena-card { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 17px; border-top: 3px solid #5c67c6; }
.arena-done { border-top-color: #56848b; }
.arena-card h2 { overflow-wrap: anywhere; }
.arena-card { scroll-margin-top: 16px; }
.task-group { margin-top: 24px; }
.task-group > h2, .task-group > summary { margin-bottom: 12px; }
.task-group > summary { font-size: 1.08rem; }
.task-group > summary span { margin-left: 10px; font-size: .9rem; }
.arena-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: #435ba0; font-weight: 650; font-size: .86rem; }
.arena-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 3px; }
.arena-card-actions > * { flex: 1 1 auto; }
.arena-card .button { width: 100%; }
.arena-retry { margin-top: 14px; }
.arena-card progress { appearance: none; width: 100%; height: 7px; margin-top: 4px; overflow: hidden; border: 0; border-radius: 9px; background: #e6ebf5; color: #4d62c8; }
.arena-card progress::-webkit-progress-bar { background: #e6ebf5; }
.arena-card progress::-webkit-progress-value { border-radius: 9px; background: #4d62c8; }
.arena-card progress::-moz-progress-bar { border-radius: 9px; background: #4d62c8; }
.arena-levels { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; list-style: none; }
.arena-level { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #98a3c886; border-radius: 10px; background: #1c284d; color: #e1e9ff; font-weight: 700; font-size: .91rem; }
.arena-level.current { border-color: #ffdf91; background: #ffd77f; color: #352345; box-shadow: 0 0 0 3px #ffd77f35; }
.arena-level.answered { border-color: #9bd3f7; background: #bfdcfa; color: #223d78; }
.arena-level.skipped { border-color: #fbc6a5; background: #ffe5ca; color: #743916; }
.arena-question { animation: arena-enter .24s ease-out; }
@keyframes arena-enter { from { opacity: .8; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .arena-question { animation: none; } }
.arena-actions, .question-support { display: flex; flex-wrap: wrap; align-items: start; gap: 10px; margin-top: 15px; }
.arena-actions { justify-content: space-between; }
.arena-next { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.question-hint { min-width: 0; }
.question-hint[open] { flex: 1 1 100%; }
.question-hint summary { list-style: none; }
.question-hint summary::-webkit-details-marker { display: none; }
.hint-body { display: grid; gap: 5px; margin-top: 9px; padding: 12px 14px; border-left: 3px solid #6c81cd; border-radius: 0 8px 8px 0; background: #edf2ff; color: #263759; font-size: .94rem; }
.hint-body strong { display: inline-block; margin-right: 7px; }
.hint-body span { white-space: pre-line; overflow-wrap: anywhere; }
.unsure-option:has(:checked), .answer-number.skipped { border-color: #d8a662; background: #fff1d9; color: #734512; }
.unsure-option:focus-within { outline: 3px solid #5875ff; outline-offset: 3px; }
.builder-panel { min-width: 0; padding: 16px; }
.builder-panel > label:first-child { display: block; margin-bottom: 6px; }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 34%); gap: 15px; align-items: start; margin-block: 15px; }
.builder-layout.whole-paper { grid-template-columns: minmax(0, 1fr); }
.task-settings { margin-top: 0; }
.builder-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 9px 11px; margin-top: 11px; }
.builder-filters label { display: block; margin-bottom: 5px; }
.builder-filters button { justify-self: start; }
.builder-bank { display: grid; gap: 9px; max-height: min(58vh, 680px); overflow-y: auto; padding-right: 3px; margin-top: 12px; }
.builder-question { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; }
.builder-question-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.builder-question-head small, .builder-selected small, .student-pick small { display: block; color: var(--muted); }
.builder-question details { margin-top: 7px; }
.builder-question summary { color: var(--blue); font-weight: 600; }
.builder-question .question-stem { margin-top: 8px; }
.preview-options { padding-left: 26px; }
.preview-options li { margin-bottom: 4px; }
.preview-options img { max-width: 100%; height: auto; }
#pick-more { margin-top: 10px; }
#pick-status:not(:empty) { margin-top: 7px; }
.builder-side { position: sticky; top: 16px; display: grid; gap: 15px; min-width: 0; }
.builder-selected ol { max-height: min(31vh, 265px); overflow-y: auto; margin: 0; padding-left: 27px; }
.builder-selected li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.builder-selected li::marker { color: #465bb4; font-weight: 700; }
.builder-selected .button { min-height: 32px; margin-left: 3px; padding: 3px 8px; }
#pick-message:not(:empty) { margin-top: 7px; color: #823241; }
.student-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 6px; max-height: 170px; overflow: auto; margin: 7px 0 14px; }
.student-pick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 7px; overflow-wrap: anywhere; }
.student-pick input[type=checkbox] { flex: 0 0 1.05rem; width: 1.05rem; min-height: 0; height: 1.05rem; margin: 0; padding: 0; }
.bank-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) auto; align-items: end; gap: 12px; padding: 15px; margin-bottom: 14px; }
.bank-filters label { display: block; margin-bottom: 5px; }
.bank-list { overflow: hidden; }
.bank-list .builder-question { border: 0; border-radius: 0; padding: 14px 17px; }
.bank-list .builder-question + .builder-question { border-top: 1px solid var(--line); }
.bank-list h2 { font-size: 1rem; overflow-wrap: anywhere; }
.question-code { margin-top: 6px; color: var(--muted); font-size: .88rem; }
.question-code code { padding: 2px 6px; border-radius: 5px; background: #edf2fa; color: #264278; font: 600 .86em "Cascadia Code", Consolas, monospace; }
.bank-page-info, .bank-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: .9rem; }
.bank-page-info { justify-content: space-between; margin-bottom: 10px; }
.bank-pagination span { margin-right: auto; }
.module-rules { margin-top: 12px; }
.module-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 15px; }
.module-rule + .module-rule { border-top: 1px solid var(--line); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: 15px; }
.editor-side, .editor-panel { display: grid; gap: 15px; min-width: 0; }
.editor-panel { padding: clamp(14px, 2vw, 21px); }
.editor-field { display: grid; gap: 5px; min-width: 0; }
.editor-field textarea { resize: vertical; }
.editor-surface { min-width: 0; min-height: 50px; padding: 9px 11px; border: 1px solid #bac9df; border-radius: 8px; cursor: text; white-space: pre-wrap; }
#stem + .editor-surface, #solution + .editor-surface { min-height: 100px; }
.editor-surface > div + div, .editor-surface > p + p { margin-top: 4px; }
.editor-reference { color: var(--muted); font-size: .84rem; }
.editor-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
  .builder-layout { grid-template-columns: minmax(0, 1fr); }
  .builder-side { position: static; }
}
.error-panel { margin: 15vh auto 0; max-width: 500px; }

.standalone { padding: 26px; min-height: 100vh; display: grid; align-items: center; justify-content: center; background: radial-gradient(ellipse at 65% 25%, #fff, #edf2fb 70%); }
.login-layout { display: grid; grid-template-columns: 1.08fr 1fr; width: min(880px, calc(100vw - 52px)); min-height: 485px; background: white; border: 1px solid #d5dff0; border-radius: 19px; overflow: hidden; box-shadow: 0 16px 58px #162d571f; }
.login-hero { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; overflow: hidden; padding: clamp(22px, 4vw, 38px); background: linear-gradient(153deg, #14234c, #233d87); color: white; }
.login-brand { position: relative; }
.login-art { position: relative; height: 192px; margin: 8px 0; background-image: radial-gradient(#acd0ff64 1px, transparent 1px); background-size: 15px 15px; }
.plot-orbit { position: absolute; left: 23%; top: 7%; width: 160px; height: 160px; border: 1px solid #9bc0ffb2; border-radius: 50%; }
.plot-diagonal { position: absolute; width: 191px; height: 117px; inset: 28% auto auto 19%; border-left: 1px solid #9bc0ffa0; border-bottom: 1px solid #9bc0ffa0; }
.plot-diagonal::after { content: ""; position: absolute; height: 1px; width: 210px; background: #a9d6ff; transform-origin: left center; transform: rotate(-30deg); bottom: 19px; left: 13px; }
.login-art b, .login-art i { position: absolute; width: 10px; height: 10px; border-radius: 50%; top: 45%; left: 55%; background: #d3e3ff; box-shadow: 0 0 0 5px #aac3ff35; }
.login-art i { top: 24%; left: 69%; background: #8ae2da; }
.login-caption { max-width: 16em; color: #e7efff; font-size: clamp(1.13rem, 2.4vw, 1.6rem); font-weight: 650; line-height: 1.45; text-wrap: balance; }
.login-form { padding: clamp(20px, 5vw, 51px); align-self: center; }
.login-form h1 { letter-spacing: -.02em; }
.login-form > p { margin-top: 7px; }
.login-form .fields { margin-top: 22px; }
.login-submit { width: 100%; margin-top: 11px; }

@media (max-width: 1100px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-fields .button { justify-self: start; }
}
@media (max-width: 850px) {
  .sidebar { position: static; width: 100%; padding: 11px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .brand { margin: 0; padding: 0; font-size: 1.12rem; grid-column: 1; }
  .brand-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .brand-icon::before, .brand-icon::after { inset: 7px; }
  .sidebar-account { margin: 0; padding: 0; border: 0; grid-row: 1; grid-column: 2; }
  .sidebar nav { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar nav a { font-size: .9rem; min-height: 37px; padding: 6px 11px; gap: 5px; }
  .nav-icon { font-size: 1rem; width: 16px; }
  .main { margin-left: 0; padding: 18px 17px 36px; }
}
@media (max-width: 600px) {
  .bank-filters { grid-template-columns: minmax(0, 1fr); }
  .task-settings { grid-template-columns: minmax(0, 1fr); }
  .bank-filters button { justify-self: start; }
  .standalone { align-items: start; padding: 17px; }
  .login-layout { width: min(420px, calc(100vw - 34px)); grid-template-columns: 1fr; min-height: 0; }
  .login-hero { gap: 10px; padding: 17px 19px; }
  .login-art { display: none; }
  .login-caption { max-width: none; font-size: .95rem; font-weight: 550; }
  .login-form { padding: 24px 19px; }
  .welcome-art { opacity: .7; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid > div { padding: 10px 12px; }
  .metric-grid > div:nth-child(3) { border-left: 0; }
  .metric-grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .module-grid { gap: 9px; }
  .module-card { padding: 11px; }
  .module-card h3 { font-size: 1.03rem; }
  .module-card p, .module-bottom { font-size: .82rem; }
  .module-icon { width: 34px; height: 34px; border-radius: 8px; }
  .settings-grid, .practice-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .settings-grid { padding: 15px; }
  .answer-card { position: static; grid-row: 1; padding: 11px; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .answer-card .timer, .answer-card .answer-grid { grid-column: 1 / -1; }
  .answer-card h2 { grid-column: 1; }
  .answer-card #save-state { grid-column: 2; text-align: right; }
  .answer-card #progress { grid-column: 1; }
  .answer-card .retry-button { grid-column: 1 / -1; }
  .answer-card .submit-button { grid-column: 2; }
  .answer-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
  .split-heading { flex-wrap: wrap; align-items: start; }
  .review-item summary { padding-inline: 10px; gap: 7px; }
  .review-content { padding-inline: 12px; }
  .option { gap: 7px; padding-inline: 7px; }
  .choice-note { font-size: .72rem; }
}
@media (max-width: 360px) {
  .sidebar nav a { padding-inline: 7px; }
  .sidebar nav .nav-icon { display: none; }
  .user-chip strong { max-width: 69px; }
  .question-buttons .button { padding-inline: 11px; }
}
