:root {
  --bg: #05080d;
  --bg2: #0a1119;
  --panel: rgba(14, 26, 38, .72);
  --line: rgba(110, 210, 255, .16);
  --line-strong: rgba(110, 210, 255, .38);
  --cyan: #56d6ff;
  --cyan-soft: #9ae6ff;
  --amber: #ffb547;
  --red: #ff5d6c;
  --green: #4fe3a5;
  --text: #e6f4fb;
  --muted: #7f97a8;
  --radius: 14px;
  --head: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(ellipse at 50% 30%, #0d2233 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden;
}
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 70%);
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0 0 .6rem; }
.caps { font-family: var(--head); text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; color: var(--cyan-soft); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
a { color: var(--cyan); }

/* ---------- screens ---------- */
.screen { display: none; position: fixed; inset: 0; }
.screen.active { display: flex; flex-direction: column; }
.screen.center { align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
#screen-boot { gap: 16px; }

/* ---------- cards & forms ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.auth { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.auth .orb-slot { width: 110px; height: 110px; margin: 0 auto; }
.brand { font-size: 2.2rem; letter-spacing: .32em; margin: 4px 0 0 .32em; color: var(--cyan-soft); text-shadow: 0 0 18px rgba(86, 214, 255, .55); }
.brand.small { font-size: 1.5rem; letter-spacing: .12em; margin-left: 0; }
label { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: .82rem; color: var(--muted); }
input, select {
  font: inherit; color: var(--text); background: rgba(3, 10, 16, .7); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; outline: none; transition: border-color .2s, box-shadow .2s; width: 100%;
}
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(86, 214, 255, .15); }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: .95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--cyan); }
.form-error { color: var(--red); min-height: 1em; margin: 0; font-size: .85rem; }
.form-error:empty { display: none; }
.btn {
  font: 600 .95rem var(--head); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  border-radius: 10px; padding: 11px 18px; border: 1px solid var(--line-strong); background: rgba(86, 214, 255, .06);
  color: var(--cyan-soft); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, box-shadow .2s, transform .1s;
}
.btn:hover { background: rgba(86, 214, 255, .14); }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(180deg, #2bb8ea, #127fb0); color: #021018; border-color: transparent; box-shadow: 0 0 18px rgba(86, 214, 255, .35); }
.btn.primary:hover { box-shadow: 0 0 26px rgba(86, 214, 255, .55); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(255, 93, 108, .4); background: rgba(255, 93, 108, .06); }
.btn.small { padding: 7px 10px; font-size: .78rem; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: rgba(3, 10, 16, .6);
  color: var(--cyan-soft); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem;
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn.on { border-color: var(--cyan); box-shadow: 0 0 12px rgba(86, 214, 255, .45); }
.icon-btn.off { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.grid2 .full { grid-column: 1 / -1; }
.inline { display: flex; gap: 8px; }

/* ---------- orb ---------- */
.orb-slot { width: 160px; height: 160px; }
.orb-slot.big { width: min(240px, 52vw); height: min(240px, 52vw); }
.orb, .orb svg { width: 100%; height: 100%; display: block; }
.orb .halo { fill: none; stroke: rgba(86, 214, 255, .12); stroke-width: 1; }
.orb .ring circle, .orb .ticks circle { fill: none; stroke: var(--cyan); stroke-linecap: round; }
.orb .r1 circle { stroke-width: 2; opacity: .7; }
.orb .r2 circle { stroke-width: 1.4; opacity: .5; }
.orb .r3 circle { stroke-width: 3; opacity: .85; }
.orb .ticks circle { stroke-width: 6; opacity: .25; }
.orb .ring, .orb .ticks { transform-origin: 100px 100px; }
.orb .r1 { animation: spin 26s linear infinite; }
.orb .r2 { animation: spin 40s linear infinite reverse; }
.orb .r3 { animation: spin 16s linear infinite; }
.orb .ticks { animation: spin 60s linear infinite reverse; }
.orb .core { transform-origin: 100px 100px; animation: breathe 4s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(86, 214, 255, .8)); }
.orb[data-state="listening"] .core { animation: breathe .9s ease-in-out infinite; }
.orb[data-state="listening"] .ring circle { stroke: #8af0ff; }
.orb[data-state="thinking"] .r1 { animation-duration: 3s; }
.orb[data-state="thinking"] .r3 { animation-duration: 1.6s; }
.orb[data-state="thinking"] .r2 { animation-duration: 4s; }
.orb[data-state="thinking"] .ring circle { stroke: var(--amber); }
.orb[data-state="speaking"] .core { animation: talk .38s ease-in-out infinite alternate; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .9; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes talk { from { transform: scale(.92); } to { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .orb * { animation: none !important; } }

/* ---------- app layout ---------- */

.demo-badge { font-size: .65rem; letter-spacing: .12em; color: var(--amber); border: 1px solid var(--amber); border-radius: 6px; padding: 1px 6px; }
.topnav { display: flex; gap: 2px; }
.topnav button, .tabbar button {
  font: 600 .85rem var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  background: none; border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.topnav button.active { color: var(--cyan-soft); background: rgba(86, 214, 255, .1); }
.role-badge { font: 600 .66rem var(--head); letter-spacing: .14em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--cyan-soft); }
.role-badge.admin { color: var(--amber); border-color: rgba(255, 181, 71, .5); }

.views { flex: 1; min-height: 0; position: relative; z-index: 1; display: flex; }
.views > .view { flex: 1; min-width: 0; }
.chats-panel { width: 280px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: rgba(5, 8, 13, .35); }
.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.chats-top { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-search { border-radius: 999px; padding: 9px 14px; font-size: .9rem; }
.chat-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.chat-group { font: 600 .68rem var(--head); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 4px; }
.chat-item { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text); border: 1px solid transparent; }
.chat-item:hover { background: rgba(86, 214, 255, .06); }
.chat-item.active { background: rgba(86, 214, 255, .12); border-color: var(--line-strong); }
.chat-item .ci-main { flex: 1; min-width: 0; }
.chat-item .ci-title { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .ci-snip { font-size: .76rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chat-item .ci-snip mark { background: rgba(86, 214, 255, .25); color: var(--text); border-radius: 3px; }
.chat-item .ci-src { font-size: .62rem; color: #d7a3ff; border: 1px solid rgba(215, 163, 255, .4); border-radius: 5px; padding: 0 5px; flex: none; }
.chat-item .ci-acts { display: none; gap: 2px; flex: none; }
.chat-item:hover .ci-acts, .chat-item.active .ci-acts { display: flex; }
.ci-acts button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 3px 5px; border-radius: 6px; font-size: .85rem; }
.ci-acts button:hover { color: var(--cyan-soft); background: rgba(86, 214, 255, .1); }
.chat-list .empty { color: var(--muted); font-size: .85rem; padding: 12px 10px; }
.chats-foot { padding: 10px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.private-note { margin: 0; }
.drawer-backdrop { display: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.chat-head .chat-title { flex: 1; margin: 0; font-size: 1.05rem; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.chat-head .icon-btn { width: 36px; height: 36px; }
.chats-toggle { display: none !important; }
.src-badge { font-size: .7rem; color: #d7a3ff; border: 1px solid rgba(215, 163, 255, .4); border-radius: 6px; padding: 1px 7px; flex: none; }

.view { display: none; min-height: 0; }
.view.active { display: flex; }
.view.scroll { overflow-y: auto; }
#view-assistant { flex-direction: row; min-height: 0; }
.panel-wrap { width: min(820px, 100%); margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- assistant ---------- */
.orb-stage { display: flex; flex-direction: column; align-items: center; padding: 18px 16px 4px; flex: none; transition: padding .3s; }
.orb-btn { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.orb-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.status-line { margin: 6px 0 0; }
.interim { min-height: 1.4em; margin: 4px 0 0; color: var(--cyan-soft); font-style: italic; text-align: center; max-width: 600px; }
#view-assistant.has-convo .orb-slot.big { width: 120px; height: 120px; }
#view-assistant.has-convo .orb-stage { padding-top: 10px; }
.convo { flex: 1; overflow-y: auto; padding: 8px max(16px, calc((100% - 760px) / 2)) 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 85%; min-width: 0; padding: 11px 15px; border-radius: 14px; animation: rise .25s ease-out; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: rgba(86, 214, 255, .12); border: 1px solid var(--line-strong); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.assistant .who { font: 600 .68rem var(--head); letter-spacing: .2em; color: var(--cyan); text-transform: uppercase; margin-bottom: 3px; }
.msg p { margin: 0 0 .5em; } .msg p:last-child { margin: 0; }
.msg ul, .msg ol { margin: .3em 0; padding-left: 1.3em; }
.msg h3, .msg h4 { font-size: 1.05rem; margin: .8em 0 .3em; color: var(--cyan-soft); }
.msg code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .86em; background: rgba(3, 10, 16, .8); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.msg .code { margin: .6em 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #03080d; }
.msg .code-bar { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; font-size: .72rem; color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(86, 214, 255, .05); }
.msg .code-bar button { background: none; border: 1px solid var(--line); color: var(--cyan-soft); border-radius: 6px; font-size: .72rem; padding: 2px 8px; cursor: pointer; }
.msg pre { margin: 0; padding: 12px; overflow-x: auto; font: .82rem/1.5 ui-monospace, 'Cascadia Code', Consolas, monospace; color: #cfeefc; }
.msg pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.msg.assistant { max-width: min(92%, 860px); }
.msg .cursor { display: inline-block; width: 8px; height: 1em; background: var(--cyan); vertical-align: -2px; animation: blink 1s infinite; margin-left: 2px; }
.msg .stamp { font-size: .7rem; color: var(--muted); margin-top: 4px; }
.msg .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg .tools span { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.msg.thinking { color: var(--muted); }
.msg.thinking .dots span { animation: blink 1.2s infinite; } .msg.thinking .dots span:nth-child(2) { animation-delay: .2s; } .msg.thinking .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 6px 16px; }
.suggestions button { font: inherit; font-size: .85rem; color: var(--cyan-soft); background: rgba(86, 214, 255, .06); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.suggestions button:hover { border-color: var(--cyan); }
.composer {
  display: flex; gap: 8px; align-items: center; padding: 12px max(16px, calc((100% - 760px) / 2)); flex: none;
  border-top: 1px solid var(--line); background: rgba(5, 8, 13, .55);
}
.composer textarea {
  flex: 1; font: inherit; color: var(--text); background: rgba(3, 10, 16, .7); border: 1px solid var(--line); border-radius: 22px;
  padding: 11px 18px; outline: none; resize: none; max-height: 200px; line-height: 1.4; transition: border-color .2s, box-shadow .2s;
}
.composer textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(86, 214, 255, .15); }
.composer .send { border-radius: 999px; }
.mic.live { background: var(--cyan); color: #021018; box-shadow: 0 0 18px var(--cyan); }

/* ---------- admin ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: .8rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.ok { color: var(--green); border-color: rgba(79, 227, 165, .4); }
.chip.no { color: var(--amber); border-color: rgba(255, 181, 71, .4); }
.perms { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; }
.perms legend { font-size: .82rem; color: var(--muted); padding: 0 6px; }
.perms .check { font-size: .88rem; }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.user.inactive { opacity: .55; }
.user .u-name { font-weight: 600; } .user .u-mail { color: var(--muted); font-size: .85rem; }
.user .u-meta { color: var(--muted); font-size: .76rem; }
.user .u-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; }
.user .perms { grid-column: 1 / -1; padding: 8px 12px; }
.audit { font-size: .82rem; color: var(--muted); max-height: 320px; overflow-y: auto; margin-top: 10px; }
.audit div { padding: 5px 0; border-bottom: 1px solid var(--line); }
.audit b { color: var(--text); font-weight: 500; }
details summary { cursor: pointer; }

/* ---------- import & memory ---------- */
.steps { margin: 0 0 14px; padding-left: 1.3em; color: var(--text); }
.steps li { margin: 4px 0; }
.file-drop { display: flex; align-items: center; justify-content: center; border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 22px; cursor: pointer; color: var(--cyan-soft); font-family: var(--head); letter-spacing: .08em; text-transform: uppercase; font-size: .95rem; }
.file-drop:hover { background: rgba(86, 214, 255, .05); }
.file-drop input { display: none; }
.import-bar { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.import-bar input[type=search] { flex: 1; }
.import-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-list label { flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--text); font-size: .9rem; cursor: pointer; }
.import-list label:last-child { border-bottom: 0; }
.import-list input { width: 16px; height: 16px; flex: none; accent-color: var(--cyan); }
.import-list .il-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-list .il-meta { color: var(--muted); font-size: .75rem; flex: none; }
.memory-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.memory-list .mem { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; }
.memory-list .mem span { flex: 1; }
.memory-list .mem button { background: none; border: 0; color: var(--muted); cursor: pointer; }
.memory-list .mem button:hover { color: var(--red); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px); opacity: 0;
  background: #0f2232; border: 1px solid var(--line-strong); color: var(--text); padding: 10px 18px; border-radius: 10px;
  transition: all .25s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); }

/* ---------- mobile ---------- */
.tabbar { display: none; }
.only-mobile-hidden { display: none; }
@media (max-width: 480px) {
  .brand { font-size: 1.7rem; letter-spacing: .2em; margin-left: .2em; }
}
@media (max-width: 900px) {
  .views { z-index: auto; }
  .chats-panel {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); z-index: 30; background: #071019;
    transform: translateX(-102%); transition: transform .25s ease; padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  }
  .chats-panel.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .6); }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .chats-toggle { display: grid !important; }
  .chat-item .ci-acts { display: flex; }
  .topnav { display: none; }
  .tabbar {
    display: flex; border-top: 1px solid var(--line); background: rgba(5, 8, 13, .92); padding-bottom: var(--safe-b);
    position: relative; z-index: 2;
  }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 10px; font-size: .68rem; }
  .tabbar button span { font-size: 1.15rem; letter-spacing: 0; }
  .tabbar button.active { color: var(--cyan-soft); }
  .grid2 { grid-template-columns: 1fr; }
  .composer .send { display: none; }
  .msg { max-width: 92%; }
  .panel-wrap { padding: 14px; }
  .toast { bottom: calc(130px + var(--safe-b)); }
}

/* ================= COMMAND LAYER (home) ================= */
:root { --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace; --violet: #b48cff; --green2: #4fe3a5; --dim: #8fa6b6; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hud-mono { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: #9db7c6; text-transform: uppercase; }
.hud-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 22px; padding-top: calc(12px + var(--safe-t)); border-bottom: 1px solid rgba(86,214,255,.14); background: rgba(4,8,14,.6); position: relative; z-index: 3; }
.hud-brand { display: flex; align-items: center; gap: 10px; font: 700 24px var(--head); letter-spacing: .36em; color: var(--cyan); text-shadow: 0 0 16px rgba(86,214,255,.6); }
.hud-brand svg { width: 26px; height: 26px; fill: none; stroke: var(--cyan); stroke-width: 1.6; }
.hud-rule { width: 70px; height: 1px; background: linear-gradient(90deg, rgba(86,214,255,.7), transparent); }
.sys-pill { color: var(--green2); }
.sys-pill.warn { color: var(--amber); }
.hud-top .topnav { order: 3; }
.hud-top .weather { margin-left: auto; }
.hud-top .weather, .hud-top .hud-date, .hud-top .hud-clock { order: 2; }
.hud-top .topnav button { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; padding: 7px 10px; }
.hud-clock { font: 700 26px var(--mono); color: #e9fbff; letter-spacing: .04em; }
.hud-clock .ss { font-size: 13px; color: var(--dim); }

#view-home { flex-direction: column; min-height: 0; overflow: hidden; background-image: radial-gradient(ellipse at 50% 40%, rgba(30,110,160,.25) 0%, transparent 55%); }
.hud-grid { flex: 1 1 auto; display: flex; gap: 24px; padding: 14px 22px 10px; align-items: stretch; perspective: 1600px; min-height: 0; }
.hud-panel { flex: 0 1 360px; min-width: 280px; border: 1px solid rgba(86,214,255,.3); background: linear-gradient(180deg, rgba(12,34,50,.85), rgba(6,16,26,.85)); box-shadow: 0 0 30px rgba(30,140,200,.12) inset; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(86,214,255,.35) transparent; }
.hud-panel::-webkit-scrollbar { width: 6px; } .hud-panel::-webkit-scrollbar-thumb { background: rgba(86,214,255,.35); border-radius: 3px; } .hud-panel::-webkit-scrollbar-track { background: transparent; }
.hud-left { border-radius: 4px 18px 4px 4px; transform: rotateY(7deg); transform-origin: left center; }
.hud-right { border-radius: 18px 4px 4px 4px; transform: rotateY(-7deg); transform-origin: right center; }
.hud-core { flex: 1 1 480px; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.pnl { display: flex; flex-direction: column; gap: 7px; }
.pnl-head { display: flex; align-items: baseline; gap: 8px; }
.pnl-head h2 { margin: 0; font: 700 15px var(--head); letter-spacing: .3em; color: var(--cyan); text-transform: uppercase; }
.pnl-head .tag { margin-left: auto; font: 10px var(--mono); letter-spacing: .16em; color: var(--dim); text-transform: uppercase; }
.pnl-head .x { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 14px; padding: 2px 4px; opacity: 0; transition: opacity .2s; }
.pnl:hover .x, .pnl:focus-within .x { opacity: 1; }
.pnl .grp { font: 10px var(--mono); letter-spacing: .18em; color: var(--dim); margin-top: 4px; text-transform: uppercase; }
.pnl .row2 { border-left: 2px solid var(--cyan); background: rgba(86,214,255,.05); padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; }
.pnl .row2.violet { border-color: var(--violet); background: rgba(180,140,255,.06); }
.pnl .row2.green { border-color: var(--green2); background: rgba(79,227,165,.06); }
.pnl .row2.amber { border-color: var(--amber); background: rgba(255,181,71,.06); }
.pnl .line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pnl .line .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnl .line .src { margin-left: auto; font: 10px var(--mono); letter-spacing: .12em; color: var(--dim); text-transform: uppercase; flex: none; }
.pnl .line .val { font: 700 14px var(--mono); flex: none; }
.pnl .sub { font: 11px var(--mono); color: #9db7c6; }
.pnl .bar { height: 4px; background: rgba(86,214,255,.12); }
.pnl .bar i { display: block; height: 4px; background: var(--cyan); }
.pnl .bar.over i { background: var(--amber); }
.pnl .time { font: 700 13px var(--mono); flex: none; width: 54px; }
.pnl .empty, .pnl .err { font: 12px var(--mono); color: var(--dim); }
.pnl .err { color: var(--amber); }
.pnl .foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-top: 8px; border-top: 1px solid rgba(86,214,255,.2); font-family: var(--mono); }
.pnl .foot b { display: block; font-size: 17px; }
.pnl .foot span { font-size: 10px; letter-spacing: .18em; color: var(--dim); }
.pnl .big { font: 700 40px var(--mono); color: #e9fbff; line-height: 1; }
.pnl .check-row { display: flex; flex-direction: row; text-align: left; gap: 10px; align-items: center; font-size: .92rem; color: var(--text); cursor: pointer; }
.pnl .check-row input { width: 17px; height: 17px; accent-color: var(--cyan); flex: none; }
.pnl .check-row.done span { text-decoration: line-through; color: var(--dim); }
.pnl .note { white-space: pre-wrap; font-size: .92rem; }

.core-stage { position: relative; width: 100%; max-width: 820px; flex: 1 1 auto; min-height: 220px; container-type: size; }
.core-orb { position: absolute; left: 50%; top: 50%; width: min(440px, 56cqw, 96cqh); aspect-ratio: 1; transform: translate(-50%, -50%); border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.core-orb:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.core-orb .ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; }
.core-orb .r2 { inset: 7%; width: 86%; height: 86%; }
.core-orb .r3 { inset: 16%; width: 68%; height: 68%; }
.core-orb .faint { stroke: rgba(86,214,255,.25); stroke-width: .6; }
.core-orb .dash1 { stroke: var(--cyan); stroke-width: 2.2; stroke-dasharray: 40 22 6 22 70 30; opacity: .85; }
.core-orb .ticks { stroke: rgba(86,214,255,.45); stroke-width: 5; stroke-dasharray: 1 4; }
.core-orb .dots { stroke: rgba(86,214,255,.3); stroke-width: .8; stroke-dasharray: 2 3; }
.core-orb .dash2 { stroke: #7fdcff; stroke-width: 3; stroke-dasharray: 60 40 14 40; opacity: .7; }
.core-orb .r1 { animation: spin 40s linear infinite; }
.core-orb .r2 { animation: spin 60s linear infinite reverse; }
.core-orb .r3 { animation: spin 24s linear infinite; }
.core-glow { position: absolute; left: 24%; top: 24%; width: 52%; height: 52%; border-radius: 50%; animation: breathe 5s ease-in-out infinite;
  background: radial-gradient(circle, #fff 0%, #d9f6ff 7%, rgba(127,220,255,.85) 16%, rgba(150,120,255,.45) 34%, rgba(60,160,230,.25) 52%, transparent 70%),
    conic-gradient(from 30deg, rgba(180,140,255,.35), rgba(86,214,255,.1), rgba(255,170,220,.25), rgba(86,214,255,.35), rgba(180,140,255,.35));
  box-shadow: 0 0 60px rgba(86,214,255,.35); }
.core-stage[data-state="listening"] .core-glow { animation-duration: .9s; filter: hue-rotate(-20deg) brightness(1.2); }
.core-stage[data-state="thinking"] .r1 { animation-duration: 4s; } .core-stage[data-state="thinking"] .r3 { animation-duration: 2s; }
.core-stage[data-state="thinking"] .dash1, .core-stage[data-state="thinking"] .dash2 { stroke: var(--amber); }
.core-stage[data-state="speaking"] .core-glow { animation: talk .38s ease-in-out infinite alternate; }
.stat, .flank { position: absolute; text-align: center; font-family: var(--mono); pointer-events: none; }
.stat b { display: block; font-size: clamp(16px, 3.2cqw, 24px); color: #e9fbff; text-shadow: 0 0 12px rgba(4,8,14,.9); }
.stat.alert b { color: var(--amber); }
.stat span, .flank span { display: block; font-size: 10px; letter-spacing: .2em; color: var(--dim); text-transform: uppercase; }
.stat small { display: block; font-size: 11px; color: #9db7c6; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat { width: 20cqw; } .s-tl { left: 0; top: 8%; } .s-tr { right: 0; top: 8%; } .s-bl { left: 0; bottom: 6%; } .s-br { right: 0; bottom: 6%; }
.flank { top: 44%; width: 20cqw; } .f-l { left: 0; } .f-r { right: 0; }
.flank b { font-size: 10px; letter-spacing: .16em; color: var(--cyan); display: block; }
.flank em { font-style: normal; font-size: 13px; color: #9db7c6; }
.term { flex: none; margin: 0; max-height: 5.2em; overflow: hidden; font: 12px/1.7 var(--mono); color: #9db7c6; white-space: pre; overflow-x: auto; max-width: 100%; }
.term .ok { color: var(--green2); } .term .bad { color: var(--amber); }
.pulse { flex: none; display: flex; align-items: center; gap: 12px; font: 11px var(--mono); letter-spacing: .2em; color: var(--dim); }
.pulse svg { width: 180px; height: 30px; fill: none; stroke: var(--cyan); stroke-width: 1.6; }
.pulse-sys { color: #dff3fb; }

.voicebar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 22px 14px; padding: 12px 16px; border: 1px solid rgba(86,214,255,.25); border-radius: 6px; background: rgba(6,16,26,.88); }
.vb-mic { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--green2); background: rgba(79,227,165,.08); color: var(--green2); display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 18px rgba(79,227,165,.35); flex: none; }
.vb-mic.live { background: var(--green2); color: #021018; }
.vb-mic svg, .vb-kb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.vb-kb { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(86,214,255,.45); background: none; color: #7fdcff; display: grid; place-items: center; cursor: pointer; flex: none; }
.vb-hint { display: flex; flex-direction: column; gap: 4px; }
.vb-hint-text { font-size: 10px; color: var(--green2); }
.wave { display: flex; align-items: center; gap: 3px; height: 16px; }
.wave i { width: 3px; height: 4px; background: var(--cyan); display: block; }
.voicebar.listening .wave i { animation: wv .6s ease-in-out infinite alternate; }
.wave i:nth-child(3n) { animation-delay: .1s } .wave i:nth-child(3n+1) { animation-delay: .25s } .wave i:nth-child(4n) { animation-delay: .4s }
@keyframes wv { to { height: 16px; } }
.vb-main { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vb-greet { color: #7fdcff; font-size: 13px; letter-spacing: .06em; text-transform: none; }
.vb-text { font-size: 15px; max-height: 3.2em; overflow-y: auto; }
.vb-text p { margin: 0 0 .3em; } .vb-text ul { margin: .2em 0; padding-left: 1.2em; }
.vb-form input { width: 100%; border-radius: 999px; padding: 9px 16px; font-size: .95rem; }
.vb-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.vb-chat, .vb-stand { background: none; cursor: pointer; padding: 5px 10px; font-size: 11px; }
.vb-chat { border: 1px solid rgba(157,183,198,.5); }
.vb-stand { color: #ff6b78; border: 1px solid rgba(255,107,120,.6); }

/* ---------- connectors ---------- */
.panel-wrap.wide { width: min(1080px, 100%); }
.sub-h { font: 600 .8rem var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin: 18px 0 8px; }
.conn-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.conn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.conn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green2); flex: none; box-shadow: 0 0 8px var(--green2); }
.conn .dot.error { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.conn .c-main { flex: 1 1 220px; min-width: 0; }
.conn .c-name { font-weight: 600; } .conn .c-meta { font-size: .8rem; color: var(--muted); }
.conn .c-err { font-size: .8rem; color: var(--amber); }
.conn .c-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font: 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--cyan-soft); border-radius: 6px; padding: 1px 6px; }
.pill.exp { color: var(--amber); border-color: rgba(255,181,71,.5); }
.pill.soon { color: var(--dim); border-color: var(--line); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: rgba(3,10,16,.4); }
.cat h4 { margin: 0; font-size: .95rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cat p { margin: 0; font-size: .8rem; color: var(--muted); flex: 1; }
.cat .btn { align-self: flex-start; }
.dlg { border: 1px solid var(--line-strong); border-radius: 14px; background: #08131d; color: var(--text); padding: 0; width: min(520px, 94vw); }
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dlg-fields { display: flex; flex-direction: column; gap: 10px; }
.dlg-fields .help { font-size: .75rem; color: var(--muted); }
.share-list { display: flex; flex-direction: column; gap: 6px; }
.req { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.req div { flex: 1; } .req small { color: var(--muted); display: block; }
.req select { width: auto; padding: 5px 8px; }

@media (max-height: 820px) and (min-width: 1101px) {
  .term { display: none; }
  .hud-top { padding-top: 6px; padding-bottom: 6px; }
  .voicebar { padding: 8px 14px; } .vb-mic { width: 46px; height: 46px; }
}
@media (max-width: 1500px) and (min-width: 1101px) { .who-line, .hud-rule { display: none; } }
@media (max-width: 1100px) {
  #view-home { overflow-y: auto; }
  .core-stage { flex: none; height: 440px; }
  .hud-grid { flex: none; flex-wrap: wrap; perspective: none; }
  .hud-core { order: -1; flex-basis: 100%; }
  .hud-panel { flex: 1 1 320px; transform: none; max-height: none; }
}
@media (max-width: 900px) {
  .hud-top { padding: 10px 14px; gap: 6px 12px; }
  .hud-brand { font-size: 20px; letter-spacing: .32em; }
  .hud-rule, .who-line, .hud-date { display: none; }
  .weather { font-size: 10px; }
  .hud-clock { font-size: 22px; margin-left: auto; } .hud-clock .ss { display: none; }
  .hud-grid { padding: 12px; gap: 12px; }
  .core-stage { container-type: normal; height: auto; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .core-orb { position: relative; left: auto; top: auto; transform: none; grid-column: 1 / -1; justify-self: center; width: min(240px, 70vw); }
  .stat { width: auto; position: static; border: 1px solid rgba(86,214,255,.22); padding: 8px 6px; background: rgba(6,16,26,.6); }
  .stat b { font-size: 18px; }
  .flank, .pulse { display: none; }
  .term { font-size: 11px; }
  #view-home { padding-bottom: 76px; }
  .voicebar { position: fixed; left: 0; right: 0; bottom: calc(58px + var(--safe-b)); margin: 0; border-radius: 0; border-width: 1px 0; padding: 8px 10px; gap: 8px; flex-wrap: nowrap; z-index: 4; background: rgba(6,16,26,.96); }
  .vb-mic { width: 46px; height: 46px; }
  .vb-kb, .vb-hint, .vb-side, .vb-greet { display: none; }
  .vb-main { flex: 1 1 auto; }
  .vb-text { font-size: 14px; max-height: 4.4em; }
  .vb-text:empty { display: none; }
  .chats-panel { width: min(86vw, 340px); }
}
.pnl .val.r { margin-left: auto; }
.pnl .sub.ok-note { color: var(--green2); }
