:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #28243f;
  background: #f6f4fb;
  --ink: #28243f;
  --muted: #625b75;
  --brand: #574097;
  --line: #ddd7ea;
  --surface: white;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
header { background: var(--surface); border-bottom: 1px solid var(--line); }
.frame { width: min(100% - 2rem, 66rem); margin-inline: auto; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; padding-block: .55rem; }
main { padding-block: clamp(1.4rem, 4vw, 3rem) 4rem; }
.brand { color: var(--ink); font-weight: 800; text-decoration: none; }
.brand span { color: var(--brand); margin-right: .35rem; }
nav, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
nav a, .back { color: var(--brand); font-weight: 650; }
nav form { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.045em; line-height: 1.12; margin-bottom: 1rem; overflow-wrap: anywhere; }
h2 { font-size: 1.3rem; line-height: 1.3; }
h3 { font-size: 1.15rem; }
p, .review, h2, h3, .meta, summary { overflow-wrap: anywhere; }
h1 + .grid, h1 + .panel { margin-top: 1rem; }
.heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.heading h1 { margin-bottom: .35rem; }
.heading p { color: var(--muted); }
.heading.compact { margin-bottom: .2rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1.15rem; padding: clamp(1rem, 3vw, 1.6rem); min-width: 0; }
.panel > h2, .panel > h3 { margin-bottom: .6rem; }
.panel > p + p { margin-top: .35rem; }
.grid, .columns, .fields { display: grid; gap: 1rem; }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.columns, .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 1rem; align-content: start; }
.card { display: flex; flex-direction: column; align-items: start; gap: .45rem; }
.card > .actions { margin-top: auto; padding-top: .5rem; }
.meta { color: var(--brand); font-size: .9rem; font-weight: 680; }
.back { display: inline-block; margin-bottom: .55rem; }
.muted { color: var(--muted); font-weight: 500; }
.button, .secondary, .link { font: inherit; font-weight: 720; cursor: pointer; }
.button, .secondary { display: inline-block; width: fit-content; padding: .6rem 1rem; border-radius: .65rem; border: 1px solid var(--brand); text-decoration: none; min-height: 44px; }
.button { color: white; background: var(--brand); }
.secondary { background: #f4efff; color: var(--brand); border-color: #d9ceee; }
.link { border: 0; padding: .45rem 0; color: var(--brand); background: transparent; text-decoration: underline; }
.button:hover, .secondary:hover { filter: brightness(.94); }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #7c55cd; outline-offset: 3px; }
.login { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1rem; max-width: 54rem; margin: clamp(0rem, 8vw, 4rem) auto 0; }
.login-intro { padding: clamp(1.4rem, 5vw, 3rem); background: #e9e1fa; border-radius: 1.15rem; }
.login-intro p { max-width: 25ch; font-size: 1.08rem; }
.decor { font-size: 3rem; color: var(--brand); margin-bottom: .45rem; }
label { display: grid; gap: .32rem; margin-bottom: .65rem; font-weight: 650; min-width: 0; }
input, textarea, select { font: inherit; font-weight: 450; color: var(--ink); border: 1px solid #aaa0bc; border-radius: .55rem; background: #fff; min-width: 0; width: 100%; padding: .6rem .7rem; }
textarea { resize: vertical; }
section details form, details > label, details > form { margin-top: .75rem; }
summary { color: var(--brand); font-weight: 720; cursor: pointer; }
.import { background: #f8f5ff; border-radius: .65rem; padding: .85rem; }
#import-status:empty { display: none; }
#import-status { margin-top: .5rem; }
.pill { display: inline-block; background: #ece5fa; color: #4d387f; padding: .2rem .62rem; border-radius: 1rem; font-size: .85rem; font-weight: 750; }
.review { white-space: pre-wrap; }
.quiz { margin-top: 2rem; }
.question { margin: 0; }
.question legend { font-weight: 760; max-width: 100%; padding: 0 .35rem; overflow-wrap: anywhere; }
.choice { display: flex; gap: .65rem; align-items: start; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: .65rem; margin-bottom: .45rem; font-weight: 500; cursor: pointer; overflow-wrap: anywhere; }
.choice:has(input:checked) { background: #eee9fa; border-color: var(--brand); }
.choice input { width: 1.1rem; height: 1.1rem; margin: .2rem 0 0; flex: 0 0 auto; accent-color: var(--brand); }
.score { font-size: 1.25rem; font-weight: 800; }
.correct { background: #def1e3; color: #245437; }
.incorrect, .alert { background: #ffebe0; color: #773a24; }
.alert { padding: .85rem 1rem; border-radius: .75rem; margin-bottom: 1rem; }
@media (max-width: 42rem) {
  .columns, .fields, .login { grid-template-columns: 1fr; }
  .header { column-gap: .65rem; }
  nav { gap: .65rem; }
  input, textarea, select { font-size: 16px; }
}
[hidden] { display: none !important; }
.student-list { display: grid; gap: .7rem; max-width: 40rem; }
.student-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.student-row > div { min-width: 0; }
.student-row h2 { font-size: 1.18rem; margin: 0; }
.student-row .button { flex: none; }
.quiz { max-width: 44rem; }
.quiz-progress { color: var(--brand); font-weight: 740; }
.quiz .actions { margin: 0; }
.quiz-start { margin-top: 1rem; }
.question { min-inline-size: 0; }
.question legend:focus { outline: none; }
.review-flow { max-width: 44rem; }
.review-flow [data-review-page] h2 { margin-bottom: .6rem; }
.review-flow [data-review-page]:focus-within h2:focus { outline: none; }
.review-flow [data-review-controls] { margin-top: .9rem; }
.review-flow img { display: block; max-width: 100%; max-height: 20rem; object-fit: contain; margin: .85rem auto 0; border-radius: .65rem; }
.review-flow [data-review-progress] { margin-bottom: .45rem; }
body[data-study-style="infantil"] { --brand: #175a69; --muted: #456372; background: #edf9f5; font-size: 1.22rem; }
body[data-study-style="infantil"] h1 { font-size: clamp(2.4rem, 8vw, 3.8rem); }
body[data-study-style="infantil"] h2, body[data-study-style="infantil"] legend { font-size: 1.48rem; }
body[data-study-style="infantil"] main button, body[data-study-style="infantil"] main .button,
body[data-study-style="infantil"] main .secondary, body[data-study-style="infantil"] .choice { min-height: 3.5rem; padding: .72rem .95rem; }
body[data-study-style="infantil"] .panel { border-color: #b9ded4; }
body[data-study-style="infantil"] .student-row { background: #fffcdf; border-color: #e6db9b; }
body[data-study-style="infantil"] .quiz-intro { background: linear-gradient(125deg, #e0f7ed, #fff5ce); border-color: #b9ded4; }
body[data-study-style="infantil"] .meta, body[data-study-style="infantil"] .quiz-meter { font-size: 1rem; }
body[data-study-style="infantil"] .game-choice:has(input:checked) { background: #e5f9f2; }
.quiz [data-meter] { width: 100%; accent-color: var(--brand); }
.quiz-note { border-radius: .8rem; padding: .9rem 1rem; }
.quiz .choice.correct { background: #def1e3; color: #245437; border-color: #93bc9f; }
.quiz .choice.incorrect { background: #ffebe0; color: #773a24; border-color: #dfaa91; }
.quiz-stats { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.quiz-adventure { background: white; border: 1px solid #e7e2f7; border-radius: 1.65rem; padding: clamp(.9rem, 4vw, 1.55rem); box-shadow: 0 18px 55px #52428c20; }
.adventure-top { background: linear-gradient(118deg, #6245d1, #8068ef); color: white; border-radius: 1rem; padding: .9rem 1.2rem; }
.adventure-top p { color: #f4efff; font-weight: 720; }
.adventure-top h2 { margin: .2rem 0; }
.quiz-adventure .quiz-stats { color: #5845a5; font-weight: 750; }
.quiz-adventure .quiz-stats h2 { font-size: 1rem; }
.quiz-adventure progress { height: .75rem; accent-color: #168369; }
.quiz-adventure .question { border: 0; padding: 0; border-radius: 0; }
.quiz-adventure .question legend { padding: 0; margin-bottom: .85rem; font-size: clamp(1.22rem, 4vw, 1.66rem); line-height: 1.35; }
.quiz-adventure .choice { position: relative; background: #fbfaff; border: 2px solid #e6e4ef; min-height: 3.6rem; border-radius: 1rem; padding: .9rem; font-weight: 680; }
.quiz-adventure .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz-adventure .choice:has(input:focus-visible) { outline: 3px solid #9f8eff; outline-offset: 2px; }
.quiz-adventure .choice.correct { background: #e2f9ef; border-color: #27b782; color: #145d43; }
.quiz-adventure .choice.incorrect { background: #ffebee; border-color: #e56f86; color: #8d2d41; }
.quiz-adventure .quiz-note { background: #f3eeff; border: 1px solid #dfd4ff; color: #28243f; }
.quiz-adventure .actions .button { background: #6448d4; min-height: 3.35rem; }
