/* ═══════════════════════════════════════════════════════════════
   J.A.R.V.I.S — Design system + Chat UI  (v5)
   Shared tokens are also consumed by the admin panel.
   ═══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Surfaces */
  --bg: #04070d;
  --bg-2: #08101c;
  --surface: rgba(13, 21, 36, .72);
  --surface-2: rgba(22, 34, 56, .55);
  --surface-3: rgba(32, 48, 76, .5);
  --surface-solid: #0b1322;
  --line: rgba(140, 190, 255, .08);
  --line-2: rgba(140, 200, 255, .15);

  /* Text */
  --text: #e7f0fb;
  --text-dim: #a5b6ca;
  --muted: #64788f;

  /* Accent (overridden by [data-accent]) */
  --accent: #3dd6ff;
  --accent-rgb: 61, 214, 255;
  --accent-2: #ff8a3d;
  --accent-2-rgb: 255, 138, 61;

  /* Semantic */
  --ok: #3ee08f;
  --warn: #ffb547;
  --err: #ff5d6c;

  /* Legacy aliases (inline styles in admin tabs rely on these) */
  --panel: var(--surface-solid);
  --border: var(--line-2);
  --border2: rgba(140, 200, 255, .22);
  --glow: var(--accent);

  /* Type */
  --font-display: 'Orbitron', 'Rajdhani', sans-serif;
  --font-hud: 'Rajdhani', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-msg: var(--font-body);
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  /* Shape */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --ring: 0 0 0 3px rgba(var(--accent-rgb), .22);
  --blur: saturate(140%) blur(18px);

  /* Layout */
  --sidebar-left-w: 280px;
  --sidebar-right-w: 300px;

  /* Reactor speeds (overridden by state) */
  --r-slow: 60s;
  --r-mid: 24s;
  --r-fast: 9s;
  --r-pulse: 4s;
  --r-level: 1;
}

[data-accent="mark"] {
  --accent: #ffc247;
  --accent-rgb: 255, 194, 71;
  --accent-2: #ff5a4a;
  --accent-2-rgb: 255, 90, 74;
}

[data-accent="vision"] {
  --accent: #b58cff;
  --accent-rgb: 181, 140, 255;
  --accent-2: #ffd166;
  --accent-2-rgb: 255, 209, 102;
}

[data-accent="ultron"] {
  --accent: #ff4d6d;
  --accent-rgb: 255, 77, 109;
  --accent-2: #9aa7b8;
  --accent-2-rgb: 154, 167, 184;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection {
  background: rgba(var(--accent-rgb), .3);
}

svg {
  flex-shrink: 0;
}

kbd {
  font-family: var(--font-mono);
  font-size: .68em;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-dim);
}

/* ── Ambient background ───────────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(var(--accent-rgb), .10), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(var(--accent-2-rgb), .05), transparent 60%),
    radial-gradient(600px 500px at 0% 80%, rgba(var(--accent-rgb), .05), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

.ambient::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

/* ── Arc reactor ──────────────────────────────────────────────── */
.reactor {
  display: block;
  color: var(--accent);
  overflow: visible;
  transform: scale(var(--r-level));
  transition: transform .12s ease-out;
}

.reactor-xs {
  width: 36px;
  height: 36px;
}

.reactor-sm {
  width: 30px;
  height: 30px;
}

.reactor-xl {
  width: 168px;
  height: 168px;
  filter: drop-shadow(0 0 28px rgba(var(--accent-rgb), .45));
}

.r-halo {
  fill: rgba(var(--accent-rgb), .04);
  stroke: rgba(var(--accent-rgb), .18);
  stroke-width: 1;
}

.r-ticks {
  fill: none;
  stroke: rgba(var(--accent-rgb), .55);
  stroke-width: 5;
  stroke-dasharray: 1.2 8.2;
}

