:root {
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #eef1f7; --text: #0f1729; --muted: #5b6478;
  --border: #dde2ec; --brand: #3b5bfd; --brand-2: #10b3a3; --danger: #d33a4a; --ok: #149a5b;
  --shadow: 0 8px 30px rgba(15, 23, 41, .08); --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --surface: #121a30; --surface-2: #19223d; --text: #e8ecf6; --muted: #9aa5be;
    --border: #26304d; --brand: #7b93ff; --brand-2: #3fd6c6; --danger: #ff6b7a; --ok: #3fd68b;
    --shadow: 0 8px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules (e.g. .suggest flex) must not un-hide */
body { margin: 0; background: var(--bg); color: var(--text); overflow-x: hidden;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.ico { flex: none; vertical-align: -4px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { font-weight: 800; letter-spacing: .2px; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav > a, .menu > summary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; cursor: pointer; list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.nav > a.active, .nav > a:hover, .menu > summary.active, .menu > summary:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; padding: 6px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.menu-item, .menu-item-form button.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border-radius: 10px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item.active { background: var(--surface-2); text-decoration: none; }
.menu-item b { display: block; font-weight: 650; }
.menu-item small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.menu-item .ico { color: var(--brand); }
.menu-item-form { margin: 0; }
.menu-list { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px; }
.topbar .god-lock-badge { margin-left: 8px; }

/* phone: bottom tab bar instead of the top nav */
.tabbar { display: none; }
@media (max-width: 760px) {
  .topbar .wrap { height: 52px; }
  .topbar .nav { display: none; }
  .topbar .god-lock-badge { margin-left: auto; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
    color: var(--muted); font-size: 11.5px; font-weight: 650; border-radius: 12px; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a:hover { text-decoration: none; }
  body.has-tabs .page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .wrap { padding: 0 16px; }
  .page { padding-top: 18px; }
}
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; border-radius: 999px;
  padding: 11px 20px; font-weight: 700; font-size: 15px; background: var(--brand); color: #fff; text-decoration: none; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.muted { color: var(--muted); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi .value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi .sub { color: var(--muted); font-size: 13px; }
h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.5px; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.page { padding-top: 28px; padding-bottom: 60px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.bad { color: var(--danger); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
input, textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; }
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); }
label { font-weight: 600; font-size: 14px; display: block; margin: 12px 0 6px; }
.error { color: var(--danger); font-weight: 600; }

/* landing */
.hero { padding: 64px 0 40px; display: grid; gap: 32px; grid-template-columns: 1.2fr 1fr; align-items: center; }
.hero p.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual { aspect-ratio: 1 / 1; max-width: 360px; width: 100%; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--brand-2) 80%, white), var(--brand) 55%, #1b2a7a 100%);
  box-shadow: 0 30px 80px color-mix(in srgb, var(--brand) 40%, transparent); position: relative; }
.hero-visual::after { content: ""; position: absolute; inset: -18px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand) 30%, transparent); animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.05); opacity: .25; } }
.section { padding: 36px 0; }
.feature .icon { font-size: 26px; }
.steps { counter-reset: s; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .card::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; margin-bottom: 8px; }
.soon { font-size: 12px; font-weight: 700; color: var(--brand-2); }
footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; padding-top: 36px; } .hero-visual { max-width: 220px; } }
.hero .hero-visual { max-width: 260px; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 420px; }
/* conversation pages (assistant home, store Q&A): full-height, no card chrome, composer at the bottom */
.chat.convo { height: calc(100dvh - 60px - 28px - 36px); min-height: 360px; max-width: 760px; margin: 0 auto; }
@media (max-width: 760px) { .chat.convo { height: calc(100dvh - 52px - 18px - 96px - env(safe-area-inset-bottom)); } }
.convo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 8px; }
.convo-head h2 { margin: 0; font-size: 22px; }
.convo-head p { margin: 2px 0 0; font-size: 14px; }
.starter { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
.starter .suggest { margin: 0; }
.starter:has(#suggest[hidden]) .shortcut { display: none; }
.shortcut { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); }
.shortcut:hover { text-decoration: none; border-color: var(--brand); }
.shortcut > span { flex: 1; }
.shortcut b { display: block; font-weight: 650; }
.shortcut small { display: block; color: var(--muted); font-size: 12.5px; }
.shortcut .ico:first-child { color: var(--danger); }
.composer .field { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; padding: 4px 4px 4px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; }
.composer .field:focus-within { border-color: var(--brand); }
.composer .field textarea, .composer .field input { border: 0; background: transparent; padding: 10px 4px 10px 16px; outline: none; }
.composer .field .web-toggle { border: 0; padding: 8px 10px; margin-bottom: 2px; border-radius: 16px; color: var(--muted); }
.composer .field .web-toggle:has(input:checked) { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.composer .field .web-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-btn { flex: none; width: 46px; height: 46px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; align-self: flex-end; }
.icon-btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.icon-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-btn.mic-btn { width: auto; min-width: 46px; padding: 0 12px; border-radius: 23px; }
.back { display: inline-block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h2 { margin: 0; }
.page-head p { margin: 2px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpi .value.small { font-size: 19px; }
.btn.block { width: 100%; justify-content: center; margin-top: 18px; }
.auth { max-width: 400px; margin: 32px auto; }
.auth-mark .dot { display: block; width: 40px; height: 40px; border-radius: 50%; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
details.tech summary { cursor: pointer; }
.messages { flex: 1; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; }
.msg.owner { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.jarvis { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg .meta { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.msg.owner .meta { color: rgba(255, 255, 255, .8); }
.composer { display: flex; gap: 10px; padding-top: 12px; }
.composer input { flex: 1; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.suggest button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }

/* personal assistant + markdown answers */
.chat-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap;
  padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.chat-head p { margin: 2px 0 0; font-size: 13px; }
.chat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.composer textarea { flex: 1; resize: none; max-height: 220px; line-height: 1.45; }
.composer button:disabled { opacity: .6; cursor: progress; }
.web-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.web-toggle input { width: auto; margin: 0; }
.web-toggle:has(input:checked) { border-color: var(--brand); color: var(--brand); }
.msg.pending { color: var(--muted); }
.md { white-space: normal; }
.md p { margin: 0 0 8px; }
.md > :last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 22px; }
.md h4 { margin: 10px 0 6px; font-size: 15px; }
.md pre { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; overflow-x: auto; margin: 6px 0 8px; }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.md :not(pre) > code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; }
.md table { margin: 6px 0 8px; font-size: 13.5px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.line.result { background: var(--surface); border: 1px solid var(--border); }

/* god mode */
.nav a.god-link { color: var(--danger); }
.god-banner { display: flex; gap: 10px; align-items: flex-start; background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border));
  padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13.5px; }
.god-banner .ico { color: var(--danger); margin-top: 2px; }
.god-modal-msg { font-size: 13px; text-align: center; margin-bottom: 12px; font-weight: 600; }
.god-modal-msg.err { color: #ef4444; } .god-modal-msg.ok { color: #34d399; }
#console .chat-actions select { padding: 6px 10px; font-size: 13px; }
.msg.tool { align-self: stretch; max-width: 100%; background: var(--surface-2); border-radius: 10px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
details.msg.tool-result { align-self: stretch; max-width: 100%; padding: 4px 12px; border: 1px dashed var(--border); border-radius: 10px; white-space: normal; }
details.msg.tool-result summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
details.msg.tool-result.error summary { color: var(--danger); }
details.msg.tool-result pre { white-space: pre-wrap; font-size: 12.5px; max-height: 320px; overflow: auto; margin: 6px 0; }
.msg.system-err { align-self: center; color: var(--danger); font-size: 13px; }
.msg.meta-line { align-self: flex-start; color: var(--muted); font-size: 12px; padding: 0 4px; }
.mic-btn { white-space: nowrap; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.mic-btn.listening { background: #e02424 !important; color: #fff !important; border-color: #e02424 !important; animation: mic-pulse 1.2s infinite; }
@keyframes mic-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
.telemetry-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.telemetry-item { display: flex; flex-direction: column; gap: 2px; }
.telemetry-lbl { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--muted); letter-spacing: .4px; }
.telemetry-val { font-size: 16px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.msg.tool.subagent { border-left: 3px solid #3b82f6; background: color-mix(in srgb, #3b82f6 10%, var(--surface-2)); }
.panel-task-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }
.panel-task-row:hover { background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); }

/* voice */
.voice { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .voice { grid-template-columns: minmax(0, 1fr); } }
.voice-stage { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.persona-pick { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.persona-pick label { margin: 0; font-size: inherit; }
.persona-pick select { border-radius: 999px; padding: 7px 12px; font-weight: 650; }
.voice-hint { text-align: center; font-size: 13px; margin: 6px 0 0; max-width: 420px; }
.voice .settings { width: 100%; max-width: 440px; margin-top: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.voice .settings > summary { padding: 12px 16px; cursor: pointer; font-weight: 650; font-size: 14px; color: var(--muted); }
.settings-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 16px 16px; }
.setting { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.setting-label { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.setting-row { display: flex; gap: 8px; }
.setting select, .setting-row select { width: 100%; min-width: 0; max-width: 100%; }
.voice .voice-mode-tabs { margin: 0; }
.voice .mode-tab { padding: 8px 10px; }
.voice-transcript-card { min-width: 0; }
@media (max-width: 760px) { .voice .orb { width: 180px; height: 180px; } .voice .orb-glow-backdrop { width: 220px; height: 220px; } }

.voice-mode-tabs {
  display: flex; gap: 8px; background: var(--surface-2); padding: 4px; border-radius: 14px;
  margin-bottom: 16px; border: 1px solid var(--border);
}
.mode-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; border: none; background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .2s ease;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active {
  background: var(--surface); color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12); border: 1px solid var(--border);
}
.mode-tab .tab-icon { font-size: 16px; }

/* Fluid Animated Gradient Orb */
.orb-wrap { display: grid; place-items: center; padding: 20px 0; position: relative; }
.orb-glow-backdrop {
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 40%, transparent) 0%, transparent 70%);
  filter: blur(24px); opacity: 0.4; transition: opacity .4s ease, transform .4s ease;
  pointer-events: none; z-index: 1;
}

.orb {
  width: 210px; height: 210px; border-radius: 50%; border: 0; cursor: pointer;
  position: relative; color: #fff; z-index: 2;
  font-weight: 700; font-size: 15px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #1e3a8a, #0284c7, #06b6d4, #3b82f6);
  background-size: 300% 300%;
  box-shadow: 0 15px 45px rgba(2, 132, 199, 0.35), inset 0 2px 10px rgba(255,255,255,0.4);
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .25s ease;
  animation: fluid-gradient 8s ease infinite;
}
.orb:hover { transform: scale(1.03); }
.orb:active { transform: scale(.96); }

/* Visualizer Wave Bars inside Orb */
.orb-visualizer {
  display: flex; align-items: center; justify-content: center; gap: 5px; height: 32px;
}
.wave-bar {
  width: 4px; height: 6px; background: rgba(255,255,255,0.85); border-radius: 4px;
  transition: height .15s ease;
}

/* Orb States */
.orb.listening {
  background: linear-gradient(135deg, #0284c7, #06b6d4, #10b981, #0ea5e9);
  background-size: 300% 300%;
  box-shadow: 0 0 0 12px color-mix(in srgb, var(--brand) 20%, transparent), 0 20px 50px rgba(6, 182, 212, 0.45);
  animation: fluid-gradient 4s ease infinite, breathe-pulse 2s ease-in-out infinite;
}
.orb.listening .wave-bar {
  animation: bar-listen 1.2s ease-in-out infinite alternate;
}
.orb.listening .wave-bar.b1 { animation-delay: 0.1s; }
.orb.listening .wave-bar.b2 { animation-delay: 0.3s; }
.orb.listening .wave-bar.b3 { animation-delay: 0.5s; }
.orb.listening .wave-bar.b4 { animation-delay: 0.2s; }
.orb.listening .wave-bar.b5 { animation-delay: 0.4s; }

.orb.thinking {
  background: linear-gradient(135deg, #d97706, #f59e0b, #fbbf24, #b45309);
  background-size: 300% 300%;
  box-shadow: 0 0 0 10px rgba(245, 158, 11, 0.2), 0 20px 50px rgba(245, 158, 11, 0.4);
  animation: fluid-gradient 2.5s ease infinite, pulse-fast 1s ease-in-out infinite alternate;
}
.orb.thinking .wave-bar {
  animation: bar-think 0.8s ease-in-out infinite alternate;
}

.orb.speaking {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899, #3b82f6, #06b6d4);
  background-size: 400% 400%;
  box-shadow: 0 0 0 16px rgba(139, 92, 246, 0.25), 0 25px 65px rgba(236, 72, 153, 0.45);
  animation: fluid-gradient 2s ease infinite, speak-wave 1s ease-in-out infinite alternate;
}
.orb-glow-backdrop.speaking {
  opacity: 0.8; transform: scale(1.15);
  background: radial-gradient(circle, rgba(168, 85, 247, 0.5) 0%, rgba(236, 72, 153, 0.3) 40%, transparent 70%);
}
.orb.speaking .wave-bar {
  animation: bar-speak 0.4s ease-in-out infinite alternate;
}
.orb.speaking .wave-bar.b1 { animation-delay: 0.05s; }
.orb.speaking .wave-bar.b2 { animation-delay: 0.2s; }
.orb.speaking .wave-bar.b3 { animation-delay: 0.35s; }
.orb.speaking .wave-bar.b4 { animation-delay: 0.15s; }
.orb.speaking .wave-bar.b5 { animation-delay: 0.25s; }

@keyframes fluid-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes breathe-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 30%, transparent); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 16px transparent; }
}
@keyframes pulse-fast {
  from { transform: scale(0.98); } to { transform: scale(1.02); }
}
@keyframes speak-wave {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1.02); }
}
@keyframes bar-listen {
  from { height: 6px; } to { height: 16px; }
}
@keyframes bar-think {
  from { height: 4px; } to { height: 12px; }
}
@keyframes bar-speak {
  0% { height: 6px; } 50% { height: 26px; } 100% { height: 12px; }
}

/* Push to Talk Button Wrap */
.ptt-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0;
}
.btn-ptt {
  width: 100%; max-width: 320px; padding: 18px 24px; border-radius: 16px; border: none;
  background: linear-gradient(135deg, var(--brand), #0284c7); color: #fff;
  font-size: 15px; font-weight: 800; letter-spacing: 0.5px; cursor: pointer;
  box-shadow: 0 10px 25px color-mix(in srgb, var(--brand) 35%, transparent);
  transition: all .15s ease; user-select: none; -webkit-user-select: none;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-ptt:hover { transform: translateY(-2px); box-shadow: 0 12px 30px color-mix(in srgb, var(--brand) 45%, transparent); }
.btn-ptt:active, .btn-ptt.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  transform: scale(0.97); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.3) !important;
}
.ptt-hint { font-size: 12px; color: var(--muted); text-align: center; }

/* Live Task Progress Card */
.task-progress-card {
  margin: 14px 0; padding: 12px 16px; border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  animation: fadeIn .3s ease;
}
.task-progress-header { display: flex; align-items: center; gap: 10px; }
.task-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--brand) 40%, transparent);
  border-top-color: var(--brand); animation: spin .8s linear infinite;
}
.task-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.task-progress-detail {
  font-size: 12px; color: var(--muted); margin-top: 4px; padding-left: 26px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Capabilities Guide */
.capabilities-box {
  margin: 16px 0; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); overflow: hidden;
}
.capabilities-toggle {
  padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; list-style: none;
  color: var(--text);
}
.capabilities-toggle::-webkit-details-marker { display: none; }
.capabilities-box[open] .toggle-icon { transform: rotate(180deg); }
.toggle-icon { font-size: 10px; transition: transform .2s ease; }
.capabilities-content { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 12.5px; }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .cap-grid { grid-template-columns: 1fr; } }
.cap-item { background: var(--surface); padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.cap-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 6px; margin-bottom: 6px; }
.cap-god { background: #fee2e2; color: #b91c1c; }
.cap-multi { background: #e0e7ff; color: #4338ca; }
.cap-biz { background: #dcfce7; color: #15803d; }
.cap-ai { background: #fef3c7; color: #b45309; }
.cap-item ul { margin: 0; padding-left: 18px; line-height: 1.5; color: var(--text); }

.state { text-align: center; color: var(--muted); font-weight: 600; margin-top: 8px; min-height: 24px; }
.transcript-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.transcript { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.line { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.line.owner { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.line.system { color: var(--muted); font-size: 13px; background: transparent; padding: 2px 4px; }
.line small { color: var(--muted); display: block; font-size: 11.5px; }

.controls { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.ctrl-group { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }

/* God 2FA Unlock Modal Popup */
.god-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: godModalFadeIn .2s ease-out;
}
@keyframes godModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.god-modal-card {
  background: #111827;
  border: 1px solid #1f2942;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 24px rgba(59, 91, 253, 0.25);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  padding: 24px;
  box-sizing: border-box;
  animation: godModalSlideUp .25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes godModalSlideUp {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.god-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.god-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}
.god-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 6px;
  transition: all .15s ease;
}
.god-modal-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.god-modal-desc {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0 0 18px;
}
.god-code-input {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
  font-family: monospace;
  font-size: 32px;
  letter-spacing: 12px;
  text-align: center;
  padding: 10px;
  background: #090d16;
  border: 2px solid #3b5bfd;
  border-radius: 12px;
  color: #60a5fa;
  outline: none;
  box-sizing: border-box;
  transition: all .2s ease;
}
.god-code-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 16px rgba(59, 91, 253, 0.4);
}
.god-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.god-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all .15s ease;
  background: transparent;
}
.god-lock-badge.locked {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #ef4444;
}
.god-lock-badge.unlocked {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #10b981;
}


/* server console on phones: the prompt gets its own full-width row, the controls sit under it */
#console .composer { flex-wrap: wrap; align-items: center; }
#console .composer textarea { min-width: 0; }
@media (max-width: 760px) {
  #console .composer textarea { flex: 1 1 100%; order: -1; }
  #console .composer .web-toggle { flex: 1 1 0; min-width: 0; height: 46px; justify-content: flex-start; gap: 8px; }
  #console .composer #send, #console .composer #stop { flex: none; }
  #console.chat { height: auto; min-height: 70vh; }
  #console .messages { min-height: 40vh; }
}
