:root {
  --bg: #04060d;
  --bg2: #0a0f1e;
  --glass: rgba(12, 18, 36, 0.72);
  --glass-2: rgba(20, 28, 54, 0.6);
  --line: rgba(120, 150, 255, 0.14);
  --line-2: rgba(120, 150, 255, 0.28);
  --text: #e8ecff;
  --muted: #8f9bc4;
  --dim: #5d688f;
  --accent: #6ea8ff;
  --accent-2: #c77dff;
  --hot: #ff5f8a;
  --ok: #3fdc95;
  --warn: #ffc24f;
  --radius: 14px;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --left-w: 320px;
  --right-w: 400px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); }
body { user-select: none; -webkit-user-select: none; background: radial-gradient(ellipse at 50% 40%, #0d1630 0%, #060a17 55%, #03050b 100%); }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; user-select: text; }
.msg, .hit p, .src p, .isec p, .isec li, .info-head .resumo { user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: 0.85em; background: rgba(110, 168, 255, 0.12); padding: 1px 5px; border-radius: 5px; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }
#stage.grab canvas { cursor: grab; }
#stage.pointer canvas { cursor: pointer; }
#stage.pressing canvas { cursor: crosshair; }

/* ------------------------------------------------ loader */
#loader { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 18px; z-index: 50; background: var(--bg); transition: opacity .6s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-brain svg { width: 90px; height: 90px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.loader-brain circle { transform-origin: 50% 50%; animation: ring 1.6s ease-in-out infinite; }
.loader-brain circle:nth-child(2) { animation-delay: .2s; stroke: var(--accent-2); }
.loader-brain circle:nth-child(3) { animation-delay: .4s; stroke: var(--hot); }
@keyframes ring { 0%, 100% { transform: scale(.85); opacity: .4; } 50% { transform: scale(1.05); opacity: 1; } }
#loader p { color: var(--muted); font-family: var(--mono); font-size: 13px; }

/* ------------------------------------------------ topbar */
#topbar { position: fixed; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; gap: 16px; padding: 0 16px; z-index: 20; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.brand { font-weight: 700; letter-spacing: .18em; font-size: 15px; display: flex; align-items: baseline; gap: 2px; }
.brand b { color: var(--accent); font-weight: 700; }
.brand small { letter-spacing: .08em; font-weight: 400; color: var(--dim); margin-left: 10px; font-size: 11px; font-family: var(--mono); }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hot); margin-right: 10px; align-self: center; box-shadow: 0 0 12px var(--hot); animation: beat 1.2s infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.5); } 30% { transform: scale(1); } }
.back { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; background: var(--glass); backdrop-filter: blur(10px); transition: .15s; }
.back:hover { color: var(--text); border-color: var(--line-2); }
.eeg-title b { font-weight: 600; }
.status { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: var(--glass); border: 1px solid var(--line); padding: 6px 12px; border-radius: 99px; backdrop-filter: blur(10px); }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.status.ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status.err .dot { background: var(--hot); }
.top-actions { display: flex; gap: 8px; }
.icon-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); display: grid; place-items: center; font-size: 14px; transition: .15s; backdrop-filter: blur(10px); flex: none; }
.icon-btn:hover { border-color: var(--line-2); background: var(--glass-2); }
.only-mobile { display: none; }

/* ------------------------------------------------ panels */
.panel { position: fixed; top: 64px; bottom: 16px; z-index: 15; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(16px) saturate(1.2); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
#left { left: 16px; width: var(--left-w); bottom: 200px; }
#right { right: 16px; width: var(--right-w); }
.tabs { display: flex; padding: 6px; gap: 4px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 8px 6px; border-radius: 9px; font-size: 12.5px; font-weight: 500; transition: .15s; white-space: nowrap; }
.tabs button:hover { color: var(--text); background: rgba(110, 168, 255, .06); }
.tabs button.on { color: var(--text); background: rgba(110, 168, 255, .14); box-shadow: inset 0 0 0 1px var(--line-2); }
.pane { display: none; flex: 1; min-height: 0; flex-direction: column; padding: 10px; gap: 8px; }
.pane.on { display: flex; }
.scroll { overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(120, 150, 255, .25) transparent; }
.hint { color: var(--muted); font-size: 12px; margin: 2px 2px 6px; line-height: 1.45; }
.field { width: 100%; background: rgba(5, 8, 18, .6); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none; font-size: 13px; transition: border-color .15s; }
.field:focus { border-color: var(--accent); }
.row { display: flex; gap: 6px; }
.btn { background: linear-gradient(135deg, #3d7bff, #8b5cff); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13px; white-space: nowrap; transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); }
.btn.small { padding: 6px 10px; font-size: 12px; }

/* region list */
.grp { margin-bottom: 10px; }
.grp-h { display: flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 6px 6px; font-weight: 600; }
.grp-h i { width: 8px; height: 8px; border-radius: 3px; }
.ritem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 9px; font-size: 13px; transition: .12s; }
.ritem:hover { background: rgba(110, 168, 255, .08); }
.ritem.on { background: rgba(110, 168, 255, .16); box-shadow: inset 2px 0 0 var(--c); }
.ritem i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); flex: none; }
.ritem .act { margin-left: auto; width: 34px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; flex: none; }
.ritem .act b { display: block; height: 100%; width: 0; background: var(--c); }

