:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #18203a;
  --muted: #5e6787;
  --line: #e1e5f0;
  --brand: #2f5bea;
  --brand-ink: #ffffff;
  --brand-soft: #e6ecff;
  --ok: #17a467;
  --ok-soft: #dcf6ea;
  --bad: #e0464b;
  --bad-soft: #fde4e4;
  --warn: #f4a52a;
  --shadow: 0 2px 0 rgba(24, 32, 58, .06), 0 8px 24px rgba(24, 32, 58, .06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11152a; --card: #1b2140; --ink: #eef1ff; --muted: #a3abcf; --line: #2c3460;
    --brand: #6f8dff; --brand-ink: #0d1126; --brand-soft: #253063;
    --ok: #3fd18e; --ok-soft: #173d31; --bad: #ff7276; --bad-soft: #4a2228;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }

/* --- barra superior --- */
.topbar {
  padding-left: clamp(12px, 1.5vw, 24px) !important; padding-right: clamp(12px, 1.5vw, 24px) !important;
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 20px; color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand); color: var(--brand-ink); font-weight: 900;
}
.stats { display: flex; gap: 8px; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 15px; }

main { width: 100%; margin: 0 auto; padding: 8px clamp(12px, 1.5vw, 24px) 24px; }

/* --- tarjetas y botones --- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 18px; margin: 12px 0; }
h1 { font-size: 26px; font-weight: 900; margin: 12px 0 4px; }
h2 { font-size: 20px; font-weight: 900; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 13px 18px; min-height: 48px;
  font-weight: 800; cursor: pointer; background: var(--brand-soft); color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); transition: transform .06s; text-decoration: none;
}
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; box-shadow: none; border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.big { font-size: 19px; min-height: 58px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 52px; height: 52px; padding: 0; border-radius: 50%; font-size: 22px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 6px 14px; font-weight: 800; cursor: pointer; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); }

.menu { display: grid; gap: 10px; }
.menu .btn { justify-content: flex-start; text-align: left; padding: 14px 18px; }
.menu .btn small { display: block; font-weight: 600; opacity: .8; }
.menu .emoji { font-size: 26px; width: 34px; text-align: center; }

.bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .4s; }

/* --- ejercicio --- */
.ex-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.ex-head .bar { flex: 1; }
.ex-label { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 0; }
.prompt { font-size: 32px; font-weight: 900; text-align: center; margin: 14px 0 4px; word-break: break-word; }
.prompt.sentence { font-size: 22px; font-weight: 700; }
.ipa { text-align: center; color: var(--muted); font-size: 18px; }
.center { display: flex; justify-content: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }

.options { display: grid; gap: 10px; margin-top: 16px; }
.opt {
  border: 2px solid var(--line); background: var(--card); border-radius: 14px;
  padding: 14px; font-weight: 800; font-size: 18px; cursor: pointer; text-align: center; min-height: 56px;
}
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt[disabled] { cursor: default; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.match .opt { font-size: 16px; padding: 12px 8px; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.done { opacity: .35; border-color: var(--ok); }

.flash {
  perspective: 1000px; min-height: 340px; cursor: pointer; margin-top: 12px;
}
.flash-inner { position: relative; min-height: 340px; transition: transform .45s; transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 18px; text-align: center; overflow-y: auto;
}
.face.back { transform: rotateY(180deg); }
.face .es { font-size: 28px; font-weight: 900; color: var(--brand); }
.face .def { margin-top: 8px; }
.face .exs { margin-top: 8px; font-style: italic; color: var(--muted); }
.tag { display: inline-block; font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); margin-bottom: 6px; }

.input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); font-size: 22px; font-weight: 800; text-align: center; letter-spacing: .02em;
}
.input:focus { outline: none; border-color: var(--brand); }
textarea.input { font-size: 16px; font-weight: 600; text-align: left; min-height: 200px; letter-spacing: 0; }
select.input { font-size: 16px; text-align: left; padding: 10px 12px; }

