/* Optim Board Room — calm, reading-first, unmistakably Optim.
   Navy / electric blue / white. Spacing and type carry the structure; borders
   and glow are used sparingly and deliberately. */

:root {
  /* Core identity tokens */
  --bg: #050a14;
  --bg2: #081020;
  --surface: #0b1526;
  --surface-raised: #101d33;
  --border: #1b2a47;
  --border-strong: #24365c;
  --blue: #2f7bff;
  --blue-bright: #5b9bff;
  --blue-deep: #1e5fd6;
  --text: #eaf1ff;
  --muted: #8fa3c8;
  --success: #35d49a;
  --danger: #ff5d6c;
  --warning: #f6b94a;

  /* Legacy aliases — older inline styles and any plugin CSS still name these. */
  --panel: var(--surface);
  --panel2: var(--surface-raised);
  --line: var(--border);
  --line2: var(--border-strong);
  --blue-hi: var(--blue-bright);
  --blue-lo: var(--blue-deep);
  --ok: var(--success);
  --warn: var(--warning);
  --accent: var(--blue);

  /* White text needs a darker blue than --blue (only ~3.89:1). Every filled
     blue control that carries white text uses --blue-deep, which clears 5.7:1. */
  --on-blue: #ffffff;
  --blue-fill: var(--blue-deep);
  --blue-fill-hover: #2569e6;   /* 5.0:1 with white — --blue itself is only 3.89 */

  /* A control's own boundary is what identifies it, so it needs 3:1 against the
     surface behind it (WCAG 1.4.11). --border is decorative separation and is
     deliberately quieter; this one is for buttons, fields and switches. */
  --field-border: #55688c;

  /* Spacing scale — structure comes from these, not from bordering everything */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --measure: 780px;          /* long-form reading column (720–840) */
  --shadow: 0 10px 34px rgba(0, 0, 0, .42);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .5);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue-bright);
  --speed: .16s;
  font-size: 15px;
}
body.text-small { font-size: 13px; }
body.text-large { font-size: 17px; }

body.light {
  --bg: #f6f8fd;
  --bg2: #eef2fb;
  --surface: #ffffff;
  --surface-raised: #f4f7fe;
  --border: #dde5f4;
  --border-strong: #c3d0ea;
  --text: #0a1424;
  --muted: #4d5f83;          /* 4.9:1 on white */
  --success: #12805c;
  --danger: #c8283a;
  --warning: #8a5a00;
  --blue-bright: #1e5fd6;    /* links/accents must darken on a light field */
  --field-border: #7186a8;   /* 3.1:1 on the light surfaces */
  --blue-fill-hover: #1a53bd;
  --shadow: 0 10px 30px rgba(16, 32, 64, .10);
  --shadow-lg: 0 22px 60px rgba(16, 32, 64, .16);
  --ring: 0 0 0 2px #fff, 0 0 0 4px var(--blue-deep);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body, #app { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.icon-defs { position: absolute; }
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -60px; left: var(--s4); z-index: 200;
  background: var(--surface-raised); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 16px; transition: top var(--speed);
}
.skip-link:focus { top: var(--s3); }

/* One focus treatment, everywhere. */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

#app { display: flex; height: 100%; }

/* ============================ LEFT NAVIGATION ============================ */
#sidebar {
  width: 268px; min-width: 268px;
  display: flex; flex-direction: column; gap: var(--s4);
  padding: var(--s4) var(--s3);
  background: var(--bg2);
  border-right: 1px solid var(--border);
}
#app.sidebar-collapsed #sidebar { display: none; }

.nav-top { display: flex; align-items: center; gap: var(--s2); }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 2px; }
/* The mark is inline vector art (no baked-in background square), so it sits
   directly on the sidebar; the drop-shadow gives it the brand's blue halo. */
.optim-mark { display: inline-block; filter: drop-shadow(0 1px 6px rgba(47, 123, 255, .45)); }
.brand-logo { width: 30px; height: 30px; flex: none; }
/* On the light theme the steel half would melt into white surfaces — the
   gradient lives in this document's defs, so CSS can re-shade it to slate. */
body.light #omark-steel stop:nth-child(1) { stop-color: #8a97ad; }
body.light #omark-steel stop:nth-child(2) { stop-color: #66748c; }
body.light #omark-steel stop:nth-child(3) { stop-color: #46536a; }
body.light .optim-mark { filter: drop-shadow(0 1px 5px rgba(30, 95, 214, .22)); }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-optim { font-weight: 800; letter-spacing: .2em; font-size: .95rem; color: var(--text); }
.brand-sub { color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }

