:root {
  --ink: #0f1318; --panel: #1a2029; --panel-2: #232b36; --line: #2f3946;
  --text: #eef2f7; --muted: #9aa6b4; --blue: #5b87c7; --blue-soft: #a9c1e8;
  --ok: #4fbf8a; --warn: #e0a64e;
  --ui: "Aptos", "Segoe UI", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ink); color: var(--text); font-family: var(--ui); font-size: 16px; overflow: hidden; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--blue-soft); outline-offset: 2px; }
[hidden] { display: none !important; }
.view { height: 100%; }

/* ---------- palco (slide 1280×720 escalado) ---------- */
.stage-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; }
.stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; }
.layer { position: absolute; inset: 0; overflow: hidden; }
.layer.enter { opacity: 0; }
.layer.enter.go { opacity: 1; transition: opacity .8s ease; }
.el { position: absolute; }
.txt { display: flex; flex-direction: column; white-space: normal; overflow-wrap: break-word; line-height: 1.2; }
.txt p { margin: 0; }
.anim { opacity: 0; transform: translateY(29px); }
.anim.wipe { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); }
.anim.in { opacity: 1; transform: none; transition: opacity .6s ease-out, transform .6s cubic-bezier(.2,.7,.2,1); }
.anim.wipe.in { clip-path: inset(0 0 0 0); transition: clip-path .9s ease-in-out; }
.anim.now { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .anim, .anim.in, .layer.enter.go { transition: none !important; transform: none; } }

/* ---------- início ---------- */
#inicio { display: grid; place-items: center; overflow: auto; padding: 32px max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
.home { width: min(880px, 100%); display: grid; gap: 28px; }
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--blue-soft); font-weight: 700; }
.home h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.08; margin: 6px 0 10px; text-wrap: balance; }
.home p { color: var(--muted); max-width: 62ch; line-height: 1.5; margin: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.choice { display: grid; gap: 10px; padding: 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--blue); transform: translateY(-2px); }
.choice .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); }
.choice strong { font-size: 22px; }
.choice span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.status-line { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }

/* ---------- projetor ---------- */
#projetor { background: #000; position: relative; cursor: none; }
#projWrap { position: absolute; inset: 0; }
.proj-hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(15,19,24,.86); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-size: 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; transition: opacity .4s; white-space: nowrap; }
#projetor.idle .proj-hint { opacity: 0; pointer-events: none; }

/* ---------- controle ---------- */
#controle { display: grid; grid-template-rows: auto 1fr auto; padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); gap: 10px; }
.bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.counter { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.counter small { color: var(--muted); font-size: 16px; font-weight: 400; }
.steps-pill { font-size: 13px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--blue-soft); }
.slide-title { color: var(--muted); font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px 4px 12px; }
.timer output { font-family: ui-monospace, Consolas, monospace; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 5ch; }
.chip { border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--blue); }
.conn { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.work { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; min-height: 0; }
.left, .right { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; min-height: 0; }
.mini { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.current { border: 2px solid var(--blue); touch-action: pan-y; }
.nextbox { border: 1px solid var(--line); }
.label { position: absolute; right: 8px; top: 8px; z-index: 2; background: rgba(15,19,24,.85); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; color: var(--blue-soft); font-weight: 700; }
.nextbox .end { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; align-items: start; }
.thumb { flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: #000; padding: 0; cursor: pointer; position: relative; opacity: .6; }
.thumb .stage-wrap { pointer-events: none; }
.thumb b { position: absolute; right: 4px; bottom: 3px; font-size: 11px; background: rgba(0,0,0,.7); padding: 1px 5px; border-radius: 4px; z-index: 2; }
.thumb.on { border-color: var(--blue); opacity: 1; }
.notes { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.notes header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.notes header span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-soft); font-weight: 700; }
.notes .size { display: flex; gap: 6px; }
#notesText { overflow-y: auto; padding: 14px 16px 20px; white-space: pre-line; line-height: 1.5; font-size: var(--note-size, 19px); }
.nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; padding-bottom: env(safe-area-inset-bottom); }
.nav button { border: 0; border-radius: 12px; padding: 18px; font-size: 20px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; touch-action: manipulation; }
#prev { background: var(--panel-2); } #next { background: var(--blue); color: #fff; }
.nav button:disabled { opacity: .35; cursor: default; }
@media (max-width: 820px) {
  .work { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .right { grid-template-rows: auto auto; }
  .nextbox { display: none; }
  #notesText { max-height: 40vh; }
  .slide-title { display: none; }
}

/* ---------- PIN ---------- */
.pin { position: fixed; inset: 0; background: rgba(5,8,12,.85); display: grid; place-items: center; z-index: 50; padding: 16px; }
.pin form { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 10px; width: min(340px, 100%); }
.pin label { font-weight: 700; }
.pin input { font: inherit; font-size: 22px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); color: var(--text); letter-spacing: .2em; }
.pin small { color: var(--muted); }
