/* EnsaYa · estilos */
:root {
  --bg: #F7F7FB;
  --surface: #FFFFFF;
  --ink: #17172B;
  --ink-2: #4A4A63;
  --muted: #7A7A93;
  --line: #E6E6EF;
  --brand: #2448D8;      /* azul índigo del logo */
  --brand-2: #0A7BE0;    /* azul de "Ya" */
  --brand-3: #18C8DC;    /* turquesa de la flecha */
  --navy: #0B2350;       /* azul marino del logo */
  --ok: #15803D;
  --ok-bg: #E9F8EE;
  --bad: #C8102E;
  --bad-bg: #FDECEF;
  --warn-bg: #FFF6E0;
  --warn: #8A5A00;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 23, 43, .04), 0 6px 24px rgba(23, 23, 43, .06);
  --c: var(--brand);
  --cs: #EEF0FF;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); line-height: 1.55; font-size: 16px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; }
.auth-logo { height: 46px; width: auto; display: block; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.nav a:hover { background: #F0F0F7; }
.nav a.active { background: var(--ink); color: #fff; }

main { min-height: 70vh; padding-top: 28px; padding-bottom: 56px; }
body { overflow-x: clip; }

/* ---------- Inicio ---------- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; padding: 28px 0 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--brand); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.03em; color: var(--navy); }
.hero h1 span { color: var(--brand-2); }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 560px; margin: 18px 0 24px; }
.hero-stats { display: flex; gap: 32px; margin-top: 26px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: .9rem; }

.hero-card { position: relative; }
.hero-card::before { content: ''; position: absolute; inset: -20px -10px 20px 30px; background: linear-gradient(135deg, #DCE4FF, #D4F6FA); border-radius: 28px; transform: rotate(3deg); }
.mock-q { position: relative; background: var(--surface); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.mock-q p { font-weight: 600; margin: 14px 0; }
.mock-chips { display: flex; gap: 6px; }
.mock-alt { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 8px; font-weight: 500; display: flex; justify-content: space-between; }
.mock-alt.ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.mock-alt.ok span { font-size: .85rem; }

/* Búsqueda */
.search { position: relative; max-width: 560px; }
.search input { width: 100%; height: 54px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 16px 0 48px; background: var(--surface); font-size: 1rem; box-shadow: var(--shadow); }
.search input:focus { outline: none; border-color: var(--brand); }
.search-ico { position: absolute; left: 16px; top: 16px; width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(23, 23, 43, .14); padding: 6px; max-height: 420px; overflow: auto; }
.sr { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.sr:hover, .sr:focus { background: #F3F3FA; outline: none; }
.sr-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sr-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sr-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-path { font-size: .82rem; color: var(--muted); }
.sr-count { font-size: .8rem; font-weight: 700; color: var(--ink-2); background: #F0F0F7; border-radius: 999px; padding: 2px 9px; }
.sr-empty { padding: 14px; color: var(--muted); }

.section { padding: 28px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.section h2 { font-size: 1.6rem; font-weight: 800; }
.link { color: var(--c); font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.subject-card { position: relative; display: flex; flex-direction: column; gap: 8px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.subject-card::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.subject-card h3 { font-size: 1.15rem; font-weight: 700; }
.subject-card p { margin: 0; color: var(--muted); font-size: .9rem; flex: 1; }
.subject-count { font-weight: 700; color: var(--c); font-size: .9rem; }
.subject-badge { align-self: flex-start; display: inline-block; background: var(--cs); color: var(--c); font-weight: 800; font-size: .8rem; padding: 4px 10px; border-radius: 8px; letter-spacing: .02em; }

.how h2 { margin-bottom: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step > span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.notice { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 14px 18px; color: var(--ink-2); font-size: .92rem; }
.tag-review { display: inline-block; background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: .75rem; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }

/* ---------- Chips ---------- */
.chip { display: inline-block; background: var(--cs); color: var(--c); font-weight: 700; font-size: .78rem; padding: 3px 10px; border-radius: 999px; }
.chip-ghost { background: #F0F0F7; color: var(--ink-2); font-weight: 600; }
.dif-alta { background: #FDECEF; color: var(--bad); }
.dif-baja { background: var(--ok-bg); color: var(--ok); }

/* ---------- Armar práctica ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 2rem; font-weight: 800; }
.page-head .search { flex: 1; max-width: 440px; min-width: 260px; }
.page-head .search input { height: 46px; box-shadow: none; }
.page-head .search-ico { top: 12px; }
.page-head > p { flex-basis: 100%; margin: 0; }

.builder { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.builder-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; font-size: .85rem; font-weight: 800; }
.mini { margin-left: auto; border: 0; background: none; color: var(--c); font-weight: 700; font-size: .85rem; padding: 4px 8px; border-radius: 8px; }
.mini:empty { display: none; }
.mini:hover { background: var(--cs); }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 700; }
.pill:hover { border-color: var(--c); color: var(--c); }
.pill.on { background: var(--c); border-color: var(--c); color: #fff; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; }
.check:hover { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.check .box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #C9C9D8; display: grid; place-items: center; }
.check.on { border-color: var(--c); background: var(--cs); }
.check.on .box { background: var(--c); border-color: var(--c); }
.check.on .box::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check-label { flex: 1; font-weight: 600; font-size: .95rem; }
.check-count { font-size: .8rem; color: var(--muted); font-weight: 700; }

.sub-title { font-size: .95rem; font-weight: 700; margin: 20px 0 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 600; text-align: left; }
.chip-btn span { color: var(--muted); font-weight: 700; margin-left: 4px; }
.chip-btn:hover { border-color: var(--c); }
.chip-btn.on { background: var(--cs); border-color: var(--c); color: var(--c); }
.tema-filter { margin-top: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--cs); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }
.tema-filter .mini { margin-left: auto; }

.toggle { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; font-weight: 600; }
.toggle span { color: var(--muted); font-size: .82rem; margin-left: 4px; }
.toggle.on { border-color: var(--c); background: var(--cs); color: var(--c); }
.toggle.on span { color: inherit; }

.qty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.qty-btn { min-width: 48px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.qty-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.qty-custom { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; margin-left: 4px; }
.qty-custom input { width: 72px; border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 10px; }

.builder-side { position: sticky; top: 84px; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.summary h3 { font-size: 1.2rem; }
.summary-filters { margin: 0; color: var(--ink-2); font-size: .9rem; }
.summary-count { background: var(--cs); border-radius: 12px; padding: 12px 14px; color: var(--ink-2); }
.summary-count strong { font-size: 1.6rem; color: var(--c); margin-right: 4px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #F0F0F7; border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 8px 6px; font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.hint { margin: -2px 0 2px; font-size: .84rem; color: var(--muted); }
.warn { margin: 0; background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: .88rem; }
.check-inline { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-2); }
.check-inline input { width: 16px; height: 16px; accent-color: var(--c); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid transparent; border-radius: 12px; padding: 12px 20px; font-weight: 700; text-decoration: none; transition: filter .15s, background .15s; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--c); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--c); color: var(--c); }
.btn-small { padding: 7px 14px; font-size: .88rem; border-radius: 10px; }
.btn-small:not(.btn-ghost) { background: var(--c); color: #fff; }

/* ---------- Sesión ---------- */
.session-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.session-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.session-title > div { display: flex; flex-direction: column; min-width: 0; }
.session-title .muted { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.session-actions { display: flex; align-items: center; gap: 12px; }
.counter { font-weight: 700; color: var(--ink-2); font-size: .92rem; }
.progress { height: 6px; background: #E6E6EF; border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.progress span { display: block; height: 100%; background: var(--c); border-radius: inherit; transition: width .3s; }

.session-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; max-width: 820px; margin: 0 auto; }
.session-body.with-text { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); max-width: none; }

.text-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.text-genre { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 700; color: var(--c); }
.text-head h3 { font-size: 1.25rem; margin: 6px 0 2px; }
.text-head p { margin: 0 0 14px; }
.paragraphs { margin: 0; padding: 0; list-style: none; counter-reset: par; font-family: Georgia, 'Times New Roman', serif; font-size: 1.02rem; line-height: 1.7; color: #24243A; }
.paragraphs li { counter-increment: par; position: relative; padding-left: 34px; margin-bottom: 12px; }
.paragraphs li::before { content: counter(par); position: absolute; left: 0; top: 3px; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: .72rem; font-weight: 700; color: var(--muted); background: #F0F0F7; border-radius: 6px; min-width: 22px; text-align: center; padding: 1px 4px; }
.text-source { font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; word-break: break-word; }

.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); min-width: 0; }
.q-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.q-num { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.q-text { font-size: 1.08rem; font-weight: 500; overflow-x: auto; }
.q-text table, .p-qbody table, .p-text table { border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
.q-text th, .q-text td, .p-qbody th, .p-qbody td { border: 1px solid var(--line); padding: 7px 12px; text-align: center; }
.q-text th, .p-qbody th { background: #F5F5FA; font-weight: 700; }
.q-text blockquote, .p-qbody blockquote { margin: 12px 0; padding: 10px 16px; border-left: 4px solid var(--c); background: #FAFAFD; border-radius: 0 10px 10px 0; color: var(--ink-2); font-style: italic; }
.q-hint { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }
.alts { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.alt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; transition: border-color .12s, background .12s; }
.alt:hover:not([aria-disabled]) { border-color: var(--c); background: var(--cs); }
.alt-letter { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #F0F0F7; font-weight: 800; }
.alt-text { flex: 1; min-width: 0; overflow-x: auto; }
.alt-flag { font-size: .78rem; font-weight: 700; white-space: nowrap; }
.alt.chosen { border-color: var(--c); background: var(--cs); }
.alt.chosen .alt-letter { background: var(--c); color: #fff; }
.alt.correct { border-color: var(--ok); background: var(--ok-bg); }
.alt.correct .alt-letter { background: var(--ok); color: #fff; }
.alt.correct .alt-flag { color: var(--ok); }
.alt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.alt.wrong .alt-letter { background: var(--bad); color: #fff; }
.alt.wrong .alt-flag { color: var(--bad); }
.alt.dim { opacity: .6; }
.alt[aria-disabled] { cursor: default; }

.feedback { margin-top: 18px; border-radius: 12px; padding: 16px 18px; border-left: 5px solid; }
.feedback p { margin: 0 0 8px; }
.feedback p:last-child { margin-bottom: 0; }
.feedback.ok { background: var(--ok-bg); border-color: var(--ok); }
.feedback.bad { background: var(--bad-bg); border-color: var(--bad); }
.feedback.omit { background: #F3F3F8; border-color: var(--muted); }
.feedback-title { font-weight: 800; }
.feedback.ok .feedback-title { color: var(--ok); }
.feedback.bad .feedback-title { color: var(--bad); }
.feedback-skill { font-size: .85rem; color: var(--ink-2); }
.q-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }

.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 28px auto 8px; max-width: 820px; }
.dot { width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.dot.answered { background: var(--cs); border-color: var(--c); color: var(--c); }
.dot.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.dot.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.dot.omit { background: #F0F0F7; color: var(--muted); }
.dot.current { box-shadow: 0 0 0 3px var(--ink); }
.kbd-hint { text-align: center; font-size: .82rem; }

/* ---------- Resultados ---------- */
.results { display: flex; flex-direction: column; gap: 18px; max-width: 900px; margin: 0 auto; }
.score-card { display: flex; align-items: center; gap: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.ring { --p: 0; flex: none; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #ECECF3 0); }
.ring > div { width: 76%; height: 76%; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring strong { font-size: 2rem; font-weight: 800; }
.ring span { font-size: .8rem; color: var(--muted); }
.ring-sm { width: 64px; height: 64px; margin-left: auto; }
.ring-sm strong { font-size: .95rem; }
.score-text h1 { font-size: 1.8rem; font-weight: 800; margin: 8px 0 4px; }
.score-text .muted { margin: 0; }
.score-stats { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.st { background: #F5F5FA; border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 96px; }
.st strong { font-size: 1.4rem; }
.st span { font-size: .82rem; color: var(--muted); }
.st.ok strong { color: var(--ok); }
.st.bad strong { color: var(--bad); }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 240px) 1fr 52px; gap: 12px; align-items: center; font-size: .92rem; }
.bar { height: 10px; background: #ECECF3; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c); border-radius: inherit; }
.bar-val { text-align: right; font-weight: 700; color: var(--ink-2); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rv button { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; background: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rv button:hover { background: #FAFAFD; border-color: var(--c); }
.rv-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: #F0F0F7; color: var(--muted); }
.rv.ok .rv-icon { background: var(--ok-bg); color: var(--ok); }
.rv.bad .rv-icon { background: var(--bad-bg); color: var(--bad); }
.rv-main { display: flex; flex-direction: column; min-width: 0; }
.rv-q { font-size: .93rem; }
.rv-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* ---------- Progreso ---------- */
.progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-bottom: 16px; }
.prog-card { display: flex; flex-direction: column; gap: 12px; }
.prog-head { display: flex; align-items: center; gap: 10px; }
.prog-head h2 { font-size: 1.05rem; }
.prog-card .muted { margin: 0; font-size: .9rem; }
.prog-card .bar-row { grid-template-columns: minmax(100px, 170px) 1fr 44px; font-size: .86rem; }
.history { list-style: none; margin: 0 0 16px; padding: 0; }
.history li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.history li strong { margin-left: auto; }
.empty { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 56px 24px; }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--ink-2); margin: 0 0 20px; }

/* ---------- Pie ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: .9rem; color: var(--ink-2); }
.footer p { margin: 4px 0; }

.katex { font-size: 1.05em; }
code.tex { background: #F0F0F7; padding: 1px 5px; border-radius: 5px; font-size: .9em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-card { max-width: 460px; }
  .builder { grid-template-columns: 1fr; }
  .builder-side { position: static; }
  .session-body.with-text { grid-template-columns: 1fr; }
  .text-panel { position: static; max-height: 46vh; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: 58px; }
  .brand-logo { height: 30px; }
  .nav a { padding: 7px 10px; font-size: .88rem; }
  .steps { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .panel, .qcard, .summary { padding: 18px; }
  .score-card { flex-direction: column; text-align: center; }
  .score-text .subject-badge { align-self: center; }
  .score-stats { justify-content: center; }
  .bar-row { grid-template-columns: 1fr 44px; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .q-nav .btn { flex: 1; padding: 12px 10px; }
  .session-title .muted { max-width: 80vw; }
  .kbd-hint { display: none; }
}


/* ===================== Plataforma con cuentas ===================== */
.loading { padding: 80px 0; text-align: center; color: var(--muted); font-weight: 600; }
.small { font-size: .85rem; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Navegación con usuario */
.nav { align-items: center; }
.nav-cta { background: var(--brand) !important; color: #fff !important; }
.nav-cta:hover { filter: brightness(1.08); }
.nav-user { display: inline-flex; align-items: center; gap: 8px; }
.nav a.nav-user.active { background: #F0F0F7; color: var(--ink); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-3), var(--brand)); color: #fff; font-weight: 800; font-size: .85rem; }

/* Formularios de cuenta */
.auth { display: grid; place-items: center; padding: 24px 0 40px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 20px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; }
.auth-sub { margin: 6px 0 20px; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; font-size: .92rem; color: var(--ink-2); }
.auth-links a, .check-terms a, .legal a, .muted a { color: var(--brand); font-weight: 600; }
form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: .92rem; }
.field-wrap { position: relative; display: block; }
.field input, .field select { width: 100%; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); font-size: 1rem; }
.field input:disabled { background: #F5F5FA; color: var(--muted); }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.field-wrap input { padding-right: 76px; }
.field-eye { position: absolute; right: 6px; top: 6px; height: 34px; border: 0; background: #F0F0F7; border-radius: 8px; padding: 0 10px; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: .82rem; color: var(--muted); }
.field-error { font-size: .84rem; color: var(--bad); font-weight: 600; }
.field-error:empty { display: none; }
.form-error { margin: 0; background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; }
.check-terms { align-items: flex-start; font-size: .86rem; line-height: 1.45; }
.check-terms input { margin-top: 2px; flex: none; }
.success-box { background: var(--ok-bg); color: #14532D; border-radius: 12px; padding: 16px; line-height: 1.5; }

/* Avisos flotantes */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: calc(100vw - 32px); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--bad); }

/* Indicadores */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi-row-5 { grid-template-columns: repeat(5, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi strong { font-size: 1.7rem; font-weight: 800; }
.kpi span { color: var(--ink-2); font-size: .88rem; }
.kpi em { font-style: normal; color: var(--muted); font-size: .8rem; margin-top: 4px; }

.history .h-desc { flex: 1; min-width: 0; }
.history li .link { font-size: .88rem; }
.history li strong { margin-left: 0; }
.pending { margin-bottom: 16px; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.pending .history { margin: 0; }
.pending .history li:last-child { border-bottom: 0; }

/* Cuenta */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.account-grid .danger { grid-column: 1 / -1; border-color: #F5C2CB; }
.account-grid .danger form { max-width: 420px; }
.account-grid form .btn { align-self: flex-start; }

/* Panel admin */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td:not(.td-text) { white-space: nowrap; }
.table .td-text { color: var(--ink-2); }
.panel-title.spaced { margin-top: 24px; }

/* Legales */
.legal { max-width: 780px; margin: 0 auto; padding: 32px 36px; }
.legal h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: 4px; }
.legal h2 { font-size: 1.1rem; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-left: 20px; }
.legal-draft { display: inline-block; background: var(--warn-bg); color: var(--warn); font-size: .85rem; font-weight: 700; padding: 4px 10px; border-radius: 8px; }

.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; }
.footer-links a { white-space: nowrap; }
.footer-links a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .kpi-row, .kpi-row-5 { grid-template-columns: repeat(2, 1fr); }
  .admin-grid, .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-user-name { display: none; }
  .nav { gap: 2px; }
  .auth-card { padding: 24px 20px; }
  .legal { padding: 22px 18px; }
  .history li { flex-wrap: wrap; }
  .table { font-size: .84rem; }
  .admin-grid .panel, .panel:has(.table) { overflow-x: auto; }
}



/* ---------- Quiénes somos ---------- */
.about { margin-top: 36px; padding-top: 40px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 80px; }
.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 36px; align-items: center; }
.about-photo { margin: 0; aspect-ratio: 3 / 4; border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, #DCE4FF, #D4F6FA); display: grid; place-items: center; box-shadow: var(--shadow); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-photo img.ilustracion { object-fit: contain; padding: 18px; background: #fff; }
.about-photo .img-fb { font-size: 4rem; font-weight: 800; color: var(--brand); background: none; border: 0; }
.about-text h2 { font-size: 2rem; font-weight: 800; color: var(--navy); margin-bottom: 14px; }
.about-text p { color: var(--ink-2); font-size: 1.04rem; margin: 0 0 12px; max-width: 680px; }
.about-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.about-links a { text-decoration: none; font-weight: 700; font-size: .9rem; color: var(--brand); background: #EEF2FF; padding: 7px 12px; border-radius: 999px; }
.about-links a:hover { background: #E0E7FF; }

.about-funding { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.about-funding h3 { font-size: 1.25rem; color: var(--navy); margin-bottom: 10px; }
.about-funding > p { color: var(--ink-2); margin: 0 0 20px; }
.org-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.org { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.org-logo { width: 100%; height: 110px; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; padding: 14px; background: #fff; margin-bottom: 6px; }
.org-logo { overflow: hidden; }
.org-logo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; display: block; }
.org-name { font-weight: 700; font-size: .88rem; line-height: 1.3; }
.org-role { font-size: .78rem; color: var(--muted); }
.img-fb { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; font-size: .82rem; color: var(--muted); text-align: center; line-height: 1.25; }
.disclaimer { margin: 20px 0 0; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

.about-contact { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(135deg, #EEF2FF, #E6FAFC); border: 1px solid #DCE4FF; border-radius: 20px; padding: 28px; }
.about-contact h3 { font-size: 1.3rem; color: var(--navy); margin: 8px 0 6px; }
.about-contact p { margin: 0; color: var(--ink-2); max-width: 560px; }
.beta-tag { display: inline-block; background: var(--navy); color: #fff; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.about-contact .btn { flex: none; }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .about-photo { max-width: 260px; }
  .org-row { grid-template-columns: repeat(2, 1fr); }
  .about-contact { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .about-funding, .about-contact { padding: 20px; }
  .about-contact .btn { width: 100%; font-size: .95rem; }
}


/* ---------- Preguntas nuevas / Cómo ayudar ---------- */
.nuevas-badge { display: inline-flex; align-items: center; gap: 8px; margin: -6px 0 18px; background: #E6FAFC; color: #0B6E7A; border: 1px solid #BDEFF4; font-weight: 700; font-size: .88rem; padding: 6px 12px; border-radius: 999px; }
.pulso { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-3); box-shadow: 0 0 0 0 rgba(24, 200, 220, .6); animation: pulso 2s infinite; }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgba(24, 200, 220, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 200, 220, 0); } }
@media (prefers-reduced-motion: reduce) { .pulso { animation: none; } }
.section-note { font-size: .88rem; font-weight: 700; color: #0B6E7A; }

.ayudar { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.ayudar-head h3 { font-size: 1.35rem; color: var(--navy); margin-bottom: 8px; }
.ayudar-head p:not(.eyebrow) { color: var(--ink-2); margin: 0 0 20px; max-width: 760px; }
.ayudar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ayudar-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #FBFBFE; }
.ayudar-card h4 { margin: 8px 0 4px; font-size: .98rem; }
.ayudar-card p { margin: 0; font-size: .88rem; color: var(--ink-2); }
.ayudar-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: .85rem; }
.ayudar-share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-whatsapp { background: #128C4B; color: #fff; }
.btn-whatsapp:hover { filter: brightness(1.08); }

/* ---------- Google y contraseñas ---------- */
.btn-google { background: #fff; border: 1.5px solid var(--line); color: var(--ink); gap: 10px; }
.btn-google:hover { border-color: #C9C9D8; background: #FAFAFD; }
.btn-google svg { width: 20px; height: 20px; }
.google-nota { font-size: .78rem; color: var(--muted); text-align: center; margin: 8px 0 0; }
.divisor { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .84rem; margin: 18px 0; }
.divisor::before, .divisor::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cuenta-google { display: flex; align-items: center; gap: 8px; margin: -6px 0 14px; }
.cuenta-google svg { width: 16px; height: 16px; flex: none; }
.pw-reglas { list-style: none; margin: -6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: .82rem; color: var(--muted); }
.pw-reglas li { display: flex; align-items: center; gap: 6px; }
.pw-reglas li[data-regla]::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #C9C9D8; flex: none; }
.pw-reglas li.ok { color: var(--ok); font-weight: 600; }
.pw-reglas li.ok::before { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px #fff; }
.pw-reglas .pw-extra { grid-column: 1 / -1; }
.pw-barra { height: 6px; background: #ECECF3; border-radius: 999px; overflow: hidden; margin-top: -4px; }
.pw-barra span { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }
.pw-barra span[data-nivel="3"] { background: #D97706; }
.pw-barra span[data-nivel="4"], .pw-barra span[data-nivel="5"] { background: var(--ok); }

@media (max-width: 860px) { .ayudar-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .ayudar { padding: 20px; }
  .ayudar-grid { grid-template-columns: 1fr; }
  .ayudar-share .btn { flex: 1; }
  .pw-reglas { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}


/* ===================== Inicio rediseñado ===================== */
.hero-wrap { position: relative; margin: -28px calc(50% - 50vw) 0; padding: 48px calc(50vw - 50%) 36px; overflow: hidden; background: linear-gradient(160deg, #EEF2FF 0%, #F4F7FF 45%, #E3F8FB 100%); border-bottom: 1px solid #DCE4FF; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.blob.b1 { width: 420px; height: 420px; background: #8AA2FF; top: -140px; left: -120px; }
.blob.b2 { width: 380px; height: 380px; background: #5EE1EE; bottom: -160px; right: 8%; }
.blob.b3 { width: 260px; height: 260px; background: #2448D8; top: 30%; right: -80px; opacity: .25; }
.hero-wrap .hero { position: relative; padding: 0; grid-template-columns: 1.15fr 1fr; gap: 56px; }
.hero-logo { display: block; width: min(360px, 80%); height: auto; margin: 0 0 18px; filter: drop-shadow(0 6px 18px rgba(36, 72, 216, .18)); }
.hero-wrap .hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.2rem); line-height: 1.02; letter-spacing: -0.035em; color: var(--navy); }
.hero-wrap .hero h1 span { background: linear-gradient(90deg, #0A7BE0, #18C8DC); -webkit-background-clip: text; background-clip: text; color: transparent; }

.sellos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 18px; }
.sello { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: #fff; border: 2px solid; box-shadow: 0 10px 30px rgba(11, 35, 80, .08); }
.sello strong { display: block; font-size: 1.32rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
.sello small { display: block; font-size: .84rem; color: var(--ink-2); margin-top: 3px; line-height: 1.35; }
.sello-ico { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.sello-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sello-gratis { border-color: #A7E9C0; }
.sello-gratis strong { color: #0F7A3D; }
.sello-gratis .sello-ico { background: linear-gradient(135deg, #16A34A, #22C55E); }
.sello-docentes { border-color: #BFCBFF; }
.sello-docentes strong { color: var(--brand); }
.sello-docentes .sello-ico { background: linear-gradient(135deg, #2448D8, #0A7BE0); }

.hero-wrap .lead { font-size: 1.12rem; margin: 0 0 22px; max-width: 600px; }
.btn-xl { padding: 16px 28px; font-size: 1.08rem; border-radius: 14px; }
.hero-wrap .btn-primary { background: linear-gradient(135deg, #2448D8, #0A7BE0); box-shadow: 0 10px 24px rgba(36, 72, 216, .3); }
.hero-wrap .btn-primary:hover { transform: translateY(-1px); }
.hero-wrap .hero-cta { margin-top: 0; }
.hero-wrap .nuevas-badge { margin: 18px 0 0; background: #fff; }

.hero-wrap .hero-card { position: relative; }
.hero-wrap .hero-card::before { background: linear-gradient(135deg, #2448D8, #18C8DC); opacity: .9; transform: rotate(4deg); }
.hero-wrap .mock-q { box-shadow: 0 24px 60px rgba(11, 35, 80, .18); }
.flotante { position: absolute; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .86rem; color: var(--navy); box-shadow: 0 10px 26px rgba(11, 35, 80, .16); white-space: nowrap; animation: flotar 5s ease-in-out infinite; }
.flotante.f1 { top: -18px; left: -26px; }
.flotante.f2 { bottom: 58px; right: -22px; animation-delay: -1.6s; }
.flotante.f3 { bottom: -18px; left: 24px; animation-delay: -3.2s; }
@keyframes flotar { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .flotante { animation: none; } }

.hero-search { position: relative; margin-top: 36px; }
.hero-search .search { max-width: 760px; margin: 0 auto; }
.hero-search .search input { height: 62px; font-size: 1.05rem; border-radius: 18px; border-color: #DCE4FF; box-shadow: 0 14px 40px rgba(11, 35, 80, .1); padding-left: 54px; }
.hero-search .search-ico { top: 20px; left: 20px; }

.apoyo { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 28px; padding: 22px 0 6px; }
.apoyo span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.apoyo img { height: 46px; width: auto; display: block; }
.apoyo .apoyo-itd { height: 30px; }

/* Tarjetas de asignatura más vivas */
.subject-card { border: 0; box-shadow: 0 1px 2px rgba(11, 35, 80, .05), 0 8px 24px rgba(11, 35, 80, .07); background: linear-gradient(180deg, var(--cs) 0, #fff 70px); }
.subject-card::after { width: 100%; height: 5px; bottom: auto; }
.subject-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(11, 35, 80, .14); }
.subject-count { margin-top: 4px; }

/* Logos de organizaciones: centrados, sobre blanco y del mismo tamaño visual */
.org-logo { background: #fff; padding: 16px 20px; }
.org-logo img { width: auto; height: auto; max-width: 100%; max-height: 72px; margin: auto; }
.org-logo img[src$="itd.png"] { max-width: 72%; max-height: 46px; }

@media (max-width: 960px) {
  .hero-wrap .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero-wrap .hero-card { max-width: 440px; margin: 0 auto; width: 100%; }
}
@media (max-width: 640px) {
  .hero-wrap { padding-top: 28px; padding-bottom: 28px; }
  .hero-logo { width: 240px; }
  .sellos { grid-template-columns: 1fr; }
  .sello strong { font-size: 1.18rem; }
  .btn-xl { width: 100%; }
  .flotante { font-size: .76rem; padding: 6px 10px; }
  .flotante.f1 { left: -6px; }
  .flotante.f2 { right: -6px; }
  .hero-search { margin-top: 28px; }
  .apoyo { gap: 18px; }
  .apoyo img { height: 38px; }
  .apoyo .apoyo-itd { height: 24px; }
  .apoyo span { width: 100%; text-align: center; }
}

/* Cronómetro */
.timer-toggle { display: flex; align-items: flex-start; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-size: .9rem; line-height: 1.35; }
.timer-toggle input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--c); flex: none; }
.timer-toggle small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.timer-toggle.on { border-color: var(--c); background: var(--cs); }
.timer-ico svg, .timer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: block; }
.timer-ico { color: var(--c); margin-top: 1px; }
.timer { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--cs); color: var(--c); padding: 6px 12px; border-radius: 10px; font-size: 1rem; }
.timer.low { background: var(--bad-bg); color: var(--bad); animation: latido 1s ease-in-out infinite; }
@keyframes latido { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .timer.low { animation: none; } }

/* ---------- Impresión / PDF ---------- */
.print-only { display: none; }
@media print {
  @page { size: letter; margin: 16mm 15mm; }
  body { background: #fff; font-size: 11pt; }
  .no-print, #app, .footer, .toast { display: none !important; }
  .print-only { display: block; }
  #print-area { color: #000; }
  .p-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 14px; }
  .p-brand img { height: 30px; width: auto; display: block; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-meta { font-size: 9pt; color: #444; }
  .p-title { font-size: 17pt; margin-bottom: 2px; }
  .p-sub { margin: 0 0 10px; color: #444; font-size: 10pt; }
  .p-name { border: 1px solid #999; padding: 8px 10px; font-size: 10pt; margin-bottom: 16px; }
  .p-text { border: 1px solid #bbb; padding: 10px 14px; margin: 14px 0; break-inside: auto; }
  .p-text h3 { font-size: 12pt; margin: 0; }
  .p-author { margin: 0 0 6px; font-size: 9.5pt; color: #444; }
  .p-text ol { margin: 0; padding-left: 22px; font-family: Georgia, serif; font-size: 10.5pt; line-height: 1.5; }
  .p-text li { margin-bottom: 5px; }
  .p-source { font-size: 8pt; color: #555; margin: 6px 0 0; word-break: break-all; }
  .p-q { display: flex; gap: 8px; margin: 0 0 14px; break-inside: avoid; }
  .p-qhead { flex: none; width: 22px; }
  .p-qbody { flex: 1; }
  .p-qbody table { font-size: 10pt; }
  .p-qbody th, .p-qbody td { border-color: #888; padding: 4px 8px; }
  .p-alts { list-style: none; margin: 6px 0 0; padding: 0; }
  .p-alts li { margin: 3px 0; }
  .p-alts li > span { font-weight: 700; margin-right: 4px; }
  .p-key { break-before: page; }
  .p-key h2 { font-size: 15pt; margin-bottom: 10px; }
  .p-keytable { border-collapse: collapse; margin-bottom: 14px; display: block; }
  .p-keytable tr { display: flex; flex-wrap: wrap; }
  .p-keytable td { border: 1px solid #999; width: 46px; text-align: center; padding: 3px; font-weight: 700; }
  .p-keytable td span { display: block; font-weight: 400; font-size: 8pt; color: #555; }
  .p-exp { font-size: 9.5pt; margin-bottom: 6px; break-inside: avoid; }
  .p-foot { margin-top: 18px; font-size: 8pt; color: #666; text-align: center; }
  /* Marca de agua: se repite en cada página */
  .p-watermark { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 0; pointer-events: none; }
  .p-wm { transform: rotate(-35deg); }
  .p-watermark { text-align: center; white-space: nowrap; color: rgba(36, 72, 216, .10); font-family: 'Plus Jakarta Sans', Arial, sans-serif; line-height: 1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .p-wm-main { font-size: 88pt; font-weight: 800; letter-spacing: -2pt; }
  .p-wm-sub { font-size: 30pt; font-weight: 800; margin-top: 6pt; text-transform: uppercase; letter-spacing: 3pt; }
  .p-wm-by { font-size: 22pt; font-weight: 600; margin-top: 10pt; }
  #print-area > *:not(.p-watermark) { position: relative; z-index: 1; }
}

/* ---------- Opiniones ---------- */
.opinar { max-width: 640px; margin: 8px auto 40px; }
.opinar-head { text-align: center; margin-bottom: 22px; }
.opinar-head h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.opinar-head p.muted { margin: 0 auto; max-width: 520px; }
.opinar-form { display: flex; flex-direction: column; gap: 20px; padding: 26px; }
.opinar-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.opinar-form legend { padding: 0; margin-bottom: 10px; }
.opinar-form textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 1rem; resize: vertical; background: var(--surface); color: var(--ink); }
.opinar-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.estrellas-field { text-align: center; }
.estrellas-field legend { width: 100%; text-align: center; }
.estrellas { display: inline-flex; gap: 6px; }
.estrella { position: relative; cursor: pointer; line-height: 0; }
.estrella input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.estrella svg { width: 44px; height: 44px; fill: #E3E3EE; transition: fill .12s, transform .12s; }
.estrella.on svg { fill: #F5B301; }
.estrella:hover svg { transform: scale(1.08); }
.estrella input:focus-visible + svg { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 8px; }
.estrellas-texto { display: block; margin-top: 6px; font-weight: 700; color: var(--ink-2); min-height: 1.5em; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.chip-check span:hover { border-color: var(--brand); }
.chip-check input:checked + span { background: #EEF0FF; border-color: var(--brand); color: var(--brand); }
.chip-check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.opinar-nota { text-align: center; margin: 0; }
.opinar-gracias { text-align: center; padding: 36px 26px; }
.opinar-gracias h1 { font-size: 1.7rem; font-weight: 800; color: var(--navy); margin: 10px 0 8px; }
.opinar-gracias-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #FFF4D1; color: #F5B301; font-size: 2rem; }
.opinar-gracias-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

.opinar-cta { display: flex; align-items: center; gap: 14px; text-decoration: none; background: linear-gradient(90deg, #FFF8E1, #EEF0FF); border: 1px solid #F1E3B5; border-radius: var(--radius); padding: 16px 20px; margin: 4px 0 22px; color: var(--ink); }
.opinar-cta:hover { filter: brightness(.98); }
.opinar-cta-stars { color: #F5B301; letter-spacing: 2px; font-size: 1.1rem; white-space: nowrap; }
.opinar-cta-go { margin-left: auto; font-weight: 800; color: var(--brand); font-size: 1.2rem; }
@media (max-width: 560px) { .opinar-cta { flex-wrap: wrap; } .opinar-cta-go { display: none; } .estrella svg { width: 40px; height: 40px; } }

.page-head-mini { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head-mini .panel-title { margin: 0; }
.op-resumen { display: grid; grid-template-columns: auto 1fr 1fr; gap: 24px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.op-promedio { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.op-promedio strong { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--navy); }
.op-stars { color: #F5B301; letter-spacing: 1px; }
.op-off { color: #E3E3EE; }
.op-temas { display: flex; flex-direction: column; gap: 8px; }
.op-lista { list-style: none; margin: 0; padding: 0; }
.op-item { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.op-item:last-child { border-bottom: 0; }
.op-item p { margin: 0; color: var(--ink-2); white-space: pre-line; }
.op-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
@media (max-width: 800px) { .op-resumen { grid-template-columns: 1fr; } }
.op-dist .bar-row, .op-dist .bar-row:is(*) { grid-template-columns: 34px 1fr 28px; grid-template-rows: auto; }
.op-dist .bar-row .bar { grid-column: auto; grid-row: auto; }
.op-dist .bar > span { background: #F5B301; }
