/* =============================================================================
   Power Query · Cafetería Andina — Blur Consulting
   Sistema de diseño: tokens → base → layout → componentes → widgets → modos
   ========================================================================== */

/* ---------- 1. Tokens -------------------------------------------------------- */
:root {
  color-scheme: light;
  /* Marca Blur */
  --navy: #0D1A31;
  --navy-ink: #000928;
  --lima: #7DF228;
  --turquesa: #04DDCA;
  --cian: #02C4E9;
  --violeta: #583DFB;
  --verde: #00B050;
  --brand-grad: linear-gradient(110deg, #7DF228 0%, #04DDCA 35%, #02C4E9 62%, #583DFB 100%);
  /* Acento BI */
  --amber: #F5B700;
  --amber-soft: #FFE7A3;

  /* Tema claro */
  --bg: #F6F4F1;
  --bg-2: #EFECE7;
  --surface: #FFFFFF;
  --surface-2: #F7F5F2;
  --surface-3: #EFEBE6;
  --text: #0D1A31;
  --text-2: #3D4A60;
  --muted: #5A667A;
  --line: #DDD8D1;
  --line-2: #C9C3BA;
  --accent: #F5B700;            /* fondos y bordes */
  --accent-ink: #7A4F00;        /* texto ámbar sobre claro (7:1) */
  --accent-tint: #FFF4D1;
  --on-accent: #0D1A31;
  --ok: #006E33;
  --ok-tint: #E2F6EA;
  --bad: #B42318;
  --bad-tint: #FDE8E6;
  --info: #0A6F8F;
  --info-tint: #E1F4FA;
  --new: #3D7A0C;
  --new-tint: #EAF8DA;
  --focus: #583DFB;
  --shadow: 0 1px 2px rgba(13, 26, 49, .06), 0 8px 24px rgba(13, 26, 49, .07);
  --shadow-lg: 0 2px 6px rgba(13, 26, 49, .08), 0 24px 60px rgba(13, 26, 49, .14);

  /* Código: siempre oscuro */
  --code-bg: #0A1426;
  --code-line: #1E2E4C;
  --code-text: #E6EBF3;

  /* Tipografía */
  --f-display: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-body: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', 'Cascadia Code', Consolas, 'Courier New', monospace;

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 180ms;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #071023;
  --bg-2: #0A1630;
  --surface: #0D1A31;
  --surface-2: #112240;
  --surface-3: #16294B;
  --text: #EEF2F8;
  --text-2: #C8D1E0;
  --muted: #9EABC1;
  --line: #213459;
  --line-2: #2E4572;
  --accent: #F5B700;
  --accent-ink: #FFC933;
  --accent-tint: rgba(245, 183, 0, .13);
  --on-accent: #0D1A31;
  --ok: #4ADE80;
  --ok-tint: rgba(74, 222, 128, .12);
  --bad: #FF8A7A;
  --bad-tint: rgba(255, 138, 122, .13);
  --info: #5CD3F0;
  --info-tint: rgba(2, 196, 233, .13);
  --new: #A3E85F;
  --new-tint: rgba(125, 242, 40, .12);
  --focus: #9D8CFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 60px rgba(0, 0, 0, .45);
}

/* ---------- 2. Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.55 var(--f-body); font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .4em; color: var(--text); }
h1 { font-size: 2.9em; font-weight: 700; }
h2 { font-size: 2.05em; font-weight: 700; }
h3 { font-size: 1.25em; font-weight: 600; letter-spacing: -.01em; }
h4 { font-size: 1em; font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: var(--info); text-underline-offset: .18em; }
strong { font-weight: 650; }
code { font-family: var(--f-mono); font-size: .88em; padding: .08em .35em; border-radius: 5px; background: var(--surface-3); color: var(--text); }
mark { background: var(--accent-tint); color: inherit; padding: 0 .2em; border-radius: 4px; box-shadow: inset 0 -2px 0 var(--accent); }
ul, ol { padding-left: 1.2em; margin: 0 0 .8em; }
li + li { margin-top: .3em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; }
.ico-play, .ico-star { fill: currentColor; stroke-width: 1.2; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- 3. Botones y controles ------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em; min-height: 2.5em; padding: .5em 1em;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .92em; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background var(--t) var(--ease), border-color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:hover { border-color: var(--text-2); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #FFC933; border-color: #FFC933; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { min-height: 2.1em; padding: .3em .7em; font-size: .85em; border-radius: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6em; align-items: center; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); }
.segmented button {
  border: 0; background: transparent; padding: .45em .9em; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .9em; color: var(--text-2);
  display: inline-flex; align-items: center; gap: .45em; transition: background var(--t), color var(--t);
}
.segmented button:hover { color: var(--text); background: var(--surface-2); }
.segmented button[aria-pressed='true'], .segmented button[aria-checked='true'], .segmented button[aria-selected='true'] {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); outline: 2px solid var(--accent); outline-offset: -2px;
}
.segmented button[aria-pressed='true']::before, .segmented button[aria-checked='true']::before, .segmented button[aria-selected='true']::before { content: '●'; color: var(--accent-ink); font-size: .7em; }

.tag {
  display: inline-flex; align-items: center; gap: .35em; padding: .15em .6em; border-radius: 999px;
  font: 600 .78em/1.5 var(--f-body); letter-spacing: .01em; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.tag-ok { color: var(--ok); background: var(--ok-tint); border-color: transparent; }
.tag-bad { color: var(--bad); background: var(--bad-tint); border-color: transparent; }
.tag-new { color: var(--new); background: var(--new-tint); border-color: transparent; }
.tag-accent { color: var(--accent-ink); background: var(--accent-tint); border-color: transparent; }
.tag-info { color: var(--info); background: var(--info-tint); border-color: transparent; }

kbd { font: 600 .8em var(--f-mono); padding: .15em .45em; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); color: var(--text); }

/* ---------- 4. Barra superior y agenda --------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 0 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-grad); opacity: .85; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { width: 34px; height: 34px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font: 700 .95em var(--f-display); letter-spacing: -.01em; white-space: nowrap; }
.brand-txt span { font-size: .72em; color: var(--muted); white-space: nowrap; }

.agenda { position: relative; display: flex; gap: 4px; min-width: 0; height: 44px; }
.agenda-seg {
  position: relative; flex: var(--min) 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 3px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; text-align: left; overflow: hidden; transition: background var(--t), border-color var(--t), color var(--t);
}
.agenda-seg:hover { border-color: var(--line-2); color: var(--text); }
.agenda-seg .s-top { display: flex; align-items: center; gap: 6px; font: 700 .8em/1.1 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-seg .s-num { display: inline-grid; place-items: center; min-width: 1.45em; height: 1.45em; border-radius: 6px; background: var(--surface-3); font-size: .9em; }
.agenda-seg .s-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.agenda-seg .s-time { font: 500 .68em/1.2 var(--f-mono); color: var(--muted); white-space: nowrap; }
.agenda-seg.is-done .s-num { background: var(--ok-tint); color: var(--ok); }
.agenda-seg.is-current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.agenda-seg.is-current .s-num { background: var(--on-accent); color: var(--accent); }
.agenda-seg.is-current .s-time { color: var(--on-accent); opacity: .85; }
.agenda-seg .s-prog { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: var(--on-accent); opacity: .55; transition: width var(--t) var(--ease); }
.agenda-seg.is-break { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 6px, var(--surface-3) 6px 12px); }
.agenda-seg.is-break.is-current { background: var(--accent); }
.agenda-now { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--violeta); border-radius: 2px; pointer-events: none; left: var(--x, 0%); transition: left 1s linear; }
.agenda-now::before { content: ''; position: absolute; top: -3px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--violeta); }
[data-theme='dark'] .agenda-now, [data-theme='dark'] .agenda-now::before { background: #9D8CFF; }

.tools { display: flex; align-items: center; gap: 6px; }
.tool {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: .85em; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.tool:hover { background: var(--surface-2); border-color: var(--line-2); }
.tool .ico { width: 18px; height: 18px; }
.tool-label { display: none; }
@media (min-width: 1500px) { .mode-toggle .tool-label { display: inline; } }

.timer { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.timer[hidden] { display: none; }
.timer .tool { height: 30px; border: 0; padding: 0 7px; }
.timer-read { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding: 0 6px; min-width: 7.2em; }
.timer-clock { font: 600 .95em var(--f-mono); letter-spacing: .02em; }
.timer-status { font: 600 .66em var(--f-body); color: var(--muted); white-space: nowrap; }
.timer-status.is-late { color: var(--bad); }
.timer-status.is-ok { color: var(--ok); }
.wallclock { font: 600 .85em var(--f-mono); color: var(--muted); padding: 0 6px; }

/* ---------- 5. Layout general ------------------------------------------------ */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 0; max-width: 1480px; margin: 0 auto; }
.toc {
  position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow: auto;
  padding: 28px 14px 40px 22px; border-right: 1px solid var(--line); font-size: .88em;
}
.toc h2 { font-size: .75em; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-family: var(--f-body); margin: 0 0 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc > ol > li { margin: 0 0 6px; }
.toc a { display: block; color: var(--text-2); text-decoration: none; padding: 5px 10px; border-radius: 8px; }
.toc a:hover { background: var(--surface-3); color: var(--text); }
.toc .toc-sec > a { font-weight: 650; color: var(--text); display: flex; gap: 8px; align-items: baseline; }
.toc .toc-sec > a .n { font: 600 .82em var(--f-mono); color: var(--accent-ink); min-width: 1.4em; }
.toc .toc-sub { margin: 2px 0 8px 22px; border-left: 1px solid var(--line); }
.toc .toc-sub a { font-size: .95em; padding: 3px 10px; }
.toc a[aria-current='true'] { background: var(--accent-tint); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }

main#deck { min-width: 0; padding: 32px clamp(16px, 4vw, 56px) 120px; }
.section { margin-bottom: 40px; }
.slide {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(22px, 3.2vw, 44px); margin: 0 0 22px; box-shadow: var(--shadow);
}
.slide-head { margin-bottom: 1.2em; max-width: 62em; }
.eyebrow { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; font: 600 .78em var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 .7em; }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lead { font-size: 1.12em; color: var(--text-2); max-width: 46em; }
.muted { color: var(--muted); }
.small { font-size: .86em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2em; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1em; }
.stack > * + * { margin-top: 1em; }

.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1em 1.25em; }
.card h3 { margin-bottom: .35em; }
.card > :last-child { margin-bottom: 0; }

