html, body { width: 100%; height: 100%; overflow: hidden; }
body { display: grid; grid-template-rows: 65px minmax(0, 1fr) 58px; }
.deck-header, .deck-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 16px; }
.deck-header { border-bottom: 1px solid var(--line); }
.deck-tools { display: flex; gap: 8px; align-items: center; }
.deck-tools button { border: 1px solid transparent; padding: 8px 12px; background: none; font-size: 12px; border-radius: 3px; }
.deck-tools button:hover { border-color: var(--line); }
.deck-tools .theme-toggle { display: inline-grid; width: 34px; height: 34px; padding: 0; border-color: var(--line); border-radius: 50%; background: var(--panel); font-size: 16px; }
.deck-tools .theme-toggle:hover { border-color: var(--accent); }
.preview-badge { color: var(--accent); font-size: 9px; letter-spacing: .1em; }
#viewport { min-height: 0; min-width: 0; position: relative; overflow: hidden; }
#stage { width: 1280px; height: 720px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(var(--stage-scale, .8)); transform-origin: center; }
.deck-mode .slide-scene { width: 100%; height: 100%; overflow: hidden; border: 1px solid var(--line); }
.deck-mode [data-step][data-visible="false"] { visibility: hidden; pointer-events: none; }
/* True fullscreen: no header, footer or margins; the slide fills the screen (keyboard/clicker still work). */

/* html.kiosk = browser fullscreen (F11): same look, and it survives switching to the ReadZen tab and back. */
html:fullscreen .deck-header, html:fullscreen .deck-footer, html:fullscreen .deck-progress,
html.kiosk .deck-header, html.kiosk .deck-footer, html.kiosk .deck-progress { display: none; }
html:fullscreen #viewport, html.kiosk #viewport { position: fixed; inset: 0; z-index: 5; background: #000; }
html:fullscreen .deck-mode .slide-scene, html.kiosk .deck-mode .slide-scene { border: 0; }

/* Presenter-only cue: "you can switch to ReadZen here". Small, bottom-left, never on the reading view. */
#demo-cue { position: fixed; left: 14px; bottom: 64px; z-index: 50; display: flex; align-items: center; gap: 8px; max-width: min(520px, 60vw);
  padding: 6px 12px 6px 6px; border: 0; border-radius: 999px; background: rgba(20, 16, 10, .78); color: #f6ead0;
  font: 700 12px system-ui, sans-serif; box-shadow: 0 2px 10px rgba(0,0,0,.25); cursor: pointer; opacity: .55; transition: opacity .2s; }
#demo-cue:hover, #demo-cue:focus-visible, #demo-cue.is-fresh { opacity: 1; }
#demo-cue kbd { padding: 2px 7px; border-radius: 999px; background: #e0a93a; color: #1b1407; font: 800 12px system-ui, sans-serif; }
#demo-cue small { color: #cdb98f; font-weight: 600; }
#demo-cue[hidden] { display: none; }
#demo-cue ol { display: none; }
#demo-cue:hover ol, #demo-cue:focus-visible ol { display: block; position: absolute; left: 0; bottom: calc(100% + 6px); margin: 0; padding: 10px 14px 10px 30px;
  border-radius: 10px; background: rgba(20, 16, 10, .92); font-weight: 600; line-height: 1.5; white-space: nowrap; text-align: left; }