.r-arc {
  fill: none;
  stroke: rgba(var(--accent-rgb), .45);
  stroke-width: 2;
  stroke-dasharray: 110 30 26 30 60 34;
  stroke-linecap: round;
}

.r-arc-bright {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 70 345;
}

.r-segments {
  fill: none;
  stroke: rgba(var(--accent-rgb), .75);
  stroke-width: 11;
  stroke-dasharray: 21 8.5;
  animation: rpulse var(--r-pulse) ease-in-out infinite;
}

.r-inner {
  fill: rgba(var(--accent-rgb), .08);
  stroke: rgba(var(--accent-rgb), .7);
  stroke-width: 1.5;
}

.r-core {
  animation: rpulse var(--r-pulse) ease-in-out infinite;
}

.r-spin {
  transform-origin: 100px 100px;
}

.r-spin-slow {
  animation: rspin var(--r-slow) linear infinite;
}

.r-spin-rev {
  animation: rspin var(--r-mid) linear infinite reverse;
}

.r-spin-fast {
  animation: rspin var(--r-fast) linear infinite;
}

@keyframes rspin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rpulse {

  0%,
  100% {
    opacity: .75;
  }

  50% {
    opacity: 1;
  }
}

body[data-state="thinking"],
body[data-state="streaming"] {
  --r-slow: 14s;
  --r-mid: 5s;
  --r-fast: 1.6s;
  --r-pulse: 1s;
}

body[data-state="listening"] {
  --r-pulse: 2s;
}

body[data-state="recording"] {
  --accent: #ff5d6c;
  --accent-rgb: 255, 93, 108;
  --r-fast: 2.5s;
  --r-pulse: .8s;
}

body[data-state="speaking"] {
  --r-mid: 8s;
  --r-fast: 3s;
  --r-pulse: .6s;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

/* ── Generic controls ─────────────────────────────────────────── */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font: 500 .88rem var(--font-body);
  cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .1s;
}

.btn:hover {
  border-color: rgba(var(--accent-rgb), .45);
  background: var(--surface-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .08));
  border-color: rgba(var(--accent-rgb), .45);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .08) inset, 0 6px 24px rgba(var(--accent-rgb), .12);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .32), rgba(var(--accent-rgb), .12));
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .15) inset, 0 6px 30px rgba(var(--accent-rgb), .25);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  appearance: none;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.icon-btn-sm svg {
  width: 15px;
  height: 15px;
}

.icon-btn.on {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .1);
  border-color: rgba(var(--accent-rgb), .3);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* ── App shell ────────────────────────────────────────────────── */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  height: 100dvh;
  padding: 12px;
  gap: 12px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  transition: width .28s cubic-bezier(.2, .8, .2, 1), opacity .2s, margin .28s, padding .28s, transform .28s;
  overflow: hidden;
}

.sidebar-left {
  width: var(--sidebar-left-w);
  padding: 16px 12px 12px;
  flex-shrink: 0;
}

.sidebar-right {
  width: var(--sidebar-right-w);
  padding: 12px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app.left-collapsed .sidebar-left,
.app.right-collapsed .sidebar-right {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  border-width: 0;
  margin-right: -12px;
}

.app.right-collapsed .sidebar-right {
  margin-right: 0;
  margin-left: -12px;
}

/* ── Brand ──────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 6px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: .28em;
  color: #fff;
  text-shadow: 0 0 18px rgba(var(--accent-rgb), .55);
}

.brand-sub {
  font-family: var(--font-hud);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Search ─────────────────────────── */
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field>svg {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  color: var(--text);
  font: .86rem var(--font-body);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-field input:focus {
  border-color: rgba(var(--accent-rgb), .45);
  box-shadow: var(--ring);
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-field .icon-btn {
  position: absolute;
  right: 5px;
}

/* ── Threads ────────────────────────── */
.threads-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-group {
  font-family: var(--font-hud);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 10px 6px;
}

.thread-group:first-child {
  padding-top: 4px;
}

.thread-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 8px 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.thread-item:hover {
  background: var(--surface-2);
}

.thread-item.active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), .14), rgba(var(--accent-rgb), .03));
  border-color: rgba(var(--accent-rgb), .22);
}

