/* Roble y Rama · app
   Layout: papel hueso de un buen libro, con el verde bosque y el negro del monograma RR,
   inscripciones clásicas en versalitas espaciadas. Un solo aspecto, claro, en cualquier tema del móvil. */
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("fonts/spectral-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("fonts/spectral-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("fonts/spectral-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #ebe3d1;
  --bg-2: #f5f0e4;
  --bg-3: #ddd3bd;
  --line: #cdc2a8;
  --bone: #1d241e;
  --bone-soft: #5f5a4b;
  --forest: #23402b;
  --forest-2: #2e5338;
  --olive: #4a5040;
  --khaki: #7d6236;
  --on-bone: #f1ead9;
  --on-dark: #f1ead9;
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Spectral", "Iowan Old Style", Georgia, serif;
  --caps: "Cinzel", "Trajan Pro", Georgia, serif;
  --gutter: 18px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--bone); font-family: var(--body); font-size: 1.0625rem; line-height: 1.62; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.08; text-wrap: balance; margin: 0; letter-spacing: .005em; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--khaki); outline-offset: 3px; }
img { max-width: 100%; }
::selection { background: var(--forest-2); color: var(--bone); }

.app { position: relative; max-width: 640px; margin: 0 auto; padding-inline: var(--gutter); padding-block: 0 calc(96px + env(safe-area-inset-bottom, 0px)); }
.label { font-family: var(--caps); font-weight: 500; font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--bone-soft); }

/* Barra superior */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 10px; min-height: 58px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
.top .back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 8px 4px; margin-left: -4px; cursor: pointer; font-family: var(--caps); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bone); text-decoration: none; }
.top .back svg { width: 18px; height: 18px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--bone); }
.brand svg { width: 44px; height: auto; display: block; }
.brand b { font-family: var(--caps); font-weight: 600; font-size: .78rem; letter-spacing: .3em; }
.top .spacer { flex: 1; }
.top .where { font-family: var(--caps); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-soft); max-width: 55%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .linkbtn { font-family: var(--caps); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; color: var(--bone-soft); }

main { display: grid; gap: 24px; padding-top: 22px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 1px solid var(--bone-soft); background: transparent; color: var(--bone); padding: 9px 18px; border-radius: 2px; cursor: pointer; text-decoration: none; font-family: var(--caps); font-weight: 600; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; }
.btn.primary { background: var(--bone); border-color: var(--bone); color: var(--on-bone); }
.btn.green { background: var(--forest-2); border-color: var(--forest-2); color: var(--bone); }
.btn.small { min-height: 38px; padding: 6px 13px; font-size: .66rem; }
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.linkbtn { border: 0; background: none; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); font-family: var(--body); font-size: .9rem; color: var(--bone); }

/* Saludo */
.hello { display: grid; gap: 6px; }
.hello h1 { font-size: 2.6rem; }
.hello h1 em { color: var(--khaki); font-style: italic; }
.intro { color: var(--bone-soft); font-size: .98rem; }
.intro b { color: var(--bone); font-weight: 600; }

