/* ARIA - command-center interface. Dark, glass, live. */
:root {
  --bg: #04050a;
  --bg-2: #080b16;
  --panel: rgba(13, 18, 34, 0.66);
  --panel-2: rgba(18, 25, 46, 0.72);
  --solid: #0b1020;
  --glass: rgba(255, 255, 255, 0.035);
  --glass-2: rgba(255, 255, 255, 0.06);
  --line: rgba(128, 162, 255, 0.12);
  --line-2: rgba(128, 172, 255, 0.24);
  --text: #e9edf8;
  --soft: #c3cbe0;
  --muted: #8a94b2;
  --dim: #5b6587;
  --cyan: #2ee6ff;
  --blue: #4d8dff;
  --violet: #8a63ff;
  --magenta: #ff4fd8;
  --green: #2df5a8;
  --amber: #ffbc4d;
  --red: #ff5677;
  --grad: linear-gradient(120deg, #2ee6ff 0%, #6f7bff 48%, #c45cff 78%, #ff4fd8 100%);
  --grad-soft: linear-gradient(120deg, rgba(46, 230, 255, 0.18), rgba(138, 99, 255, 0.18) 60%, rgba(255, 79, 216, 0.14));
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r: 14px;
  --r-lg: 20px;
  --side: 272px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(46, 230, 255, 0.3); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(128, 160, 255, 0.25) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(128, 160, 255, 0.2); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- living background ---------- */
#bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.85; }
.aurora { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.32; mix-blend-mode: screen; }
.aurora.a1 { width: 55vw; height: 55vw; left: -18vw; top: -22vw; background: radial-gradient(circle, #1a6dff 0%, transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.aurora.a2 { width: 50vw; height: 50vw; right: -20vw; bottom: -24vw; background: radial-gradient(circle, #9b3dff 0%, transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.aurora.a3 { width: 30vw; height: 30vw; right: 18vw; top: -12vw; background: radial-gradient(circle, #00d5ff 0%, transparent 70%); opacity: 0.16; animation: drift1 40s ease-in-out infinite alternate-reverse; }
.gridline {
  position: absolute; inset: -2px;
  background-image: linear-gradient(rgba(110, 150, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(110, 150, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}
.scan { position: absolute; left: 0; right: 0; height: 30%; top: -30%; background: linear-gradient(transparent, rgba(46, 230, 255, 0.035), transparent); animation: scan 9s linear infinite; }
@keyframes scan { to { top: 110%; } }
@keyframes drift1 { to { transform: translate(8vw, 6vw) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-7vw, -5vw) scale(1.08); } }
body.thinking .aurora { opacity: 0.5; }

/* ---------- the ARIA core (orb) ---------- */
.orb { --s: 44px; position: relative; width: var(--s); height: var(--s); flex: none; }
.orb .core {
  position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #9ff4ff 12%, #2ee6ff 30%, #6f5bff 62%, #2a0b6b 100%);
  box-shadow: 0 0 calc(var(--s) * 0.45) rgba(46, 230, 255, 0.55), 0 0 calc(var(--s) * 0.9) rgba(138, 99, 255, 0.35), inset 0 0 calc(var(--s) * 0.18) rgba(255, 255, 255, 0.5);
  animation: breathe 4.2s ease-in-out infinite;
}
.orb .ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 18%, var(--cyan) 26%, transparent 34% 52%, var(--magenta) 62%, transparent 70%);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%, #000 66%, transparent 67%);
  mask: radial-gradient(circle, transparent 60%, #000 61%, #000 66%, transparent 67%);
  animation: spin 7s linear infinite;
  opacity: 0.9;
}
.orb .ring.r2 { inset: -9%; animation-duration: 13s; animation-direction: reverse; opacity: 0.45;
  background: conic-gradient(from 90deg, transparent 0 40%, var(--violet) 50%, transparent 60%); }
.orb.busy .ring { animation-duration: 1.1s; }
.orb.busy .ring.r2 { animation-duration: 2.2s; }
.orb.busy .core { animation-duration: 1.2s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(0.9); filter: brightness(1.25) saturate(1.2); } }

/* ---------- layout ---------- */
#app { position: relative; z-index: 1; display: flex; height: 100vh; height: 100dvh; }
#side {
  width: var(--side); flex: none; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px 12px;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.82), rgba(6, 9, 20, 0.82));
  border-right: 1px solid var(--line); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
  transition: transform 0.35s var(--ease);
}
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 14px; text-decoration: none !important; }
.brand .word { font-weight: 800; letter-spacing: 0.22em; font-size: 19px; line-height: 1; }
.brand .org { font: 10.5px/1.3 var(--mono); color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 4px; }
.new-chat {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 12px;
  background: var(--grad-soft); border: 1px solid var(--line-2); cursor: pointer; font-weight: 600; transition: 0.2s;
}
.new-chat:hover { border-color: rgba(46, 230, 255, 0.55); box-shadow: 0 0 22px rgba(46, 230, 255, 0.18); }
.new-chat span { display: flex; align-items: center; gap: 8px; }
kbd { font: 10.5px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: rgba(255, 255, 255, 0.03); }
.nav { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--soft); font-weight: 500; font-size: 14.5px;
  text-decoration: none; position: relative; transition: background 0.15s, color 0.15s;
}
.nav a svg { opacity: 0.75; }
.nav a:hover { background: var(--glass-2); color: var(--text); }
.nav a.on { background: rgba(46, 230, 255, 0.08); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--cyan); }
.nav a.on svg { opacity: 1; color: var(--cyan); }
.side-label { font: 10.5px var(--mono); color: var(--dim); letter-spacing: 0.16em; text-transform: uppercase; padding: 12px 11px 6px; display: flex; justify-content: space-between; }
.recent { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; display: flex; flex-direction: column; gap: 1px; }
.recent a {
  display: block; padding: 7px 11px; border-radius: 9px; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
.recent a:hover { background: var(--glass); color: var(--text); }
.recent a.on { background: var(--glass-2); color: var(--text); }
.recent .empty { color: var(--dim); font-size: 13px; padding: 6px 11px; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.status-pill { display: flex; align-items: center; gap: 8px; font: 11px var(--mono); color: var(--muted); letter-spacing: 0.06em; padding: 0 6px; text-transform: uppercase; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); flex: none; }
.dot.off { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.dot.err { background: var(--red); box-shadow: 0 0 10px var(--red); }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.me-btn { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; background: none; border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%; }
.me-btn:hover { background: var(--glass); border-color: var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
  background: linear-gradient(135deg, rgba(46, 230, 255, 0.25), rgba(138, 99, 255, 0.35)); border: 1px solid var(--line-2); }
.me-btn .who { min-width: 0; flex: 1; }
.me-btn .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btn .who small { font: 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }

.topbar { display: none; }
.view { flex: 1; min-height: 0; overflow-y: auto; position: relative; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 34px 32px 60px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font: 11px var(--mono); letter-spacing: 0.2em; color: var(--cyan); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
h1.title { font-size: 30px; line-height: 1.15; margin: 8px 0 4px; letter-spacing: -0.02em; font-weight: 750; }
.sub { color: var(--muted); margin: 0; }

/* ---------- surfaces ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(18px) saturate(1.25); -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px rgba(0, 0, 0, 0.35);
  position: relative;
}
.panel.pad { padding: 20px; }
.panel h3 { margin: 0 0 14px; font: 600 11.5px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.corner::after { content: ""; position: absolute; top: -1px; left: 22px; width: 64px; height: 1px; background: var(--grad); box-shadow: 0 0 12px var(--cyan); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--glass-2); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: 0.18s var(--ease); color: var(--text); text-decoration: none !important;
}
.btn:hover { border-color: rgba(46, 230, 255, 0.5); background: rgba(46, 230, 255, 0.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #050812; box-shadow: 0 6px 26px rgba(77, 141, 255, 0.35); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 8px 34px rgba(46, 230, 255, 0.45); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--glass); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: rgba(255, 86, 119, 0.6); background: rgba(255, 86, 119, 0.08); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { padding: 8px; border-radius: 10px; }
.iconbtn { background: none; border: 1px solid transparent; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; }
.iconbtn:hover { color: var(--text); background: var(--glass-2); border-color: var(--line); }
.iconbtn.on { color: var(--cyan); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font: 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 11px; background: rgba(4, 7, 16, 0.6); border: 1px solid var(--line-2); outline: none; transition: 0.15s;
}
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(46, 230, 255, 0.14), 0 0 20px rgba(46, 230, 255, 0.12); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
select.input option { background: #0b1020; }
.err-text { color: var(--red); font-size: 13.5px; min-height: 1.2em; }

.badge { display: inline-flex; align-items: center; gap: 5px; font: 600 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--soft); background: rgba(255, 255, 255, 0.03); white-space: nowrap; }
.badge.cyan { color: var(--cyan); border-color: rgba(46, 230, 255, 0.35); background: rgba(46, 230, 255, 0.07); }
.badge.violet { color: #b9a4ff; border-color: rgba(138, 99, 255, 0.4); background: rgba(138, 99, 255, 0.1); }
.badge.green { color: var(--green); border-color: rgba(45, 245, 168, 0.35); background: rgba(45, 245, 168, 0.07); }
.badge.amber { color: var(--amber); border-color: rgba(255, 188, 77, 0.38); background: rgba(255, 188, 77, 0.08); }
.badge.red { color: var(--red); border-color: rgba(255, 86, 119, 0.4); background: rgba(255, 86, 119, 0.08); }
.badge.magenta { color: #ff8be6; border-color: rgba(255, 79, 216, 0.38); background: rgba(255, 79, 216, 0.08); }

.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 12px; background: rgba(4, 7, 16, 0.55); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 11px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--glass-2); color: #fff; box-shadow: 0 0 0 1px var(--line-2) inset, 0 0 14px rgba(46, 230, 255, 0.12); }

/* ---------- sign-in ---------- */
.gate { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.gate-card { width: min(420px, 100%); padding: 34px 30px 28px; text-align: center; }
.gate .orb { --s: 104px; margin: 0 auto 22px; }
.gate h1 { font-size: 40px; letter-spacing: 0.32em; margin: 0 0 4px; padding-left: 0.32em; font-weight: 800; }
.gate .tag { font: 11.5px var(--mono); color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 26px; }
.gate form { text-align: left; }
.gate .btn.primary { width: 100%; padding: 12px; margin-top: 4px; }
.gate .fine { font: 11px var(--mono); color: var(--dim); letter-spacing: 0.06em; margin-top: 20px; }
.typing::after { content: "▌"; color: var(--cyan); animation: pulse 1s steps(2) infinite; margin-left: 2px; }

/* ---------- ask ---------- */
.ask { display: flex; flex-direction: column; height: 100%; }
.thread { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.thread-inner { max-width: 860px; margin: 0 auto; padding: 30px 28px 24px; display: flex; flex-direction: column; gap: 26px; }
.hero { text-align: center; padding: 6vh 0 10px; }
.hero .orb { --s: 120px; margin: 0 auto 26px; }
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.1; margin: 6px 0 10px; letter-spacing: -0.025em; font-weight: 780; }
.hero .greet { font: 12px var(--mono); color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; }
.telemetry { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font: 11px var(--mono); color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; margin: 16px 0 30px; }
.telemetry b { color: var(--soft); font-weight: 600; }
.suggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: left; }
.sug { text-align: left; padding: 15px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: 0.2s var(--ease); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sug:hover { transform: translateY(-2px); border-color: rgba(46, 230, 255, 0.45); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 24px rgba(46, 230, 255, 0.12); }
.sug .k { font: 600 10.5px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.sug .q { color: var(--soft); font-size: 14.5px; }

.msg { display: flex; gap: 14px; animation: rise 0.35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { max-width: 78%; background: linear-gradient(135deg, rgba(46, 230, 255, 0.12), rgba(138, 99, 255, 0.14)); border: 1px solid var(--line-2); padding: 11px 15px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; word-wrap: break-word; }
.msg.ai .orb { --s: 34px; margin-top: 2px; }
.msg.ai .body { flex: 1; min-width: 0; }
.ai-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 11px var(--mono); color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 7px; }
.ai-meta b { color: var(--soft); letter-spacing: 0.18em; }
.pipeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font: 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin: 2px 0 10px; }
.stage { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); transition: 0.25s; }
.stage i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.stage.on { color: var(--cyan); border-color: rgba(46, 230, 255, 0.4); box-shadow: 0 0 16px rgba(46, 230, 255, 0.15); }
.stage.on i { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 0.9s infinite; }
.stage.done { color: var(--soft); }
.stage.done i { background: var(--green); box-shadow: 0 0 6px var(--green); }
.stage .t { color: var(--dim); }
.arrow { color: var(--dim); }

.md { color: var(--text); word-wrap: break-word; }
.md p { margin: 0 0 11px; }
.md p:last-child { margin-bottom: 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 18px 0 8px; font-size: 15.5px; letter-spacing: 0.01em; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 20px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--cyan); }
.md strong { color: #fff; font-weight: 650; }
.md code { font: 13px var(--mono); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.md pre { background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; }
.md hr { border: 0; height: 1px; background: var(--line-2); margin: 16px 0; }
.md .tbl { overflow-x: auto; margin: 6px 0 14px; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th { text-align: left; font: 600 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); background: rgba(46, 230, 255, 0.05); }
.md th, .md td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md tr:last-child td { border-bottom: 0; }
.md blockquote.say {
  position: relative; margin: 10px 0 14px; padding: 13px 16px 13px 18px; border-radius: 14px; background: linear-gradient(135deg, rgba(46, 230, 255, 0.07), rgba(138, 99, 255, 0.08));
  border: 1px solid rgba(46, 230, 255, 0.25); box-shadow: 0 0 30px rgba(46, 230, 255, 0.06) inset;
}
.md blockquote.say::before { content: "SAY"; position: absolute; top: -8px; left: 14px; font: 700 9.5px var(--mono); letter-spacing: 0.2em; color: var(--cyan); background: var(--bg-2); padding: 1px 7px; border-radius: 6px; border: 1px solid rgba(46, 230, 255, 0.3); }
.md blockquote.say .say-body { padding-right: 56px; }
.md blockquote.say p { margin: 0 0 6px; }
.say-copy { position: absolute; top: 9px; right: 9px; font: 600 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); background: rgba(46, 230, 255, 0.08); border: 1px solid rgba(46, 230, 255, 0.3); border-radius: 7px; padding: 4px 8px; cursor: pointer; }
.say-copy:hover { background: rgba(46, 230, 255, 0.18); }
.cite {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px; border-radius: 6px; vertical-align: 2px;
  font: 700 10.5px/1 var(--mono); color: var(--cyan); background: rgba(46, 230, 255, 0.1); border: 1px solid rgba(46, 230, 255, 0.4); cursor: pointer; transition: 0.15s;
}
.cite:hover { background: var(--cyan); color: #04121a; box-shadow: 0 0 14px var(--cyan); }
.stream-caret { display: inline-block; width: 8px; height: 16px; background: var(--cyan); vertical-align: -3px; margin-left: 2px; box-shadow: 0 0 10px var(--cyan); animation: pulse 0.8s steps(2) infinite; }

.evidence { margin-top: 14px; }
.ev-head { display: flex; align-items: center; justify-content: space-between; font: 11px var(--mono); color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ev {
  text-align: left; padding: 10px 11px 9px; border-radius: 12px; background: rgba(8, 12, 26, 0.6); border: 1px solid var(--line); cursor: pointer; transition: 0.18s; position: relative; overflow: hidden; min-width: 0;
}
.ev:hover { border-color: rgba(46, 230, 255, 0.45); transform: translateY(-1px); }
.ev.cited { border-color: rgba(46, 230, 255, 0.32); background: linear-gradient(135deg, rgba(46, 230, 255, 0.07), rgba(8, 12, 26, 0.6)); }
.ev .n { font: 700 10.5px var(--mono); color: var(--cyan); }
.ev .t { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0 3px; }
.ev .w { font: 10.5px var(--mono); color: var(--dim); letter-spacing: 0.05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--grad); box-shadow: 0 0 8px var(--cyan); opacity: 0.75; }
.more-ev { margin-top: 8px; }

.actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.actions .sep { flex: 1; }
.gap-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 12px; border-radius: 11px; font-size: 13px; color: var(--amber); background: rgba(255, 188, 77, 0.06); border: 1px solid rgba(255, 188, 77, 0.25); }

.composer-wrap { padding: 0 24px 18px; position: relative; }
.composer-wrap::before { content: ""; position: absolute; left: 0; right: 0; top: -40px; height: 40px; background: linear-gradient(transparent, rgba(4, 5, 10, 0.75)); pointer-events: none; }
.composer {
  max-width: 860px; margin: 0 auto; border-radius: 20px; padding: 10px 10px 10px 14px; background: rgba(10, 14, 30, 0.86); border: 1px solid var(--line-2);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); transition: 0.2s; position: relative;
}
.composer:focus-within { border-color: rgba(46, 230, 255, 0.55); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(46, 230, 255, 0.1), 0 0 40px rgba(46, 230, 255, 0.12); }
.composer .modes { display: flex; gap: 4px; margin: 0 0 6px -4px; flex-wrap: wrap; }
.mode { border: 1px solid transparent; background: none; color: var(--dim); font: 600 10.5px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.mode:hover { color: var(--soft); }
.mode.on { color: var(--cyan); border-color: rgba(46, 230, 255, 0.35); background: rgba(46, 230, 255, 0.07); }
.composer .row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { flex: 1; resize: none; border: 0; outline: none; background: none; padding: 8px 2px; max-height: 220px; min-height: 26px; line-height: 1.5; font-size: 15px; }
.composer textarea::placeholder { color: var(--dim); }
.send { width: 40px; height: 40px; border-radius: 13px; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--grad); color: #050812; box-shadow: 0 6px 22px rgba(77, 141, 255, 0.4); flex: none; transition: 0.2s; }
.send:hover { filter: brightness(1.12); }
.send:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.mic { width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--glass); color: var(--soft); cursor: pointer; display: grid; place-items: center; flex: none; }
.mic:hover { color: #fff; border-color: rgba(46, 230, 255, 0.5); }
.mic.live { color: #fff; background: rgba(255, 86, 119, 0.2); border-color: var(--red); box-shadow: 0 0 0 0 rgba(255, 86, 119, 0.6); animation: ping 1.3s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 12px rgba(255, 86, 119, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 86, 119, 0); } }
.fineprint { max-width: 860px; margin: 8px auto 0; text-align: center; font: 10.5px var(--mono); color: var(--dim); letter-spacing: 0.08em; }

/* ---------- drawer ---------- */
#scrim { position: fixed; inset: 0; z-index: 40; background: rgba(2, 3, 8, 0.55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: 0.25s; }
#scrim.on { opacity: 1; pointer-events: auto; }
#drawer {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: rgba(9, 13, 27, 0.94); border-left: 1px solid var(--line-2);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); transform: translateX(105%); transition: transform 0.35s var(--ease); display: flex; flex-direction: column;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
}
#drawer.on { transform: none; }
.dr-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.dr-head .h { flex: 1; min-width: 0; }
.dr-head h2 { margin: 6px 0 6px; font-size: 19px; line-height: 1.3; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 20px 26px; }
.passage { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; color: var(--soft); padding: 16px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); position: relative; }
.passage::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 2px; background: var(--grad); box-shadow: 0 0 10px var(--cyan); border-radius: 2px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13.5px; margin: 14px 0; }
.kv dt { font: 11px var(--mono); color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; color: var(--soft); }

/* ---------- modal, toast, palette ---------- */
#modal { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 20px; background: rgba(2, 3, 8, 0.6); backdrop-filter: blur(5px); }
#modal.on { display: grid; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(480px, 100%); padding: 24px; animation: rise 0.3s var(--ease); max-height: 90vh; overflow-y: auto; }
.modal-card h2 { margin: 0 0 6px; font-size: 20px; }
.modal-card .actions-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.linkbox { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(46, 230, 255, 0.35); font: 12.5px var(--mono); word-break: break-all; color: var(--cyan); }
#toasts { position: fixed; z-index: 80; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; padding: 10px 16px; border-radius: 12px; background: rgba(12, 18, 36, 0.95); border: 1px solid var(--line-2); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); font-size: 14px; display: flex; gap: 9px; align-items: center; animation: rise 0.3s var(--ease); }
.toast.err { border-color: rgba(255, 86, 119, 0.5); }
.toast.ok { border-color: rgba(45, 245, 168, 0.45); }
#palette { position: fixed; inset: 0; z-index: 70; display: none; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(2, 3, 8, 0.55); backdrop-filter: blur(5px); }
#palette.on { display: flex; animation: fade 0.15s; }
.pal { width: min(620px, 100%); overflow: hidden; animation: rise 0.25s var(--ease); }
.pal input { width: 100%; border: 0; outline: none; background: none; padding: 18px 20px; font-size: 17px; border-bottom: 1px solid var(--line); }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--soft); }
.pal-item .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item small { font: 10.5px var(--mono); color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }
.pal-item.on { background: rgba(46, 230, 255, 0.09); color: #fff; box-shadow: 0 0 0 1px rgba(46, 230, 255, 0.25) inset; }
.pal-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font: 10.5px var(--mono); color: var(--dim); letter-spacing: 0.06em; }
.menu { position: fixed; z-index: 65; min-width: 220px; padding: 6px; animation: rise 0.18s var(--ease); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; background: none; border-radius: 9px; cursor: pointer; color: var(--soft); text-align: left; font-size: 14px; }
.menu button:hover { background: var(--glass-2); color: #fff; }

/* ---------- practice ---------- */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.persona {
  text-align: left; padding: 14px; border-radius: 16px; background: rgba(8, 12, 26, 0.6); border: 1px solid var(--line); cursor: pointer; transition: 0.2s var(--ease); position: relative; overflow: hidden; min-height: 108px;
}
.persona:hover { border-color: rgba(46, 230, 255, 0.4); transform: translateY(-2px); }
.persona.on { border-color: rgba(46, 230, 255, 0.7); background: linear-gradient(140deg, rgba(46, 230, 255, 0.12), rgba(138, 99, 255, 0.12)); box-shadow: 0 0 30px rgba(46, 230, 255, 0.15); }
.persona.on::after { content: "SELECTED"; position: absolute; top: 10px; right: 10px; font: 700 9px var(--mono); letter-spacing: 0.16em; color: var(--cyan); }
.persona .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); margin-bottom: 10px; color: var(--cyan); }
.persona b { display: block; font-size: 14px; margin-bottom: 3px; }
.persona span { font-size: 12.5px; color: var(--muted); line-height: 1.4; display: block; }
.opt-row { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 18px 0 6px; align-items: flex-end; }
.opt-row .field { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.025); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--soft); }
.chip:hover { border-color: rgba(46, 230, 255, 0.45); }
.chip.on { color: #04121a; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 16px rgba(46, 230, 255, 0.4); }
.call { display: flex; flex-direction: column; height: 100%; }
.call-head { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: rgba(6, 9, 20, 0.6); backdrop-filter: blur(14px); flex-wrap: wrap; }
.call-head .who { flex: 1; min-width: 180px; }
.call-head .who b { font-size: 16px; display: block; }
.call-head .who small { font: 11px var(--mono); color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.timer { font: 600 20px var(--mono); letter-spacing: 0.08em; color: var(--soft); font-variant-numeric: tabular-nums; }
.live-tag { display: inline-flex; align-items: center; gap: 7px; font: 700 11px var(--mono); letter-spacing: 0.18em; color: var(--red); }
.live-tag .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
.wave { display: flex; align-items: center; gap: 3px; height: 34px; }
.wave i { width: 3px; border-radius: 3px; background: var(--grad); height: 6px; opacity: 0.5; transition: height 0.12s; }
.wave.on i { opacity: 1; animation: wv 0.9s ease-in-out infinite; }
@keyframes wv { 0%, 100% { height: 5px; } 50% { height: 30px; } }
.msg.cust .avatar { background: linear-gradient(135deg, rgba(255, 79, 216, 0.3), rgba(138, 99, 255, 0.3)); }
.msg.cust .bubble { background: rgba(10, 15, 32, 0.75); border: 1px solid var(--line); padding: 11px 15px; border-radius: 16px 16px 16px 4px; max-width: 78%; white-space: pre-wrap; }
.call-end { text-align: center; padding: 18px; border-radius: 16px; border: 1px dashed rgba(46, 230, 255, 0.35); background: rgba(46, 230, 255, 0.04); }
.score-hero { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.gauge { width: 170px; height: 170px; position: relative; }
.gauge svg { transform: rotate(-90deg); }
.gauge .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .val b { font: 800 46px/1 var(--mono); display: block; }
.gauge .val small { font: 10.5px var(--mono); color: var(--muted); letter-spacing: 0.18em; }
.imp { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(8, 12, 26, 0.55); margin-bottom: 10px; }
.imp .m { font: 600 11px var(--mono); color: var(--amber); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px; }
.imp .said { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 86, 119, 0.6); font-size: 14px; margin-bottom: 8px; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 7px 0 7px 22px; position: relative; color: var(--soft); }
.list-clean li::before { content: "▸"; position: absolute; left: 4px; color: var(--green); }
.list-clean.warn li::before { content: "!"; color: var(--amber); font-weight: 800; }

/* ---------- library ---------- */
.lib-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-box { flex: 1; min-width: 220px; position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search-box .input { padding-left: 40px; }
.drop {
  border: 1.5px dashed rgba(46, 230, 255, 0.35); border-radius: 18px; padding: 22px; text-align: center; margin-bottom: 18px; cursor: pointer; transition: 0.2s;
  background: repeating-linear-gradient(-45deg, rgba(46, 230, 255, 0.025) 0 10px, transparent 10px 20px); position: relative; overflow: hidden;
}
.drop:hover, .drop.over { border-color: var(--cyan); background-color: rgba(46, 230, 255, 0.05); box-shadow: 0 0 40px rgba(46, 230, 255, 0.12) inset; }
.drop.over::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); animation: sweep 1.2s linear infinite; }
@keyframes sweep { from { top: 0; } to { top: 100%; } }
.drop b { display: block; margin: 6px 0 3px; }
.drop small { color: var(--muted); }
.docs { display: flex; flex-direction: column; gap: 6px; }
.doc {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(8, 12, 26, 0.5);
  border: 1px solid var(--line); cursor: pointer; transition: 0.15s; text-align: left; width: 100%;
}
.doc:hover { border-color: rgba(46, 230, 255, 0.35); background: rgba(12, 18, 36, 0.7); }
.doc.archived { opacity: 0.55; }
.doc .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); color: var(--cyan); }
.doc .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.doc .r { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.doc .stat { font: 11px var(--mono); color: var(--dim); letter-spacing: 0.04em; white-space: nowrap; }
.progress { height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; width: 40%; background: var(--grad); animation: load 1.3s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.hit { padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: rgba(8, 12, 26, 0.5); cursor: pointer; margin-bottom: 8px; }
.hit:hover { border-color: rgba(46, 230, 255, 0.4); }
.hit .t { font-weight: 600; font-size: 14px; }
.hit .x { color: var(--muted); font-size: 13.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .orb { --s: 70px; margin: 0 auto 18px; opacity: 0.85; }

/* ---------- insights & team ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 16px 16px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(46, 230, 255, 0.14), transparent 70%); }
.kpi .l { font: 10.5px var(--mono); color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; }
.kpi .v { font: 750 30px/1.15 var(--mono); margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .d { font-size: 12.5px; color: var(--dim); margin-top: 2px; }
.chart { width: 100%; height: 190px; display: block; }
.rows { display: flex; flex-direction: column; }
.rows .r { display: flex; gap: 12px; align-items: flex-start; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rows .r:last-child { border-bottom: 0; }
.rows .r .grow { flex: 1; min-width: 0; }
.rows .r small { font: 10.5px var(--mono); color: var(--dim); letter-spacing: 0.06em; }
.meter { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; background: var(--grad); box-shadow: 0 0 10px rgba(46, 230, 255, 0.5); border-radius: 6px; }
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font: 600 10.5px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t select.input { padding: 6px 30px 6px 10px; font-size: 13px; width: auto; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person b { display: block; font-size: 14px; }
.person small { color: var(--muted); font-size: 12.5px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid2, .cols3, .cols2 { grid-template-columns: 1fr; }
  .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}
@media (max-width: 820px) {
  #side { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; transform: translateX(-102%); box-shadow: 30px 0 80px rgba(0, 0, 0, 0.6); }
  body.side-open #side { transform: none; }
  body.side-open #scrim { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(6, 9, 20, 0.8); backdrop-filter: blur(16px); position: relative; z-index: 5; }
  .topbar .brand { padding: 0; }
  .topbar .brand .word { font-size: 16px; }
  .wrap { padding: 22px 16px 50px; }
  .thread-inner { padding: 20px 16px 18px; }
  .composer-wrap { padding: 0 10px 10px; }
  .suggest { grid-template-columns: 1fr; }
  .hero { padding-top: 3vh; }
  .hero .orb { --s: 92px; }
  .msg.user .bubble, .msg.cust .bubble { max-width: 90%; }
  .msg.ai .orb { display: none; }
  .doc { grid-template-columns: 34px minmax(0, 1fr); }
  .doc .r { grid-column: 1 / -1; justify-content: flex-start; }
  h1.title { font-size: 25px; }
  .call-head { padding: 10px 14px; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ---------- live voice ---------- */
.talkbar { display: flex; align-items: center; gap: 9px; margin: -2px 0 8px; font: 600 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); }
.talkbar .dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.lvl { display: inline-flex; align-items: center; gap: 2px; height: 22px; }
.lvl i { width: 3px; height: 3px; border-radius: 2px; background: var(--grad); transition: height 0.08s; }
.mic.talk.live { background: rgba(46, 230, 255, 0.18); border-color: var(--cyan); animation: pingc 1.4s infinite; color: #fff; }
@keyframes pingc { 70% { box-shadow: 0 0 0 12px rgba(46, 230, 255, 0); } 0% { box-shadow: 0 0 0 0 rgba(46, 230, 255, 0.5); } }
body.speaking .orb .ring { animation-duration: 1.6s; }
.msg.user.partial .bubble { opacity: 0.6; border-style: dashed; }
.wave.sm { height: 22px; gap: 2px; }
.wave.sm i { width: 3px; }
.meters { display: flex; align-items: center; gap: 8px; font: 600 10px var(--mono); letter-spacing: 0.14em; color: var(--dim); }
.src-opts { display: flex; flex-direction: column; gap: 10px; }
.src { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(8, 12, 26, 0.55); cursor: pointer; transition: 0.15s; }
.src input { display: none; }
.src > div { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); color: var(--cyan); flex: none; }
.src b { display: block; }
.src small { color: var(--muted); font-size: 13px; line-height: 1.45; display: block; margin-top: 2px; }
.src.on { border-color: rgba(46, 230, 255, 0.6); box-shadow: 0 0 24px rgba(46, 230, 255, 0.12); background: linear-gradient(140deg, rgba(46, 230, 255, 0.08), rgba(138, 99, 255, 0.08)); }
.src.off { opacity: 0.5; cursor: not-allowed; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 13.5px; color: var(--soft); cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--cyan); }
.live-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); }
.transcript { overflow-y: auto; padding: 22px 26px 40px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); }
.transcript.flat { border: 0; padding: 0; max-height: 520px; }
.tline { display: grid; grid-template-columns: 82px 1fr; gap: 12px; padding: 7px 0; animation: rise 0.25s var(--ease); line-height: 1.55; }
.tline .tw { font: 700 10.5px var(--mono); letter-spacing: 0.14em; padding-top: 4px; color: var(--dim); }
.tline.agent .tw { color: var(--cyan); }
.tline.customer .tw { color: #ff8be6; }
.tline.customer .tt { color: #fff; }
.tline .tt { color: var(--soft); font-size: 15.5px; }
.tline.partial .tt { color: var(--muted); }
.tline.partial .tt::after { content: "▌"; color: var(--cyan); animation: pulse 0.8s steps(2) infinite; margin-left: 2px; }
.assist-col { overflow-y: auto; padding: 22px 22px 40px; background: rgba(6, 9, 20, 0.35); }
.acard { padding: 14px 15px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(10, 15, 32, 0.8); margin-bottom: 12px; animation: pop 0.45s var(--ease); position: relative; }
.acard.objection { border-color: rgba(255, 188, 77, 0.45); box-shadow: 0 0 30px rgba(255, 188, 77, 0.08); }
.acard.compliance { border-color: rgba(255, 86, 119, 0.5); box-shadow: 0 0 30px rgba(255, 86, 119, 0.1); }
.acard.opportunity { border-color: rgba(45, 245, 168, 0.4); }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.acard .ah { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.acard .ah b { font-size: 15px; }
.acard .why { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.acard .asrc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cite-src { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--mono); color: var(--cyan); background: rgba(46, 230, 255, 0.07); border: 1px solid rgba(46, 230, 255, 0.3); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.cite-src:hover { background: rgba(46, 230, 255, 0.16); }
@media (max-width: 980px) {
  .live-grid { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 0.9fr); }
  .transcript { border-right: 0; border-bottom: 1px solid var(--line); }
  .meters { display: none; }
}
@media (max-width: 820px) {
  .tline { grid-template-columns: 70px 1fr; }
  #handsBtn span { display: none; }
}
.tline.speaker_a .tw { color: var(--cyan); }
.tline.speaker_b .tw { color: #ff8be6; }

/* ---- switches (Team & system) ---- */
.feats { display: flex; flex-direction: column; gap: 10px; }
.feat { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 12px; background: rgba(3, 5, 12, 0.45); cursor: pointer; }
.feat b { display: block; font-size: 14px; }
.feat small { display: block; color: var(--dim); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.sw { position: relative; width: 44px; height: 24px; flex: none; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line, rgba(255,255,255,.14)); transition: background 0.2s, border-color 0.2s; }
.sw i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s, background 0.2s; }
.sw input:checked + i { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 14px rgba(46, 230, 255, 0.35); }
.sw input:checked + i::after { transform: translateX(20px); background: #070414; }

/* ---- customer language (Ask) ---- */
.lang-pick { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding-left: 10px; color: var(--dim); }
.lang-pick svg { margin-right: 3px; }
/* ---- follow-ups ---- */
.nav a { position: relative; }
.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font: 700 11px/20px var(--mono); text-align: center; box-shadow: 0 0 12px rgba(255, 86, 119, 0.45); }
.fu-form { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; }
.fu-form .grow { flex: 1 1 260px; }
.fu-form .field { min-width: 130px; }
.fu-list { display: flex; flex-direction: column; }
.fu { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); }
.fu:first-child { border-top: 0; }
.fu .grow { flex: 1; min-width: 0; }
.fu b { display: block; font-size: 14.5px; overflow-wrap: anywhere; }
.fu small { display: block; color: var(--dim); font-size: 12.5px; margin-top: 3px; }
.fu small a { color: var(--cyan); }
.fu.over .due { color: var(--red); font-weight: 600; }
.fu.today .due { color: var(--cyan); font-weight: 600; }
.fu.done b { color: var(--dim); text-decoration: line-through; }
.fu-notes { margin: 6px 0 0; color: var(--soft); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fu-check { position: relative; width: 22px; height: 22px; flex: none; margin-top: 1px; cursor: pointer; }
.fu-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.fu-check i { position: absolute; inset: 0; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; transition: all 0.15s; }
.fu-check input:checked + i { background: var(--green); border-color: var(--green); color: #04121a; }
.fu-check:hover i { border-color: var(--cyan); }
.iconbtn.sm { width: 30px; height: 30px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* team: one wrapping row per person, never a sideways scroll */
.plist { display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(8, 12, 26, 0.5); }
.prow .person { flex: 1 1 220px; min-width: 0; }
.prow .person small { display: block; overflow: hidden; text-overflow: ellipsis; }
.prow .pctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.prow .pctl select.input { width: auto; min-width: 140px; max-width: 220px; padding-top: 7px; padding-bottom: 7px; }
.prow .pmeta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.prow .pact { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.dlist .prow b { font-size: 15px; }

/* results: how calls ended */
.obar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, 0.05); gap: 2px; }
.obar i { display: block; background: var(--muted); opacity: 0.55; }
.obar i.green { background: var(--green); opacity: 1; } .obar i.cyan { background: var(--cyan); opacity: 0.9; }
.obar i.violet { background: var(--violet); opacity: 0.9; } .obar i.amber { background: var(--amber); opacity: 0.8; }
.olegend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 13px; }
.olegend span { display: inline-flex; align-items: center; gap: 6px; }
.dotc { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dotc.green { background: var(--green); } .dotc.cyan { background: var(--cyan); } .dotc.violet { background: var(--violet); } .dotc.amber { background: var(--amber); }

/* recruiting funnel: wraps, never scrolls sideways */
.funnel { display: flex; flex-wrap: wrap; gap: 8px; }
.fstep { flex: 1 1 110px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 12, 26, 0.5); }
.fstep b { font-size: 20px; } .fstep span { font-size: 13px; font-weight: 600; } .fstep small { font-size: 11.5px; }

/* Protégé tutor */
.tutor-log { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.tmsg { padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; max-width: 92%; }
.tmsg.me { align-self: flex-end; background: var(--glass-2); border: 1px solid var(--line-2); }
.tmsg.ai { align-self: flex-start; background: rgba(8, 12, 26, 0.6); border: 1px solid var(--line); }
.tmsg.ai p { margin: 0 0 6px; }

/* phones: stat cards two across, so the useful lists aren't pushed below the fold */
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 12px 10px; }
  .kpi .v { font-size: 24px; }
}

/* Demo District banner */
.demo-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 16px; font-size: 13px;
  background: linear-gradient(90deg, rgba(138, 99, 255, 0.25), rgba(46, 230, 255, 0.18)); border-bottom: 1px solid var(--line-2); }

/* the weekly brief prints clean */
@media print {
  #side, .topbar, .demo-bar, #printB, .orb, .bg, canvas { display: none !important; }
  body, #main, .panel, .kpi { background: #fff !important; color: #111 !important; box-shadow: none !important; backdrop-filter: none !important; }
  .brief .grad-text { -webkit-text-fill-color: #111 !important; color: #111 !important; }
  .brief .x, .brief .muted, .brief .sub, .brief .kpi .l, .brief .kpi .d { color: #333 !important; }
  .panel, .kpi { border: 1px solid #ccc !important; break-inside: avoid; }
}
