:root {
  --bg: #f6f4ee;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #5d6474;
  --line: #e4e0d6;
  --brand: #2f6fde;
  --ok: #1f9d55;
  --ok-bg: #e6f6ec;
  --bad: #d64545;
  --bad-bg: #fdecec;
  --warn: #b7791f;
  --warn-bg: #fdf3e1;
  --radius: 18px;
  --shadow: 0 2px 0 rgba(31, 36, 48, .06), 0 8px 24px rgba(31, 36, 48, .06);
  --c-matematicas: #2f6fde;
  --c-espanol: #d9480f;
  --c-completar: #7048e8;
  --c-informatica: #0b8a8a;
  --c-economia: #2b8a3e;
  --c-investigacion: #a5631b;
  --c-sociales: #c2255c;
  --c-ciencias: #1c7ed6;
  --c-ingles: #5f3dc4;
  --c-cierre: #495057;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171c; --card: #1f222a; --ink: #eef0f4; --muted: #a8afbd; --line: #30343e;
    --ok-bg: #12301f; --bad-bg: #3a1a1a; --warn-bg: #3a2c12;
    --shadow: 0 2px 0 rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px; line-height: 1.5;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { max-width: 920px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 20px; }
.top-nav { display: flex; gap: 6px; }
.nav-link { text-decoration: none; color: var(--ink); font-weight: 800; padding: 8px 14px; border-radius: 999px; }
.nav-link.on { background: var(--brand); color: #fff; }
.loading { padding: 40px 0; color: var(--muted); }
.foot { color: var(--muted); font-size: 14px; padding: 32px 16px 48px; text-align: center; }

.hero { margin: 24px 0 16px; padding: 24px; border-radius: var(--radius); background: linear-gradient(135deg, #2f6fde, #7048e8); color: #fff; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 4px; font-size: 30px; line-height: 1.2; }
.hero p { margin: 4px 0; opacity: .95; }
.hero .meta { font-weight: 700; opacity: .9; }
.bar { height: 14px; background: rgba(255,255,255,.3); border-radius: 999px; overflow: hidden; margin-top: 14px; }
.bar > span { display: block; height: 100%; background: #ffd43b; border-radius: 999px; transition: width .4s; }
.bar-label { font-weight: 800; margin-top: 6px; font-size: 15px; }

.section-title { font-size: 22px; margin: 28px 0 12px; }
.schedule { display: grid; gap: 10px; }
.slot { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border-left: 8px solid var(--subject, var(--line)); }
a.slot:hover { transform: translateY(-1px); }
.slot .time { font-weight: 900; font-size: 17px; }
.slot .time small { display: block; font-weight: 600; color: var(--muted); font-size: 13px; }
.slot .label { font-weight: 800; }
.slot .label small { display: block; font-weight: 600; color: var(--muted); font-size: 14px; }
.slot.pausa { background: transparent; box-shadow: none; border-style: dashed; border-left-width: 1px; }
.badge { font-size: 14px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--line); color: var(--ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 16px 0; }
.act-head { margin: 24px 0 8px; }
.chip { display: inline-block; font-size: 14px; font-weight: 900; color: #fff; background: var(--subject, var(--brand)); padding: 4px 12px; border-radius: 999px; }
.act-head h1 { font-size: 28px; margin: 8px 0 4px; line-height: 1.2; }
.act-head .meta { color: var(--muted); font-weight: 700; }
.intro p:first-child { margin-top: 0; }
.intro p:last-child { margin-bottom: 0; }
.intro .tip { background: var(--warn-bg); border-radius: 12px; padding: 10px 14px; }
.figure { text-align: center; margin: 12px 0; }
.figure img { border-radius: 12px; max-height: 340px; background: #fff; padding: 8px; }
.credit { font-size: 12px; color: var(--muted); }
.reading { font-size: 19px; line-height: 1.7; background: var(--bg); border-radius: 14px; padding: 16px 18px; }

.q { border-top: 1px solid var(--line); padding: 18px 0; }
.q:first-of-type { border-top: 0; padding-top: 4px; }
.q-head { display: flex; gap: 10px; align-items: flex-start; }
.q-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--subject, var(--brand)); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 16px; }
.q-text { flex: 1; font-weight: 700; padding-top: 3px; white-space: pre-line; }
.say { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; }
.q .figure img { max-height: 220px; }
.hint { color: var(--muted); font-size: 15px; margin: 6px 0 0 44px; }
.opts { display: grid; gap: 8px; margin: 12px 0 0 44px; }
.opt { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 700; background: var(--card); }
.opt input { width: 22px; height: 22px; accent-color: var(--brand); flex: 0 0 auto; }
.opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.field { margin: 12px 0 0 44px; }
input.text, textarea, .blank {
  font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
input.text { width: min(320px, 100%); font-weight: 800; }
textarea { width: 100%; min-height: 110px; resize: vertical; }
input.text:focus, textarea:focus, .blank:focus { outline: none; border-color: var(--brand); }
.blanks { margin: 12px 0 0 44px; line-height: 2.6; font-weight: 700; }
.blank { width: 110px; padding: 4px 8px; font-weight: 800; text-align: center; }
.mark-ok { border-color: var(--ok) !important; background: var(--ok-bg) !important; }
.mark-bad { border-color: var(--bad) !important; background: var(--bad-bg) !important; }
.feedback { margin: 8px 0 0 44px; font-weight: 800; font-size: 15px; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.feedback.open { color: var(--warn); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.btn { font: inherit; font-weight: 900; border: 0; border-radius: 14px; padding: 14px 22px; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn:disabled { opacity: .6; cursor: wait; }

.result { text-align: center; }
.result .big { font-size: 64px; font-weight: 900; line-height: 1; margin: 8px 0; }
.result .big.ok { color: var(--ok); }
.result .big.bad { color: var(--bad); }
.result .big.warn { color: var(--warn); }
.result p { margin: 6px 0; }

table.boletin { width: 100%; border-collapse: collapse; }
table.boletin th, table.boletin td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.boletin th { font-size: 14px; color: var(--muted); }
table.boletin td.n { font-weight: 900; text-align: right; }
.legend { color: var(--muted); font-size: 14px; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero h1 { font-size: 24px; }
  .slot { grid-template-columns: 60px 1fr; }
  .slot .badge { grid-column: 2; justify-self: start; }
  .opts, .field, .blanks, .hint, .feedback { margin-left: 0; }
  .top-nav .nav-link { padding: 6px 10px; }
  .brand span { font-size: 17px; }
}

.papa-note { background: #fff9db; color: #5c3c00; border: 2px solid #ffd43b; border-radius: 14px; padding: 12px 16px; font-weight: 700; white-space: pre-line; }
.papa-note.small { margin: 10px 0 0 44px; padding: 8px 12px; font-size: 16px; }
@media (max-width: 560px) { .papa-note.small { margin-left: 0; } }

.listen { float: right; margin: 0 0 8px 12px; padding: 8px 14px; font-size: 15px; }
.young .say { width: 58px; height: 58px; font-size: 28px; background: #ffd43b; border-color: #f59f00; }
.young .q-text { font-size: 32px; line-height: 1.3; }
.young .opt { font-size: 30px; padding: 14px 18px; }
.young .reading { font-size: 22px; }
@media (max-width: 560px) { .listen { float: none; display: block; margin: 0 0 10px; } }