.feedback { margin-top: 14px; padding: 14px; border-radius: 14px; font-weight: 800; text-align: center; }
.feedback.ok { background: var(--ok-soft); color: var(--ok); }
.feedback.bad { background: var(--bad-soft); color: var(--bad); }
.feedback .answer { display: block; color: var(--ink); font-size: 20px; margin-top: 4px; }
.diff b { color: var(--bad); text-decoration: underline; }

.mic { width: 96px; height: 96px; border-radius: 50%; font-size: 40px; }
.mic.rec { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* --- resultados --- */
.result { text-align: center; }
.result .big-num { font-size: 56px; font-weight: 900; color: var(--brand); }

/* --- tablas admin --- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.box-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 2px; background: var(--line); }
.box-dot.on { background: var(--ok); }
.word-row input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--bg); font-size: 15px; }
.tabs { display: flex; gap: 8px; margin: 10px 0; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.kpi b { display: block; font-size: 26px; font-weight: 900; }
.scroll-x { overflow-x: auto; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 800;
  transition: transform .25s, visibility .25s; max-width: calc(100% - 32px); z-index: 20; visibility: hidden;
}
#toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }

@media (min-width: 520px) {
  .options.two { grid-template-columns: 1fr 1fr; }
}

/* --- v4: fonética y verbos --- */
.phon { text-align: center; font-weight: 800; font-size: 18px; color: var(--brand); margin-top: 4px; }
table.forms { margin: 10px auto 0; width: auto; font-size: 15px; }
table.forms th, table.forms td { text-align: center; padding: 4px 10px; }
table.forms td { font-weight: 800; }
.input.good { border-color: var(--ok); background: var(--ok-soft); }
.input.badin { border-color: var(--bad); background: var(--bad-soft); }

/* --- duplicadas --- */
.dup-groups { display: grid; gap: 8px; margin-top: 10px; color: var(--ink); font-weight: 600; }
.dup-group { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dup-item { padding: 4px 0; border-top: 1px solid var(--line); margin-top: 6px; }

/* ===== Pantallas grandes (portátiles de 14" y superiores) =====
   Se ocupa todo el ancho dejando un margen mínimo a los lados. */
@media (min-width: 900px) {
  body { font-size: 18px; }
  h1 { font-size: 32px; }
  .home-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
  .home-grid .card:first-child { margin-top: 0; }
  .home-grid .menu { margin-top: 0; }
  .menu .btn { min-height: 76px; }
  .prompt { font-size: 52px; margin-top: 2vh; }
  .prompt.sentence { font-size: 32px; }
  .ipa, .phon { font-size: 22px; }
  .options { gap: 14px; }
  .options.two { grid-template-columns: 1fr 1fr; }
  .opt { font-size: 22px; min-height: 76px; }
  .match { gap: 20px; }
  .match .opt { font-size: 20px; min-height: 64px; }
  .flash, .flash-inner { min-height: min(56vh, 520px); }
  .face .es { font-size: 40px; }
  .face .def, .face .exs { font-size: 20px; }
  .input { font-size: 28px; padding: 16px 20px; }
  textarea.input { font-size: 17px; min-height: 240px; }
  .btn.big { font-size: 21px; min-height: 64px; }
  .mic { width: 120px; height: 120px; font-size: 50px; }
  .icon-btn { width: 58px; height: 58px; font-size: 24px; }
  .feedback { font-size: 20px; }
  table.forms { font-size: 18px; }
  .result .big-num { font-size: 80px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .scroll-x table { min-width: 100%; }
}
@media (min-width: 1300px) {
  .options.two { grid-template-columns: repeat(4, 1fr); }
}

/* --- v8: acepciones de diccionario --- */
.src { font-size: 13px; opacity: .8; white-space: nowrap; }
.src.ai { color: var(--warn); font-weight: 800; }
.senses-block { text-align: left; margin-top: 8px; }
.senses-title { font-weight: 900; }
ol.senses { margin: 4px 0 0; padding-left: 22px; }
ol.senses li { padding: 3px 4px; border-radius: 8px; }
ol.senses li.chosen { background: var(--ok-soft); font-weight: 800; }
.spos { display: inline-block; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 0 6px; }
.wk { margin: 6px 0 0; }
details summary { cursor: pointer; font-weight: 800; color: var(--brand); margin-top: 4px; }
.chooser { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 0; position: sticky; left: 0; width: min(100%, calc(100vw - 90px)); }
.chooser-block { display: grid; gap: 6px; align-content: start; }
.pick-sense { text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 15px; }
.pick-sense:hover { border-color: var(--brand); }
.pick-sense.chosen { border-color: var(--ok); background: var(--ok-soft); font-weight: 700; }
.word-row input[data-src="dict"] { border-left: 4px solid var(--ok); }
.word-row input[data-src="ai"] { border-left: 4px solid var(--warn); }
.word-row input[data-src="manual"] { border-left: 4px solid var(--brand); }
@media (max-width: 700px) { .chooser { grid-template-columns: 1fr; } }

/* --- v9: pronunciación --- */
.w-ok { color: var(--ok); font-weight: 900; }
.w-bad { color: var(--bad); text-decoration: underline wavy; text-underline-offset: 4px; }

/* --- v10: perfiles --- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; max-width: 900px; margin: 18px auto 0; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 10px; border-radius: 22px; cursor: pointer;
  background: var(--card); border: 3px solid transparent; box-shadow: var(--shadow); font-family: inherit; transition: transform .1s, border-color .1s; }
.profile-card:hover, .profile-card:focus-visible { border-color: var(--pc); transform: translateY(-2px); outline: none; }
.profile-avatar { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; font-size: 54px;
  background: color-mix(in srgb, var(--pc, var(--brand)) 18%, var(--card)); border: 4px solid var(--pc, var(--brand)); }
.profile-avatar.small { width: 58px; height: 58px; font-size: 32px; border-width: 3px; flex: none; }
.profile-avatar.big { width: 120px; height: 120px; font-size: 68px; margin: 0 auto; }
.profile-name { font-weight: 900; font-size: 20px; color: var(--ink); }
.pin-wrap { max-width: 340px; margin: 10px auto 0; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--brand); }
.pin-dots i.on { background: var(--brand); }
.pin-dots.shake { animation: shake .4s; }
.pin-dots.shake i { border-color: var(--bad); }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-key { height: 68px; border-radius: 18px; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 28px; font-weight: 900; cursor: pointer; color: var(--ink); border: 1px solid var(--line); }
.pin-key.ghost { background: transparent; box-shadow: none; }
.pin-key:active { transform: translateY(2px); }
.me-pill { cursor: pointer; border-color: var(--pc); font-family: inherit; }
@media (max-width: 480px) { .me-name { display: none; } }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.avatar-opt { font-size: 28px; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
.avatar-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.color-dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.color-dot.on { border-color: var(--ink); }
.pform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .pform-grid { grid-template-columns: 1fr; } }
.admin-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 14px; }
@media (max-width: 520px) { .admin-profiles { grid-template-columns: 1fr; } }
.pform, .card { scroll-margin-top: 80px; }
#wk { max-width: 280px !important; }

/* --- v11: materias, cursos y accesibilidad --- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.crumb { display: inline-block; margin: 6px 0 0; color: var(--brand); font-weight: 800; text-decoration: none; }
.eyebrow { margin: 10px 0 0; color: var(--muted); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
h1[tabindex="-1"]:focus { outline: none; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 12px 0; }
.subject-card { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--card); border: 3px solid transparent;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border-left: 8px solid var(--pc); }
.subject-card:hover { border-color: var(--pc); }
.subject-icon { font-size: 44px; width: 64px; text-align: center; flex: none; }
.subject-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.subject-name { font-size: 21px; font-weight: 900; }
.due { color: var(--warn); }
.settings summary { cursor: pointer; font-weight: 800; }
.settings label { margin-top: 8px; gap: 8px; }
.course-head { display: grid; gap: 14px; }
@media (min-width: 900px) { .course-head { grid-template-columns: 3fr 2fr; align-items: start; } .course-head .card { margin: 0; } }
details.module > summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; }
details.module > summary::-webkit-details-marker { display: none; }
.module-num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); font-weight: 900; flex: none; }
ol.lessons { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.lesson { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); text-decoration: none; color: var(--ink); background: var(--bg); }
a.lesson:hover { border-color: var(--brand); }
.lesson.done { border-color: var(--ok); background: var(--ok-soft); }
.lesson.locked { opacity: .55; }
.objective { background: var(--brand-soft); border-color: transparent; }
.step h2 { display: flex; align-items: center; gap: 10px; }
.stepn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 16px; flex: none; }
.lesson-text p { margin: 0 0 10px; font-size: 1.05em; line-height: 1.6; max-width: 75ch; }
.example { background: var(--bg); border-radius: 14px; padding: 12px 14px; border-left: 5px solid var(--warn); }
.example p { margin: 6px 0 0; }
.read-btn { float: right; margin: -4px 0 6px 10px; }
fieldset { border: 0; padding: 0; margin: 0; }
.q-legend { font-weight: 800; font-size: 1.1em; margin-bottom: 10px; }
.q-opts { display: grid; gap: 10px; margin-bottom: 12px; }
.q-opt { display: flex; gap: 12px; align-items: center; padding: 14px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--card); font-weight: 700; }
.q-opt input { width: 22px; height: 22px; flex: none; }
.q-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.q-opt.right { border-color: var(--ok); background: var(--ok-soft); }
.q-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.q-opt.right::after { content: '✔ correcta'; margin-left: auto; color: var(--ok); font-weight: 900; font-size: 14px; }
.q-opt.wrong::after { content: '✘ tu respuesta'; margin-left: auto; color: var(--bad); font-weight: 900; font-size: 14px; }
textarea.refl { min-height: 150px; font-size: 17px; font-weight: 500; }
.criteria { margin-top: 10px; display: grid; gap: 6px; }
.criteria input, .settings input, .assign-row input, .survey-item input { width: 20px; height: 20px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-weight: 700; }
.checklist li.ok { color: var(--ok); }
.tip summary { cursor: pointer; font-weight: 800; }
.review h2 { margin-top: 4px; }
.answer-box { margin-top: 10px; }
.upcoming { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.survey-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.survey-item legend { font-weight: 800; margin-bottom: 6px; }
.chip-radio { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; }
.chip-radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.diploma { margin: 20px auto; max-width: 760px; text-align: center; padding: 40px 30px; border: 10px double var(--brand); border-radius: 20px; background: var(--card); }
.dip-icon { font-size: 64px; }
.diploma h1 { font-size: 44px; margin: 10px 0; }
.dip-small { text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.dip-note { font-size: 13px; color: var(--muted); margin-top: 24px; }
@media print {
  .topbar, .no-print, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  .diploma { border-color: #2f5bea; box-shadow: none; }
}
.move-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.assign-row { padding: 10px 0; border-top: 1px solid var(--line); }
.module-admin { padding: 6px 0; border-top: 1px solid var(--line); }
.module-admin summary { cursor: pointer; }
.refl-text { white-space: pre-wrap; background: var(--bg); padding: 8px; border-radius: 8px; max-width: 420px; }
.chip.ghost { border-style: dashed; }
/* ajustes personales */
body.big-text { font-size: 21px; }
body.big-text h1 { font-size: 34px; }
body.big-text .input, body.big-text .q-opt, body.big-text .btn { font-size: 1.05em; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.criteria label.row, .settings label.row, .assign-row label.row { flex-wrap: nowrap; align-items: flex-start; }
.criteria input, .settings input, .assign-row input { margin-top: 3px; flex: none; }
.q-opt.right.right { border-color: var(--ok); background: var(--ok-soft); }
.q-opt.wrong.wrong { border-color: var(--bad); background: var(--bad-soft); }
@media (max-width: 600px) { .read-btn { float: none; display: inline-flex; margin: 0 0 8px; } .q-opt.right::after, .q-opt.wrong::after { display: none; } }

/* --- v12: pie con versión --- */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.site-footer .btn { margin-left: 8px; min-height: 32px; padding: 4px 10px; }
@media print { .site-footer { display: none; } }

/* --- v12: unidad semanal (vocabulario, gramática, lectura, escucha) --- */
.unit-card h2 { margin-bottom: 8px; }
.part-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.part-tile { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px 10px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--bg); color: var(--ink); text-decoration: none; }
.part-tile:hover { border-color: var(--brand); }
.part-tile.today { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.part-tile.done { border-color: var(--ok); background: var(--ok-soft); }
.pt-icon { font-size: 32px; }
.week-plan { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 0; margin: 6px 0 0; }
.week-plan li { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--bg); font-size: 14px; }
.week-plan li.today { background: var(--brand-soft); outline: 2px solid var(--brand); }
.examples { list-style: none; padding: 0; display: grid; gap: 8px; }
.examples li { display: flex; gap: 10px; align-items: center; }
.reading-text p { font-size: 1.12em; line-height: 1.75; max-width: 75ch; margin: 0 0 12px; }
.wk-word { font: inherit; color: var(--brand); background: var(--brand-soft); border: 0; border-bottom: 2px solid var(--brand); padding: 0 3px; border-radius: 4px; cursor: pointer; }
.player .btn.big { min-width: 150px; }
.transcript summary { cursor: pointer; font-weight: 800; margin-top: 8px; }
.pitems { display: grid; gap: 12px; }
.pitem-box { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.item-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 14px; margin-right: 8px; }
.gap-line { font-size: 1.15em; line-height: 2.2; }
.gap-in { width: 9em; font: inherit; font-weight: 800; padding: 4px 8px; margin: 0 4px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.gap-in.good { border-color: var(--ok); background: var(--ok-soft); } .gap-in.badin { border-color: var(--bad); background: var(--bad-soft); }
.order-target { min-height: 52px; padding: 8px; border: 2px dashed var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; background: var(--card); }
.order-bank { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pitem .pcheck { margin-top: 6px; }
.tf-btn.ok { background: var(--ok); color: #fff; } .tf-btn.bad { background: var(--bad); color: #fff; }
.week-head { position: relative; }
.unit-tabs { margin-top: 14px; flex-wrap: wrap; }
.ai-box { background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.ai-box summary { cursor: pointer; font-weight: 800; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }
.fmt-help { margin-top: 8px; } .fmt-help summary { cursor: pointer; font-weight: 800; color: var(--brand); }
.fmt-help pre { background: var(--bg); padding: 10px; border-radius: 10px; overflow-x: auto; font-size: 14px; }
.preview-list { display: grid; gap: 8px; padding-left: 22px; margin-top: 12px; }

/* --- v12.1: Mis apuntes --- */
.hub-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 4px 0 12px; }
.tool-card { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 2px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tool-card:hover { border-color: var(--brand); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.note-card { display: grid; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); border-top: 6px solid var(--warn); }
.note-card:hover { border-color: var(--brand); }
.note-badges { display: flex; gap: 10px; font-size: 14px; color: var(--muted); }
.note-title { flex: 1; min-width: 220px; font-size: 24px !important; text-align: left !important; }
.notes-text { text-align: left !important; font-size: 17px !important; font-weight: 500 !important; line-height: 1.6; min-height: 260px; }
.card-rows { display: grid; gap: 8px; }
.card-row { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 8px; align-items: start; }
.card-row textarea { font-size: 16px !important; text-align: left !important; font-weight: 600 !important; min-height: 60px; }
@media (max-width: 640px) { .card-row { grid-template-columns: auto 1fr auto; } .card-row .card-back { grid-column: 2; } }
.outline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .outline-grid { grid-template-columns: 1fr; } }
.outline-view { background: var(--bg); border-radius: 12px; padding: 12px; min-height: 200px; }
.otree, .otree ul { list-style: none; margin: 0; padding-left: 18px; }
.outline-view > .otree { padding-left: 0; }
.otree li { position: relative; margin: 6px 0; }
.otree li > span { display: inline-block; padding: 4px 10px; border-radius: 10px; background: var(--card); border: 2px solid var(--line); font-weight: 700; }
.outline-view > .otree > li > span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-size: 1.1em; }
.otree ul li::before { content: ''; position: absolute; left: -12px; top: 0; bottom: 50%; width: 10px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.sug { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--brand-soft); }
.sug-row { align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.orig-notes { background: var(--bg); border-radius: 12px; padding: 12px; max-height: 420px; overflow: auto; }
.print-menu, .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tpl-card { display: grid; gap: 4px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); text-decoration: none; color: var(--ink); }
.tpl-card:hover { border-color: var(--brand); }
.print-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.print-dd { position: relative; display: inline-block; }
.print-dd summary { list-style: none; cursor: pointer; }
.print-dd summary::-webkit-details-marker { display: none; }
.print-dd-menu { position: absolute; z-index: 10; right: 0; top: 110%; min-width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; display: grid; }
.print-dd-menu a { padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.print-dd-menu a:hover { background: var(--brand-soft); }

/* --- v12.1: hojas A4 imprimibles --- */
.print-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0; position: sticky; top: 56px; z-index: 4; background: var(--bg); padding: 8px 0; }
.print-note { background: var(--brand-soft); padding: 10px 14px; border-radius: 12px; }
.sheets { display: grid; gap: 18px; justify-items: center; padding-bottom: 20px; }
.sheet { width: 210mm; min-height: 297mm; padding: 12mm; background: #fff; color: #111; box-shadow: 0 4px 20px rgba(0,0,0,.15); box-sizing: border-box; position: relative;
  font-family: "Nunito", Arial, sans-serif; font-size: 11.5pt; line-height: 1.45; }
.sheet.landscape { width: 297mm; min-height: 210mm; }
.sheet h2 { margin: 0; font-size: 18pt; } .sheet h3 { font-size: 13pt; margin: 14px 0 6px; }
.sh-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #2f5bea; padding-bottom: 6px; margin-bottom: 10px; }
.sh-brand { font-size: 9pt; font-weight: 900; color: #2f5bea; letter-spacing: .08em; text-transform: uppercase; }
.sh-sub { font-size: 10pt; color: #555; }
.sh-name { font-size: 10pt; display: grid; gap: 4px; min-width: 62mm; }
.sh-name .line { display: inline-block; min-width: 42mm; border-bottom: 1px solid #999; font-weight: 800; }
.sh-foot { position: absolute; bottom: 5mm; left: 12mm; right: 12mm; text-align: center; font-size: 8pt; color: #888; }
.cards-sheet { padding: 10mm 12mm; }
.cut-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 54mm; border-top: 1px dashed #999; border-left: 1px dashed #999; }
.cut-card { border-right: 1px dashed #999; border-bottom: 1px dashed #999; padding: 5mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.cut-card.back { background: #f7f8fc; }
.cut-grid.fold .cut-card { flex-direction: row; padding: 0; }
.foldable .half { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3mm; }
.foldable .half.back { border-left: 1px dotted #bbb; background: #f7f8fc; }
.cc-main { font-size: 15pt; font-weight: 900; } .cc-ans { font-size: 13pt; font-weight: 800; color: #2f5bea; }
.cc-ipa { font-size: 11pt; color: #555; } .cc-small { font-size: 9.5pt; color: #444; margin-top: 2mm; } .cc-ex { font-size: 9.5pt; font-style: italic; color: #555; margin-top: 2mm; }
.cc-tag { position: absolute; bottom: 2mm; right: 3mm; font-size: 7pt; color: #999; }
.p-outline .p-tree { font-size: 13pt; }
.p-tree, .p-tree ul { list-style: none; padding-left: 9mm; margin: 0; }
.p-outline > .p-tree { padding-left: 0; }
.p-tree li { margin: 2.5mm 0; position: relative; }
.p-tree li > span { display: inline-block; padding: 1.5mm 3mm; border: 1.5px solid #2f5bea; border-radius: 3mm; font-weight: 700; }
.p-outline > .p-tree > li > span { background: #2f5bea; color: #fff; font-size: 15pt; }
.p-tree ul li::before { content: ''; position: absolute; left: -6mm; top: 0; height: 3.4mm; width: 5mm; border-left: 1.5px solid #999; border-bottom: 1.5px solid #999; }
.mindmap { width: 100%; height: auto; margin-top: 4mm; font-family: "Nunito", Arial, sans-serif; }
.p-notes p, .p-reading p { margin: 0 0 3mm; }
.p-reading { font-size: 12.5pt; line-height: 1.7; }
.p-box { border: 1.5px solid #ccd; border-radius: 3mm; padding: 3mm 4mm; background: #fafbff; }
.p-items li, .p-q li, .p-sol li { margin: 0 0 4mm; }
.p-opts { display: flex; flex-wrap: wrap; gap: 6mm; margin-top: 1.5mm; } .p-tf { margin-left: 6mm; white-space: nowrap; }
.p-blank { display: inline-block; min-width: 30mm; border-bottom: 1.2px solid #333; margin: 0 1mm; }
.p-words { display: inline-flex; flex-wrap: wrap; gap: 2mm; } .p-words span { border: 1px solid #999; border-radius: 2mm; padding: 0 2mm; }
.p-line { border-bottom: 1px solid #999; height: 8mm; }
.ruled { background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(9mm - 1px), #c9cfe0 calc(9mm - 1px), #c9cfe0 9mm); }
.cornell { display: grid; grid-template-columns: 30% 1fr; border: 1.5px solid #2f5bea; }
.c-cues { border-right: 1.5px solid #2f5bea; padding: 2mm; } .c-notes { padding: 2mm; }
.c-sum { border: 1.5px solid #2f5bea; border-top: 0; padding: 2mm; }
.c-lab { font-size: 9pt; font-weight: 800; color: #2f5bea; text-transform: uppercase; }
.tpl-outline > div { border-bottom: 1px solid #c9cfe0; height: 10mm; padding-top: 3mm; font-weight: 800; color: #2f5bea; }
.tpl-outline .lv0 { font-size: 14pt; height: 13mm; } .tpl-outline .lv1 { padding-left: 4mm; } .tpl-outline .lv2 { padding-left: 14mm; } .tpl-outline .lv3 { padding-left: 26mm; color: #999; }
.tpl-table { width: 100%; border-collapse: collapse; margin-top: 3mm; }
.tpl-table th, .tpl-table td { border: 1px solid #9aa3c0; padding: 2mm; text-align: left; vertical-align: top; color: #111; font-size: 10pt; }
.tpl-table th { background: #eef1ff; }
.tpl-table tbody tr { height: 20mm; }
.tpl-table.week tbody tr { height: 26mm; } .tpl-table.week tbody th { width: 28mm; }

@page { size: A4; margin: 0; }
@page landscape { size: A4 landscape; margin: 0; }
@media print {
  body.print-mode { background: #fff !important; }
  body.print-mode .topbar, body.print-mode .site-footer, body.print-mode #toast, body.print-mode .no-print { display: none !important; }
  body.print-mode main { padding: 0 !important; }
  body.print-mode .sheets { display: block; gap: 0; padding: 0; }
  body.print-mode .sheet { box-shadow: none; margin: 0; break-after: page; page-break-after: always; min-height: 297mm; height: 297mm; overflow: hidden; }
  body.print-mode .sheet.landscape { page: landscape; height: 210mm; min-height: 210mm; }
  body.print-mode .sheet:last-child { break-after: auto; page-break-after: auto; }
  .cut-card.back, .foldable .half.back, .p-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-outline > .p-tree > li > span, .mindmap, .tpl-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 900px) { .sheets { overflow-x: auto; justify-items: start; } }
.sheets { max-width: 100%; }
.sheet.landscape .mindmap { height: 160mm; width: 100%; }
.sheet .mindmap { max-height: 240mm; }
#ntabs, .unit-tabs, .tabs { flex-wrap: wrap; }
@media (max-width: 520px) { #ntabs .chip { padding: 6px 10px; font-size: 15px; } .note-title { min-width: 0; width: 100%; } }

/* ================= v12.2 · Guía interactiva con Brainy ================= */
.help-pill { cursor: pointer; border: 0; font: inherit; margin-left: auto; margin-right: 8px; background: #fff3d6; color: #6b4a00; font-weight: 800; }
@media (prefers-color-scheme: dark) { .help-pill { background: #4a3a12; color: #ffe1a0; } }
.topbar .help-pill + .stats { margin-left: 0; }
@media (max-width: 520px) { .help-txt { display: none; } }
.brainy { flex: none; display: block; }
body:not(.reduce-motion) .guide-card .brainy, body:not(.reduce-motion) .guide-hero .brainy { animation: brainy-bob 3s ease-in-out infinite; }
@keyframes brainy-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
.guide-card { display: flex; align-items: center; gap: 14px; background: linear-gradient(120deg, #fff0f7, var(--card)); border: 2px solid #ffc4de; border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
.guide-card:hover { border-color: #ff8fc2; }
.guide-card .bar { display: block; margin: 6px 0; }
@media (prefers-color-scheme: dark) { .guide-card { background: linear-gradient(120deg, #3a1f33, var(--card)); border-color: #6b3558; } }
.guide-hero { display: flex; align-items: center; gap: 20px; }
.bar.big { height: 14px; }
.guide-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .guide-grid { grid-template-columns: 1fr; } .guide-hero { flex-direction: column; text-align: center; } }
.missions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mission { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.mission .m-icon { font-size: 28px; width: 40px; text-align: center; }
.mission.done { background: var(--ok-soft); border-color: transparent; }
.mission.done b { color: var(--ok); }
.ok-pill { background: var(--ok); color: #fff; }
.tour-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.play-card { border: 2px dashed var(--brand); }
.faq { padding: 10px 16px; margin: 6px 0; }
.faq summary { cursor: pointer; font-weight: 800; }
.faq p { margin: 8px 0 0; }
.tip-card { display: flex; align-items: center; gap: 18px; margin: 18px 0; border: 2px solid #ffc4de; }
@media (max-width: 520px) { .tip-card { flex-direction: column; text-align: center; } }
.result .brainy { margin: 0 auto 6px; }

/* recorridos */
.tour { position: fixed; inset: 0; z-index: 1000; }
.tour-block { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 4px #ff8fc2, 0 0 0 9999px rgba(10, 14, 35, .62); pointer-events: none; transition: all .3s ease; }
.tour.centered .tour-spot { box-shadow: 0 0 0 9999px rgba(10, 14, 35, .62); }
body.reduce-motion .tour-spot { transition: none; }
.tour-bubble { position: fixed; display: flex; gap: 12px; align-items: flex-start; background: var(--card); color: var(--ink); border-radius: 20px; padding: 16px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); border: 3px solid #ff8fc2; outline: none; }
.tour.centered .tour-bubble { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)) !important; }
.tour.mobile .tour-bubble { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto !important; }
.tour.mobile.centered .tour-bubble { bottom: auto; top: 50% !important; left: 12px !important; transform: translateY(-50%); }
.tour-bubble h2 { margin: 2px 0 4px; font-size: 20px; }
.tour-bubble p { margin: 0 0 10px; line-height: 1.45; }
.tour-body { flex: 1; min-width: 0; }
.tour-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tour-extra:empty { display: none; }
.tour-extra { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
body:not(.reduce-motion) .tour-bubble.pop .tour-brainy { animation: brainy-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes brainy-pop { 0% { transform: scale(.4) rotate(-15deg); } 100% { transform: scale(1) rotate(0); } }
@media (max-width: 420px) { .tour-brainy .brainy { width: 46px; height: 46px; } .tour-bubble { padding: 12px; } }

/* misiones conseguidas */
.mission-pop { position: fixed; z-index: 1100; right: 16px; bottom: 16px; display: flex; gap: 12px; align-items: center; max-width: min(380px, calc(100vw - 32px)); background: var(--card); color: var(--ink); border: 3px solid var(--ok); border-radius: 18px; padding: 12px 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); }
body:not(.reduce-motion) .mission-pop { animation: pop-in .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop-in { from { transform: translateY(40px) scale(.8); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1200; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
@media print { #helpbtn, .tour, .mission-pop, .confetti, .guide-card { display: none !important; } }
.tour-bubble [hidden] { display: none !important; }
.topbar .pill { white-space: nowrap; }
.tour-btns .btn { white-space: nowrap; }
@media (max-width: 520px) {
  .help-pill { padding: 4px 9px; margin-right: 6px; }
  .topbar .stats { gap: 6px; }
  .topbar .stats .pill { padding: 4px 9px; }
  .tour-btns { flex-wrap: nowrap; gap: 6px; }
  .tour-btns .btn { padding: 8px 10px; font-size: 14px; }
}
@media (max-width: 380px) { .brand > span:last-child { display: none; } }
