:root {
  color-scheme: dark;
  --bg: #070a12; --bg-grid: rgba(150, 172, 235, .07);
  --surface: rgba(12, 18, 36, .74); --surface-2: rgba(16, 24, 48, .7); --surface-3: rgba(24, 34, 64, .8); --solid: #0c1224; --solid-2: #111a31;
  --line: rgba(150, 172, 235, .26); --line-s: rgba(150, 172, 235, .14); --line-strong: rgba(150, 172, 235, .42);
  --text: #eef1fa; --text-2: #c7cde0; --muted: #8e97b5; --faint: #6f7897; --ink: #0a0d18;
  --blue: #4f8cff; --blue-hover: #6a9dff; --blue-text: #8db4ff; --blue-soft: rgba(79, 140, 255, .16);
  --amber: #ff963c; --amber-text: #ffb877; --amber-soft: rgba(255, 150, 60, .1); --amber-line: rgba(255, 150, 60, .36);
  --green: #3ddc97; --green-text: #5fe6ab; --green-soft: rgba(61, 220, 151, .13);
  --red: #ff6b7a; --red-text: #ff8f9b; --red-soft: rgba(255, 107, 122, .12);
  --violet: #b69cff; --pink: #ff7ab6; --teal: #6fd6c8; --glow: rgba(79, 140, 255, .38); --scrim: rgba(2, 4, 10, .66);
  --head: rgba(7, 10, 18, .78);
  --shadow: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 12px 32px -18px rgba(0, 0, 0, .7);
  --shadow-up: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 40px -16px rgba(0, 0, 0, .8), 0 0 0 1px var(--line-strong);
  --ring: 0 0 0 3px rgba(79, 140, 255, .4);
  --av-l: 24%; --av-s: 45%; --av-t: 82%;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dash: 1px dashed var(--line);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f3f5fb; --bg-grid: rgba(47, 76, 160, .08);
    --surface: rgba(255, 255, 255, .82); --surface-2: rgba(244, 246, 251, .9); --surface-3: #e9edf7; --solid: #ffffff; --solid-2: #f4f6fb;
    --line: rgba(47, 76, 160, .26); --line-s: rgba(47, 76, 160, .13); --line-strong: rgba(47, 76, 160, .45);
    --text: #0e1322; --text-2: #39405a; --muted: #5f6889; --faint: #8a92ad; --ink: #0e1322;
    --blue: #2f6bf0; --blue-hover: #255ddb; --blue-text: #2356c8; --blue-soft: rgba(47, 107, 240, .1);
    --amber: #d06a0c; --amber-text: #9a4a05; --amber-soft: #fff5e8; --amber-line: #f6d2a5;
    --green: #12a26a; --green-text: #0b7a4f; --green-soft: rgba(18, 162, 106, .12);
    --red: #d33b4c; --red-text: #b02a3a; --red-soft: rgba(211, 59, 76, .1);
    --violet: #7c5cff; --pink: #e0478f; --teal: #1a9e8f; --glow: rgba(47, 107, 240, .3); --scrim: rgba(14, 19, 34, .38);
    --head: rgba(243, 245, 251, .82);
    --shadow: 0 1px 2px rgba(16, 24, 48, .04), 0 8px 24px -14px rgba(16, 24, 48, .18);
    --shadow-up: 0 2px 4px rgba(16, 24, 48, .05), 0 14px 32px -14px rgba(16, 24, 48, .24), 0 0 0 1px var(--line-strong);
    --ring: 0 0 0 3px rgba(47, 107, 240, .32);
    --av-l: 92%; --av-s: 85%; --av-t: 34%;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: var(--bg);
}
.atmos {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 85% -140px, rgba(79, 140, 255, .18), transparent 70%),
    radial-gradient(700px 400px at -10% 100%, rgba(255, 150, 60, .07), transparent 70%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px), linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  -webkit-mask-image: linear-gradient(#000 55%, rgba(0, 0, 0, .35)); mask-image: linear-gradient(#000 55%, rgba(0, 0, 0, .35));
}
::selection { background: var(--blue); color: #fff; }
a { color: var(--blue-text); text-underline-offset: 3px; }
code { font: .9em var(--mono); background: var(--surface-3); padding: 1px 6px; border-radius: 3px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -96px; z-index: 50; background: var(--solid); color: var(--text); padding: 8px 14px; border: var(--dash); }
.skip:focus { top: 12px; }
.noscript { text-align: center; padding: 48px 16px; color: var(--muted); }
.mark { width: 26px; height: 26px; flex: none; border-radius: 7px; box-shadow: 0 0 0 1px var(--line), 0 4px 12px -4px rgba(79, 140, 255, .45); }

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px;
  font: 600 13.5px/1 var(--sans); color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--solid-2); border: 1px solid var(--line-strong); border-radius: 6px;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .2s ease, transform .18s var(--ease), color .15s ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--muted); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .06s; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: #fff; border-color: #fff; color: var(--ink); }