.thread-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.thread-content {
  flex: 1;
  min-width: 0;
}

.thread-title {
  font-size: .87rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
  border-radius: 4px;
}

.thread-title[contenteditable="true"] {
  white-space: normal;
  background: rgba(0, 0, 0, .35);
  box-shadow: var(--ring);
  padding: 0 4px;
  cursor: text;
}

.thread-meta {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--muted);
}

.thread-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
}

.thread-item:hover .thread-actions,
.thread-item.active .thread-actions,
.thread-item.confirm .thread-actions {
  opacity: 1;
}

.thread-act {
  appearance: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.thread-act:hover {
  color: var(--text);
  background: var(--surface-3);
}

.thread-act svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thread-delete:hover,
.thread-item.confirm .thread-delete {
  color: #fff;
  background: rgba(255, 93, 108, .85);
}

.thread-item.confirm .thread-delete {
  width: auto;
  padding: 0 8px;
  font: 600 .72rem var(--font-body);
}

.sid-empty {
  font-family: var(--font-hud);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--muted);
  text-align: center;
  padding: 18px 0;
}

/* ── Sidebar footer ─────────────────── */
.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.accent-picker {
  display: flex;
  gap: 8px;
  padding-left: 4px;
}

.swatch {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--sw);
  box-shadow: 0 0 10px var(--sw);
  transition: transform .15s;
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch.active {
  border-color: #fff;
}

.swatch[data-accent="arc"] {
  --sw: #3dd6ff;
}

.swatch[data-accent="mark"] {
  --sw: #ffc247;
}

.swatch[data-accent="vision"] {
  --sw: #b58cff;
}

.swatch[data-accent="ultron"] {
  --sw: #ff4d6d;
}

.foot-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: .84rem;
  transition: background .15s, color .15s;
}

.foot-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.foot-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform .4s;
}

.foot-link:hover svg {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════════
   CHAT COLUMN
   ═══════════════════════════════════════════════════════════════ */
.chat-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
  position: relative;
}

.chat-col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .6), transparent);
  z-index: 2;
}

/* ── Top bar ────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 62px;
  padding: 0 12px 0 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.thread-title-main {
  font-weight: 600;
  font-size: .98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 6px;
  padding: 2px 4px;
  outline: none;
  cursor: default;
}

.thread-title-main[contenteditable="true"] {
  background: rgba(0, 0, 0, .35);
  box-shadow: var(--ring);
  cursor: text;
}

.thread-id {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.agent-chip {
  --chip: var(--pill, var(--accent));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .2);
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  flex-shrink: 0;
}

.agent-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: 0 0 8px var(--chip);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  margin-right: 6px;
}

.clock-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .08em;
  color: #fff;
}

.clock-date {
  font-family: var(--font-hud);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tts-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  font: 700 .5rem var(--font-body);
  color: var(--accent);
  letter-spacing: 0;
}

#tts-toggle:not(.on) .tts-wave {
  opacity: .25;
}

.status-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  margin: 0 4px;
  border-radius: 999px;
  background: rgba(62, 224, 143, .08);
  border: 1px solid rgba(62, 224, 143, .2);
  color: var(--ok);
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.status-live.err {
  background: rgba(255, 93, 108, .08);
  border-color: rgba(255, 93, 108, .25);
  color: var(--err);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: dotpulse 2.2s ease-in-out infinite;
}

@keyframes dotpulse {

  0%,
  100% {
    opacity: .6;
  }

  50% {
    opacity: 1;
  }
}

/* ── Stage / messages ───────────────── */
.chat-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px max(20px, calc((100% - 860px) / 2)) 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.msg {
  display: flex;
  gap: 14px;
  max-width: 100%;
  animation: msgin .35s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes msgin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.msg.user {
  flex-direction: row-reverse;
  align-self: flex-end;
  max-width: min(78%, 680px);
}

.msg.bot {
  align-self: stretch;
}

.msg-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.msg.user .msg-inner {
  align-items: flex-end;
}

/* Avatar */
.avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 600 .72rem var(--font-body);
}

