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

:root {
  /* One dark theme for the whole product. See docs/DESIGN_SYSTEM.md. */
  color-scheme: dark;
  --bg: #141518;
  --surface: #1c1d21;
  --raised: #24262b;
  --sunken: #111215;
  --text: #eef0f4;
  --text-2: #a5abb6;
  --text-3: #959ba6;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.12);
  --accent: #94aaff;
  --on-accent: #151a2a;
  --accent-soft: rgba(111, 147, 255, 0.14);
  --accent-text: #a9bdff;
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, 0.12);
  --ok: #2fd38a;
  --danger: #ff5d6c;
  --hover: rgba(255, 255, 255, 0.045);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 2px 6px rgb(0 0 0 / .18), 0 18px 48px rgb(0 0 0 / .32);
  --r-xs: 6px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --h-sm: 28px;
  --h-md: 34px;
  --h-lg: 44px;
  --h-xl: 60px;
  --col: 720px;
  --sat: 46%;
  --lum: 54%;
  --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);
}

* { 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(--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: var(--h-md); padding: 0 14px; border-radius: var(--r-sm); flex: none;
  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, .cta { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover, .cta:hover { background: color-mix(in srgb, var(--accent) 85%, var(--text)); }
.btn.lg { height: var(--h-lg); padding: 0 20px; font-size: 15px; border-radius: var(--r); }
.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, .cta:disabled { color: var(--text-3); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); 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; min-width: 0;
  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) 22% 24%); color: hsl(var(--h) 60% 82%); }
.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.agent.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(--raised); color: var(--text); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-2);
  padding: 8px 16px; 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: rgb(0 0 0 / .5); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fade 0.18s ease-out;
}
.modal {
  width: min(460px, 100%); background: var(--raised);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line);
  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(--raised); border-radius: var(--r);
  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; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.codeblock button, .cmd button { font-family: var(--font); }
.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-2);
  background: var(--bg);
  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; }
.room-back { display: inline-flex; align-items: center; gap: 2px; flex: none; min-height: 40px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.room-back span { display: none; }
.room-back { width: 28px; justify-content: center; }
.top .local-only { color: var(--text-3); display: inline-flex; }
.top .people { align-items: center; gap: 4px; }
.top .person { display: contents; }
.top .person button { margin: 0; transform: none; }
.top .person .jobs { display: none; }
.top .people-extra { display: none; }
.people-more { display: inline-grid; align-items: center; min-width: 28px; min-height: 28px; color: var(--text-2); font-size: 12px; }
.room-back .back { transform: rotate(180deg); }
.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; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 8px; margin: -4px 0 -8px; }
.people::-webkit-scrollbar { display: none; }
.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: 28px; height: 28px; border-radius: 8px; margin-left: 2px;
  display: grid; place-items: center; color: var(--text-3);
  transition: color 0.15s, background 0.15s;
}
.add-agent:hover { color: var(--text); background: var(--hover); }
.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; }
.sys.created { justify-content: center; color: var(--text-3); font-size: 12px; }

