/* ORION AI — interface */
:root {
  --bg: #07090f;
  --bg-2: #0b0f19;
  --panel: #0e1320;
  --panel-2: #121929;
  --raised: #172036;
  --line: rgba(148, 163, 184, 0.12);
  --line-2: rgba(148, 163, 184, 0.2);
  --text: #e6ebf5;
  --text-2: #a3aec4;
  --text-3: #6b7790;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --side-w: 430px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }
::selection { background: rgba(34, 211, 238, 0.3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.18); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(148, 163, 184, 0.3); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--raised); color: var(--text);
  font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: #1d2842; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #22d3ee, #6366f1); color: #04121a; border: 0; }
.btn-primary:hover { background: linear-gradient(135deg, #3ee0f5, #7c7ff7); box-shadow: 0 6px 20px -6px rgba(34, 211, 238, 0.55); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.08); color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2); transition: background .15s, color .15s;
  text-decoration: none; flex-shrink: 0;
}
.icon-btn:hover { background: rgba(148, 163, 184, 0.1); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }
.icon-btn.sm { width: 26px; height: 26px; }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 12px; font-weight: 600; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.chip {
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; transition: all .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(148, 163, 184, 0.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
.spinner.sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ topo */
.topbar {
  height: 54px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: rgba(7, 9, 15, 0.9); backdrop-filter: blur(10px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #e0fbff 0 18%, #22d3ee 30%, #6366f1 70%, transparent 72%);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.55);
}
.brand-name { font-family: 'Orbitron', var(--font); font-weight: 800; letter-spacing: 3px; font-size: 15px; }
.repo-pill {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; max-width: 420px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--text-2); font-size: 13px; transition: border-color .15s;
}
.repo-pill:hover { border-color: var(--accent); color: var(--text); }
.repo-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.repo-branch { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #475569; flex-shrink: 0; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.dot.busy { background: var(--warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.dot.err { background: var(--err); }
.topbar-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); max-width: 340px; }
.topbar-status span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
#open-keys-btn.connected { border-color: rgba(52, 211, 153, 0.4); color: var(--ok); }

/* ------------------------------------------------------------------ layout */
.workspace { flex: 1; min-height: 0; display: flex; position: relative; }
.side { width: var(--side-w); min-width: 340px; max-width: 70vw; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--line); min-height: 0; }
.resizer { width: 5px; cursor: col-resize; background: transparent; flex-shrink: 0; margin-left: -3px; z-index: 5; transition: background .15s; }
.resizer:hover, .resizer.dragging { background: rgba(34, 211, 238, 0.35); }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
body.resizing iframe { pointer-events: none; }
body.resizing { cursor: col-resize; user-select: none; }

/* ------------------------------------------------------------------ voz */
.voice-dock { display: flex; gap: 14px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 20% 50%, rgba(34, 211, 238, 0.07), transparent 70%); }
.orb-box { position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.orb-canvas { width: 100%; height: 100%; display: block; }
.orb-expand { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-3); display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.orb-box:hover .orb-expand { opacity: 1; }
.voice-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.voice-state { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); }
.voice-state.listening { color: var(--ok); }
.voice-state.speaking { color: var(--accent-2); }
.voice-caption { font-size: 13px; color: var(--text-2); min-height: 40px; max-height: 60px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.voice-caption .you { color: var(--text); }
.voice-controls { display: flex; gap: 6px; align-items: center; }
.btn-voice { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(34, 211, 238, 0.35); border-radius: 999px; }
.btn-voice:hover { background: rgba(34, 211, 238, 0.2); }
.btn-voice.live { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; border-color: transparent; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.45); } 50% { box-shadow: 0 0 0 7px rgba(244, 63, 94, 0); } }
#mute-btn.active { color: var(--err); background: rgba(248, 113, 113, 0.12); }