.user .avatar {
  display: none;
}

.bot .avatar {
  background: radial-gradient(circle, rgba(var(--accent-rgb), .18), transparent 70%);
}

.bot .avatar .reactor {
  width: 30px;
  height: 30px;
}

.msg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 18px;
}

.msg-name {
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--accent);
}

.msg-agent {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}

.msg-agent:empty {
  display: none;
}

.msg-duration {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--muted);
}

/* Bubbles */
.bubble {
  font-family: var(--font-msg);
  font-size: .97rem;
  line-height: 1.7;
  word-break: break-word;
  color: var(--text);
}

.user .bubble {
  padding: 11px 16px;
  border-radius: 18px 18px 4px 18px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .2), rgba(var(--accent-rgb), .1));
  border: 1px solid rgba(var(--accent-rgb), .25);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

.bot .bubble {
  padding: 2px 0;
}

.bubble p {
  margin: 0 0 .7em;
}

.bubble p:last-child {
  margin-bottom: 0;
}

.bubble strong {
  color: #fff;
  font-weight: 600;
}

.bot .bubble strong {
  color: rgb(var(--accent-rgb));
}

.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4 {
  font-family: var(--font-hud);
  font-weight: 700;
  letter-spacing: .04em;
  margin: 1em 0 .4em;
  line-height: 1.3;
}

.bubble h1 {
  font-size: 1.3rem;
}

.bubble h2 {
  font-size: 1.15rem;
}

.bubble h3,
.bubble h4 {
  font-size: 1.02rem;
}

.bubble ul,
.bubble ol {
  margin: .4em 0 .7em 1.3em;
}

.bubble li {
  margin: .2em 0;
}

.bubble li::marker {
  color: var(--accent);
}

.bubble a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), .35);
}

.bubble a:hover {
  border-bottom-color: var(--accent);
}

.bubble blockquote {
  margin: .6em 0;
  padding: 6px 14px;
  border-left: 3px solid rgba(var(--accent-rgb), .5);
  color: var(--text-dim);
  background: rgba(var(--accent-rgb), .04);
  border-radius: 0 8px 8px 0;
}

.bubble hr {
  border: none;
  height: 1px;
  background: var(--line-2);
  margin: 1em 0;
}

.bubble code {
  font-family: var(--font-mono);
  font-size: .84em;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(var(--accent-rgb), .1);
  color: rgb(var(--accent-rgb));
}

.bubble pre {
  position: relative;
  margin: .7em 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--line-2);
  overflow-x: auto;
}

.bubble pre code {
  padding: 0;
  background: none;
  color: #cfe3f7;
  font-size: .82rem;
}

.code-copy {
  position: absolute;
  top: 6px;
  right: 6px;
  appearance: none;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface-solid);
  color: var(--text-dim);
  font: 500 .72rem var(--font-body);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}

.bubble pre:hover .code-copy {
  opacity: 1;
}

.bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: .7em 0;
  font-size: .9rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.bubble th,
.bubble td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.bubble th {
  font-family: var(--font-hud);
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  background: rgba(var(--accent-rgb), .06);
}

.bubble img {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

/* Streaming caret / typing */
body[data-state="streaming"] .msg.streaming .bubble::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: caret 1s steps(2) infinite;
}

@keyframes caret {
  50% {
    opacity: 0;
  }
}

.typing-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 24px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotbounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: .15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes dotbounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: .4;
  }

  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.msg.error .bubble {
  color: #ffc2c8;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 93, 108, .35);
  background: rgba(255, 93, 108, .08);
}

