/* M.E.N.E.Z.E.S — HUD holográfico: ciano tecnológico, violeta consultando, dourado falando */
:root {
  --bg: #02060c; --c: #4fdcff; --c2: #1aa7d6; --g: #ffcd78; --v: #b084ff; --ok: #4ade80; --bad: #f87171;
  --ink: #e8f6ff; --mut: rgb(200 230 255 / .58); --line: rgb(79 220 255 / .16); --line2: rgb(79 220 255 / .32);
  --s: 79 220 255; /* cor do estado atual (RGB) */
  --hd: "Orbitron", system-ui, sans-serif; --tx: "Exo 2", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
body[data-state="off"] { --s: 120 150 170; }
body[data-state="standby"] { --s: 70 160 210; }
body[data-state="muted"] { --s: 95 140 170; }
body[data-state="connecting"] { --s: 255 190 90; }
body[data-state="thinking"] { --s: 176 132 255; }
body[data-state="speaking"] { --s: 255 205 120; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; width: 100%; max-width: 100%; overflow-x: hidden; overflow-x: clip; }
body { min-height: 100svh; background: radial-gradient(90% 70% at 50% 42%, #08192a 0%, #030b14 55%, var(--bg) 100%) fixed; color: var(--ink); font-family: var(--tx); }
button { font: inherit; color: inherit; }
::selection { background: rgb(79 220 255 / .3); }
* { scrollbar-width: thin; scrollbar-color: rgb(79 220 255 / .35) transparent; }

/* ---------- camadas de fundo ---------- */
.bg-grid, .bg-hex, #fx, .vignette, .scanlines { position: fixed; inset: 0; pointer-events: none; }
.bg-grid { opacity: .55;
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px;
  -webkit-mask: radial-gradient(75% 65% at 50% 45%, #000 15%, transparent 85%); mask: radial-gradient(75% 65% at 50% 45%, #000 15%, transparent 85%); }
.bg-hex { opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64v33M0 16l-28-16M56 16l28-16' fill='none' stroke='%234fdcff' stroke-width='.8'/%3E%3C/svg%3E");
  background-size: 56px 97px;
  -webkit-mask: radial-gradient(45% 50% at 50% 45%, #000, transparent 75%); mask: radial-gradient(45% 50% at 50% 45%, #000, transparent 75%);
  animation: hexDrift 60s linear infinite; }
@keyframes hexDrift { to { background-position: 56px 97px; } }
.vignette { background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgb(0 0 0 / .65) 100%); }
.scanlines { z-index: 1; opacity: .35; background: repeating-linear-gradient(180deg, rgb(0 0 0 / .22) 0 1px, transparent 1px 3px); }
.scanlines::after { content: ""; position: absolute; left: 0; right: 0; height: 22vh; top: -22vh;
  background: linear-gradient(180deg, transparent, rgb(var(--s) / .05) 60%, rgb(var(--s) / .12) 98%, transparent); animation: sweep 9s linear infinite; }
@keyframes sweep { to { transform: translateY(130vh); } }

/* ---------- topo ---------- */
.top { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 10px max(22px, env(safe-area-inset-left)); }
.top::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2) 15%, rgb(var(--s) / .7) 50%, var(--line2) 85%, transparent); }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-logo { position: relative; flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.brand-logo::before { content: ""; position: absolute; inset: 0; border: 1px solid rgb(255 205 120 / .45);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: radial-gradient(circle, rgb(255 205 120 / .14), transparent 70%); }
.brand-logo i { position: absolute; inset: -4px; border-radius: 50%; border: 1px solid transparent; border-top-color: rgb(255 205 120 / .7); border-bottom-color: rgb(79 220 255 / .5); animation: spin 6s linear infinite; }
.brand-logo img { position: relative; width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 0 8px rgb(255 205 120 / .6)); animation: logoPulse 3.5s ease-in-out infinite; }
@keyframes logoPulse { 50% { filter: drop-shadow(0 0 16px rgb(255 205 120 / .9)); } }
.brand-tx { min-width: 0; }
.brand-tx b { display: block; font: 700 17px var(--hd); letter-spacing: .3em; color: var(--c); text-shadow: 0 0 18px rgb(79 220 255 / .6); white-space: nowrap; }
.brand-tx small { display: block; font: 400 9.5px var(--tx); letter-spacing: .26em; text-transform: uppercase; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.state { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border: 1px solid rgb(var(--s) / .45); background: rgb(4 18 30 / .75);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  font: 600 10.5px var(--hd); letter-spacing: .22em; text-transform: uppercase; color: rgb(var(--s)); white-space: nowrap;
  box-shadow: inset 0 0 18px rgb(var(--s) / .15); transition: color .4s, border-color .4s; }
.state i { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--s)); box-shadow: 0 0 10px rgb(var(--s)); }
.state .eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.state .eq u { width: 2px; height: 30%; background: rgb(var(--s)); text-decoration: none; transition: height .3s; }
body.live .state .eq u { animation: eq 1s ease-in-out infinite; }
.state .eq u:nth-child(2) { animation-delay: -.2s !important; } .state .eq u:nth-child(3) { animation-delay: -.5s !important; }
.state .eq u:nth-child(4) { animation-delay: -.7s !important; } .state .eq u:nth-child(5) { animation-delay: -.35s !important; }
body[data-state="speaking"] .state .eq u { animation-duration: .45s; }
body[data-state="thinking"] .state .eq u { animation-duration: .3s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
body[data-state="listening"] .state i { animation: blink 1.4s infinite; }
body[data-state="speaking"] .state i { animation: blink .5s infinite; }
body[data-state="thinking"] .state i { animation: blink .25s infinite; }
body[data-state="connecting"] .state i { animation: blink .6s infinite; }
body[data-state="standby"] .state i { animation: blink 3s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

.clock { justify-self: end; display: flex; align-items: center; gap: 14px; min-width: 0; }
.clk { text-align: right; min-width: 0; }
.clk b { display: block; font: 500 21px var(--hd); letter-spacing: .12em; color: var(--ink); text-shadow: 0 0 14px rgb(79 220 255 / .35); white-space: nowrap; }
.clk small { display: block; font: 400 10px var(--tx); letter-spacing: .2em; text-transform: uppercase; color: var(--mut); white-space: nowrap; }
.sair { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line2); border-radius: 4px; background: rgb(4 18 30 / .6);
  font: 600 9.5px var(--hd); letter-spacing: .2em; text-transform: uppercase; color: var(--mut); text-decoration: none; transition: color .2s, border-color .2s, box-shadow .2s; }
.sair svg { width: 13px; height: 13px; }
.sair:hover { color: #fecaca; border-color: rgb(248 113 113 / .6); box-shadow: 0 0 16px -4px var(--bad); }

/* ---------- grade principal ---------- */
.hud { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr) minmax(260px, 380px); gap: 18px;
  padding: 14px max(22px, env(safe-area-inset-right)) 20px max(22px, env(safe-area-inset-left)); height: calc(100svh - 76px); min-height: 600px; }

/* colunas holográficas */
.col { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 6px; background: linear-gradient(180deg, rgb(7 28 46 / .86), rgb(3 11 20 / .9));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .04), inset 0 0 40px rgb(79 220 255 / .04), 0 0 30px -18px rgb(79 220 255 / .5);
  animation: colIn .9s var(--ease) both; }
.col.panels { animation-delay: .12s; }
@keyframes colIn { from { opacity: 0; transform: translateY(14px); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.col::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; --k: var(--c);
  background:
    linear-gradient(var(--k), var(--k)) top left / 18px 2px no-repeat, linear-gradient(var(--k), var(--k)) top left / 2px 18px no-repeat,
    linear-gradient(var(--k), var(--k)) top right / 18px 2px no-repeat, linear-gradient(var(--k), var(--k)) top right / 2px 18px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom left / 18px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom left / 2px 18px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom right / 18px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom right / 2px 18px no-repeat;
  opacity: .8; filter: drop-shadow(0 0 4px var(--c)); }
.col::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 80px; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent, rgb(79 220 255 / .06), transparent); animation: colScan 7s linear infinite; }
.col.panels::after { animation-delay: -3.5s; }
@keyframes colScan { from { transform: translateY(-90px); } to { transform: translateY(110vh); } }
.col h2 { position: relative; display: flex; align-items: center; gap: 9px; margin: 0; padding: 14px 16px 12px; font: 600 11px var(--hd); letter-spacing: .3em; text-transform: uppercase; color: var(--c);
  border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgb(79 220 255 / .09), transparent 70%); text-shadow: 0 0 12px rgb(79 220 255 / .5); }