/* ------------------------------------------------------------------ tarefa */
.task-strip { padding: 10px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(129, 140, 248, 0.1), transparent); }
.task-head { display: flex; align-items: center; gap: 8px; }
.task-title { flex: 1; font-weight: 600; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-step { font-size: 12px; color: var(--text-3); margin-top: 3px; padding-left: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ chat */
.chat-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.chat-toolbar-title { margin-right: auto; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-3); }
.view-toggles { display: flex; gap: 4px; margin-right: 4px; }
.view-toggles .btn.off { color: var(--accent); border-color: rgba(34, 211, 238, 0.4); background: var(--accent-soft); }

/* painéis ocultáveis */
body.chat-hidden .chat, body.chat-hidden .task-strip { display: none; }
body.chat-hidden .voice-dock { flex: 1; flex-direction: column; justify-content: center; text-align: center; border-bottom: 0; background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.08), transparent 70%); }
body.chat-hidden .orb-box { width: min(340px, 80%); height: auto; aspect-ratio: 1; }
body.chat-hidden .voice-info { align-items: center; max-width: 560px; flex: 0; }
body.chat-hidden .voice-caption { font-size: 16px; color: var(--text); max-height: none; -webkit-line-clamp: 5; text-align: center; }
body.chat-hidden .voice-controls { justify-content: center; }
body.preview-hidden .stage, body.preview-hidden .resizer { display: none !important; }
body.preview-hidden .side { width: 100%; max-width: none; border-right: 0; }
body.preview-hidden:not(.chat-hidden) .chat, body.preview-hidden:not(.chat-hidden) .voice-dock, body.preview-hidden:not(.chat-hidden) .task-strip { width: 100%; max-width: 900px; margin: 0 auto; }
body.preview-hidden .chat-toolbar { border-bottom: 1px solid var(--line); }
.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: msg-in .25s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg .avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; background: radial-gradient(circle, #e0fbff 0 18%, #22d3ee 32%, #6366f1 72%); box-shadow: 0 0 12px rgba(34, 211, 238, 0.35); }
.msg.user { flex-direction: row-reverse; }
.msg.user .avatar { background: var(--raised); box-shadow: none; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text-2); }
.msg.user .avatar::after { content: 'VC'; }
.bubble { min-width: 0; max-width: 100%; font-size: 13.5px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--raised); padding: 9px 13px; border-radius: 14px 14px 4px 14px; max-width: 88%; white-space: pre-wrap; }
.msg.assistant .bubble { flex: 1; }
.msg.voice .bubble::before { content: '🎙'; font-size: 11px; margin-right: 6px; opacity: .6; }
.msg.user.voice .bubble::before { content: '🎙'; }
.msg.interim .bubble { opacity: .6; font-style: italic; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.bubble li { margin: 2px 0; }
.bubble code { font-family: var(--mono); font-size: 12px; background: rgba(148, 163, 184, 0.12); padding: 1px 5px; border-radius: 4px; }
.bubble pre { position: relative; background: #0a0e18; border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; margin: 8px 0; }
.bubble pre code { background: none; padding: 0; font-size: 12px; }
.bubble h1, .bubble h2, .bubble h3 { font-size: 14px; margin: 10px 0 6px; }
.bubble a { color: var(--accent); }
.bubble.error { color: #fecaca; }
.msg-meta { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--text-3); margin-top: 6px; }
.msg-meta button { background: none; border: 0; color: var(--text-3); font-size: 11px; padding: 0; }
.msg-meta button:hover { color: var(--accent); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.code-copy { position: absolute; top: 6px; right: 6px; font-size: 11px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); border-radius: 6px; padding: 2px 8px; }

.steps { margin: 6px 0 2px; display: flex; flex-direction: column; gap: 3px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 3px 0; }
.step .ico { width: 14px; height: 14px; flex-shrink: 0; display: grid; place-items: center; }
.step.done .ico::before { content: '✓'; color: var(--ok); font-weight: 700; font-size: 11px; }
.step.error .ico::before { content: '✕'; color: var(--err); font-weight: 700; font-size: 11px; }
.step.error { color: #fca5a5; }
.step .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11.5px; }
.step .err { color: var(--err); font-family: var(--font); white-space: normal; }
.steps-toggle { font-size: 11px; color: var(--text-3); background: none; border: 0; padding: 0; margin-top: 2px; }
.commit-card { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border: 1px solid rgba(52, 211, 153, 0.25); background: rgba(52, 211, 153, 0.06); border-radius: 10px; font-size: 12px; color: var(--text-2); }
.commit-card a { color: var(--ok); font-family: var(--mono); text-decoration: none; }

.attachments { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 14px 0; }
.att { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 8px; background: var(--raised); font-size: 12px; max-width: 220px; }
.att img { width: 28px; height: 28px; border-radius: 5px; object-fit: cover; }
.att span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.att button { background: none; border: 0; color: var(--text-3); font-size: 15px; line-height: 1; }
.msg-images { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-images img { max-width: 140px; max-height: 100px; border-radius: 8px; }

.quick-prompts { display: flex; gap: 6px; padding: 8px 14px 0; overflow-x: auto; scrollbar-width: none; }
.quick-prompts::-webkit-scrollbar { display: none; }
.composer { margin: 10px 14px 14px; display: flex; align-items: flex-end; gap: 6px; padding: 6px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 7px 4px; max-height: 180px; line-height: 1.45; font-size: 14px; }
.composer textarea::placeholder { color: var(--text-3); }
.send-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; display: grid; place-items: center; background: linear-gradient(135deg, #22d3ee, #6366f1); color: #04121a; flex-shrink: 0; transition: transform .1s, opacity .15s; }
.send-btn:hover { transform: scale(1.04); }
.send-btn.busy { background: var(--raised); color: var(--text); }
.chat.drag-over .composer { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2); }

/* ------------------------------------------------------------------ palco */
.stage-tabs { height: 44px; display: flex; align-items: center; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.tab { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-3); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--panel-2); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 10px; display: inline-grid; place-items: center; }
.stage-status { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); }
.tab-pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab-pane.active { display: flex; }

.preview-toolbar { height: 46px; display: flex; align-items: center; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.route-box { flex: 1; min-width: 120px; display: flex; align-items: center; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 10px; margin: 0 6px; font-family: var(--mono); font-size: 12px; }
.route-host { color: var(--text-3); white-space: nowrap; }
.route-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 0 0 2px; font-family: var(--mono); font-size: 12px; }
.device-switch { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--panel); margin-right: 4px; }
.device-switch .icon-btn { width: 30px; height: 28px; }