.nav-actions { display: flex; flex-direction: column; gap: var(--s2); }
.nav-footer { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: var(--s3); }

.room-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 calc(var(--s2) * -1); padding: 0 var(--s2); }
.list-label {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding: var(--s4) var(--s2) var(--s1);
}

/* A meeting row is a real button plus a real menu button — never a div, and
   never hover-only: the menu is reachable by keyboard at all times. */
.room-row { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm); }
.room-row:hover { background: var(--surface); }
.room-item {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2);
  font: inherit; text-align: left; color: var(--muted);
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 9px var(--s2); cursor: pointer; min-height: 36px;
}
.room-item .rname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .cnt { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.room-item:hover { color: var(--text); }
.room-row.active { background: var(--surface-raised); }
.room-row.active .room-item { color: var(--text); font-weight: 600; }
.room-row.active { box-shadow: inset 3px 0 0 var(--blue); }

.project-row { display: flex; align-items: center; gap: 2px; margin-top: var(--s2); }
.project-head {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2);
  font: inherit; font-weight: 600; font-size: .86rem; color: var(--text); text-align: left;
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 7px var(--s2); cursor: pointer; min-height: 34px;
}
.project-head:hover { background: var(--surface); }
.project-head .tri { transition: transform var(--speed); color: var(--muted); }
.project-head[aria-expanded="true"] .tri { transform: rotate(90deg); }
.project-head .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-rooms { margin-left: var(--s4); border-left: 1px solid var(--border); padding-left: var(--s1); display: flex; flex-direction: column; gap: 1px; }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  padding: 9px 14px; min-height: 40px; cursor: pointer;
  transition: background var(--speed), border-color var(--speed), color var(--speed);
  white-space: nowrap;
}
.btn:hover { border-color: var(--blue); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--blue-fill); border-color: var(--blue-fill); color: var(--on-blue); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--blue-fill-hover); border-color: var(--blue-fill-hover); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); font-weight: 600; }
.btn-danger:hover:not(:disabled) { background: rgba(255, 93, 108, .12); }
.btn-quiet { background: transparent; border-color: var(--border); color: var(--text); }
.btn-quiet:hover { background: var(--surface); }
.btn-nav {
  background: transparent; border-color: transparent; color: var(--muted);
  justify-content: flex-start; padding: 9px 10px;
}
.btn-nav:hover { background: var(--surface); color: var(--text); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: .86rem; }

/* 24×24 is the accessible floor; these sit at 32 so they are comfortable. */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer; transition: background var(--speed), color var(--speed);
}
.icon-btn:hover { background: var(--surface); color: var(--text); }

.chip-btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  font: inherit; font-size: .85rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; min-height: 34px; cursor: pointer;
  transition: border-color var(--speed), background var(--speed);
}
.chip-btn:hover { border-color: var(--blue); }
.meta-badge { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 var(--s1); }

/* ============================ HEADER ============================ */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }

#roomHeader {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s5); border-bottom: 1px solid var(--border);
  background: var(--bg); min-height: 58px;
}
.rh-left { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.rh-right { display: flex; align-items: center; gap: var(--s2); }
.room-title {
  font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--text);
  background: none; border: 0; border-radius: var(--radius-sm); padding: 4px 6px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 34vw; min-height: 32px;
}
.room-title:hover { background: var(--surface); }
.picker-wrap { position: relative; }

/* Board summary: a countable, labelled control — not a stack of overlapping
   circles nobody can read or reach. */
.board-faces { display: inline-flex; }
.board-face {
  width: 22px; height: 22px; border-radius: 50%; margin-left: -6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 700; color: #fff;
  border: 2px solid var(--bg);
}
.board-face:first-child { margin-left: 0; }
.board-face.needs-setup { opacity: .5; }