/* Message actions */
.msg-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .15s;
  margin-left: -6px;
}

.msg:hover .msg-actions,
.msg-actions:focus-within {
  opacity: 1;
}

.msg.user .msg-actions {
  margin-left: 0;
  margin-right: -6px;
}

.msg-act {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: 500 .74rem var(--font-body);
  cursor: pointer;
}

.msg-act:hover {
  background: var(--surface-2);
  color: var(--text);
}

.msg-act.on {
  color: var(--accent);
}

.msg-act svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msg-time {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--muted);
  padding: 0 6px;
  align-self: center;
}

/* ── Welcome ────────────────────────── */
.welcome {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
  animation: msgin .5s ease both;
}

.welcome>* {
  pointer-events: auto;
}

#messages:not(:empty)~.welcome {
  display: none;
}

.welcome .reactor {
  margin-bottom: 10px;
}

.welcome-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  letter-spacing: .08em;
  background: linear-gradient(180deg, #fff, rgba(var(--accent-rgb), .85));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome-sub {
  color: var(--text-dim);
  font-size: .98rem;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  gap: 10px;
  margin-top: 18px;
}

.suggestion {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}

.suggestion:hover {
  border-color: rgba(var(--accent-rgb), .45);
  background: rgba(var(--accent-rgb), .08);
  transform: translateY(-2px);
}

.sg-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), .12);
  color: var(--accent);
  font-size: 1.05rem;
}

.sg-text {
  display: flex;
  flex-direction: column;
}

.sg-text b {
  font-weight: 600;
  font-size: .9rem;
}

.sg-text small {
  font-size: .78rem;
  color: var(--muted);
}

/* ── Scroll to bottom ───────────────── */
.scroll-bottom {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 12px);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.scroll-bottom.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.scroll-bottom svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* ── Composer ───────────────────────── */
.composer-wrap {
  flex-shrink: 0;
  padding: 0 max(16px, calc((100% - 892px) / 2)) 12px;
}

#agent-bar {
  margin-bottom: 8px;
}

#agent-actions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  mask-image: linear-gradient(90deg, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
}

#agent-actions::-webkit-scrollbar {
  display: none;
}

.agent-pill {
  --pill: var(--accent);
  --pill-rgb: var(--accent-rgb);
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  color: var(--text-dim);
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}

.agent-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pill);
  opacity: .55;
}

.agent-pill:hover {
  color: var(--text);
  border-color: rgba(var(--pill-rgb), .4);
}

.agent-pill.selected {
  color: #fff;
  border-color: rgba(var(--pill-rgb), .6);
  background: rgba(var(--pill-rgb), .16);
  box-shadow: 0 0 16px rgba(var(--pill-rgb), .2);
}

.agent-pill.selected::before {
  opacity: 1;
  box-shadow: 0 0 8px var(--pill);
}

.agent-pill.active:not(.selected) {
  border-color: rgba(var(--pill-rgb), .35);
}

[data-key="mail"] {
  --pill: #8f7cff;
  --pill-rgb: 143, 124, 255;
}

[data-key="calendar"] {
  --pill: #3ee08f;
  --pill-rgb: 62, 224, 143;
}

[data-key="todo"] {
  --pill: #60a5fa;
  --pill-rgb: 96, 165, 250;
}

[data-key="shopping"] {
  --pill: #fb923c;
  --pill-rgb: 251, 146, 60;
}

[data-key="home"] {
  --pill: #d08cff;
  --pill-rgb: 208, 140, 255;
}

[data-key="health"] {
  --pill: #ff7a85;
  --pill-rgb: 255, 122, 133;
}

[data-key="chantier"] {
  --pill: #fbbf24;
  --pill-rgb: 251, 191, 36;
}

[data-key="devis"] {
  --pill: #34d399;
  --pill-rgb: 52, 211, 153;
}

