:root {
  --bg: #0f1115; --bg-2: #15181e; --bg-3: #1c2028; --bg-4: #242934;
  --text: #e8eaf0; --text-2: #a9afbd; --text-3: #737a8a;
  --border: #2a2f3a; --accent: #6d8cff; --accent-2: #8f6dff; --accent-soft: rgba(109,140,255,.14);
  --good: #3ccf91; --warn: #f5b84a; --bad: #ff6b6b;
  --user-bubble: #232a3a; --code-bg: #0b0d11;
  --radius: 14px; --shadow: 0 10px 40px rgba(0,0,0,.35);
  --font: "Segoe UI", "Heebo", "Rubik", "Assistant", system-ui, -apple-system, Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", "SF Mono", ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f7f5; --bg-2: #ffffff; --bg-3: #f0f1f3; --bg-4: #e6e8ec;
    --text: #1c1f26; --text-2: #4d5463; --text-3: #8a90a0; --border: #e1e3e8;
    --accent: #4565f0; --accent-2: #7048e8; --accent-soft: rgba(69,101,240,.1);
    --user-bubble: #eceff7; --code-bg: #f3f4f7; --shadow: 0 10px 40px rgba(20,30,60,.12);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f7f5; --bg-2: #ffffff; --bg-3: #f0f1f3; --bg-4: #e6e8ec;
  --text: #1c1f26; --text-2: #4d5463; --text-3: #8a90a0; --border: #e1e3e8;
  --accent: #4565f0; --accent-2: #7048e8; --accent-soft: rgba(69,101,240,.1);
  --user-bubble: #eceff7; --code-bg: #f3f4f7; --shadow: 0 10px 40px rgba(20,30,60,.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15.5px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent); }

#app { display: flex; height: 100dvh; overflow: hidden; }

/* ---------- sidebar ---------- */
#sidebar { width: 270px; flex-shrink: 0; background: var(--bg-2); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px; gap: 10px; z-index: 30; }
.side-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: .3px; padding: 4px 6px; }
.orb-mini { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff 0 18%, var(--accent) 40%, var(--accent-2) 100%); box-shadow: 0 0 14px var(--accent); }
.new-chat { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-3); font-weight: 600; }
.new-chat:hover { background: var(--bg-4); }
.search { width: 100%; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); outline: none; }
.search:focus { border-color: var(--accent); }
.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-inline: -4px; padding-inline: 4px; }
.conv-group { font-size: 12px; color: var(--text-3); padding: 10px 8px 4px; }
.conv { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 9px; color: var(--text-2);
  border: 0; background: none; text-align: start; width: 100%; }
.conv:hover { background: var(--bg-3); color: var(--text); }
.conv.active { background: var(--accent-soft); color: var(--text); }
.conv .t { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv .acts { display: none; gap: 2px; }
.conv:hover .acts, .conv.active .acts { display: flex; }
.conv .acts span { padding: 0 4px; border-radius: 5px; font-size: 13px; opacity: .7; }
.conv .acts span:hover { opacity: 1; background: var(--bg-4); }
.side-nav { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.nav-btn { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; border: 0; background: none; color: var(--text-2); text-align: start; }
.nav-btn:hover, .nav-btn.active { background: var(--bg-3); color: var(--text); }
#scrim { display: none; }

/* ---------- main ---------- */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); min-height: 56px; }
.topbar .title { flex: 1; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.model-select { max-width: 230px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-2); direction: ltr; font-size: 13px; }
.icon-btn { border: 0; background: none; width: 36px; height: 36px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.icon-btn:hover { background: var(--bg-3); }
.icon-btn.recording { background: rgba(255,107,107,.18); animation: pulse 1.2s infinite; }
.live-btn { display: flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--bg-2); padding: 6px 14px; border-radius: 99px; font-weight: 600; }
.live-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.live-btn:hover { border-color: var(--accent); }
.only-mobile { display: none; }

.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scroller { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.messages { max-width: 820px; margin: 0 auto; padding: 24px 20px 12px; display: flex; flex-direction: column; gap: 22px; }

.welcome { max-width: 720px; margin: 8vh auto 0; text-align: center; padding: 0 20px; }
.welcome h1 { font-size: 30px; margin: 18px 0 6px; }
.welcome p { color: var(--text-2); margin: 0 0 26px; }
.orb-big { width: 86px; height: 86px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 10%, var(--accent) 45%, var(--accent-2) 100%);
  box-shadow: 0 0 50px var(--accent-soft), 0 0 22px var(--accent); animation: breathe 4s ease-in-out infinite; }
.suggestions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.suggestions button { text-align: start; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-2); }
.suggestions button:hover { border-color: var(--accent); color: var(--text); }

