/* Reusable talk components. Each one works without JS unless noted. */

/* Bullets with subtitles */
.bullets { list-style: none; display: grid; gap: 1.25rem; }
.bullets li { position: relative; padding-left: 1.6rem; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 0.55rem; height: 0.55rem; border-radius: 2px; background: var(--verify); }
.bullets .human::before { background: var(--human-text); }
.bullets strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05em; }

/* Timeline: date on the left, entry in a card */
.timeline { list-style: none; display: grid; gap: 1.25rem; }
.timeline > li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.timeline .when { font-family: var(--font-display); font-weight: 600; color: var(--muted); padding-top: 1.5rem; }
.timeline > li:first-child .when { color: var(--human-text); }
.timeline .what { background: var(--ink-1); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.4rem 1.6rem; }
.demo-main .timeline .what { background: var(--ink-2); }
.timeline .what h3 { margin-bottom: 0.2rem; }
.timeline .where { color: var(--muted); margin: 0 0 0.8rem; }
.timeline .what ul { list-style: none; display: grid; gap: 0.4rem; }
.timeline .what li { display: block; padding: 0 0 0 1.1rem; position: relative; }
.timeline .what li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 0.5rem; height: 1px; background: var(--muted); }
@media (max-width: 640px) {
  .timeline > li { grid-template-columns: 1fr; gap: 0.5rem; }
  .timeline .when { padding-top: 0; }
}

/* Data tree (details/summary) */
.tree, .tree ul { list-style: none; }
.tree ul { margin-left: 0.55rem; padding-left: 1.4rem; border-left: 1px solid var(--line); }
.tree li { position: relative; padding-block: 0.25rem; }
.tree ul > li::before { content: ""; position: absolute; left: -1.4rem; top: 1.15rem; width: 1rem; height: 1px; background: var(--line); }
.tree summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 0.6rem; font-family: var(--font-display); font-weight: 600; color: var(--text); padding: 0.2rem 0; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: "+"; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border: 1px solid var(--verify); color: var(--verify); border-radius: 4px; font-size: 0.9rem; line-height: 1; flex: none; }
.tree details[open] > summary::before { content: "\2212"; }
.tree .leaf b { font-weight: 600; }
.tree .leaf span { color: var(--muted); }
.tree-actions { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.tree-actions button { min-height: 40px; padding: 0 1rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 500 0.9rem var(--font-display); cursor: pointer; }
.tree-actions button:hover { border-color: var(--muted); }

/* Carousel (JS) */
.carousel { position: relative; }
.carousel-track { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 min(80%, 300px); scroll-snap-align: start; margin: 0; }
.slide img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius-m); border: 1px solid var(--line); }
.carousel--full .slide { flex-basis: 100%; }
.slide--text { padding: clamp(1.5rem, 4vw, 2.5rem); background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-m); min-height: 12rem; display: flex; flex-direction: column; justify-content: center; }
.slide--text p { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); line-height: 1.2; margin: 0; max-width: 24ch; }
.carousel-ui { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.carousel-ui .dots { display: flex; gap: 0.5rem; margin-inline: 0.6rem; }
.carousel-ui .dot { width: 28px; height: 4px; border: 0; padding: 0; background: var(--line); cursor: pointer; border-radius: 2px; }
.carousel-ui .dot[aria-current="true"] { background: var(--human); }
.carousel-ui .dot:focus-visible { outline-offset: 6px; }

/* Tabs (JS) */
.tabs [role="tablist"] { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--line); }
.tabs [role="tab"] { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: 600 1rem var(--font-display); padding: 0.8rem 1.2rem; cursor: pointer; margin-bottom: -1px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--human); }
.tabs [role="tabpanel"] { padding-top: 1.5rem; }

/* Q&A accordion */
.qa details { border-top: 1px solid var(--line); }
.qa details:last-child { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--human-text); font-size: 1.4em; line-height: 1; transition: transform 0.3s var(--ease); }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa .answer { padding-bottom: 1.3rem; color: var(--muted); }

/* Flow of steps: a true sequence, so numbered */
.flow { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.flow li { counter-increment: step; position: relative; padding: 0.4rem 1rem 0.4rem 0; }
.flow li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--verify); color: var(--verify); font: 600 0.9rem var(--font-display); margin-bottom: 0.8rem; background: var(--ink-1); position: relative; z-index: 1; }
.flow li::after { content: ""; position: absolute; top: 1.4rem; left: 2rem; right: 0; height: 1px; background: var(--line); }
.flow li:last-child::after { display: none; }
.flow li:last-child::before { border-color: var(--human); color: var(--human-text); }
.flow strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.flow span { color: var(--muted); font-size: var(--step--1); display: block; max-width: 18ch; }

/* Figures */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.5rem 2.5rem; }
.figure b { display: block; font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 1.6rem + 2.6vw, 3.6rem); line-height: 1; letter-spacing: -0.03em; color: var(--human-text); }
.figure span { color: var(--muted); display: block; margin-top: 0.5rem; max-width: 22ch; font-size: var(--step--1); }