[data-key="jellyfin"] {
  --pill: #a78bfa;
  --pill-rgb: 167, 139, 250;
}

[data-key="spotify"] {
  --pill: #22c55e;
  --pill-rgb: 34, 197, 94;
}

.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-2);
  background: rgba(4, 9, 18, .7);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
  transition: border-color .2s, box-shadow .2s;
}

.composer:focus-within {
  border-color: rgba(var(--accent-rgb), .5);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .1), 0 10px 40px rgba(0, 0, 0, .35), 0 0 40px rgba(var(--accent-rgb), .08);
}

#msg-input {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: 1rem/1.55 var(--font-body);
  padding: 9px 0;
  max-height: 200px;
  min-height: 42px;
}

#msg-input:focus-visible {
  box-shadow: none;
}

#msg-input::placeholder {
  color: var(--muted);
}

.composer-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.mic-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.mic-btn.active {
  color: #fff;
  background: rgba(255, 93, 108, .2);
  border-color: rgba(255, 93, 108, .6);
  box-shadow: 0 0 0 calc(var(--mic-level, 0) * 10px) rgba(255, 93, 108, .18), 0 0 24px rgba(255, 93, 108, .4);
}

.send-btn {
  appearance: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #04121c;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), .45);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}

.send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 32px rgba(var(--accent-rgb), .7);
}

.send-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send-btn .i-stop {
  display: none;
  fill: currentColor;
  stroke: none;
}

.send-btn.stop {
  background: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, .3);
}

.send-btn.stop .i-send {
  display: none;
}

.send-btn.stop .i-stop {
  display: block;
}

.composer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 22px;
  padding: 6px 8px 0;
  font-size: .74rem;
  color: var(--muted);
}

#conv-status {
  color: var(--accent);
  font-weight: 500;
}

#vad-debug {
  font-family: var(--font-mono);
  font-size: .68rem;
}

#respeaker-thread {
  color: var(--accent);
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.composer-foot .hint {
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════
   RIGHT HUD
   ═══════════════════════════════════════════════════════════════ */
.sidebar-right {
  gap: 12px;
  overflow-y: auto;
}

.hud-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  flex-shrink: 0;
  overflow: hidden;
}

.hud-card::before,
.hud-card::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(var(--accent-rgb), .5);
  pointer-events: none;
}

.hud-card::before {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
  border-radius: 6px 0 0 0;
}

.hud-card::after {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 6px 0;
}

.hud-grow {
  flex: 1;
  min-height: 220px;
}

.hud-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 8px 26px;
}

.hud-title {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hud-metric {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(var(--accent-rgb), .5);
}

.hud-body {
  padding: 4px 16px 16px;
}

/* Bench */
.bench-item {
  margin-bottom: 10px;
}

.bench-item:last-child {
  margin-bottom: 0;
}

.bench-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.bench-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bench-label span:last-child {
  color: var(--text);
  flex-shrink: 0;
}

.bench-bar-bg {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  overflow: hidden;
}

.bench-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}

.bench-bar-fill.fast {
  background: linear-gradient(90deg, rgba(62, 224, 143, .5), var(--ok));
}

.bench-bar-fill.medium {
  background: linear-gradient(90deg, rgba(255, 181, 71, .5), var(--warn));
}

.bench-bar-fill.slow {
  background: linear-gradient(90deg, rgba(255, 93, 108, .5), var(--err));
}

.bench-sub-item {
  margin: -4px 0 10px 10px;
  padding-left: 10px;
  border-left: 1px dashed rgba(181, 140, 255, .35);
}

.bench-sub-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: .66rem;
  color: #c4a8ff;
  margin-bottom: 3px;
}

.bench-sub-pct {
  color: var(--muted);
}

.bench-bar-llm {
  background: linear-gradient(90deg, rgba(181, 140, 255, .4), #b58cff) !important;
}

.bench-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.btk-label {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}

.btk-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(62, 224, 143, .08);
  border: 1px solid rgba(62, 224, 143, .2);
}