/* ============================ POPOVERS / MENUS ============================ */
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: min(430px, 90vw);
  background: var(--surface-raised); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--s2);
  animation: rise .14s ease;
}
.sp-option {
  display: flex; align-items: flex-start; gap: var(--s3); width: 100%; text-align: left;
  font: inherit; color: var(--text); background: none; border: 1px solid transparent;
  padding: 10px var(--s3); border-radius: var(--radius-sm); cursor: pointer;
}
.sp-option:hover { background: var(--surface); }
.sp-option[aria-selected="true"] { background: rgba(47, 123, 255, .14); border-color: var(--blue-deep); }
.sp-option .ico { color: var(--blue-bright); margin-top: 2px; }
.sp-option .ttl { font-weight: 650; font-size: .9rem; display: flex; align-items: center; gap: var(--s2); }
.sp-option .dsc { font-size: .78rem; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.sp-foot { font-size: .74rem; color: var(--muted); line-height: 1.5; padding: var(--s2) var(--s3) var(--s1); border-top: 1px solid var(--border); margin-top: var(--s1); }

.ctx-menu {
  position: fixed; z-index: 70; min-width: 210px;
  background: var(--surface-raised); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: var(--s1);
  animation: rise .12s ease;
}
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font: inherit; font-size: .88rem; color: var(--text); text-align: left;
  background: none; border: 0; border-radius: var(--radius-sm); padding: 9px var(--s3);
  cursor: pointer; min-height: 38px;
}
.ctx-item:hover { background: var(--surface); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(255, 93, 108, .12); }
.ctx-sep { height: 1px; background: var(--border); margin: var(--s1) var(--s2); }
.ctx-label { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: var(--s2) var(--s3) var(--s1); }

@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================ TRANSCRIPT ============================ */
.transcript-wrap { flex: 1; min-height: 0; position: relative; display: flex; }
.messages {
  flex: 1; overflow-y: auto; padding: var(--s6) var(--s5) var(--s4);
  display: flex; flex-direction: column; gap: var(--s5); scroll-behavior: smooth;
}
.messages > * { width: 100%; max-width: var(--measure); margin-inline: auto; }

.jump-latest {
  position: absolute; bottom: var(--s4); left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: var(--s2); z-index: 5;
  font: inherit; font-size: .84rem; color: var(--text);
  background: var(--surface-raised); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 8px 16px; min-height: 36px;
  cursor: pointer; box-shadow: var(--shadow);
}
.jump-latest:hover { border-color: var(--blue); }

.msg { display: flex; flex-direction: column; gap: 6px; animation: rise .18s ease; }

/* AI replies read like a document: no card, no border, no chrome competing
   with the words. */