/* ---------- 6. Tipos de diapositiva ------------------------------------------ */

/* Portada */
.hero { overflow: hidden; background: var(--navy); color: #fff; border-color: transparent; min-height: 560px; }
.hero > .slide-inner { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2em; align-items: center; }
.hero h1, .hero h2, .hero h3 { color: #fff; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(900px 420px at 85% 110%, rgba(88, 61, 251, .35), transparent 60%), radial-gradient(700px 380px at 10% -10%, rgba(4, 221, 202, .18), transparent 60%); pointer-events: none; }
.hero-deco { position: absolute; right: -80px; bottom: -2px; width: 560px; opacity: .07; filter: invert(1); pointer-events: none; }
.hero-body { position: relative; z-index: 1; }
.hero .logo { height: 44px; width: auto; margin-bottom: 1.6em; }
.hero h1 { font-size: 3.4em; margin-bottom: .25em; }
.hero h1 .grad { display: inline-block; white-space: nowrap; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: #C8D1E0; font-size: 1.25em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: .5em; margin: 1.4em 0; }
.hero-meta .tag { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #E6EBF3; font-size: .85em; }
.hero-live { position: absolute; top: 22px; right: 26px; width: 96px; z-index: 2; }
.hero-side { position: relative; z-index: 1; display: grid; gap: 1em; justify-items: center; }
.hero-side img.mascota { width: 230px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); }
.hero-keys { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r); padding: 1em 1.2em; font-size: .9em; color: #C8D1E0; width: 100%; max-width: 360px; }
.hero-keys kbd { background: #16294B; color: #fff; border-color: #2E4572; }
.hero-keys ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45em; }

/* Apertura de bloque */
.opener { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.2em; align-items: stretch; }
.opener-num { font: 700 7.5em/0.85 var(--f-display); letter-spacing: -.05em; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: .1em; }
.opener h2 { font-size: 2.6em; }
.opener-time { display: flex; gap: .5em; flex-wrap: wrap; margin: .4em 0 1.2em; }
.problem { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-left: 5px solid var(--bad); border-radius: var(--r); padding: 1.2em 1.4em; }
.problem h3 { display: flex; align-items: center; gap: .5em; color: var(--bad); font-size: .85em; text-transform: uppercase; letter-spacing: .1em; font-family: var(--f-mono); }
.problem p { font-size: 1.12em; }
.problem .evidence { margin-top: .8em; }
.rescate { margin-top: 1.2em; }
.rescate h3 { font: 600 .78em var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.rescate ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .35em; }
.rescate li { display: flex; gap: .6em; align-items: center; font-size: .95em; color: var(--muted); margin: 0; }
.rescate li .st { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; border: 1.5px dashed var(--line-2); flex: none; font-size: .8em; }
.rescate li.is-done { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--ok); }
.rescate li.is-done .st { background: var(--ok-tint); color: var(--ok); border: 0; }
.rescate li.is-now { color: var(--text); font-weight: 600; }
.rescate li.is-now .st { background: var(--accent); color: var(--on-accent); border: 0; }

/* Concepto: qué es → por qué → cómo → M */
.concept { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 1.6em; align-items: start; }
.concept.no-code { grid-template-columns: minmax(0, 1fr); max-width: 60em; }
.qp { display: grid; gap: .9em; }
.qp-item { display: grid; grid-template-columns: 2.1em minmax(0, 1fr); gap: .8em; align-items: start; }
.qp-n { display: grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: 10px; font: 700 .9em var(--f-display); background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); }
.qp-item.is-how .qp-n { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.qp-label { display: block; font: 600 .74em var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: .25em 0 .2em; }
.qp-text { font-size: 1.05em; }
.qp-text > :last-child { margin-bottom: 0; }
.qp-text ol, .qp-text ul { margin-top: .3em; }
.note { display: flex; gap: .6em; align-items: flex-start; margin-top: 1em; padding: .75em 1em; border-radius: 10px; background: var(--info-tint); color: var(--text); font-size: .93em; }
.note .ico { color: var(--info); margin-top: .15em; }

.ruta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3em; font-weight: 600; }
.ruta-i { display: inline-block; padding: .14em .55em; border-radius: 7px; background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; font-size: .93em; line-height: 1.45; }
.ruta-sep { color: var(--accent-ink); font-weight: 700; }

/* Flujo del analista */
.flow { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: .7em; margin: 1.2em 0; counter-reset: f; }
.flow-step { position: relative; padding: 1.1em 1em; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.flow-step:not(:last-child)::after { content: '→'; position: absolute; right: -.62em; top: 50%; transform: translateY(-50%); z-index: 1; color: var(--muted); font-weight: 700; background: var(--surface); border-radius: 50%; width: 1.1em; line-height: 1.1em; }
.flow-step b { display: block; font: 700 1.15em var(--f-display); }
.flow-step span { display: block; font-size: .85em; color: var(--muted); margin-top: .25em; }
.flow-step .ico { width: 1.6em; height: 1.6em; color: var(--text-2); margin-bottom: .3em; }
.flow-step.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.flow-step.is-active span, .flow-step.is-active .ico { color: var(--on-accent); }
.flow-step.is-active::before { content: 'Hoy vivimos aquí'; position: absolute; left: 50%; top: -1.05em; transform: translateX(-50%); white-space: nowrap; font: 700 .72em var(--f-mono); text-transform: uppercase; letter-spacing: .08em; background: var(--navy); color: #fff; padding: .25em .7em; border-radius: 999px; }

/* Comparar A vs B */
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1em; }
.compare .card.is-pick { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.compare .card h3 { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; }
.compare ul { margin: .5em 0 0; }

/* Lista con íconos */
.bullets { list-style: none; padding: 0; display: grid; gap: .65em; max-width: 56em; }
.bullets li { display: grid; grid-template-columns: 1.6em minmax(0, 1fr); gap: .5em; margin: 0; font-size: 1.05em; }
.bullets li .ico { color: var(--accent-ink); margin-top: .2em; }
.bullets.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; column-gap: 2em; }

/* Fija + error común */
.closing { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.3em; align-items: stretch; }
.fija { position: relative; border-radius: var(--r-lg); padding: 1.6em 1.8em 1.6em; background: var(--accent); color: var(--on-accent); overflow: hidden; display: flex; flex-direction: column; }
.fija::after { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; border: 34px solid rgba(13, 26, 49, .07); }
.fija-label { display: flex; align-items: center; gap: .5em; font: 700 .8em var(--f-mono); text-transform: uppercase; letter-spacing: .14em; margin-bottom: .8em; }
.fija-label .ico { width: 1.3em; height: 1.3em; }
.fija-text { font: 700 1.75em/1.22 var(--f-display); letter-spacing: -.02em; position: relative; z-index: 1; }
.fija-text code { background: rgba(13, 26, 49, .12); color: var(--on-accent); }
.fija-foot { margin-top: auto; padding-top: 1.2em; display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; }
.fija-foot img { width: 120px; margin: -10px -10px -26px 0; }
.fija-foot p { margin: 0; font-size: .92em; font-weight: 500; opacity: .85; }
.error-card { position: relative; border-radius: var(--r-lg); padding: 1.4em 1.5em; background: var(--bad-tint); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1em; }
.error-card h3 { display: flex; align-items: center; gap: .5em; color: var(--bad); font: 700 .8em var(--f-mono); text-transform: uppercase; letter-spacing: .12em; }
.error-card .err-title { font: 700 1.2em/1.3 var(--f-display); margin-bottom: .4em; }
.error-card p { margin-bottom: .4em; }
.error-card .fix { display: flex; gap: .5em; align-items: flex-start; margin-top: .6em; color: var(--text); font-weight: 500; }
.error-card .fix .ico { color: var(--ok); margin-top: .2em; }
.error-card img { width: 88px; align-self: end; }

/* Datasets */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 1em; }
.ds { display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ds-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8em; align-items: center; padding: 1em 1.1em; border-bottom: 1px solid var(--line); background: var(--surface); }
.ds-icon { display: grid; place-items: center; width: 2.6em; height: 2.6em; border-radius: 10px; background: var(--accent-tint); color: var(--accent-ink); }
.ds-icon .ico { width: 1.4em; height: 1.4em; }
.ds-name { font: 600 .95em var(--f-mono); word-break: break-all; }
.ds-meta { font-size: .78em; color: var(--muted); }
.ds-body { padding: .9em 1.1em 1.1em; display: grid; gap: .7em; font-size: .92em; }
.ds-body h4 { font: 600 .72em var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .25em; display: flex; align-items: center; gap: .4em; }
.ds-body ul { margin: 0; padding-left: 1.1em; }
.ds-body li + li { margin-top: .15em; }
.ds-body p { margin: 0; }
.ds .ds-res { background: var(--ok-tint); border-radius: 10px; padding: .6em .8em; }
.ds .ds-res h4 { color: var(--ok); }
.ds-opt { font-size: .75em; }
.zipbar { display: flex; flex-wrap: wrap; gap: 1em; align-items: center; justify-content: space-between; margin-top: 1.2em; padding: 1em 1.2em; border-radius: var(--r); background: var(--navy); color: #fff; }
.zipbar p { margin: 0; color: #C8D1E0; }
.zipbar b { color: #fff; }

/* Marca Blur */
.brand-slide { overflow: hidden; color: #fff; background: var(--navy); border-color: transparent; }
.brand-slide::before { content: ''; position: absolute; inset: 0; background: url('../img/foto-equipo.jpg') center/cover no-repeat; opacity: .16; filter: grayscale(1); }
.brand-slide > * { position: relative; }
.brand-slide h2, .brand-slide h3 { color: #fff; }
.brand-slide .eyebrow { color: #FFC933; }
.brand-slide .lead { color: #D6DDE8; }
.brand-slide .card { background: rgba(13, 26, 49, .72); border-color: rgba(255, 255, 255, .14); color: #E6EBF3; backdrop-filter: blur(6px); }
.brand-slide .card h3 { display: flex; align-items: center; gap: .5em; }
.brand-slide .card h3::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--brand-grad); }
.brand-logo { height: 48px; width: auto; margin-bottom: 1.2em; }
.socials { display: flex; gap: .6em; margin-top: 1.2em; flex-wrap: wrap; }
.socials a { display: inline-flex; align-items: center; gap: .5em; padding: .4em .8em .4em .4em; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-decoration: none; font-size: .85em; }
.socials img { width: 26px; height: 26px; border-radius: 50%; }

/* ---------- 7. Código -------------------------------------------------------- */
.code { margin: 0; border-radius: var(--r); background: var(--code-bg); border: 1px solid var(--code-line); overflow: hidden; color: var(--code-text); box-shadow: var(--shadow); }
.code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: .45em .6em .45em 1em; border-bottom: 1px solid var(--code-line); background: #0D1A31; }
.code-lang { font: 600 .72em var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #9EABC1; }
.code-lang::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: .55em; vertical-align: .05em; }
.code-copy { display: inline-flex; align-items: center; gap: .4em; border: 1px solid #2E4572; background: transparent; color: #E6EBF3; border-radius: 8px; padding: .3em .7em; font-size: .78em; font-weight: 600; cursor: pointer; }
.code-copy:hover { background: #16294B; }
.code-copy.is-done { border-color: #4ADE80; color: #4ADE80; }
.code pre { margin: 0; padding: 1em 1.1em 1.1em; overflow-x: auto; font: 500 .86em/1.65 var(--f-mono); tab-size: 4; white-space: pre-wrap; overflow-wrap: break-word; }
.code-sm pre { font-size: .8em; padding: .8em 1em; }
.code code { background: none; padding: 0; color: inherit; font-size: inherit; }
.t-kw { color: #FFC933; font-weight: 600; }
.t-fn { color: #5CD3F0; }
.t-str { color: #A6E86B; }
.t-num { color: #C3B8FF; }
.t-com { color: #7F8DA6; font-style: italic; }
.t-field { color: #5EEAD4; }
.t-id { color: #E6EBF3; }
.t-type { color: #FF9EC7; }
.t-op { color: #9EABC1; }

/* ---------- 8. Tablas -------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 100%; }
.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9em; }
.tbl caption { text-align: left; padding: .6em .9em; font-size: .85em; color: var(--muted); caption-side: top; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 650; font-size: .86em; padding: .55em .8em; background: var(--surface-3); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl th > span { vertical-align: middle; }
.tbl td { padding: .45em .8em; border-bottom: 1px solid var(--line); font-family: var(--f-mono); font-size: .92em; white-space: nowrap; transition: background var(--t); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .null { font-style: italic; color: var(--muted); font-family: var(--f-body); font-size: .9em; }
.tbl .ws { background: var(--bad-tint); border-radius: 4px; }
.tbl .sp { color: var(--bad); font-weight: 700; }
.tbl td.rowtag { font-family: var(--f-body); font-size: .8em; text-align: right; }
.tbl.tbl-text td { font-family: var(--f-body); white-space: normal; font-size: .95em; }
.tbl.tbl-text th { white-space: normal; }
.tbl tr.is-removed td { background: var(--bad-tint) !important; color: var(--muted); text-decoration: line-through; text-decoration-color: var(--bad); }
.tbl tr.is-removed td.rowtag { text-decoration: none; }
.tbl td.is-changed { background: var(--accent-tint) !important; box-shadow: inset 0 0 0 2px var(--accent); font-weight: 600; }
.tbl tr.is-new td { background: var(--new-tint) !important; }
.tbl tr.is-orphan td { background: var(--bad-tint) !important; }
.tbl tr.is-hl td { background: var(--info-tint) !important; }
.tbl tr.enter { animation: rowIn 420ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tbadge { display: inline-grid; place-items: center; min-width: 2.2em; height: 1.45em; padding: 0 .3em; margin-right: .45em; border-radius: 5px; font: 700 .72em var(--f-mono); color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2); letter-spacing: -.02em; vertical-align: middle; }
.tbadge svg { width: 1.1em; height: 1.1em; }
.tbadge-text { color: #0A6F8F; } .tbadge-int, .tbadge-dec { color: #3D7A0C; } .tbadge-cur { color: #7A4F00; } .tbadge-date { color: #6A3FD8; }
[data-theme='dark'] .tbadge-text { color: #5CD3F0; } [data-theme='dark'] .tbadge-int, [data-theme='dark'] .tbadge-dec { color: #A3E85F; }
[data-theme='dark'] .tbadge-cur { color: #FFC933; } [data-theme='dark'] .tbadge-date { color: #B9A9FF; }

.tbl-ref td, .tbl-ref th { white-space: normal; }
.tbl-ref td { font-family: var(--f-body); font-size: .97em; vertical-align: top; }
.tbl-ref td:first-child { font-weight: 600; }
.tbl-ref td code { white-space: nowrap; }

/* ---------- 9. Widgets ------------------------------------------------------- */
.widget { position: relative; }
.w-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1em 1.2em; }
.w-toolbar { display: flex; flex-wrap: wrap; gap: .8em 1.2em; align-items: center; margin-bottom: 1em; }
.w-toolbar .lbl { font: 600 .74em var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.w-count { display: inline-flex; align-items: baseline; gap: .35em; font: 700 1.05em var(--f-display); }
.w-count small { font: 500 .75em var(--f-body); color: var(--muted); }
.w-result { display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1em; padding: .8em 1em; border-radius: 12px; margin-top: 1em; font-weight: 500; }
.w-result.ok { background: var(--ok-tint); }
.w-result.bad { background: var(--bad-tint); }
.w-result.warn { background: var(--accent-tint); }
.w-result .ico { width: 1.4em; height: 1.4em; }
.w-result.ok .ico { color: var(--ok); } .w-result.bad .ico { color: var(--bad); } .w-result.warn .ico { color: var(--accent-ink); }
.arrow-col { display: grid; place-items: center; color: var(--muted); }
.arrow-col .ico { width: 2em; height: 2em; }

/* Simulador de tipos */
.tipos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2em; }
.tipo-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: .6em; flex-wrap: wrap; }
.tipo-val { font: 700 1.9em var(--f-mono); letter-spacing: .02em; padding: .25em .5em; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line-2); display: inline-block; margin: .2em 0 .7em; }
.tipo-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1em; }
.tipo-opts button { display: inline-flex; align-items: center; gap: .35em; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: .4em .7em; cursor: pointer; font-weight: 600; font-size: .86em; }
.tipo-opts button:hover { border-color: var(--text-2); }
.tipo-opts button[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.tipo-out { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3em 1em; align-items: center; padding: .9em 1em; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-height: 6.5em; }
.tipo-out .cell { font: 700 1.3em var(--f-mono); padding: .2em .6em; border-radius: 8px; background: var(--surface-3); white-space: nowrap; }
.tipo-out .cell.err { color: var(--bad); background: var(--bad-tint); }
.tipo-out .verdict { display: flex; align-items: center; gap: .45em; font-weight: 700; }
.tipo-out .verdict.ok { color: var(--ok); } .tipo-out .verdict.bad { color: var(--bad); } .tipo-out .verdict.warn { color: var(--accent-ink); }
.tipo-out .why { grid-column: 1 / -1; color: var(--text-2); font-size: .95em; }
.tipo-out .placeholder { grid-column: 1 / -1; color: var(--muted); }

/* Limpieza paso a paso */
.steps-ui { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 1.1em; align-items: start; }
.applied { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.applied h4 { margin: 0; padding: .6em .9em; font: 600 .74em var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-3); }
.applied ol { list-style: none; margin: 0; padding: .35em; }
.applied li { margin: 0; }
.applied button { display: flex; align-items: center; gap: .5em; width: 100%; text-align: left; border: 0; background: transparent; padding: .45em .6em; border-radius: 8px; cursor: pointer; font-size: .9em; color: var(--text-2); }
.applied button:hover { background: var(--surface-2); color: var(--text); }
.applied button .n { font: 600 .8em var(--f-mono); color: var(--muted); min-width: 1.3em; }
.applied button[aria-current='step'] { background: var(--accent-tint); color: var(--text); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.applied button.is-future { opacity: .55; }
.step-view .w-toolbar { justify-content: space-between; }
.step-note { margin: .8em 0; color: var(--text-2); }

/* Unpivot / Pivot / Combinar */
.wl { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr); gap: 1em; align-items: start; }
.wl h4 { display: flex; align-items: center; gap: .5em; justify-content: space-between; flex-wrap: wrap; font-size: .95em; margin-bottom: .5em; }
.tbl th.is-fixed { box-shadow: inset 0 -3px 0 var(--info); }
.tbl th.is-sel { box-shadow: inset 0 -3px 0 var(--accent); }
.tbl th.is-new, .tbl td.is-newcol { background: var(--new-tint) !important; }
.venn { width: 120px; height: 72px; flex: none; }
.venn circle { stroke: var(--text-2); stroke-width: 1.5; fill: transparent; }
.venn .fillA { fill: var(--accent); }
.join-head { display: flex; gap: 1em; align-items: center; flex-wrap: wrap; }
.join-desc { flex: 1 1 18em; margin: 0; }

/* Orden ETL */
.etl { list-style: none; padding: 0; margin: 0; display: grid; gap: .5em; counter-reset: etl; }
.etl li {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: .7em; align-items: center; margin: 0;
  padding: .55em .7em; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: grab; user-select: none;
  transition: transform var(--t) var(--ease), border-color var(--t), background var(--t), box-shadow var(--t);
}
.etl li:active { cursor: grabbing; }
.etl li.is-drag { opacity: .45; }
.etl li.is-over { border-color: var(--accent); box-shadow: 0 -3px 0 var(--accent); }
.etl li .grip { color: var(--muted); }
.etl li .pos { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 8px; background: var(--surface-3); font: 700 .9em var(--f-display); }
.etl li .txt b { display: block; font-weight: 650; }
.etl li .txt .why { display: block; font-size: .86em; color: var(--text-2); margin-top: .2em; }
.etl li .mv { display: flex; gap: 4px; }
.etl li .mv button { width: 2em; height: 2em; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.etl li .mv button:hover { border-color: var(--text-2); }
.etl li.is-ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-tint); }
.etl li.is-ok .pos { background: var(--ok); color: #fff; }
.etl li.is-bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); background: var(--bad-tint); }
.etl li.is-bad .pos { background: var(--bad); color: #fff; }
.etl .verdict { font-size: .78em; font-weight: 700; white-space: nowrap; }
.etl .is-ok .verdict { color: var(--ok); } .etl .is-bad .verdict { color: var(--bad); }

/* Query folding */
.fold { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1em; }
.lane { border-radius: var(--r); padding: 1em; border: 1px solid var(--line); min-height: 14em; }
.lane h4 { display: flex; align-items: center; gap: .5em; margin-bottom: .2em; }
.lane .sub { font-size: .82em; color: var(--muted); margin-bottom: .8em; }
.lane-db { background: var(--info-tint); }
.lane-pc { background: var(--surface-2); }
.fold-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45em; }
.fold-step { display: grid; grid-template-columns: 1.8em minmax(0, 1fr) auto; gap: .6em; align-items: center; padding: .5em .7em; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); margin: 0; animation: rowIn 320ms var(--ease) both; }
.fold-step .n { font: 700 .85em var(--f-mono); color: var(--muted); }
.fold-step .nat { font-size: .74em; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: .3em; }
.fold-step .nat.on { color: var(--ok); } .fold-step .nat.off { color: var(--muted); }
.fold-step.is-break { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.fold-step .ctrl { display: flex; gap: 3px; }
.fold-step .ctrl button { width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.fold-wire { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3em 1em; align-items: center; padding: .9em 1.1em; border-radius: var(--r); background: var(--navy); color: #E6EBF3; }
.fold-wire .big { font: 700 1.6em var(--f-display); color: #FFC933; }
.fold-bar { height: 10px; border-radius: 5px; background: #1E2E4C; overflow: hidden; }
.fold-bar span { display: block; height: 100%; width: var(--w); background: var(--brand-grad); transition: width 500ms var(--ease); }
.fold .code { grid-column: 1 / -1; }

/* Quiz */
.quiz { max-width: 980px; }
.quiz-progress { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.1em; }
.quiz-progress span { width: 28px; height: 8px; border-radius: 4px; background: var(--surface-3); border: 1px solid var(--line); }
.quiz-progress span.ok { background: var(--ok); border-color: var(--ok); }
.quiz-progress span.bad { background: var(--bad); border-color: var(--bad); }
.quiz-progress span.now { background: var(--accent); border-color: var(--accent); }
.quiz-q { font: 700 1.5em/1.28 var(--f-display); letter-spacing: -.015em; margin: .2em 0 .9em; }
.quiz-opts { display: grid; gap: .55em; }
.quiz-opt { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: .8em; align-items: center; text-align: left; padding: .75em .9em; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.02em; transition: border-color var(--t), background var(--t); }
.quiz-opt:hover:not([disabled]) { border-color: var(--text-2); }
.quiz-opt .L { display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 9px; background: var(--surface-3); font: 700 .9em var(--f-display); }
.quiz-opt[disabled] { cursor: default; }
.quiz-opt.is-right { border-color: var(--ok); background: var(--ok-tint); }
.quiz-opt.is-right .L { background: var(--ok); color: #fff; }
.quiz-opt.is-wrong { border-color: var(--bad); background: var(--bad-tint); }
.quiz-opt.is-wrong .L { background: var(--bad); color: #fff; }
.quiz-opt .mk { font-weight: 700; font-size: .85em; }
.quiz-opt.is-right .mk { color: var(--ok); } .quiz-opt.is-wrong .mk { color: var(--bad); }
.quiz-exp { margin-top: 1em; }
.quiz-end { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5em; align-items: center; }
.quiz-end img { width: 200px; }
.quiz-score { font: 700 3.6em/1 var(--f-display); letter-spacing: -.03em; }
.quiz-score small { font-size: .35em; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.quiz-review { list-style: none; padding: 0; margin: 1em 0 0; display: grid; gap: .3em; font-size: .9em; }
.quiz-review li { display: flex; gap: .5em; margin: 0; }

/* Intermedio */
.break { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2em; align-items: center; }
.cd { display: grid; place-items: center; position: relative; width: min(100%, 23em); aspect-ratio: 1; margin: 0 auto; }
.cd svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cd circle { fill: none; stroke-width: 10; }
.cd .trk { stroke: var(--surface-3); }
.cd .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.cd-mid { position: relative; text-align: center; }
.cd-time { font: 700 5.2em/1 var(--f-mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.cd-lbl { font: 600 .8em var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-top: .4em; }
.cd-done .cd-time { color: var(--ok); }
.break-side img { width: 220px; display: block; margin: 0 auto 1em; }

/* Reto */
.reto-grid td { cursor: pointer; padding: 0; }
.reto-grid td button { all: unset; display: block; width: 100%; padding: .45em .8em; box-sizing: border-box; cursor: pointer; min-height: 1.6em; }
.reto-grid td button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.reto-grid td.is-found { background: var(--ok-tint) !important; box-shadow: inset 0 0 0 2px var(--ok); }
.reto-grid td.is-miss { animation: miss 400ms; }
@keyframes miss { 50% { background: var(--surface-3); } }
.reto-found { list-style: none; padding: 0; margin: 1em 0 0; display: grid; gap: .3em; counter-reset: r; }
.reto-found li { display: flex; gap: .5em; align-items: center; margin: 0; }
.reto-found .b { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--ok); color: #fff; font: 700 .75em var(--f-mono); }
.reto-found li.pend { color: var(--muted); }
.reto-found li.pend .b { background: var(--surface-3); color: var(--muted); }

/* Codificación */
.enc-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1em; }

/* ---------- 10. Pie y diálogos ----------------------------------------------- */
.deckbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none; align-items: center; gap: 1em; padding: 8px 18px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.deckbar .where { flex: 1; min-width: 0; font-size: .85em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deckbar .where b { color: var(--text); }
.deckbar .count { font: 600 .85em var(--f-mono); color: var(--text-2); }
.deckbar .bar { position: absolute; left: 0; top: -1px; height: 2px; width: var(--p, 0%); background: var(--accent); transition: width var(--t) var(--ease); }
.deckbar .hint { font-size: .78em; color: var(--muted); }

dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 1.6em 1.8em; max-width: min(92vw, 560px); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(7, 16, 35, .6); backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.4em; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: .55em 1em; align-items: center; margin: 1em 0 1.4em; }

.footer { padding: 30px 22px 60px; text-align: center; color: var(--muted); font-size: .85em; border-top: 1px solid var(--line); }
.footer img { height: 30px; width: auto; vertical-align: middle; }

/* Logo según tema */
.logo-dark { display: none; }
[data-theme='dark'] .logo-light { display: none; }
[data-theme='dark'] .logo-dark { display: inline-block; }

/* ---------- 11. Modo presentación -------------------------------------------- */
body.is-present { overflow: hidden; }
body.is-present .toc, body.is-present .footer, body.is-present .read-only { display: none !important; }
body.is-present .layout { display: block; max-width: none; }
body.is-present main#deck {
  position: fixed; top: var(--topbar-h); bottom: 52px; left: 0; right: 0; padding: 0; overflow: hidden;
  font-size: clamp(14px, min(1.22vw, 2.25vh), 32px);
}
body.is-present .section { margin: 0; }
body.is-present .slide { display: none; margin: 0; height: 100%; border-radius: 0; border: 0; box-shadow: none; padding: 2.2em clamp(1.4em, 5vw, 4.5em) 2em; overflow-y: auto; background: var(--bg); }
body.is-present .slide.is-current { display: flex; flex-direction: column; position: absolute; inset: 0; animation: slideIn 260ms var(--ease) both; }
.slide:focus { outline: none; }
body.is-present .slide.is-current > .slide-inner { margin: auto 0; width: 100%; max-width: 1640px; align-self: center; }
body.is-present .slide.hero, body.is-present .slide.brand-slide { background: var(--navy); }
body.is-present .deckbar { display: flex; }
body.is-present .tbl { font-size: .86em; }
body.is-present .slide .card, body.is-present .slide .w-panel { background: var(--surface); }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
body.is-present.is-back .slide.is-current { animation-name: slideInBack; }
@keyframes slideInBack { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
body:not(.is-present) .present-only { display: none !important; }
body:not(.is-present) .slide-inner { max-width: none; }

/* ---------- 12. Responsive ---------------------------------------------------- */
@media (min-width: 1600px) { .agenda-seg { min-width: 6.2em; } }
@media (max-width: 1599px) { .wallclock { display: none; } }
@media (max-width: 1439px) { .brand-txt { display: none; } }
@media (max-width: 1280px) {
  .agenda-seg .s-time { display: none; }
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .concept, .opener, .closing, .break, .hero > .slide-inner, .steps-ui, .fold { grid-template-columns: minmax(0, 1fr); }
  .wl { grid-template-columns: minmax(0, 1fr); }
  .wl .arrow-col { transform: rotate(90deg); }
  .hero-side { display: none; }
  .agenda-seg .s-title { display: none; }
  .agenda-seg { align-items: center; padding: 3px 4px; }
  .agenda-seg .s-top { justify-content: center; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  :root { --topbar-h: 104px; }
  .topbar { grid-template-columns: 1fr auto; grid-template-rows: 52px 44px; height: auto; padding: 0 12px; row-gap: 0; }
  .agenda { grid-column: 1 / -1; grid-row: 2; height: 36px; padding-bottom: 6px; }
  .brand-txt span { display: none; }
  .mode-toggle, .timer, .wallclock, #btn-fs, .tool-instructor { display: none !important; }
  .grid-2, .grid-3, .compare, .tipos, .bullets.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-step:not(:last-child)::after { content: '↓'; right: 50%; top: auto; bottom: -.9em; transform: translateX(50%); }
  .flow-step.is-active::before { top: -.9em; }
  h1, .hero h1 { font-size: 2.2em; }
  h2, .opener h2 { font-size: 1.6em; }
  .opener-num { font-size: 5em; }
  .fija-text { font-size: 1.35em; }
  .error-card { grid-template-columns: minmax(0, 1fr); }
  .error-card img { display: none; }
  .quiz-end { grid-template-columns: minmax(0, 1fr); }
  .quiz-end img { width: 140px; }
  .hero-live { width: 70px; top: 14px; right: 14px; }
  .etl li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .etl li .grip { display: none; }
  .cd-time { font-size: 3.6em; }
  .slide { padding: 20px 16px; }
  main#deck { padding: 18px 12px 80px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* ---------- 13. Impresión ---------------------------------------------------- */
@media print {
  .topbar, .toc, .deckbar, .code-copy, .btn, .tools { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .layout { display: block; }
  .slide { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- 14. Ajustes de densidad en presentación -------------------------- */
body.is-present .tbl td { padding: .34em .8em; }
body.is-present .tbl th { padding: .45em .8em; }

/* ---------- 15. Guía del instructor ------------------------------------------ */
.ig-main { max-width: 1120px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 40px) 80px; }
.ig-head { margin-bottom: 28px; }
.ig-head img { height: 42px; width: auto; margin-bottom: 1.2em; }
.ig-sec { margin-bottom: 22px; padding: clamp(18px, 3vw, 34px); background: var(--surface); }
.ig-sec h2 { font-size: 1.6em; }
.ig-sec h3 { display: flex; align-items: center; gap: .45em; margin-top: 1.2em; font-size: 1.05em; }
.ig-sec h3 .ico { color: var(--accent-ink); }
.ig-sec ol, .ig-sec ul { padding-left: 1.3em; }
.ig-qa { display: grid; gap: .5em; margin: .5em 0 0; }
.ig-qa dt { font-weight: 650; }
.ig-qa dt::before { content: 'P: '; color: var(--accent-ink); font-family: var(--f-mono); }
.ig-qa dd { margin: 0 0 .5em; padding-left: 1.6em; color: var(--text-2); }
.ig-qa dd::before { content: 'R: '; color: var(--ok); font-family: var(--f-mono); margin-left: -1.6em; display: inline-block; width: 1.6em; }
.ig-fija { display: flex; gap: .6em; align-items: flex-start; margin-top: 1.2em; padding: .8em 1em; border-radius: 12px; background: var(--accent-tint); box-shadow: inset 4px 0 0 var(--accent); }
.ig-fija .ico { color: var(--accent-ink); margin-top: .2em; }
.ig-check { list-style: none; padding: 0 !important; display: grid; gap: .5em; }
.ig-check label { display: flex; gap: .6em; align-items: flex-start; cursor: pointer; }
.ig-check input { width: 1.1em; height: 1.1em; margin-top: .25em; accent-color: var(--accent); }
.ig-slides { columns: 2; column-gap: 2em; font-size: .92em; }
.ig details { margin-top: 1.2em; }
.ig summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
@media (max-width: 760px) { .ig-slides { columns: 1; } }
@media print {
  .ig { background: #fff; }
  .ig .ig-sec { break-inside: auto; border: 1px solid #ccc; box-shadow: none; }
  .ig details > *:not(summary) { display: block; }
  .ig .logo-dark { display: none !important; }
  .ig .logo-light { display: inline-block !important; }
  :root, [data-theme='dark'] { --surface: #fff; --surface-2: #fafafa; --surface-3: #f2f2f2; --text: #000; --text-2: #222; --muted: #555; --line: #ccc; --accent-ink: #7A4F00; --ok: #00813A; --bad: #B42318; }
}

/* ---------- 16. Presentador ---------------------------------------------------- */
.presenter { display: grid; grid-template-columns: minmax(180px, 20em) minmax(0, 1fr); gap: 2.4em; align-items: center; max-width: 1400px; }
.presenter-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: #fff; border: 6px solid var(--surface); box-shadow: 0 0 0 4px var(--accent), var(--shadow-lg); }
.presenter h2 { font-size: 2.8em; margin-bottom: .15em; }
.presenter-rol { font: 600 1.15em var(--f-display); color: var(--accent-ink); margin-bottom: 1em; }
.presenter-datos { margin-top: 1.4em; }
.presenter-datos .card b { display: block; font: 700 1.5em var(--f-display); letter-spacing: -.02em; }
.presenter-datos .card span { color: var(--muted); font-size: .92em; }
.presenter-links { list-style: none; padding: 0; margin: 1.4em 0 0; display: flex; flex-wrap: wrap; gap: .6em; }
.presenter-links li { margin: 0; }
.presenter-links a { display: inline-flex; align-items: center; gap: .55em; padding: .4em .9em .4em .4em; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .92em; transition: border-color var(--t), background var(--t); }
.presenter-links a:hover { border-color: var(--accent); background: var(--accent-tint); }
.presenter-links img { width: 26px; height: 26px; border-radius: 50%; background: #fff; padding: 2px; }
.presenter-links .pl-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.presenter-links .pl-ico .ico { width: 15px; height: 15px; }
.presenter-links b { font-weight: 650; margin-right: .2em; }
@media (max-width: 760px) {
  .presenter { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .presenter-photo { width: 160px; }
  .presenter h2 { font-size: 2em; }
}