/* Fichas del inicio */
.card { background: var(--bg-2); border: 1px solid var(--line); padding: 18px; display: grid; gap: 10px; min-width: 0; }
.card h2 { font-size: 1.75rem; }
.card p.ex { color: var(--bone-soft); font-size: .97rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card.reading { padding: 0; gap: 0; overflow: hidden; grid-template-columns: 1fr; }
.card.reading .print { aspect-ratio: 16 / 9; }
.card.reading .body { display: grid; gap: 9px; min-width: 0; padding: 16px 18px 18px; }
.print { margin: 0; position: relative; overflow: hidden; background: var(--bg-3); }
.print .ph { width: 100%; height: 100%; }
.print img { display: block; width: 100%; height: 100%; object-fit: cover; }
.print::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 45%, rgba(18, 20, 16, .75)); }
.step-card { border-top: 3px solid var(--forest-2); }
.game-card .tags { margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--caps); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line); border-radius: 2px; color: var(--bone-soft); white-space: nowrap; }
.tag.raiz { color: var(--khaki); border-color: rgba(196, 176, 138, .45); } .tag.rama { color: #9cbf9f; border-color: rgba(156, 191, 159, .4); } .tag.done { color: var(--bone); border-color: var(--forest-2); background: var(--forest); }
.bar { height: 4px; background: var(--bg-3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--khaki); }
.count { font-family: var(--body); font-size: .85rem; color: var(--bone-soft); font-variant-numeric: tabular-nums; }

/* Los cuatro botones: las cuatro versiones del monograma */
.four { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; display: grid; align-content: space-between; gap: 22px; min-height: 140px; padding: 16px 15px 15px; text-decoration: none; border-radius: 2px; overflow: hidden; border: 1px solid transparent; }
.tile:active { transform: translateY(1px); }
.tile svg { width: 32px; height: 32px; }
.tile b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1; }
.tile span { display: block; margin-top: 6px; font-family: var(--caps); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; opacity: .78; }
.tile.t1 { background: var(--forest); color: var(--bone); }
.tile.t2 { background: var(--bone); color: var(--on-bone); }
.tile.t3 { background: var(--bg); color: var(--bone); border-color: var(--line); }
.tile.t4 { background: var(--olive); color: var(--bone); }

/* Lema y principios */
.creed { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 26px 8px 10px; border-top: 1px solid var(--line); }
.creed svg { width: 64px; color: var(--bone-soft); }
.creed h2 { font-family: var(--caps); font-weight: 500; font-size: .95rem; letter-spacing: .26em; line-height: 1.8; text-transform: uppercase; }
.creed ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.creed li { font-family: var(--caps); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--bone-soft); }
.creed hr { width: 48px; border: 0; border-top: 1px solid var(--bone-soft); margin: 0; }