/* Comparison table */
.compare { width: 100%; border-collapse: collapse; }
.compare th, .compare td { text-align: left; padding: 0.9rem 1rem 0.9rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-family: var(--font-display); font-weight: 600; border-bottom: 2px solid var(--human); }
.compare tbody th { font-weight: 600; color: var(--muted); }
.table-scroll { overflow-x: auto; }

/* Quote and pilot callout */
.quote { margin: 0; padding-left: 1.4rem; border-left: 3px solid var(--human); }
.quote p { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); line-height: 1.2; max-width: 26ch; }
.quote cite { color: var(--muted); font-style: normal; }
.callout { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.2rem 1.4rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-m); }
.callout svg { width: 26px; height: 26px; fill: none; stroke: var(--verify); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-top: 0.1rem; }
.callout p { margin: 0; }
.callout strong { font-family: var(--font-display); font-weight: 600; }

/* Code */
.codeblock, .code pre { margin: 0; padding: 1.2rem 1.4rem; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-s); overflow-x: auto; font: 400 0.88rem / 1.6 var(--font-code); }
.code { margin-top: 1.5rem; }
.code summary { cursor: pointer; font-family: var(--font-display); font-weight: 500; padding: 0.5rem 0; color: var(--muted); }
.code summary:hover { color: var(--text); }

/* Themes. Set data-palette and data-style on a section or on <main>; every component inside follows.
   Default palette: Escenario (stage red). Default style: Vidrio (glass). */