.btn-primary:hover { background: #dfe8ff; border-color: #dfe8ff; color: var(--ink); }
@media (prefers-color-scheme: light) { .btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; } .btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; } }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-quiet { background: transparent; border-style: dashed; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); min-height: 30px; padding: 0 10px; font-weight: 500; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); transform: none; }
.btn-block { width: 100%; }
.field {
  width: 100%; min-width: 0; font: inherit; color: var(--text); background: var(--solid);
  border: var(--dash); border-radius: 4px; padding: 9px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field::placeholder { color: var(--faint); }
.field:hover { border-color: var(--line-strong); }
.field:focus { outline: none; border: 1px solid var(--blue); box-shadow: var(--ring); }
.field:disabled { opacity: .6; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 34px; height: 20px; margin: 0; cursor: pointer;
  border-radius: 999px; background: var(--line-strong); transition: background-color .18s ease;
}
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s ease; }
.switch:checked { background: var(--amber); }
.switch:checked::before { transform: translateX(14px); }
.switch:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- avatars ---------- */
.avatar {
  --h: 215; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  font: 650 13px/1 var(--mono); letter-spacing: .02em; user-select: none;
  background: hsl(var(--h) var(--av-s) var(--av-l)); color: hsl(var(--h) 70% var(--av-t));
  box-shadow: 0 0 0 1px hsl(var(--h) 60% 50% / .35) inset;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.t0 { --h: 218; } .t1 { --h: 26; } .t2 { --h: 156; } .t3 { --h: 266; } .t4 { --h: 336; } .t5 { --h: 188; } .t6 { --h: 44; } .t7 { --h: 4; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--head); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: var(--dash); }
