
@font-face { font-family: "Zilla Slab"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/zilla-slab-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Zilla Slab"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/zilla-slab-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
/* Layout: hoja de estudio. Columna de lectura alineada a la izquierda (máx. 44rem);
   escala MCER, tablas y tests a ancho completo (máx. 72rem). Tinta azul de bolígrafo
   como acento, amarillo de subrayador solo para el nivel que se pide. */
:root {
  --paper: #f5f7fa;
  --surface: #ffffff;
  --ink: #18202f;
  --ink-soft: #525d72;
  --rule: #d8dee8;
  --pen: #2a43b4;
  --pen-soft: #e7ebfb;
  --marker: #ffe35a;
  --marker-ink: #18202f;
  --ok: #1b7549;
  --ok-soft: #e2f3e9;
  --bad: #b5373a;
  --bad-soft: #f9e5e5;
  --font-display: "Zilla Slab", "Rockwell", "Roboto Slab", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.2rem, 5vw + 1rem, 3.4rem);
  --read: 44rem;
  --wide: 72rem;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10141c;
    --surface: #171d28;
    --ink: #e6e9f0;
    --ink-soft: #a5aec0;
    --rule: #2b3445;
    --pen: #93a6ff;
    --pen-soft: #222b4b;
    --marker: #e8cb4c;
    --marker-ink: #18202f;
    --ok: #67c995;
    --ok-soft: #15301f;
    --bad: #f28a8a;
    --bad-soft: #3a1c1d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10141c;
  --surface: #171d28;
  --ink: #e6e9f0;
  --ink-soft: #a5aec0;
  --rule: #2b3445;
  --pen: #93a6ff;
  --pen-soft: #222b4b;
  --marker: #e8cb4c;
  --marker-ink: #18202f;
  --ok: #67c995;
  --ok-soft: #15301f;
  --bad: #f28a8a;
  --bad-soft: #3a1c1d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--pen); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-4); letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0; }

.shell { padding-inline: 16px; }
.wrap { max-width: var(--wide); margin-inline: auto; }
.read { max-width: var(--read); }

/* Cabecera */
.site-head { border-bottom: 1px solid var(--rule); background: var(--surface); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-block: 14px;
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.45rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.brand .lvl {
  font-family: var(--font-body); font-weight: 700; font-size: 0.72rem;
  background: var(--marker); color: var(--marker-ink);
  padding: 1px 6px; border-radius: 4px; transform: translateY(-3px);
}
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.98rem; padding-block: 4px; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--pen); color: var(--pen); }

main { padding-block: 40px 72px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.section { display: flex; flex-direction: column; gap: 18px; padding-top: 56px; }
.lead { font-size: var(--step-1); color: var(--ink-soft); max-width: 40rem; }
.meta { font-size: var(--step--1); color: var(--ink-soft); }
.crumb { font-size: var(--step--1); }

mark, .mark {
  background: var(--marker); color: var(--marker-ink);
  padding: 0 4px; border-radius: 3px; font-weight: 700;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Selector de objetivo */
.goals { display: flex; flex-wrap: wrap; gap: 10px; }
.goal {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 999px;
}
.goal:hover { border-color: var(--pen); }
.goal[aria-pressed="true"] { background: var(--pen); border-color: var(--pen); color: var(--surface); }
.answer {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; max-width: var(--read);
}
.answer h3 { font-size: var(--step-1); }

/* Escala MCER */
.scale { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 18px 16px; overflow-x: auto; }
.scale-grid { display: grid; grid-template-columns: minmax(9.5rem, 13rem) repeat(6, minmax(3rem, 1fr)); gap: 10px 0; min-width: 34rem; align-items: center; }
.scale-head { font-weight: 700; font-size: var(--step--1); color: var(--ink-soft); text-align: center; border-left: 1px dashed var(--rule); padding-bottom: 4px; }
.scale-name { grid-column: 1; font-weight: 700; font-size: 0.98rem; padding-right: 12px; line-height: 1.25; }
.scale-name a { color: var(--ink); text-decoration: none; }
.scale-name a:hover { color: var(--pen); text-decoration: underline; }
.scale-name small { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.8rem; }
.bar {
  height: 26px; border-radius: 6px; background: var(--pen); color: var(--surface);
  font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; padding-inline: 10px; white-space: nowrap; overflow: hidden;
}
.bar.light { background: var(--pen-soft); color: var(--pen); border: 1.5px dashed var(--pen); }
.dots { display: flex; justify-content: space-around; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pen); display: inline-block; }
.scale-note { margin-top: 12px; font-size: var(--step--1); color: var(--ink-soft); }

/* Tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; background: var(--pen-soft); color: var(--ink); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; }
.compare { min-width: 52rem; }
.tnum { font-variant-numeric: tabular-nums; }

/* Fichas */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.facts div { padding: 14px 16px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); min-width: 0; }
.facts dt { font-size: var(--step--1); color: var(--ink-soft); }
.facts dd { margin: 2px 0 0; font-weight: 700; }