:root { --c-surface: var(--ink-2); --c-border: var(--line); --c-radius: var(--radius-s); }
[data-palette="oceano"] { --human: #1a6fbf; --human-ink: #ffffff; --human-text: #6cb8ff; --verify: #6fd3c3; }
[data-palette="bosque"] { --human: #23784a; --human-ink: #ffffff; --human-text: #6fd49a; --verify: #c9b46c; }
[data-palette="ambar"] { --human: #f0a020; --human-ink: #1a1206; --human-text: #ffc061; --verify: #8fa6cf; }
[data-palette="contraste"] { --ink-1: #000; --ink-2: #121212; --line: #9a9a9a; --text: #fff; --muted: #e6e6e6; --human: #ffd400; --human-ink: #000; --human-text: #ffd400; --verify: #7fdbff; --glass: #000; --glass-hover: #121212; }
:root[data-theme="light"] [data-palette="oceano"] { --human: #0b5c9e; --human-text: #0b5c9e; --verify: #1f6f66; }
:root[data-theme="light"] [data-palette="bosque"] { --human: #1d6b40; --human-text: #1d6b40; --verify: #6b5a1c; }
:root[data-theme="light"] [data-palette="ambar"] { --human: #9a5a00; --human-ink: #ffffff; --human-text: #8a4f00; --verify: #3d5a8c; }
:root[data-theme="light"] [data-palette="contraste"] { --ink-1: #fff; --ink-2: #f2f2f2; --line: #555; --text: #000; --muted: #222; --human: #002fa7; --human-ink: #fff; --human-text: #002fa7; --verify: #005a3c; --glass: #fff; --glass-hover: #f2f2f2; }
[data-style="plano"] { --c-border: transparent; --c-radius: 6px; }
[data-style="contorno"] { --c-surface: transparent; --c-border: var(--human); }
[data-style="plano"] .demo-main { background: var(--ink-1); backdrop-filter: none; -webkit-backdrop-filter: none; border-color: transparent; border-radius: 6px; }
[data-style="contorno"] .demo-main { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border: 1.5px solid var(--human); }
[data-style="plano"] :is(.timeline .what, .callout) { background: var(--ink-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-style="contorno"] :is(.timeline .what, .callout) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
:is(.timeline .what, .slide--text, .callout, .codeblock, .code pre) { border-color: var(--c-border); }
[data-style] :is(.slide--text, .codeblock, .code pre) { background: var(--c-surface); border-radius: var(--c-radius); }
[data-style] :is(.timeline .what, .callout) { border-radius: var(--c-radius); }
[data-style="contorno"] :is(.timeline .what, .slide--text, .callout, .codeblock, .code pre) { border-width: 1.5px; }

/* Theme picker on the Componentes page */
.theme-picker { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin-top: 2rem; align-items: flex-end; }
.theme-picker fieldset { border: 0; padding: 0; margin: 0; }
.theme-picker legend { font: 600 var(--step--1) var(--font-display); color: var(--muted); margin-bottom: 0.5rem; }
.theme-picker .opts { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.theme-picker button { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0 0.95rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: 999px; font: 500 0.9rem var(--font-display); cursor: pointer; }
.theme-picker button[aria-pressed="true"] { border-color: var(--human); background: var(--human); color: var(--human-ink); }
.theme-picker .sw { width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.4); }
.sw--escenario { background: #d1263a; } .sw--oceano { background: #1a6fbf; } .sw--bosque { background: #23784a; } .sw--ambar { background: #f0a020; } .sw--contraste { background: #ffd400; }
.theme-code { flex-basis: 100%; margin: 0; font: 400 0.85rem var(--font-code); color: var(--muted); }

/* Shared controls for step-driven components */
.c-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.c-controls button { min-height: 40px; padding: 0 1rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 500 0.9rem var(--font-display); cursor: pointer; }
.c-controls button:hover:not(:disabled) { border-color: var(--muted); }
.c-controls button:disabled { opacity: 0.45; cursor: default; }
.c-controls .c-status { color: var(--muted); font-size: var(--step--1); margin-left: auto; }

/* Before and after (JS adds the range slider; without JS both panes stack) */
.ba { display: grid; gap: 0.75rem; }
.ba-pane { padding: 1.4rem 1.5rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--c-radius); }
.ba-pane p { margin: 0.6rem 0 0; font-family: var(--font-display); font-weight: 500; font-size: var(--step-1); line-height: 1.35; max-width: 40ch; }
.ba-tag { font: 600 var(--step--1) var(--font-display); color: var(--muted); }
.ba-after .ba-tag { color: var(--human-text); }
.ba--ready { grid-template-areas: "stack"; gap: 0; }
.ba--ready .ba-pane { grid-area: stack; min-height: 9rem; }
.ba--ready .ba-before { background: var(--ink-2); }
.ba--ready .ba-after { background: var(--ink-1); clip-path: inset(0 0 0 var(--pos, 50%)); border-color: var(--human); }
.ba-range { width: 100%; margin-top: 1rem; accent-color: var(--human); }

/* Prompt and answer */
.chat { list-style: none; display: grid; gap: 0.75rem; }
.msg { max-width: 85%; padding: 0.9rem 1.1rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); }
.msg b { display: block; font: 600 var(--step--1) var(--font-display); color: var(--muted); margin-bottom: 0.2rem; }
.msg--user { justify-self: end; border-color: var(--human); }
.msg--user b { color: var(--human-text); }
.msg.is-new { animation: msg-in 0.35s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }

/* Terminal replay */
.term { font: 400 0.9rem / 1.7 var(--font-code); background: #0b0809; color: #e9e1dd; border: 1px solid var(--c-border); border-radius: var(--c-radius); padding: 1.1rem 1.3rem; min-height: 11rem; overflow-x: auto; }
:root[data-theme="light"] .term { background: #1d1417; }
.term-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-line[data-type="cmd"]::before { content: "$ "; color: #ff8a97; }
.term-line[data-type="out"] { color: #b9acac; }
.term-caret { display: inline-block; width: 0.55em; height: 1.05em; vertical-align: text-bottom; background: currentColor; margin-left: 1px; }

/* Annotated code */
.acode pre { margin: 0; padding: 1.1rem 1.3rem; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--c-radius); overflow-x: auto; font: 400 0.9rem / 1.7 var(--font-code); counter-reset: ln; }
.acode [data-line] { display: inline-block; width: 100%; box-sizing: border-box; padding-left: 0.6rem; border-left: 3px solid transparent; transition: opacity 0.25s, border-color 0.25s, background 0.25s; }
.acode [data-line]::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 1.6rem; color: var(--muted); }
.acode--ready [data-line] { opacity: 0.4; }
.acode--ready [data-line].is-on { opacity: 1; border-left-color: var(--human); background: color-mix(in srgb, var(--human) 14%, transparent); }
.acode-notes { margin: 1rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; color: var(--muted); }
.acode--ready .acode-notes { list-style: none; padding: 0; }
.acode--ready .acode-notes li { display: none; color: var(--text); font-family: var(--font-display); font-weight: 500; }
.acode--ready .acode-notes li.is-on { display: block; }

@media (prefers-reduced-motion: reduce) {
  .msg.is-new { animation: none; }
  .acode [data-line] { transition: none; }
}

/* Context window: a bar that fills piece by piece (JS); without JS the list shows each piece and its tokens */
.ctx-items { list-style: none; display: grid; gap: 0.4rem; }
.ctx-items li { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.8rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); }
.ctx-items li::after { margin-left: auto; content: attr(data-tokens) " tokens"; color: var(--muted); font: 400 0.85rem var(--font-code); }
.ctx-items li[hidden] { display: none; }
.ctx-items li i { width: 0.75rem; height: 0.75rem; border-radius: 3px; flex: none; }
.ctx-bar { position: relative; display: flex; height: 2.4rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: var(--c-radius); overflow: hidden; background: var(--ink-2); }
.ctx-bar span { height: 100%; transition: width 0.5s var(--ease); }
.ctx-bar.is-over { border-color: var(--human); }
.ctx-bar.is-over::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--human) 30%, transparent) 8px 16px); }
.ctx-c0 { background: var(--verify); } .ctx-c1 { background: color-mix(in srgb, var(--verify) 55%, var(--ink-3)); } .ctx-c2 { background: var(--human); } .ctx-c3 { background: var(--human-text); } .ctx-c4 { background: var(--muted); }
.ctx .c-status.is-over { color: var(--human-text); font-weight: 600; }

/* Reveal on click */
.reveal > li.is-new { animation: msg-in 0.35s var(--ease); }

/* Quiz */
.quiz-q { font: 600 var(--step-1) / 1.3 var(--font-display); margin: 0 0 1rem; max-width: 36ch; }
.quiz-opts { list-style: none; display: grid; gap: 0.5rem; }
.quiz-opts button { width: 100%; text-align: left; min-height: 48px; padding: 0.7rem 1rem; background: var(--c-surface); color: var(--text); border: 1px solid var(--c-border); border-radius: var(--c-radius); font: 500 1rem var(--font-body); cursor: pointer; }
.quiz-opts button:hover:not(:disabled) { border-color: var(--muted); }
.quiz-opts button[aria-pressed="true"] { border-color: var(--human); }
.quiz-opts button.is-right { border-color: var(--verify); box-shadow: inset 4px 0 0 var(--verify); }
.quiz-opts button.is-wrong { box-shadow: inset 4px 0 0 var(--human); }
.quiz-fb { min-height: 1.6em; margin: 1rem 0 0; font-family: var(--font-display); font-weight: 500; }

/* Flip cards */
.flips { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; }
.flip { position: relative; display: block; width: 100%; min-height: 11rem; padding: 0; border: 0; background: none; color: var(--text); cursor: pointer; perspective: 900px; text-align: left; }
.flip-face { position: absolute; inset: 0; display: flex; align-items: center; padding: 1.1rem 1.2rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform 0.55s var(--ease); }
.flip-front { font: 600 var(--step-1) / 1.2 var(--font-display); }
.flip-back { transform: rotateY(180deg); font-size: var(--step--1); border-color: var(--human); }
.flip[aria-pressed="true"] .flip-front { transform: rotateY(-180deg); }
.flip[aria-pressed="true"] .flip-back { transform: rotateY(0); }

@media (prefers-reduced-motion: reduce) {
  .ctx-bar span, .reveal > li.is-new { transition: none; animation: none; }
  .flip-face { transition: none; }
  .flip-back { transform: none; opacity: 0; }
  .flip[aria-pressed="true"] .flip-front { transform: none; opacity: 0; }
  .flip[aria-pressed="true"] .flip-back { opacity: 1; }
}

/* Exercise timer */
.timer-label { margin: 0 0 0.6rem; color: var(--muted); }
.timer-clock { display: block; font: 600 clamp(3.2rem, 2rem + 5vw, 5.5rem) / 1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.timer-clock.is-low { color: var(--human-text); }
.timer-track { height: 6px; margin-top: 1rem; background: var(--ink-3); border-radius: 3px; overflow: hidden; }
.timer-track span { display: block; height: 100%; background: var(--human); transition: width 1s linear; }

/* Data classifier */
.classify { display: grid; gap: 0.75rem; }
.classify-item { padding: 0.9rem 1.1rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); font: 600 1.05rem var(--font-display); }
.classify-opts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.classify-opts button { min-height: 38px; padding: 0 0.9rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: 999px; font: 500 0.88rem var(--font-body); cursor: pointer; }
.classify-opts button[aria-pressed="true"][data-v="publico"] { border-color: var(--verify); background: color-mix(in srgb, var(--verify) 22%, transparent); }
.classify-opts button[aria-pressed="true"][data-v="interno"] { border-color: var(--muted); background: color-mix(in srgb, var(--muted) 22%, transparent); }
.classify-opts button[aria-pressed="true"][data-v="confidencial"] { border-color: var(--human); background: color-mix(in srgb, var(--human) 25%, transparent); }
.classify-fb { margin: 0.6rem 0 0; font: 400 var(--step--1) var(--font-body); color: var(--muted); }
.classify-fb.is-wrong { color: var(--human-text); }

/* Agent orchestration */
.orch svg { display: block; width: 100%; height: auto; max-width: 520px; margin-inline: auto; }
.orch-link { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 3 4; }
.orch-node rect { fill: var(--ink-2); stroke: var(--line); stroke-width: 1.5; transition: stroke 0.4s, fill 0.4s; }
.orch-node text { fill: var(--text); font: 600 15px var(--font-display); }
.orch-node .sub { fill: var(--muted); font: 400 11.5px var(--font-body); }
.orch-node, .orch-link { opacity: 0.45; }
.orch-node { transition: opacity 0.4s; }
.orch-link { transition: opacity 0.4s, stroke 0.4s; }
.orch .is-on { opacity: 1; }
.orch .orch-node.is-on rect { stroke: var(--human); }
.orch .orch-link.is-on { stroke: var(--human); stroke-dasharray: none; }
.orch .orch-node.is-done rect { stroke: var(--verify); }
.orch-steps { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--muted); display: grid; gap: 0.3rem; }
.orch--ready .orch-steps { list-style: none; padding: 0; }
.orch--ready .orch-steps li { display: none; color: var(--text); font-family: var(--font-display); font-weight: 500; }
.orch--ready .orch-steps li.is-on { display: block; }

/* Agenda with progress */
.agenda { list-style: none; counter-reset: ag; display: grid; gap: 0.5rem; }
.agenda li { counter-increment: ag; display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 0.9rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); color: var(--muted); }
.agenda li::before { content: counter(ag); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; flex: none; border-radius: 50%; border: 1px solid var(--line); font: 600 0.85rem var(--font-display); }
.agenda li.is-done { color: var(--text); }
.agenda li.is-done::before { content: "\2713"; border-color: var(--verify); color: var(--verify); }
.agenda li.is-now { color: var(--text); border-color: var(--human); font-family: var(--font-display); font-weight: 600; }
.agenda li.is-now::before { border-color: var(--human); background: var(--human); color: var(--human-ink); }
.agenda-track { height: 4px; margin-top: 1rem; background: var(--ink-3); border-radius: 2px; overflow: hidden; }
.agenda-track span { display: block; height: 100%; background: var(--human); transition: width 0.4s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .timer-track span, .orch-link, .orch-node, .orch-node rect, .agenda-track span { transition: none; }
}

/* Decision tree */
.decide { display: grid; gap: 0.75rem; }
.decide-node { padding: 1.1rem 1.2rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); }
.decide-node p { margin: 0 0 0.8rem; font: 600 var(--step-1) / 1.3 var(--font-display); max-width: 34ch; }
.decide-node button { min-height: 44px; min-width: 5rem; margin-right: 0.4rem; padding: 0 1.1rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 600 0.95rem var(--font-display); cursor: pointer; }
.decide-node button:hover { border-color: var(--human); }
.decide-result { border-color: var(--human); }
.decide-result p { margin: 0; }
.decide--ready .decide-node { display: none; }
.decide--ready .decide-node.is-on { display: block; animation: msg-in 0.3s var(--ease); }
.decide-path { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 0.5rem; margin: 0 0 0.8rem; padding: 0; color: var(--muted); font-size: var(--step--1); }
.decide-path li + li::before { content: "\203A"; margin-right: 0.5rem; }

/* Next word and temperature */
.temp-prompt { margin: 0 0 1rem; font: 600 var(--step-2) / 1.2 var(--font-display); }
.temp-blank { color: var(--human-text); }
.temp-words { list-style: none; display: grid; gap: 0.5rem; }
.temp-words li { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 3.5rem; align-items: center; gap: 0.75rem; font-family: var(--font-display); font-weight: 500; }
.temp-words li::after { content: attr(data-pct); text-align: right; white-space: nowrap; font: 400 0.9rem var(--font-code); color: var(--muted); }
.temp-bar { height: 0.8rem; border-radius: 4px; background: var(--ink-3); overflow: hidden; }
.temp-bar span { display: block; height: 100%; background: var(--human); transition: width 0.3s var(--ease); }
.temp-words li.is-picked { color: var(--human-text); }
.temp-range { display: grid; grid-template-columns: auto minmax(0, 1fr) 3rem; align-items: center; gap: 0.75rem; margin-top: 1.2rem; font-size: var(--step--1); color: var(--muted); }
.temp-range input { accent-color: var(--human); }
.temp-range output { font: 600 1rem var(--font-code); color: var(--text); text-align: right; }
.temp-note { margin: 1rem 0 0; font-size: var(--step--1); color: var(--muted); max-width: 52ch; }
@media (max-width: 520px) { .temp-words li { grid-template-columns: 5rem minmax(0, 1fr) 3.9rem; gap: 0.5rem; } }

/* Verification checklist */
.checklist { border: 0; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.checklist legend { font: 600 var(--step-1) var(--font-display); margin-bottom: 0.8rem; }
.checklist label { display: flex; align-items: center; gap: 0.75rem; min-height: 48px; padding: 0.5rem 0.9rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); cursor: pointer; }
.checklist input { width: 1.2rem; height: 1.2rem; accent-color: var(--human); flex: none; }
.checklist label:has(input:checked) { border-color: var(--verify); }
.checklist-done { margin: 0.4rem 0 0; font: 600 1rem var(--font-display); color: var(--verify); }

/* Code diff */
.diff { margin: 0; padding: 1.1rem 0; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--c-radius); overflow-x: auto; font: 400 0.9rem / 1.7 var(--font-code); }
.diff span { display: inline-block; width: 100%; padding: 0 1.3rem; box-sizing: border-box; }
.diff .add { background: color-mix(in srgb, var(--verify) 18%, transparent); }
.diff .del { background: color-mix(in srgb, var(--human) 18%, transparent); color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--human) 60%, transparent); }
.diff.is-result .del { display: none; }
.diff .mk { font-weight: 400; user-select: none; }
.diff.is-result .mk { visibility: hidden; }
.diff.is-result .add { background: none; }

