:root {
  color-scheme: dark;
  --bg: #10121a;
  --panel: #181b26;
  --panel-hi: #202435;
  --border: #303448;
  --text: #f2f2fa;
  --muted: #b0b4c8;
  --accent: #bdaaff;
  --accent-strong: #ad94ff;
  --mint: #8ce3c5;
  --focus: #d4c5ff;
  font-family: 'Inter', 'Aptos', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, textarea, select { font: inherit; }
:is(a, button, input, textarea, select, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.frame { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; z-index: 5; left: 1rem; top: .5rem; transform: translateY(-190%); background: var(--panel); padding: .5rem 1rem; }
.skip:focus { transform: translateY(0); }
.top { background: #11131c; border-bottom: 1px solid #272a3b; }
.top-inner, .footer-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); font-size: 1.25rem; font-weight: 780; text-decoration: none; letter-spacing: -.04em; }
.brand-icon { background: #282341; color: var(--accent); border: 1px solid #433769; border-radius: 10px; padding: .18rem .48rem; font: 700 1.1rem/1.65 ui-monospace, monospace; letter-spacing: -.10em; }
.brand small { font-size: .75em; color: var(--muted); font-weight: 600; }
.accent { color: var(--accent); }
nav { display: flex; align-items: center; gap: clamp(.7rem, 3vw, 2rem); }
nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .93rem; }
nav a:hover, nav a[aria-current], .contents a[aria-current] { color: var(--accent); }
main { padding-bottom: 4rem; min-height: 68vh; }
.hero {
  display: grid;
  grid-template-columns: 1.24fr .76fr;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2.3rem;
  padding: clamp(1.65rem, 5vw, 3.5rem);
  min-height: 405px;
  border: 1px solid #332d50;
  border-radius: 27px;
  background: radial-gradient(ellipse at 86% 28%, #33305a 0%, transparent 53%), linear-gradient(130deg,#1a1b2a,#211d38);
  overflow: hidden;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.034em; }
h1 { font-size: clamp(2.1rem, 5vw, 4.2rem); margin-bottom: 1rem; font-weight: 800; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.65rem); }
.hero h1 span { color: var(--accent); }
h2 { font-size: clamp(1.43rem, 3vw, 2rem); margin-bottom: .75rem; }
h3 { margin-bottom: .45rem; }
p, .muted { color: var(--muted); }
.hero p:not(.eyebrow) { max-width: 47ch; font-size: 1.07rem; margin-bottom: 1.55rem; }
.eyebrow { color: var(--accent); font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .9rem; }
.dot { display: inline-block; width: .5rem; height: .5rem; margin-right: .4rem; border-radius: 50%; background: var(--mint); box-shadow: 0 0 1rem #8ce3c555; vertical-align: .06em; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; width: fit-content; padding: .7rem 1.05rem; border: 1px solid transparent; border-radius: 10px; background: var(--accent-strong); color: #171226; font-weight: 750; text-decoration: none; min-height: 44px; }
.button:not(:disabled):hover { background: #c8b6ff; }
.secondary { background: #232637; color: var(--text); border-color: #3b4058; }
.secondary:not(:disabled):hover { background: #34324c; }
.button:disabled { opacity: .6; }
.hero-art { position: relative; display: grid; place-items: center; min-width: 0; min-height: 255px; isolation: isolate; }
.art-orbit { position: absolute; z-index: -1; inset: 1rem 0; border: 1px solid #bc9eff37; border-radius: 50%; transform: rotate(-17deg); }
.orbit-b { inset: -.25rem 2rem; transform: rotate(25deg); }
.art-card { width: min(90%, 320px); padding: 1.2rem 1.3rem; background: #19192be8; border: 1px solid #686092; border-radius: 18px; box-shadow: 0 18px 45px #100d22a0; }
.art-top { display: flex; align-items: center; gap: .75rem; }
.art-top small { display: block; color: var(--muted); }
.art-symbol { color: var(--mint); background: #223e3c; border-radius: 9px; font-size: 1.2rem; display: grid; place-items: center; width: 42px; height: 42px; }
.art-value { margin: .75rem 0 .16rem; font-size: 2.1rem; font-weight: 800; letter-spacing: -.05em; }
.art-value span { color: var(--muted); font-size: .85rem; letter-spacing: normal; margin-left: .28rem; }
.art-bars { display: flex; align-items: end; gap: 5px; height: 45px; overflow: hidden; }
.art-bars i { flex: 1; height: 33%; border-radius: 3px 3px 0 0; background: #6c5f9f; }
.art-bars i:nth-child(3n) { height: 62%; }
.art-bars i:nth-child(3n + 1) { height: 46%; }
.art-bars i:nth-child(n + 6) { background: #9b83e4; }
.art-bars i:nth-child(n + 9) { height: 78%; }
.art-bars i:nth-child(n + 11) { height: 100%; background: #baa9fb; }
.section { margin-top: 2.8rem; }
.section-head { margin-bottom: 1.2rem; }
.section-head p, .feature p { margin-bottom: 0; }
.class-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }
.class-card, .panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: clamp(1rem, 2.1vw, 1.65rem); min-width: 0; }
.class-card { --class-color: #a99aff; --class-bg: #2c2648; }
.class-10 { --class-color: #8be1c1; --class-bg: #203c38; }
.class-11 { --class-color: #f6bd89; --class-bg: #42312c; }
.class-12 { --class-color: #8ad9fa; --class-bg: #223746; }
.class-mark { display: grid; place-content: center; width: 48px; height: 48px; border-radius: 11px; color: var(--class-color); background: var(--class-bg); font: 750 .98rem ui-monospace, monospace; margin-bottom: .8rem; }
.class-card h3 { font-size: 1.32rem; }
.class-card p { font-size: .85rem; margin-bottom: .9rem; }
.part { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .52rem; border-top: 1px solid var(--border); text-decoration: none; font-size: .94rem; font-weight: 680; color: var(--text); padding: .65rem 0; }
.part:hover { color: var(--class-color); }
.part-tag { width: 25px; height: 25px; display: grid; place-items: center; background: var(--class-bg); color: var(--class-color); border-radius: 6px; font-size: .75rem; }
.part small { display: block; color: var(--muted); font-size: .73rem; font-weight: 500; line-height: 1.3; }
.link-arrow { display: inline-block; position: relative; width: .64rem; height: .64rem; border-top: 1.5px solid; border-right: 1.5px solid; }
.link-arrow::after { content: ''; position: absolute; right: -1px; top: -1px; width: .8rem; border-top: 1.5px solid; transform: rotate(-45deg); transform-origin: right; }
.arrow { color: var(--class-color); }
.feature { margin-top: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer { border-top: 1px solid var(--border); padding-block: 1.15rem; }
.footer p { font-size: .85rem; margin: .2rem 0 0; }
.page-intro { margin: clamp(2rem,5vw,4rem) 0 1.6rem; }
.page-intro h1 { font-size: clamp(2rem, 4vw, 3.65rem); }
.page-intro p:not(.eyebrow) { font-size: 1.08rem; }
.filter { display: flex; align-items: end; gap: 1rem; margin-bottom: 1rem; }
label { display: grid; gap: .32rem; font-weight: 650; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; background: #11141e; color: var(--text); border: 1px solid #42465b; padding: .59rem .69rem; min-height: 44px; border-radius: 8px; }
textarea { min-height: 6rem; resize: vertical; }
.learn-layout, .admin-grid { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(0, 2.35fr); gap: 1rem; align-items: start; }
.admin-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.contents h2 { font-size: 1.25rem; }
.contents h3 { margin-top: 1.1rem; font-size: .95rem; }
.contents a { display: block; color: var(--muted); text-decoration: none; padding: .28rem .48rem; border-radius: 5px; font-size: .88rem; overflow-wrap: anywhere; }
.contents a:hover, .contents a[aria-current] { background: var(--panel-hi); }
.reading h3 { margin-top: 1.45rem; }
.reading-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.reading-tools p { margin: 0; }
.reading-tools + h2 { margin-top: .7rem; }
.source { font-size: .8rem; margin: 1.5rem 0 0; overflow-wrap: anywhere; }
.written { margin-top: 1.3rem; }
.written details { border-top: 1px solid var(--border); }
.written summary, .panel summary { padding: .75rem 0; cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
.written summary span { color: var(--accent); padding-right: .35rem; }
.written details p { margin: .35rem 0 .95rem 1rem; overflow-wrap: anywhere; }
.info { margin-top: 2.5rem; max-width: 850px; }
.quiz-setup, .quiz { max-width: 970px; }
.quiz-filters { display: grid; grid-template-columns: 1.2fr 1.2fr .6fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.quiz-top { display: flex; justify-content: space-between; gap: 1rem; }
.quiz-top .eyebrow { margin: 0; }
progress { width: 100%; height: .45rem; display: block; margin: .75rem 0 1rem; accent-color: var(--accent); }
.clock { font-variant-numeric: tabular-nums; color: var(--mint); }
.quiz h2 { overflow-wrap: anywhere; }
.choices { display: grid; gap: .65rem; margin: 1rem 0; }
.choice { display: flex; align-items: center; text-align: left; gap: .75rem; width: 100%; padding: .62rem .85rem; border: 1px solid #3d435a; background: #1e2232; border-radius: 10px; color: var(--text); overflow-wrap: anywhere; }
.choice:not(:disabled):hover, .choice[aria-pressed=true] { border-color: var(--accent); background: #302849; }
.choice.correct { border-color: #5cbb9a; background: #20352f; }
.choice.incorrect { border-color: #d77b86; background: #3d2730; }
.letter { flex: 0 0 2rem; height: 2rem; display: grid; place-items: center; background: #151724; border-radius: 7px; color: var(--accent); font-weight: 750; }
.message { border: 1px solid #488774; color: #bde8d7; background: #1c302d; border-radius: 8px; padding: .65rem .85rem; overflow-wrap: anywhere; }
.error { border-color: #a46675; color: #ffd2d8; background: #352331; }
.result { color: var(--mint); font-size: 1.25rem; font-weight: 700; }
.progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.progress-grid article a { margin: .24rem; }
.score-row, .record { display: flex; align-items: center; justify-content: space-between; padding: .52rem 0; gap: .85rem; border-top: 1px solid var(--border); }
.record :is(p,small) { margin: 0; overflow-wrap: anywhere; }
.record .actions { flex-shrink: 0; }
.admin-narrow { max-width: 580px; margin-bottom: 1rem; }
.admin-actions { margin-bottom: 1rem; }
.stack, fieldset { display: grid; gap: .75rem; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0; padding: .8rem; min-width: 0; }
#setup-status, #admin-status { margin: 0; }
#setup-status:not(:empty) { margin-top: .75rem; }
@media (max-width: 950px) {
  .class-grid, .quiz-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 690px) {
  .frame { width: calc(100% - 30px); }
  .top-inner { min-height: 64px; gap: .55rem; }
  nav a { font-size: .83rem; }
  .hero { grid-template-columns: 1fr; gap: 0; margin-top: 1rem; }
  .hero-art { min-height: 202px; margin-top: .65rem; }
  .art-orbit { left: 5%; right: 5%; }
  .feature, .footer-inner { align-items: flex-start; flex-direction: column; }
  .learn-layout, .admin-grid, .progress-grid { grid-template-columns: 1fr; }
  .learn-layout .reading { grid-row: 1; }
  .filter { flex-wrap: wrap; }
  .filter label { width: 100%; }
}
@media (max-width: 360px) {
  .class-grid, .quiz-filters { grid-template-columns: 1fr; }
  .top-inner { flex-wrap: wrap; padding-block: .5rem; }
  .record, .score-row { flex-wrap: wrap; }
}