.col h2 svg { width: 15px; height: 15px; flex: none; }
.col h2 small { color: var(--mut); font-family: var(--tx); letter-spacing: .1em; }
.h-led { margin-left: auto; width: 34px; height: 4px; background: repeating-linear-gradient(90deg, var(--c) 0 4px, transparent 4px 7px); opacity: .6; animation: blink 2.4s steps(2) infinite; }
.col h2::after { content: ""; position: absolute; left: 16px; bottom: -1px; width: 60px; height: 1px; background: var(--c); box-shadow: 0 0 8px var(--c); }

/* atividade */
#log { list-style: none; margin: 0; padding: 12px 10px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 7px; }
#log li { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px 9px 9px; border-radius: 4px; font-size: 12.5px; line-height: 1.42;
  background: linear-gradient(90deg, rgb(255 255 255 / .04), rgb(255 255 255 / .01)); border: 1px solid rgb(255 255 255 / .05); border-left: 2px solid var(--k, var(--mut));
  animation: logIn .45s var(--ease); --k: rgb(200 230 255 / .5); }
@keyframes logIn { from { opacity: 0; transform: translateX(-12px); filter: blur(3px); } 40% { opacity: 1; } }
#log li i { flex: none; width: 18px; height: 18px; margin-top: 1px; background: var(--k);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; filter: drop-shadow(0 0 4px var(--k));
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
#log li span { min-width: 0; overflow-wrap: anywhere; }
#log li.you { --k: #e2e8f0; }
#log li.you i { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1-4 4-6 8-6s7 2 8 6'/%3E%3C/svg%3E"); }
#log li.you span { color: #e2e8f0; }
#log li.jv { --k: var(--c); background: linear-gradient(90deg, rgb(79 220 255 / .09), rgb(79 220 255 / .01)); }
#log li.jv i { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M3 12h1M7 8v8M11 4v16M15 8v8M19 11v2'/%3E%3C/svg%3E"); }
#log li.jv span { color: #c4f1ff; }
#log li.sys span { color: var(--mut); font-size: 11.5px; }
#log li.tool { --k: var(--v); background: linear-gradient(90deg, rgb(176 132 255 / .1), rgb(176 132 255 / .01)); }
#log li.tool i { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 3a9 9 0 1 0 9 9'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
#log li.tool.run i { animation: spin .9s linear infinite; }
#log li.tool.run::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 40%; background: var(--v); box-shadow: 0 0 6px var(--v); animation: runBar 1.1s ease-in-out infinite; }
@keyframes runBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
#log li.tool.ok { --k: var(--ok); background: linear-gradient(90deg, rgb(74 222 128 / .08), rgb(74 222 128 / .01)); }
#log li.tool.ok i { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l3 3 5-6'/%3E%3C/svg%3E"); }
#log li.tool.erro { --k: var(--bad); background: linear-gradient(90deg, rgb(248 113 113 / .09), rgb(248 113 113 / .01)); }
#log li.tool.erro i { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 9l6 6M15 9l-6 6'/%3E%3C/svg%3E"); }

/* ---------- centro ---------- */
.center { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; justify-items: center; align-items: center; gap: 12px; }
/* palco: reator no centro; quando há resultado/telão, ele recua para o canto e o conteúdo se materializa */
.stage-area { --rs: 420px; --mini: 128px; position: relative; width: 100%; height: 100%; min-height: 0; align-self: stretch; }
.reactor-wrap { position: absolute; z-index: 2; left: 50%; top: 50%; width: var(--rs); aspect-ratio: 1; transform: translate(-50%, -50%);
  transition: left .8s var(--ease), top .8s var(--ease), width .8s var(--ease), transform .8s var(--ease); }
