/*
VOICE: amable, claro y profesional; un producto para docentes ocupados, no una plantilla escolar.
IDEA: la mesa del maestro: fichas de papel blanco sobre un fondo tranquilo, con cartulinas de color.
PICTURE: fichas generadas (sopa de letras, flashcard, crucigrama) inclinadas como sobre una mesa.
COLOUR and TYPE: azul cobalto (tinta) dominante, coral y amarillo girasol de acento; tipografía redondeada del sistema.
LAYOUT: barra superior fija, bandas a todo el ancho, herramientas con panel de ajustes + vista previa en papel.
*/
:root {
  color-scheme: light dark;
  --brand: #2346d8; --brand-ink: #1a36b0; --brand-soft: #e8edff;
  --coral: #ff6b4a; --sun: #ffc83d; --mint: #19a874;
  --ink: #161a2e; --ink-strong: #161a2e; --muted: #5a6178;
  --bg: #f6f7fb; --paper: #ffffff; --wash: #eef1fa; --line: #dde2ee;
  --shadow: 0 1px 2px rgba(22,26,46,.05), 0 6px 20px rgba(22,26,46,.06);
  --radius: 16px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --brand: #7b93ff; --brand-ink: #a3b3ff; --brand-soft: #1d2550;
    --ink: #e8ebf7; --muted: #a7adc6; --bg: #0e1120; --paper: #161a2d; --wash: #1c2240; --line: #2a3154;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --brand: #7b93ff; --brand-ink: #a3b3ff; --brand-soft: #1d2550;
  --ink: #e8ebf7; --muted: #a7adc6; --bg: #0e1120; --paper: #161a2d; --wash: #1c2240; --line: #2a3154;
}
:root[data-theme=light] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font-text); overflow-x: clip; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-ink); }
h1, h2, h3, h4 { font-family: var(--font); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 750; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: .5rem 1rem; z-index: 50; border-radius: 8px; }
.skip:focus { left: 8px; }
.ico { width: 1.25em; height: 1.25em; flex: none; }
.wrap { width: min(100% - 2rem, 1200px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; justify-content: center; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 68ch; }
.kicker { font-family: var(--font); font-weight: 800; color: var(--brand); font-size: .95rem; margin-bottom: .6rem; }
.kicker a { text-decoration: none; }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-family: var(--font); font-size: 1.25rem; font-weight: 700; }
.logo b { font-weight: 900; color: var(--brand); }
.logo-mark { width: 36px; height: 36px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 650; padding: .55rem .75rem; border-radius: 10px; font-size: .97rem; }
.nav a:hover { background: var(--wash); color: var(--ink); }
.nav a[aria-current=page] { color: var(--brand); background: var(--brand-soft); }
.nav .lang { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); margin-left: .4rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; width: 44px; height: 44px; align-items: center; justify-content: center; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: .6rem 1rem 1rem; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: .8rem; }
  .nav .lang { margin: .4rem 0 0; justify-content: center; }
}

/* Botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .65rem 1.15rem; border-radius: 12px; border: 2px solid var(--brand); background: var(--brand); color: #fff; font: 700 1rem/1.1 var(--font); text-decoration: none; cursor: pointer; transition: transform .12s, background .12s; }
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand); }
.btn.lg { min-height: 52px; padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.field > label, .field > span { font-weight: 700; font-size: .92rem; }
select, input[type=text], input[type=search], textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .7rem; min-height: 44px; width: 100%; }
select:focus, input:focus, textarea:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent); }
textarea { resize: vertical; min-height: 110px; line-height: 1.4; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 600; font-size: .95rem; margin: .4rem 0 .9rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.help { color: var(--muted); font-size: .85rem; margin: -.4rem 0 .9rem; }
.notice { background: color-mix(in srgb, var(--sun) 22%, var(--paper)); border: 1px solid color-mix(in srgb, var(--sun) 60%, var(--line)); border-radius: 10px; padding: .6rem .8rem; font-size: .92rem; color: var(--ink); }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 .8rem; }

/* Hero */
.hero { padding: clamp(2.2rem, 5vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem); background: linear-gradient(180deg, var(--brand-soft), var(--bg)); }
.hero-in { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero-art { width: 100%; height: auto; max-height: 440px; }
.art-title { font: 800 22px var(--font); fill: #161a2e; }
.art-letter { font: 800 16px var(--font); fill: #161a2e; }
.art-small { font: 600 13px var(--font-text); fill: #5a6178; }
.art-card { font: 800 28px var(--font); fill: #fff; }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; } .hero-art { max-height: 300px; order: 2; } }

/* Bandas y secciones */
.band { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.band.alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: 1.2rem; }
.section-head h2 { margin: 0; }
.section-head a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sub { margin: 2rem 0 .8rem; font-size: 1.05rem; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 860px) { .split, .three { grid-template-columns: 1fr; } }
.page-head { padding: 1.2rem 0 1.4rem; }
.page-head.center .btn-row { justify-content: center; }
.content-block { margin: 2.2rem 0; }
.prose-wrap { max-width: 820px; }

/* Tarjetas de herramienta */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tool-grid.compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.tool-card { display: flex; gap: .9rem; align-items: flex-start; padding: 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--ink); }
.tool-card strong { display: block; font-family: var(--font); font-size: 1.05rem; line-height: 1.25; margin-bottom: .2rem; }
.tool-card .tool-txt span { color: var(--muted); font-size: .9rem; line-height: 1.45; display: block; }
.compact .tool-card { padding: .8rem; box-shadow: none; }
.compact .tool-card .tool-txt span { display: none; }
.tool-ico { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.tool-ico .ico { width: 26px; height: 26px; }
.tool-ico.lg { width: 64px; height: 64px; border-radius: 18px; }
.tool-ico.lg .ico { width: 34px; height: 34px; }
.ic-wordsearch, .ic-quiz { background: #e8edff; color: #2346d8; }
.ic-vocabsheet, .ic-scramble { background: #fff0db; color: #b05f00; }
.ic-flashcards, .ic-bingo { background: #ffe6df; color: #c43d1d; }
.ic-crossword, .ic-gapfill { background: #e0f6ec; color: #0f7a52; }
.ic-matching { background: #f1e8ff; color: #6b3fc4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .tool-ico { filter: saturate(.9) brightness(.92); } }

/* Recursos, noticias, chips */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.res-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.res-card h3 { font-size: 1.12rem; margin: .5rem 0; }
.res-card h3 a { color: var(--ink); text-decoration: none; }
.res-card h3 a:hover { color: var(--brand); }
.res-card p { color: var(--muted); font-size: .94rem; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-block; font: 700 .75rem/1 var(--font); background: var(--brand-soft); color: var(--brand); padding: .35rem .6rem; border-radius: 999px; }
.tag.soft { background: var(--wash); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .5rem .85rem; min-height: 40px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 650; font-size: .92rem; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.res { background: color-mix(in srgb, var(--sun) 18%, var(--paper)); }
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: auto 1fr; gap: .2rem .7rem; padding: .85rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.news a { font-weight: 700; color: var(--ink); text-decoration: none; }
.news a:hover { color: var(--brand); }
.news time { grid-column: 2; color: var(--muted); font-size: .85rem; }
.explore { display: grid; gap: 1rem; align-content: start; }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.area-card { display: flex; flex-direction: column; gap: .3rem; padding: 1.2rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.area-card:hover { border-color: var(--brand); color: var(--ink); }
.area-card strong { font-family: var(--font); font-size: 1.1rem; }
.area-card span { color: var(--muted); font-size: .92rem; }
.area-card .ico { width: 32px; height: 32px; color: var(--coral); margin-bottom: .3rem; }
.about-strip { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.about-strip > div { max-width: 720px; }
.about-strip p { color: var(--muted); margin: 0; }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; background: var(--brand); color: #fff; border-radius: var(--radius); padding: 1.6rem; margin: 2rem 0; }
.cta-band h2 { margin: 0 0 .3rem; font-size: 1.35rem; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band .btn { background: var(--sun); border-color: var(--sun); color: #161a2e; }
.guide-list { list-style: none; padding: 0; display: grid; gap: .8rem; margin: 0 0 1rem; }
.guide-list a { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.guide-list a:hover { border-color: var(--brand); color: var(--ink); }
.guide-list .num { width: 40px; height: 40px; border-radius: 12px; background: var(--sun); color: #161a2e; font: 900 1.1rem var(--font); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.guide-list strong { display: block; font-family: var(--font); font-size: 1.1rem; }
.guide-list span span { color: var(--muted); font-size: .94rem; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; margin-bottom: 1.2rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.field.inline { margin: 0; min-width: 160px; }
.field.inline.grow { flex: 1; }
.empty { padding: 1.2rem; background: var(--paper); border-radius: var(--radius); border: 1px dashed var(--line); }

/* Migas */
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .88rem; color: var(--muted); padding-top: 1.1rem; }
.crumbs a { color: var(--muted); }
.crumbs .sep { opacity: .5; }

/* Página de herramienta */
.tool-head { display: flex; gap: 1.1rem; align-items: center; padding: 1rem 0 1.4rem; }
.tool-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: .2rem; }
.tool-head .lead { margin: 0; }
@media (max-width: 600px) { .tool-head { align-items: flex-start; gap: .8rem; } .tool-ico.lg { width: 48px; height: 48px; border-radius: 14px; } .tool-ico.lg .ico { width: 26px; height: 26px; } }
.tool-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; }
.panel-title { font-size: 1.05rem; margin-bottom: 1rem; }
.actions { display: grid; grid-template-columns: 1fr; gap: .6rem; margin: .4rem 0 .8rem; }
.preview { min-height: 420px; }
@media (max-width: 920px) { .tool-layout { grid-template-columns: 1fr; } .panel { position: static; max-height: none; } }

/* ===== Ficha imprimible (siempre papel blanco) ===== */
.sheet { -webkit-print-color-adjust: exact; print-color-adjust: exact; --s-ink: #161a2e; --s-muted: #5a6178; --s-line: #c9cfdd; --s-wash: #f1f3f9; background: #fff; color: var(--s-ink); border-radius: 14px; padding: clamp(1rem, 3vw, 2.2rem); box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; }
.ws-head { margin-bottom: 1.1rem; }
.ws-title { font: 800 clamp(1.5rem, 3vw, 2rem)/1.1 var(--font); text-align: center; margin: 0 0 .3rem; color: var(--s-ink); }
.ws-sub { text-align: center; color: var(--s-muted); margin: 0 0 .7rem; font-weight: 600; }
.ws-name { display: flex; gap: 1.5rem; }
.ws-name span { flex: 1; border-bottom: 1.5px solid var(--s-line); padding-bottom: .2rem; font-weight: 700; color: var(--s-muted); }
.pic { font-size: 1.35em; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pic.big { font-size: 2.6rem; display: block; }
.pic.empty { width: 2.6rem; height: 2.6rem; border: 1.5px dashed var(--s-line); border-radius: 8px; }
.es { display: block; color: var(--s-muted); font-size: .85rem; }
.key { padding-left: 1.3rem; columns: 2 200px; }
.key.cols { columns: 3 160px; }
.key li { margin-bottom: .35rem; break-inside: avoid; }
.len { color: var(--s-muted); font-size: .85rem; margin-left: .3rem; }
.first { font-weight: 800; font-family: var(--font); font-size: 1.1rem; margin-right: .1rem; }
.line { display: inline-block; flex: 1; min-width: 120px; border-bottom: 1.5px solid var(--s-ink); height: 1.6em; }
.gap { display: inline-block; width: calc(var(--len, 6) * .62em + 1.2em); border-bottom: 1.5px solid var(--s-ink); height: 1.1em; margin: 0 .15em; vertical-align: baseline; }
/* sopa de letras */
.ws-grid { border-collapse: collapse; margin: 0 auto 1rem; width: auto; }
.ws-grid td { width: 2.2rem; height: 2.2rem; text-align: center; font: 800 1.2rem var(--font); border: 1px solid var(--s-line); color: var(--s-ink); }
.ws-grid.size-15 td { width: 1.85rem; height: 1.85rem; font-size: 1.05rem; }
.ws-grid td.hit { background: #ffd96b; box-shadow: inset 0 0 0 2px #e0a800; }
.ws-words { list-style: none; padding: 0; margin: 0; columns: 3 150px; font-weight: 700; }
.ws-words li { margin-bottom: .4rem; break-inside: avoid; }
.ws-words li::before { content: "☐ "; color: var(--s-muted); }
/* fichas de vocabulario */
.vs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.vs-card { border: 2px solid var(--s-line); border-radius: 14px; padding: .8rem .5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .35rem; break-inside: avoid; }
.vs-card strong { font: 800 1.1rem var(--font); }
.vs-grid.draw .vs-card { justify-content: space-between; }
.draw-box { width: 100%; aspect-ratio: 1; border: 1.5px dashed var(--s-line); border-radius: 10px; }
.vs-rows { display: grid; gap: .9rem; }
.vs-row { display: flex; align-items: center; gap: 1rem; break-inside: avoid; }
.vs-row .pic.big { width: 3.2rem; text-align: center; }
.vs-lines { flex: 1; display: flex; align-items: flex-end; gap: 1rem; }
.trace { font: 800 1.8rem var(--font); color: #c5cad8; letter-spacing: .08em; -webkit-text-stroke: .5px #9aa1b5; min-width: 9ch; }
.frame { margin-top: 1.2rem; font-size: 1.1rem; font-weight: 600; }
/* flashcards */
.fc-page { display: grid; gap: 0; border: 1.5px dashed var(--s-line); }
.fc-page.per-4 { grid-template-columns: repeat(2, 1fr); }
.fc-page.per-6 { grid-template-columns: repeat(2, 1fr); }
.fc-page.per-8 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .fc-page.per-6, .fc-page.per-8 { grid-template-columns: repeat(3, 1fr); } }
.fc { border: 1.5px dashed var(--s-line); min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; padding: 1rem; text-align: center; break-inside: avoid; }
.per-4 .fc { min-height: 260px; }
.fc-pic { font-size: 4.2rem; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.per-4 .fc-pic { font-size: 6rem; }
.fc-word { font: 800 1.7rem var(--font); }
.per-4 .fc-word { font-size: 2.3rem; }
/* crucigrama */
.cw-grid { border-collapse: collapse; margin: 0 auto 1.2rem; width: auto; }
.cw-grid td { width: 2.2rem; height: 2.2rem; padding: 0; position: relative; }
.cw-grid td.cell { border: 1.5px solid var(--s-ink); background: #fff; }
.cw-grid td.blank { border: 0; }
.cw-grid .n { position: absolute; top: 1px; left: 3px; font-size: .62rem; font-weight: 800; color: var(--s-muted); }
.cw-grid .ch { display: flex; align-items: center; justify-content: center; height: 100%; font: 800 1.15rem var(--font); }
.cw-clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 2rem; }
.cw-clues h3 { font-size: 1.05rem; color: var(--s-ink); }
.cw-clues ol { list-style: none; padding: 0; margin: 0; }
.cw-clues li { margin-bottom: .45rem; display: flex; align-items: center; gap: .4rem; }
.bank { margin-top: 1rem; padding: .7rem 1rem; background: var(--s-wash); border-radius: 10px; }
/* unir */
.match { display: grid; gap: .6rem; max-width: 640px; margin: 0 auto; }
.m-row { display: grid; grid-template-columns: 1fr 5rem 1fr; align-items: center; }
.m-left, .m-right { display: flex; align-items: center; gap: .6rem; font: 700 1.15rem var(--font); }
.m-left { justify-content: flex-end; }
.m-left .pic.big { font-size: 2.4rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--s-ink); flex: none; }
.es-word { font-weight: 700; }
/* completar frases */
.bank-box { display: flex; flex-wrap: wrap; gap: .5rem; border: 2px solid var(--s-line); border-radius: 12px; padding: .7rem; margin-bottom: 1.1rem; }
.bank-box span { font: 700 1rem var(--font); padding: .2rem .6rem; background: var(--s-wash); border-radius: 8px; }
.gap-list { padding-left: 1.4rem; display: grid; gap: .9rem; font-size: 1.12rem; }
/* bingo */
.bingo-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
.bingo-card { border: 2px solid var(--s-ink); border-radius: 14px; padding: .8rem; break-inside: avoid; page-break-inside: avoid; }
.bingo-title { display: flex; justify-content: space-between; font: 800 1rem var(--font); margin-bottom: .5rem; }
.bingo-title span { background: #ffc83d; padding: 0 .5rem; border-radius: 6px; }
.bingo { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bingo td { border: 1.5px solid var(--s-line); text-align: center; height: 5.2rem; padding: .2rem; vertical-align: middle; }
.bingo.g4 td { height: 4.2rem; }
.bingo .pic { display: block; font-size: 2rem; }
.bingo.g4 .pic { font-size: 1.6rem; }
.bingo .w { display: block; font: 700 .85rem/1.15 var(--font); overflow-wrap: anywhere; }
.bingo-name { margin-top: .5rem; font-size: .85rem; color: var(--s-muted); }
/* quiz */
.quiz { padding-left: 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 2rem; }
.q { break-inside: avoid; }
.q-prompt { font-weight: 700; margin-bottom: .4rem; }
.q-prompt .pic.big { font-size: 2.8rem; }
.q-opts { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.box { display: inline-flex; width: 1.6rem; height: 1.6rem; border: 1.5px solid var(--s-ink); border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; margin-right: .3rem; }
/* desordenadas */
.scr-list { padding-left: 1.5rem; display: grid; gap: 1rem; }
.scr-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-size: 1.1rem; }
.scr { display: inline-flex; gap: .25rem; }
.scr i { font: 800 1.15rem var(--font); font-style: normal; width: 1.8rem; height: 1.8rem; display: inline-flex; align-items: center; justify-content: center; background: var(--s-wash); border-radius: 6px; text-transform: lowercase; }
.arrow { color: var(--s-muted); }
/* recursos: frases */
.phrase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.phrase { border: 2px solid #2346d8; border-radius: 14px; padding: .9rem; text-align: center; break-inside: avoid; }
.phrase strong { display: block; font: 800 1.02rem/1.25 var(--font); margin: .3rem 0; }
.phrase small { color: var(--s-muted); }
.resource-sheet { margin: 1.5rem 0; }
.no-print-sub { text-align: center; }

/* Artículos */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; padding-bottom: 2rem; }
.article-layout .side { position: sticky; top: 90px; }
.article-layout .side .tool-grid.compact { grid-template-columns: 1fr; }
.article-layout .side h2 { font-size: 1.1rem; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } .article-layout .side { position: static; } }
.prose { max-width: 760px; padding-top: .8rem; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose li { margin-bottom: .35rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.byline { color: var(--muted); font-size: .92rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.2rem 0; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: .8rem; font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.facts abbr { text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: help; }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0 1.5rem; }
.toc ol { margin: .5rem 0 0; }
.series { margin-top: 3rem; padding: 1.2rem; border-radius: var(--radius); background: var(--brand-soft); }
.series ol { margin: .5rem 0 0; }
.series [aria-current] { font-weight: 800; }
.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose table, .content-block table { background: var(--paper); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--wash); font-family: var(--font); }
blockquote { margin: 1.2rem 0; padding: .8rem 1.2rem; border-left: 4px solid var(--sun); background: var(--paper); border-radius: 0 12px 12px 0; }
.crit-quote .crit-label { font: 800 .85rem var(--font); color: var(--brand); margin-bottom: .3rem; }
.crit-quote p:last-child { margin: 0; font-size: .9rem; }
.region { display: inline-block; font: 700 .72rem/1 var(--font); background: var(--wash); color: var(--muted); padding: .3rem .55rem; border-radius: 999px; margin-left: .3rem; vertical-align: middle; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: .7rem; }
.steps li { counter-increment: s; display: flex; gap: .8rem; align-items: flex-start; }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 10px; background: var(--sun); color: #161a2e; font: 900 1rem var(--font); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.faq details, .ce details, details.saberes { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .2rem 1rem; margin-bottom: .6rem; }
summary { cursor: pointer; font-weight: 700; padding: .7rem 0; list-style-position: outside; }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: .6rem; }
.related { margin: 2rem 0; }
.print-row { margin: .5rem 0 1.2rem; }
.curriculum-box { margin: 2rem 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: .3rem 1.2rem; }
.curriculum-box summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.curriculum-box h3 { font-size: 1rem; margin-top: 1rem; }
.cb-body li { margin-bottom: .6rem; font-size: .95rem; }
.desc-codes { color: var(--muted); font-size: .8rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Explorador curricular */
[role=tablist] { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: .6rem 0; }
[role=tab] { font: 700 1rem var(--font); padding: .6rem 1rem; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
[role=tab] span { font-weight: 600; color: var(--muted); font-size: .85rem; margin-left: .2rem; }
[role=tab][aria-selected=true] { background: var(--brand); color: #fff; border-color: var(--brand); }
[role=tab][aria-selected=true] span { color: #fff; opacity: .85; }
.ce { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1rem; }
.ce h3 { font-size: 1.05rem; line-height: 1.4; }
.ce-n { display: inline-block; background: var(--sun); color: #161a2e; border-radius: 8px; padding: .1rem .45rem; margin-right: .3rem; font-size: .9rem; }
.ce details { background: var(--wash); }
.crit-list { list-style: none; padding: 0; margin: .8rem 0; display: grid; gap: .7rem; }
.crit-list > li { border-left: 3px solid var(--brand); padding: .2rem 0 .2rem .9rem; }
.crit-list > li:target { background: color-mix(in srgb, var(--sun) 20%, transparent); border-radius: 0 10px 10px 0; }
.crit-list p { margin: 0 0 .2rem; }
.crit-id { color: var(--brand); margin-right: .3rem; }
.crit-links { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem; font-size: .85rem; color: var(--muted); }
.crit-links .chip { min-height: 32px; padding: .3rem .7rem; font-size: .82rem; }
.saberes h4 { margin-top: 1rem; }
.saberes li { font-size: .93rem; margin-bottom: .3rem; }

/* Anuncios (solo si se activan) */
.ad { margin: 2rem 0; text-align: center; min-height: 100px; }
.ad-label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }

/* Consentimiento */
.consent { position: fixed; z-index: 60; left: 1rem; right: 1rem; bottom: 1rem; max-width: 640px; margin-inline: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.consent p { margin: 0 0 .8rem; font-size: .95rem; }
.consent-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }

/* Pie */
.footer { margin-top: 3rem; background: var(--paper); border-top: 1px solid var(--line); padding: 2.5rem 0 1.5rem; font-size: .95rem; }
.footer-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer h2 { font-size: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .45rem; }
.footer a { color: var(--muted); }
.footer-brand p { color: var(--muted); max-width: 42ch; margin-top: .7rem; }
.footer-base { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .footer-in { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Impresión: solo la ficha */
@media print {
  @page { margin: 12mm; }
  :root { --ink: #161a2e; --muted: #5a6178; --bg: #fff; --paper: #fff; --line: #c9cfdd; }
  body { background: #fff; color: #161a2e; font-size: 12pt; }
  .topbar, .footer, .crumbs, .panel, .tool-head, .tool-page .prose-wrap, .ad, .consent, .no-print, .side, .filters, .curriculum-box, .series, .toc, [role=tablist] { display: none !important; }
  .tool-page .preview { min-height: 0; }
  .tool-layout { display: block; }
  .sheet { box-shadow: none; border: 0; border-radius: 0; padding: 0; margin: 0; overflow: visible; }
  .page-break { break-before: page; }
  .fc-page { break-after: page; grid-template-columns: repeat(2, 1fr) !important; }
  .fc-page.per-4 .fc { height: 120mm; }
  .fc-page.per-6 .fc { height: 82mm; }
  .fc-page.per-8 .fc { height: 61mm; min-height: 0; }
  .bingo-wrap { grid-template-columns: 1fr; gap: 10mm; }
  .bingo-card:nth-child(2n) { break-after: page; }
  .ws-grid td { width: 1.05cm; height: 1.05cm; font-size: 15pt; }
  .ws-grid.size-15 td { width: .9cm; height: .9cm; font-size: 13pt; }
  .cw-grid td { width: .95cm; height: .95cm; }
  .article-layout { display: block; }
  .prose { max-width: none; }
  .tool-page .notice { display: none; }
  a { color: inherit; text-decoration: none; }
  body.print-only-sheet .prose > *:not(.resource-sheet) { display: none !important; }
  body.print-only-sheet .resource-sheet { margin: 0; }
}
