:root {
  --or: #ff7a45;
  --or2: #ffb38a;
  --cy: #5fd4ff;
  --bg: #000;
  --ink: #e9e4df;
  --mut: #9a948d;
  --line: #24272c;
  --card: #0e1013;
  --ok: #7be08a;
  --bad: #ff6b6b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 16px;
  overscroll-behavior: none;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; }
#app { max-width: 520px; margin: 0 auto; padding: 8px 16px 16px; padding-top: calc(8px + env(safe-area-inset-top)); }
.view[hidden], [hidden] { display: none !important; }

/* holograma */
.holo-svg { display: block; width: min(94vw, 400px); height: auto; aspect-ratio: 1; margin: 0 auto; }
.holo .px { fill: var(--or); }
.holo .eye { fill: #000; }
.holo .mascot, .holo .eyes, .holo .eye { transform-box: fill-box; transform-origin: center; }
.holo .spin { transform-origin: 225px 225px; animation: spin var(--spd, 24s) linear infinite; }
.holo .spinr { transform-origin: 225px 225px; animation: spin var(--spd2, 36s) linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes look { 0%, 100% { transform: translateX(-10px); } 50% { transform: translateX(10px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes breathe { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
.holo.st-idle .eye { animation: blink 4s infinite; }
.holo.st-idle .mascot { animation: breathe 4s ease-in-out infinite; }
.holo.st-listen .mascot { transform: scale(1.06); }
.holo.st-listen .eye { transform: scaleY(1.25); }
.holo.st-think .eyes { animation: look 1.2s ease-in-out infinite; }
.holo.st-think { --spd: 4s; --spd2: 6s; }
.holo.st-speak .mascot { animation: bob .45s ease-in-out infinite; }
.holo.st-listen { --spd: 14s; }
.holo .t-time { font-family: "Segoe UI", system-ui, sans-serif; font-weight: 300; fill: var(--ink); }
.holo .t-mono { font-family: Consolas, "Cascadia Mono", monospace; fill: var(--or2); letter-spacing: 1px; }
.holo .mascot { filter: drop-shadow(0 0 6px rgba(255,122,69,.9)) drop-shadow(0 0 18px rgba(255,122,69,.45)); }
.holo .scan { fill: url(#holoScan); pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .holo .spin, .holo .spinr, .holo .eye, .holo .mascot, .holo .eyes { animation: none !important; }
}

/* textos */
.heard { margin: 6px 0 0; min-height: 22px; color: var(--cy); font-size: 15px; text-align: center; overflow-wrap: anywhere; }
.reply { margin: 6px 0 0; min-height: 44px; font-size: 17px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; max-height: 28vh; overflow-y: auto; }
.notice { margin: 4px 0 0; min-height: 20px; color: var(--or2); font-size: 14px; text-align: center; }

/* microfone */
.mic-fab {
  position: fixed; z-index: 20; right: calc(16px + env(safe-area-inset-right));
  bottom: calc(56px + env(safe-area-inset-bottom) + 16px);
  display: flex; align-items: center; gap: 10px;
}
.mic {
  flex: none; width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--or);
  background: #140a05; display: grid; place-items: center; padding: 0;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  box-shadow: 0 0 22px rgba(255,122,69,.35);
}
.mic svg { width: 36px; height: 36px; fill: var(--or); }
.mic.rec { background: var(--or); box-shadow: 0 0 34px rgba(255,122,69,.8); }
.mic.rec svg { fill: #1a0d06; }
.mic-hint { color: var(--mut); font-size: 13px; text-shadow: 0 0 6px #000, 0 0 6px #000; }
.ghost { min-height: 44px; min-width: 88px; border-radius: 22px; border: 1px solid var(--line); background: #15171b; padding: 0 14px; }

/* texto + botoes */
.text-form { display: flex; gap: 8px; }
.text-form input {
  flex: 1; min-width: 0; min-height: 48px; border-radius: 24px; border: 1px solid var(--line);
  background: #0b0c0e; color: var(--ink); padding: 0 16px; font: inherit; outline: none;
}
.text-form input:focus { border-color: var(--or); }
.send { min-height: 48px; min-width: 80px; border-radius: 24px; border: 0; background: var(--or); color: #1a0d06; font-weight: 600; padding: 0 16px; }
.row { display: flex; gap: 10px; margin-top: 12px; justify-content: center; }
.chip { min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line); background: #101215; }
.chip.on, #mode[aria-pressed="true"] { border-color: var(--or); color: var(--or2); }
#mode[aria-pressed="false"] { border-color: var(--line); color: var(--mut); }

/* abas */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #060708; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; min-height: 56px; border: 0; background: none; color: var(--mut); font-size: 16px; }
.tab.on { color: var(--or); box-shadow: inset 0 2px 0 var(--or); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--or); color: #1a0d06; font-size: 13px; font-weight: 700; margin-left: 4px; }

/* tarefas */
h2 { font-size: 20px; font-weight: 600; margin: 12px 0; }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.task { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.task .t-text { margin: 0 0 6px; overflow-wrap: anywhere; }
.task .t-status { font-size: 13px; font-weight: 600; letter-spacing: .3px; }
.task .t-prog { margin: 4px 0 0; font-size: 14px; color: var(--mut); overflow-wrap: anywhere; }
.task .t-result { margin: 6px 0 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; max-height: 180px; overflow-y: auto; }
.task.s-running .t-status, .task.s-waiting_approval .t-status { color: var(--or); }
.task.s-done .t-status { color: var(--ok); }
.task.s-failed .t-status { color: var(--bad); }
.task.s-queued .t-status, .task.s-cancelled .t-status { color: var(--mut); }
.task button { margin-top: 8px; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: #15171b; }
.empty { color: var(--mut); text-align: center; }

/* aprovacao */
.approval { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: flex; align-items: stretch; justify-content: center; }
.ap-box { width: 100%; max-width: 520px; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; min-height: 0; }
.ap-count { margin: 0; color: var(--mut); font-size: 13px; min-height: 16px; }
.ap-box h2 { color: var(--or); margin: 4px 0 10px; }
.ap-key { border: 1px solid var(--or); background: #140a05; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; overflow-y: auto; max-height: 38vh; }
.ap-key .k-label { color: var(--or2); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 0; }
.ap-key .k-value { margin: 2px 0 10px; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.ap-key .k-value.text { font-size: 18px; font-weight: 400; }
.ap-key > :last-child { margin-bottom: 0; }
.ap-key .k-note { margin: 0 0 10px; color: var(--or2); font-size: 14px; line-height: 1.4; }
.ap-key .k-cmd {
  margin: 2px 0 10px; padding: 10px 12px; background: #000; border: 1px solid var(--or); border-radius: 10px;
  font: 600 15px/1.45 Consolas, "Cascadia Mono", monospace; color: #fff; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ap-label { margin: 6px 0 4px; color: var(--mut); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.ap-input {
  flex: 1; min-height: 80px; margin: 0; overflow: auto; background: #08090b; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; font: 13px/1.5 Consolas, "Cascadia Mono", monospace; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.ap-buttons { display: flex; gap: 12px; margin-top: 14px; }
.ap-buttons button { flex: 1; min-height: 56px; border-radius: 28px; font-size: 18px; font-weight: 600; border: 2px solid; }
.deny { background: #1a0a0a; border-color: var(--bad); color: var(--bad); }
.allow { background: var(--or); border-color: var(--or); color: #1a0d06; }

/* chave ausente */
.locked { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 24px; font-size: 18px; line-height: 1.5; }