@media (prefers-reduced-motion: reduce) {
  .decide--ready .decide-node.is-on { animation: none; }
  .temp-bar span { transition: none; }
}

/* Show of hands */
.vote-q, .ideas-q { display: block; margin: 0 0 1rem; font: 600 var(--step-1) / 1.3 var(--font-display); max-width: 36ch; }
.vote-opts { list-style: none; display: grid; gap: 0.6rem; }
.vote-opts li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; }
.vote-bar { height: 1.6rem; border-radius: 6px; background: var(--ink-3); overflow: hidden; position: relative; }
.vote-bar span { display: block; height: 100%; background: var(--human); transition: width 0.35s var(--ease); }
.vote-bar em { position: absolute; inset: 0 0.6rem 0 auto; display: flex; align-items: center; font: 600 0.85rem var(--font-code); font-style: normal; color: var(--text); }
.vote-btns { display: flex; gap: 0.3rem; }
.vote-btns button { width: 2.4rem; height: 2.4rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 600 1.1rem var(--font-display); cursor: pointer; }
.vote-btns button:hover { border-color: var(--human); }
@media (max-width: 520px) { .vote-opts li { grid-template-columns: 1fr auto; } .vote-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Idea board */
.ideas-form { display: flex; gap: 0.5rem; }
.ideas-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0 0.9rem; background: var(--c-surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 400 1rem var(--font-body); }
.ideas-form input:focus-visible { outline: 2px solid var(--human); outline-offset: 2px; }
.ideas-form button { min-height: 46px; padding: 0 1.1rem; background: var(--human); color: var(--human-ink); border: 0; border-radius: var(--radius-s); font: 600 0.95rem var(--font-display); cursor: pointer; }
.ideas-board { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.9rem; margin: 1.2rem 0 0; min-height: 3rem; }
.ideas-board li { font-family: var(--font-display); font-weight: 600; line-height: 1.1; color: var(--text); }
.ideas-board li.is-top { color: var(--human-text); }
.ideas-board small { font: 400 0.75rem var(--font-code); color: var(--muted); margin-left: 0.2rem; }

/* Risk matrix */
.risk-grid { display: grid; grid-template-columns: 2.6rem repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(4.5rem, auto)) 2rem; gap: 4px; }
.risk-legend { margin: 0.4rem 0 1.2rem; font-size: var(--step--1); color: var(--muted); }
.risk-cell { border-radius: 6px; padding: 0.4rem; display: flex; flex-direction: column; gap: 0.25rem; justify-content: flex-start; font-size: 0.8rem; }
.risk-cell[data-level="1"] { background: color-mix(in srgb, var(--verify) 16%, var(--ink-2)); }
.risk-cell[data-level="2"] { background: color-mix(in srgb, var(--muted) 22%, var(--ink-2)); }
.risk-cell[data-level="3"] { background: color-mix(in srgb, var(--human) 32%, var(--ink-2)); }
.risk-cell b { display: block; padding: 0.25rem 0.4rem; border-radius: 4px; background: var(--ink-1); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 520px) { .risk-cell b { font-size: 0.7rem; padding: 0.2rem 0.3rem; } }
.risk-axis { display: grid; place-items: center; font-size: 0.75rem; color: var(--muted); }
.risk-axis--y { writing-mode: vertical-rl; transform: rotate(180deg); }
.risk-items { list-style: none; display: grid; gap: 0.5rem; }
.risk-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem; align-items: center; font-weight: 500; }
.risk-items select { min-height: 38px; padding: 0 0.5rem; background: var(--c-surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 400 0.85rem var(--font-body); }
@media (max-width: 520px) { .risk-items li { grid-template-columns: 1fr 1fr; } .risk-items li > span { grid-column: 1 / -1; } }

/* Count-up figures */
[data-countup] b { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .vote-bar span { transition: none; }
}

/* Presenter tools: full screen per component, speaker notes and remote-control advance */
.presenter-help { margin-top: 2.5rem; padding: 1.4rem 1.6rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--glass); }
.presenter-help h2 { font-size: var(--step-1); }
.presenter-help h2::after { display: none; }
.presenter-help ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 2rem; margin: 1rem 0; }
.presenter-help li { color: var(--muted); font-size: var(--step--1); }
.presenter-help strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 1rem; margin-bottom: 0.2rem; }
.presenter-help p { margin: 0; }
.notes-toggle { min-height: 40px; padding: 0 1rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 500 0.9rem var(--font-display); cursor: pointer; }
.notes-toggle[aria-pressed="true"] { border-color: var(--human); }
.notes { display: block; margin-top: 1rem; padding: 0.8rem 1rem; border: 1px dashed var(--verify); border-radius: var(--radius-s); color: var(--text); font-size: var(--step--1); }
.notes[hidden] { display: none; }
.notes b { color: var(--verify); font-family: var(--font-display); margin-right: 0.3rem; }
.fs-btn { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; margin-top: 1rem; padding: 0 0.9rem; background: none; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-s); font: 500 0.88rem var(--font-display); cursor: pointer; }
.fs-btn:hover, .fs-btn:focus-visible { color: var(--text); border-color: var(--muted); }
.fs-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.demo-main:fullscreen { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 6vw, 6rem); background: var(--ink-0); border: 0; border-radius: 0; font-size: 1.35rem; overflow: auto; }
.demo-main:fullscreen > .code { display: none; }
.demo-main::backdrop { background: var(--ink-0); }
@media print { .fs-btn, .presenter-help, .notes { display: none !important; } }