/* Listas */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg-2); border-radius: 2px; padding: 7px 13px; min-height: 36px; cursor: pointer; font-family: var(--caps); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bone-soft); }
.chip[aria-pressed="true"] { background: var(--bone); border-color: var(--bone); color: var(--on-bone); }
.search { width: 100%; min-height: 46px; border: 1px solid var(--line); background: var(--bg-2); padding: 10px 14px; border-radius: 2px; }
.search::placeholder, textarea::placeholder, input::placeholder { color: #7d7868; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; min-height: 62px; }
.row.done { background: transparent; }
.row .t { display: grid; gap: 2px; min-width: 0; }
.row .t strong { font-family: var(--display); font-weight: 600; font-size: 1.32rem; line-height: 1.15; }
.row .t span { font-size: .86rem; color: var(--bone-soft); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.row.done .t strong { color: var(--bone-soft); }
.row .n { font-family: var(--caps); font-size: .9rem; color: var(--khaki); width: 1.8em; text-align: center; }
.row.num { grid-template-columns: 1.8em minmax(0, 1fr) auto; }
.mark { width: 22px; height: 22px; border: 1px solid var(--line); display: inline-grid; place-items: center; color: var(--bone); }
.row.done .mark { border-color: var(--forest-2); background: var(--forest-2); }
.mark svg { width: 14px; height: 14px; }
.more { justify-self: center; }
.empty { text-align: center; color: var(--bone-soft); padding: 22px 10px; border: 1px dashed var(--line); }

/* Ámbitos */
.ambs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.amb { display: grid; background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; min-width: 0; cursor: pointer; padding: 0; text-align: left; color: var(--bone); }
.amb .im { aspect-ratio: 3 / 2; overflow: hidden; }
.amb .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.amb .tx { padding: 10px 11px 12px; display: grid; gap: 5px; }
.amb strong { font-family: var(--display); font-weight: 600; font-size: 1.22rem; line-height: 1.1; }

/* Lectura */
.reading-view { display: grid; gap: 18px; }
.reading-view h1 { font-size: 2.6rem; }
.photo { margin: 0 calc(var(--gutter) * -1); position: relative; }
.photo .ph { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-3); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { font-family: var(--caps); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-soft); padding: 8px var(--gutter) 0; }
.text { display: grid; gap: 1em; font-size: 1.14rem; line-height: 1.74; max-width: 36em; color: #e2dac7; }
.text p:first-child::first-letter { font-family: var(--display); font-weight: 600; font-size: 3.4em; float: left; line-height: .8; padding: 6px 9px 0 0; color: var(--khaki); }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; border: 1px solid var(--forest-2); background: transparent; color: var(--bone); padding: 10px 16px; border-radius: 2px; cursor: pointer; font-family: var(--caps); font-weight: 600; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; }
.toggle .box { width: 18px; height: 18px; border: 1px solid currentColor; display: inline-grid; place-items: center; }
.toggle .box svg { width: 13px; height: 13px; }
.toggle[aria-pressed="true"] { background: var(--forest-2); }
.star { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; border: 1px solid var(--line); background: var(--bg-2); padding: 10px 14px; border-radius: 2px; cursor: pointer; font-family: var(--caps); font-weight: 600; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; }
.star svg { width: 18px; height: 18px; }
.star[aria-pressed="true"] svg { fill: var(--khaki); stroke: var(--khaki); }
.note { background: var(--bg-2); border: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 8px; }
.note h2 { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.3rem; color: var(--khaki); }
textarea.lined { width: 100%; min-height: 6.6em; resize: vertical; border: 0; padding: 4px 2px; background: transparent; font-family: var(--body); font-size: 1rem; line-height: 1.65em; color: var(--bone);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.65em - 1px), var(--line) calc(1.65em - 1px), var(--line) 1.65em); background-attachment: local; }
.saved { font-family: var(--caps); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: #9cbf9f; min-height: 1em; }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Paso de programa */
.step-head { display: grid; gap: 6px; }
.step-head h1 { font-size: 2.4rem; }
.task { background: var(--forest); padding: 18px; display: grid; gap: 8px; }
.task h2 { font-family: var(--caps); font-weight: 500; font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--khaki); }
.task p { font-size: 1.12rem; }
details.read { background: var(--bg-2); border: 1px solid var(--line); }
details.read summary { cursor: pointer; padding: 14px 16px; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
details.read summary::-webkit-details-marker { display: none; }
details.read summary strong { font-family: var(--display); font-weight: 600; font-size: 1.45rem; }
details.read .text { padding: 0 16px 16px; font-size: 1.06rem; }
.prog-head { display: grid; gap: 12px; }
.prog-head h1 { font-size: 2.6rem; }
.prog-head .promise { font-family: var(--display); font-style: italic; font-size: 1.35rem; line-height: 1.3; color: var(--khaki); }
.prog-card { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; background: var(--bg-2); border: 1px solid var(--line); padding: 12px; text-decoration: none; align-items: center; }
.prog-card .im { aspect-ratio: 1; overflow: hidden; background: var(--bg-3); }
.prog-card .im img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prog-card .tx { display: grid; gap: 6px; min-width: 0; }
.prog-card strong { font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1.1; }

/* Juego */
.game-view { display: grid; gap: 16px; }
.game-view h1 { font-size: 2.6rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--bg-2); }
.facts div { padding: 10px 12px; display: grid; gap: 2px; border-right: 1px solid var(--line); min-width: 0; }
.facts div:last-child { border-right: 0; }
.facts b { font-family: var(--display); font-weight: 600; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.howto { font-size: 1.14rem; line-height: 1.72; }
.variant { border-left: 2px solid var(--khaki); padding-left: 14px; font-style: italic; color: #e2dac7; }
.material { font-size: .98rem; color: var(--bone-soft); }

/* Cuaderno */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); padding: 14px 10px; display: grid; gap: 4px; }
.stat b { font-family: var(--display); font-weight: 600; font-size: 2.3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.entry { background: var(--bg-2); border: 1px solid var(--line); padding: 12px 14px; display: grid; gap: 6px; }
.entry .when { font-size: .8rem; color: var(--bone-soft); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.entry .when a { color: var(--khaki); }
.entry p { font-size: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.section-title h2 { font-size: 1.7rem; }
.field { display: grid; gap: 6px; }
.field > span { font-family: var(--caps); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-soft); }
.field input, .field select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); background: var(--bg-2); padding: 8px 12px; border-radius: 2px; }
.kid { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto; gap: 8px; align-items: end; }
.kid .field { min-width: 0; }
.iconbtn { border: 1px solid var(--line); background: var(--bg-2); min-width: 44px; min-height: 44px; border-radius: 2px; cursor: pointer; display: inline-grid; place-items: center; }
.iconbtn svg { width: 18px; height: 18px; }
.notice { background: var(--bg-2); border: 1px solid var(--khaki); padding: 14px 16px; font-size: .95rem; display: grid; gap: 8px; }
.notice strong { font-family: var(--display); font-weight: 600; font-size: 1.3rem; }