html:fullscreen #demo-cue, html.kiosk #demo-cue { bottom: 14px; }
.deck-footer { border-top: 1px solid var(--line); font-size: 12px; }
.slide-position { display: flex; gap: 16px; align-items: center; }
#slide-counter { font-family: var(--mono); color: var(--accent); }
.divider { color: var(--line); }
.navigation { display: flex; align-items: center; gap: 16px; }
.navigation button { width: 40px; height: 34px; border: 1px solid var(--line); background: transparent; border-radius: 3px; font-size: 19px; }
#step-counter { min-width: 90px; text-align: center; color: var(--muted); font-size: 11px; }
.deck-progress { position: fixed; height: 3px; bottom: 0; left: 0; width: 100%; background: var(--line); }
#progress-fill { height: 100%; background: var(--accent); width: 0; }
.loading { text-align: center; padding: 200px 40px; color: var(--muted); font-size: 25px; }
.fatal-error { position: fixed; top: 25%; left: 10%; right: 10%; padding: 32px; border: 1px solid var(--accent); background: var(--panel); line-height: 1.7; z-index: 50; }
.deck-dialog { width: min(700px, calc(100vw - 40px)); max-height: 80vh; overflow: auto; padding: 32px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.deck-dialog::backdrop { background: var(--scrim); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.dialog-heading h2 { font: 400 32px var(--serif); letter-spacing: -.03em; }
.dialog-heading button { border: 0; background: none; font-size: 25px; }
#overview-list { list-style: none; padding: 0; }
#overview-list button { display: flex; gap: 20px; width: 100%; text-align: left; background: none; border: 1px solid var(--line); padding: 20px; margin: 10px 0; border-radius: 3px; }
#overview-list button[aria-current="true"] { border-color: var(--accent); color: var(--accent); }
#overview-list button span { font-family: var(--mono); color: var(--accent); }
.key-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; font-size: 13px; line-height: 1.5; }
.key-list dt { font-weight: 600; } .key-list dd { margin: 0; color: var(--muted); }
.deck-dialog > p { font-size: 12px; color: var(--muted); line-height: 1.7; }
@media(max-width: 650px) { .deck-header, .deck-footer { padding: 0 12px; } .wordmark { font-size: 23px; } .wordmark small, .wordmark i, #slide-label, .divider { display: none; } .deck-tools { gap: 0; } .deck-tools button { padding: 8px; } .slide-position { gap: 6px; } .navigation { gap: 8px; } .preview-badge { display: none; } }

/* Self-guided answer panel (core/answer.js): docked in the slide, sized in stage pixels. */
.ans-panel { position: absolute; right: 28px; bottom: 26px; z-index: 25; display: grid; gap: 10px; width: 360px; max-height: 640px; overflow: auto; padding: 16px 18px 14px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--panel-strong) 96%, transparent); box-shadow: 0 14px 40px var(--shadow); font: 400 15px/1.45 var(--sans); color: var(--ink); }
.ans-title { margin: 0; color: var(--accent); font: 700 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.ans-note { margin: 0; color: var(--muted); font-size: 14px; }
.ans-body { display: grid; gap: 8px; }
.ans-choices { grid-template-columns: 1fr; }
.ans-choice { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); font: 600 15px/1.35 var(--sans); text-align: left; cursor: pointer; }
.ans-choice small { color: var(--muted); font-weight: 400; font-size: 13px; }
.ans-choice:hover:not(:disabled), .ans-choice:focus-visible { border-color: var(--accent); background: var(--accent-wash); }
.ans-choice:disabled { cursor: default; opacity: .62; }
.ans-choice.is-picked { opacity: 1; border-color: var(--accent); background: var(--accent-wash); }
.ans-choice.is-right { opacity: 1; border-color: var(--green); background: color-mix(in srgb, var(--green) 16%, var(--panel)); }
.ans-choice.is-wrong { opacity: 1; border-color: var(--accent); text-decoration: line-through; text-decoration-color: var(--accent); }
.ans-form { display: grid; gap: 8px; }
.ans-form input, .ans-form textarea { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: 400 15px/1.4 var(--sans); resize: vertical; }
.ans-send { justify-self: start; padding: 8px 16px; border: 0; border-radius: 8px; background: var(--ink); color: var(--paper); font: 700 14px var(--sans); cursor: pointer; }
.ans-send:disabled { opacity: .5; cursor: default; }
.ans-status { margin: 0; min-height: 0; color: var(--green); font-weight: 700; font-size: 14px; }
.ans-status:empty { display: none; }
.ans-actions { display: flex; justify-content: flex-end; }
.ans-skip { padding: 4px 2px; border: 0; background: none; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); }
.ans-skip:hover, .ans-skip:focus-visible { color: var(--ink); }
.ans-panel :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tap-a-character lookup (core/lookup.js) inside panels. */
.lk-reader { display: grid; gap: 6px; }
.lk-line { display: flex; flex-wrap: wrap; align-items: baseline; margin: 0; font: 500 24px/1.3 var(--serif); }
.lk-char { padding: 1px 2px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.lk-char:hover, .lk-char.on { background: color-mix(in srgb, var(--gold) 28%, transparent); }
.lk-tip { margin: 0; color: var(--muted); font-size: 12px; }
.lk-card { display: grid; gap: 6px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line)); border-radius: 8px; background: var(--paper); font-size: 13px; }
.lk-card p { margin: 2px 0 0; }
.lk-py { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.lk-zen { color: var(--accent); }

/* Lexicographer rounds, solo: the panel takes the guesses column; hints are a numbered list. */
.ans-panel.lex-panel { top: 34px; bottom: auto; right: 72px; width: 350px; max-height: 560px; }
html.solo .lex-side { visibility: hidden; }
.lex-hints { display: grid; gap: 6px; margin: 0 0 4px; padding: 0 0 0 20px; font-size: 14px; }
.lex-hints:empty { display: none; }
.lex-hints li::marker { color: var(--gold); font-weight: 700; }

/* A bare Skip link, centred above the footer (exercises that happen outside the slide). */
.ans-panel.ans-mini { left: 50%; right: auto; bottom: 18px; width: auto; padding: 4px 14px; transform: translateX(-50%); border: 0; box-shadow: none; background: transparent; }
.ans-panel.ans-mini .ans-skip { font-size: 15px; }