.msg-meta { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.msg-name { font-weight: 650; font-size: .9rem; }
.msg-tag, .msg-time { font-size: .72rem; color: var(--muted); font-weight: 400; }
.msg-text { line-height: 1.65; overflow-wrap: break-word; }
.msg-text > :last-child { margin-bottom: 0; }

.avatar {
  width: 24px; height: 24px; min-width: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: .68rem;
}

/* Real provider logos ride a light chip so dark marks (ChatGPT, Grok) stay
   readable on both themes; the chip scales with whatever avatar size the
   context already uses. */
.logo-chip { background: #fff; border: 1px solid rgba(20, 32, 56, .22); overflow: hidden; flex: none; }
.logo-chip img { width: 70%; height: 70%; object-fit: contain; display: block; }
.board-face.logo-chip { border: 2px solid var(--bg); background: #fff; }
.catalog-card .cat-face { width: 26px; height: 26px; min-width: 26px; }

/* The chair gets a quiet rule, not a badge parade. */
.msg.is-chair .msg-text { border-left: 2px solid var(--blue-deep); padding-left: var(--s4); margin-left: -1px; }

/* The user's own turn: compact, right-aligned, visually secondary to answers. */
.msg.user { align-items: flex-end; }
.msg.user .msg-meta { justify-content: flex-end; }
.msg.user .msg-text {
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius-sm) var(--radius) var(--radius);
  padding: 10px var(--s4); max-width: min(560px, 88%); text-align: left;
}
body.light .msg.user .msg-text { background: var(--surface-raised); }

.msg.system .msg-text { color: var(--muted); font-size: .9rem; }

.msg.streaming .msg-text::after {
  content: '▍'; color: var(--blue-bright); animation: blink 1s steps(2) infinite; margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.msg-text p { margin: 0 0 .7em; }
.msg-text ul, .msg-text ol { margin: .4em 0 .8em 1.4em; }
.msg-text li { margin-bottom: .25em; }
.msg-text a { color: var(--blue-bright); text-underline-offset: 2px; }
.msg-text code {
  background: rgba(47, 123, 255, .13); border-radius: 5px; padding: 1px 6px;
  font-family: Consolas, "Cascadia Code", monospace; font-size: .9em;
}
body.light .msg-text code { background: rgba(30, 95, 214, .10); }

.codeblock { position: relative; margin: .8em 0; }
.codeblock pre {
  background: #060b16; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--s4); overflow-x: auto;
  font-family: Consolas, "Cascadia Code", monospace; font-size: .87em; line-height: 1.55;
  color: #d5e3ff;
}
body.light .codeblock pre { background: #0b1526; border-color: #0b1526; }
.codeblock .copy-btn {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: .74rem;
  background: var(--surface-raised); color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 4px 9px; min-height: 26px; cursor: pointer; opacity: 0; transition: opacity var(--speed);
}
.codeblock:hover .copy-btn, .codeblock .copy-btn:focus-visible { opacity: 1; }
.codeblock .lang {
  position: absolute; top: -7px; left: var(--s3); font-size: .66rem; color: var(--muted);
  background: var(--bg); padding: 0 6px; border-radius: 4px;
}

/* A member that failed: a compact, local card — never a wall of red. */
.error-card {
  border: 1px solid var(--border-strong); border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm); background: var(--surface); padding: var(--s3) var(--s4);
}
.error-card .ec-head { display: flex; align-items: center; gap: var(--s2); font-weight: 650; font-size: .9rem; }
.error-card .ec-head .icon { color: var(--danger); }
.error-card .ec-summary { color: var(--muted); font-size: .86rem; line-height: 1.55; margin-top: 5px; }
.error-card .ec-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.error-card details { margin-top: var(--s2); }
.error-card summary { cursor: pointer; font-size: .8rem; color: var(--muted); padding: 3px 0; }
.error-card pre.ec-detail {
  margin-top: var(--s2); background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; font-size: .78rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto;
  font-family: Consolas, "Cascadia Code", monospace; color: var(--text);
}

/* Live record of a tool action. Quiet, but never hidden — shown at every
   permission level, including Full access. */
.agent-activity {
  display: flex; align-items: center; gap: var(--s2);
  font-size: .8rem; color: var(--muted);
  padding: 2px 0 2px var(--s3); border-left: 2px solid var(--border-strong);
}
.agent-activity.failed { border-left-color: var(--danger); }
.agent-activity .icon { width: 14px; height: 14px; }

/* ============================ BOARD STATUS ============================ */
.board-status {
  display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center;
  padding: 0 var(--s5) var(--s2); min-height: 6px;
}
.board-status > * { max-width: var(--measure); }
.think-chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px; font-size: .8rem; color: var(--muted);
  animation: rise .2s ease;
}
.think-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
/* Actually doing something on this computer, rather than thinking about it.
   The wording carries the meaning; this only makes it easier to spot. */
.think-chip.is-working { border-color: var(--blue-deep); color: var(--text); }
.think-chip.is-working .dot { background: var(--blue-bright); animation: workPulse 1.4s ease-in-out infinite; }
@keyframes workPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.think-dots { display: inline-flex; gap: 3px; }
.think-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--blue-bright); animation: bounce 1.2s infinite; }
.think-dots i:nth-child(2) { animation-delay: .18s; }
.think-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

/* ============================ COMPOSER ============================ */
#composer { padding: var(--s2) var(--s5) var(--s4); background: var(--bg); }
.composer-shell { max-width: var(--measure); margin-inline: auto; }
.composer-inner {
  display: flex; align-items: flex-end; gap: var(--s2);
  background: var(--surface); border: 1px solid var(--field-border);
  border-radius: var(--radius); padding: var(--s2) var(--s2) var(--s2) var(--s4);
  transition: border-color var(--speed);
}
.composer-inner:focus-within { border-color: var(--blue); }
#app.is-sending .composer-inner { border-color: var(--blue-deep); }
#composerInput {
  flex: 1; resize: none; max-height: 190px;
  font: inherit; color: var(--text); background: transparent; border: 0; outline: none;
  line-height: 1.55; padding: 9px 0;
}
#composerInput::placeholder { color: var(--muted); }
#composerInput:disabled { color: var(--muted); }
.composer-actions { display: flex; align-items: center; gap: var(--s2); padding-bottom: 2px; }
.send-btn { width: 40px; height: 40px; padding: 0; }
.composer-foot {
  display: flex; gap: var(--s2); margin-top: var(--s2); flex-wrap: wrap;
  align-items: center; min-height: 20px; font-size: .76rem; color: var(--muted);
}
.mention-chip {
  font: inherit; font-size: .76rem; color: var(--muted); background: transparent;
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
  min-height: 26px; cursor: pointer;
}
.mention-chip:hover { color: var(--text); border-color: var(--blue); }

