:root {
  color-scheme: light;
  --ink: #09162f;
  --muted: #52627e;
  --line: #dbe4f2;
  --brand: #0750e9;
  --deep: #09162f;
  --soft: #edf4ff;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f7faff;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
.frame { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.masthead { background: white; border-top: .35rem solid var(--brand); border-bottom: 1px solid var(--line); }
.bar, .controls, .brand, .language { display: flex; align-items: center; gap: .75rem; }
.bar { justify-content: space-between; flex-wrap: wrap; padding: .85rem 0; }
.brand { text-decoration: none; color: var(--deep); font-weight: 750; font-size: 1.25rem; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: .875rem; font-weight: 500; }
.wordmark { display: grid; color: var(--brand); font-size: 2rem; font-weight: 900; letter-spacing: -.06em; line-height: .9; padding-right: .75rem; border-right: 1px solid var(--line); }
.wordmark small { color: var(--ink); font-size: .9rem; font-weight: 800; margin-top: .25rem; }
.controls { flex-wrap: wrap; }
.language { gap: .1rem; background: var(--soft); border-radius: .5rem; padding: .15rem; }
.language button { border: 0; background: transparent; min-height: 2.75rem; padding: .4rem .6rem; }
.language button[aria-pressed="true"] { background: white; box-shadow: 0 1px 4px #15273820; }
main { padding-block: clamp(1.4rem, 5vw, 3.5rem); min-height: 68vh; }
h1, h2, h3, p { margin: 0 0 .7rem; }
h1 { color: var(--deep); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button, .primary { border: 1px solid transparent; border-radius: .45rem; cursor: pointer; padding: .6rem .9rem; min-height: 2.75rem; font-weight: 650; }
.primary { display: inline-block; color: white; background: var(--brand); text-decoration: none; }
.primary:hover { background: var(--deep); }
.quiet { background: white; border-color: var(--line); }
:focus-visible { outline: 3px solid #91490c; outline-offset: 3px; }
.entry, .cards, .fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.entry { max-width: 49rem; margin-inline: auto; gap: 1.25rem; align-items: start; }
.panel { background: white; border: 1px solid var(--line); border-radius: .8rem; padding: clamp(1rem, 3vw, 1.6rem); }
.demo { background: var(--soft); }
.stack, .roster { display: grid; gap: 1rem; }
.stack button { justify-self: start; }
label { display: grid; gap: .35rem; font-weight: 600; }
input, select, textarea { min-height: 2.75rem; width: 100%; padding: .5rem; border: 1px solid #8799a9; background: white; border-radius: .4rem; }
textarea { resize: vertical; }
dl { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0; }
dd { margin: 0; overflow-wrap: anywhere; }
.section { margin-block: 1.5rem; }
.meta { color: var(--muted); font-size: .9rem; }
.status, .alert { border-radius: .4rem; padding: .5rem .75rem; background: var(--soft); color: var(--deep); }
.alert { background: #fcebe6; color: #7d2514; }
footer { border-top: 1px solid var(--line); padding: 1rem 0 2rem; }

.calendar-filter { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin-bottom: 1rem; }

.learning-options { border: 1px solid var(--line); border-radius: .6rem; padding: .8rem; }
.learning-options label { display: flex; align-items: center; gap: .75rem; }
.learning-options input { width: 1.2rem; min-height: 1.2rem; }
math { font-size: 1.1em; }
progress { width: min(100%, 20rem); accent-color: var(--brand); }

.attempt-summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.attempt-summary .meta { margin-block: .3rem; }
.attempt-points { background: var(--deep); color: white; border-radius: .7rem; padding: .8rem 1rem; }
.attempt-points strong { display: block; font-size: 1.65rem; }
.attempt-layout { display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(0, 2.6fr); gap: 1rem; align-items: start; }
.attempt-index { padding: 1rem; }
.attempt-block { padding: .7rem 0; border-top: 1px solid var(--line); }
.attempt-block summary { cursor: pointer; padding-block: .35rem; }
.attempt-block summary span { display: block; margin-left: 1rem; color: var(--muted); font-size: .9rem; }
.attempt-jumps { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.attempt-jumps a { display: grid; grid-auto-flow: column; place-items: center; min-width: 2.75rem; min-height: 2.75rem; border: 1px solid var(--line); border-radius: .45rem; text-decoration: none; gap: .2rem; padding-inline: .3rem; }
.attempt-jumps .answered { background: var(--soft); }
.attempt-jumps [aria-current] { background: var(--brand); color: white; border-color: var(--brand); }
.exercise-theory { background: var(--soft); padding: 1rem; border-left: 3px solid var(--brand); border-radius: .4rem; margin-block: .75rem 1.25rem; }
.exercise details summary { cursor: pointer; font-weight: 650; }
.exercise-options { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; border: 0; padding: 0; min-width: 0; }
.exercise-options label { min-height: 3.25rem; padding: .65rem; border: 1px solid var(--line); border-radius: .5rem; cursor: pointer; }
.exercise-options label:has(:checked) { border-color: var(--brand); background: var(--soft); }
@media (max-width: 720px) { .attempt-layout { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .exercise-options { grid-template-columns: 1fr; } }

.masthead .account-identity {
  display: inline-flex;
  flex-direction: column;
  background: var(--soft);
  border-radius: .5rem;
  padding: .35rem .7rem;
  line-height: 1.2;
}
.masthead .account-identity small { color: var(--muted); font-size: .875rem; }

.masthead .session-controls { display: flex; align-items: center; gap: .75rem; }

.batch-option { display: flex; min-height: 2.75rem; align-items: center; gap: .65rem; cursor: pointer; }
.batch-option input { width: 1.25rem; min-height: 1.25rem; flex: none; accent-color: var(--brand); }