.top-inner { display: flex; align-items: center; gap: 10px; max-width: 1320px; margin: 0 auto; padding: 0 24px; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 15px var(--mono); letter-spacing: -.02em; }
.slash { color: var(--line-strong); font-size: 20px; font-weight: 300; }
.picker { min-width: 0; }
.picker select {
  max-width: min(360px, 40vw); font: 500 13px/1 var(--mono); color: var(--text); background: transparent; border: 1px solid transparent;
  border-radius: 4px; padding: 7px 8px; cursor: pointer; text-overflow: ellipsis; transition: background-color .15s ease, border-color .15s ease;
}
.picker select:hover:not(:disabled) { background: var(--surface-3); }
.picker select:focus-visible { outline: none; box-shadow: var(--ring); }
.picker select:disabled { cursor: default; appearance: none; -webkit-appearance: none; opacity: 1; }
.grow { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px; flex: none;
  font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: transparent; border: var(--dash);
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.pill-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.running { color: var(--green-text); border-color: rgba(61, 220, 151, .5); border-style: solid; }
.pill.running .pill-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: pulse 2.2s ease-out infinite; }
.pill.polling, .pill.paused { color: var(--amber-text); border-color: var(--amber-line); }
.pill.refused { color: var(--red-text); border-color: var(--red); }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
.me { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding-left: 6px; }
.me .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.me-name { font: 600 13px var(--mono); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout ---------- */
.shell { max-width: 1320px; margin: 0 auto; padding: 18px 24px 40px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); align-items: start; outline: none; }
.col { display: grid; gap: 16px; min-width: 0; min-height: 80px; align-content: start; }
.col.over { outline: 1px dashed var(--blue); outline-offset: 6px; }
.panel { background: var(--surface); border: var(--dash); min-width: 0; position: relative; transition: box-shadow .3s ease, opacity .2s ease; scroll-margin-top: 76px; }
.panel::before, .panel::after { content: "+"; position: absolute; top: -9px; font: 13px/1 var(--mono); color: var(--faint); background: var(--bg); padding: 0 3px; pointer-events: none; }
.panel::before { left: -5px; } .panel::after { right: -5px; }
.panel:focus { outline: none; }
.panel:focus-visible { box-shadow: var(--ring); }
.panel.dragging { opacity: .35; }
.panel.folded .panel-body { display: none; }
.panel.folded .fold svg { transform: rotate(-90deg); }
.drop-slot { height: 10px; border: 1px dashed var(--blue); background: var(--blue-soft); border-radius: 2px; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 10px; border-bottom: var(--dash); }
.panel-body { padding: 0; }
h2, h3 { margin: 0; font: 600 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text); }
h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--blue-text); }
.grip { display: inline-grid; place-items: center; width: 22px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--faint); cursor: grab; border-radius: 3px; flex: none; }
.grip:hover { color: var(--text); background: var(--surface-3); }
.grip:active { cursor: grabbing; }
.grip:focus-visible { outline: none; box-shadow: var(--ring); color: var(--text); }
.grip .i { width: 14px; height: 14px; }
.fold { margin-left: 2px; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; background: transparent; color: var(--faint); cursor: pointer; border-radius: 3px; flex: none; }
.fold:hover { color: var(--text); background: var(--surface-3); }
.fold:focus-visible { outline: none; box-shadow: var(--ring); }
.fold svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font: 600 11px/1 var(--mono); letter-spacing: 0; color: var(--muted); background: var(--surface-3); }
.count-hot { color: #fff; background: var(--amber); }
.demo-banner, .banner, .notice { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; font-size: 13.5px; border: 1px dashed var(--amber-line); background: var(--amber-soft); color: var(--amber-text); }
.banner::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.notice { border-color: var(--line-strong); background: var(--surface); color: var(--text-2); }
.demo-banner { border-color: rgba(79, 140, 255, .5); background: var(--blue-soft); color: var(--text-2); flex-wrap: wrap; }
.demo-tag { font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: var(--blue-text); padding: 5px 7px; }
.demo-hint { margin-left: auto; font: 12px var(--mono); color: var(--blue-text); }
.empty { list-style: none; display: flex; align-items: center; gap: 10px; padding: 18px 16px; border: var(--dash); color: var(--muted); font-size: 13.5px; margin: 14px 16px; }
.empty::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }

/* ---------- lane map ---------- */
.lanes-map { padding: 10px 16px 6px; }
.lanes-map svg { width: 100%; height: auto; display: block; }
.lane-row { cursor: pointer; }
.lane-row:focus { outline: none; }
.lane-row:focus-visible .lane-bar, .lane-row:hover .lane-bar { stroke: var(--blue); }
.lane-file { font: 12px var(--mono); fill: var(--text); }
.lane-row.quiet .lane-file { fill: var(--muted); }
.lane-bar { stroke: var(--line-strong); stroke-width: 10; stroke-linecap: round; fill: none; }
.lane-row.quiet .lane-bar { stroke: var(--line-s); stroke-dasharray: 2 6; }
.lane-flow { stroke: var(--blue-text); stroke-width: 2; stroke-dasharray: 3 9; stroke-linecap: round; fill: none; opacity: .75; animation: flow 1.4s linear infinite; }
.lane-row.quiet .lane-flow { display: none; }
@keyframes flow { to { stroke-dashoffset: -12; } }
.lane-dot { stroke: var(--bg); stroke-width: 2; }
.lane-dot.wait { fill: none; stroke: var(--amber); stroke-dasharray: 3 3; stroke-width: 1.8; animation: spin 6s linear infinite; transform-box: fill-box; transform-origin: center; }
.lane-ini { font: 650 9.5px var(--mono); fill: var(--ink); text-anchor: middle; pointer-events: none; }
.lane-ini.wait { fill: var(--amber-text); }
.lane-label { font: 11px var(--mono); fill: var(--muted); }
.lane-label.wait { fill: var(--amber-text); }
.lane-label.hold { fill: var(--green-text); }
.lanes-legend { list-style: none; margin: 0; padding: 0 16px 12px; display: flex; flex-wrap: wrap; gap: 14px; font: 11px var(--mono); color: var(--muted); letter-spacing: .04em; }
.lanes-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-hold { background: var(--green); }
.lg-wait { border: 1.5px dashed var(--amber); }
.lg-quiet { border: 1.5px dashed var(--line-strong); }