/* ============================ INSPECTOR ============================ */
.inspector {
  width: 320px; min-width: 320px; display: flex; flex-direction: column;
  background: var(--bg2); border-left: 1px solid var(--border);
}
.insp-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); }
.insp-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.insp-tab {
  font: inherit; font-size: .8rem; color: var(--muted); background: none;
  border: 0; border-bottom: 2px solid transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 7px 10px; min-height: 32px; cursor: pointer; white-space: nowrap;
}
.insp-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--blue); font-weight: 600; }
.insp-body { flex: 1; overflow-y: auto; padding: var(--s4) var(--s3); font-size: .86rem; }
.insp-section + .insp-section { margin-top: var(--s5); }
.insp-row { display: flex; align-items: center; gap: var(--s2); padding: 6px 0; }
.insp-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Narrow: the inspector becomes an overlay drawer instead of stealing width. */
@media (max-width: 1180px) {
  .inspector {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 45;
    width: min(340px, 92vw); box-shadow: var(--shadow-lg);
  }
}

/* ============================ MODAL / SHEET ============================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 6, 12, .62);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: var(--s4);
}
body.light .modal-backdrop { background: rgba(20, 32, 56, .34); }
.modal {
  width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: rise .18s ease;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5) var(--s3); border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1.05rem; }
.modal-body { padding: var(--s5); overflow-y: auto; }

.sheet {
  width: min(1080px, 100%); height: min(88vh, 900px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: rise .18s ease;
  overflow: hidden;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.sheet-head h2 { font-size: 1.05rem; }
.sheet-main { flex: 1; display: flex; min-height: 0; }
.sheet-nav {
  width: 232px; min-width: 232px; overflow-y: auto; padding: var(--s3) var(--s2);
  border-right: 1px solid var(--border); background: var(--bg2);
  display: flex; flex-direction: column; gap: 1px;
}
.sheet-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font: inherit; font-size: .88rem; color: var(--muted); background: none; border: 0;
  border-radius: var(--radius-sm); padding: 9px var(--s3); min-height: 40px; cursor: pointer;
}
.sheet-nav button:hover { background: var(--surface); color: var(--text); }
.sheet-nav button[aria-current="true"] { background: var(--surface-raised); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.sheet-body { flex: 1; overflow-y: auto; padding: var(--s5) var(--s6); }
.sheet-body > h3 { font-size: 1.02rem; margin-bottom: var(--s2); }
.sheet-body > .section-note { color: var(--muted); font-size: .86rem; line-height: 1.6; margin-bottom: var(--s5); max-width: 68ch; }
.danger-zone { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border); }
.danger-zone > label, .danger-zone .zone-title { color: var(--danger); font-weight: 650; font-size: .85rem; display: block; margin-bottom: var(--s2); }

@media (max-width: 900px) {
  .sheet-main { flex-direction: column; }
  .sheet-nav { width: 100%; min-width: 0; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sheet-nav button { width: auto; white-space: nowrap; }
  .sheet-nav button[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--blue); }
  .sheet-body { padding: var(--s4); }
}

.dialog-backdrop { z-index: 80; }
.dialog {
  width: min(440px, 100%); text-align: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: var(--s5) var(--s5) var(--s4); animation: rise .16s ease;
}
.dialog-logo { width: 44px; height: 44px; margin-bottom: var(--s3); }
.dialog p { line-height: 1.6; margin-bottom: var(--s4); text-align: left; }
.dialog p code { display: inline-block; word-break: break-all; }
.dialog input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg2); border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  padding: 10px var(--s3); outline: none; margin-bottom: var(--s4);
}
.dialog input:focus { border-color: var(--blue); }
.dialog-row { justify-content: flex-end; }

/* ============================ FORM PRIMITIVES ============================ */
.field { margin-bottom: var(--s5); }
.field > label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field input[type="text"], .field input[type="search"], .field input[type="password"],
.field select, .field textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg2); border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  padding: 10px var(--s3); outline: none; min-height: 40px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.field .hint, .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; line-height: 1.55; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
select { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--field-border); border-radius: var(--radius-sm); padding: 8px 10px; min-height: 36px; }