/* ---------- 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; max-width: 45%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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:is(:hover,:focus-within) .actions, .row.has-quick-result .actions { display: flex; }
.row.has-quick-result:not(:hover):not(:focus-within) .actions { opacity: 0; pointer-events: none; }
.row .actions .request-job { margin: 0; }
.row .actions .result-link { min-height: 26px; }
.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: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; margin-top: 2px; padding: 9px 12px; border-radius: var(--r); background: rgba(61, 123, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(61, 123, 255, 0.2); }
.ask-q .body { grid-column: 2; }
.qb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.ask-who { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--accent-text); font-weight: 560; line-height: 20px; white-space: nowrap; }
.ask-wait { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-weight: 400; }
.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 .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; }
.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 { min-height: 38px; padding: 5px 12px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-2); font-size: 13px; }
.tile:hover { color: var(--text); background: var(--hover); }

.jump {
  margin: 3px auto;
  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-row { flex: none; }
.jump:hover { color: var(--accent-text); }
.jump .x { color: var(--text-3); margin-left: 2px; }
.scroll-wrap { overflow: clip; 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[tabindex="-1"]:focus { outline: none; }
.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 { background: var(--bg); flex: none; padding: 0 20px 18px; padding-bottom: max(18px, env(safe-area-inset-bottom)); position: relative; }
.dock-inner { max-width: calc(var(--col) - 40px); margin: 0 auto; position: relative; }
.activity { height: 22px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); padding-left: 40px; min-width: 0; overflow: hidden; white-space: nowrap; }
.activity .act { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.activity .act > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .activity .running > span:last-child { animation: task-progress 3s ease-in-out infinite; }
  @keyframes task-progress { 50% { color: var(--text); } }
}
.activity .who { color: var(--text-2); font-weight: 500; }
.act { display: inline-flex; align-items: center; gap: 5px; }
.pins { display: grid; grid-template-columns: minmax(0, 1fr); 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 .q .text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin .chips { margin: 0; max-width: 70%; justify-content: flex-end; }
.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 .reply-text { text-align: start; 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(--accent); color: var(--on-accent); }
.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(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.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-part { display: inline-block; white-space: nowrap; }
.pop[tabindex="-1"]:focus { outline: none; }
.asstpop .card-foot { flex-wrap: wrap; }
.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; }
/* Segmented control: content width by default, never wraps, scrolls if it must. */
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--sunken); border-radius: var(--r-sm); padding: 2px; box-shadow: inset 0 0 0 1px var(--line); }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; height: 26px; padding: 0 12px; border-radius: var(--r-xs); font-size: 12.5px; color: var(--text-2); white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px 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-list { flex: 1; overflow-y: auto; padding: 6px 8px 20px; }
.task-row { display: flex; align-items: center; }
.task-row > .task-review, .task-row > .task-stop { min-height: 44px; min-width: 44px; }
.task-row > .task-stop { box-shadow: inset 0 0 0 1px var(--line-2); }
.task {
  flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: inherit;
  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 .tb { flex: 1; min-width: 0; }
.task .tt { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.task.done .tt, .task.ended .tt { color: var(--text-2); }
.task .tm { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.task .ta { flex: none; color: var(--text-2); }
.drawer-empty { display: grid; place-items: center; color: var(--text-3); gap: 10px; padding: 64px 20px; }

.mobile-pin { display: none; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .room-back { width: 44px; justify-content: center; }
  .room-back span { display: none; }
}
@media (max-width: 640px) {
  .top { height: auto; padding: 0 8px 6px; display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); gap: 0 8px; }
  .top .title { grid-column: 1 / -1; gap: 4px; }
  .top .spacer, .top .mcode { display: none; }
  .top .people { margin: 0; padding: 4px 2px; }
  .pins > .pin { display: none; }
  .mobile-pin { display: flex; align-items: center; gap: 4px; padding: 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
  .pending-question { display: flex; align-items: center; gap: 8px; min-height: 42px; min-width: 0; flex: 1; text-align: left; }
  .pending-question b { display: none; }
  .pending-question .approval-action { display: inline; flex: none; color: var(--accent-text); }
  .pending-more { flex: none; min-height: 42px; color: var(--accent-text); font-size: 13px; }
  .pending-questions { max-height: 50dvh; overflow-y: auto; }
  .pending-questions .pending-question { width: 100%; }
  .timeline .chips .chip:not(.ic) { height: auto; min-height: 28px; max-width: 100%; padding-block: 4px; overflow-wrap: anywhere; }
  .tasks-btn span.l { display: none; }
  .timeline { padding: 16px 14px 24px; }
  .dock { padding: 0 14px 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; }
}

/* Assistant portraits retain their owner's chosen accent. */
.orb {
  --s: 28px; --ring: 1.5px;
  position: relative; display: inline-flex; flex: none; isolation: isolate;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: #15151a;
  box-shadow: 0 0 0 var(--ring) color-mix(in srgb, var(--c) 26%, #9fa1ab55);
}
.appearance-picker > .orb, .na-preview > .orb { box-shadow: 0 0 0 2px var(--c); }
.orb .shiba-face { display: block; width: 100%; height: 100%; border-radius: inherit; background: url("/shiba.webp") center / cover no-repeat; }
.has-portrait-atlas .shiba-face { background: url("/shiba-avatars.webp") var(--coat-x) var(--expression-y) / 800% 800% no-repeat; }
.orb.xs { --s: 16px; }
.orb.sm { --s: 22px; }
.orb.md { --s: 32px; }
.orb.lg { --s: 46px; }
.orb.xl { --s: 96px; }
.orb.sleep .shiba-face, .orb.dim .shiba-face { filter: saturate(.75) brightness(.88); }
.orb.off .shiba-face { filter: grayscale(1) brightness(.62); }
.orb:is(.dim,.off,.sleep)::after {
  content: ""; position: absolute; right: -3%; bottom: -3%;
  width: max(5px, 22%); height: max(5px, 22%); border-radius: 50%;
  background: #555961; border: 1.5px solid #16181b; box-sizing: border-box;
}
.orb.think::before {
  content: ""; position: absolute; inset: calc(-2 * var(--ring) - 2px); border-radius: inherit;
  border: 2px dashed var(--c); animation: assistant-thinking 6s linear infinite;
}
@keyframes assistant-thinking { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orb.think::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; }
@media (prefers-reduced-motion: reduce) { .jobs i.running { animation: none; } }
.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%; }
.pface .av::after { content: ""; position: absolute; left: -1px; bottom: -1px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 1.5px var(--bg); }
.pface .av.off::after { background: var(--bg); box-shadow: inset 0 0 0 1px var(--text-3), 0 0 0 1.5px var(--bg); }
.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 {
  white-space: nowrap; flex: none;
  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 ---------- */
.scrim:has(> .modal.plus) { align-items: start; padding-block-start: clamp(12px, 9dvh, 80px); }
.modal.plus { display: flex; flex-direction: column; max-height: calc(100dvh - clamp(12px, 9dvh, 80px) - 20px); }
.modal.plus > .tabs { flex-shrink: 0; border-bottom: 0; gap: 12px; }
.plus > .tabs button[data-k] { padding-inline: 0; }
.plus-body > .codeblock { align-items: center; color: var(--text-2); }
.plus-body > .invite-link { padding-inline: 8px; gap: 6px; }
.invite-link .invite-host { max-width: 100%; overflow-wrap: anywhere; }
.invite-link .invite-path { white-space: nowrap; }
.invite-link code { display: flex; flex-wrap: wrap; white-space: normal; overflow-wrap: normal; word-break: normal; overflow-x: auto; }
.plus-body > .codeblock button { flex: none; color: var(--text); }
.modal.plus > .plus-body { min-height: 0; overflow: auto; }
.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 .panel-close { margin: 0 0 0 auto; align-self: center; padding: 4px; border: 0; }
.plus button.bigcode { display: block; width: 100%; }
.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: 10px 0; 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 { display: flex; }
.seg.wide button { flex: 1 0 auto; }
.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.asstpop { width: min(360px, calc(100vw - 16px)); }
.asstpop .job { flex-wrap: wrap; }
.asstpop .job .jt { flex: 1 1 calc(100% - 30px); white-space: normal; overflow-wrap: anywhere; }
.asstpop .job .js { flex: 1 1 72px; overflow-wrap: anywhere; }
.request-job { margin: 3px 0 8px 40px; color: var(--text-2); font-size: 13px; }
.request-job-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; overflow-wrap: anywhere; }
.job-history { margin-top: 4px; font-size: 12px; color: var(--text-3); }
.job-history-toggle { width: 28px; height: 28px; display: grid; place-items: center; color: var(--text-2); border-radius: var(--r-sm); }
.job-history-toggle:hover { background: var(--hover); }
.job-history-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.failed-reason { display: inline-flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.failed-reason > span { overflow: hidden; text-overflow: ellipsis; }
.failed-reason svg { flex: none; color: var(--danger); }
.request-job-line > b { font-weight: 560; }
.result-link { color: var(--text-2); font-size: 12px; min-height: 28px; }
.result-link:hover { text-decoration: underline; }
.reply-action { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.reply-tip { display: none; position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); padding: 4px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); white-space: nowrap; color: var(--text); z-index: 1; }
.reply-action:is(:hover,:focus-visible) .reply-tip { display: block; }
.job-history .jobline { margin-left: 0; }
.job-history .jl-t { white-space: normal; overflow-wrap: anywhere; }
.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); }
.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: few words, the glow does the talking ---------- */
.home { min-height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--bg); }
.home::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(55% 38% at 50% 6%, rgba(61, 123, 255, 0.2), transparent 70%),
    radial-gradient(28% 24% at 22% 26%, rgba(255, 90, 60, 0.08), transparent 70%),
    radial-gradient(28% 24% at 78% 30%, rgba(20, 214, 143, 0.08), transparent 70%);
}
.home::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 45% at 50% 16%, #000, transparent 75%);
}
.home > * { position: relative; z-index: 1; }
.htop { display: flex; align-items: center; gap: 12px; padding: 20px clamp(20px, 5vw, 56px); }
.htop .brand { margin: 0; }
.htop .spacer { flex: 1; }
.hlink { display: inline-flex; align-items: center; gap: 6px; height: var(--h-md); font-size: 13.5px; color: var(--text-2); padding: 0 10px; border-radius: var(--r-sm); white-space: nowrap; transition: color 0.15s, background 0.15s; }
.hlink:hover { color: var(--text); background: var(--hover); text-decoration: none; }

