/* Agent Room — quiet by default. One column, few colors, motion only to explain change. */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --sunken: #f3f3f1;
  --text: #1f2328;
  --text-2: #5d636b;
  --text-3: #959aa1;
  --line: #ebebe8;
  --line-2: #dcdcd8;
  --accent: #3b6cf6;
  --accent-soft: #edf2ff;
  --accent-text: #2a55d1;
  --warn: #b7791f;
  --warn-soft: #fdf6e9;
  --ok: #2f9e6b;
  --danger: #d1434b;
  --hover: rgba(31, 35, 40, 0.035);
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.04), 0 8px 28px rgba(20, 22, 26, 0.09);
  --shadow-lg: 0 2px 6px rgba(20, 22, 26, 0.05), 0 24px 64px rgba(20, 22, 26, 0.16);
  --r: 10px;
  --r-sm: 7px;
  --col: 720px;
  --sat: 52%;
  --lum: 60%;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1b1c1f;
    --sunken: #222327;
    --text: #e7e8ea;
    --text-2: #a4a8ae;
    --text-3: #6f747b;
    --line: #26272b;
    --line-2: #34353a;
    --accent: #7b9cff;
    --accent-soft: rgba(123, 156, 255, 0.13);
    --accent-text: #9db5ff;
    --warn: #e0a84e;
    --warn-soft: rgba(224, 168, 78, 0.12);
    --hover: rgba(255, 255, 255, 0.035);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 24px 64px rgba(0, 0, 0, 0.5);
    --sat: 38%;
    --lum: 52%;
  }
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg { display: block; }
svg .on-fill { stroke: var(--surface); }

/* ---------- primitives ---------- */
.btn {
  height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.btn.quiet { color: var(--text-2); }
.btn.quiet:hover { background: var(--hover); color: var(--text); }
.btn.line { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.btn.line:hover { background: var(--hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  display: inline-grid; place-items: center; color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.field {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field::placeholder { color: var(--text-3); }
.label { font-size: 12.5px; color: var(--text-2); margin: 0 0 6px; display: block; }
.muted { color: var(--text-3); }
.kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--sunken); color: var(--text-2); }

/* ---------- avatars ---------- */
.av {
  --h: 220;
  flex: none; display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: hsl(var(--h) var(--sat) var(--lum));
  color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0;
  user-select: none; position: relative;
}
.av.agent {
  border-radius: 8px;
  background: hsl(var(--h) calc(var(--sat) - 10%) calc(var(--lum) + 24%));
  color: hsl(var(--h) 45% 28%);
}
@media (prefers-color-scheme: dark) {
  .av.agent { background: hsl(var(--h) 22% 26%); color: hsl(var(--h) 60% 80%); }
}
.av.sm { width: 22px; height: 22px; font-size: 10.5px; }
.av.sm.agent { border-radius: 6px; }
.av.xs { width: 18px; height: 18px; font-size: 9.5px; }
.av.xs.agent { border-radius: 5px; }
.av.lg { width: 44px; height: 44px; font-size: 17px; }
.av.lg.agent { border-radius: 13px; }
.av.off { filter: grayscale(1); opacity: 0.42; }
.pres { position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); }
.pres.on { background: var(--ok); }
.pres.idle { background: var(--warn); }
.av.lg .pres { width: 11px; height: 11px; right: -1px; bottom: -1px; }
.pop .pres, .mentions .pres { box-shadow: 0 0 0 2px var(--surface); }

/* ---------- toast & overlays ---------- */
#toast {
  position: fixed; left: 50%; bottom: 112px; z-index: 60;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg);
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 17, 20, 0.28);
  display: grid; place-items: center; padding: 20px;
  animation: fade 0.18s ease-out;
}
.modal {
  width: min(440px, 100%); background: var(--surface);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 22px 22px 18px;
  animation: rise 0.22s var(--ease);
}
.modal h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.modal .sub { margin: 0 0 18px; color: var(--text-2); font-size: 13px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.pop {
  position: fixed; z-index: 50; width: 300px; max-height: calc(100vh - 24px); overflow-y: auto;
  background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  padding: 16px; animation: pop 0.16s var(--ease);
  transform-origin: top center;
}
.menu { width: 210px; padding: 6px; }
.menu button {
  width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px;
  font-size: 13.5px; display: flex; align-items: center; gap: 9px; color: var(--text);
}
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
@keyframes flash { 0%, 100% { background: transparent; } 20% { background: var(--accent-soft); } }
@keyframes breathe { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- landing ---------- */
.landing { min-height: 100%; display: grid; place-items: center; padding: 48px 20px; }
.landing-inner { width: min(380px, 100%); }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand img { width: 26px; height: 26px; }
.landing h1 { font-size: 26px; line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 650; }
.landing p.lead { color: var(--text-2); margin: 0 0 30px; font-size: 14px; }
.stack { display: grid; gap: 12px; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 26px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.recent { margin-top: 30px; }
.recent a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; margin: 0 -12px; border-radius: var(--r-sm);
  color: var(--text); font-size: 14px;
}
.recent a:hover { background: var(--hover); text-decoration: none; }
.recent a span { color: var(--text-3); font-size: 12.5px; }
.join-members { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; margin: -16px 0 26px; }
.join-members .avs { display: flex; }
.join-members .avs .av { box-shadow: 0 0 0 2px var(--bg); margin-right: -6px; }
.codeblock {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--sunken); border-radius: var(--r-sm);
  padding: 10px 10px 10px 12px; font: 12.5px/1.55 var(--mono); color: var(--text);
  word-break: break-all;
}
.codeblock code { flex: 1; white-space: pre-wrap; }
.codeblock .icon-btn { width: 26px; height: 26px; margin: -3px -3px 0 0; }

/* ---------- room layout ---------- */
.room { height: 100%; display: flex; flex-direction: column; }
.top {
  flex: none; height: 54px; padding: 0 14px 0 18px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  position: relative; z-index: 10;
}
.top .title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.top .title a.home { display: grid; place-items: center; }
.top .title a.home img { width: 20px; height: 20px; }
.top .title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); animation: breathe 1.4s infinite; flex: none; }
.top .spacer { flex: 1; }