/* A switch is a real focusable checkbox — never display:none. */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input {
  position: absolute; width: 40px; height: 24px; margin: 0; opacity: 0; cursor: pointer;
}
.switch .track {
  width: 40px; height: 22px; border-radius: 999px; background: var(--field-border);
  position: relative; transition: background var(--speed); flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform var(--speed);
}
.switch input:checked + .track { background: var(--blue-fill); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

.slider-field { margin-bottom: var(--s5); }
.slider-row { display: flex; align-items: center; gap: var(--s4); }
.slider-row input[type="range"] { flex: 1; accent-color: var(--blue); height: 4px; cursor: pointer; min-height: 24px; }
.slider-val {
  min-width: 68px; text-align: center; font-weight: 650; font-size: .9rem;
  background: var(--bg2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px var(--s2);
}
.slider-marks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 5px; }
.slider-marks .rec { color: var(--blue-bright); font-weight: 650; }

/* ============================ CARDS ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--muted);
}
.badge.ok { color: var(--success); border-color: rgba(53, 212, 154, .45); }
.badge.warn { color: var(--warning); border-color: rgba(246, 185, 74, .45); }
.badge.free { color: var(--blue-bright); border-color: rgba(91, 155, 255, .45); }
.badge.lead { color: #ffd166; border-color: rgba(255, 209, 102, .45); }
.badge.code { color: #7dd3fc; border-color: rgba(125, 211, 252, .45); }
.badge.big { font-size: .7rem; font-weight: 650; padding: 3px 10px; }
body.light .badge.lead { color: #8a6100; border-color: rgba(138, 97, 0, .4); }
body.light .badge.code { color: #0b6c93; border-color: rgba(11, 108, 147, .4); }
.badge-warn { color: var(--warning); border-color: rgba(246, 185, 74, .5); }

.member-card {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s2);
}
.member-card .avatar { width: 34px; height: 34px; min-width: 34px; font-size: .8rem; }
.member-card .info { flex: 1; min-width: 0; }
.member-card .name { font-weight: 650; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.member-card .sub { font-size: .78rem; color: var(--muted); margin-top: 3px; }
/* Status is never colour-only: the label carries the meaning. */
.member-card.ready { border-left: 3px solid var(--success); }
.member-card.needs { border-left: 3px solid var(--warning); }
.member-card.needs .avatar { opacity: .6; }

.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: var(--s2); }
.catalog-card {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s4); cursor: pointer; transition: border-color var(--speed);
}
.catalog-card:hover { border-color: var(--blue); }
.catalog-card .top { display: flex; align-items: center; gap: var(--s2); margin-bottom: 6px; }
.catalog-card .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.catalog-card .nm { font-weight: 650; }
.catalog-card .vd { font-size: .72rem; color: var(--muted); }
.catalog-card .bl { font-size: .78rem; color: var(--muted); line-height: 1.5; }