.stage-area.focus .reactor-wrap { left: 0; top: 0; width: var(--mini); transform: translate(0, 0); }
.stage-area.focus .reactor-wrap .boot, .stage-area.focus .reactor-wrap .standby-tx, .stage-area.focus .power span { opacity: 0 !important; }
.stage-area.focus .r-orbit { opacity: 0; }
.stage-area.focus #reactor { cursor: pointer; }
.stage-area.focus .tele { opacity: 0 !important; transform: scale(.9); pointer-events: none; }
.stage-area::after { content: ""; position: absolute; left: calc(var(--mini) / 2); top: calc(var(--mini) / 2); width: calc(var(--mini) / 2 + 16px); height: 1px; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--s) / 0), rgb(var(--s) / .8)); transform-origin: left; transform: scaleX(0); transition: transform .5s .5s var(--ease); }
.stage-area.focus::after { transform: scaleX(1); }
.reactor-wrap::before { content: ""; position: absolute; inset: -6%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgb(var(--s) / .13), transparent 62%); transition: background .6s; }
.r-orbit { position: absolute; inset: -5%; border-radius: 50%; pointer-events: none; opacity: .5;
  background: repeating-conic-gradient(rgb(var(--s) / .5) 0 .6deg, transparent .6deg 6deg);
  -webkit-mask: radial-gradient(closest-side, transparent 96.5%, #000 97%, #000 99%, transparent 99.5%); mask: radial-gradient(closest-side, transparent 96.5%, #000 97%, #000 99%, transparent 99.5%);
  animation: spin 80s linear infinite reverse; }
#reactor { position: relative; display: block; width: 100%; height: 100%; cursor: pointer; }
body.live #reactor { cursor: default; }

/* telemetria lateral */
.tele { position: absolute; top: 50%; translate: 0 -50%; display: flex; flex-direction: column; gap: 14px; width: 140px; font-family: var(--hd); opacity: .9; transition: opacity .6s, transform .6s; pointer-events: none; }
.tele-l { right: calc(50% + var(--rs) / 2 + 30px); align-items: flex-end; text-align: right; }
.tele-r { left: calc(50% + var(--rs) / 2 + 30px); }
.tele div { position: relative; min-width: 0; max-width: 150px; width: 100%; }
.tele small { display: block; font: 500 8.5px var(--hd); letter-spacing: .3em; text-transform: uppercase; color: var(--mut); }
.tele b { display: block; font: 500 15px var(--hd); letter-spacing: .1em; color: rgb(var(--s)); text-shadow: 0 0 10px rgb(var(--s) / .5); white-space: nowrap; transition: color .5s; }
.tbar { display: block; height: 3px; margin-top: 4px; background: rgb(var(--s) / .14); overflow: hidden; }
.tbar i { display: block; height: 100%; background: rgb(var(--s)); box-shadow: 0 0 8px rgb(var(--s)); transform: scaleX(0); transform-origin: left; transition: transform .25s linear; }
.tele-l .tbar i { transform-origin: right; }
.tele-l div::after, .tele-r div::after { content: ""; position: absolute; top: 9px; width: 18px; height: 1px; background: rgb(var(--s) / .5); }
.tele-l div::after { right: -24px; } .tele-r div::after { left: -24px; }
body[data-state="off"] .tele { opacity: .45; }

/* sequência de inicialização */
.boot { position: absolute; left: 50%; top: 100%; transform: translate(-50%, -30%); width: max-content; max-width: 92vw; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; z-index: 3; }
.boot b { display: block; font: 700 11px var(--hd); letter-spacing: .4em; text-transform: uppercase; color: var(--c); text-shadow: 0 0 14px var(--c); }
.boot b::after { content: "_"; animation: blink .5s steps(1) infinite; }
.boot ul { list-style: none; margin: 8px 0 0; padding: 0; font: 500 10px var(--tx); letter-spacing: .2em; text-transform: uppercase; color: var(--mut); }
.boot li { opacity: 0; }
.boot em { font-style: normal; color: var(--ok); margin-left: 8px; }
body.booting .boot { visibility: visible; animation: bootFade 2.7s ease forwards; }
body.booting .boot li { animation: bootLine .3s ease forwards; }
body.booting .boot li:nth-child(1) { animation-delay: .5s; } body.booting .boot li:nth-child(2) { animation-delay: 1s; } body.booting .boot li:nth-child(3) { animation-delay: 1.5s; }
@keyframes bootFade { 0% { opacity: 0; } 8%, 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bootLine { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
body.booting .captions { opacity: 0; }

/* em espera (palavra de ativação) */
.standby-tx { position: absolute; left: 50%; bottom: 1%; transform: translateX(-50%); white-space: nowrap; padding: 8px 16px; pointer-events: none; opacity: 0; transition: opacity .6s;
  font: 500 10px var(--hd); letter-spacing: .26em; text-transform: uppercase; color: rgb(var(--s)); border: 1px solid rgb(var(--s) / .4); background: rgb(2 14 24 / .82); border-radius: 3px; }
.standby-tx b { color: var(--g); text-shadow: 0 0 10px rgb(255 205 120 / .7); }
body[data-state="standby"] .standby-tx { opacity: 1; animation: standbyBreath 3.2s ease-in-out infinite; }
@keyframes standbyBreath { 50% { box-shadow: 0 0 22px rgb(var(--s) / .45); border-color: rgb(var(--s) / .8); } }

/* botão de ativar: o reator inteiro é clicável; a pílula fica embaixo (não cobre a logo) */
.power { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; border: 0; background: none; cursor: pointer; transition: opacity .5s; }
.power span { position: absolute; left: 50%; bottom: 1%; transform: translateX(-50%); white-space: nowrap; padding: 9px 18px;
  font: 600 10px var(--hd); letter-spacing: .26em; text-transform: uppercase; color: var(--c); border: 1px solid rgb(79 220 255 / .55); background: rgb(2 14 24 / .85);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); animation: powerPulse 2.4s ease-in-out infinite; }
.power:hover span, .power:focus-visible span { color: #fff; background: rgb(79 220 255 / .2); }
.power:focus-visible { outline: 1px dashed rgb(79 220 255 / .5); outline-offset: 4px; }
@keyframes powerPulse { 50% { background: rgb(79 220 255 / .16); text-shadow: 0 0 12px var(--c); } }
body.live .power, body[data-state="standby"] .power { opacity: 0; pointer-events: none; }

/* legendas */
.captions { position: relative; width: min(760px, 100%); min-height: 96px; padding: 10px 26px; text-align: center; transition: opacity .4s; }
.captions::before, .captions::after { content: ""; position: absolute; top: 6px; bottom: 6px; width: 10px; border: 1px solid rgb(var(--s) / .55); opacity: 0; transition: opacity .4s; }
.captions::before { left: 0; border-right: 0; } .captions::after { right: 0; border-left: 0; }
.captions:has(p:not(:empty))::before, .captions:has(p:not(:empty))::after { opacity: 1; }
.cap-j { margin: 0; font: 400 clamp(16px, 2vw, 21px)/1.45 var(--tx); color: #dcf7ff; text-shadow: 0 0 20px rgb(var(--s) / .45); transition: text-shadow .5s; overflow-wrap: anywhere; }
body[data-state="speaking"] .cap-j { color: #fff6e3; }
.cap-u { margin: 8px 0 0; font: 300 13.5px/1.4 var(--tx); color: var(--mut); font-style: italic; overflow-wrap: anywhere; }
.cap-u:not(:empty)::before { content: "VOCÊ › "; font: 600 9.5px var(--hd); letter-spacing: .2em; font-style: normal; color: rgb(79 220 255 / .7); }

/* chips */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 100%; }
.chips button { position: relative; cursor: pointer; padding: 8px 14px; border: 1px solid var(--line2); border-radius: 3px; background: linear-gradient(180deg, rgb(79 220 255 / .08), rgb(4 20 34 / .7));
  font: 500 12px var(--tx); letter-spacing: .02em; color: rgb(220 240 255 / .78); transition: color .2s, border-color .2s, box-shadow .2s, transform .2s; }
.chips button::before { content: ""; position: absolute; left: -1px; top: -1px; width: 6px; height: 6px; border-left: 2px solid var(--c); border-top: 2px solid var(--c); }
.chips button:hover { color: #fff; border-color: rgb(79 220 255 / .7); box-shadow: 0 0 18px -4px rgb(79 220 255 / .7), inset 0 0 12px rgb(79 220 255 / .15); transform: translateY(-1px); }
.chips .mode { border-color: rgb(255 205 120 / .4); color: rgb(255 225 170 / .9); background: linear-gradient(180deg, rgb(255 205 120 / .1), rgb(20 14 4 / .6)); }
.chips .mode::before { border-color: var(--g); }
.chips .mode:hover { border-color: var(--g); box-shadow: 0 0 18px -4px rgb(255 205 120 / .7); }

/* barra de digitar */
.ask { position: relative; width: min(660px, 100%); display: flex; gap: 10px; align-items: center; padding: 7px; border: 1px solid transparent; border-radius: 10px;
  background: linear-gradient(rgb(3 13 23 / .92), rgb(3 13 23 / .92)) padding-box, linear-gradient(90deg, rgb(79 220 255 / .65), rgb(79 220 255 / .15) 40%, rgb(255 205 120 / .15) 60%, rgb(255 205 120 / .6)) border-box;
  box-shadow: 0 0 36px -12px rgb(79 220 255 / .6), inset 0 0 20px rgb(79 220 255 / .05); transition: box-shadow .3s; }
.ask::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--c), transparent); opacity: .8; animation: askGlow 3.5s ease-in-out infinite; }
@keyframes askGlow { 50% { left: 35%; right: 35%; opacity: .3; } }
.ask:focus-within { box-shadow: 0 0 46px -10px rgb(79 220 255 / .85), inset 0 0 24px rgb(79 220 255 / .08); }
.ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 15px var(--tx); padding: 0 4px; caret-color: var(--c); }
.ask input::placeholder { color: rgb(200 230 255 / .36); }
.mic, .send { flex: none; position: relative; width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; transition: all .25s; }
.mic svg, .send svg { width: 20px; height: 20px; }
.mic { border: 1px solid var(--line2); background: rgb(79 220 255 / .07); color: var(--c); }
.mic::after { content: ""; position: absolute; inset: -4px; border-radius: 11px; border: 1px solid rgb(79 220 255 / .0); transition: border-color .3s; }
.mic:disabled { opacity: .35; cursor: default; }
.mic.on { background: radial-gradient(circle, rgb(79 220 255 / .55), rgb(26 167 214 / .25)); border-color: var(--c); color: #fff; box-shadow: 0 0 22px rgb(79 220 255 / .6); }
.mic.on::after { border-color: rgb(79 220 255 / .35); }
body[data-state="listening"] .mic.on { animation: micPulse 1.6s ease-in-out infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 7px rgb(79 220 255 / .12), 0 0 30px rgb(79 220 255 / .75); } }
.send { border: 0; color: #00131f; background: linear-gradient(180deg, #8ae9ff, var(--c) 45%, var(--c2)); box-shadow: 0 0 18px -4px var(--c); }
.send:hover { filter: brightness(1.12); box-shadow: 0 0 26px -2px var(--c); }
body.ptt .mic { border-color: var(--g); color: var(--g); }
body.holding .mic { background: radial-gradient(circle, rgb(255 205 120 / .7), rgb(255 160 60 / .3)); color: #1a1306; box-shadow: 0 0 0 9px rgb(255 205 120 / .15), 0 0 34px rgb(255 205 120 / .85); }
body.voice-open .mic.on { box-shadow: 0 0 0 6px rgb(79 220 255 / .2), 0 0 36px rgb(79 220 255 / .95); }

/* ---------- painéis ---------- */
#panels { flex: 1; overflow: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 12px; }
.empty { display: grid; justify-items: center; gap: 14px; color: var(--mut); font-size: 12.5px; text-align: center; margin: 40px 14px; line-height: 1.5; }
.empty-ico { width: 64px; height: 64px; border-radius: 50%; border: 1px dashed rgb(79 220 255 / .35); position: relative; animation: spin 14s linear infinite; }
.empty-ico::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--c); border-left-color: rgb(79 220 255 / .3); animation: spin 2.4s linear infinite reverse; }
.empty-ico::after { content: ""; position: absolute; inset: 27px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); animation: blink 1.6s infinite; }
.panel { position: relative; flex: none; border: 1px solid rgb(79 220 255 / .24); border-radius: 4px; background: linear-gradient(180deg, rgb(4 22 36 / .85), rgb(2 10 18 / .85)); overflow: hidden;
  box-shadow: 0 0 24px -14px rgb(79 220 255 / .8), inset 0 0 30px rgb(79 220 255 / .03); animation: panelIn .7s var(--ease) both; }
.panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; --k: var(--c);
  background:
    linear-gradient(var(--k), var(--k)) top left / 12px 2px no-repeat, linear-gradient(var(--k), var(--k)) top left / 2px 12px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom right / 12px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom right / 2px 12px no-repeat; }
.panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent, rgb(79 220 255 / .22) 50%, transparent); height: 60px; transform: translateY(-70px); animation: panelScan 1.1s .2s ease-out; }
@keyframes panelIn { 0% { opacity: 0; transform: translateX(24px); clip-path: inset(0 0 100% 0); filter: blur(4px) brightness(2); } 35% { opacity: .7; } 50% { opacity: .3; } 65% { opacity: 1; } 100% { clip-path: inset(0 0 0 0); } }
@keyframes panelScan { to { transform: translateY(600px); } }
.panel header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgb(79 220 255 / .14), transparent 75%), repeating-linear-gradient(135deg, rgb(79 220 255 / .04) 0 6px, transparent 6px 12px); }
.panel header::before { content: ""; width: 6px; height: 6px; flex: none; background: var(--c); box-shadow: 0 0 8px var(--c); transform: rotate(45deg); }
.panel header b { flex: 1; min-width: 0; font: 600 12px var(--hd); letter-spacing: .08em; text-transform: uppercase; color: #dff7ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel time { font: 500 10px var(--hd); letter-spacing: .1em; color: var(--mut); }
.px { cursor: pointer; width: 24px; height: 24px; border-radius: 3px; border: 1px solid transparent; background: none; color: var(--mut); font-size: 17px; line-height: 1; padding: 0; transition: all .2s; }
.px:hover { color: #fecaca; border-color: rgb(248 113 113 / .5); background: rgb(248 113 113 / .12); }
.pb { padding: 12px; font-size: 12.5px; overflow-wrap: anywhere; }
.pb h4 { display: flex; align-items: center; gap: 8px; margin: 14px 0 7px; font: 600 9.5px var(--hd); letter-spacing: .26em; text-transform: uppercase; color: var(--c); }
.pb h4::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.kv { display: grid; grid-template-columns: minmax(80px, 100px) 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--mut); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding-top: 1px; }
.kv dd { margin: 0; word-break: break-word; color: #e6f7ff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.kpis div { position: relative; padding: 12px 8px 10px; border-radius: 3px; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, rgb(79 220 255 / .1), rgb(79 220 255 / .02)); border: 1px solid var(--line); }
.kpis div::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--c), transparent); box-shadow: 0 0 8px var(--c); }
.kpis b { display: block; font: 700 17px var(--hd); letter-spacing: .02em; color: #fff; text-shadow: 0 0 14px rgb(79 220 255 / .55); overflow-wrap: anywhere; }
.kpis.big b { font-size: 21px; }
.kpis small { display: block; margin-top: 3px; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--mut); }
.kpis .bad b { color: #fca5a5; text-shadow: 0 0 14px rgb(248 113 113 / .6); }
.kpis .bad::after { background: linear-gradient(90deg, transparent, var(--bad), transparent); box-shadow: 0 0 8px var(--bad); }
.status { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.status li { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 3px; background: rgb(255 255 255 / .025); border: 1px solid rgb(255 255 255 / .04); }
.status i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.status .up i { background: var(--ok); box-shadow: 0 0 0 3px rgb(74 222 128 / .15), 0 0 10px var(--ok); }
.status .down { border-color: rgb(248 113 113 / .25); background: rgb(248 113 113 / .06); }
.status .down i { background: var(--bad); box-shadow: 0 0 0 3px rgb(248 113 113 / .15), 0 0 10px var(--bad); animation: blink .8s infinite; }
.status span { flex: 1; min-width: 0; }
.status small { display: block; color: var(--mut); font-size: 10.5px; }
.status em { font: 500 10.5px var(--hd); font-style: normal; color: rgb(134 239 172 / .85); }
.status .down em { color: #fca5a5; }
.badge { display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 3px; font: 700 10px var(--hd); letter-spacing: .16em; text-transform: uppercase; }
.badge.ok { color: #86efac; background: rgb(34 197 94 / .12); border: 1px solid rgb(74 222 128 / .4); box-shadow: 0 0 14px -4px var(--ok); }
.badge.warn { color: #fcd34d; background: rgb(251 191 36 / .12); border: 1px solid rgb(251 191 36 / .4); box-shadow: 0 0 14px -4px #fbbf24; }
.tw { overflow: auto; border: 1px solid var(--line); border-radius: 3px; }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
th { position: sticky; top: 0; text-align: left; font: 600 9px var(--hd); letter-spacing: .14em; text-transform: uppercase; color: var(--c); padding: 7px 8px; background: rgb(6 28 44 / .95); border-bottom: 1px solid var(--line2); white-space: nowrap; }
td { padding: 6px 8px; border-bottom: 1px solid rgb(255 255 255 / .04); }
tbody tr:nth-child(even) td { background: rgb(255 255 255 / .018); }
tbody tr:hover td { background: rgb(79 220 255 / .07); }
.muted { color: var(--mut); }
.bubble { padding: 10px 12px; border-radius: 10px 10px 10px 2px; background: rgb(34 197 94 / .12); border: 1px solid rgb(74 222 128 / .3); white-space: pre-wrap; }
.open { display: inline-flex; gap: 8px; padding: 10px 16px; border-radius: 4px; background: linear-gradient(180deg, #8ae9ff, var(--c) 45%, var(--c2)); color: #00131f; font-weight: 700; text-decoration: none; box-shadow: 0 0 18px -4px var(--c); }

/* histórico (coluna direita): miniaturas clicáveis que reabrem no centro */
#panels .panel { cursor: pointer; max-height: 168px; transition: border-color .25s, box-shadow .25s, transform .25s; }
#panels .panel .pb { pointer-events: none; zoom: .82; -webkit-mask: linear-gradient(180deg, #000 45%, transparent 95%); mask: linear-gradient(180deg, #000 45%, transparent 95%); }
#panels .panel:hover { border-color: rgb(79 220 255 / .6); box-shadow: 0 0 26px -8px rgb(79 220 255 / .9); transform: translateX(-3px); }
#panels .panel:hover header b { color: #fff; }
#panels .panel header::after { content: "⤢"; color: var(--c); font-size: 13px; opacity: 0; transition: opacity .2s; }
#panels .panel:hover header::after { opacity: .9; }

/* painel em destaque no centro (holograma que se materializa) */
.feature { position: absolute; z-index: 3; inset: 0 0 0 calc(var(--mini) + 18px); display: flex; pointer-events: none; }
.feature-card { pointer-events: auto; flex: 1; min-width: 0; display: flex; flex-direction: column; max-height: 100%; align-self: center;
  border-color: rgb(79 220 255 / .45); background: linear-gradient(180deg, rgb(5 24 40 / .96), rgb(2 10 18 / .97)), repeating-linear-gradient(0deg, rgb(79 220 255 / .03) 0 1px, transparent 1px 4px);
  box-shadow: 0 0 0 1px rgb(79 220 255 / .08), 0 0 70px -20px rgb(79 220 255 / .8), inset 0 0 60px rgb(79 220 255 / .05);
  animation: materialize 1s var(--ease) both; }
.feature-card::before { background:
    linear-gradient(var(--k), var(--k)) top left / 22px 2px no-repeat, linear-gradient(var(--k), var(--k)) top left / 2px 22px no-repeat,
    linear-gradient(var(--k), var(--k)) top right / 22px 2px no-repeat, linear-gradient(var(--k), var(--k)) top right / 2px 22px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom left / 22px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom left / 2px 22px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom right / 22px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom right / 2px 22px no-repeat;
  filter: drop-shadow(0 0 5px var(--c)); }
.feature-card::after { height: 90px; background: linear-gradient(180deg, transparent, rgb(120 235 255 / .28) 50%, transparent); animation: panelScan 1.4s .25s ease-out; }
@keyframes materialize {
  0% { opacity: 0; clip-path: inset(49.5% 30% 49.5% 30%); filter: brightness(3) blur(3px); transform: translateX(-30px); }
  25% { opacity: 1; clip-path: inset(49.5% 0 49.5% 0); filter: brightness(2.4) blur(1px); }
  55% { clip-path: inset(0 0 0 0); opacity: .55; }
  65% { opacity: 1; } 72% { opacity: .75; }
  100% { opacity: 1; clip-path: inset(0 0 0 0); filter: none; transform: none; } }
.feature-card.out { animation: dematerialize .46s ease-in forwards; }
@keyframes dematerialize { 0% { clip-path: inset(0 0 0 0); } 60% { clip-path: inset(49.5% 0 49.5% 0); opacity: 1; filter: brightness(2.5); } 100% { clip-path: inset(49.5% 50% 49.5% 50%); opacity: 0; } }
.feature-card header { padding: 13px 16px; gap: 12px; }
.feature-card header b { font-size: 15px; letter-spacing: .12em; text-shadow: 0 0 14px rgb(79 220 255 / .5); }
.fc-tag { flex: none; padding: 3px 8px; font: 600 8.5px var(--hd); letter-spacing: .22em; text-transform: uppercase; color: #00131f; background: var(--c); box-shadow: 0 0 12px -2px var(--c); }
.feature-card .px { width: 30px; height: 30px; font-size: 20px; border-color: var(--line2); }
.feature-card .pb { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px 22px; font-size: 14px; }
.feature-card .pb > * { animation: rise .6s var(--ease) both; }
.feature-card .pb > :nth-child(2) { animation-delay: .5s; } .feature-card .pb > :nth-child(3) { animation-delay: .6s; } .feature-card .pb > :nth-child(n+4) { animation-delay: .7s; }
.feature-card .pb > :first-child { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.feature-card .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.feature-card .kpis div { padding: 18px 12px 16px; }
.feature-card .kpis b { font-size: clamp(22px, 2.6vw, 34px); }
.feature-card .kpis small { font-size: 10.5px; }
.feature-card .kv { grid-template-columns: minmax(110px, 160px) 1fr; gap: 9px 18px; font-size: 14px; }
.feature-card .kv dt { font-size: 11px; }
.feature-card table { font-size: 13px; }
.feature-card th { font-size: 9.5px; padding: 9px 10px; }
.feature-card td { padding: 8px 10px; }
.feature-card .status { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.feature-card .status li { padding: 10px 12px; }
.feature-card .badge { font-size: 11px; padding: 6px 12px; }
.feature-card .bubble { font-size: 15px; }
.fc-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: linear-gradient(90deg, rgb(79 220 255 / .2), var(--c)); transform-origin: left; animation: fcTimer 75s linear forwards; pointer-events: none; }
.feature-card:hover .fc-timer { animation-play-state: paused; }
@keyframes fcTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* painel "cérebro": resposta em destaque + passos + tabela */
.cb-resp { position: relative; padding: 14px 16px 14px 18px; margin-bottom: 12px; font: 400 1.12em/1.55 var(--tx); color: #eafaff; white-space: pre-wrap;
  background: linear-gradient(90deg, rgb(79 220 255 / .1), rgb(79 220 255 / .02)); border-left: 2px solid var(--c); text-shadow: 0 0 16px rgb(79 220 255 / .3); }
.cb-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cb-steps span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; font: 500 9.5px var(--hd); letter-spacing: .1em; text-transform: uppercase; border: 1px solid rgb(74 222 128 / .4); background: rgb(74 222 128 / .08); color: #a7f3c4;
  animation: rise .4s var(--ease) both; animation-delay: calc(.5s + var(--i, 0) * .08s); }
.cb-steps span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.cb-steps span.erro { border-color: rgb(248 113 113 / .45); background: rgb(248 113 113 / .08); color: #fecaca; }
.cb-steps span.erro::before { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.cb-model { margin: 12px 0 0; text-align: right; font: 500 8.5px var(--hd); letter-spacing: .24em; text-transform: uppercase; color: var(--mut); }

/* ---------- confirmação ---------- */
.confirm { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgb(0 0 0 / .65); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.confirm[hidden] { display: none; }
.cf-card { position: relative; width: min(440px, 100%); padding: 24px; border-radius: 6px; border: 1px solid rgb(255 205 120 / .45); background: linear-gradient(180deg, #16120a, #070605);
  box-shadow: 0 0 70px -20px rgb(255 205 120 / .7); animation: panelIn .5s var(--ease); }
.cf-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; --k: var(--g);
  background: linear-gradient(var(--k), var(--k)) top left / 16px 2px no-repeat, linear-gradient(var(--k), var(--k)) top left / 2px 16px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom right / 16px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom right / 2px 16px no-repeat; }
.cf-k { font: 600 10px var(--hd); letter-spacing: .3em; text-transform: uppercase; color: var(--g); }
.cf-card h3 { margin: 8px 0 4px; font: 500 20px var(--tx); }
.cf-to { margin: 0 0 10px; color: var(--mut); font-size: 12.5px; }
.cf-card pre { margin: 0; padding: 12px; border-radius: 4px; background: rgb(255 255 255 / .04); border: 1px solid rgb(255 255 255 / .08); white-space: pre-wrap; font: 400 13.5px/1.5 var(--tx); max-height: 40vh; overflow: auto; }
.cf-a { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.cf-a button { cursor: pointer; padding: 11px 18px; border-radius: 4px; border: 1px solid rgb(255 255 255 / .15); background: transparent; font-weight: 600; }
.cf-a .go { border: 0; color: #1a1306; background: linear-gradient(180deg, #fff1c2, var(--g)); box-shadow: 0 0 20px -4px var(--g); }

/* ---------- telão ---------- */
/* o telão abre integrado ao palco central, como um holograma grande */
.screen { position: absolute; z-index: 4; inset: 0 0 0 calc(var(--mini) + 18px);
  transform: perspective(1200px) rotateX(8deg) scale(.6); transform-origin: 0 0; opacity: 0; filter: blur(8px) brightness(1.8);
  transition: transform .7s var(--ease), opacity .45s, filter .6s; }
.screen[hidden] { display: none; }
.screen.on { transform: none; opacity: 1; filter: none; }
.screen.max { position: fixed; z-index: 30; inset: 16px; }
.screen.min { transform: translate(40%, 60%) scale(.08); opacity: 0; }
.sc-frame { position: absolute; inset: 0; display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; background: rgb(2 10 18 / .94);
  border: 1px solid rgb(79 220 255 / .45); box-shadow: 0 0 0 1px rgb(79 220 255 / .08), 0 30px 80px -20px #000, 0 0 60px -10px rgb(79 220 255 / .45); }
.sc-frame::before, .sc-frame::after { content: ""; position: absolute; z-index: 3; width: 22px; height: 22px; border: 2px solid var(--c); pointer-events: none; filter: drop-shadow(0 0 6px var(--c)); }
.sc-frame::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.sc-frame::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.sc-frame header { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgb(79 220 255 / .14), rgb(255 205 120 / .06)); }
.sc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: blink 1.6s infinite; }
.sc-frame header b { font: 600 12px var(--hd); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.sc-frame header span { flex: 1; min-width: 0; font: 400 11.5px var(--tx); color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-btn { display: flex; gap: 6px; }
.sc-btn button { width: 30px; height: 30px; border-radius: 4px; cursor: pointer; border: 1px solid var(--line); background: rgb(79 220 255 / .06); color: var(--ink); font-size: 15px; line-height: 1; transition: background .2s, border-color .2s; }
.sc-btn button:hover { background: rgb(79 220 255 / .2); border-color: var(--c); }
.sc-btn button[data-a="fechar"]:hover { background: rgb(248 113 113 / .25); border-color: var(--bad); }
.sc-body { flex: 1; overflow: auto; background: #050a10; }
.sc-body img { display: block; width: 100%; height: auto; }
.screen.loading .sc-body img { opacity: 0; }
.sc-load { position: absolute; inset: 46px 0 0; display: none; place-content: center; justify-items: center; gap: 14px; font: 500 11px var(--hd); letter-spacing: .26em; text-transform: uppercase; color: var(--c); }
.sc-load span { width: 54px; height: 54px; border-radius: 50%; border: 2px solid rgb(79 220 255 / .2); border-top-color: var(--c); animation: spin .9s linear infinite; }
.screen.loading .sc-load { display: grid; }
.sc-scan { position: absolute; left: 0; right: 0; top: 46px; height: 120px; pointer-events: none; opacity: 0; background: linear-gradient(180deg, transparent, rgb(79 220 255 / .25) 50%, transparent); }
.screen.scan .sc-scan { animation: scScan 1.2s ease-in-out; }
@keyframes scScan { 0% { opacity: 1; transform: translateY(-120px); } 100% { opacity: 1; transform: translateY(74vh); } }
.screen.on .sc-frame { animation: holo .5s steps(2) 1; }
@keyframes holo { 0% { opacity: .4; } 30% { opacity: 1; } 45% { opacity: .6; } 60%, 100% { opacity: 1; } }
.sc-dock { position: fixed; z-index: 15; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 4px; cursor: pointer;
  border: 1px solid rgb(79 220 255 / .5); background: rgb(2 12 22 / .92); color: var(--ink); font: 600 12px var(--tx); box-shadow: 0 0 26px -6px var(--c); animation: logIn .5s; }
.sc-dock[hidden] { display: none; }
.sc-dock i { width: 14px; height: 10px; border: 1.5px solid var(--c); border-radius: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; min-height: 100svh; padding: 24px 0; }
.login-box { position: relative; z-index: 2; width: min(380px, calc(100% - 32px)); text-align: center; animation: loginIn 1s var(--ease) both; }
@keyframes loginIn { from { opacity: 0; transform: translateY(16px) scale(.98); filter: blur(6px); } }
.login-orb { position: relative; width: 210px; height: 210px; margin: 0 auto 26px; }
.login-orb::before { content: ""; position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(circle, rgb(79 220 255 / .2), transparent 65%); animation: orbBreath 3s ease-in-out infinite; }
@keyframes orbBreath { 50% { transform: scale(1.08); opacity: .7; } }
.login-orb span { position: absolute; border-radius: 50%; }
.login-orb .o1 { inset: 0; background: repeating-conic-gradient(rgb(79 220 255 / .7) 0 .8deg, transparent .8deg 5deg);
  -webkit-mask: radial-gradient(closest-side, transparent 92%, #000 93%, #000 99%, transparent); mask: radial-gradient(closest-side, transparent 92%, #000 93%, #000 99%, transparent); animation: spin 40s linear infinite; }
.login-orb .o2 { inset: 16px; border: 2px solid transparent; border-top-color: var(--c); border-bottom-color: rgb(79 220 255 / .35); filter: drop-shadow(0 0 6px var(--c)); animation: spin 3s linear infinite; }
.login-orb .o3 { inset: 30px; border: 1px dashed rgb(79 220 255 / .45); animation: spin 14s linear infinite reverse; }
.login-orb .o4 { inset: 42px; border: 3px solid transparent; border-left-color: var(--g); border-right-color: rgb(255 205 120 / .35); filter: drop-shadow(0 0 6px var(--g)); animation: spin 2.2s linear infinite reverse; }
.login-orb .o5 { inset: 56px; background: radial-gradient(circle, rgb(79 220 255 / .3), rgb(2 10 18 / .9) 70%); border: 1px solid rgb(79 220 255 / .4); box-shadow: inset 0 0 24px rgb(79 220 255 / .3); }
.login-orb img { position: absolute; inset: 74px; width: calc(100% - 148px); height: calc(100% - 148px); object-fit: contain; filter: drop-shadow(0 0 14px rgb(255 205 120 / .85)); animation: logoPulse 3s ease-in-out infinite; }
.login-orb i { position: absolute; inset: 74px; overflow: hidden; pointer-events: none; border-radius: 50%; }
.login-orb i::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(180deg, transparent, rgb(160 240 255 / .35), transparent); animation: orbScan 2.6s ease-in-out infinite; }
@keyframes orbScan { from { transform: translateY(-100%); } to { transform: translateY(340%); } }
.login-box h1 { position: relative; margin: 0; font: 900 25px var(--hd); letter-spacing: .32em; padding-left: .32em; color: var(--c); text-shadow: 0 0 22px rgb(79 220 255 / .65); }
.login-box h1::after { content: attr(data-t); position: absolute; inset: 0; padding-left: .32em; color: var(--g); opacity: 0; clip-path: inset(40% 0 45% 0); animation: glitch 5s steps(1) infinite; }
@keyframes glitch { 0%, 91%, 100% { opacity: 0; transform: none; } 92% { opacity: .8; transform: translateX(-4px); } 94% { opacity: .6; transform: translateX(3px); clip-path: inset(10% 0 70% 0); } 96% { opacity: 0; } }
.login-box > p { margin: 8px 0 24px; font: 500 10px var(--hd); letter-spacing: .3em; text-transform: uppercase; color: var(--mut); }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-field { position: relative; }
.login-field::before { content: ""; position: absolute; inset: 0; pointer-events: none; --k: var(--c);
  background: linear-gradient(var(--k), var(--k)) top left / 10px 2px no-repeat, linear-gradient(var(--k), var(--k)) top left / 2px 10px no-repeat,
    linear-gradient(var(--k), var(--k)) bottom right / 10px 2px no-repeat, linear-gradient(var(--k), var(--k)) bottom right / 2px 10px no-repeat; }
.login-box input { width: 100%; padding: 15px 16px; border-radius: 4px; border: 1px solid rgb(79 220 255 / .3); background: rgb(3 14 24 / .85); color: var(--ink); font: 400 15px var(--tx); letter-spacing: .1em; outline: 0; text-align: center; caret-color: var(--c); transition: border-color .2s, box-shadow .2s; }
.login-box input::placeholder { color: rgb(200 230 255 / .38); letter-spacing: .14em; }
.login-box input:focus { border-color: var(--c); box-shadow: 0 0 24px -6px var(--c), inset 0 0 16px rgb(79 220 255 / .1); }
.login-box button { position: relative; overflow: hidden; cursor: pointer; padding: 15px; border-radius: 4px; border: 0; font: 700 12px var(--hd); letter-spacing: .34em; text-transform: uppercase; color: #00131f;
  background: linear-gradient(180deg, #8ae9ff, var(--c) 45%, var(--c2)); box-shadow: 0 0 26px -6px var(--c); transition: filter .2s, box-shadow .2s; }
.login-box button::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -50%; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .55), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 60%, 100% { left: 130%; } }
.login-box button:hover { filter: brightness(1.1); box-shadow: 0 0 36px -4px var(--c); }
.login-err { color: #fca5a5; font-size: 12.5px; min-height: 1.2em; letter-spacing: 0 !important; text-transform: none !important; font-family: var(--tx) !important; }
.login-sys { margin-top: 18px; display: flex; justify-content: center; gap: 16px; font: 500 8.5px var(--hd); letter-spacing: .24em; text-transform: uppercase; color: var(--mut); }
.login-sys span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); vertical-align: 1px; animation: blink 2s infinite; }
.login-sys span:nth-child(2)::before { animation-delay: -.7s; } .login-sys span:nth-child(3)::before { animation-delay: -1.3s; }

/* ---------- telas médias ---------- */
@media (max-width: 1500px) { .tele { display: none; } }
@media (max-width: 1100px) {
  .hud { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(240px, 320px); gap: 14px; }
  .brand-tx small { display: none; }
}

/* ---------- celular / tela estreita ---------- */
@media (max-width: 900px) {
  .hud { display: flex; flex-direction: column; height: auto; min-height: 0; padding: 6px 12px 110px; gap: 14px; }
  .center { order: 1; padding-top: 4px; }
  .panels { order: 2; } .log { order: 3; max-height: 340px; }
  .col { min-height: 170px; }
  .center { display: flex; flex-direction: column; align-items: center; }
  .stage-area { --mini: 84px; height: min(88vw, 400px); transition: height .7s var(--ease); scroll-margin-top: 10px; }
  .stage-area.focus { height: min(74svh, 640px); }
  .feature, .screen { inset: calc(var(--mini) + 10px) 0 0 0 !important; }
  .screen.max { inset: 10px !important; }
  .stage-area::after { display: none; }
  .captions { min-height: 70px; padding: 6px 18px; }
  .ask { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: auto; z-index: 10; }
  .top { padding: max(10px, env(safe-area-inset-top)) 12px 8px; gap: 8px; grid-template-columns: minmax(0, 1fr) auto auto; }
  .top::after { left: 12px; right: 12px; }
  .state { order: 2; padding: 6px 12px; font-size: 8.5px; letter-spacing: .14em; gap: 7px; }
  .clock { order: 3; gap: 8px; }
  .clk small { display: none; }
  .clk b { font-size: 15px; }
  .sair { padding: 7px; }
  .sair span { display: none; }
  .brand { gap: 9px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-logo img { width: 22px; height: 22px; }
  .brand-tx b { font-size: 12px; letter-spacing: .2em; }
  .sc-dock { bottom: 90px; }
  .chips button { padding: 7px 11px; font-size: 11.5px; }
}
@media (max-width: 420px) {
  .state .eq { display: none; }
  .brand-tx b { font-size: 11px; letter-spacing: .14em; }
  .clk b { font-size: 13px; letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .scanlines::after, .col::after { display: none; }
}
/* telão maximizado fica acima do topo */
body:has(.screen.max) .hud { z-index: 25; }
/* KPIs: número se ajusta à largura do cartão (container query) e nunca vaza */
.kpis div { container-type: inline-size; min-width: 0; }
.kpis b { --n: 6; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: clip; overflow-wrap: normal;
  font-size: clamp(11px, calc(100cqw / (var(--n) * .82)), 19px); }
.kpis.big b { font-size: clamp(11px, calc(100cqw / (var(--n) * .82)), 23px); }
.feature-card .kpis b, .feature-card .kpis.big b { font-size: clamp(13px, calc(100cqw / (var(--n) * .8)), 36px); }
.kpis small { line-height: 1.3; overflow-wrap: anywhere; }
.feature-card .status li { padding: 7px 10px; }

/* palavra de ativação: reator adormecido em espera, acende ao acordar */
body[data-state="standby"] .reactor-wrap { animation: sleepBreath 4.5s ease-in-out infinite; }
@keyframes sleepBreath { 50% { filter: brightness(1.35); } }
body.awake .reactor-wrap::before { background: radial-gradient(circle, rgb(var(--s) / .3), transparent 62%); }
body.wake-mode .chips .mode { border-color: rgb(79 220 255 / .5); color: #bdefff; background: linear-gradient(180deg, rgb(79 220 255 / .14), rgb(4 20 34 / .7)); }
body.wake-mode .chips .mode::before { border-color: var(--c); }
/* seletor de voz (inserido pelo wake.js dentro de #chips) */
.chips .voz-sel { cursor: pointer; padding: 7px 28px 7px 12px; border: 1px solid var(--line2); border-radius: 3px; font: 500 12px var(--tx); color: rgb(220 240 255 / .85); outline: 0;
  -webkit-appearance: none; appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234fdcff' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 8px center / 12px no-repeat, linear-gradient(180deg, rgb(79 220 255 / .08), rgb(4 20 34 / .8)); }
.chips .voz-sel:hover, .chips .voz-sel:focus { border-color: rgb(79 220 255 / .7); box-shadow: 0 0 16px -4px rgb(79 220 255 / .7); }
.chips .voz-sel option { background: #04121e; color: var(--ink); }
@media (max-width: 900px) { .feature-card { align-self: flex-start; } }
@media (max-width: 520px) { .fc-tag { display: none; } .feature-card .pb { padding: 14px; } }
@media (prefers-reduced-motion: reduce) { body[data-state="standby"] .reactor-wrap { animation: none; } }

/* histórico: miniaturas compactas e com acabamento (sem cortar no meio, sem cartão solto) */
#panels .panel .pb { max-height: 128px; overflow: hidden; -webkit-mask: linear-gradient(#000 72%, transparent); mask: linear-gradient(#000 72%, transparent); }
#panels .panel .kpis { grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)) !important; gap: 4px !important; }
#panels .panel .kpis > div { padding: 6px 3px !important; min-width: 0; }
#panels .panel .kpis b { font-size: 12px !important; white-space: nowrap; }
#panels .panel .kpis small { font-size: 7.5px !important; line-height: 1.15; display: block; overflow: hidden; text-overflow: ellipsis; }