/* ---------- messages ---------- */
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.user { justify-content: flex-start; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--user-bubble); padding: 10px 16px; border-radius: 18px; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg.assistant .bubble { flex: 1; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
  background: radial-gradient(circle at 35% 35%, #fff 0 14%, var(--accent) 45%, var(--accent-2) 100%); }
.msg.user .avatar { display: none; }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.att { font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: var(--bg-4); color: var(--text-2); }

.steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.step { font-size: 13px; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.step summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; }
.step summary::-webkit-details-marker { display: none; }
.step pre { white-space: pre-wrap; max-height: 220px; overflow: auto; font-size: 12px; direction: ltr; text-align: left; margin: 6px 0 0; }
.step.running summary::after { content: ""; width: 10px; height: 10px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.status-line { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }

.md { word-wrap: break-word; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .8em; }
.md h1, .md h2, .md h3, .md h4 { margin: 1.1em 0 .45em; line-height: 1.3; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.25em; } .md h3 { font-size: 1.1em; }
.md ul, .md ol { margin: 0 0 .8em; padding-inline-start: 1.5em; }
.md li { margin: .2em 0; }
.md blockquote { margin: 0 0 .8em; padding: 4px 14px; border-inline-start: 3px solid var(--accent); color: var(--text-2); background: var(--bg-2); border-radius: 6px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--bg-3); padding: .1em .4em; border-radius: 5px; direction: ltr; unicode-bidi: isolate; }
.md .code { margin: 0 0 .9em; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; direction: ltr; text-align: left; }
.md .code-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 12px; background: var(--bg-3); font-size: 12px; color: var(--text-3); }
.md .code-head button { border: 0; background: none; color: var(--text-2); font-size: 12px; }
.md pre { margin: 0; padding: 12px 14px; background: var(--code-bg); overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 13px; line-height: 1.55; }
.md .tbl { overflow-x: auto; margin: 0 0 .9em; }
.md table { border-collapse: collapse; min-width: 50%; font-size: 14px; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: start; }
.md th { background: var(--bg-3); }
.cite { font-size: .72em; vertical-align: super; line-height: 0; }
.cite a { text-decoration: none; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; margin: 0 1px; }
.cursor::after { content: "▍"; color: var(--accent); animation: blink 1s infinite; }

.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.source { display: flex; align-items: center; gap: 6px; max-width: 260px; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; }
.source b { color: var(--accent); }
.source span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.source:hover { border-color: var(--accent); }

.msg-footer { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--text-3); font-size: 12.5px; flex-wrap: wrap; }
.msg-footer .icon-btn { width: 30px; height: 30px; font-size: 14px; opacity: .75; }
.msg-footer .icon-btn:hover { opacity: 1; }
.msg-footer .icon-btn.on { background: var(--accent-soft); opacity: 1; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; border: 1px solid var(--border); background: var(--bg-2); cursor: default; }
.badge.good { color: var(--good); border-color: rgba(60,207,145,.35); }
.badge.mid { color: var(--warn); border-color: rgba(245,184,74,.35); }
.badge.low { color: var(--bad); border-color: rgba(255,107,107,.35); }
.badge.improved { color: var(--accent); border-color: rgba(109,140,255,.4); cursor: pointer; }
.meta-model { direction: ltr; margin-inline-start: 6px; }
.original { margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-2); font-size: 14px; }
.error-box { padding: 10px 14px; border-radius: 10px; background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.35); color: var(--bad); }

/* ---------- composer ---------- */
.composer-wrap { max-width: 820px; width: 100%; margin: 0 auto; padding: 8px 16px 14px; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--border); }
.chip.loading { opacity: .6; }
.chip button { border: 0; background: none; padding: 0 2px; color: var(--text-3); }
.composer { display: flex; align-items: flex-end; gap: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 18px; padding: 8px; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; resize: none; border: 0; outline: none; background: none; padding: 7px 6px; max-height: 220px; line-height: 1.5; }
.send-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 16px; flex-shrink: 0; transform: scaleX(-1); }
.send-btn.stop { transform: none; background: var(--bg-4); color: var(--text); }
.send-btn:disabled { opacity: .45; cursor: default; }
.hint { text-align: center; font-size: 11.5px; color: var(--text-3); margin-top: 7px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(5,7,12,.6); display: grid; place-items: center; z-index: 100; padding: 16px; backdrop-filter: blur(3px); }
.modal-card { width: min(760px, 100%); max-height: 88dvh; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 16px 18px 20px; overflow-y: auto; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.field small { color: var(--text-3); font-size: 12px; }
.field input[type=text], .field input[type=number], .field select, .field textarea, .inp {
  padding: 8px 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); outline: none; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.switch input { width: 40px; height: 22px; accent-color: var(--accent); }
.btn { padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-3); font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--bg-4); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.list { display: flex; flex-direction: column; gap: 6px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .sub { font-size: 12px; color: var(--text-3); }
.tag { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--bg-4); color: var(--text-2); white-space: nowrap; }
.muted { color: var(--text-3); font-size: 13px; }
.section-title { font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.stat { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--text-3); }