.preview-area { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; background: repeating-conic-gradient(#0a0d15 0 25%, #0b0f18 0 50%) 0 0 / 22px 22px; overflow: auto; }
.device-frame { width: 100%; height: 100%; transition: width .3s ease, height .3s ease, margin .3s; background: #fff; }
.device-frame.tablet { width: 820px; max-width: 100%; height: calc(100% - 32px); margin: 16px 0; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line-2); }
.device-frame.mobile { width: 390px; max-width: 100%; height: min(844px, calc(100% - 32px)); margin: 16px 0; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 6px #1e293b; }
.device-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.preview-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px; background: var(--bg); }
.preview-empty h3 { margin: 6px 0 0; font-size: 18px; }
.preview-empty p { margin: 0; color: var(--text-2); max-width: 440px; }
.empty-art { width: 92px; height: 92px; border-radius: 22px; background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(99, 102, 241, 0.2)); border: 1px solid var(--line-2); position: relative; }
.empty-art::before { content: ''; position: absolute; inset: 18px 14px 30px; border-radius: 6px; border: 2px solid rgba(34, 211, 238, 0.6); }
.empty-art::after { content: ''; position: absolute; left: 30px; right: 30px; bottom: 18px; height: 3px; border-radius: 3px; background: rgba(99, 102, 241, 0.7); }
.preview-empty.loading .empty-art { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .7; } }