/* Cover */
.cover { padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2.5rem); border-left: 4px solid var(--human); }
.cover-event { margin: 0; color: var(--muted); font-size: var(--step--1); }
.cover-title { margin: 0.6rem 0 0; font: 700 var(--step-3) / 1.02 var(--font-display); letter-spacing: -0.02em; }
.cover-sub { margin: 1rem 0 0; font-size: var(--step-1); color: var(--muted); max-width: 38ch; }
.cover-who { margin: 2rem 0 0; font-size: var(--step--1); color: var(--muted); }
.cover-who strong { display: block; font: 600 1.1rem var(--font-display); color: var(--text); }

/* Prompt anatomy */
.anatomy-prompt { margin: 0; font: 500 var(--step-1) / 1.7 var(--font-display); }
.anatomy-prompt mark { color: var(--text); padding: 0.1em 0.2em; border-radius: 4px; transition: background 0.25s, opacity 0.25s; }
.anatomy [data-c="0"] { --mk: color-mix(in srgb, var(--verify) 30%, transparent); }
.anatomy [data-c="1"] { --mk: color-mix(in srgb, var(--human) 28%, transparent); }
.anatomy [data-c="2"] { --mk: color-mix(in srgb, #c9b46c 34%, transparent); }
.anatomy [data-c="3"] { --mk: color-mix(in srgb, #6fd49a 28%, transparent); }
.anatomy [data-c="4"] { --mk: color-mix(in srgb, var(--muted) 30%, transparent); }
.anatomy-prompt mark { background: var(--mk, transparent); }
.anatomy--focus .anatomy-prompt mark:not(.is-on) { background: transparent; opacity: 0.4; }
.anatomy-legend { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; }
.anatomy-legend button { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 38px; padding: 0 0.85rem; background: none; color: var(--text); border: 1px solid var(--line); border-radius: 999px; font: 500 0.88rem var(--font-display); cursor: pointer; }
.anatomy-legend button[aria-pressed="true"] { border-color: var(--human); }
.anatomy-legend i { width: 0.75rem; height: 0.75rem; border-radius: 3px; background: var(--mk); }

/* Token calculator */
.tcalc { display: grid; gap: 0.5rem; }
.tcalc label { font: 600 var(--step--1) var(--font-display); color: var(--muted); }
.tcalc textarea, .tcalc input { width: 100%; padding: 0.7rem 0.9rem; background: var(--c-surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-s); font: 400 1rem / 1.5 var(--font-body); }
.tcalc input { max-width: 12rem; min-height: 44px; }
.tcalc textarea:focus-visible, .tcalc input:focus-visible { outline: 2px solid var(--human); outline-offset: 2px; }
.tcalc label + textarea { margin-bottom: 0.6rem; }
.tcalc-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-top: 0.8rem; }
.tcalc-out div { padding: 0.8rem 1rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); }
.tcalc-out b { display: block; font: 600 var(--step-1) / 1.2 var(--font-display); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tcalc-out span { font-size: var(--step--1); color: var(--muted); }
.tcalc-note { margin: 0.4rem 0 0; font-size: var(--step--1); color: var(--muted); }

/* Case study */
.case-study { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.case-study > div { padding: 1.1rem 1.2rem; border: 1px solid var(--c-border); border-radius: var(--c-radius); background: var(--c-surface); }
.case-study h3 { font-size: var(--step-0); color: var(--muted); margin-bottom: 0.5rem; }
.case-study p { margin: 0; }
.case-study > .case-result { border-color: var(--human); }
.case-result b { display: block; font: 600 var(--step-3) / 1 var(--font-display); color: var(--human-text); margin-bottom: 0.4rem; }
@media (max-width: 760px) { .case-study { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { .anatomy-prompt mark { transition: none; } }

/* Concept map */
.mindmap { position: relative; }
.mm-stage { position: relative; min-height: 22rem; }
.mm-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mm-stage line { stroke: var(--line); stroke-width: 2; transition: stroke 0.3s; }
.mm-stage line.is-on { stroke: var(--human); }
.mm-center, .mm-node { position: absolute; transform: translate(-50%, -50%); margin: 0; text-align: center; }
.mm-center { left: 50%; top: 50%; padding: 0.9rem 1.1rem; max-width: 11rem; border: 2px solid var(--human); border-radius: var(--c-radius); background: var(--ink-1); font: 600 1.05rem / 1.2 var(--font-display); }
.mm-node { min-height: 40px; padding: 0.4rem 0.9rem; background: var(--c-surface); color: var(--text); border: 1px solid var(--c-border); border-radius: 999px; font: 600 0.92rem var(--font-display); cursor: pointer; }
.mm-node[aria-pressed="true"] { border-color: var(--human); background: var(--human); color: var(--human-ink); }
.mm-note { min-height: 1.6em; margin: 0.8rem 0 0; font-family: var(--font-display); font-weight: 500; }
.mindmap--ready .mm-branches { display: none; }
.mm-branches { list-style: none; display: grid; gap: 0.3rem; margin-top: 1rem; }
@media (max-width: 640px) { .mm-stage { min-height: 30rem; } .mm-center { max-width: 8.5rem; font-size: 0.95rem; padding: 0.7rem 0.8rem; } .mm-node { font-size: 0.85rem; padding: 0.35rem 0.75rem; } }

/* Maturity levels: a staircase on wide screens, a list on phones */
.levels { list-style: none; counter-reset: lv; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 0.5rem; }
.levels li { counter-increment: lv; display: flex; flex-direction: column; justify-content: flex-start; gap: 0.3rem; padding: 0.9rem; border: 1px solid var(--c-border); border-radius: var(--c-radius) var(--c-radius) 4px 4px; background: var(--c-surface); color: var(--muted); font-size: var(--step--1); }
.levels li:nth-child(1) { min-height: 8rem; } .levels li:nth-child(2) { min-height: 10.5rem; } .levels li:nth-child(3) { min-height: 13rem; } .levels li:nth-child(4) { min-height: 15.5rem; }
.levels li::before { content: "Nivel " counter(lv); font: 600 0.75rem var(--font-display); color: var(--muted); }
.levels strong { color: var(--text); font: 600 1.02rem / 1.2 var(--font-display); }
.levels li.is-done { border-color: var(--verify); }
.levels li.is-now { border-color: var(--human); background: color-mix(in srgb, var(--human) 16%, var(--c-surface)); color: var(--text); }
.levels li.is-now::before { color: var(--human-text); }
@media (max-width: 640px) { .levels { grid-template-columns: 1fr; } .levels li:nth-child(n) { min-height: 0; border-radius: var(--c-radius); } }

/* Annotated screenshot */
.hs-stage { position: relative; }
.hs-stage svg { display: block; width: 100%; height: auto; }
.hs-frame { fill: var(--ink-2); stroke: var(--line); stroke-width: 1.5; }
.hs-side { fill: var(--ink-1); stroke: var(--line); stroke-width: 1.5; }
.hs-line, .hs-bubble { fill: var(--ink-3); }
.hs-bubble--ai { fill: var(--ink-1); stroke: var(--line); }
.hs-pill, .hs-input { fill: var(--ink-1); stroke: var(--line); stroke-width: 1.5; }
.hs-label { fill: var(--muted); font: 500 14px var(--font-body); }
.hs-clip { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.hs-dot { position: absolute; transform: translate(-50%, -50%); width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--human); background: var(--ink-0); color: var(--text); font: 700 0.85rem var(--font-display); cursor: pointer; }
.hs-dot[aria-pressed="true"] { background: var(--human); color: var(--human-ink); box-shadow: 0 0 0 6px color-mix(in srgb, var(--human) 30%, transparent); }
.hs-notes { margin: 1rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; color: var(--muted); }
.hotspots--ready .hs-notes { list-style: none; padding: 0; }
.hotspots--ready .hs-notes li { display: none; color: var(--text); font-family: var(--font-display); font-weight: 500; }
.hotspots--ready .hs-notes li.is-on { display: block; }

/* Closing */
.closing-big { margin: 0; font: 700 var(--step-3) / 1.05 var(--font-display); letter-spacing: -0.02em; color: var(--human-text); max-width: 16ch; }
.closing-thanks { margin: 1.5rem 0 0.5rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .mm-stage line { transition: none; } }

/* Figure colour modifiers and linked figures */
.figure--verify b { color: var(--verify); }
.figure--human b { color: var(--human-text); }
.figure--plain b { color: var(--text); }
a.figure { color: inherit; text-decoration: none; }
a.figure span { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
a.figure:hover span, a.figure:focus-visible span { text-decoration-color: currentColor; }
/* Timeline: every entry marked .is-now is current, not only the first one */
.timeline > li.is-now .when { color: var(--human-text); }