/* NT cards */
.nt { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; background: rgba(5, 8, 18, .35); transition: .15s; }
.nt.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset, 0 0 24px -8px var(--c); }
.nt-h { display: flex; align-items: center; gap: 10px; }
.nt-h i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.nt-h b { font-size: 14px; }
.nt-h small { color: var(--dim); font-size: 11px; margin-left: auto; font-family: var(--mono); }
.nt p { font-size: 12.5px; color: var(--muted); margin: 7px 0; line-height: 1.45; }
.nt .vias { display: none; font-size: 12px; margin-top: 6px; }
.nt.on .vias { display: block; }
.nt .vias div { padding: 3px 0; color: var(--text); opacity: .85; }
.nt .vias em { color: var(--muted); font-style: normal; }
.nt .meta { display: none; font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 6px; }
.nt.on .meta { display: block; }
.toggle { margin-left: 6px; border: 1px solid var(--line-2); background: transparent; border-radius: 99px; padding: 3px 10px; font-size: 11.5px; }
.nt.on .toggle { background: var(--c); color: #0a0f1e; border-color: var(--c); font-weight: 700; }

/* stim */
.stim { display: flex; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: rgba(5, 8, 18, .35); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; transition: .15s; }
.stim:hover { border-color: var(--line-2); background: rgba(110, 168, 255, .08); transform: translateX(2px); }
.stim.on { border-color: var(--hot); box-shadow: 0 0 24px -8px var(--hot); }
.stim .ic { font-size: 22px; line-height: 1; }
.stim b { display: block; font-size: 14px; margin-bottom: 3px; }
.stim span { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* library */
.doc { font-size: 12px; padding: 6px 4px; border-bottom: 1px dashed var(--line); color: var(--muted); display: flex; gap: 8px; }
.doc b { color: var(--text); font-weight: 500; }
.doc small { margin-left: auto; font-family: var(--mono); white-space: nowrap; }
.hit { border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; margin-bottom: 8px; background: rgba(5, 8, 18, .35); font-size: 12.5px; line-height: 1.5; }
.hit-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 5px; }
.hit-h b { font-size: 12px; color: var(--accent); }
.hit-h small { margin-left: auto; color: var(--dim); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.hit p { margin: 0; color: #c7cfee; max-height: 9.2em; overflow: hidden; position: relative; }
.hit.open p { max-height: none; }
.hit mark { background: rgba(255, 194, 79, .22); color: #ffe2a3; border-radius: 3px; padding: 0 1px; }
.hit .more { border: 0; background: none; color: var(--accent); font-size: 11.5px; padding: 4px 0 0; }

/* ------------------------------------------------ info panel */
.empty { text-align: center; padding: 50px 22px; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.empty-icon { font-size: 54px; filter: drop-shadow(0 0 20px rgba(255, 95, 138, .5)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.empty h3 { color: var(--text); font-weight: 600; margin: 12px 0 8px; }
.info-head { padding: 6px 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 99px; padding: 3px 9px; font-weight: 600; }
.info-head h2 { margin: 10px 0 2px; font-size: 21px; line-height: 1.2; font-weight: 600; text-shadow: 0 0 30px color-mix(in srgb, var(--c) 60%, transparent); }
.info-head .en { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.info-head .resumo { font-size: 14px; line-height: 1.5; color: #d5dcfa; margin: 10px 0 12px; }
.act-row { display: flex; flex-wrap: wrap; gap: 6px; }
.act-row button { border: 1px solid var(--line-2); background: rgba(5, 8, 18, .4); border-radius: 9px; padding: 6px 10px; font-size: 12px; transition: .12s; }
.act-row button:hover { border-color: var(--c); color: #fff; }
.act-row button.primary { background: var(--c); color: #071022; border-color: var(--c); font-weight: 700; }
.act-row button.on { box-shadow: inset 0 0 0 1px var(--c); color: var(--c); }
.meter { margin: 12px 0 0; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.meter i { flex: 1; height: 5px; background: rgba(255, 255, 255, .06); border-radius: 5px; overflow: hidden; }
.meter b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c), #fff); border-radius: 5px; transition: width .08s; }
.isec { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.isec h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.isec p, .isec li { font-size: 13.2px; line-height: 1.55; color: #d5dcfa; margin: 0; }
.isec ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.isec.mk { background: linear-gradient(90deg, rgba(255, 95, 138, .07), transparent); border-radius: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); padding: 4px 10px; border-radius: 99px; font-size: 12px; transition: .12s; }
.chips button:hover { background: color-mix(in srgb, var(--c) 25%, transparent); color: #fff; }

/* ------------------------------------------------ chat */
.chat-head { display: flex; gap: 6px; align-items: center; }
.ctx { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); }
.ctx .cchip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--c); color: var(--c); border-radius: 99px; padding: 3px 4px 3px 10px; max-width: 100%; }
.ctx .cchip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx .cchip button { border: 0; background: none; color: inherit; padding: 0 5px; }
#messages { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.msg { font-size: 13.6px; line-height: 1.6; }
.msg.user { align-self: flex-end; max-width: 88%; background: linear-gradient(135deg, rgba(61, 123, 255, .35), rgba(139, 92, 255, .3)); border: 1px solid var(--line-2); padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg.bot { background: rgba(5, 8, 18, .4); border: 1px solid var(--line); padding: 11px 14px; border-radius: 14px 14px 14px 4px; }
.msg.bot .who { font-size: 10.5px; letter-spacing: .14em; color: var(--accent-2); font-weight: 700; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.msg.bot .who small { color: var(--dim); letter-spacing: 0; font-weight: 400; font-family: var(--mono); }
.msg.bot .body h1, .msg.bot .body h2, .msg.bot .body h3 { font-size: 14.5px; margin: 12px 0 5px; color: #fff; }
.msg.bot .body p { margin: 6px 0; }
.msg.bot .body ul, .msg.bot .body ol { margin: 6px 0; padding-left: 20px; }
.msg.bot .body li { margin: 3px 0; }
.msg.bot .body strong { color: #fff; }
.msg.bot .body table { border-collapse: collapse; font-size: 12.5px; margin: 8px 0; width: 100%; }
.msg.bot .body td, .msg.bot .body th { border: 1px solid var(--line); padding: 4px 6px; }
.msg.bot .body blockquote { border-left: 2px solid var(--accent-2); margin: 6px 0; padding-left: 10px; color: var(--muted); }
.rchip { display: inline-flex; align-items: center; gap: 4px; color: var(--c, var(--accent)); cursor: pointer; font-weight: 700; font-family: var(--mono); font-size: 9.5px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 99px; padding: 0 6px 0 4px; margin: 0 2px; vertical-align: 1px; line-height: 1.5; }
.rchip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.rchip:hover { color: #fff; background: color-mix(in srgb, var(--c) 35%, transparent); }
.cite { color: var(--warn); font-family: var(--mono); font-size: 10.5px; cursor: pointer; padding: 0 1px; }
.cite:hover { text-decoration: underline; }
.thinking { color: var(--muted); font-family: var(--mono); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.thinking::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent-2); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.caret::after { content: '▍'; color: var(--accent-2); animation: blink 1s steps(2) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.sources { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.sources summary { font-size: 11.5px; color: var(--muted); cursor: pointer; font-family: var(--mono); }
.src { font-size: 12px; padding: 7px 8px; border-radius: 8px; margin-top: 6px; background: rgba(255, 255, 255, .025); border: 1px solid transparent; }
.src.flash { border-color: var(--warn); }
.src b { color: var(--warn); font-family: var(--mono); margin-right: 6px; }
.src .t { color: var(--text); }
.src .p { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.src p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; font-size: 11.8px; }
.err { color: #ff9fb6; background: rgba(255, 95, 138, .1); border: 1px solid rgba(255, 95, 138, .35); padding: 9px 12px; border-radius: 10px; font-size: 13px; }
#suggest { display: flex; flex-wrap: wrap; gap: 6px; }
#suggest button { border: 1px solid var(--line-2); background: rgba(5, 8, 18, .4); border-radius: 99px; padding: 5px 11px; font-size: 12px; color: var(--muted); transition: .12s; }
#suggest button:hover { color: var(--text); border-color: var(--accent); }
#chatForm { display: flex; gap: 8px; align-items: flex-end; background: rgba(5, 8, 18, .6); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px 6px 6px 12px; }
#chatForm:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 168, 255, .12); }
#chatInput { flex: 1; resize: none; border: 0; background: transparent; outline: none; font-size: 13.5px; max-height: 140px; padding: 6px 0; line-height: 1.45; }
.send { width: 36px; height: 36px; border-radius: 10px; border: 0; background: linear-gradient(135deg, #3d7bff, #8b5cff); font-size: 14px; flex: none; }
.send:disabled { opacity: .4; }
.model-line { font-family: var(--mono); font-size: 10.5px; color: var(--dim); text-align: center; }
.model-line button { border: 0; background: none; color: var(--accent); font-size: inherit; font-family: inherit; padding: 0; }

/* ------------------------------------------------ toolbar */
#toolbar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: blur(16px); z-index: 16; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.tool { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 8px 11px; border-radius: 11px; font-size: 12.5px; color: var(--muted); transition: .15s; white-space: nowrap; }
.tool span { font-size: 15px; }
.tool em { font-style: normal; }
.tool:hover { color: var(--text); background: rgba(110, 168, 255, .08); }
.tool.on { color: #fff; background: rgba(110, 168, 255, .2); box-shadow: inset 0 0 0 1px var(--line-2); }
.slider-tool input { width: 80px; }
.tool-group { position: relative; }
.pop { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); background: var(--glass); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; backdrop-filter: blur(16px); width: 250px; display: grid; gap: 10px; }
.seg { display: flex; gap: 3px; background: rgba(5, 8, 18, .6); border-radius: 9px; padding: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.seg button.on { background: rgba(110, 168, 255, .25); color: #fff; }
input[type=range] { accent-color: var(--accent); }

/* ------------------------------------------------ EEG */
#eeg { position: fixed; left: 16px; bottom: 16px; width: var(--left-w); height: 172px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(16px); z-index: 15; padding: 8px 10px; display: grid; grid-template-rows: auto 1fr auto; }
.eeg-title { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; }
.eeg-title span { font-family: var(--mono); letter-spacing: 0; text-transform: none; color: var(--ok); }
#eegCanvas { width: 100%; height: 100%; min-height: 0; }
.bands { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.band { font-size: 9.5px; font-family: var(--mono); display: grid; gap: 3px; }
.band i { height: 3px; background: rgba(255, 255, 255, .06); border-radius: 3px; overflow: hidden; }
.band b { display: block; height: 100%; transition: width .3s; }

/* ------------------------------------------------ labels / tooltip */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.lbl { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); font-size: 11px; font-weight: 500; white-space: nowrap; color: #fff; text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, .8); padding-bottom: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; }
.lbl::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 1px; height: 12px; background: linear-gradient(var(--c), transparent); }
.lbl::before { content: ''; position: absolute; left: calc(50% - 3px); bottom: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.lbl.show { opacity: .9; }
.lbl.hot { opacity: 1; font-size: 13px; font-weight: 700; color: var(--c); z-index: 2; }
#tooltip { position: fixed; z-index: 30; pointer-events: none; background: rgba(6, 10, 22, .9); border: 1px solid var(--c, var(--line-2)); border-radius: 10px; padding: 7px 11px; font-size: 12.5px; max-width: 280px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
#tooltip b { color: var(--c); display: block; }
#tooltip small { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------ timeline */
#timeline { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - var(--left-w) - var(--right-w) - 64px)); background: var(--glass); border: 1px solid var(--hot); border-radius: var(--radius); padding: 10px 14px; z-index: 16; backdrop-filter: blur(16px); box-shadow: 0 0 40px -12px var(--hot); }
.tl-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--hot); font-weight: 700; }
.tl-head .icon-btn { width: 24px; height: 24px; font-size: 11px; }
.tl-step { font-size: 14.5px; margin: 6px 0 8px; min-height: 1.4em; animation: fadein .35s; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.tl-bar { height: 3px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
.tl-nav { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.tl-nav .icon-btn { width: 28px; height: 28px; font-size: 11px; flex: none; }
.tl-dots { display: flex; gap: 5px; flex: 1; flex-wrap: wrap; justify-content: center; }
.tl-dots button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); font-size: 10px; font-family: var(--mono); color: var(--muted); padding: 0; }
.tl-dots button.seen { color: var(--text); border-color: rgba(255, 95, 138, .45); }
.tl-dots button.on { background: var(--hot); border-color: var(--hot); color: #fff; box-shadow: 0 0 12px -2px var(--hot); }
#timeline.review .tl-step { font-size: 15.5px; line-height: 1.45; max-height: 30vh; overflow-y: auto; user-select: text; -webkit-user-select: text; }
.tl-regions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tl-regions span { font-size: 11px; border: 1px solid var(--c); color: var(--c); border-radius: 999px; padding: 1px 8px; cursor: pointer; }
.tl-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--hot), var(--warn)); transition: width .2s linear; }

/* ------------------------------------------------ modals */
#modal, #help { position: fixed; inset: 0; background: rgba(2, 4, 10, .6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal-card { width: min(520px, 100%); background: #0b1124; border: 1px solid var(--line-2); border-radius: 18px; padding: 18px; display: grid; gap: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-card label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
#modelSelect { height: 180px; font-family: var(--mono); font-size: 12px; }
#modelSelect option { padding: 3px 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: 11px; background: rgba(110, 168, 255, .14); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; color: var(--text); }

/* ------------------------------------------------ responsivo */
@media (max-width: 1180px) { :root { --left-w: 280px; --right-w: 350px; } .tool { padding: 8px 8px; } .tool em, .tool:not(.slider-tool) { font-size: 0; } .tool span { font-size: 16px; } }
@media (max-width: 860px) {
  .only-mobile { display: grid; }
  .brand small, #eeg { display: none; }
  #left, #right { top: 60px; bottom: 80px; width: calc(100vw - 32px); transform: translateX(calc(-100% - 32px)); transition: transform .25s; }
  #right { transform: translateX(calc(100% + 32px)); }
  #left.open, #right.open { transform: none; }
  #toolbar { max-width: calc(100vw - 32px); overflow-x: auto; }
  #timeline { width: calc(100vw - 32px); }
  .status { display: none; }
}

/* ------------------------------------------------ cena interpretada pela IA */
.scene-form { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line-2); border-radius: 12px; background: linear-gradient(135deg, rgba(199, 125, 255, .08), rgba(110, 168, 255, .05)); }
.scene-form label { font-size: 12px; font-weight: 700; color: var(--accent-2); letter-spacing: .04em; }
.scene-form textarea { resize: vertical; min-height: 64px; max-height: 200px; background: rgba(5, 8, 18, .6); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: inherit; font-size: 13px; padding: 8px 10px; outline: none; user-select: text; -webkit-user-select: text; }
.scene-form textarea:focus { border-color: var(--accent-2); }
.scene-form .btn:disabled { opacity: .5; cursor: wait; }
#sceneResult:empty { display: none; }
#sceneResult { margin-bottom: 10px; }
.scene-card { border: 1px solid var(--accent-2); border-radius: 12px; padding: 11px 12px; background: rgba(12, 18, 36, .55); display: grid; gap: 9px; font-size: 12.8px; line-height: 1.45; user-select: text; -webkit-user-select: text; }
.scene-card h3 { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.scene-card h4 { margin: 0 0 4px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.scene-card p { margin: 0; }
.scene-card ul { margin: 0; padding-left: 16px; }
.scene-card li { margin: 2px 0; }
.scene-card .tag { font-size: 10.5px; font-family: var(--mono); color: var(--dim); text-transform: uppercase; margin-right: 4px; }
.emo { display: grid; grid-template-columns: 1fr 44px; gap: 2px 8px; margin: 5px 0; }
.emo b { font-size: 13px; }
.emo em { font-style: normal; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.emo .bar { grid-column: 1 / -1; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.emo .bar i { display: block; height: 100%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.emo small { grid-column: 1 / -1; color: var(--muted); font-size: 11.8px; }
.scene-card .chips { display: flex; flex-wrap: wrap; gap: 5px; }
.scene-card .chips button { font-size: 11px; border: 1px solid var(--c); color: var(--c); background: transparent; border-radius: 999px; padding: 2px 9px; }
.scene-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.scene-err { color: var(--hot); font-size: 12.5px; padding: 8px; }
.scene-steps { margin: 0; padding-left: 18px; }
.scene-steps li { margin: 3px 0; }
.scene-steps a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--line-2); }
.scene-steps a:hover { color: var(--hot); border-color: var(--hot); }
.tl-sub { font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--muted); font-size: 11px; }