ul.plain, ol.plain { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.sources { font-size: var(--step--1); color: var(--ink-soft); }
.sources ul { margin: 6px 0 0; padding-left: 1.2em; }

/* Tarjetas de práctica */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
}
.card:hover { border-color: var(--pen); }
.card .tag { font-size: var(--step--1); font-weight: 700; color: var(--pen); }
.card dl { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.card dl div { display: flex; gap: 4px; }
.card dd { margin: 0; font-weight: 700; color: var(--ink); }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  background: var(--pen); color: var(--surface); border: 0; border-radius: 8px; padding: 11px 18px; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--pen); border: 1.5px solid var(--pen); }

/* Test */
.test-intro { display: flex; flex-direction: column; gap: 14px; max-width: var(--read); }
.part { display: flex; flex-direction: column; gap: 16px; padding-top: 44px; }
.part > header { display: flex; flex-direction: column; gap: 6px; max-width: var(--read); border-top: 2px solid var(--ink); padding-top: 14px; }
.part > header .meta { font-weight: 700; }
.item {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; max-width: var(--read);
}
.item.is-right { border-color: var(--ok); }
.item.is-wrong { border-color: var(--bad); }
.qn { font-family: var(--font-display); font-weight: 700; color: var(--pen); margin-right: 6px; }
.stem { font-size: 1.06rem; }
.bubbles { display: flex; flex-wrap: wrap; gap: 8px 10px; border: 0; margin: 0; padding: 0; }
.bubbles legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bubble { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 12px 6px 6px; border: 1.5px solid var(--rule); border-radius: 999px; background: var(--paper); }
.bubble input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bubble .ltr {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-soft);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; color: var(--ink-soft); flex: none;
}
.bubble:has(input:checked) { border-color: var(--pen); background: var(--pen-soft); }
.bubble:has(input:checked) .ltr { background: var(--pen); border-color: var(--pen); color: var(--surface); }
.bubble:has(input:focus-visible) { outline: 3px solid var(--pen); outline-offset: 2px; }
.item.is-right .bubble:has(input:checked) { border-color: var(--ok); background: var(--ok-soft); }
.item.is-right .bubble:has(input:checked) .ltr { background: var(--ok); border-color: var(--ok); }
.item.is-wrong .bubble:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); }
.item.is-wrong .bubble:has(input:checked) .ltr { background: var(--bad); border-color: var(--bad); }
.bubble.is-key { border-color: var(--ok); }

.vocab-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, 13rem); gap: 8px 14px; align-items: center; padding-block: 8px; border-bottom: 1px dashed var(--rule); }
.vocab-row:last-of-type { border-bottom: 0; }
.vocab-row label { min-width: 0; }
select, .gap-input {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--rule); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 100%;
}
select:focus-visible, .gap-input:focus-visible { outline: 3px solid var(--pen); outline-offset: 1px; }
.vocab-row.is-right select { border-color: var(--ok); background: var(--ok-soft); }
.vocab-row.is-wrong select { border-color: var(--bad); background: var(--bad-soft); }
.bank { font-size: var(--step--1); color: var(--ink-soft); }