.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--bone); color: var(--on-bone); font-family: var(--caps); font-weight: 600; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; padding: 11px 16px; border-radius: 2px; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.foot { text-align: center; color: var(--bone-soft); font-size: .8rem; padding-top: 4px; display: grid; gap: 6px; justify-items: center; }

@media (min-width: 560px) {
  .hello h1 { font-size: 3rem; }
  .ambs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .view-in { animation: rise .3s ease-out both; }
  @keyframes rise { from { opacity: .35; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Fondo hueso: piezas que van sobre verde o negro */
.tile.t1, .tile.t4, .task, .btn.green, .toggle[aria-pressed="true"], .row.done .mark, .tag.done { color: var(--on-dark); }
.tile.t2 { background: var(--bg-2); color: var(--bone); border-color: var(--line); }
.tile.t3 { background: var(--bone); color: var(--on-dark); border-color: var(--bone); }
.task h2 { color: #e2cf9f; }
.text, .variant { color: #2a302a; }
.print::after { background: linear-gradient(to bottom, transparent 55%, rgba(20, 25, 20, .35)); }
.tag.rama { color: var(--forest-2); border-color: rgba(46, 83, 56, .4); }
.saved { color: var(--forest-2); }
.search::placeholder, textarea::placeholder, input::placeholder { color: #8d8672; }
::selection { background: #c9d6c3; color: var(--bone); }

/* Párrafo para el padre al final de cada lectura */
.padre { display: grid; gap: 8px; max-width: 36em; padding: 16px 0 2px; border-top: 1px solid var(--line); }
.padre::before { content: ""; width: 34px; height: 2px; background: var(--forest-2); margin-top: -17px; }
.padre .label { color: var(--forest-2); }
.padre p { font-size: 1.08rem; line-height: 1.7; color: var(--bone); }
details.read .padre { margin: 0 16px 16px; }

/* Menú inferior */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(5, 1fr); max-width: 640px; margin: 0 auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
.tabbar:empty { display: none; }
.tabbar a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 0 4px; min-width: 0; text-decoration: none; color: var(--bone-soft); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar span { font-family: var(--caps); font-weight: 500; font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.tabbar a[aria-current="page"] { color: var(--forest); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -7px; left: 30%; right: 30%; height: 2px; background: var(--forest-2); }
@media (min-width: 640px) { .tabbar { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* Portada */
body.sin-menu .app { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.portada { display: grid; gap: 34px; padding-top: calc(28px + env(safe-area-inset-top, 0px)); }
.p-hero { display: grid; gap: 14px; justify-items: start; }
.p-hero > svg { width: 84px; color: var(--bone); }
.p-hero h1 { font-size: 2.7rem; line-height: 1.04; }
.p-hero h1 em { color: var(--khaki); font-style: italic; }
.p-hero .label { margin-bottom: -10px; }
.p-lema { font-family: var(--display); font-style: italic; font-size: 1.2rem; color: var(--khaki); margin-top: -4px; }
.p-hero .lead { font-size: 1.12rem; line-height: 1.6; color: var(--bone-soft); max-width: 32em; }
.p-photo { aspect-ratio: 4 / 3; margin-inline: calc(var(--gutter) * -1); }
.p-sec { display: grid; gap: 12px; max-width: 36em; }
.p-sec h2 { font-size: 2rem; }
.p-sec > p { font-size: 1.06rem; line-height: 1.72; }
.p-sec > .label { color: var(--forest-2); }
.p-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.p-list li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.p-list svg { width: 30px; height: 30px; color: var(--forest-2); margin-top: 2px; }
.p-list h3 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; line-height: 1.15; margin: 0 0 4px; }
.p-list h3 .count { font-size: .8rem; margin-left: 6px; }
.p-list p { color: var(--bone-soft); font-size: .98rem; line-height: 1.6; }
.p-enter { display: grid; gap: 10px; justify-items: center; text-align: center; margin-inline: calc(var(--gutter) * -1); padding: 16px var(--gutter) calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
.p-enter .btn { width: 100%; max-width: 360px; min-height: 54px; font-size: .8rem; letter-spacing: .26em; }
.p-enter span { font-size: .85rem; color: var(--bone-soft); max-width: 30em; }

/* Escritorio y tableta */
.tab-brand, .tab-extra { display: none !important; }
@media (min-width: 700px) {
  .app { max-width: 760px; }
  .tabbar { max-width: 760px; }
}
@media (min-width: 1000px) {
  :root { --gutter: 40px; }
  body:not(.sin-menu) { padding-left: 232px; }
  .app { max-width: 1120px; padding-bottom: 64px; }
  body.sin-menu .app { max-width: 1120px; }

  /* El menú pasa a una columna a la izquierda */
  .tabbar { top: 0; bottom: 0; right: auto; width: 232px; max-width: none; margin: 0; grid-template-columns: 1fr; align-content: start; gap: 2px; padding: 26px 18px; border-top: 0; border-right: 1px solid var(--line); border-left: 0; }
  .tabbar a { grid-template-columns: 26px 1fr; justify-items: start; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 2px; }
  .tabbar a:hover { background: var(--bg-2); color: var(--bone); }
  .tabbar span { font-size: .68rem; letter-spacing: .2em; }
  .tabbar a[aria-current="page"] { background: var(--bg-2); color: var(--forest); }
  .tabbar a[aria-current="page"]::before { top: 8px; bottom: 8px; left: 0; right: auto; width: 2px; height: auto; }
  .tabbar .tab-brand { display: grid !important; grid-template-columns: 1fr; justify-items: start; gap: 12px; padding: 4px 12px 26px; margin-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--bone); background: none !important; }
  .tabbar .tab-brand svg { width: 64px; height: auto; }
  .tabbar .tab-brand b { font-family: var(--caps); font-weight: 600; font-size: .74rem; letter-spacing: .3em; text-transform: uppercase; }
  .tabbar .tab-brand::before { display: none; }
  .tabbar .tab-extra { display: grid !important; grid-template-columns: 1fr; margin-top: 18px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 18px; }
  .top .brand { visibility: hidden; }
  .toast { bottom: 28px; left: calc(50% + 116px); }

  main { gap: 32px; padding-top: 34px; }
  .hello h1 { font-size: 3.6rem; }

  /* Inicio */
  .card.reading:not(.game-card) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .card.reading .print { aspect-ratio: 3 / 2; }
  .top:has(.brand) { display: none; }
  .amb .im { aspect-ratio: 16 / 9; }
  .card.reading .body { align-content: center; padding: 32px 34px; gap: 14px; }
  .card.reading h2 { font-size: 2.4rem; }
  .card p.ex { -webkit-line-clamp: 5; font-size: 1.05rem; }
  .four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .tile { min-height: 180px; padding: 20px; transition: transform .15s ease; }
  .tile:hover { transform: translateY(-2px); }

  /* Listas a dos columnas */
  main > ul.list, main > .list:not(ol) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .row:hover, .prog-card:hover, .amb:hover { border-color: var(--bone-soft); }
  .prog-card { grid-template-columns: 120px minmax(0, 1fr); }
  .ambs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
  .stats { grid-template-columns: repeat(3, minmax(0, 220px)); }

  /* Pantallas de lectura en columna centrada */
  main.narrow { max-width: 760px; margin-inline: auto; width: 100%; }
  .photo { margin-inline: 0; }
  .photo .ph { aspect-ratio: 2 / 1; }
  .photo figcaption { padding-inline: 0; }
  .reading-view h1, .game-view h1, .prog-head h1 { font-size: 3.2rem; }
  .step-head h1 { font-size: 3rem; }
  .text { font-size: 1.2rem; }

  /* Portada */
  .portada { max-width: 1040px; margin-inline: auto; gap: 56px; padding-top: 56px; }
  .portada { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 56px; }
  .portada > * { grid-column: 1 / -1; }
  .portada > .p-hero { grid-column: 1; align-self: center; }
  .portada > .p-photo { grid-column: 2; grid-row: 1; margin-inline: 0; aspect-ratio: 4 / 5; }
  .p-hero h1 { font-size: 3.6rem; }
  .p-hero > svg { width: 96px; }
  .portada > .p-sec { max-width: 760px; justify-self: center; width: 100%; }
  .p-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .p-enter { margin-inline: 0; border: 1px solid var(--line); background: var(--bg-2); padding: 32px; max-width: 760px; justify-self: center; width: 100%; }
}
@media (min-width: 1400px) {
  .app { max-width: 1200px; }
}

/* Ficha de cada programa */
.prog-card { align-items: start; }
.prog-card .pc-prom { font-size: .9rem; line-height: 1.45; color: var(--bone-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prog-card .tags { gap: 5px; }
.prog-card .tag { font-size: .55rem; padding: 2px 7px; }
.ficha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 4px 0 0; border: 1px solid var(--line); background: var(--bg-2); }
.ficha div { padding: 10px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.ficha div:nth-child(odd) { border-right: 1px solid var(--line); }
.ficha div:nth-last-child(-n+2) { border-bottom: 0; }
.ficha dt { font-family: var(--caps); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-soft); }
.ficha dd { margin: 2px 0 0; font-family: var(--display); font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
@media (min-width: 1000px) { .ficha { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ficha div { border-right: 1px solid var(--line); } .ficha div:nth-child(3n) { border-right: 0; } .ficha div:nth-last-child(-n+3) { border-bottom: 0; } }

/* Programas en dos partes */
.prog-group { display: grid; gap: 12px; }
.prog-group .intro a { color: var(--forest-2); }
.pc-num { font-family: var(--caps); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--khaki); }
.pc-para { font-family: var(--caps); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--forest-2); font-weight: 600; }
.kid { grid-template-columns: minmax(0, 1fr) 70px 96px auto; }
.field select { appearance: none; -webkit-appearance: none; }

/* Modo administrador */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px dashed var(--khaki); background: var(--bg-2); font-family: var(--caps); font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--khaki); }
.edit-form { display: grid; gap: 14px; }
.edit-form textarea, .edit-form input { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--bg-2); padding: 10px 12px; border-radius: 2px; font-family: var(--body); font-size: 1rem; line-height: 1.55; color: var(--bone); }
.edit-ta { min-height: 7em; resize: vertical; }