.error-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid rgba(248, 113, 113, 0.35); background: rgba(127, 29, 29, 0.25); font-size: 12.5px; }
.error-icon { width: 20px; height: 20px; border-radius: 50%; background: var(--err); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.error-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #fecaca; font-family: var(--mono); font-size: 12px; }
.errors-pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; color: #fecaca; background: #0a0e18; padding: 12px; border-radius: 8px; max-height: 60vh; overflow: auto; margin: 0; }

/* código */
.code-layout { flex: 1; min-height: 0; display: flex; }
.file-list { width: 280px; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.file-filter { margin: 10px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 10px; outline: 0; font-size: 12px; }
.file-items { flex: 1; overflow: auto; padding: 0 6px 10px; font-family: var(--mono); font-size: 12px; }
.file-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; color: var(--text-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item:hover { background: rgba(148, 163, 184, 0.08); color: var(--text); }
.file-item.active { background: var(--accent-soft); color: var(--accent); }
.file-item.changed::after { content: '●'; color: var(--warn); margin-left: auto; font-size: 9px; }
.file-item .dir { color: var(--text-3); }
.file-view { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-view-head { height: 38px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.file-code { flex: 1; margin: 0; overflow: auto; padding: 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; background: #0a0d15; }
.file-code code.hljs { background: transparent; padding: 0; }

/* logs */
.logs-toolbar { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.logs-toolbar .muted { margin-right: auto; }
.logs { flex: 1; overflow: auto; padding: 10px 14px; font-family: var(--mono); font-size: 12px; line-height: 1.6; background: #06080d; }
.log-line { white-space: pre-wrap; word-break: break-word; color: #94a3b8; }
.log-line.cmd { color: var(--accent); }
.log-line.warn { color: #fcd34d; }
.log-line.error { color: #fca5a5; }

.mobile-tabs { display: none; }

/* ------------------------------------------------------------------ modo foco */
.focus-overlay { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at center, #0b1430 0%, #03050a 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; }
.focus-orb { width: min(62vh, 80vw); height: min(62vh, 80vw); }
.focus-caption { max-width: 760px; text-align: center; font-size: clamp(16px, 2.2vw, 22px); color: var(--text); min-height: 64px; line-height: 1.45; }
.focus-caption .you { color: var(--text-2); }
.focus-state { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.focus-close { position: absolute; top: 18px; right: 18px; }

/* ------------------------------------------------------------------ modais */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(2, 4, 8, 0.7); backdrop-filter: blur(6px); }
.modal.open { display: flex; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.modal-card.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-tabs { display: flex; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.mtab { height: 36px; padding: 0 12px; border: 0; background: none; color: var(--text-3); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.mtab.active { color: var(--text); border-bottom-color: var(--accent); }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.modal-foot .muted { margin-right: auto; font-size: 12px; }
.mpane { display: none; flex-direction: column; gap: 14px; }
.mpane.active { display: flex; }
.hint { margin: 0; font-size: 12px; color: var(--text-3); }
.hint a { color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 1; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; justify-content: space-between; }
.field label output { color: var(--accent); font-family: var(--mono); }
.field-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
:where(input:not([type=checkbox]):not([type=range]), select, textarea.keys-input) {
  height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 0 10px; outline: 0; width: 100%; transition: border-color .15s;
}
:where(input, select, textarea.keys-input):focus { border-color: rgba(34, 211, 238, 0.6); }
.route-box input:focus { border: 0; }
select { cursor: pointer; }
select option, select optgroup { background: var(--panel); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.secret { position: relative; }
.secret input { padding-right: 36px; font-family: var(--mono); font-size: 12px; }
.secret .icon-btn { position: absolute; right: 5px; top: 5px; }
.search-input { margin-bottom: 4px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); height: 36px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.provider-card { border: 1px solid var(--line); background: var(--bg-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.provider-card.has-keys { border-color: rgba(52, 211, 153, 0.3); }
.provider-head { display: flex; align-items: center; gap: 8px; }
.provider-head strong { font-size: 13px; }
.provider-head .tag { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--raised); color: var(--text-3); font-weight: 600; }
.provider-head .tag.free { background: rgba(52, 211, 153, 0.12); color: var(--ok); }
.provider-head a { margin-left: auto; font-size: 11px; text-decoration: none; }
.provider-desc { font-size: 11.5px; color: var(--text-3); margin: 0; }
textarea.keys-input { height: auto; min-height: 58px; padding: 8px 10px; resize: vertical; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; }
.key-status { display: flex; flex-direction: column; gap: 3px; }
.key-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.key-row .st { font-family: var(--font); font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.st.ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.st.cooldown { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.st.invalid { background: rgba(248, 113, 113, 0.14); color: var(--err); }
.st.testing { background: var(--raised); color: var(--text-3); }
.key-row .why { color: var(--text-3); font-family: var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.provider-actions { display: flex; gap: 8px; }

.repo-list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.repo-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.repo-item:hover { background: rgba(148, 163, 184, 0.07); }
.repo-item.active { background: var(--accent-soft); }
.repo-item .name { font-weight: 600; font-size: 13px; }
.repo-item .meta { font-size: 11px; color: var(--text-3); }
.repo-item .lock { margin-left: auto; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.new-repo summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 600; }
.new-repo .field-row { margin-top: 10px; }

/* ------------------------------------------------------------------ toast */
.toast-host { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .25s; cursor: pointer; }
.toast.show { opacity: 1; transform: none; }
.toast-icon { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0; margin-top: 1px; background: var(--accent); color: #04121a; }
.toast-success .toast-icon { background: var(--ok); }
.toast-error .toast-icon { background: var(--err); color: #fff; }
.toast-warning .toast-icon { background: var(--warn); }

/* ------------------------------------------------------------------ responsivo */
@media (max-width: 900px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-name { display: none; }
  #keys-btn-label { display: none; }
  .repo-pill { max-width: 46vw; }
  .topbar-status { display: none; }
  .workspace { flex-direction: column; }
  .side, .stage { width: 100% !important; max-width: none; min-width: 0; flex: 1; border: 0; }
  .resizer { display: none; }
  .workspace[data-mobile="side"] .stage { display: none; }
  .workspace[data-mobile="stage"] .side { display: none; }
  .mobile-tabs { display: flex; border-top: 1px solid var(--line); background: var(--bg-2); flex-shrink: 0; }
  .mobile-tabs button { flex: 1; height: 46px; border: 0; background: none; color: var(--text-3); font-weight: 600; }
  .mobile-tabs button.active { color: var(--accent); }
  .file-list { width: 42%; }
  .device-switch, #pv-forward { display: none; }
  .view-toggles span { display: none; }
  .provider-grid { grid-template-columns: 1fr; }
}

.logs-toolbar .engine-select { width: auto; height: 28px; font-size: 12px; }