.plugin-card { display: flex; align-items: center; gap: var(--s3); background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3) var(--s4); margin-bottom: var(--s2); }
.plugin-card .info { flex: 1; min-width: 0; }
.plugin-card .name { font-weight: 650; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.plugin-card .desc { font-size: .8rem; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* Staged member setup */
.steps { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s5); }
.step {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; min-height: 28px;
}
.step .num {
  width: 18px; height: 18px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: .68rem; font-weight: 700;
  background: var(--border-strong); color: var(--text); flex: none;
}
.step.current { color: var(--text); border-color: var(--blue-deep); }
.step.current .num { background: var(--blue-fill); color: var(--on-blue); }
.step.done .num { background: var(--success); color: #04231a; }
.wizard-foot { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--border); flex-wrap: wrap; }

.choice {
  display: flex; align-items: flex-start; gap: var(--s3); width: 100%; text-align: left;
  font: inherit; color: var(--text); background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--s3) var(--s4); margin-bottom: var(--s2); cursor: pointer;
}
.choice:hover { border-color: var(--blue); }
.choice[aria-pressed="true"] { border-color: var(--blue-deep); background: rgba(47, 123, 255, .10); }
.choice .ttl { font-weight: 650; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.choice .dsc { font-size: .8rem; color: var(--muted); line-height: 1.55; margin-top: 4px; }
.choice-facts { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: 6px; font-size: .74rem; color: var(--muted); }
.choice-facts span { display: inline-flex; align-items: center; gap: 4px; }

/* generated images & files */
.attachments { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.attachment { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); padding: var(--s2); max-width: 100%; }
.attachment.is-image { flex-direction: column; max-width: 340px; }
.attachment-preview img { display: block; max-width: 320px; max-height: 320px; width: auto; height: auto; border-radius: var(--radius-sm); cursor: pointer; background: var(--bg2); }
.attachment-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.attachment-name { font-size: .85rem; font-weight: 600; word-break: break-word; }
.attachment-actions { flex-wrap: wrap; gap: 6px; }

.artifact-list { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.artifact-card { display: flex; gap: var(--s3); align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); padding: 10px; }
.artifact-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg2); flex: none; }
.artifact-card .info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.artifact-card .name { font-weight: 600; font-size: .9rem; word-break: break-word; }
.artifact-card .sub { color: var(--muted); font-size: .78rem; }
.artifact-actions { flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* welcome / empty */
.welcome { text-align: center; padding: var(--s2) var(--s2) 0; }
.welcome .welcome-mark { width: 72px; height: 72px; margin-bottom: var(--s4); filter: drop-shadow(0 4px 22px rgba(47, 123, 255, .38)); }
.welcome h3 { font-size: 1.25rem; margin-bottom: var(--s2); }
.welcome p { color: var(--muted); line-height: 1.65; max-width: 48ch; margin: 0 auto var(--s4); }
.welcome .row { justify-content: center; }

.empty-state { margin: auto; text-align: center; color: var(--muted); padding: var(--s7) var(--s5); max-width: var(--measure); }
.empty-state .empty-mark { width: 84px; height: 84px; margin-bottom: var(--s5); filter: drop-shadow(0 6px 28px rgba(47, 123, 255, .35)); }
.empty-state h2 { color: var(--text); margin-bottom: var(--s2); font-size: 1.35rem; }
.empty-state p { line-height: 1.7; max-width: 52ch; margin: 0 auto var(--s4); }
.empty-state .row { justify-content: center; }

/* toast */
.toast {
  position: fixed; bottom: var(--s5); left: 50%; transform: translateX(-50%);
  background: var(--surface-raised); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 11px 20px; z-index: 90; box-shadow: var(--shadow-lg);
  animation: rise .2s ease; max-width: min(80vw, 640px);
}

/* update banner + provider notices */
.update-banner { display: flex; align-items: center; gap: var(--s2); padding: 8px var(--s5); font-size: .85rem; background: var(--surface-raised); border-bottom: 1px solid var(--border); }
.update-banner .ub-text { flex: 1; min-width: 0; }
.notice-bar { display: flex; flex-direction: column; }
.notice-row { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s5); font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.notice-row.warn { color: var(--warning); }
.notice-row span { flex: 1; min-width: 0; }

/* seat speaking order */
.seat-order {
  min-width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-raised); border: 1px solid var(--border-strong);
  color: var(--blue-bright); font-size: .75rem; font-weight: 650; flex: none;
}
.seat-moves { display: flex; flex-direction: column; gap: 2px; flex: none; }
.seat-move { min-height: 24px; width: 28px; padding: 0; }
.seat-move:disabled { opacity: .3; cursor: default; }