.people { display: flex; align-items: center; gap: 4px; }
.person { display: flex; align-items: flex-end; padding: 3px; border-radius: 999px; transition: background 0.15s; }
.person:hover { background: var(--hover); }
.person .av { box-shadow: 0 0 0 2px var(--bg); }
.person .av.agent { margin-left: -6px; transform: translateY(3px); }
.person .av.agent + .av.agent { margin-left: -3px; }
.person .av.me { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--line-2); }
.add-agent {
  width: 26px; height: 26px; border-radius: 8px; margin-left: 2px;
  display: grid; place-items: center; color: var(--text-3);
  border: 1px dashed var(--line-2);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.add-agent:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tasks-btn {
  height: 30px; padding: 0 8px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.tasks-btn:hover { background: var(--hover); color: var(--text); }
.tasks-btn b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.scroll { flex: 1; overflow-y: auto; overflow-anchor: none; position: relative; scroll-behavior: auto; }
.timeline { max-width: var(--col); margin: 0 auto; padding: 24px 20px 28px; }
.history-top { display: flex; justify-content: center; align-items: center; gap: 7px; color: var(--text-3); font-size: 12px; min-height: 24px; padding: 0 0 18px; }
.history-top.origin img { width: 16px; height: 16px; opacity: 0.7; }

/* ---------- rows ---------- */
.row { position: relative; display: flex; gap: 12px; padding: 6px 10px 2px; margin: 0 -10px; border-radius: var(--r); }
.row.first { margin-top: 12px; }
.sys + .row.first, .day + .row.first { margin-top: 6px; }
.row.cont { padding-top: 1px; }
.row.new { animation: appear 0.26s var(--ease); }
.row.flash { animation: flash 1.6s ease-out; }
.row:hover { background: var(--hover); }
.row .gutter { width: 28px; flex: none; display: flex; justify-content: center; }
.row.cont .gutter .t { opacity: 0; font-size: 10.5px; color: var(--text-3); line-height: 24px; font-variant-numeric: tabular-nums; }
.row.cont:hover .gutter .t { opacity: 1; }
.row .main { min-width: 0; flex: 1; }
.meta { display: flex; align-items: baseline; gap: 6px; line-height: 20px; margin-bottom: 1px; }
.meta .who { font-weight: 600; font-size: 14px; cursor: pointer; }
.meta .who:hover { text-decoration: underline; text-underline-offset: 2px; }
.meta .owner { color: var(--text-3); font-size: 12.5px; }
.meta .time { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.row.agent .meta .who { color: var(--text-2); font-weight: 560; }
.body { overflow-wrap: anywhere; }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body p { margin: 0 0 6px; }
.body ul, .body ol { margin: 2px 0 6px; padding-left: 20px; }
.body li { margin: 1px 0; }
.body li::marker { color: var(--text-3); }
.body li.todo { list-style: none; margin-left: -20px; display: flex; gap: 6px; align-items: flex-start; }
.body li.todo .ticon { margin-top: 3px; }
.body .hd { font-weight: 650; margin: 8px 0 3px; letter-spacing: -0.005em; }
.body .hd.h1 { font-size: 1.12em; }
.body blockquote { margin: 4px 0 6px; padding: 1px 0 1px 11px; border-left: 2.5px solid var(--line-2); color: var(--text-2); }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.body .tbl { overflow-x: auto; margin: 4px 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.body table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.body th, .body td { padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.body th { background: var(--sunken); font-weight: 600; color: var(--text-2); font-size: 12.5px; }
.body tr:last-child td { border-bottom: 0; }
.body .path { font: 0.88em var(--mono); color: var(--text-2); background: var(--sunken); padding: 1.5px 5px; border-radius: 5px; }
.pre { position: relative; margin: 6px 0; }
.pre .cp { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; opacity: 0; background: var(--surface); }
.pre:hover .cp { opacity: 1; }
.row.agent .body { color: color-mix(in srgb, var(--text) 90%, var(--text-2)); }
.body code { font: 0.88em var(--mono); background: var(--sunken); padding: 1.5px 5px; border-radius: 5px; }
.body pre, .pre pre {
  font: 12.5px/1.6 var(--mono); background: var(--sunken); border-radius: var(--r-sm);
  padding: 10px 12px; margin: 6px 0; overflow-x: auto; white-space: pre;
}
.body pre code { background: none; padding: 0; font-size: inherit; }
.mention { color: var(--accent-text); background: var(--accent-soft); border-radius: 5px; padding: 0 3px; font-weight: 500; cursor: pointer; }
.mention.me { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }

.quote {
  display: flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: 12.5px; color: var(--text-3); margin: 1px 0 3px; cursor: pointer;
}
.quote::before { content: ""; width: 14px; height: 9px; border: 1.5px solid var(--line-2); border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; margin-top: 7px; flex: none; }
.quote b { color: var(--text-2); font-weight: 500; flex: none; }
.quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote:hover span { color: var(--text-2); }

.states { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.rc {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px 0 2px;
  border-radius: 999px; font-size: 11.5px; color: var(--text-2);
  background: var(--sunken);
}
.rc .av { box-shadow: none; }
.rc-n { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc .rc-g { color: var(--text-3); }
.rc.got .rc-g { color: var(--ok); }
.rc.pend { background: var(--warn-soft); }
.rc.pend .rc-g { color: var(--warn); }
.rc.work { background: var(--accent-soft); color: var(--accent-text); }
.rc.work .rc-g { color: var(--accent); }
.rc.stall { background: var(--warn-soft); color: var(--text-2); }
.rc.stall .rc-g { color: var(--warn); }
.rc-x { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); margin-right: -3px; }
.rc-x:hover { background: var(--hover); color: var(--text); }
.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.actions {
  position: absolute; right: 8px; top: -14px; display: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: 2px;
}
.row:hover .actions { display: flex; }
.actions button { height: 26px; padding: 0 8px; border-radius: 6px; font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.actions button:hover { background: var(--hover); color: var(--text); }

/* handoff */
.handoff { margin-top: 2px; }
.handoff-head {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  font-size: 14px; cursor: pointer; padding: 1px 0;
}
.handoff-head .kind { font-size: 12px; font-weight: 600; color: var(--accent-text); display: inline-flex; align-items: center; gap: 4px; flex: none; }
.handoff-head .chev { color: var(--text-3); transition: transform 0.18s var(--ease); flex: none; }
.handoff.open .handoff-head .chev { transform: rotate(90deg); }
.handoff-head .summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.handoff-head .kind .av { margin-left: 2px; }
.handoff-head .kind span:last-child { color: var(--text-2); font-weight: 560; }
.handoff-body {
  display: none; margin: 6px 0 2px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--sunken); font-size: 13.5px;
}
.handoff.open .handoff-body { display: grid; gap: 7px; animation: appear 0.2s var(--ease); }
.hb-row { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; }
.hb-i { color: var(--text-3); padding-top: 3px; }
.hb-row .links { display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* ask */
.ask-q { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.ask-q .body { flex-basis: 100%; }
.qb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; margin-top: 2px; flex: none; }
.ask-who { font-size: 12px; color: var(--text-2); font-weight: 560; line-height: 20px; }
.answer { margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; padding: 5px 8px; background: var(--sunken); border-radius: var(--r-sm); }
.answer .arr { color: var(--text-3); transform: scaleX(-1) rotate(180deg); margin-top: 3px; }
.answer .av { margin-top: 1px; }
.answer.waiting { background: none; padding: 0; color: var(--text-3); align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip {
  height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text);
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.chip:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.chip.solid { background: var(--text); color: var(--bg); box-shadow: none; }
.chip.solid:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); color: var(--bg); }
.chip.ic { width: 28px; padding: 0; display: grid; place-items: center; color: var(--text-2); }

/* system lines */
.sys {
  display: flex; align-items: center; gap: 8px; padding: 3px 10px; margin: 2px -10px;
  font-size: 12.5px; line-height: 20px; color: var(--text-3); border-radius: var(--r-sm);
}
.sys .g { width: 28px; display: flex; justify-content: center; flex: none; }
.sys b { color: var(--text-2); font-weight: 500; }
.sys .t { margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0; }
.sys:hover .t { opacity: 1; }
.sys.task { cursor: pointer; }
.sys.task:hover { background: var(--hover); }
.sys .names { color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sys .muted { display: inline-flex; align-items: center; gap: 3px; }
.sys .ttl { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sys .note { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.sys .note::before { content: "·"; margin-right: 6px; }
.ticon.gold { color: #d4a017; }
.stack { display: inline-flex; flex: none; }
.stack .av { box-shadow: 0 0 0 1.5px var(--bg); }
.stack .av + .av { margin-left: -5px; }
.bolt { color: #e0a100; display: inline-grid; vertical-align: -1px; margin-left: 3px; }
.ticon { color: var(--text-3); }
.ticon.doing { color: var(--accent); }
.ticon.done { color: var(--ok); }
.ticon.stuck { color: var(--warn); }

.day { display: flex; align-items: center; gap: 12px; margin: 26px 0 8px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.day::before, .day::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.unread-line { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; font-size: 11.5px; color: var(--danger); font-weight: 500; }
.unread-line::after { content: ""; flex: 1; border-top: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }

.fold {
  display: flex; align-items: center; gap: 8px; width: calc(100% + 20px);
  padding: 6px 10px; margin: 4px -10px; border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--text-3); text-align: left;
  transition: background 0.15s, color 0.15s;
}
.fold:hover { background: var(--hover); color: var(--text-2); }
.fold .g { width: 28px; display: flex; justify-content: center; flex: none; }
.fold .cnt { font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--sunken); border-radius: 999px; padding: 0 7px; line-height: 18px; font-variant-numeric: tabular-nums; }
.fold .at-me { color: var(--warn); display: inline-grid; }
.fold .line { flex: 1; border-top: 1px dashed var(--line-2); }

.empty { display: flex; gap: 12px; justify-content: center; padding: 72px 20px 40px; }
.tile {
  width: 108px; height: 92px; border-radius: 14px; display: grid; place-items: center; align-content: center; gap: 8px;
  color: var(--text-2); font-size: 13px; border: 1px dashed var(--line-2);
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.12s;
}
.tile:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.tile:active { transform: scale(0.98); }

.jump {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 999px; height: 32px; padding: 0 14px;
  font-size: 12.5px; display: flex; align-items: center; gap: 6px;
  animation: appear 0.2s var(--ease);
}
.jump:hover { color: var(--accent-text); }
.jump .x { color: var(--text-3); margin-left: 2px; }
.scroll-wrap { flex: 1; position: relative; min-height: 0; display: flex; flex-direction: column; }

/* ---------- files ---------- */
.file, .fcard { margin-top: 4px; }
.fimg { display: block; border-radius: 10px; overflow: hidden; background: var(--sunken); max-width: min(360px, 100%); min-width: 80px; min-height: 60px; }
.fimg img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; }
.fimg.broken { width: 120px; height: 80px; }
.fcard {
  width: min(380px, 100%); border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  overflow: hidden; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.fcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.fhead { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 10px; }
.fico { position: relative; width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.fico .ext { position: absolute; bottom: -3px; right: -5px; font: 600 8.5px/1 var(--font); letter-spacing: 0.02em; padding: 2px 3px; border-radius: 4px; background: var(--surface); color: var(--text-2); box-shadow: 0 0 0 1px var(--line-2); }
.fmeta { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.fname { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fpeek { position: relative; max-height: 96px; overflow: hidden; padding: 8px 12px 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.fpeek::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32px; background: linear-gradient(to top, var(--surface), transparent); }
.fpeek pre { margin: 0; font: 11.5px/1.55 var(--mono); white-space: pre-wrap; }
.fpeek .body { font-size: 12.5px; }
.modal.viewer { width: min(860px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 0; }
.vhead { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.vhead .fico { width: 26px; height: 26px; }
.vhead .fname { min-width: 0; }
.vbody { overflow: auto; padding: 18px 22px; min-height: 120px; }
.vbody img { display: block; max-width: 100%; margin: 0 auto; border-radius: 8px; }
.vtext { margin: 0; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.body.doc { font-size: 14.5px; line-height: 1.7; }
.vload { display: grid; place-items: center; min-height: 120px; color: var(--text-3); }
.grow { flex: 1; }

/* ---------- dock ---------- */
.dock { flex: none; padding: 0 20px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); position: relative; }
.dock-inner { max-width: var(--col); margin: 0 auto; position: relative; }
.dock-inner::before {
  content: ""; position: absolute; left: -20px; right: -20px; bottom: 100%; height: 24px;
  background: linear-gradient(to top, var(--bg), transparent); pointer-events: none;
}
.activity { height: 22px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); padding-left: 2px; }
.activity .dots { display: inline-flex; gap: 3px; }
.activity .dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: breathe 1.2s infinite; }
.activity .dots i:nth-child(2) { animation-delay: 0.15s; }
.activity .dots i:nth-child(3) { animation-delay: 0.3s; }
.activity .who { color: var(--text-2); font-weight: 500; }
.act { display: inline-flex; align-items: center; gap: 5px; }
.pins { display: grid; gap: 6px; margin-bottom: 8px; }
.pin {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); animation: rise 0.24s var(--ease);
}
.pin .q { flex: 1; min-width: 0; font-size: 13.5px; }
.pin-face { position: relative; flex: none; }
.pin-b { position: absolute; right: -4px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.pin-b.claim { background: var(--warn); }
.pin .q .text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin .chips { margin: 0; flex-wrap: nowrap; }
.composer {
  position: relative;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20, 22, 26, 0.03);
  transition: border-color 0.15s, box-shadow 0.2s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); box-shadow: 0 0 0 4px var(--accent-soft); }
.replying {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 0 14px;
  font-size: 12.5px; color: var(--text-3);
}
.replying b { color: var(--text-2); font-weight: 500; flex: none; }
.replying span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.replying .icon-btn { width: 22px; height: 22px; }
.compose-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px 6px 6px; }
.attach { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; color: var(--text-3); transition: background 0.15s, color 0.15s; }
.attach:hover { background: var(--hover); color: var(--text); }
.tray { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 8px 0; }
.tray:empty { display: none; }
.chip-f {
  position: relative; display: flex; align-items: center; gap: 8px; height: 44px; max-width: 230px; padding: 0 8px 0 6px;
  border-radius: 10px; background: var(--sunken); animation: rise 0.18s var(--ease);
}
.chip-f .th { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; }
.chip-f .fico { width: 32px; height: 32px; }
.cf-meta { display: grid; min-width: 0; line-height: 1.3; }
.cf-n { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-s { font-size: 11px; color: var(--text-3); }
.ring { --p: 0; width: 16px; height: 16px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line-2) 0); -webkit-mask: radial-gradient(circle, transparent 4.5px, #000 5px); mask: radial-gradient(circle, transparent 4.5px, #000 5px); }
.chip-f.ok .ring { background: var(--ok); -webkit-mask: none; mask: none; width: 7px; height: 7px; }
.chip-f.err { background: color-mix(in srgb, var(--danger) 10%, var(--sunken)); }
.chip-f.err .ring { background: var(--danger); -webkit-mask: none; mask: none; width: 7px; height: 7px; }
.chip-f.sending { opacity: 0.55; }
.cf-x { width: 20px; height: 20px; flex: none; }
.dropzone { display: none; position: fixed; inset: 0; z-index: 35; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(2px); padding: 18px; }
.room.dragging .dropzone { display: block; animation: fade 0.12s; }
.dz { height: 100%; border: 2px dashed var(--accent); border-radius: 18px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--accent-text); font-size: 14px; font-weight: 500; pointer-events: none; }
.compose-row textarea {
  flex: 1; border: 0; outline: none; resize: none; background: none;
  padding: 6px 0; max-height: 200px; line-height: 1.55; min-height: 34px;
}
.compose-row textarea::placeholder { color: var(--text-3); }
.send {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--sunken); color: var(--text-3);
  transition: background 0.15s, color 0.15s, transform 0.08s;
}
.send.ready { background: var(--text); color: var(--bg); }
.send:active { transform: scale(0.96); }

.mentions {
  position: absolute; left: 0; bottom: calc(100% + 6px); width: 260px; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 5px; z-index: 20; animation: pop 0.14s var(--ease); transform-origin: bottom left;
}
.mentions button { width: 100%; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; font-size: 13.5px; text-align: left; }
.mentions button.on { background: var(--hover); }
.mentions button .sub { color: var(--text-3); font-size: 12px; margin-left: auto; }
.mentions button.indent { padding-left: 22px; }

/* ---------- member popover ---------- */
.card-head { display: flex; align-items: center; gap: 12px; }
.card-head .n { font-weight: 600; font-size: 15px; line-height: 1.3; }
.card-head .s { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.card-head .s .live { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.card-head .s .av { margin-right: 1px; }
.face { position: relative; flex: none; }
.crown { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); color: #d4a017; display: grid; place-items: center; box-shadow: 0 0 0 1px var(--line); }
.you { font-size: 11px; font-weight: 500; color: var(--text-3); background: var(--sunken); padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.tagx { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--text-2); background: var(--sunken); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.tagx svg { color: #e0a100; }
.card-head .state { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.card-head .state .d { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.card-head .state.on { color: var(--text-2); }
.card-head .state.on .d { background: var(--ok); }
.card-head .state.idle .d { background: var(--warn); }
.card-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-sec .cap { font-size: 11.5px; color: var(--text-3); margin-bottom: 10px; }
.setting { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; }
.setting:last-child { margin-bottom: 0; }
.setting .k { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.traits { display: grid; gap: 7px; }
.trait { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.trait svg { color: var(--text-3); }
.icon-btn.danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.confirm-face { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.seg { display: flex; background: var(--sunken); border-radius: 8px; padding: 2px; }
.seg button {
  flex: 1; height: 26px; border-radius: 6px; font-size: 12.5px; color: var(--text-2);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 0.5px var(--line-2); font-weight: 500; }
.fine { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin: 4px 0 0; }
.card-foot { display: flex; gap: 6px; margin-top: 14px; }
.facts { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.agents-of { display: grid; gap: 2px; }
.agents-of button { display: flex; align-items: center; gap: 8px; padding: 5px 6px; margin: 0 -6px; border-radius: 6px; font-size: 13px; text-align: left; }
.agents-of button:hover { background: var(--hover); }
.agents-of .sub { color: var(--text-3); font-size: 12px; margin-left: auto; }

/* ---------- add agent ---------- */
.clients { display: flex; flex-wrap: wrap; gap: 6px; }
.clients button {
  height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2);
  transition: all 0.15s;
}
.clients button:hover { color: var(--text); }
.clients button.on { background: var(--text); color: var(--bg); box-shadow: none; }
.modal.add { width: min(460px, 100%); }
.modal.add h3 { margin-bottom: 14px; }
.choices { display: grid; gap: 8px; }
.choice {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px; align-items: center;
  text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.choice:hover { border-color: var(--line-2); }
.choice.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice .ci { grid-row: span 2; }
.ci { width: 34px; height: 34px; border-radius: 10px; background: var(--sunken); color: var(--text-2); display: grid; place-items: center; }
.choice.on .ci { background: var(--accent-soft); color: var(--accent-text); }
.ct { font-size: 14px; font-weight: 600; }
.cs { font-size: 12.5px; color: var(--text-3); }
.choice .clients { grid-column: 2; }
.choice:not(.on) .clients { opacity: 0.45; pointer-events: none; }
.clients button { height: 26px; padding: 0 10px; font-size: 12.5px; }
.fine.err { color: var(--danger); min-height: 16px; }
.add-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.add-head h3 { margin: 0; }
.add-head .ci { background: var(--accent-soft); color: var(--accent-text); }
.setup-t { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.setup-t svg { transition: transform 0.18s var(--ease); }
.setup-t:hover { color: var(--text-2); }
.show-setup .setup-t svg { transform: rotate(90deg); }
.setup { display: none; margin-top: 6px; }
.show-setup .setup { display: block; animation: appear 0.18s var(--ease); }
.waiting-join { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--text-3); font-size: 12px; }
.waiting-join .ghost { width: 28px; height: 28px; border-radius: 8px; background: var(--sunken); display: grid; place-items: center; animation: breathe 1.6s infinite; }
.waiting-join .dots { display: inline-flex; gap: 3px; flex: 1; }
.waiting-join .dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: breathe 1.2s infinite; }
.waiting-join .dots i:nth-child(2) { animation-delay: 0.15s; }
.waiting-join .dots i:nth-child(3) { animation-delay: 0.3s; }
.timer { font-variant-numeric: tabular-nums; }
.joined-ok { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 9%, transparent); font-size: 13.5px; animation: rise 0.25s var(--ease); }
.joined-ok b { flex: 1; font-weight: 600; }
.joined-ok .ok { color: var(--ok); }

/* ---------- tasks drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(15, 17, 20, 0.12); animation: fade 0.2s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(380px, 100%);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide 0.26s var(--ease);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { height: 54px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.drawer-add { padding: 14px 16px 6px; }
.drawer-add .field { height: 36px; background: var(--sunken); border-color: transparent; }
.drawer-add .field:focus { background: var(--surface); }
.drawer-list { flex: 1; overflow-y: auto; padding: 6px 8px 20px; }
.group-cap { font-size: 11.5px; color: var(--text-3); padding: 14px 10px 6px; display: flex; gap: 6px; font-weight: 500; }
.group-cap button { color: var(--text-3); font-size: 11.5px; display: flex; align-items: center; gap: 4px; }
.task {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  transition: background 0.15s;
}
.task:hover { background: var(--hover); }
.task.hl { animation: flash 1.6s ease-out; }
.task .check { margin-top: 2px; flex: none; color: var(--text-3); border-radius: 50%; }
.task .check:hover { color: var(--ok); }
.task .tb { flex: 1; min-width: 0; }
.task .tt { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.task.done .tt { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.task .tm { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.tmf { display: inline-flex; align-items: center; gap: 5px; }
.tmf.dim .av { opacity: 0.6; }
.task .tm .st-pending { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); }
.task .tm .st-pending .tmf { color: var(--text-3); }
.task .ta { display: none; gap: 2px; flex: none; }
.task:hover .ta { display: flex; }
.drawer-empty { display: grid; place-items: center; color: var(--line-2); padding: 64px 20px; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .top { padding: 0 8px 0 12px; gap: 8px; }
  .people .person:nth-child(n + 5) { display: none; }
  .person .av.agent { display: none; }
  .pin { flex-wrap: wrap; }
  .pin .q { flex-basis: calc(100% - 40px); }
  .pin .chips { flex-wrap: wrap; margin-left: 32px; }
  .tasks-btn span.l { display: none; }
  .timeline { padding: 16px 14px 24px; }
  .dock { padding: 0 10px 10px; }
  .actions { top: -10px; }
  .pop { width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- assistants: glowing orbs with capsule eyes ---------- */
/* Light, not a ball: a bright core that fades out, a wide soft halo, no edge, no highlight. */
.orb {
  --s: 28px;
  position: relative; display: inline-block; flex: none; isolation: isolate;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 82%, #fff) 0%, var(--c) 30%, color-mix(in srgb, var(--c) 55%, transparent) 52%, transparent 71%);
  transition: filter 0.3s, opacity 0.3s;
}
.orb::before {
  content: ""; position: absolute; inset: -42%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 42%, transparent) 0%, color-mix(in srgb, var(--c) 14%, transparent) 42%, transparent 68%);
  filter: blur(calc(var(--s) * 0.08));
  animation: halo 5s ease-in-out infinite var(--blink, 0s);
}
.orb i {
  position: absolute; top: 37%; width: 12%; height: 24%; border-radius: 999px;
  background: rgba(10, 11, 14, 0.82); transform-origin: 50% 60%;
  animation: blink 6.5s infinite var(--blink, 0s);
  transition: top 0.3s var(--ease), height 0.3s var(--ease);
}
.orb i:first-child { left: 32%; }
.orb i:last-child { right: 32%; }
.orb.xs { --s: 16px; }
.orb.xs::before, .orb.sm::before { inset: -26%; }
.orb.sm { --s: 22px; }
.orb.md { --s: 32px; }
.orb.lg { --s: 46px; }
.orb.xl { --s: 96px; }
.orb.think i { top: 28%; }
.orb.sleep i { height: 6%; top: 47%; animation: none; }
.orb.sleep::before { animation: none; opacity: 0.5; }
.orb.dim { filter: saturate(0.5) brightness(0.85); }
.orb.off { filter: grayscale(1); opacity: 0.4; }
.orb.off i { height: 6%; top: 47%; animation: none; }
.orb.off::before { display: none; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.12); } }
@keyframes halo { 50% { opacity: 0.7; transform: scale(0.94); } }
@media (prefers-reduced-motion: reduce) { .orb i, .orb::before { animation: none; } }

/* one light per job: running glows, input is amber, queued/approval are hollow */
.jobs { display: inline-flex; gap: 2px; align-items: center; }
.jobs i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.jobs i.running { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: glow 1.8s ease-out infinite; }
.jobs i.input { background: var(--warn); }
.jobs i.queued, .jobs i.approval { background: transparent; box-shadow: inset 0 0 0 1.2px var(--text-3); }
@keyframes glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 4px transparent; } }

/* ---------- top bar ---------- */
.person { display: flex; align-items: flex-end; padding: 3px; border-radius: 999px; }
.person:hover { background: var(--hover); }
.pface { display: grid; border-radius: 50%; }
.pagent { position: relative; display: grid; margin-left: -6px; transform: translateY(3px); border-radius: 50%; }
.pagent + .pagent { margin-left: -2px; }
.pagent .av { box-shadow: 0 0 0 2px var(--bg); }
.pagent .jobs { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); }
.pagent .jobs i { width: 4px; height: 4px; }
.mcode {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font: 500 12px/1 var(--mono); letter-spacing: 0.04em; color: var(--text-2); background: var(--sunken);
  transition: background 0.15s, color 0.15s;
}
button.mcode:hover { color: var(--text); background: color-mix(in srgb, var(--sunken) 70%, var(--line-2)); }
.mcode.static { height: 26px; font-size: 13.5px; }

/* ---------- + panel and assistant panels ---------- */
.modal.plus, .modal.assistants, .modal.auth { width: min(460px, 100%); }
.tabs { display: flex; gap: 2px; margin: -4px 0 18px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 8px 12px 10px; font-size: 13.5px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); font-weight: 560; border-color: var(--text); }
.plus-body { display: grid; gap: 12px; min-height: 120px; }
.bigcode { text-align: center; font: 600 30px/1.2 var(--mono); letter-spacing: 0.08em; padding: 14px 0 6px; cursor: pointer; border-radius: var(--r); }
.bigcode:hover { background: var(--hover); }
.center { text-align: center; }
.loading { display: grid; place-items: center; min-height: 80px; color: var(--text-3); }
.alist { display: grid; gap: 4px; }
.arow { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r); }
.arow:hover { background: var(--hover); }
.arow .an { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.arow .an b { font-weight: 560; }
.arow .an span { font-size: 12px; color: var(--text-3); }
.arow .in { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ok); }
.newa { border-top: 1px dashed var(--line-2); padding-top: 10px; }
.newa-t { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); padding: 4px 6px; border-radius: 6px; }
.newa-t:hover { color: var(--text); background: var(--hover); }
.newa-b { display: none; gap: 12px; margin-top: 10px; }
.newa.open .newa-t { display: none; }
.newa.open .newa-b { display: grid; }
.newa-r { display: flex; align-items: center; gap: 12px; }
.newa .row { margin-top: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 80%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 40%, transparent) 72%); transition: transform 0.12s; position: relative; }
.sw:hover { transform: scale(1.12); }
.sw.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.sw.custom { background: conic-gradient(#ff8a65, #f5c542, #4cc38a, #38bdf8, #7c9cff, #c084fc, #f472b6, #ff8a65); overflow: hidden; cursor: pointer; }
.sw.custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.achips { display: flex; flex-wrap: wrap; gap: 6px; }
.achips button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 6px; border-radius: 999px; font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); }
.achips button.on { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.seg.wide button { flex: 1; }
.connect-area { display: grid; gap: 10px; }
.connect-area .seg { justify-self: start; }
.fine.err { color: var(--danger); min-height: 0; }
.fine.err:empty { display: none; }
.mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mhead h3 { margin: 0; }
.amanage { display: grid; gap: 14px; max-height: min(70vh, 640px); overflow: auto; margin: 0 -6px; padding: 0 6px; }
.acard2 { display: grid; gap: 12px; padding: 14px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.ac-head { display: flex; gap: 14px; align-items: center; }
.ac-n { flex: 1; display: grid; gap: 8px; }
.field.inline { height: 32px; font-weight: 560; }
.field.memo { height: auto; min-height: 56px; padding: 8px 10px; resize: vertical; font-size: 13px; line-height: 1.5; }
.ac-sec { display: grid; gap: 6px; }
.ac-sec .k { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.conns { display: grid; gap: 2px; }
.cn { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.cn .d { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.cn .d.on { background: var(--ok); }
.cn .cl { flex: 1; }
.cn .ck { font-size: 11.5px; color: var(--text-3); }
.cbox:empty { display: none; }
.cbox { padding-top: 4px; display: grid; gap: 10px; }
.acard2 .row { margin-top: 0; justify-content: flex-start; align-items: center; }
.acard2 .row .grow { flex: 1; }
.pop.acard { width: 300px; }
.joblist { display: grid; gap: 6px; }
.job { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.job .jt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .js { font-size: 12px; color: var(--text-3); }
.job .icon-btn { width: 22px; height: 22px; color: var(--text-3); }
.jd { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.jd.running { animation: glow 1.8s ease-out infinite; }
.jd.input { background: var(--warn); }
.jd.queued, .jd.approval { background: transparent; box-shadow: inset 0 0 0 1.4px var(--text-3); }
.waiting-join .orb { margin-right: 4px; }
.joined-ok .orb { margin-right: 2px; }

/* ---------- home: always dark, few words, the glow does the talking ---------- */
.home {
  --bg: #07080b; --surface: #0e1015; --sunken: #13151b; --text: #eef0f3; --text-2: #a3a9b3; --text-3: #6c727c;
  --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.13); --hover: rgba(255, 255, 255, 0.05);
  --accent: #8aa6ff; --accent-soft: rgba(138, 166, 255, 0.14);
  color-scheme: dark; color: var(--text); background: var(--bg);
  min-height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.home::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 8%, rgba(124, 156, 255, 0.16), transparent 70%),
    radial-gradient(30% 25% at 18% 30%, rgba(255, 138, 101, 0.07), transparent 70%),
    radial-gradient(30% 25% at 82% 34%, rgba(76, 195, 138, 0.07), transparent 70%);
}
.home::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 55% at 50% 20%, #000, transparent 75%);
}
.home > * { position: relative; z-index: 1; }
.htop { display: flex; align-items: center; padding: 22px clamp(20px, 5vw, 56px); }
.htop .brand { margin: 0; }
.htop .spacer { flex: 1; }
.hlink { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); padding: 6px 10px; border-radius: 8px; transition: color 0.15s, background 0.15s; }
.hlink:hover { color: var(--text); background: var(--hover); }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(28px, 7vh, 80px) 20px 24px; position: relative; }
.hero-orbs { position: relative; width: 300px; height: 150px; margin-bottom: 18px; }
.hero-orbs .orb { position: absolute; animation: float 7s ease-in-out infinite; }
.hero-orbs .o0 { left: 100px; top: 8px; --s: 104px; }
.hero-orbs .o1 { left: 28px; top: 58px; --s: 58px; animation-delay: -2.4s; }
.hero-orbs .o2 { left: 216px; top: 52px; --s: 62px; animation-delay: -4.6s; }
@keyframes float { 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .hero-orbs .orb { animation: none; } }
.hero h1 { font-size: clamp(38px, 6.4vw, 76px); line-height: 1.08; letter-spacing: -0.04em; font-weight: 720; margin: 0 0 18px; }
.hero h1 .glow { background: linear-gradient(100deg, #ffb59a 0%, #a9bcff 45%, #8fe3bd 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(15px, 1.6vw, 18px); color: var(--text-2); margin: 0 0 34px; }
.startbar {
  display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--line), 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}
.startbar .field { height: 44px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border-color: transparent; }
.startbar .field:focus { border-color: var(--accent); }
.field.namein { width: 150px; }
.field.codein { width: 150px; font: 500 16px/1 var(--mono); letter-spacing: 0.08em; text-align: center; }
.field.need { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.startbar .sep { width: 1px; height: 26px; background: var(--line-2); margin: 0 4px; }
.cta { height: 44px; padding: 0 22px; border-radius: 10px; font-size: 15px; font-weight: 600; color: #0a0b0e; background: linear-gradient(180deg, #ffffff, #d9dde6); box-shadow: 0 0 0 1px rgba(255,255,255,0.4) inset, 0 6px 24px rgba(138, 166, 255, 0.25); transition: transform 0.1s, box-shadow 0.2s; }
.cta:hover { box-shadow: 0 0 0 1px rgba(255,255,255,0.5) inset, 0 8px 34px rgba(138, 166, 255, 0.4); }
.cta:active { transform: translateY(1px); }
.cta.ghost { color: var(--text); background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--line-2); }
.cta.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.cta[disabled] { opacity: 0.5; pointer-events: none; }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hero-bring:empty { display: none; }
.hero-bring { margin-top: 14px; }
.bring { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tog { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 8px; border-radius: 999px; font-size: 13px; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); transition: color 0.15s, box-shadow 0.15s, background 0.15s; }
.tog .orb { filter: grayscale(1); opacity: 0.45; transition: filter 0.2s, opacity 0.2s; }
.tog.on { color: var(--text); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-2); }
.tog.on .orb { filter: none; opacity: 1; }
.hero .fine.err { margin-top: 10px; }
.myrooms:empty { display: none; }
.myrooms { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; max-width: 760px; }
.rchip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); transition: color 0.15s, box-shadow 0.15s; }
.rchip:hover { color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.rchip .rt { font-size: 11.5px; color: var(--text-3); }

.ambient { position: absolute; inset: 0; pointer-events: none; }
.ambient code { position: absolute; font: 12px/1 var(--mono); color: rgba(255, 255, 255, 0.11); white-space: nowrap; }
.ambient .l1 { left: 3%; top: 14%; transform: rotate(-6deg); }
.ambient .l2 { left: 6%; top: 22%; transform: rotate(-6deg); }
.ambient .l3 { left: 3%; top: 84%; transform: rotate(4deg); }
.ambient .r1 { right: 3%; top: 12%; transform: rotate(6deg); }
.ambient .r2 { right: 3%; top: 82%; transform: rotate(-4deg); }
.ambient .r3 { right: 6%; top: 90%; transform: rotate(-4deg); }
@media (max-width: 1360px) { .ambient { display: none; } }

.facts { width: min(980px, calc(100% - 40px)); margin: 56px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 18px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px var(--line); }
.fact { padding: 28px 30px; text-align: center; }
.fact + .fact { box-shadow: inset 1px 0 0 var(--line); }
.fb { display: flex; align-items: baseline; justify-content: center; gap: 6px; }
.fb b { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; background: linear-gradient(180deg, #fff, #a9b4c8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fb span { font-size: 15px; color: var(--text); font-weight: 560; }
.fact p { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }

.flow { width: min(980px, calc(100% - 40px)); margin: 20px auto 0; }
.flowcard { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0 clamp(40px, 9vw, 120px); padding: 34px clamp(20px, 4vw, 44px); border-radius: 18px; background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px var(--line); }
.flowlines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.flowlines path { fill: none; stroke-width: 1.2; }
.flowlines path.in { stroke: rgba(169, 188, 255, 0.28); }
.flowlines path.out { stroke: rgba(143, 227, 189, 0.32); stroke-dasharray: 5 7; animation: flowdash 1.6s linear infinite; }
@keyframes flowdash { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .flowlines path.out { animation: none; } }
.fcol { display: grid; gap: 12px; position: relative; z-index: 1; }
.fnode { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: #0e1015; box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px; color: var(--text-2); }
.fnode .fp { color: var(--text); font-weight: 560; margin-right: auto; }
.fnode .fa { color: var(--text-2); }
.fnode.agent { justify-content: flex-start; }
.fnode .fd { width: 6px; height: 6px; border-radius: 50%; background: #8fe3bd; box-shadow: 0 0 10px #8fe3bd; }
.fhub { display: grid; justify-items: center; gap: 6px; padding: 18px 22px; border-radius: 14px; background: #0e1015; box-shadow: inset 0 0 0 1px var(--line-2), 0 0 60px rgba(124, 156, 255, 0.18); }
.fhub img { width: 28px; height: 28px; }
.fhub b { font-size: 14px; }
.fhub code { font: 12px/1 var(--mono); color: var(--text-3); letter-spacing: 0.06em; }

.hfoot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 64px clamp(20px, 5vw, 56px) 28px; color: var(--text-3); font-size: 12.5px; }
.hfoot .brand { margin: 0; font-size: 13px; color: var(--text-2); }
.hfoot .brand img { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .ambient { display: none; }
  .hero-orbs { transform: scale(0.8); margin: -10px 0 6px; }
  .startbar { flex-wrap: wrap; justify-content: center; width: 100%; max-width: 420px; }
  .startbar .field, .field.namein, .field.codein { flex: 1 1 140px; width: auto; }
  .startbar .namein, .startbar .cta:first-of-type { flex: 1 1 100%; }
  .startbar .sep { display: none; }
  .facts { grid-template-columns: 1fr; }
  .fact + .fact { box-shadow: inset 0 1px 0 var(--line); }
  .flowcard { grid-template-columns: 1fr; gap: 14px; }
  .flowlines { display: none; }
  .fhub { grid-auto-flow: column; justify-content: center; }
  .top .mcode { display: none; }
}

/* quiet job lines: acknowledgement and progress under the request */
.jobline { display: flex; align-items: center; gap: 7px; margin: 2px 0 2px 40px; padding: 2px 0; font-size: 12.5px; color: var(--text-3); min-width: 0; }
.jobline .jl-w { color: var(--text-2); flex: none; }
.jobline .jl-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobline .jobs { width: 7px; justify-content: center; }
.jobline .jl-done { width: 7px; height: 7px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); }
.act { cursor: pointer; }

/* assistants list: one row each, details behind icons */
.arow2 { border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.ahead { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; }
.ahead .an { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.ahead .an b { font-weight: 560; }
.ahead .an span { font-size: 12px; color: var(--text-3); }
.ahead .icon-btn.on { color: var(--text); background: var(--hover); }
.apanel:empty { display: none; }
.apanel { display: grid; gap: 10px; padding: 2px 12px 12px; }
.apanel .row { margin-top: 0; justify-content: flex-start; align-items: center; }
.apanel .row .grow, .card-foot .grow { flex: 1; }
.answer-box:empty { display: none; }
.answer-box { padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); font-size: 13.5px; }
.card-sec.fold { display: none; }
.card-sec.fold.open { display: block; }
.amanage { gap: 8px; }
.jobline .jl-ref { display: inline-flex; align-items: center; gap: 3px; flex: 0 1 auto; max-width: 40%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-3); cursor: pointer; }
.jobline .jl-ref:hover { color: var(--text-2); }