.passage { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px 22px; max-width: var(--read); display: flex; flex-direction: column; gap: 14px; line-height: 2.1; }
.passage h3 { line-height: 1.2; }
.gap-label { font-family: var(--font-display); font-weight: 700; color: var(--pen); }
.gap-blank { display: inline-block; min-width: 3.2rem; border-bottom: 2px solid var(--ink-soft); text-align: center; font-weight: 700; color: var(--pen); line-height: 1.4; }
.passage .gap-input { width: 9.5rem; max-width: 100%; padding: 2px 8px; display: inline-block; }
.kw { font-weight: 700; font-size: var(--step--1); color: var(--ink-soft); letter-spacing: 0.04em; }
.gap-input.is-right { border-color: var(--ok); background: var(--ok-soft); }
.gap-input.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.explain { font-size: 0.97rem; color: var(--ink); background: var(--pen-soft); border-radius: 8px; padding: 10px 12px; }
.explain b.key { color: var(--ok); }
.explain-list { display: flex; flex-direction: column; gap: 8px; max-width: var(--read); }
.keyword { font-weight: 700; letter-spacing: 0.06em; color: var(--pen); }
.transform .gap-input { width: 100%; }

.testbar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 40px;
  background: var(--surface); border-top: 1px solid var(--rule);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
}
.testbar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.testbar .status { display: flex; flex-wrap: wrap; gap: 6px 18px; font-variant-numeric: tabular-nums; font-weight: 700; }
.testbar .timer.is-low { color: var(--bad); }
.testbar .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result { background: var(--surface); border: 2px solid var(--pen); border-radius: var(--radius); padding: 20px 22px; max-width: var(--read); display: flex; flex-direction: column; gap: 8px; }
.result .score { font-family: var(--font-display); font-size: var(--step-3); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Pie */
.site-foot { border-top: 1px solid var(--rule); background: var(--surface); }
.site-foot .wrap { padding-block: 28px; display: flex; flex-direction: column; gap: 12px; font-size: var(--step--1); color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--ink-soft); }

.legal h2 { font-size: var(--step-2); }
.legal .stack { max-width: var(--read); }
.placeholder { background: var(--marker); color: var(--marker-ink); padding-inline: 4px; border-radius: 3px; font-weight: 700; }

@media (max-width: 560px) {
  main { padding-block: 28px 56px; }
  .testbar { padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .testbar .wrap { gap: 6px 12px; }
  .testbar .btn { padding: 8px 12px; font-size: 0.95rem; }
  .vocab-row { grid-template-columns: 1fr; }
  .section { padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Reading, writing, speaking y listening */
.passage-tight { line-height: 1.65; }
.passage select { width: auto; display: inline-block; padding: 2px 8px; margin-inline: 4px; }
select.is-right { border-color: var(--ok); background: var(--ok-soft); }
select.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.fixed { color: var(--ink-soft); }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 14px; }
.person { border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; background: var(--paper); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.para { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px dashed var(--rule); }
.para:last-child { border-bottom: 0; }
.headings { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.headings b { display: inline-block; min-width: 1.6em; color: var(--pen); }
.audio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.transcript { margin-top: 6px; }
textarea {
  font: inherit; color: var(--ink); background: var(--paper); width: 100%; min-width: 0;
  border: 1.5px solid var(--rule); border-radius: 8px; padding: 10px 12px; resize: vertical; line-height: 1.5;
}
textarea:focus-visible { outline: 3px solid var(--pen); outline-offset: 1px; }
.counter { font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.counter.is-ok { color: var(--ok); font-weight: 700; }
.counter.is-off { color: var(--bad); font-weight: 700; }
.model { border-top: 1px dashed var(--rule); padding-top: 10px; }
.model summary { cursor: pointer; font-weight: 700; color: var(--pen); }
.model-body { margin-top: 8px; background: var(--pen-soft); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.tip { font-size: 0.97rem; color: var(--ink-soft); }
.timer-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.clock { font-weight: 700; font-variant-numeric: tabular-nums; }
.clock.is-low { color: var(--bad); }
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; max-width: var(--read); }
.rec audio { max-width: 100%; }
.photo-box {
  max-width: var(--read); border: 2px dashed var(--ink-soft); border-radius: var(--radius);
  padding: 18px 20px; background: var(--surface); color: var(--ink); font-style: italic;
}