.btk-lbl {
  font-size: .64rem;
  color: rgba(62, 224, 143, .7);
}

.btk-val {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--ok);
}

/* Sys grid */
.sid-sysgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.sys-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
}

.sys-row:last-child {
  border-bottom: none;
}

.sys-k {
  font-family: var(--font-hud);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: .76rem;
}

.sys-v {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--text);
  text-align: right;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sys-v.ok {
  color: var(--ok);
}

.sys-v.warn {
  color: var(--warn);
}

/* Log */
.seg {
  display: inline-flex;
  margin-left: auto;
  padding: 2px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
}

.log-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 .7rem var(--font-body);
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.log-tab.active {
  background: var(--surface-3);
  color: var(--text);
}

.sid-logbody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.log-entry {
  display: flex;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: .68rem;
  line-height: 1.45;
  animation: logfade .25s ease;
  flex-shrink: 0;
}

.log-entry:hover {
  background: rgba(255, 255, 255, .03);
}

@keyframes logfade {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
}

.log-time {
  color: var(--muted);
  flex-shrink: 0;
}

.log-msg {
  color: var(--text-dim);
  word-break: break-word;
}

.log-entry.ok .log-msg {
  color: #8ff0bf;
}

.log-entry.warn .log-msg {
  color: #ffd08a;
}

.log-entry.error .log-msg {
  color: #ff9aa5;
}

.log-entry::before {
  content: '';
  width: 5px;
  height: 5px;
  margin-top: .55em;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: .7;
}

.log-entry.ok::before {
  background: var(--ok);
}

.log-entry.warn::before {
  background: var(--warn);
}

.log-entry.error::before {
  background: var(--err);
}

/* ── Toast ──────────────────────────── */
.toast,
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 9000;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid rgba(var(--accent-rgb), .4);
  color: var(--text);
  font: 500 .86rem var(--font-body);
  box-shadow: var(--shadow), 0 0 30px rgba(var(--accent-rgb), .15);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}

.toast.show,
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.err,
#toast.err {
  border-color: rgba(255, 93, 108, .5);
  color: #ffc2c8;
}

/* ── Scrim (mobile drawers) ─────────── */
.scrim {
  display: none;
}

/* ── Scrollbars ─────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 200, 255, .18) transparent;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(140, 200, 255, .14);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), .45);
  background-clip: padding-box;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  :root {
    --sidebar-right-w: 270px;
    --sidebar-left-w: 250px;
  }
}

@media (max-width: 1100px) {

  .sidebar-right {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    padding: 0;
    transform: translateX(calc(100% + 24px));
  }

  .app.right-open .sidebar-right {
    transform: none;
  }

  .app.right-collapsed .sidebar-right {
    width: var(--sidebar-right-w);
    opacity: 1;
    margin: 0;
  }

  .app.right-open .scrim {
    display: block;
  }
}

@media (max-width: 820px) {
  .app {
    padding: 0;
    gap: 0;
  }

  .chat-col {
    border-radius: 0;
    border: none;
  }

  .sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    background: var(--surface-solid);
    transform: translateX(-105%);
  }

  .app.left-open .sidebar-left {
    transform: none;
  }

  .app.left-collapsed .sidebar-left {
    width: var(--sidebar-left-w);
    padding: 16px 12px 12px;
    opacity: 1;
    border-width: 1px;
    margin: 0;
  }

  .app.left-open .scrim {
    display: block;
  }

  .sidebar-right {
    top: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    background: var(--surface-solid);
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(3px);
  }

  .header-clock,
  .agent-chip,
  .thread-id,
  .composer-foot .hint,
  #status-text {
    display: none;
  }

  .suggestions {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 360px;
  }

  .reactor-xl {
    width: 120px;
    height: 120px;
  }

  .msg.user {
    max-width: 90%;
  }

  .msg-actions {
    opacity: 1;
  }
}
