:root {
  color-scheme: light;
  --ink: #192d25;
  --ink-soft: #40574d;
  --light: #f5f3eb;
  --paper: #fffdf7;
  --muted: #52655a;
  --line: #dadfd0;
  --forest: #112922;
  --forest-deep: #0c221c;
  --gold: #f2cb79;
  --gold-hover: #ffdc91;
  --shadow: 0 7px 25px #173b2610;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; color: var(--ink); background: var(--light); font: 1rem/1.5 var(--sans); }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button[aria-disabled="true"] { opacity: .64; cursor: progress; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #157657; outline-offset: 4px; }
.sidebar :focus-visible, .hero :focus-visible { outline-color: var(--gold-hover); }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; line-height: 1.1; }
h3 { font-size: 1rem; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 20; background: var(--paper); color: var(--ink); padding: 10px 16px; border-radius: 8px; }
.loading { max-width: 45rem; margin: 15vh auto; padding: 24px; }
.loading p { margin: 16px 0; }

.shell { min-height: 100dvh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  position: sticky; inset-block-start: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 28px 16px 20px; background: radial-gradient(ellipse at 0 0,#1c3b30 0,transparent 53%), var(--forest-deep);
  color: #e6ece2; border-right: 1px solid #234637;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 7px 8px 40px; user-select: none; }
.brand-mark {
  display: grid; place-items: center; width: 46px; aspect-ratio: 1; border: 1px solid #77875d;
  border-radius: 14px; background: #304630; color: var(--gold); font: 34px/1 var(--serif);
  box-shadow: inset 0 0 0 4px #1e382a;
}
.brand span { display: block; font: 1.3rem/1.05 var(--serif); letter-spacing: .12em; color: #fff7dd; }
.brand small { display: block; margin-top: 4px; color: #c1c8a7; font-size: .61rem; font-weight: 650; letter-spacing: .23em; }
.sidebar nav { display: grid; gap: 5px; }
.side-link {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 11px; text-align: left;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; color: #c0d0c4;
  background: transparent; font-size: .88rem; font-weight: 600;
}
.side-link:hover, .side-link.current { color: #fff8de; background: #253e32; border-color: #45604a; }
.side-link.current .nav-icon { color: var(--gold); }
.nav-icon { flex: 0 0 24px; text-align: center; font-size: 1.16rem; line-height: 1.06; }
.sidebar-bottom { margin-top: auto; }
.profile { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 17px 0 7px; padding: 18px 7px 5px; border-top: 1px solid #405b4c; }
.profile > div { min-width: 0; }
.profile strong, .profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile strong { color: #fff7dd; font-size: .88rem; }
.profile small { color: #bdcfc0; font-size: .73rem; }
.avatar {
  flex: 0 0 33px; height: 33px; display: grid; place-items: center; border-radius: 50%;
  color: #f0da9b; background: #3a4d31; border: 1px solid #697752; font: 1.07rem var(--serif);
}

.main { width: min(100%, 1520px); margin: 0 auto; padding: 25px clamp(21px, 3.5vw, 56px) 50px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 0 1px 20px; color: var(--muted); font-size: .7rem; font-weight: 750; letter-spacing: .13em; }
.top-right { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: .78rem; font-weight: 650; letter-spacing: 0; }
.top-right i { width: 7px; height: 7px; border-radius: 50%; background: #4d8a69; box-shadow: 0 0 0 3px #dfe9d9; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 380px; display: flex; align-items: center;
  border-radius: 17px; color: #fffae8; background: #1b3a30; box-shadow: 0 11px 27px #102a2329;
}
.hero::before {
  position: absolute; z-index: -1; inset: 0; content: "";
  background: linear-gradient(90deg,#132f25 2%,#132f25f0 22%,#132f2599 46%,#122b2112 75%),
              linear-gradient(0deg,#10261c78,transparent 58%),
              url("/atlas-art.jpg") 64% 43% / cover no-repeat;
}
.hero-content { max-width: 650px; width: 100%; padding: clamp(26px, 5vw, 63px); }
.eyebrow { margin-bottom: 9px; color: #466557; font-size: .69rem; font-weight: 800; letter-spacing: .145em; }
.hero .eyebrow { color: #f0cf86; }
.hero h1 { font-size: clamp(3.5rem, 7.1vw, 6.15rem); line-height: .96; letter-spacing: -.054em; overflow-wrap: anywhere; }
.hero h1 em { color: #f3ce80; font-weight: 400; }
.hero-content > p:not(.eyebrow) { margin: 21px 0 20px; max-width: 390px; color: #e1ecdf; font-size: 1.03rem; }
.student-hero { min-height: 342px; }
.student-hero .hero-content { padding-block: 38px; }
.student-hero h1 { font-size: clamp(3rem, 6.2vw, 5.2rem); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 45px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; font-size: .91rem;
  text-align: center; transition: background-color .17s, box-shadow .17s, border-color .17s;
}
.primary { background: var(--gold); color: #2c291a; border-color: #d9ad54; box-shadow: 0 2px 0 #a7772b45; }
.primary:hover { background: var(--gold-hover); border-color: #ba8a39; }
.secondary { background: #f5f7ee; color: var(--ink); border-color: #c8d4c5; }
.secondary:hover { background: #e4efde; border-color: #8dac98; }
.ghost-light { color: #fff3d7; border-color: #778c71; background: #142f24d4; }
.ghost-light:hover { background: #2d4a38; }
.compact { min-height: 37px; padding: 6px 11px; font-size: .82rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.text-button {
  min-height: 38px; border: 0; border-radius: 4px; padding: 5px 2px; background: transparent; color: #285e48;
  text-align: left; font-size: .91rem; font-weight: 750; text-underline-offset: 4px;
}
.text-button:hover { text-decoration: underline; }
.back { margin-bottom: 15px; }
.quiet { color: var(--muted); margin-top: 14px; }

.section { margin-top: clamp(25px, 3.1vw, 44px); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.section-heading h2 { font-size: clamp(1.62rem, 3.1vw, 2.36rem); letter-spacing: -.025em; }
.page-heading { margin: 18px 0 26px; }
.page-heading h1 { font-size: clamp(2.66rem, 5vw, 4.5rem); letter-spacing: -.055em; overflow-wrap: anywhere; }
.lede { color: var(--muted); margin-top: 12px; max-width: 49rem; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-top: 17px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 12px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; }
.stat-icon { flex: 0 0 36px; height: 36px; display: grid; place-items: center; background: #e6efdf; color: #32634e; border-radius: 9px; font-size: 1.2rem; }
.stat strong, .stat small { display: block; }
.stat strong { font: 1.41rem/1.1 var(--serif); }
.stat small { color: var(--muted); margin-top: 2px; font-size: .76rem; }

.mint { --tone: #27664e; --wash: #e6eedb; --card-fill: #f4f7ed; --border: #9cb997; }
.gold { --tone: #815522; --wash: #f3e5c4; --card-fill: #fbf5e7; --border: #cdb385; }
.sky { --tone: #315c72; --wash: #dae9e9; --card-fill: #eef6f5; --border: #9bb7c2; }
.rose { --tone: #82464c; --wash: #f0deda; --card-fill: #fbf0ed; --border: #ccaaa7; }
.regions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.region {
  min-width: 0; min-height: 153px; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: radial-gradient(ellipse at 100% 0, var(--wash), transparent 61%), var(--card-fill);
}
button.region:hover, .region.chosen { box-shadow: inset 0 0 0 1px var(--tone), var(--shadow); }
.region.chosen { border-color: var(--tone); }
.region-emblem {
  width: 39px; height: 39px; display: grid; place-items: center; margin-bottom: 12px; border: 1px solid var(--border);
  border-radius: 50%; background: var(--wash); color: var(--tone); font: 1.6rem/1 var(--serif);
}
.region-age, .region-copy { color: var(--tone); font-size: .72rem; }
.region-age { font-weight: 800; }
.region strong { display: block; margin: 2px 0 4px; font: 1.17rem/1.12 var(--serif); }
.region-copy { font-size: .77rem; line-height: 1.4; }
.topics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 12px; }
.topic {
  display: flex; align-items: center; gap: 11px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); min-height: 66px; text-align: left;
}
.topic:hover { border-color: #8eac95; box-shadow: var(--shadow); }
.topic strong, .topic small { display: block; overflow-wrap: anywhere; }
.topic small { color: var(--muted); font-size: .75rem; }
.topic-symbol { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: var(--wash); color: var(--tone); font: 1.28rem var(--serif); }
.topic-arrow { margin-left: auto; color: #3b6f55; font-size: 1.27rem; }
.empty { padding: 21px; background: #eeeee3; border: 1px dashed #b0beac; border-radius: 10px; color: var(--ink-soft); }

.collection-tools { align-items: center; }
.collection-tools label select { min-width: 10rem; }
.pill { display: inline-block; padding: 5px 10px; background: #e9eee0; color: #345446; border: 1px solid #d1dbcb; border-radius: 999px; font-size: .79rem; font-weight: 750; }
.card-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
.math-card {
  min-width: 0; padding: 12px; min-height: 204px; display: flex; flex-direction: column; justify-content: space-between; gap: 9px;
  text-align: left; color: var(--tone); border: 1px solid var(--border); border-radius: 12px; background: var(--card-fill);
  box-shadow: var(--shadow); transition: transform .17s, box-shadow .17s;
}
.math-card:hover { transform: translateY(-3px); box-shadow: 0 12px 22px #192d2524; }
.math-card.locked { background: #f0eee6; --wash: #e5e5d9; --border: #c9ccbd; --tone: #525e54; box-shadow: none; }
.card-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; font-size: .62rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.card-art {
  display: grid; place-items: center; min-height: 96px; border-radius: 7px; overflow: hidden;
  background: repeating-radial-gradient(circle at center, transparent 0 20px,#fff7 21px 22px,transparent 23px 36px),var(--wash);
}
.card-art span {
  display: grid; place-items: center; width: 65px; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card-fill); font: 2rem/1 var(--serif); box-shadow: 0 3px 9px #173b2620;
}
.locked .card-art span { background: #eeece1; }
.math-card strong { font: 1.16rem/1.06 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.card-bottom { font-size: .72rem; font-weight: 680; }
.card-detail { padding: 17px 44px 17px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-fill); margin-bottom: 15px; }
.card-detail-symbol {
  display: grid; place-items: center; margin-bottom: 8px; width: 45px; aspect-ratio: 1; background: var(--wash);
  border: 1px solid var(--border); border-radius: 10px; color: var(--tone); font: 1.6rem/1 var(--serif);
}
.card-detail .eyebrow { color: var(--tone); }
.detail-level { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; margin-block: 11px 3px; }
.detail-level span { color: var(--muted); font-size: .8rem; }
progress { width: 100%; accent-color: #3a7859; margin-bottom: 10px; }

.exercise-panel {
  max-width: 780px; padding: clamp(17px, 4vw, 39px); border: 1px solid var(--line);
  border-radius: 15px; background: var(--paper); box-shadow: var(--shadow);
}
.exercise-panel h2 { font-size: clamp(1.45rem, 3vw, 2.5rem); }
.exercise-panel > p { color: var(--ink-soft); margin: 10px 0 19px; }
.exercise-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 19px; }
.steps { display: flex; gap: 6px; }
.step { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #eeeee4; color: #4a6052; font-size: .82rem; font-weight: 750; }
.step.current-step { outline: 1px solid #53816a; outline-offset: 2px; }
.step.correct { background: #cfe8d4; color: #145037; }
.step.missed { background: #f5e5cd; color: #775120; }
.question { margin-bottom: 23px; }
.answer-row { display: flex; align-items: stretch; gap: 10px; }
.answer-row input { flex: 1; max-width: 370px; min-width: 0; }
.answer-form label { margin-bottom: 6px; }
.feedback { margin: 11px 0 15px; padding: 10px 12px; border-radius: 9px; }
.feedback.correct { background: #e0eee0; color: #20543b; }
.feedback.missed, .feedback.hint { background: #f7ead1; color: #624c2d; }
.feedback p { margin-top: 2px; }
.reward-panel { text-align: center; }
.pack-art {
  width: 126px; height: 153px; display: grid; place-items: center; position: relative; overflow: hidden; margin: 10px auto 25px;
  transform: rotate(-8deg); border-radius: 13px; border: 2px solid #c2a45c;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 16px,#c2a45c55 17px 18px,transparent 19px 27px),#214438;
  box-shadow: inset 0 0 0 6px #173529, 0 8px 18px #10261944;
}
.pack-art span { border: 1px solid #dbbc73; border-radius: 100%; color: #f3d390; background: #214438; font: 3.1rem/1 var(--serif); padding: 12px; }

.teacher-layout { display: grid; grid-template-columns: minmax(155px, .75fr) minmax(0,2.2fr); gap: 16px; align-items: start; }
.teacher-classes, .teacher-panel { padding: clamp(13px, 2vw, 24px); background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.teacher-layout h2 { font-size: clamp(1.24rem, 2.5vw, 1.85rem); overflow-wrap: anywhere; }
.teacher-panel > h2 { margin-bottom: 12px; }
.class-list { display: grid; gap: 7px; }
.class-list button {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; align-items: center; min-height: 41px;
  text-align: left; padding: 7px; border: 1px solid #d7dfd1; border-radius: 7px; background: #f6f7ef;
}
.class-list button strong { overflow-wrap: anywhere; }
.class-list button span { color: #526657; font-size: .79rem; }
.class-list button:hover, .class-list button.chosen { background: #e6efde; border-color: #8bab96; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .89rem; }
th, td { padding: 8px; border-bottom: 1px solid #dfdfd2; }
thead th { background: #eaf0e3; color: #325547; font-size: .75rem; white-space: nowrap; }
tbody th { overflow-wrap: anywhere; }
td:last-child { text-align: right; }
td .text-button { white-space: nowrap; padding-block: 2px; min-height: 33px; }
.deck-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 16px 0; }
.deck-grid fieldset {
  min-width: 0; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-fill);
}
.deck-grid legend { padding: 0 4px; color: var(--tone); font: 1.13rem var(--serif); }
.deck-grid legend small { font: 700 .69rem var(--sans); }
.check-card { display: flex; align-items: center; gap: 6px; min-height: 41px; padding: 5px 3px; font-weight: 550; cursor: pointer; }
.check-card:hover { background: var(--wash); border-radius: 5px; }
.check-card input { width: 17px; height: 17px; flex: 0 0 17px; accent-color: #37664f; }
.check-card span { width: 22px; flex: 0 0 22px; text-align: center; color: var(--tone); }
.progress-list { max-height: 210px; overflow-y: auto; list-style: none; margin: 12px 0 17px; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.progress-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.progress-list li:last-child { border-bottom: 0; }
.progress-list li small { display: block; color: var(--muted); }

dialog {
  width: min(560px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto; padding: 0;
  border: 1px solid #a2b09c; border-radius: 15px; color: var(--ink); background: var(--paper);
  box-shadow: 0 22px 80px #10261960;
}
dialog::backdrop { background: #112922b0; }
.dialog-body { position: relative; padding: 25px; }
.dialog-body > h2, .card-detail h2 { font-size: clamp(1.8rem, 5vw, 2.45rem); padding-right: 20px; overflow-wrap: anywhere; }
.dialog-body > p { margin: 11px 0 15px; }
.dialog-body > h3 + p { margin-top: 3px; color: var(--ink-soft); }
.dialog-body > form { margin-top: 15px; }
.dialog-close { position: absolute; top: 12px; right: 12px; }
.icon-btn { width: 37px; height: 37px; border: 1px solid #cad7c5; border-radius: 8px; background: #f1f4e9; color: #305444; font-size: 1.4rem; line-height: 1; }
.icon-btn:hover { background: #e4ebde; }
label { font-size: .88rem; font-weight: 700; }
form > label { display: block; margin-bottom: 9px; }
label > input:not([type="checkbox"]), label > select { display: block; margin-top: 5px; width: 100%; }
input:not([type="checkbox"]), select {
  color: var(--ink); padding: 9px 11px; min-height: 43px; background: #fffefa;
  border: 1px solid #acbeaf; border-radius: 8px;
}
input::placeholder { color: #68796d; }
.field-help { font-size: .79rem; margin: 7px 0; color: var(--muted); }
.form-error { margin: 7px 0; color: #8d342d; font-size: .88rem; font-weight: 700; }
form > .button, form > .inline-actions { margin-top: 8px; }
.instructions { margin: 14px 0; padding-left: 21px; }
.instructions li { padding-left: 3px; margin: 0 0 9px; }
.student-code { padding: 11px; background: #e9f0e2; border: 1px dashed #8ca48f; border-radius: 8px; text-align: center; }
.dialog-status { color: #285e48; font-size: .88rem; font-weight: 700; }
.student-code code { font-size: 1.32rem; font-weight: 700; letter-spacing: .14em; }
.toast {
  position: fixed; z-index: 14; bottom: 20px; right: 20px; max-width: calc(100% - 40px); padding: 11px 13px;
  background: var(--forest); color: #fef7e9; border: 1px solid #638476; border-radius: 9px; box-shadow: var(--shadow); font-size: .91rem;
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 192px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .card-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 840px) {
  .regions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .teacher-layout { grid-template-columns: 1fr; }
  .class-list { grid-template-columns: repeat(auto-fill,minmax(123px,1fr)); }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .sidebar {
    position: relative; height: auto; padding: 9px 13px 8px; border-right: 0; border-bottom: 1px solid #45604a;
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 9px;
  }
  .brand { padding: 3px 0; gap: 7px; }
  .brand-mark { width: 34px; border-radius: 8px; font-size: 24px; }
  .brand span { font-size: .98rem; }
  .brand small { font-size: .49rem; margin-top: 2px; }
  .sidebar nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 2px; }
  .side-link { width: auto; min-height: 37px; gap: 4px; padding: 5px; font-size: .75rem; }
  .nav-icon { flex-basis: auto; font-size: .94rem; }
  .sidebar-bottom { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
  .profile { order: -1; margin: 0 auto 0 0; padding: 0; border: 0; }
  .profile small, .avatar { display: none; }
  .profile strong { max-width: 30vw; font-size: .75rem; }
  .main { padding: 17px 15px 34px; }
  .topline { margin-bottom: 12px; }
  .hero::before {
    background: linear-gradient(90deg,#132f25fa 1%,#132f25ca 40%,#132f2550 100%),
                linear-gradient(0deg,#10261c80,transparent 55%),
                url("/atlas-art.jpg") 67% 45% / cover no-repeat;
  }
  .hero { min-height: 310px; }
  .hero-content { padding: 24px; }
  .stats, .card-grid { gap: 8px; }
  .stat { padding: 8px; gap: 6px; }
  .stat-icon { width: 29px; flex-basis: 29px; height: 29px; font-size: .93rem; }
  .stat strong { font-size: 1.12rem; }
  .stat small { font-size: .66rem; line-height: 1.15; }
}
@media (max-width: 430px) {
  .sidebar { grid-template-columns: 1fr; gap: 3px; }
  .sidebar nav { justify-content: flex-start; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 3.6rem); }
  .hero-content > p:not(.eyebrow) { font-size: .95rem; }
  .stats { gap: 6px; }
  .stat { align-items: flex-start; }
  .stat-icon { display: none; }
  .regions { gap: 8px; }
  .region { padding: 9px; min-height: 136px; }
  .region strong { font-size: 1.09rem; }
  .topics, .deck-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .math-card { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

.question-visual { display: flex; justify-content: center; margin: 0 0 22px; padding: 12px; background: #f1f5eb; border: 1px solid #d9e3d5; border-radius: 9px; }
.dot-visual { align-items: center; gap: clamp(8px, 3vw, 22px); }
.dot-visual strong { color: #476750; }
.dot-group { display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(3px, 1vw, 7px); }
.dot-group i { width: clamp(9px, 3vw, 15px); aspect-ratio: 1; border-radius: 50%; background: #236149; }
.dot-group:last-child i { background: #d19844; border: 1px solid #97713c; }
.polygon { --points: polygon(50% 0,100% 100%,0 100%); display: block; width: 90px; aspect-ratio: 1; clip-path: var(--points); background: #34694f; position: relative; }
.polygon::after { content: ""; position: absolute; inset: 9%; clip-path: var(--points); background: #c8dec6; }
.sides-4 { --points: polygon(10% 10%,90% 10%,90% 90%,10% 90%); }
.sides-5 { --points: polygon(50% 0,100% 38%,81% 100%,19% 100%,0 38%); }
.sides-6 { --points: polygon(25% 5%,75% 5%,100% 50%,75% 95%,25% 95%,0 50%); }
.sides-7 { --points: polygon(50% 0,89% 19%,100% 62%,73% 96%,27% 96%,0 62%,11% 19%); }
.sides-8 { --points: polygon(30% 0,70% 0,100% 30%,100% 70%,70% 100%,30% 100%,0 70%,0 30%); }
.fraction-bar { display: flex; width: min(100%,320px); min-height: 35px; gap: 2px; padding: 2px; border: 1px solid #779a82; border-radius: 5px; background: #779a82; }
.fraction-bar i { flex: 1; background: #f6faf1; }
.fraction-bar i.filled { background: #326a50; }

/* Catalogue, maîtrise et parcours de classe */
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 22px; }
.filters label { display: grid; gap: 4px; color: var(--ink-soft); font-size: .83rem; font-weight: 750; flex: 1 1 135px; }
.filters label select { min-width: 0; width: 100%; }
.filters .pill { margin-bottom: 7px; }
.math-card { justify-content: flex-start; }
.math-card strong { min-height: 2.15em; }
.card-art { display: block; width: 100%; min-height: 0; aspect-ratio: 512 / 284; background: var(--wash); }
.card-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.locked .card-art img { filter: saturate(.48) brightness(.93); }
.card-bottom { margin-top: auto; }
.mastery-dots { display: flex; gap: 4px; }
.mastery-dots i { width: 13px; height: 4px; border-radius: 4px; background: var(--tone); }
.mastery-dots .empty-dot { background: var(--border); opacity: .7; }
.tier-3, .tier-4 { box-shadow: inset 0 0 0 2px var(--wash), var(--shadow); }
.tier-5, .tier-6 { border-color: #a47a3e; box-shadow: inset 0 0 0 2px #eacf94, 0 5px 12px #7051122b; }
.tier-6 .card-art { outline: 1px solid #ad843c; }
.tier-6 .mastery-dots i { background: #96681d; }
.detail-plate { display: block; width: min(100%, 245px); height: auto; border-radius: 6px; margin-bottom: 12px; }
.school-pack {
  padding: clamp(14px, 3vw, 24px); margin-bottom: 16px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--paper); box-shadow: var(--shadow);
}
.school-pack h2 { font-size: clamp(1.3rem, 3vw, 2rem); }
.school-pack > p, .school-pack > h2 + .topics, .school-pack > h2 + .progress-list { margin-top: 12px; }
.empty .button { margin-top: 12px; }
.join-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; margin: 0 0 14px; border: 1px solid #bbceb9; border-radius: 10px; background: #eaf1e2;
}
.join-strip code { font-size: 1.04rem; letter-spacing: .12em; }
.reveal-content { text-align: center; }
.reveal-content h2 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
.reveal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin: 18px 0; }
.reveal-grid .math-card { animation: reveal-card .4s cubic-bezier(.2,.85,.4,1) both; }
.reveal-grid .math-card:nth-child(2) { animation-delay: .12s; }
.reveal-content > p:not(.eyebrow) { margin: 0 0 12px; }
.pack-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, #ffed9f55 49%, transparent 60%);
  animation: pack-shine 1.15s ease-out both;
}
@keyframes reveal-card {
  from { opacity: 0; transform: perspective(480px) rotateY(-65deg) translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pack-shine {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@media (max-width: 520px) {
  .math-card { min-height: 0; padding: 9px; }
  .math-card strong { min-height: 0; }
  .filters .pill { margin-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-grid .math-card, .pack-art::after { animation: none; }
}

.rectangle-visual { text-align: center; color: #254b3a; font-size: .82rem; font-weight: 700; }
.rect-body { display: flex; align-items: center; gap: 8px; }
.rect-shape { border: 2px solid #3c7154; background: #dbead5; }
.rect-shape {
  --unit: clamp(8px, 2.8vw, 17px);
  display: grid; grid-template-columns: repeat(var(--cols), var(--unit));
  width: calc(var(--cols) * var(--unit)); height: calc(var(--rows) * var(--unit));
}
.rect-shape.squared { box-sizing: content-box; }
.rect-shape i { box-shadow: inset -1px -1px #87ab8e; }
.cols-7 { --cols: 7; }
.cols-8 { --cols: 8; }
.cols-9 { --cols: 9; }
.cols-10 { --cols: 10; }
.cols-11 { --cols: 11; }
.cols-12 { --cols: 12; }
.cols-13 { --cols: 13; }
.cols-14 { --cols: 14; }
.rows-2 { --rows: 2; }
.rows-3 { --rows: 3; }
.rows-4 { --rows: 4; }
.rows-5 { --rows: 5; }
.rows-6 { --rows: 6; }

.exercise-category { margin: 0 0 5px; color: #356348; font-weight: 700; font-size: .9rem; }
.answer-choices { display: grid; gap: 8px; padding: 0; margin: 0 0 14px; border: 0; }
.answer-choices legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.answer-form .answer-option {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 0;
  min-height: 48px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.answer-option:hover, .answer-option:has(:checked) { border-color: #43845e; background: #e4efdf; }
.answer-option input { flex: 0 0 19px; width: 19px; min-height: 0; height: 19px; margin: 0; accent-color: #306547; }
.exercise-figure { width: min(100%, 280px); height: auto; color: #244835; }
.exercise-figure text { fill: currentColor; font-size: 14px; font-weight: 650; }
.exercise-figure .axis-tick { font-size: 10px; font-weight: 500; }
.figure-grid { fill: none; stroke: #b2ccb8; }
.figure-line { fill: none; stroke: currentColor; stroke-width: 1.8; }
.figure-shape { fill: #d6ead5; stroke: currentColor; stroke-width: 2; }
.figure-point { fill: #793b2c; stroke: #fff; stroke-width: 1.5; }
.figure-cut { fill: none; stroke: #536c5b; stroke-width: 1.4; stroke-dasharray: 4 3; }
.value-table { width: min(100%, 300px); text-align: center; background: var(--paper); }
.value-table th, .value-table td { text-align: center; }
.value-table th { background: #d6ead5; }