/* ---------- people ---------- */
.people { list-style: none; margin: 0; padding: 14px 16px 16px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); align-items: start; }
.people > .empty { grid-column: 1 / -1; margin: 0; }
.person {
  min-width: 0; border: var(--dash); background: var(--surface-2); padding: 14px;
  position: relative; transition: border-color .2s ease, box-shadow .25s ease, transform .25s var(--ease);
}
.person::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: hsl(var(--h) 80% 60%); opacity: .9; }
.person:hover, .person:focus-within { border-style: solid; border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.person:focus { outline: none; box-shadow: var(--ring); }
.person.mine { background: linear-gradient(180deg, var(--blue-soft), transparent 70%), var(--surface-2); }
.person-head { display: flex; align-items: center; gap: 11px; }
.avatar-wrap { position: relative; flex: none; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--solid); background: var(--muted); }
.presence.working { background: var(--green); }
.presence.waiting { background: var(--amber); }
.presence.blocked { background: var(--red); }
.person-id { min-width: 0; flex: 1; }
.person-name { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 14.5px; }
.person-name .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.you { font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--blue-text); border: 1px dashed var(--blue-text); padding: 3px 5px; }
.person-sub { color: var(--muted); font-size: 12.5px; }
.agents { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.agent { background: var(--solid); border: var(--dash); padding: 10px 12px; min-width: 0; }
.agent.is-waiting { border-color: var(--amber-line); background: linear-gradient(180deg, var(--amber-soft), var(--solid)); }
.agent-top { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.where { font-family: var(--mono); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state { display: inline-flex; align-items: center; gap: 5px; flex: none; font: 600 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px 4px 7px; border-radius: 999px; color: var(--muted); background: var(--surface-3); }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-working { color: var(--green-text); background: var(--green-soft); }
.s-waiting { color: var(--amber-text); background: var(--amber-soft); box-shadow: 0 0 0 1px var(--amber-line) inset; }
.s-blocked { color: var(--red-text); background: var(--red-soft); }
.task { margin-top: 7px; font-weight: 550; overflow-wrap: anywhere; }
.task.quiet { font-weight: 400; color: var(--muted); }
.wait { margin-top: 7px; font-size: 13px; color: var(--amber-text); overflow-wrap: anywhere; }
.wait code { background: var(--amber-soft); box-shadow: 0 0 0 1px var(--amber-line) inset; color: inherit; }
.chips { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.chips > li { max-width: 100%; min-width: 0; }
.chip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11.5px/1 var(--mono); padding: 5px 7px; color: var(--text-2); background: transparent; border: var(--dash); }
button.chip { cursor: pointer; transition: border-color .15s ease, color .15s ease, background-color .15s ease, transform .18s var(--ease); }
button.chip:hover { border-color: var(--blue); color: var(--blue-text); background: var(--blue-soft); transform: translateY(-1px); }
button.chip:active { transform: scale(.96); }
button.chip:focus-visible { outline: none; box-shadow: var(--ring); }
.chip.hit { border-color: var(--blue); color: var(--blue-text); background: var(--blue-soft); }
.chip.more { color: var(--muted); }
.person-foot { margin-top: 10px; display: flex; justify-content: flex-end; }

/* ---------- requests ---------- */
.panel-sub { margin-left: auto; font: 11.5px var(--mono); color: var(--faint); letter-spacing: .02em; }
.reqs { list-style: none; margin: 0; padding: 14px 16px 16px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.reqs > .empty { grid-column: 1 / -1; margin: 0; }
.reqs-sent { padding-bottom: 4px; }
.req { position: relative; border: var(--dash); padding: 12px 14px; background: var(--surface-2); min-width: 0; transition: border-color .2s ease, box-shadow .25s ease, transform .25s var(--ease); }
.req.inbox { background: var(--solid); border: 1px solid var(--amber-line); box-shadow: 0 0 24px -12px var(--amber); }
.req.inbox:hover, .req.inbox:focus-within { border-color: var(--amber); transform: translateY(-2px); }
.req.inbox:focus { outline: none; box-shadow: var(--ring); }
.req-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13.5px; }
.req-who { flex: 1; min-width: 0; color: var(--text-2); }
.req-who strong { color: var(--text); }
.req-text { margin: 8px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.req-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.left { font: 12px var(--mono); color: var(--muted); margin-right: auto; font-variant-numeric: tabular-nums; }
.left.soon { color: var(--amber-text); }
.badge { display: inline-flex; align-items: center; flex: none; font: 600 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; color: var(--muted); border: var(--dash); }
.scope-read { color: var(--blue-text); border-color: var(--blue-text); }
.scope-edit { color: var(--amber-text); border-color: var(--amber); }
.st-pending { color: var(--blue-text); border-color: var(--blue-text); }
.st-approved, .st-delivered { color: var(--green-text); border-color: var(--green); }
.st-denied { color: var(--red-text); border-color: var(--red); }
.when { font: 12px var(--mono); color: var(--muted); }
.reply { margin: 10px 0 0; padding: 8px 12px; border-left: 2px solid var(--green); background: var(--solid); }
.reply-label { display: block; font: 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.reply p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask { margin: 14px 16px 16px; padding: 16px; background: var(--surface-2); border: var(--dash); }
.ask h3 { margin-bottom: 2px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.ask-row { display: grid; gap: 10px; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); }
.field-wrap { display: grid; gap: 5px; min-width: 0; }
.field-label { font: 600 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ask-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* ---------- chat ---------- */
.chat-panel { position: sticky; top: 76px; display: flex; flex-direction: column; }
.chat-body { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 400px; overflow: hidden; }
.chat-panel.folded .chat-body { display: none; }
.messages { list-style: none; margin: 0; padding: 14px 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.messages > :first-child { margin-top: auto; }
.messages > .empty { margin: 0 0 auto; }
.msg { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.msg-body { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 1px; }
.msg-who { font: 650 12.5px var(--mono); }
.msg-time { font: 11px var(--mono); color: var(--faint); }
.bubble { margin: 0; max-width: 100%; padding: 7px 11px; background: var(--surface-2); border: var(--dash); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-body { align-items: flex-end; }
.msg.mine .msg-head { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--blue-soft); border-color: rgba(79, 140, 255, .5); }
.mention { font-weight: 600; color: var(--blue-text); background: var(--blue-soft); padding: 0 3px; }
.msg.mine .mention { background: var(--solid); }
.mention.to-me { color: var(--amber-text); background: var(--amber-soft); box-shadow: 0 0 0 1px var(--amber-line) inset; }
.composer { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: var(--dash); background: var(--solid); }
.composer-field { position: relative; flex: 1; min-width: 0; display: flex; }
.composer .field { resize: none; field-sizing: content; min-height: 40px; max-height: 140px; line-height: 1.45; }
.btn-send { width: 40px; height: 40px; padding: 0; flex: none; }
.btn-send svg { width: 16px; height: 16px; }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card { width: min(420px, 100%); padding: 36px 32px 28px; text-align: center; background: var(--surface); border: var(--dash); box-shadow: var(--shadow); }
.signin-card .mark { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 18px; }
.signin-card h1 { margin: 0; font: 700 22px var(--mono); letter-spacing: -.02em; }
.lead { margin: 8px 0 22px; color: var(--muted); }
.reason { margin: 0 0 18px; padding: 10px 12px; font-size: 13.5px; color: var(--red-text); background: var(--red-soft); text-align: left; border: 1px dashed var(--red); }
.gh { display: grid; gap: 12px; margin-bottom: 20px; }
.btn-github { min-height: 44px; font-size: 14.5px; background: #1f2328; border-color: #1f2328; color: #fff; }
.btn-github:hover { background: #32383f; border-color: #32383f; color: #fff; }
.gh-mark { width: 18px; height: 18px; }
.gh-code { display: grid; gap: 12px; }
.step { margin: 0; font-size: 13px; color: var(--muted); }
.code-row { display: flex; align-items: center; gap: 8px; }
.user-code { flex: 1; display: block; padding: 12px; font: 650 26px/1.1 var(--mono); letter-spacing: .14em; background: var(--solid); border: 1px dashed var(--line-strong); user-select: all; }
.code-row .btn { min-height: 52px; }
.btn-block { min-height: 42px; }
.waiting-line { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gh-error { display: grid; gap: 10px; }
.gh-error p { margin: 0; padding: 10px 12px; font-size: 13.5px; color: var(--red-text); background: var(--red-soft); text-align: left; overflow-wrap: anywhere; }
.fallback { margin: 0; padding-top: 18px; border-top: var(--dash); font-size: 13px; color: var(--muted); }

/* ---------- header tools ---------- */
.i { width: 16px; height: 16px; flex: none; }
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; font: 600 11px/1 var(--mono); color: var(--muted); background: var(--solid); border: 1px solid var(--line-strong); border-bottom-width: 2px; white-space: nowrap; }
.cmdk {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 11px; min-width: 0; cursor: pointer;
  font: 500 13px/1 var(--sans); color: var(--muted); background: transparent; border: var(--dash);
  transition: border-color .15s ease, color .15s ease;
}
.cmdk:hover { color: var(--text); border-color: var(--line-strong); }
.cmdk:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.cmdk-text { padding-right: 24px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; cursor: pointer;
  font: 650 15px/1 var(--mono); color: var(--muted); background: transparent; border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, transform .18s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .i { width: 18px; height: 18px; }
#notify[aria-pressed="true"] { color: var(--blue-text); background: var(--blue-soft); }
#notify.ring .i { animation: ring .7s var(--ease); transform-origin: 50% 10%; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.jump-chat { display: none; }
.dot-count { position: absolute; top: 2px; right: 1px; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; font: 700 10px/1 var(--mono); color: #fff; background: var(--pink); box-shadow: 0 0 0 2px var(--bg); animation: pop .35s var(--spring); }
.pill.pop { animation: pop .4s var(--spring); }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- panel accents, filter ---------- */
.tag { flex: none; width: 8px; height: 8px; border-radius: 2px; }
.tag-blue { background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.tag-green { background: var(--green); box-shadow: 0 0 10px var(--green); }
.tag-orange { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.tag-violet { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.tag-pink { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.tag-teal { background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.filter { position: relative; display: flex; align-items: center; margin-left: auto; min-width: 0; color: var(--muted); }
.filter .i { position: absolute; left: 10px; width: 14px; height: 14px; pointer-events: none; }
.filter-input { width: 220px; height: 30px; padding: 0 10px 0 31px; font: 12.5px/1 var(--mono); color: var(--text); background: var(--solid); border: var(--dash); transition: width .25s var(--ease), border-color .15s ease, box-shadow .15s ease; }
.filter-input::placeholder { color: var(--faint); }
.filter-input:hover { border-color: var(--line-strong); }
.filter-input:focus { outline: none; width: 280px; border: 1px solid var(--blue); box-shadow: var(--ring); }
.filter-input:not(:placeholder-shown) { border-color: var(--blue); background: var(--blue-soft); }
.filter-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 16px -4px; font-size: 13px; color: var(--text-2); }
.filter-sum code { color: var(--blue-text); background: var(--blue-soft); }
.empty .btn { margin-left: auto; }
.empty-q { overflow-wrap: anywhere; }

/* ---------- person actions ---------- */
.person-actions { display: flex; gap: 2px; margin-left: auto; transition: opacity .2s ease; }
.person-actions .btn-ghost { min-height: 28px; padding: 0 8px; font-size: 12.5px; }
@media (hover: hover) {
  .person:not(:hover):not(:focus-within) .person-actions .btn-ghost:not(.keep) { opacity: 0; }
  .person-actions .btn-ghost { transition: opacity .2s ease, background-color .15s ease, color .15s ease; }
}

/* ---------- motion: enter, live change, leave ---------- */
.enter { animation: enter .42s var(--ease) both; }
.d1 { animation-delay: 40ms; } .d2 { animation-delay: 80ms; } .d3 { animation-delay: 120ms; } .d4 { animation-delay: 160ms; } .d5 { animation-delay: 200ms; } .d6 { animation-delay: 240ms; } .d7 { animation-delay: 280ms; } .d8 { animation-delay: 320ms; }
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.flash { position: relative; }
.flash::after { content: ""; position: absolute; inset: -1px; pointer-events: none; box-shadow: 0 0 0 2px var(--blue), 0 0 24px 2px var(--glow); opacity: 0; animation: flash 1.6s ease-out; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
.gone { pointer-events: none; animation: leave .5s var(--ease) .55s both; }
.gone-deny { animation-name: leave-left; animation-delay: .25s; }
.gone-approve { border-color: var(--green) !important; }
@keyframes leave { to { opacity: 0; transform: translateY(-6px) scale(.96); } }
@keyframes leave-left { to { opacity: 0; transform: translateX(-24px); } }
.btn-ok { background: var(--green); border-color: var(--green); color: var(--ink); animation: pop .45s var(--spring); }
.btn-ok:disabled { opacity: 1; }
.check { width: 16px; height: 16px; }
.check path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: draw .4s var(--ease) .08s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.busy::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ---------- skeletons ---------- */
.skel { list-style: none; position: relative; overflow: hidden; border: var(--dash); background: var(--surface-2); padding: 14px; display: grid; gap: 9px; margin: 14px 16px 0; }
.skel span { display: block; height: 10px; background: var(--surface-3); }
.skel span:nth-child(1) { width: 40%; height: 12px; } .skel span:nth-child(2) { width: 85%; } .skel span:nth-child(3) { width: 62%; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(150, 172, 235, .08), transparent); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- activity ---------- */
.activity { list-style: none; margin: 0; padding: 12px 16px 16px; display: grid; gap: 2px; }
.act { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 8px; transition: background-color .15s ease; }
.act:hover { background: var(--surface-2); }
.act::before { content: ""; position: absolute; left: 21px; top: 36px; bottom: -6px; width: 0; border-left: 1px dashed var(--line); }
.act:last-child::before { display: none; }
.act .avatar { position: relative; }
.act-ico { position: absolute; left: 28px; top: 26px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--solid); background: var(--muted); }
.a-start { background: var(--blue); } .a-done { background: var(--green); } .a-wait { background: var(--amber); } .a-problem { background: var(--red); }
.a-ask { background: var(--violet); } .a-approved { background: var(--green); } .a-declined { background: var(--red); } .a-reply { background: var(--pink); }
.act-text { margin: 0; padding-top: 4px; font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.act-text strong { color: var(--text); font-weight: 650; }
.act-subject { color: var(--text); }
.act-time { padding-top: 5px; font: 11.5px var(--mono); color: var(--faint); white-space: nowrap; }
.activity > .empty { margin: 0; }

/* ---------- chat extras ---------- */
.bubble.enter { animation: bubble .38s var(--spring) both; transform-origin: 0 0; }
.msg.mine .bubble.enter { transform-origin: 100% 0; }
@keyframes bubble { from { opacity: 0; transform: translateY(6px) scale(.94); } to { opacity: 1; transform: none; } }
.new-pill { position: absolute; left: 50%; bottom: 78px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 14px; border-radius: 999px; border: 0; cursor: pointer; font: 600 12px/1 var(--mono); color: var(--ink); background: #fff; transform: translateX(-50%); animation: rise .3s var(--spring); }
.new-pill:hover { background: #dfe8ff; }
.new-pill:focus-visible { outline: none; box-shadow: var(--ring); }
.new-pill .i { width: 14px; height: 14px; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }
.counter { font: 11px var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.counter.near { color: var(--amber-text); font-weight: 600; }
.counter-float { position: absolute; right: 10px; bottom: -18px; }
.composer { padding-bottom: 20px; }
.btn-send .i { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.btn-send:hover .i { transform: translateX(2px); }
.btn-send.sent .i { animation: fly .45s var(--ease); }
@keyframes fly { 0% { transform: none; } 45% { transform: translate(12px, -10px); opacity: 0; } 55% { transform: translate(-10px, 8px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- request composer ---------- */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ask textarea.field { resize: none; field-sizing: content; min-height: 40px; max-height: 160px; line-height: 1.45; }
.sugg { display: flex; flex-wrap: wrap; gap: 5px; min-height: 0; }
.sugg:empty { display: none; }
.sugg-btn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 3px; border-radius: 999px; cursor: pointer; font: 500 12.5px/1 var(--sans); color: var(--text-2); background: transparent; border: var(--dash); transition: border-color .15s ease, transform .18s var(--ease), background-color .15s ease; }
.sugg-btn .avatar { width: 20px; height: 20px; font-size: 9px; }
.sugg-btn:hover { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.sugg-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.scope-note { flex: 1; min-width: 180px; margin: 0; font-size: 12.5px; color: var(--muted); }
.scope-note strong { color: var(--text-2); }
.scope-note.edit strong { color: var(--amber-text); }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 24px; bottom: 24px; width: min(420px, calc(100vw - 32px)); display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; font-size: 13.5px; color: var(--text); background: var(--solid); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55); animation: toast-in .32s var(--spring); }
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.toast.ok::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.toast.error { border-color: var(--red); }
.toast.error::before { background: var(--red); box-shadow: 0 0 10px var(--red); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .btn { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.toast-x { width: 28px; height: 28px; font-size: 16px; }
.toast.out { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* ---------- dialogs: palette and shortcuts ---------- */
dialog { padding: 0; border: 1px solid var(--line-strong); color: var(--text); background: var(--solid); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .6); max-width: calc(100vw - 32px); }
dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog[open] { animation: dialog-in .24s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.palette { width: 580px; margin: 12vh auto auto; overflow: hidden; }
.pal-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: var(--dash); color: var(--muted); }
.pal-search .i { width: 18px; height: 18px; }
.pal-input { flex: 1; min-width: 0; height: 54px; border: 0; outline: none; font: 15px/1 var(--sans); color: var(--text); background: transparent; }
.pal-input::placeholder { color: var(--faint); }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 56vh); overflow-y: auto; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; cursor: pointer; font-size: 14px; transition: background-color .12s ease, transform .15s var(--ease); }
.pal-item .avatar { width: 24px; height: 24px; font-size: 10px; }
.pal-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; color: var(--muted); border: var(--dash); }
.pal-ico .i { width: 14px; height: 14px; }
.pal-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-hint { font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.pal-item.active { background: var(--blue-soft); transform: translateX(2px); }
.pal-item.active .pal-hint { color: var(--blue-text); }
.pal-empty { padding: 18px 12px; color: var(--muted); font-size: 13.5px; }
.pal-foot { display: flex; gap: 16px; margin: 0; padding: 9px 14px; border-top: var(--dash); font: 12px var(--mono); color: var(--faint); }
.pal-foot .kbd { margin-right: 3px; }
.help { width: 460px; margin: 10vh auto auto; padding: 18px 20px 16px; }
.help-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.help-head h2 { font: 650 16px/1.2 var(--sans); text-transform: none; letter-spacing: -.01em; color: var(--text); }
.help-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; align-items: center; }
.help-list dt { display: flex; gap: 4px; justify-content: flex-end; }
.help-list dd { margin: 0; font-size: 13.5px; color: var(--text-2); }
.help-foot { margin: 14px 0 0; padding-top: 12px; border-top: var(--dash); font-size: 12.5px; color: var(--muted); }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .chat-panel { position: relative; top: auto; }
  .chat-body { height: auto; min-height: 0; overflow: visible; }
  .jump-chat { display: inline-grid; }
  .messages { max-height: 65vh; }
  .composer { position: static; }
  .grip { display: none; }
  .layout-btn { display: none; }
}
@media (max-width: 640px) {
  .top-inner { padding: 0 16px; gap: 8px; height: 56px; }
  .brand-name, .me-name, .slash, .cmdk-text, .cmdk .kbd, .help-btn { display: none; }
  .cmdk, .icon-btn { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .cmdk { border-color: transparent; }
  .picker select { max-width: 30vw; padding: 7px 4px; }
  .me { padding-left: 0; }
  .person-head { flex-wrap: wrap; }
  .person-actions { flex-basis: 100%; margin: 2px 0 -6px 39px; }
  .person-actions .btn-ghost { opacity: 1 !important; }
  .pill { width: 28px; padding: 0; justify-content: center; }
  .pill-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .panel-head { flex-wrap: wrap; }
  .filter { order: 9; flex: 1 0 100%; margin: 6px 0 0; }
  .filter-input, .filter-input:focus { width: 100%; }
  .toasts { left: 16px; right: 16px; bottom: 16px; transform: none; width: auto; }
  .scope-note { order: 3; flex-basis: 100%; }
  .shell { padding: 14px 12px 32px; }
  .grid, .col { gap: 14px; }
  .panel-head { padding: 12px 12px 12px 8px; }
  .people { padding: 12px 12px 14px; grid-template-columns: minmax(0, 1fr); }
  .reqs { padding: 12px 12px 14px; grid-template-columns: minmax(0, 1fr); }
  .panel-sub { display: none; }
  .ask { margin: 12px; padding: 14px; }
  .ask-row { grid-template-columns: minmax(0, 1fr); }
  .ask-foot .btn { flex: 1; }
  .messages { padding: 12px; }
  .signin-card { padding: 28px 20px 22px; }
  .user-code { font-size: 22px; letter-spacing: .1em; }
  .demo-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:hover, .btn:active, .person:hover, .person:focus-within, .req.inbox:hover, .req.inbox:focus-within, button.chip:hover, .icon-btn:hover, .cmdk:hover { transform: none !important; }
  .gone { opacity: .5; }
  .flash { outline: 2px solid var(--glow); outline-offset: 2px; }
}