/* ---------- live voice ---------- */
.live { position: fixed; inset: 0; z-index: 200; background: radial-gradient(ellipse at center, #141a2c 0%, #07080c 75%); color: #eef1f8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px; text-align: center; }
.live-status { font-size: 15px; color: #a9b3d0; letter-spacing: .3px; min-height: 22px; }
.live-orb { width: 190px; height: 190px; border-radius: 50%; border: 0; background: none; position: relative; padding: 0; }
.live-orb span { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0 8%, #7f9bff 38%, #7b52ff 75%, #3b2a8a 100%);
  box-shadow: 0 0 60px rgba(109,140,255,.55), 0 0 140px rgba(143,109,255,.3); transition: transform .12s ease; }
.live.listening .live-orb span { animation: breathe 2.2s ease-in-out infinite; }
.live.thinking .live-orb span { animation: spin-glow 1.4s linear infinite; }
.live.speaking .live-orb span { animation: none; }
.live-user { font-size: 18px; color: #c9d1ea; max-width: 720px; min-height: 28px; }
.live-bot { font-size: 21px; max-width: 760px; min-height: 32px; line-height: 1.55; max-height: 30vh; overflow-y: auto; }
.live-actions { display: flex; gap: 10px; }
.pill { padding: 10px 20px; border-radius: 99px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #eef1f8; font-weight: 600; }
.pill.danger { background: rgba(255,80,80,.85); border: 0; }
.pill.on { background: rgba(255,255,255,.22); }

.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(50%); background: var(--bg-4); color: var(--text); padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 300; font-size: 14px; max-width: calc(100vw - 32px); }

/* ---------- admin / control center ---------- */
.admin { overflow-y: auto; }
.admin-wrap { max-width: 1180px; width: 100%; margin: 0 auto; padding: 22px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; font-size: 24px; }
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.hero { display: grid; grid-template-columns: 200px 1fr; gap: 22px; align-items: center; }
.gauge { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); }
.gauge .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .num b { font-size: 42px; line-height: 1; display: block; }
.gauge .num span { font-size: 12.5px; color: var(--text-3); }
.verdict { font-size: 16px; line-height: 1.7; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; }
.kpi { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.kpi .label { font-size: 12.5px; color: var(--text-3); }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.kpi .sub { font-size: 12px; color: var(--text-3); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chart-title { font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.spark { width: 100%; height: 90px; }
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.agent { display: flex; flex-direction: column; gap: 10px; }
.agent-head { display: flex; align-items: center; gap: 10px; }
.agent-icon { font-size: 24px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-3); }
.agent-name { font-weight: 700; flex: 1; }
.score-pill { font-weight: 700; padding: 3px 11px; border-radius: 99px; font-size: 14px; }
.score-pill.ready { background: rgba(60,207,145,.15); color: var(--good); }
.score-pill.progress { background: rgba(245,184,74,.15); color: var(--warn); }
.score-pill.attention { background: rgba(255,107,107,.15); color: var(--bad); }
.bar { height: 6px; background: var(--bg-4); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.opinion { font-size: 14.5px; color: var(--text); background: var(--bg); border-radius: 10px; padding: 10px 12px; border-inline-start: 3px solid var(--accent); }
.recs { margin: 0; padding-inline-start: 1.2em; font-size: 13.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.agent-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: flex; gap: 10px; font-size: 13.5px; align-items: baseline; }
.issue b { color: var(--warn); min-width: 28px; }
.log-row { display: grid; grid-template-columns: 110px 140px 1fr 90px; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); align-items: start; font-size: 13.5px; }
.log-row:last-child { border-bottom: 0; }
.st { font-size: 12px; padding: 2px 9px; border-radius: 99px; text-align: center; }
.st.running { background: var(--accent-soft); color: var(--accent); }
.st.done { background: rgba(60,207,145,.15); color: var(--good); }
.st.failed { background: rgba(255,107,107,.15); color: var(--bad); }
.st.proposed { background: rgba(245,184,74,.15); color: var(--warn); }
.result-box { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.result-box pre { white-space: pre-wrap; direction: ltr; text-align: left; max-height: 240px; overflow: auto; background: var(--bg); padding: 8px; border-radius: 8px; }
.bench { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.bench td, .bench th { border-bottom: 1px solid var(--border); padding: 5px 6px; text-align: start; vertical-align: top; }
.toggle-line { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 12px; }
.kcard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }

@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,.4); } 50% { box-shadow: 0 0 0 6px rgba(255,107,107,0); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes spin-glow { 0% { transform: rotate(0) scale(.96); filter: hue-rotate(0); } 50% { transform: rotate(180deg) scale(1.02); } 100% { transform: rotate(360deg) scale(.96); filter: hue-rotate(40deg); } }

@media (max-width: 860px) {
  #sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  #app.side-open #sidebar { transform: none; }
  #app.side-open #scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
  .only-mobile { display: inline-grid; }
  .model-select { max-width: 130px; }
  .suggestions { grid-template-columns: 1fr; }
  .hero, .charts { grid-template-columns: 1fr; }
  .agents { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .log-row { grid-template-columns: 1fr 1fr; }
  .messages { padding: 16px 16px 8px; }
  .composer-wrap { padding: 6px 10px 10px; }
  .live-orb { width: 150px; height: 150px; }
}