/* armed indicator — always visible while hands-free control is live */
.arm-chip {
  position: fixed; bottom: var(--s4); right: var(--s4); z-index: 100;
  display: flex; align-items: center; gap: 10px;
  background: #7a1414; border: 1px solid #ff8a8a; color: #fff;
  padding: 8px 12px; border-radius: 999px; box-shadow: var(--shadow); font-size: .85rem;
}
.arm-chip .arm-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff8a8a; animation: armPulse 1.2s ease-in-out infinite; }
.arm-chip .arm-label { font-variant-numeric: tabular-nums; }
.arm-chip .btn { background: rgba(255, 255, 255, .12); border-color: #ff8a8a; color: #fff; }
@keyframes armPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ RESPONSIVE ============================
   The app minimum is 900×600, so everything below has to work there. */
@media (max-width: 1080px) {
  #sidebar { width: 236px; min-width: 236px; }
  .messages { padding: var(--s5) var(--s4) var(--s3); }
  #composer { padding: var(--s2) var(--s4) var(--s3); }
  .board-status { padding: 0 var(--s4) var(--s2); }
  #roomHeader { padding: var(--s2) var(--s4); }
  .sheet-body { padding: var(--s4) var(--s5); }
  .modal-body { padding: var(--s4); }
}
@media (max-width: 940px) {
  .room-title { max-width: 26vw; }
  #tokenBadge { display: none; }         /* still reachable in the inspector */
}
@media (max-height: 680px) {
  .messages { padding-top: var(--s4); }
  .empty-state { padding: var(--s5) var(--s4); }
  .empty-state .empty-mark { width: 60px; height: 60px; margin-bottom: var(--s3); }
}

/* ============ Plan picker (onboarding + Settings → Change plan) ============ */
.plan-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
}
.plan-panel {
  position: relative; width: min(1180px, 100%);
  background: var(--bg2); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 28px 28px 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
}
.plan-close {
  position: absolute; top: 14px; right: 14px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 10px; width: 34px; height: 34px;
  cursor: pointer; font-size: .95rem;
}
.plan-close:hover { color: var(--text); border-color: var(--border-strong); }
.plan-title { text-align: center; margin: 4px 0 6px; font-size: 1.5rem; }
.plan-sub { text-align: center; color: var(--text-dim); margin-bottom: 20px; }
.plan-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; align-items: stretch;
}
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 18px 18px; min-height: 380px;
}
.plan-card.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 34px rgba(47,108,246,.18); }
.plan-card.is-current { outline: 1px dashed var(--border-strong); }
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
  letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; text-transform: uppercase;
}
.plan-name { font-weight: 700; font-size: 1.05rem; }
.plan-price { font-size: 2.1rem; font-weight: 750; line-height: 1; }
.plan-price sup { font-size: 1rem; font-weight: 650; margin-right: 1px; }
.plan-cents { font-size: 1rem; font-weight: 650; }
.plan-per { display: block; font-size: .78rem; color: var(--text-dim); font-weight: 500; margin-top: 4px; }
.plan-blurb { color: var(--text-dim); font-size: .85rem; min-height: 3.2em; }
.plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; flex: 1; }
.plan-features li { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; }
.plan-features .icon { width: 15px; height: 15px; color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.plan-cta { width: 100%; justify-content: center; margin-top: 4px; }
.plan-foot { margin-top: 18px; display: grid; gap: 8px; justify-items: center; text-align: center; }

/* ============ Weekly usage bar ============ */
.usage-week { margin: 10px 0 6px; display: grid; gap: 6px; }
.usage-week-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .88rem; }
.usage-week-nums { color: var(--text-dim); font-size: .8rem; }
.usage-bar {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
}
.usage-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--blue-bright, #6ea8ff));
  transition: width .4s ease;
}
.usage-bar-fill.is-warn { background: linear-gradient(90deg, var(--warning), #ffd27a); }
.usage-bar-fill.is-danger { background: linear-gradient(90deg, var(--danger), #ff8b96); }

/* ============ Composer attachments, ＋ menu, dictation ============ */
.composer-side-btn { padding: 6px 10px; font-size: 1rem; line-height: 1; align-self: center; }
#micBtn.is-recording { color: var(--danger); border-color: var(--danger); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { box-shadow: 0 0 0 5px rgba(255,93,108,.18); } }
.attach-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 4px 2px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px 6px 4px 4px; font-size: .8rem; max-width: 240px;
}
.attach-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 7px; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-x { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: .8rem; padding: 2px 4px; }
.attach-x:hover { color: var(--danger); }
.plus-menu {
  position: absolute; bottom: 100%; left: 12px; margin-bottom: 8px; z-index: 60;
  min-width: 280px; background: var(--bg2); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 6px; box-shadow: 0 14px 44px rgba(0,0,0,.5);
  display: grid; gap: 2px;
}
.composer-shell { position: relative; }
.plus-item {
  text-align: left; background: none; border: 0; color: var(--text);
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: .88rem;
}
.plus-item:hover { background: var(--panel); }
.plus-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.plus-head { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); padding: 4px 10px; }
.plus-hint { padding: 2px 10px 8px; }
.plus-plugin { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: .86rem; }
.plus-plugin:hover { background: var(--panel); }

/* ============ Collapsed file attachment in a message ============ */
.attach-file {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); margin: var(--s2) 0; overflow: hidden;
}
.attach-file > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 11px; cursor: pointer; list-style: none;
  font-size: .84rem; user-select: none;
}
.attach-file > summary::-webkit-details-marker { display: none; }
.attach-file > summary::after {
  content: '▸'; margin-left: auto; color: var(--text-dim);
  transition: transform .15s ease; font-size: .8rem;
}
.attach-file[open] > summary::after { transform: rotate(90deg); }
.attach-file > summary:hover { background: var(--panel); }
.attach-file .af-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-file .af-meta { color: var(--text-dim); font-size: .76rem; flex: 0 0 auto; }
.attach-file .codeblock { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; max-height: 420px; overflow: auto; }