.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; white-space: nowrap;
  height: var(--h-lg); padding: 0 22px; border-radius: var(--r); font-size: 15px; font-weight: 600;
  transition: transform 0.1s, background 0.15s;
}
.cta:hover { text-decoration: none; }
.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.sm { height: var(--h-md); padding: 0 16px; font-size: 13.5px; border-radius: var(--r-sm); }
.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(24px, 6vh, 72px) 20px 8px; }
.hero-orbs { position: relative; width: 300px; height: 150px; margin-bottom: 14px; flex: none; }
.hero-orbs .orb { position: absolute; animation: float 7s ease-in-out infinite; }
.hero-orbs .o0 { left: 98px; top: 6px; --s: 108px; }
.hero-orbs .o1 { left: 26px; top: 58px; --s: 60px; animation-delay: -2.4s; }
.hero-orbs .o2 { left: 214px; top: 52px; --s: 64px; animation-delay: -4.6s; }
@keyframes float { 50% { transform: translateY(-9px); } }
@media (prefers-reduced-motion: reduce) { .hero-orbs .orb { animation: none; } }
.hero h1 { display: grid; gap: 4px; font-size: clamp(38px, 6.2vw, 74px); line-height: 1.1; letter-spacing: -0.04em; font-weight: 720; margin: 0 0 18px; }
.hero h1 .l1 { white-space: nowrap; }
.typed { --tc: #3d7bff; margin-left: 0.22em; color: var(--tc); text-shadow: 0 0 28px color-mix(in srgb, var(--tc) 55%, transparent); transition: color 0.3s, text-shadow 0.3s; }

.hero .lead { font-size: clamp(15px, 1.5vw, 17px); color: var(--text-2); margin: 0 0 30px; }
.joinbar {
  display: flex; align-items: center; gap: 10px; width: min(560px, 100%); padding: 10px; border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--line), 0 24px 70px rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px);
}
/* The code box and its button share one height. */
.joinbar .field, .joinbar .field.big { flex: 1; height: 52px; border-radius: var(--r); background: rgba(255, 255, 255, 0.04); border-color: transparent; }
.joinbar .field:focus { border-color: var(--accent); }
.joinbar .cta { height: 52px; padding: 0 28px; font-size: 16px; border-radius: var(--r); }
.joinbar.small { width: min(420px, 100%); padding: 6px; border-radius: 16px; }
.joinbar.small .field, .joinbar.small .field.big, .joinbar.small .cta { height: var(--h-lg); font-size: 15px; border-radius: var(--r); }
.field.codein { text-align: center; font: 600 16px/1 var(--mono); letter-spacing: 0.1em; }
.field.codein.big { font-size: 22px; letter-spacing: 0.16em; }
.field.codein::placeholder { font-family: var(--font); letter-spacing: 0.04em; font-weight: 500; }
.field.big { height: var(--h-lg); font-size: 16px; border-radius: var(--r); }
.field.need { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.connectbox { width: min(760px, calc(100% - 40px)); margin: 64px auto 0; padding: 8px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.025); box-shadow: inset 0 0 0 1px var(--line); }
.hero-start { margin-bottom: 14px; }
.connectbox > summary { padding: 7px 12px; cursor: pointer; color: var(--text-2); font-weight: 550; }
.home-connect, .connect-instructions { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.home-connect { padding: 8px; }
.home-connect > .choice { width: min(100%, 260px); }
.ctabs { display: flex; gap: 2px; padding: 2px 2px 8px; overflow-x: auto; scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.ctabs button { flex: none; height: 30px; padding: 0 14px; border-radius: var(--r-sm); font-size: 13px; color: var(--text-3); white-space: nowrap; transition: color 0.15s, background 0.15s; }
.ctabs button:hover { color: var(--text-2); }
.ctabs button.on { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.cmd { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 8px 0 18px; border-radius: var(--r); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
.cmd-mark { flex: none; font: 600 14px/1 var(--mono); color: #14d68f; }
.cmd code { flex: 1; min-width: 0; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 7em; padding-block: 8px; scrollbar-width: thin; font: 14px/1.5 var(--mono); color: var(--text); }
.cmd code::-webkit-scrollbar { width: 5px; height: 5px; }
.cmd > .btn { flex: none; }
.cmd-copy { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--text-2); transition: background 0.15s, color 0.15s; }
.cmd-copy:hover { background: var(--hover); color: var(--text); }

.flow { width: min(1080px, calc(100% - 40px)); margin: 24px auto 0; }
.flowcard { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0 clamp(32px, 5vw, 64px); padding: 40px clamp(20px, 3vw, 36px); border-radius: var(--r-lg); 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(150, 175, 255, 0.32); }
.flowlines path.out { stroke: rgba(20, 214, 143, 0.5); stroke-dasharray: 4 6; animation: flowdash 1.4s linear infinite; }
@keyframes flowdash { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) { .flowlines path.out { animation: none; } }
.fside { display: grid; gap: 14px; position: relative; z-index: 1; }
.fpair { display: flex; align-items: center; gap: clamp(28px, 4vw, 56px); }
.fside.left .fpair { justify-content: flex-end; }
.fnode { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.fnode.person { min-width: 150px; }
.fnode .fp { color: var(--text); font-weight: 560; margin-right: auto; padding-right: 8px; }
.fnode .fd { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.fhub { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; padding: 20px 24px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 70px rgba(61, 123, 255, 0.22); }
.fhub img { width: 28px; height: 28px; }
.fhub b { font-size: 14px; white-space: nowrap; }
.fhub code { font: 12px/1 var(--mono); color: var(--text-3); letter-spacing: 0.06em; white-space: nowrap; }

.features { width: min(1080px, calc(100% - 40px)); margin: 96px auto 0; display: grid; gap: 96px; }
.feature { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: clamp(28px, 5vw, 64px); align-items: center; opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.feature.in { opacity: 1; transform: none; }
.feature.flip { grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.8fr); }
.feature.flip .ft { order: 2; }
.ft .fn { font: 600 12px/1 var(--mono); color: var(--text-3); letter-spacing: 0.1em; }
.ft h3 { margin: 12px 0 10px; font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -0.02em; font-weight: 680; }
.ft p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.shot { position: relative; border-radius: var(--r-lg); padding: 1px; background: linear-gradient(140deg, rgba(255,255,255,0.22), rgba(255,255,255,0.04) 40%, rgba(61,123,255,0.25)); box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 90px rgba(61,123,255,0.12); }
.shot img { display: block; width: 100%; height: auto; border-radius: calc(var(--r-lg) - 1px); background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .feature { opacity: 1; transform: none; transition: none; } }

.hfoot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 96px 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: 900px) {
  .flowcard { grid-template-columns: 1fr; gap: 14px; }
  .fside.left .fpair { justify-content: flex-start; flex-direction: row-reverse; }
  .fpair { justify-content: space-between; }
  .fhub { grid-auto-flow: column; justify-content: center; align-items: center; gap: 10px; padding: 12px 16px; }
  .feature, .feature.flip { grid-template-columns: 1fr; }
  .feature.flip .ft { order: 0; }
}
@media (max-width: 600px) {
  .hero-orbs { transform: scale(0.8); margin: -10px 0 4px; }
  .hero h1 .l1 { white-space: normal; }
  .joinbar { flex-direction: column; align-items: stretch; }
  .joinbar .cta { width: 100%; }
  .fnode.person { min-width: 0; flex: 1; }
  .fnode.agent .fd + span { overflow: hidden; text-overflow: ellipsis; }
  .fpair { gap: 20px; }
}

/* ---------- workspace ---------- */
.ws { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100%; }
.ws-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--sunken); }
.ws-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; color: var(--text); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.ws-brand:hover { text-decoration: none; }
.ws-brand img { width: 22px; height: 22px; }
.ws-nav { display: grid; gap: 2px; }
.ws-nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.ws-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.ws-nav a.on { background: rgba(255, 255, 255, 0.06); color: var(--text); font-weight: 560; }
.ws-nav a .orb { --s: 16px; margin: 0 0 0 0; }
.ws-foot { margin-top: auto; }
.ws-acct { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 10px; border-radius: var(--r-sm); text-align: left; transition: background 0.15s; }
@media (min-width: 1024px) {
  .ws:not(.room-layout) .ws-acct.local-guest { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; column-gap: 10px; row-gap: 0; }
  .ws-acct.local-guest > .av { grid-row: span 2; }
  .ws-acct.local-guest .ws-as { line-height: 1.15; }
}
.ws-acct:hover { background: var(--hover); }
.ws-an { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.ws-as { flex: none; font-size: 12px; color: var(--text-2); text-decoration: underline; text-underline-offset: .2em; }
.ws-main { min-width: 0; padding: 28px clamp(20px, 4vw, 48px) 64px; }
.ws-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ws-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; font-weight: 680; white-space: nowrap; }
.ws-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.joinmini { display: flex; gap: 6px; }
.joinmini .field.codein { width: 150px; height: var(--h-md); font-size: 14px; }

.checklist { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -8px 0 22px; padding: 8px 8px 8px 10px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ck { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 8px; border-radius: 999px; font-size: 13px; color: var(--text); white-space: nowrap; transition: background 0.15s; }
.ck:hover { background: var(--hover); }
.ck-dot { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); color: var(--text-2); font: 11px/1 var(--font); font-variant-numeric: tabular-nums; }
.checklist .grow { flex: 1; }

.mgrid, .agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.mcard, .acard { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s var(--ease); min-height: 196px; text-align: left; }
.mcard:hover, .acard:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 50px rgba(0,0,0,0.45); transform: translateY(-2px); }
.mcard.sk, .acard.sk { background: linear-gradient(100deg, var(--surface) 30%, var(--raised) 50%, var(--surface) 70%); background-size: 300% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -150% 0; } }
.mcard { min-height: 0; }
.ws-main:has(.checklist) .mgrid > p:only-child { display: none; }
.mc-cover { position: relative; flex: none; min-height: 72px; display: grid; place-items: center; background: radial-gradient(70% 90% at 30% 100%, color-mix(in srgb, var(--g1) 14%, transparent), transparent 70%), radial-gradient(60% 80% at 80% 0%, color-mix(in srgb, var(--g2) 9%, transparent), transparent 70%), var(--sunken); border-bottom: 1px solid var(--line); }
.mc-orbs { display: flex; align-items: center; gap: 14px; }
.mc-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mc-people { flex: none; display: flex; align-items: center; }
.mc-people .av { box-shadow: 0 0 0 2px var(--sunken); }
.mc-people .av + .av { margin-left: -3px; }
.mc-more { margin-left: 6px; font-size: 11.5px; color: var(--text-3); }
.mc-wait { justify-self: start; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; color: var(--warn); background: var(--warn-soft); }
.mc-copy { position: absolute; top: 8px; right: 8px; opacity: 0; background: rgba(0,0,0,0.35); }
.mcard:is(:hover, :focus-within) .mc-copy, .mc-copy:focus-visible { opacity: 1; }
@media (hover: none) { .mc-copy { opacity: 1; } }
.mc-meta { display: grid; gap: 4px; padding: 12px 14px 14px; min-width: 0; }
.mc-n { display: flex; align-items: center; gap: 6px; font-weight: 560; font-size: 14.5px; min-width: 0; overflow-wrap: anywhere; }

.ac-cover { position: relative; flex: 1; min-height: 132px; display: grid; place-items: center; background: radial-gradient(60% 80% at 50% 55%, color-mix(in srgb, var(--g1) 20%, transparent), transparent 70%), var(--sunken); border-bottom: 1px solid var(--line); }
.ac-cover .orb { --s: 64px; }
.ac-jobs { position: absolute; right: 12px; bottom: 12px; }
.ac-meta { display: grid; gap: 4px; padding: 12px 14px 14px; min-width: 0; }
.ac-meta b { font-weight: 560; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-meta span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.dotx { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.dotx.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dotx.idle { background: var(--warn); }

.ad-back { display: inline-flex; align-items: center; gap: 6px; height: 28px; margin-bottom: 14px; color: var(--text-3); font-size: 13px; }
.ad-back:hover { color: var(--text); text-decoration: none; }
.ad-back .back { transform: rotate(180deg); }
.ad-head { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.ad-head .orb { --s: 72px; }
.ad-n { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ad-n h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-n span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); }
.ad-head .icon-btn.on { background: var(--hover); color: var(--text); }
.ad-bar { margin: 18px 0 18px; }
.ad-tabs { margin: 0; gap: 18px; border-bottom: none; }
.ad-tabs button { padding-inline: 0; }
.connection-roster { list-style: none; padding: 0; margin: 0 0 14px; }
.connection-roster[hidden] { display: none; }
.connection-roster .cn { min-height: 44px; padding-inline: 8px; border-bottom: 1px solid var(--line); }
.connection-roster .cn:hover { background: var(--hover); }
.ad-n .ad-status.online { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ad-head .portrait-open { position: relative; }
.ad-head:has(.ad-status.online) .portrait-open::after { content: ""; position: absolute; bottom: 3%; right: 3%; width: 14%; aspect-ratio: 1; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--surface); }
.ad-body { min-width: 0; }
.ad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { min-width: 0; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 12px; align-content: start; }
.card.wide { grid-column: 1 / -1; }
.card-k { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.card .btn { justify-self: start; }
.rchips { display: flex; flex-wrap: wrap; gap: 8px; }
.rchip { display: inline-flex; align-items: center; gap: 8px; height: 30px; max-width: 100%; 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); white-space: nowrap; }
.rchip .rn { overflow: hidden; text-overflow: ellipsis; }
.rchip:hover { color: var(--text); text-decoration: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.job { color: var(--text); }
.job:hover { text-decoration: none; }
.ad-connect { max-width: 640px; display: grid; gap: 10px; }
.askwrap { max-width: 720px; display: grid; gap: 14px; }
.asklog { display: grid; gap: 10px; }
.asklog:empty { display: none; }
.qa { padding: 10px 14px; border-radius: var(--r); font-size: 14px; line-height: 1.6; max-width: 88%; }
.qa.q { justify-self: end; background: rgba(61, 123, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(61, 123, 255, 0.25); }
.qa.a { justify-self: start; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.qa.a .orb { margin-top: 3px; }
.askbar { display: flex; gap: 8px; }
.askbar .field { height: var(--h-lg); border-radius: var(--r); }
.askbar .btn { height: var(--h-lg); width: var(--h-lg); padding: 0; border-radius: var(--r); }
.ad-settings { max-width: 640px; display: grid; gap: 14px; }
.setrow { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: center; }
.setrow.tall { align-items: start; }
.setrow.tall .k { padding-top: 9px; }
.setrow .k { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.setrow .btn { justify-self: start; }
.na-preview { display: grid; place-items: center; height: 130px; margin: -4px 0 8px; }

/* ---------- guide and confirm pages ---------- */
.guide .htop { position: relative; }
.g-dots { display: flex; gap: 6px; }
.g-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: width 0.25s var(--ease), background 0.25s; }
.g-dots i.on { width: 20px; border-radius: 999px; background: var(--text); }
.g-pad { width: 60px; }
.g-main { flex: 1; display: grid; place-items: center; padding: 20px 20px 80px; }
.g-card { width: min(480px, 100%); display: grid; justify-items: center; text-align: center; gap: 18px; animation: rise 0.35s var(--ease); }
.g-card h2 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.03em; font-weight: 700; }
.g-orb { height: 150px; display: grid; place-items: center; }
.g-orb .orb { --s: 104px; }
.g-form { display: flex; gap: 10px; width: 100%; justify-content: center; }
.g-form .field { flex: 1; }
.g-form .cta { flex: none; }
.g-or { color: var(--text-3); font-size: 13px; }
.g-skip { margin-top: 4px; }
.g-connect { width: 100%; display: grid; gap: 10px; text-align: left; }
.g-pick { width: min(400px, 100%); justify-items: stretch; }
.g-pick .toggles { justify-content: center; }
.g-pick .cta { width: 100%; }
.g-card .swatches { justify-content: center; }

@media (max-width: 760px) {
  .ws { grid-template-columns: 1fr; }
  .ws-side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ws-brand span, .ws-an, .ws-as { display: none; }
  .ws-brand { padding: 4px; }
  .ws-nav { display: flex; gap: 2px; }
  .ws-nav a { height: 34px; }
  .ws-foot { margin: 0 0 0 auto; }
  .ws-acct { width: auto; height: 36px; padding: 0 6px; }
  .ws-main { padding: 20px 16px 48px; }
  .ws-head h1 { font-size: 22px; }
  .ws-tools { width: 100%; }
  .ws-tools .btn.primary { flex: 1; }
  .joinmini { flex: 1; }
  .joinmini .field.codein { flex: 1; width: auto; }
  .mgrid, .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mcard, .acard { min-height: 168px; }
  .ac-cover { min-height: 104px; }
  .ad-grid { grid-template-columns: 1fr; }
  .ad-head { padding: 16px; gap: 14px; }
  .ad-head .orb { --s: 56px; }
  .setrow { grid-template-columns: 1fr; gap: 6px; }
  .setrow.tall .k { padding-top: 0; }
  .g-form { flex-direction: column; }
  .g-form .cta { width: 100%; }
  .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; }
.request-status { flex-wrap: wrap; }
.request-status:has(.btn) { color: var(--text-2); }
.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; }

/* shared small pieces */
.vstack { display: grid; gap: 12px; }
.modal .vstack .field { width: 100%; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.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); white-space: nowrap; 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; }
.tog > svg:last-child { display: none; }
.tog.on > svg:last-child { display: inline-block; color: var(--accent-text); }
.bring { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-foot .grow { flex: 1; }
.card-sec.fold { display: none; }
.card-sec.fold.open { display: block; }
.jobline .jl-ref { display: inline-flex; align-items: center; gap: 3px; flex: 0 1 auto; max-width: 40%; min-width: 0; white-space: nowrap; color: var(--text-3); cursor: pointer; }
.jobline .jl-ref span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.jobline .jl-ref:hover { color: var(--text-2); }
.job-stopped .jl-ref { max-width: 25%; }
.job-stopped .jl-t { white-space: normal; overflow-wrap: anywhere; }
.task .tt p, .task .tt .pre { margin: 0; }
.jobline .jl-ref { padding: 0 6px; border-radius: var(--r-xs); background: rgba(255, 255, 255, 0.04); }
.modal .cmd, .ad-connect .cmd, .g-connect .cmd { min-height: 48px; }
.modal .cmd code, .ad-connect .cmd code, .g-connect .cmd code { font-size: 13px; line-height: 1.5; }
/* Grid columns must not grow to fit a long one-line command. */
.connect-area, .ad-connect, .g-connect, .plus-body, .vstack, .ad-settings, .askwrap { grid-template-columns: minmax(0, 1fr); }
.cmd { min-width: 0; }

html.dsh {
  --r: 10px;
  --r-lg: 12px;
}
.dsh .ws { grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px 1fr; }
.dsh .ws-side { z-index: 2; flex-direction: row; align-items: center; height: 48px; padding: 0 12px; gap: 12px; border: 0; border-bottom: 1px solid var(--line); }
.dsh .ws-nav { display: flex; }
.dsh .ws-nav a { height: 30px; font-size: 13px; }
.dsh .ws-brand, .dsh .ws-an { display: none; }
.dsh .ws-foot { margin: 0 0 0 auto; }
.dsh .ws-acct { height: 32px; }
.dsh .ws-main { padding: 20px 16px 36px; }
.dsh .ws-head h1 { font-size: 20px; }
.dsh .ws-head { margin-bottom: 16px; }
.dsh-auth { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.dsh-auth section { width: min(100%, 300px); display: grid; gap: 16px; }
.dsh-auth .brand { margin-bottom: 6px; }
@media (max-width: 440px) {
  .dsh .mgrid, .dsh .agrid { grid-template-columns: 1fr; }
  .dsh .ws-tools { flex-wrap: wrap; }
  .dsh .ws-main { padding-inline: 12px; }
}
@media (prefers-color-scheme: light) {
  html.dsh {
    color-scheme: light;
    --bg: #fff; --sunken: #f8f8fa; --surface: #fafafa; --raised: #f1f2f5;
    --text: #202124; --text-2: #50545c; --text-3: #676c75;
    --line: #e5e6ea; --line-2: #d3d5db; --hover: #ededf2;
    --accent: #385fe0; --on-accent: white; --accent-text: #334fb9; --accent-soft: #eaf0ff;
    --shadow-lg: 0 10px 32px rgba(26, 32, 44, .14);
  }
  .dsh .ws-nav a.on { background: var(--accent-soft); }
  .dsh .mc-wait { color: #824900; }
}

.dsh-confirm { max-width: min(380px, 92vw); padding: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.dsh-confirm p { margin: 0 0 16px; }
.dsh-confirm::backdrop { background: rgba(0, 0, 0, .36); }

.send-retries { max-height: 8rem; overflow-y: auto; }
.send-retry { display: flex; align-items: center; gap: 6px; }
.send-retry small { color: var(--text-3); }
.send-retry > span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.language-picker { width: auto; max-width: 8rem; font: inherit; font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; cursor: pointer; }
.language-picker:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ws-main:has(> .first-meeting) { display: flex; flex-direction: column; align-items: flex-start; }
.ws-main:has(> .first-meeting) > .ws-head { width: min(100%, 420px); margin: 0 0 20px; }
.first-meeting { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: min(100%, 420px); margin: 0; padding-bottom: 24px; }
.first-meeting .first-join { border-top: 1px solid var(--line); padding-top: 18px; }
.first-meeting .first-join .joinmini { margin-top: 0; }
.first-meeting label { display: grid; gap: 6px; font-size: 14px; }
.first-meeting .err:empty { display: none; }
.first-meeting .joinmini { margin-top: 8px; }
.first-meeting .joinmini input { flex: 1; min-width: 0; }
.first-meeting .hlink { justify-self: start; }

.appearance-picker { min-width: 0; width: 100%; text-align: start; }
.appearance-picker[hidden], .portrait-grid[hidden] { display: none; }
.appearance-picker > .orb { margin: 4px 0 14px; --s: 52px; }
.portrait-open { display: inline-flex; flex: none; border-radius: 50%; }
.orb[role="button"] { cursor: pointer; }
.portrait-fields { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 12px; }
.portrait-modes { display: inline-flex; justify-self: start; gap: 2px; padding: 3px; border-radius: 9px; background: var(--sunken); }
.portrait-modes button { padding: 5px 15px; color: var(--text-3); border-radius: 6px; font-size: 13px; font-weight: 600; line-height: 1.3; }
.portrait-modes button[aria-pressed="true"] { background: var(--line-2); color: var(--text); }
.portrait-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.portrait-option { position: relative; display: grid; justify-items: center; align-content: center; gap: 6px; min-width: 0; padding: 7px 2px 4px; border: 1px solid transparent; border-radius: 10px; color: var(--text-2); cursor: pointer; }
.portrait-option .orb { --s: 36px; --ring: 1.5px; }
.portrait-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.portrait-option:hover, .portrait-option:has(:checked) { background: var(--sunken); }
.portrait-option:has(:checked) { border-color: var(--line-2); color: var(--text); }
.portrait-option:has(:focus-visible) { outline: 2px solid var(--text); outline-offset: 1px; }
.portrait-label { font-size: 11px; line-height: 1.25; text-align: center; }
.portrait-check { display: none; position: absolute; top: 3px; right: 4px; width: 14px; height: 14px; place-items: center; border-radius: 50%; color: var(--bg); background: var(--text); }
.portrait-option:has(:checked) .portrait-check { display: grid; }
.portrait-colors { display: grid; gap: 7px; color: var(--text-2); font-size: 12px; }
.accent-editor { margin-top: 10px; padding: 10px; border-radius: 8px; display: flex; align-items: center; gap: 14px; background: var(--sunken); }
.accent-editor[hidden] { display: none; }
.accent-sliders { flex: 1; display: grid; gap: 6px; }
.accent-sliders label { display: flex; align-items: center; gap: 6px; font: 10px var(--mono); }
.accent-sliders label span { width: 1ch; }
.accent-sliders input { appearance: none; height: 7px; border: 1px solid var(--line-2); border-radius: 6px; min-width: 0; width: 100%; cursor: pointer; }
.accent-sliders input::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #333; }
.accent-sliders input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 1px solid #333; }
.accent-editor .color-hex { width: 92px; min-width: 0; font-family: var(--mono); font-size: 12px; }
.sw.custom { display: grid; place-items: center; color: #17171a; }
.portrait-fields > button { justify-self: end; }
.modal:has(.appearance-picker) { max-height: calc(100dvh - 40px); overflow-y: auto; }
.na-preview:has(.orb[role="button"]) { height: 100px; }
.na-preview .orb[role="button"] { --s: 76px; }
.g-card .appearance-picker { max-width: 380px; }


.field.choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: start; cursor: pointer; }
.preference-switch { width: 38px; height: 24px; padding: 3px; border-radius: 14px; background: var(--line-2); display: flex; align-items: center; }
.preference-switch::after { content: ""; background: var(--text); width: 18px; height: 18px; border-radius: 50%; }
.preference-switch[aria-checked="true"] { background: var(--accent); justify-content: flex-end; }
.settings-model { display: flex; padding: 12px 0; border-top: 1px solid var(--line); }
.settings-recovery { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.field.choice[hidden] { display: none; }
.choice::after { content: ""; flex: none; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.choice:disabled { opacity: .55; cursor: default; }
.choice-list { position: fixed; inset: auto; margin: 0; box-sizing: border-box; padding: 4px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
.choice-list [role=option] { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.choice-list [role=option]:hover, .choice-list .active { background: var(--raised); }
.choice-list [aria-selected=true]::after { content: "✓"; color: var(--accent); }

/* Meeting task panel and question shortcuts */
@media (min-width: 901px) {
  #app:has(.drawer) .room-layout { width: calc(100% - min(32vw, 380px)); }
  .drawer { width: min(32vw, 380px); box-shadow: none; }
  .drawer-scrim { display: none; }
}
@media (max-width: 900px) {
  .drawer { width: 100%; }
}
.pin-question { display: flex; align-items: center; gap: 8px; text-align: start; width: 100%; min-width: 0; color: inherit; }
:is(.pin-question,.pending-question) .pin-body { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pin-actors { max-width: 42%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pin-arrow { flex: none; color: var(--accent-text); }
.pin-question b { flex: none; color: var(--accent-text); font-weight: 500; font-size: 12px; }
.job-failure { display: inline-flex; align-items: center; gap: 4px; color: var(--danger); font-size: 12px; }

.ad-body, .ad-head, .ad-bar { max-width: 840px; }
.ad-body > :is(.ad-settings, .ad-connect, .askwrap) { max-width: none; }
fieldset.ad-settings { min-width: 0; border: 0; padding: 0; margin: 0; }
.ad-head .icon-btn.on, .ad-settings .seg button.on { background: var(--text); color: var(--bg); }
.device-guide { height: 100%; overflow-y: auto; }
.device-guide .g-main { flex: 1 0 auto; }
.device-guide .g-pick { min-width: 0; width: min(380px, 100%); }
.device-field { display: grid; gap: 6px; text-align: start; font-weight: 600; }
.device-field[hidden], .waiting-join[hidden] { display: none; }
.connect-area :is(.cmd, .codeblock) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.connect-area .codeblock { grid-template-columns: minmax(0, 1fr) auto; }
.connect-area :is(.cmd, .codeblock) > button { position: static; }
.appearance-picker > .orb { --s: 88px; }
.portrait-option .orb { --s: clamp(46px, 7vw, 60px); }
.portrait-option:has(:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 540px) {
  .ad-settings .setrow { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ad-settings .setrow > .k:empty { display: none; }
}
.viewer .vhead > :is(strong,b) { min-width: 0; overflow-wrap: anywhere; max-height: 3lh; overflow: auto; }
.viewer .vhead > :is(.time,.icon-btn,.fsize) { flex-shrink: 0; }

.modal.viewer.delivery { width: min(560px, 100%); max-height: calc(100dvh - 40px); }
.delivery .vhead { padding: 10px 18px; border: 0; gap: 8px; }
.delivery .vhead .delivery-source { font-size: 13px; font-weight: 400; line-height: 1.5; color: var(--text-2); }
.delivery .vbody { min-height: 0; padding: 0 18px 18px; }
.delivery-body .body { font-size: 15px; line-height: 1.65; }
.delivery-event:empty { display: none; }
.delivery-body .fcard { width: 100%; }

.device-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.device-actions > button { flex: 1; }
.device-field + .toggles .on::after, .device-guide .tog.on::after { content: "✓"; }
.device-code strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ask-error { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: .85em; }

.public-home { --home-width: min(880px, calc(100% - 40px)); }
.public-home > :is(.hero,.connectbox,.flow,.features,.hfoot) { width: var(--home-width); margin-inline: auto; }
.public-home .hero { padding-inline: 0; }
.home-join { width: 100%; }
.home-join .joinbar { width: 100%; }
.home-join .join-error { margin: 8px 8px 0; text-align: start; font-size: 1rem; color: #ffaaa4; }
.join-error:empty { display: none; }
.joinbar .field.codein[aria-invalid="true"], .joinmini .field.codein[aria-invalid="true"] { border-color: #ff958b; box-shadow: inset 0 0 0 1px #ff958b; }
.public-home .hero .lead { text-wrap: balance; }
.device-clients { color: var(--text-2); }
.public-home .hero-start { margin: 12px 0 0; text-decoration: underline; text-underline-offset: .2em; }
.public-home .flowcard { gap: 16px; padding-inline: 16px; }
.public-home .fpair { gap: 12px; }
.public-home .fnode.person { min-width: 0; }
.home-methods { display: flex; flex-wrap: wrap; gap: 4px; }
.home-methods button { padding: 9px 12px; border-radius: var(--r-sm); }
.home-methods [aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.home-connect .ctabs button, .script-source { color: var(--text-2); }
.script-source summary, .ad-connect details summary { cursor: pointer; }
.script-source a { text-decoration: underline; }
.public-home .feature, .public-home .feature.flip { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; }
.public-home .feature.flip .ft { order: 0; }
.public-home .hfoot { padding-inline: 0; flex-wrap: wrap; }
@media (max-width: 480px) {
  .home-join .joinbar { display: grid; }
  .home-methods { display: grid; grid-template-columns: 1fr 1fr; }
  .home-methods button { padding-inline: 6px; }
}
@media (max-width: 600px) {
  .public-home .flowcard { grid-template-columns: minmax(0, 1fr); padding-inline: 8px; }
  .public-home .fside { min-width: 0; }
  .public-home .fpair { gap: 8px; }
  .public-home .fnode { gap: 4px; padding-inline: 6px; }
  .public-home .fnode .fp { padding-right: 0; }
}
.landing.invite-error { display: flex; flex-direction: column; align-items: stretch; padding: 0; }
.invite-error .landing-inner { align-self: center; margin: auto; padding: 32px 16px; }

.public-home .cmd code { max-height: none; overflow: visible; overflow-wrap: normal; word-break: normal; }
.public-home .url-segment, .public-home .lead > span { display: inline-block; }
.public-home .url-segment { white-space: nowrap; }
.public-home .script-source code { overflow-wrap: anywhere; }
.public-home .hfoot { justify-content: flex-start; gap: 18px; }
.public-home .hfoot .brand { margin-right: auto; }
.public-home .hfoot .language-picker { padding: 0; border: 0; background: transparent; color: inherit; }
.home-join .join-error { text-align: center; }
@media (min-width: 901px) {
  .public-home .fpair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .public-home .fside.right .fpair { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .public-home .fnode { padding-inline: 7px; gap: 4px; }
  .public-home .fnode .fp { padding-right: 0; }
}

.subscription-body { display:grid; gap:12px; min-width:0; }
.subscription-body p, .subscription-usage { margin:0; }
.subscription-plan, .subscription-row { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.subscription-plan strong { font-size:1.45rem; }
.subscription-plan span { overflow-wrap:anywhere; color:var(--muted); font-size:.84rem; }
.subscription-row { padding:9px 0; border-bottom:1px solid var(--line); }
.subscription-row dd { margin:0; font-variant-numeric:tabular-nums; white-space:nowrap; }
.subscription-actions,.subscription-terms { display:flex; flex-wrap:wrap; gap:8px; }
.subscription-actions:empty,.subscription-body p:empty { display:none; }
.subscription-terms { font-size:.8rem; }
.subscription-terms p { flex-basis:100%; }

.relay-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 12rem; overflow: auto; }

.memory-notes summary { cursor: pointer; }
.memory-notes li { white-space: pre-wrap; overflow-wrap: anywhere; }

.quota-button { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; color: var(--text); }
.quota-button:hover { background: var(--hover); }
.quota-ring { width: 15px; height: 15px; border-radius: 50%; background: conic-gradient(currentColor var(--quota-fill, 100%), var(--line) 0); mask: radial-gradient(circle, transparent 45%, black 51%); }
.quota-pop { width: min(276px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.quota-body { padding: 14px 16px; }
.quota-heading, .quota-manage { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.quota-heading span, .quota-value { color: var(--text-2); font-size: 12px; }
.quota-value { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 6px; }
.quota-value b { color: var(--text); font-size: 24px; font-variant-numeric: tabular-nums; }
.quota-track { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.quota-track i { display: block; height: 100%; background: currentColor; }
.quota-body p { margin: 8px 0 0; }
.quota-pop .quota-manage { width: 100%; padding: 10px 16px; border-top: 1px solid var(--line); border-radius: 0; }
.mobile-quota { display: none; }
@media (max-width: 760px) { html:not(.dsh) .mobile-quota { display: inline-grid; } }

.account-danger { color: var(--danger); }
.settings-recovery[hidden] { display: none; }
.dsh-confirm h3 { margin: 0 0 8px; }

.room-consent-status { margin: 0 8px 6px; color: var(--text-2); font-size: 12px; }
.row .actions:has(.message-more) { display: flex; }
.row:not(:hover):not(:focus-within) .actions:has(.message-more) { opacity: 0; pointer-events: none; }
@media (hover: none) {
  .row:has(.message-more) > .main { padding-right: 32px; }
  .row:not(:hover):not(:focus-within) .actions:has(.message-more) { top: 0; right: 2px; padding: 0; opacity: 1; pointer-events: auto; background: transparent; border: 0; box-shadow: none; }
  .row:not(:hover):not(:focus-within) .actions:has(.message-more) > :not(.message-more) { display: none; }
}
