/* Conductor console. System fonts only, no external requests. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
    "Segoe UI", Inter, Roboto, "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --accent: #007aff;
  --accent-hover: #0a6fe6;
  --accent-soft: rgba(0, 122, 255, 0.1);
  --accent-text: #0066d6;
  --green: #28a745;
  --green-soft: rgba(52, 199, 89, 0.14);
  --orange: #f08c00;
  --orange-soft: rgba(255, 149, 0, 0.14);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.12);
  --purple: #af52de;
  --purple-soft: rgba(175, 82, 222, 0.13);
  --teal: #30a6c9;
  --teal-soft: rgba(48, 176, 199, 0.14);
  --gray: #8e8e93;
  --gray-soft: rgba(142, 142, 147, 0.16);

  --window: #ececef;
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --bg-3: #ebebed;
  --sidebar: rgba(232, 232, 237, 0.72);
  --text: #1d1d1f;
  --text-2: rgba(60, 60, 67, 0.68);
  --text-3: rgba(60, 60, 67, 0.42);
  --sep: rgba(60, 60, 67, 0.13);
  --sep-strong: rgba(60, 60, 67, 0.22);
  --fill: rgba(120, 120, 128, 0.1);
  --fill-2: rgba(120, 120, 128, 0.16);
  --control: #ffffff;
  --control-border: rgba(0, 0, 0, 0.12);
  --card: #ffffff;
  --bubble-in: #e9e9eb;
  --shadow-sm: 0 0.5px 1px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 22px 70px rgba(0, 0, 0, 0.22);
  --code-bg: #f5f5f7;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0a84ff;
    --accent-hover: #2b93ff;
    --accent-soft: rgba(10, 132, 255, 0.2);
    --accent-text: #4aa3ff;
    --green: #32d74b;
    --green-soft: rgba(50, 215, 75, 0.16);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.17);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.17);
    --purple: #bf5af2;
    --purple-soft: rgba(191, 90, 242, 0.18);
    --teal: #40c8e0;
    --teal-soft: rgba(64, 200, 224, 0.16);
    --gray: #98989d;
    --gray-soft: rgba(152, 152, 157, 0.18);

    --window: #161618;
    --bg: #1e1e20;
    --bg-2: #262628;
    --bg-3: #2f2f32;
    --sidebar: rgba(44, 44, 48, 0.66);
    --text: #f5f5f7;
    --text-2: rgba(235, 235, 245, 0.62);
    --text-3: rgba(235, 235, 245, 0.34);
    --sep: rgba(255, 255, 255, 0.09);
    --sep-strong: rgba(255, 255, 255, 0.16);
    --fill: rgba(255, 255, 255, 0.07);
    --fill-2: rgba(255, 255, 255, 0.12);
    --control: #3a3a3d;
    --control-border: rgba(255, 255, 255, 0.08);
    --card: #2a2a2d;
    --bubble-in: #333336;
    --shadow-sm: 0 0.5px 1px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 0 0 0.5px rgba(255, 255, 255, 0.12), 0 24px 70px rgba(0, 0, 0, 0.6);
    --code-bg: #161618;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 0% 0%, rgba(90, 169, 255, 0.16), transparent 60%),
    radial-gradient(900px 600px at 0% 100%, rgba(175, 82, 222, 0.08), transparent 60%),
    var(--window);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: default; }
h1, h2, h3, h4, p { margin: 0; }
code, pre { font-family: var(--mono); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-radius: 6px; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
noscript { display: block; padding: 40px; text-align: center; }

/* ---------------------------------------------------------------- icons */

.icon { display: inline-flex; width: 16px; height: 16px; flex: none; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; display: block; }
.app-mark { display: inline-flex; width: 30px; height: 30px; flex: none; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.18)); }
.app-mark svg { width: 100%; height: 100%; }
.app-mark.large { width: 56px; height: 56px; }
.app-mark.hero { width: 84px; height: 84px; filter: drop-shadow(0 6px 14px rgba(10, 96, 224, 0.28)); }

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 12px; border-radius: 7px; border: 0;
  font-size: 13px; font-weight: 500; white-space: nowrap; flex: none;
  transition: background-color 0.12s, filter 0.12s, box-shadow 0.12s;
}
.btn .icon { width: 14px; height: 14px; }
.btn .icon svg { stroke-width: 2.1; }
.btn.small { height: 24px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn.large { height: 36px; padding: 0 18px; font-size: 14px; border-radius: 9px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 0.5px 1px rgba(0, 0, 0, 0.15), inset 0 0.5px 0 rgba(255, 255, 255, 0.18); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:active { filter: brightness(0.92); }
.btn.secondary { background: var(--control); box-shadow: 0 0 0 0.5px var(--control-border), var(--shadow-sm); }
.btn.secondary:hover { background: color-mix(in srgb, var(--control) 92%, var(--text)); }
.btn.plain { background: transparent; color: var(--accent-text); padding: 0 8px; }
.btn.plain:hover { background: var(--fill); }
.btn.danger { color: var(--red); }
.btn.destructive { background: var(--red); color: #fff; }
.btn.destructive:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--text-2); flex: none;
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn.small { width: 24px; height: 24px; }
.icon-btn.small .icon { width: 14px; height: 14px; }

.segmented {
  display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--fill-2); flex: none;
}
.segmented button {
  border: 0; background: transparent; height: 24px; min-width: 32px; padding: 0 8px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-2);
}
.segmented button.on { background: var(--control); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented.text button { padding: 0 14px; font-size: 13px; }

.field {
  width: 100%; border-radius: 7px; border: 0; padding: 7px 10px; background: var(--control);
  box-shadow: 0 0 0 0.5px var(--control-border), inset 0 0.5px 1px rgba(0, 0, 0, 0.04);
  outline: none; resize: vertical; line-height: 1.45;
}
.field::placeholder { color: var(--text-3); }
.field:focus { box-shadow: 0 0 0 0.5px var(--accent), 0 0 0 3.5px color-mix(in srgb, var(--accent) 30%, transparent); }
.field.large { font-size: 17px; font-weight: 500; padding: 9px 12px; }
.select { width: auto; min-width: 150px; padding: 4px 26px 4px 9px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 13px) 52%, calc(100% - 9px) 52%; background-size: 4px 4px; background-repeat: no-repeat; }

/* ----------------------------------------------------------------- pills */

.pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--text-2); flex: none;
}
.pill.accent, .pill.status-awaiting { background: var(--accent); color: #fff; }
.pill.status-active { background: var(--green-soft); color: var(--green); }
.pill.status-invited { background: var(--orange-soft); color: var(--orange); }

.stage-draft { --stage: var(--gray); --stage-soft: var(--gray-soft); }
.stage-dispatched { --stage: var(--teal); --stage-soft: var(--teal-soft); }
.stage-in_progress { --stage: var(--accent); --stage-soft: var(--accent-soft); }
.stage-blocked { --stage: var(--orange); --stage-soft: var(--orange-soft); }
.stage-in_review { --stage: var(--purple); --stage-soft: var(--purple-soft); }
.stage-done { --stage: var(--green); --stage-soft: var(--green-soft); }
.stage-cancelled { --stage: var(--gray); --stage-soft: var(--gray-soft); }
.pill[class*="stage-"] { background: var(--stage-soft); color: var(--stage); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--stage, var(--gray)); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.off { background: var(--gray); }

/* --------------------------------------------------------------- avatars */

/* Agents are app-icon tiles: a rounded square (Apple's ~22.4% corner) for
   letters and images alike, so lists line up whatever the source. */
.avatar {
  --a1: #8e8e93; --a2: #636366;
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 22.4%; color: #fff; font-weight: 600; letter-spacing: -0.02em;
  background: linear-gradient(180deg, var(--a1), var(--a2));
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
.avatar.xs { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
.avatar.md { width: 34px; height: 34px; font-size: 15px; border-radius: 8px; }
.avatar.lg { width: 44px; height: 44px; font-size: 19px; border-radius: 10px; }
.avatar.xl { width: 72px; height: 72px; font-size: 30px; border-radius: 16px; }
.avatar.xxl { width: 112px; height: 112px; font-size: 46px; border-radius: 25px; }
/* Image icons sit on a white tile (dark glyph favicons stay visible in dark
   mode, like app icons do) with a hairline edge drawn above the image. */
.avatar.img { background: #fff; box-shadow: none; }
.avatar.img img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.avatar.img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); pointer-events: none; }
@media (prefers-color-scheme: dark) {
  .avatar.img::after { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14); }
}
.avatar-edit { position: relative; padding: 0; border: 0; background: none; border-radius: 16px; cursor: pointer; display: inline-flex; }
.avatar-edit:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; }
.avatar-edit-badge {
  position: absolute; right: -5px; bottom: -5px; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); color: var(--text-2); box-shadow: 0 0 0 0.5px var(--sep-strong), 0 1px 3px rgba(0, 0, 0, 0.15);
  opacity: 0.85; transition: opacity 0.15s, transform 0.15s;
}
.avatar-edit-badge .icon { width: 13px; height: 13px; }
.avatar-edit:hover .avatar-edit-badge { opacity: 1; transform: scale(1.06); color: var(--accent); }
.icon-sheet { max-width: 420px; margin: 0 auto; }
.icon-preview { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 8px 0 4px; }
.icon-preview > .avatar { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.icon-preview-sizes { display: flex; align-items: flex-end; gap: 14px; }
.icon-source { text-align: center; font-weight: 600; margin-top: 10px; }
.avatar.pair { background: var(--fill-2); color: var(--text-2); }
.avatar.pair .icon { width: 55%; height: 55%; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gray); border: 2px solid var(--bg); }
.presence.on { background: var(--green); }

/* ------------------------------------------------------------------- app */

#root { height: 100vh; }
#root.booting { display: grid; place-items: center; }
.app {
  display: grid; height: 100vh;
  grid-template-columns: 228px minmax(380px, 1fr) minmax(400px, 460px);
}
.app.view-settings { grid-template-columns: 228px 1fr; }

.sidebar {
  display: flex; flex-direction: column; min-height: 0; padding: 18px 10px 12px;
  background: var(--sidebar);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border-right: 0.5px solid var(--sep-strong);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-2); }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; text-align: left; font-size: 13.5px; color: var(--text);
}
.nav-item .icon { width: 18px; height: 18px; color: var(--accent); }
.nav-item:hover { background: var(--fill); }
.nav-item.active { background: var(--fill-2); font-weight: 600; }
.nav-label { flex: 1; }
.nav-badge { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.nav-badge.alert { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side-spacer { flex: 1; }
.side-footer { display: flex; align-items: center; gap: 8px; padding: 8px 10px 2px; font-size: 11.5px; color: var(--text-2); }
.side-footer > span:nth-child(2) { flex: 1; }

.content {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg);
}
.content.full, .content.wide { grid-column: 2 / -1; }
.pane-header {
  display: flex; align-items: flex-end; gap: 12px; padding: 26px 28px 14px; flex: none;
}
.pane-titles { flex: 1; min-width: 0; }
.pane-titles h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.pane-sub { color: var(--text-2); margin-top: 3px; font-size: 13px; }
.welcome > p, .empty p, .detail-empty p, .confirm p, .thread-empty, .sheet-head p, .form-hint, .set-extra, .about-text, .callout p, .live-text span { text-wrap: pretty; }
.welcome > p, .empty p, .empty h2, .welcome h1 { text-wrap: balance; }
.pane-actions { display: flex; align-items: center; gap: 10px; }
.pane-scroll { flex: 1; overflow-y: auto; padding: 0 20px 40px; min-height: 0; }

/* ---------------------------------------------------------------- detail */

.detail {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg);
  border-left: 0.5px solid var(--sep-strong);
}
.detail.overlay {
  position: fixed; right: 0; top: 0; bottom: 0; width: 460px; z-index: 20; box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform 0.22s ease; border-left: 0;
}
.detail.overlay:not(.open) { visibility: hidden; box-shadow: none; }
.detail.overlay.open { transform: none; }
.detail-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); padding: 40px; text-align: center; }
.detail-empty .icon { width: 44px; height: 44px; }
.detail-empty .icon svg { stroke-width: 1.2; }
.detail-empty p { font-size: 14px; color: var(--text-2); }
.detail-loading { flex: 1; display: grid; place-items: center; }
.detail-scroll { flex: 1; overflow-y: auto; padding: 18px 26px 28px; min-height: 0; }
.detail-topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-title { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; word-break: break-word; }
.detail-sub { color: var(--text-2); margin-top: 4px; }
.detail-h { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; margin: 22px 0 6px; }
.prose { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.prose.quote { padding: 2px 0 2px 12px; border-left: 3px solid var(--stage, var(--sep-strong)); margin: 4px 0 10px; }
.id-line { margin-top: 28px; font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.detail-actions {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 0.5px solid var(--sep); flex: none; flex-wrap: wrap;
  background: color-mix(in srgb, var(--bg) 92%, var(--bg-2));
}
.inline-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.detail-actions .select { min-width: 120px; max-width: 170px; text-overflow: ellipsis; }

.facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 18px 0 0; padding: 14px 16px;
  background: var(--bg-2); border-radius: var(--radius); font-size: 13px;
}
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; min-width: 0; word-break: break-word; display: flex; align-items: center; }
.facts.compact { background: transparent; padding: 4px 0; margin: 8px 0 4px; gap: 6px 14px; }

.callout {
  margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2);
  border: 0.5px solid var(--sep);
}
.callout-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.callout-head .icon { width: 18px; height: 18px; }
.callout p { margin-top: 8px; }
.callout .field { margin-top: 10px; }
.callout-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.callout.review { --stage: var(--purple); background: var(--purple-soft); border-color: transparent; }
.callout.review .callout-head .icon { color: var(--purple); }
.callout.warn { background: var(--orange-soft); border-color: transparent; }
.callout.warn .callout-head .icon { color: var(--orange); }
.callout.done { background: var(--green-soft); border-color: transparent; }
.callout.done .callout-head .icon { color: var(--green); }
.callout.info .callout-head .icon { color: var(--accent); }
.callout.approve { background: var(--accent-soft); border-color: transparent; }
.callout.approve .callout-head .icon { color: var(--accent); }

/* Gantt: readable evidence rows that stack cleanly on narrow screens. */
.gantt { margin-top: 18px; padding: 16px; border: 1px solid var(--sep); border-radius: 12px; background: var(--bg-2); overflow: hidden; }
.gantt-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.gantt-body { display: grid; grid-template-columns: minmax(150px, 0.8fr) minmax(0, 2fr); gap: 12px; min-width: 0; }
.gantt-labels { display: grid; grid-auto-rows: 40px; min-width: 0; }
.gantt-label { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 1px; }
.gantt-svg { width: 100%; min-width: 0; height: auto; background: var(--control); border-radius: 8px; }
.gantt-grid { stroke: var(--sep); stroke-width: 1; }
.gantt-bar { fill: var(--accent); opacity: .8; }
@media (max-width: 680px) {
  .gantt-body { grid-template-columns: 1fr; }
  .gantt-svg { min-height: 90px; }
}
.artifacts { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.artifact { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--bg); border-radius: 8px; font-size: 12.5px; }
.artifact .icon { color: var(--text-2); }

.mini-list { display: flex; flex-direction: column; background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: transparent; text-align: left; }
.mini-row + .mini-row { box-shadow: inset 0 0.5px 0 var(--sep); }
.mini-row:hover { background: var(--fill); }

.timeline { list-style: none; padding: 0; margin: 4px 0 0; position: relative; }
.timeline li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 4.5px; top: 14px; bottom: 0; width: 1px; background: var(--sep-strong); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--stage); flex: none; box-shadow: 0 0 0 3px var(--bg); }
.tl-body { flex: 1; min-width: 0; font-size: 13px; }
.tl-quote { margin-top: 3px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.tl-time { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* --------------------------------------------------------------- groups */

.group { margin-top: 18px; }
.group:first-child { margin-top: 4px; }
.group-title {
  display: flex; align-items: baseline; gap: 8px; padding: 0 8px 6px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
}
.stage-group .group-title { color: var(--stage); }
.group-count { font-size: 12.5px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.group-hint { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-3); }
.group-body { display: flex; flex-direction: column; }
.group.inset .group-body { background: var(--bg); border-radius: 12px; box-shadow: 0 0 0 0.5px var(--sep-strong); overflow: hidden; }
.group.inset .group-title { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 12px 7px; }

.disclosure {
  display: flex; align-items: center; gap: 6px; margin: 18px 0 0; padding: 6px 8px; border: 0; background: transparent;
  color: var(--text-2); font-size: 12.5px; border-radius: 6px;
}
.disclosure:hover { color: var(--text); background: var(--fill); }
.disclosure .icon { width: 13px; height: 13px; }

/* ----------------------------------------------------------------- tasks */

.task-row, .agent-row, .thread-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 10px; border: 0; border-radius: 9px;
  background: transparent; text-align: left; position: relative;
}
.task-row::after, .agent-row::after, .thread-row::after {
  content: ""; position: absolute; left: 44px; right: 10px; bottom: 0; height: 0.5px; background: var(--sep);
}
.agent-row::after, .thread-row::after { left: 56px; }
.group-body > :last-child::after, .thread-list > :last-child::after { display: none; }
.task-row:hover, .agent-row:hover, .thread-row:hover { background: var(--fill); }
.task-row.selected, .agent-row.selected, .thread-row.selected { background: var(--accent-soft); }
.task-row.selected::after, .agent-row.selected::after, .thread-row.selected::after,
.task-row:has(+ .selected)::after, .agent-row:has(+ .selected)::after, .thread-row:has(+ .selected)::after { opacity: 0; }

.status-ring {
  width: 20px; height: 20px; margin-top: 0.5px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1.6px solid var(--stage); color: #fff;
}
.status-ring.stage-in_progress { background: conic-gradient(var(--stage) 0 25%, transparent 25%); border-width: 1.6px; }
.status-ring.stage-in_review { box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 10px var(--stage); }
.status-ring.stage-blocked { border-style: dashed; }
.status-ring.stage-done { background: var(--stage); }
.status-ring.stage-done .icon { width: 12px; height: 12px; }
.status-ring.stage-done .icon svg { stroke-width: 3; }
.status-ring.stage-cancelled { opacity: 0.5; }
.status-ring.small { width: 14px; height: 14px; border-width: 1.4px; }
.status-ring.small.stage-in_review { box-shadow: inset 0 0 0 2px var(--bg-2), inset 0 0 0 7px var(--stage); }

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 14px; line-height: 1.35; word-break: break-word; }
.row-title.struck { text-decoration: line-through; color: var(--text-2); }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; font-size: 12px; color: var(--text-2); }
.row-meta .sep { color: var(--text-3); }
.meta-agent { display: inline-flex; align-items: center; gap: 5px; }
.meta-pool { color: var(--teal); }
.row-note { font-size: 12px; margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-note.warn { color: var(--orange); }
.prio { color: var(--orange); font-weight: 800; font-size: 15px; padding: 0 4px; }
.row-progress { display: flex; align-items: center; gap: 8px; margin-top: 5px; max-width: 260px; }
.progress { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; display: block; min-width: 80px; }
.progress-fill { --p: 0%; display: block; height: 100%; width: var(--p); background: var(--accent); border-radius: 2px; }
.progress-label { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.facts .row-progress { margin: 0; width: 100%; }

.banner {
  display: flex; align-items: center; gap: 12px; margin: 0 8px 18px; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); border: 0.5px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.banner-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.banner-text strong { font-size: 13.5px; font-weight: 600; }
.banner-text span { font-size: 12px; color: var(--text-2); }

/* board */
.board { display: flex; gap: 14px; align-items: flex-start; padding: 2px 8px 10px; overflow-x: auto; min-height: 100%; }
.column { flex: 1 1 0; min-width: 172px; background: var(--bg-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.column-head { display: flex; align-items: center; gap: 7px; font-weight: 600; padding: 2px 4px 4px; font-size: 13px; }
.column-head .group-count { margin-left: auto; }
.column-body { display: flex; flex-direction: column; gap: 8px; }
.column-empty { color: var(--text-3); text-align: center; padding: 14px 0; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 0; border-radius: 9px; text-align: left;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-md); }
.card.selected { box-shadow: 0 0 0 2px var(--accent); }
.card-title { font-size: 13.5px; font-weight: 500; line-height: 1.35; word-break: break-word; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.card-meta > :first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-meta .meta-agent { display: flex; }
.ellip { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-meta > :last-child { flex: none; white-space: nowrap; }
.card-title, .row-title, .detail-title, .type-name { text-wrap: pretty; }

/* welcome / empty */
.welcome { max-width: 560px; margin: 0 auto; padding: 9vh 32px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.welcome h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 22px; }
.welcome > p { color: var(--text-2); font-size: 15px; line-height: 1.6; margin-top: 10px; max-width: 470px; }
.welcome-steps { list-style: none; padding: 0; margin: 30px 0 30px; width: 100%; text-align: left;
  background: var(--bg-2); border-radius: 14px; }
.welcome-steps li { display: flex; gap: 14px; padding: 15px 18px; align-items: flex-start; }
.welcome-steps li + li { box-shadow: inset 0 0.5px 0 var(--sep); }
.welcome-steps strong { display: block; font-size: 14px; font-weight: 600; }
.welcome-steps span:not(.num) { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.num { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.welcome .content.full { background: var(--bg); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12vh 32px 40px; max-width: 460px; margin: 0 auto; }
.empty-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--fill); color: var(--text-2); display: grid; place-items: center; margin-bottom: 18px; }
.empty-icon .icon { width: 32px; height: 32px; }
.empty-icon .icon svg { stroke-width: 1.4; }
.empty h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.empty p { color: var(--text-2); font-size: 13.5px; margin-top: 8px; line-height: 1.6; }
.empty-actions { display: flex; gap: 10px; margin-top: 20px; }
.boot-error { display: grid; place-items: center; }

/* ---------------------------------------------------------------- agents */

.agent-row { align-items: center; }
.agent-row .chev { color: var(--text-3); display: inline-flex; }
.agent-row .chev .icon { width: 14px; height: 14px; }
.agent-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 0 4px; }
.agent-hero h2 { font-size: 21px; font-weight: 700; margin-top: 10px; letter-spacing: -0.015em; }
.agent-hero .pill { margin-top: 6px; }

/* -------------------------------------------------------------- messages */

.thread-list { display: flex; flex-direction: column; padding-top: 2px; }
.thread-row { align-items: center; }
.thread-top { display: flex; align-items: baseline; gap: 8px; }
.thread-top .row-title { flex: 1; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-time { font-size: 12px; color: var(--text-2); flex: none; }
.thread-preview { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.thread-pane { background: var(--bg); }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 0.5px solid var(--sep); flex: none;
  background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.thread-name { font-weight: 600; font-size: 14px; }
.thread-scroll { flex: 1; overflow-y: auto; padding: 14px 18px 18px; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.thread-empty { margin: auto; color: var(--text-2); text-align: center; max-width: 260px; }
.day-sep { align-self: center; font-size: 11.5px; color: var(--text-3); font-weight: 500; margin: 12px 0 6px; }
.sys-line { align-self: center; display: flex; align-items: baseline; gap: 6px; max-width: 86%; text-align: center; font-size: 11.5px; color: var(--text-2); margin: 4px 0; }
.sys-time { color: var(--text-3); flex: none; }
.bubble-row { display: flex; margin: 2px 0; }
.bubble-row.out { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 7px 12px 6px; border-radius: 17px; background: var(--bubble-in); font-size: 13.5px; line-height: 1.45;
}
.bubble.out { background: var(--accent); color: #fff; }
.bubble-from { font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-meta { font-size: 10.5px; opacity: 0.6; margin-top: 2px; text-align: right; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 14px; border-top: 0.5px solid var(--sep); flex: none; }
.composer.readonly { justify-content: center; padding: 12px; }
.composer-input {
  flex: 1; resize: none; border: 0; outline: none; padding: 7px 14px; border-radius: 17px; min-height: 34px; max-height: 140px;
  background: var(--bg); box-shadow: 0 0 0 0.5px var(--sep-strong); line-height: 1.45;
}
.composer-input:focus { box-shadow: 0 0 0 1px var(--accent); }
.send-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-bottom: 1px; }
.send-btn .icon { width: 16px; height: 16px; }
.send-btn .icon svg { stroke-width: 2.2; }

/* -------------------------------------------------------------- settings */

.settings-wrap { background: var(--bg-2); }
.settings-wrap .pane-scroll { padding: 0 32px 60px; }
.settings { max-width: 680px; margin: 0 auto; padding-top: 30px; }
.settings-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0 4px 22px; }
.settings .group { margin-top: 22px; }
.set-row { display: grid; grid-template-columns: 150px 1fr; gap: 4px 16px; padding: 12px 16px; align-items: center; }
.set-row + .set-row { box-shadow: inset 0 0.5px 0 var(--sep); }
.set-label { font-size: 13px; }
.set-value { min-width: 0; display: flex; align-items: center; justify-content: flex-end; text-align: right; color: var(--text-2); }
.set-extra { grid-column: 1 / -1; font-size: 12px; color: var(--text-2); line-height: 1.55; }
.set-extra code, .about-text code { font-size: 11.5px; background: var(--fill); padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.code-value { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.code-value code { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.status-inline { display: inline-flex; align-items: center; gap: 7px; }
.status-inline .icon { width: 15px; height: 15px; }
.about { display: flex; gap: 16px; padding: 16px; align-items: flex-start; }
.about-name { font-size: 16px; font-weight: 700; }
.about-text { margin-top: 8px; color: var(--text-2); font-size: 12.5px; line-height: 1.6; }

/* ---------------------------------------------------------------- sheets */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 24px 24px;
  background: rgba(0, 0, 0, 0); transition: background-color 0.2s ease; overflow-y: auto;
}
.sheet-backdrop.open { background: rgba(0, 0, 0, 0.26); }
.sheet {
  width: 440px; max-width: 100%; background: var(--bg); border-radius: 14px; box-shadow: var(--shadow-lg);
  transform: translateY(-12px) scale(0.985); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
}
.sheet.wide { width: 720px; }
.sheet { max-height: calc(100vh - 4vh - 24px); display: flex; flex-direction: column; overflow: hidden; }
.sheet > .sheet-body, .sheet > form.sheet-body { overflow-y: auto; }
.sheet-split { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.sheet-split > .sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.sheet-foot { flex: none; padding: 0 26px 18px; border-top: 0.5px solid var(--sep); background: var(--bg); }
.sheet-foot .live { margin-top: 14px; }
.sheet-foot .sheet-actions { margin-top: 14px; }
.sheet-backdrop.open .sheet { transform: none; opacity: 1; }
.sheet-body { padding: 24px 26px 20px; }
.sheet-head { margin-bottom: 18px; }
.sheet-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.sheet-head p { margin-top: 4px; }
.sheet-head.with-icon { display: flex; gap: 14px; align-items: center; }
.sheet-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.confirm { text-align: center; display: flex; flex-direction: column; align-items: center; }
.confirm h2 { font-size: 16px; font-weight: 700; margin-top: 12px; }
.confirm p { margin-top: 6px; word-break: break-word; }
.confirm .sheet-actions { width: 100%; }
.confirm .sheet-actions .btn { flex: 1; }
.confirm-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.confirm-icon.danger { background: var(--red-soft); color: var(--red); }
.confirm-icon .icon { width: 26px; height: 26px; }

.form-label { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; font-weight: 600; margin: 16px 0 6px; color: var(--text); }
.form-label:first-of-type { margin-top: 0; }
.optional { font-weight: 400; color: var(--text-3); }
.form-hint { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }
.form-hint.center { text-align: center; margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 8px; border-radius: 15px; border: 0;
  background: var(--fill); font-size: 13px;
}
.chip:hover { background: var(--fill-2); }
.chip.on { background: var(--accent); color: #fff; }
.chip-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }
.chip-icon .icon { width: 15px; height: 15px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.mandate-form { display: grid; gap: 8px; }
.mandate-form .form-label { margin: 4px 0 0; }
.mandate-form .callout-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 0; }
.pick-list { display: flex; flex-direction: column; background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: transparent; text-align: left; font-size: 13.5px; }
.pick-row + .pick-row { box-shadow: inset 0 0.5px 0 var(--sep); }
.pick-row .icon { color: var(--accent); }
.pick-row:hover { background: var(--fill); }

/* wizard */
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.type-card { min-width: 0; }
.type-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px 14px; border-radius: 12px; border: 0;
  background: var(--bg-2); text-align: center; transition: background-color 0.12s, box-shadow 0.12s;
}
.type-card:hover { background: var(--accent-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.type-card .avatar { margin-bottom: 6px; }
.type-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.type-hint { font-size: 11.5px; color: var(--text-2); text-wrap: balance; }
.token-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2);
}
.token-row > .icon { width: 18px; height: 18px; color: var(--orange); }
.token-label { font-size: 11.5px; color: var(--text-2); }
.token-value { font-size: 12.5px; word-break: break-all; }
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 12px; }
.steps .num { margin-top: 0; }
.step-body { flex: 1; min-width: 0; }
.step-body > p { font-size: 13.5px; line-height: 1.55; padding-top: 2px; }
.code-block { position: relative; margin-top: 8px; border-radius: 9px; background: var(--code-bg); box-shadow: inset 0 0 0 0.5px var(--sep); }
.code-block pre { margin: 0; padding: 10px 84px 10px 12px; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: auto; }
.code-block.prompt pre { font-family: var(--font); font-size: 13px; word-break: normal; overflow-wrap: anywhere; }
.copy-btn {
  position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border: 0; border-radius: 6px; font-size: 12px; background: var(--control); box-shadow: 0 0 0 0.5px var(--control-border), var(--shadow-sm); color: var(--text);
}
.copy-btn .icon { width: 13px; height: 13px; }
.copy-btn:hover { color: var(--accent-text); }
.brief { margin-top: 18px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); }
.brief summary { cursor: default; font-size: 13px; font-weight: 500; color: var(--accent-text); list-style-position: inside; }
.brief p { margin-top: 8px; }
.brief .code-block { background: var(--bg); }
.live {
  display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 16px 18px; border-radius: 12px;
  background: var(--bg-2); border: 0.5px solid var(--sep);
}
.live.ready { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.live.done { background: var(--green-soft); border-color: transparent; }
.live-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-text strong { font-size: 14px; font-weight: 600; }
.live-text span { font-size: 12.5px; color: var(--text-2); }
.live-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); flex: none; }
.live-icon.ok { background: var(--green); color: #fff; }
.live-icon.accent { background: var(--accent); color: #fff; }
.live-icon .icon { width: 18px; height: 18px; }
.live-icon .icon svg { stroke-width: 2.3; }

.spinner {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--fill-2); border-top-color: var(--accent); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- login */

.login-screen { display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 380px; max-width: 100%; padding: 34px 30px 28px; border-radius: 16px; background: var(--bg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
}
.login-card h1 { font-size: 20px; font-weight: 700; margin-top: 6px; }
.login-card p { font-size: 13px; line-height: 1.55; }
.login-card .field, .login-card .btn { width: 100%; }
.inline-cmd { font-size: 12px; background: var(--fill); padding: 4px 9px; border-radius: 6px; user-select: all; }
.login-error { color: var(--red); font-size: 12.5px; min-height: 1em; }

/* ----------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translate(-50%, 12px); opacity: 0;
  max-width: 480px; padding: 9px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
  background: color-mix(in srgb, var(--text) 88%, transparent); color: var(--bg); box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); color: #fff; }

/* -------------------------------------------------------------- projects */

.app.view-projects { grid-template-columns: 228px 300px minmax(420px, 1fr) 340px; }
.app.view-projects.no-info { grid-template-columns: 228px 300px minmax(420px, 1fr); }
.app.view-projects.no-projects { grid-template-columns: 228px 1fr; }
.app.view-projects .content.chat { background: var(--bg); }
.app.view-projects .detail { border-left: 0.5px solid var(--sep-strong); }

.proj-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); border-right: 0.5px solid var(--sep-strong); }
.proj-side-head { display: flex; align-items: center; gap: 8px; padding: 22px 14px 10px 18px; flex: none; }
.proj-side-head h1 { flex: 1; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.proj-side-head .icon-btn.accent { color: var(--accent); }
.proj-side .pane-scroll { padding: 0 8px 24px; }
.proj-list { display: flex; flex-direction: column; gap: 2px; }
.proj-row {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; text-align: left;
}
.proj-row:hover { background: var(--fill); }
.proj-row.selected { background: var(--accent-soft); }
.proj-row.archived { opacity: 0.62; }
.proj-row .row-main { gap: 1px; }
.thread-preview.one { -webkit-line-clamp: 1; }
.proj-row-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 0; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.avatar.proj { border-radius: 10px; }
.avatar.proj.sm { border-radius: 8px; }
.avatar.proj.lg { border-radius: 13px; }
.avatar-stack { display: inline-flex; align-items: center; flex: none; }
.avatar-stack .avatar { box-shadow: 0 0 0 1.5px var(--bg-2); }
.avatar-stack .avatar + .avatar { margin-left: -4px; }
.proj-row.selected .avatar-stack .avatar { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 10%, var(--bg-2)); }
.stack-more { font-size: 10.5px; color: var(--text-3); margin-left: 3px; }
.count-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fill-2); color: var(--text-2);
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; font-variant-numeric: tabular-nums;
}
.count-badge.mention { background: var(--red); color: #fff; }
.pill.state-paused { background: var(--orange-soft); color: var(--orange); }
.pill.state-archived { background: var(--gray-soft); color: var(--text-2); }
.thread-name .pill { margin-left: 8px; vertical-align: 1px; }
.role-tag { font-size: 10.5px; font-weight: 600; color: var(--orange); background: var(--orange-soft); padding: 1px 6px; border-radius: 6px; flex: none; }

.proj-head { padding: 12px 14px 12px 20px; }
.proj-scroll { padding: 10px 20px 20px; gap: 2px; }
.msg-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 8px; max-width: 86%; }
.msg-row.grouped { margin-top: 2px; }
.msg-avatar-gap { width: 26px; flex: none; }
.msg-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg-col .bubble { max-width: 100%; }
.msg-from { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin: 0 0 3px 4px; }
.bubble-row.out { margin-top: 8px; }
.bubble-row.out.grouped { margin-top: 2px; }
.bubble.to-me { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--orange) 70%, transparent); background: color-mix(in srgb, var(--orange) 9%, var(--bubble-in)); }
.mention { color: var(--accent-text); font-weight: 600; }
.mention.me { color: var(--orange); background: var(--orange-soft); border-radius: 4px; padding: 0 2px; }
.bubble.out .mention { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.5); text-underline-offset: 2px; }
.bubble.out .mention.me { background: rgba(255, 255, 255, 0.2); text-decoration: none; }
.caption-wrap { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0; max-width: 88%; }
.task-caption {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: var(--fill); color: var(--text-2);
  font-size: 12px; line-height: 1.4; padding: 4px 11px 4px 8px; border-radius: 14px; text-align: left;
}
.task-caption:hover { background: var(--fill-2); color: var(--text); }
.task-caption .status-ring.small.stage-in_review { box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 7px var(--stage); }
.caption-quote { font-size: 12px; color: var(--text-2); padding: 1px 0 1px 10px; border-left: 2.5px solid var(--sep-strong); max-width: 520px; white-space: pre-wrap; word-break: break-word; }
.caption-quote.warn { border-left-color: var(--orange); }
.result-card { width: min(520px, 100%); background: var(--bg); border-radius: 12px; padding: 10px 12px; box-shadow: 0 0 0 0.5px var(--sep-strong), var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.result-card .prose { font-size: 13px; }
.result-card .artifact { background: var(--bg-2); }
.result-actions { display: flex; justify-content: flex-end; }
.sys-line.alert { color: var(--orange); font-weight: 500; }

.proj-onboard { margin: auto; max-width: 400px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 12px; }
.onboard-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 4px; }
.onboard-icon .icon { width: 28px; height: 28px; }
.proj-onboard h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.proj-onboard p { color: var(--text-2); font-size: 13px; line-height: 1.6; text-wrap: pretty; }
.onboard-steps { text-align: left; color: var(--text-2); font-size: 12.5px; line-height: 1.7; margin: 4px 0 8px; padding-left: 20px; }

.proj-notice { display: flex; align-items: center; gap: 8px; padding: 7px 18px; font-size: 12px; color: var(--orange); background: var(--orange-soft); flex: none; }
.proj-composer { position: relative; align-items: flex-end; }
.composer-tool { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; flex: none; margin-bottom: 1px; }
.composer-tool:hover { background: var(--fill); color: var(--accent); }
.composer-tool .icon { width: 19px; height: 19px; }
.composer-task { height: 32px; margin-bottom: 1px; border-radius: 16px; }
.mention-pop {
  position: absolute; left: 52px; bottom: calc(100% - 6px); width: 280px; max-height: 260px; overflow-y: auto; z-index: 10;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; display: flex; flex-direction: column;
}
.mention-pop[hidden] { display: none; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; font-size: 13px; }
.mention-item .avatar.xs { width: 20px; height: 20px; font-size: 10px; }
.mention-item.on { background: var(--accent); color: #fff; }
.mention-item.on .mention-id, .mention-item.on .role-tag { color: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.18); }
.mention-id { font-size: 11px; color: var(--text-3); font-family: var(--mono); }

.sheet-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.sheet-icon .icon { width: 24px; height: 24px; }
.icon-btn.info-close { display: none; }
.proj-info .detail-scroll { padding: 18px 22px 24px; }
.proj-hero { display: flex; align-items: center; gap: 12px; }
.proj-hero h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; word-break: break-word; }
.prose.goal { font-size: 13px; color: var(--text); }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--accent-text); font-size: inherit; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--text-3); text-decoration: none; }
.lead-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-2); border-radius: var(--radius); }
.lead-name { font-weight: 600; font-size: 13.5px; }
.lead-change .select { min-width: 0; width: 104px; font-size: 12px; padding: 3px 22px 3px 8px; }
.detail-h.with-action { display: flex; align-items: center; justify-content: space-between; }
.detail-h.with-action .btn { text-transform: none; letter-spacing: 0; font-weight: 500; }
.member-row { padding: 7px 10px 7px 12px; }
.presence.small { width: 9px; height: 9px; }
.icon-btn.subtle { color: var(--text-3); }
.icon-btn.subtle:hover { color: var(--red); }
.stage-mini { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--stage); margin: 12px 0 5px 2px; }
.stage-mini .group-count { font-weight: 500; font-size: 12px; }
.meta-pool.small { font-size: 11.5px; }
.proj-info .detail-actions .btn.plain { color: var(--text-2); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .app { grid-template-columns: 200px minmax(320px, 1fr) minmax(340px, 400px); }
  .app.view-projects, .app.view-projects.no-info { grid-template-columns: 200px 250px minmax(360px, 1fr); }
  .icon-btn.info-close { display: inline-flex; }
  .app.view-projects .proj-info { position: fixed; right: 0; top: 0; bottom: 0; width: 340px; z-index: 20; box-shadow: var(--shadow-lg); border-left: 0; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 64px 1fr; }
  .brand > div, .nav-label, .side-footer > span:nth-child(2) { display: none; }
  .nav-item { justify-content: center; position: relative; }
  .nav-badge { position: absolute; top: 2px; right: 4px; }
  .content.full, .content.wide { grid-column: 2; }
  .detail { position: fixed; right: 0; top: 0; bottom: 0; width: min(440px, 100%); z-index: 20; box-shadow: var(--shadow-lg); }
  .detail:has(.detail-empty) { display: none; }
  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .app.view-projects, .app.view-projects.no-info { grid-template-columns: 64px 220px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
  .spinner { animation: none; border-top-color: var(--accent); }
}
.login-error:empty { display: none; }
.audit-row { grid-template-columns: 1fr auto; padding-top: 9px; padding-bottom: 9px; }
.audit-row .set-label { font-size: 12.5px; }

/* ------------------------------------------------------- billing & quota */
.bill-actions { display: inline-flex; gap: 2px; }
.bill-card { background: var(--bg-2); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.bill-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bill-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.plan { background: var(--accent-soft); color: var(--accent-text); }
.bill-mode { margin-bottom: 4px; }
.bill-empty { margin-top: 4px; }
.bill-links { display: flex; justify-content: flex-end; margin-top: 4px; }
.quota-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.quota-row { display: flex; flex-direction: column; gap: 5px; }
.quota-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.quota-name { font-weight: 500; }
.quota-bar { display: block; height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.quota-fill { --p: 0%; display: block; height: 100%; width: var(--p); border-radius: 3px; background: var(--green); transition: width 0.3s ease; }
.quota-bar.mid .quota-fill { background: var(--orange); }
.quota-bar.low .quota-fill { background: var(--red); }
.quota-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.quota-meta .sep { color: var(--text-3); }
.quota-left { color: var(--text); font-weight: 600; font-size: 12px; }
.quota-row.stale { opacity: 0.5; }
.quota-row.stale .quota-fill { background: var(--gray); }
.quota-age { color: var(--orange); }
.src-badge { font-size: 10.5px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: var(--gray-soft); color: var(--text-2); white-space: nowrap; }
.src-badge.src-self_reported { background: var(--purple-soft); color: var(--purple); }
.src-badge.src-local_probe { background: var(--teal-soft); color: var(--teal); }
.pick-row.on { background: var(--accent-soft); }
.pick-row .block { display: block; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid.three { grid-template-columns: 1fr 0.8fr 1.4fr; gap: 0 10px; }
.form-grid .form-label:first-of-type { margin-top: 16px; }
.form-sub { display: block; font-size: 11.5px; color: var(--text-2); margin: 0 0 4px; }
.form .segmented { display: flex; }
.form .segmented button { flex: 1; }
button.set-row.bill-set-row { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.set-row.bill-set-row:hover { background: var(--fill); }
.bill-set-row .set-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
@media (max-width: 560px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }
.form-grid .select { width: 100%; }
.set-row.bill-set-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }

/* ------------------------------------------------------------ connectors */
.app.view-connections.conn-wide { grid-template-columns: 228px 1fr; }
.conn-toolbar { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
.conn-filter { flex-wrap: wrap; }
.conn-paused { margin: 0 8px 16px; }
.conn-tile { flex: none; display: grid; place-items: center; color: #fff; border-radius: 9px; background: var(--text-3); }
.conn-tile.sm { width: 26px; height: 26px; border-radius: 7px; }
.conn-tile.sm .icon { width: 15px; height: 15px; }
.conn-tile.md { width: 36px; height: 36px; }
.conn-tile.md .icon { width: 20px; height: 20px; }
.conn-tile.lg { width: 52px; height: 52px; border-radius: 13px; }
.conn-tile.lg .icon { width: 28px; height: 28px; }
.conn-tile.tile-github { background: linear-gradient(180deg, #3a3f46, #24292f); }
.conn-tile.tile-feishu { background: linear-gradient(180deg, #4d8cff, #2f6bf0); }
.conn-row { width: 100%; border: 0; background: transparent; text-align: left; }
.conn-row .muted { font-weight: 400; }
.pill.conn-ok { background: var(--green-soft); color: var(--green); }
.pill.conn-warn { background: var(--orange-soft); color: var(--orange); }
.conn-soon { padding: 10px 12px 0; }
.conn-explainer { margin: 18px 8px 0; }
.conn-hero { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; }
.conn-hero .grow { flex: 1; min-width: 0; }
.conn-enable { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.conn-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.conn-note { margin-top: 8px; }
.conn-grant { width: 100%; }
.pill.conn-level-write { background: var(--accent-soft); color: var(--accent-text); }
.conn-tool .tool-name { font-size: 12.5px; }
.conn-tool.off .row-main { opacity: 0.55; }
.conn-tool .check { white-space: nowrap; color: var(--text-2); }
.conn-tool .check.locked { color: var(--orange); }
.conn-caps { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.conn-agent { display: flex; align-items: center; gap: 8px; }
.warn-text { color: var(--orange); }
.grow { flex: 1; min-width: 0; }

.switch { position: relative; flex: none; width: 38px; height: 22px; border: 0; padding: 0; border-radius: 11px;
  background: var(--fill-strong, rgba(120, 120, 128, 0.28)); transition: background 0.18s; }
.switch .switch-knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.18s; }
.switch.on { background: var(--green); }
.switch.on .switch-knob { transform: translateX(16px); }
.switch:disabled { opacity: 0.45; }
.switch:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }

.wiz { margin-top: 18px; }
.wiz-step .step-body > strong { display: block; font-size: 14px; margin-top: 2px; }
.wiz-step .step-body > p { margin-top: 4px; }
.wiz-step.done .num { background: var(--green); }
.wiz-step .num .icon { width: 14px; height: 14px; }
.wiz-step .inline-field { margin-top: 8px; }
.wiz-step .inline-field .field { flex: 1; }
.perm-list { margin: 6px 0 8px; padding-left: 18px; color: var(--text-2); line-height: 1.6; }
.wiz-step .link-btn { display: inline-block; margin-top: 2px; text-decoration: none; }

.appr-list { display: flex; flex-direction: column; gap: 14px; padding: 0 8px; max-width: 860px; }
.appr-card { background: var(--bg-2); border-radius: 14px; padding: 16px 18px; box-shadow: inset 0 0 0 0.5px var(--sep); }
.appr-head { display: flex; align-items: center; gap: 12px; }
.appr-title { font-size: 14px; line-height: 1.4; }
.appr-title code { font-size: 12.5px; padding: 1px 6px; border-radius: 5px; background: var(--fill); }
.appr-args pre { padding-right: 12px; max-height: 260px; }
.appr-card .form-label { margin-top: 6px; }
.appr-note { margin-top: 8px; }
.appr-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.conn-log { padding: 0 8px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.log-row + .log-row { box-shadow: inset 0 0.5px 0 var(--sep); }
.log-row code { font-size: 12.5px; }
.log-status.ok { color: var(--green); }
.log-status.error { color: var(--red); }
.log-time { min-width: 70px; text-align: right; }
.pill.dec-allowed, .pill.dec-approved { background: var(--green-soft); color: var(--green); }
.pill.dec-pending { background: var(--accent-soft); color: var(--accent-text); }
.pill.dec-denied, .pill.dec-rejected { background: var(--red-soft); color: var(--red); }
.pill.dec-expired { background: var(--fill); color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .switch, .switch .switch-knob { transition: none; } }
.conn-log .conn-toolbar { padding-left: 0; }
.fs-choice { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); }
.fs-choice summary { cursor: default; color: var(--accent-text); }
.fs-choice .inline-field { margin-top: 6px; }
.fs-choice .select { min-width: 220px; }
.ident-block { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ident-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13px; }
.scope-list summary { cursor: default; font-size: 12px; color: var(--accent-text); }
.scope-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.scope-chips code { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--fill); }
.ident-note { flex-basis: 100%; }

/* ---------------------------------------------------- connector browse */
.app.conn-browse { grid-template-columns: 228px minmax(380px, 1fr) minmax(440px, 520px); }
.cb-entry {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 12px 14px;
  border: 0; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); text-align: left; cursor: pointer;
}
.cb-entry:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cb-entry:disabled { opacity: 0.5; cursor: default; }
.cb-entry > .icon { color: var(--text-3); width: 14px; height: 14px; }
.cb-entry-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; flex: none; }
.cb-entry-icon .icon { width: 17px; height: 17px; }
.cb-entry .row-title { font-weight: 600; }
.cb-header { flex-wrap: wrap; row-gap: 6px; }
.cb-back { flex-basis: 100%; justify-content: flex-start; margin-left: -8px; color: var(--accent-text); }
.cb-back .icon { width: 14px; height: 14px; }
.cb-titles { display: flex; align-items: center; gap: 12px; }
.cb-titles h1 { font-size: 22px; }
.cb-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cb-search { flex: 1; min-width: 160px; max-width: 360px; }
.cb-fresh { margin-left: auto; white-space: nowrap; }
.cb-row { width: 100%; border: 0; text-align: left; gap: 12px; }
a.cb-row, a.cb-row:hover { color: inherit; text-decoration: none; }
.cb-row[hidden] { display: none; }
.cb-row .row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.cb-row .row-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-repo-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--fill); color: var(--text-2); flex: none; }
.cb-repo-icon .icon { width: 16px; height: 16px; }
.cb-repo-icon.chat { background: color-mix(in srgb, #3370ff 14%, transparent); color: #3370ff; }
.cb-repo-icon.lg { width: 44px; height: 44px; border-radius: 11px; }
.cb-repo-icon.lg .icon { width: 22px; height: 22px; }
.cb-chips { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.cb-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cb-chip .icon { width: 12px; height: 12px; }
.cb-chip.warn { color: var(--orange); }
.cb-ci { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 7px; border-radius: 99px; background: var(--fill); color: var(--text-2); flex: none; }
.cb-ci-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray, #8e8e93); }
.cb-ci.ok { background: var(--green-soft); color: var(--green); }
.cb-ci.ok .cb-ci-dot { background: var(--green); }
.cb-ci.fail { background: var(--red-soft); color: var(--red); }
.cb-ci.fail .cb-ci-dot { background: var(--red); }
.cb-ci.running { background: var(--orange-soft); color: var(--orange); }
.cb-ci.running .cb-ci-dot { background: var(--orange); animation: cb-pulse 1.2s ease-in-out infinite; }
@keyframes cb-pulse { 50% { opacity: 0.35; } }
.cb-avatars { display: inline-flex; align-items: center; flex: none; }
.cb-avatars .avatar { box-shadow: 0 0 0 2px var(--bg); }
.cb-avatars .avatar + .avatar { margin-left: -4px; }
.cb-more { font-size: 11px; color: var(--text-3); margin-left: 4px; }
.pill.tiny { font-size: 10.5px; padding: 1px 6px; font-weight: 500; }
.cb-hero { align-items: flex-start; }
.cb-hero .detail-title { word-break: break-all; }
.cb-who .mini-list { margin-bottom: 8px; }
.cb-who-row .segmented { flex: none; }
.cb-who-row .segmented button { height: 24px; padding: 0 10px; font-size: 12px; }
.cb-remove { color: var(--text-3); }
.cb-remove:hover { color: var(--red); }
.cb-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-add .select { flex: 1; min-width: 120px; max-width: 220px; }
.cb-add .select:last-of-type { flex: none; min-width: 90px; }
.cb-link, .cb-hero a.btn { color: inherit; text-decoration: none; }
.cb-hero a.btn { flex: none; }
.cb-link .row-title { overflow-wrap: anywhere; }
.cb-num { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-3); min-width: 34px; flex: none; }
.cb-msgs { display: flex; flex-direction: column; gap: 8px; }
.cb-msg { padding: 9px 12px; border-radius: 12px; background: var(--bg-2); }
.cb-msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 3px; }
.cb-msg-body { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.cb-private { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; }
.cb-private .icon { width: 13px; height: 13px; }
.cb-foot { margin-top: 18px; line-height: 1.5; }
.cb-more-row { display: flex; justify-content: center; margin-top: 12px; }
.cb-note { margin-top: 14px; }
.cb-error { margin-top: 14px; }
.content.cb-wide { grid-column: 2 / -1; }
.content.cb-wide .pane-scroll { max-width: 900px; }

/* skeletons: first paint before upstream data arrives */
.skel { display: inline-block; border-radius: 6px; background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 37%, var(--fill) 63%); background-size: 400% 100%; animation: cb-shimmer 1.4s ease infinite; }
@keyframes cb-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skel, .cb-ci.running .cb-ci-dot { animation: none; } }
.cb-skel-list { display: flex; flex-direction: column; margin-top: 10px; }
.cb-skel-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.cb-skel-list.compact .cb-skel-row { padding: 7px 12px; }
.skel-tile { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.cb-skel-list.compact .skel-tile { width: 18px; height: 18px; border-radius: 5px; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skel-line { height: 11px; }
.skel-line.short { height: 9px; }
.skel-line.w0 { width: 62%; } .skel-line.w1 { width: 48%; } .skel-line.w2 { width: 74%; } .skel-line.w3 { width: 36%; }
.skel-line.short.w0 { width: 30%; } .skel-line.short.w1 { width: 42%; } .skel-line.short.w2 { width: 24%; } .skel-line.short.w3 { width: 36%; }
.skel-chip { width: 30px; height: 14px; border-radius: 99px; }

/* Members, runtimes and roles (docs/11) */
.role-tag.plain { color: var(--text-2); background: var(--fill-2); }
.member-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.member-desc { font-size: 11.5px; }
.role-pick {
  display: inline-flex; align-items: center; gap: 2px; flex: none; max-width: 120px;
  border: 0; border-radius: 6px; padding: 2px 4px 2px 7px; font: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--text-2); background: var(--fill-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-pick.lead { color: var(--orange); background: var(--orange-soft); }
.role-pick.empty { font-weight: 500; background: transparent; box-shadow: inset 0 0 0 1px var(--sep-strong); }
.role-pick:hover { filter: brightness(0.96); }
.role-pick .icon { width: 12px; height: 12px; opacity: 0.7; }
.stack-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.stack-node {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; border-radius: 9px;
  background: var(--fill); font-size: 12.5px; font-weight: 500; max-width: 100%;
}
.stack-node.none { color: var(--text-2); padding-left: 9px; }
.stack-node .label { font-size: 10.5px; color: var(--text-2); font-weight: 600; }
.stack-node button.link-btn { font-size: 12px; }
.stack-arrow { color: var(--text-2); font-size: 12px; }
.subagents { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.subagents .dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green, #34c759); }
.member-projects { display: flex; flex-wrap: wrap; gap: 6px; }
.member-proj { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; padding: 4px 8px; background: var(--fill); font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.member-proj:hover { background: var(--fill-2); }
.stack-node.label-only { background: transparent; padding: 0 0 0 2px; }
.type-card.on { background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent); }

/* ------------------------------------------------------------------ zima */

.dot.warn { background: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.zima-glyph {
  display: inline-grid; place-items: center; flex: none; border-radius: 9px; color: #fff;
  background: linear-gradient(145deg, #8e7cff, #5b5bd6);
}
.zima-glyph.sm { width: 22px; height: 22px; border-radius: 7px; }
.zima-glyph.sm .icon { width: 14px; height: 14px; }
.zima-glyph.md { width: 30px; height: 30px; }
.zima-glyph.md .icon { width: 18px; height: 18px; }
.zima-glyph.lg { width: 52px; height: 52px; border-radius: 15px; }
.zima-glyph.lg .icon { width: 30px; height: 30px; }
.zima-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(420px, 100vw);
  display: flex; flex-direction: column; background: var(--bg-2); box-shadow: var(--shadow-lg);
  border-left: 0.5px solid var(--sep-strong);
}
.zima-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 16px; border-bottom: 0.5px solid var(--sep); background: var(--bg); }
.zima-titles { flex: 1; min-width: 0; }
.zima-name { font-size: 15px; font-weight: 700; }
.zima-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin-top: 1px; }
.zima-sub .dot { width: 7px; height: 7px; box-shadow: none; }
.zima-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.zima-scroll .bubble { max-width: 88%; }
.bubble.zima-in { background: var(--bg); box-shadow: 0 0 0 0.5px var(--sep-strong); }
.zima-system { align-self: center; font-size: 11.5px; color: var(--text-3); margin: 6px 0; }
.zima-hello { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 18px 24px; }
.zima-hello h2 { font-size: 17px; font-weight: 700; }
.zima-hello p { color: var(--text-2); font-size: 13px; line-height: 1.55; text-wrap: pretty; word-break: break-word; }
.zima-section { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 14px 4px 2px; }
.zima-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.zima-tool { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-2); background: var(--fill); border-radius: 6px; padding: 1px 6px; font-family: var(--mono); }
.zima-tool .icon { width: 11px; height: 11px; }
.zima-tool.running { color: var(--accent-text); background: var(--accent-soft); }
.zima-typing { display: inline-flex; gap: 3px; padding: 4px 0 2px; }
.zima-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: zima-blink 1.2s infinite ease-in-out; }
.zima-typing span:nth-child(2) { animation-delay: 0.15s; }
.zima-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes zima-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .zima-typing span { animation: none; } }
.zima-proposal { margin: 6px 0 2px; }
.zima-proposal .callout-head .muted { margin-left: auto; }
.zima-summary { font-size: 13px; line-height: 1.5; word-break: break-word; }
.zima-actions { margin: 8px 0 0; padding-left: 20px; font-size: 12.5px; line-height: 1.5; }
.zima-actions li { margin-top: 3px; word-break: break-word; }
.zima-actions li.ok::marker { color: var(--green); }
.zima-actions li.bad { color: var(--red); }
.zima-action-note, .zima-action-err { display: block; font-size: 11.5px; color: var(--text-2); }
.zima-action-err { color: var(--red); }
.zima-decided { margin-top: 8px; font-size: 12px; color: var(--text-2); }
.zima-composer { background: var(--bg); }
.zima-input:disabled { opacity: 0.6; }
.zima-brief { margin: 4px 0 14px; padding: 14px 16px; border-radius: 12px; background: var(--bg); box-shadow: 0 0 0 0.5px var(--sep-strong); }
.zima-brief-head { display: flex; align-items: center; gap: 8px; }
.zima-brief-head strong { font-size: 14px; }
.zima-brief-head .muted { margin-left: auto; }
.zima-brief-body { margin-top: 8px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.zima-brief-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.zima-settings .set-value code { word-break: break-all; }
.zima-err { color: var(--red); }
.zima-note { display: block; margin-top: 6px; }
.zima-job { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.zima-bar { width: 100%; max-width: 360px; height: 6px; accent-color: var(--accent); }
.zima-joblog { margin: 0; padding: 8px 10px; max-height: 120px; overflow: auto; font: 11px/1.45 var(--mono, ui-monospace, monospace); white-space: pre-wrap; word-break: break-all; background: var(--fill, rgba(127,127,127,.08)); border-radius: 8px; color: var(--text-2); }
.zima-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zima-time { width: 120px; }
.zima-num { width: 130px; }
.zima-budget { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.zima-budget label { display: flex; flex-direction: column; gap: 3px; }
.zima-wizard { grid-column: 1 / -1; list-style: none; margin: 0; padding: 4px 16px 12px; }
.zima-wizard li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.zima-wizard li + li { box-shadow: inset 0 0.5px 0 var(--sep); }
.zima-wizard .num { background: var(--gray); }
.zima-wizard li.current .num { background: var(--accent); }
.zima-wizard li.done .num { background: var(--green); }
.zima-wizard .num .icon { width: 13px; height: 13px; }
.zima-step { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zima-step strong { font-size: 13.5px; }
.zima-step .code-value { margin-top: 4px; }
.zima-mem + .zima-mem { margin-top: 16px; }
.zima-mem-text { white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: 12px; background: var(--code-bg); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow-y: auto; }

/* Hermes terminal (Settings › Zima) */
.zima-model-help { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.zima-cmd { flex-basis: 100%; }
.zima-cmd summary { cursor: pointer; width: fit-content; }
.zima-cmd[open] summary { margin-bottom: 6px; }
.sheet-body.zt { display: flex; flex-direction: column; gap: 12px; }
.zt-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zt-bar .spacer { flex: 1; }
.zt-status { font-size: 13px; color: var(--text-2); gap: 8px; }
.zt-screen {
  height: min(460px, 56vh);
  padding: 10px 4px 10px 12px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 0.5px solid var(--sep-strong);
  box-shadow: inset 0 0.5px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.zt-screen .xterm { height: 100%; }
.zt-screen .xterm-viewport { border-radius: 6px; }
.zt-callout { margin: 0; }
@media (prefers-color-scheme: dark) {
  .zt-screen { background: #1c1c1e; border-color: rgba(255, 255, 255, 0.12); }
}

/* ---------------------------------------------------- AI-native (docs/13) */

.pill.bad, .pill.risk-high { background: var(--red-soft); color: var(--red); }
.pill.risk-medium { background: var(--orange-soft); color: var(--orange); }
.pill.risk-low { background: var(--green-soft); color: var(--green); }
.pill.small { height: 18px; font-size: 10.5px; padding: 0 6px; }

.zima-ack { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 12.5px; color: var(--red); font-weight: 500; }
.zima-noself { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12px; color: var(--text-2); }
.zima-noself svg { width: 13px; height: 13px; flex: none; }

/* home */
.owner-home-section { margin: 26px 0; }
.owner-home-section h2, .home-away-summary h2 { display: flex; gap: 10px; align-items: center; font-size: 19px; margin-bottom: 12px; }
.home-project-group { margin: 10px 0; border: 1px solid var(--sep); border-radius: 12px; padding: 12px; }
.home-project-group summary { cursor: pointer; font-weight: 600; padding: 4px; }
.home-project-group summary .pill { margin-left: 10px; }
.home-project-group .home-list { margin-top: 12px; }
.home-evidence { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.home-away-summary, .home-away-status { padding: 14px; border-radius: 12px; background: var(--accent-soft); }
.home-error { color: var(--red); }
.home .pane-scroll { padding: 0 28px 48px; }
.home-scroll > * { max-width: 860px; }
.approvals-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.home-meta { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; }
.home-loading { padding: 40px 0; text-align: center; }
.home-list { display: flex; flex-direction: column; gap: 10px; }
.home-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm), 0 0 0 0.5px var(--sep); }
.home-item.proposal { display: block; padding: 0; background: none; box-shadow: none; }
.home-item.urgent { box-shadow: var(--shadow-sm), 0 0 0 0.5px var(--sep), inset 3px 0 0 var(--red); }
.home-icon { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--fill); color: var(--text-2); }
.home-icon svg { width: 17px; height: 17px; }
.kind-approval .home-icon, .kind-member .home-icon { background: var(--accent-soft); color: var(--accent-text); }
.kind-review .home-icon { background: var(--purple-soft); color: var(--purple); }
.kind-blocked .home-icon, .kind-connector .home-icon, .kind-quota .home-icon { background: var(--orange-soft); color: var(--orange); }
.kind-mention .home-icon { background: var(--red-soft); color: var(--red); }
.home-main { flex: 1; min-width: 0; }
.home-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.home-kind { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .02em; }
.home-sub { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
.home-advice { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: var(--purple-soft); font-size: 13px; line-height: 1.45; }
.home-advice span { white-space: pre-wrap; overflow-wrap: anywhere; }
.home-actions { flex: none; align-self: center; }
.prio-badge { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--fill-2); color: var(--text-2); }
.prio-badge.p1 { background: var(--red); color: #fff; }
.prio-badge.p2 { background: var(--orange); color: #fff; }
.prio-badge.p3 { background: var(--accent-soft); color: var(--accent-text); }

.ai-off { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 0 12px; border-radius: 10px; background: var(--fill); font-size: 13px; color: var(--text-2); }
.ai-off > span:not(.zima-glyph) { flex: 1; }

/* explanations */
.ai-explain { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--purple-soft); font-size: 13px; }
.ai-explain.muted-box { display: flex; align-items: center; gap: 8px; background: var(--fill); }
.ai-explain.muted-box .ai-off { margin: 0; padding: 0; background: none; flex: 1; }
.ai-explain-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ai-explain dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-points { margin: 6px 0 4px; padding-left: 20px; }
.ai-points li { margin: 2px 0; overflow-wrap: anywhere; }
.grow { flex: 1; }
.grow-right { margin-left: auto; }

/* command bar */
.cmdk-layer { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, 0.18); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; animation: fade-in .12s ease; }
.cmdk { width: min(640px, calc(100vw - 32px)); max-height: 72vh; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); box-shadow: var(--shadow-lg); }
.cmdk-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 0.5px solid var(--sep); }
.cmdk-bar > svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.cmdk-input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--text); }
.cmdk-bar kbd { font: 11px var(--mono); color: var(--text-3); border: 0.5px solid var(--sep-strong); border-radius: 5px; padding: 1px 5px; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: default; }
.cmdk-row svg { width: 16px; height: 16px; color: var(--text-2); flex: none; }
.cmdk-row.on { background: var(--accent); color: #fff; }
.cmdk-row.on svg, .cmdk-row.on .cmdk-hint { color: rgba(255, 255, 255, 0.85); }
.cmdk-row.zima { margin-top: 4px; border-top: 0.5px solid var(--sep); border-top-left-radius: 0; border-top-right-radius: 0; }
.cmdk-row.zima.on { border-radius: 8px; }
.cmdk-row:disabled { opacity: .55; }
.cmdk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-hint { font-size: 12px; color: var(--text-3); flex: none; }
.cmdk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 0.5px solid var(--sep); font-size: 12px; color: var(--text-2); }
.cmdk-ctx { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmdk-ctx svg { width: 13px; height: 13px; flex: none; }
.cmdk-zima { overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.cmdk-ask { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.cmdk-working { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; padding: 6px 0; }
.cmdk-reply { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.cmdk-reply .prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.cmdk-again { padding: 0 10px 6px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.zima-fab { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow-md), 0 0 0 0.5px var(--sep-strong); cursor: default; transition: transform .12s ease; }
.zima-fab:hover { transform: scale(1.06); }
.zima-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cmdk-layer { animation: none; } .zima-fab { transition: none; } }
.zima-ai-opts { display: flex; flex-direction: column; gap: 6px; }

/* summary cards (docs/13 §7) */
.ai-sum { margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--purple-soft); font-size: 13px; }
.ai-sum.off, .ai-sum.loading { display: flex; align-items: center; gap: 8px; background: var(--fill); color: var(--text-2); padding: 9px 12px; }
.ai-sum.off .ai-sum-head, .ai-sum.loading .ai-sum-head { margin: 0; flex: 1; }
.ai-sum-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.ai-sum-label { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.ai-sum-label.warn { color: var(--orange); }
.ai-sum-note { display: block; margin-top: 8px; }
.ai-sum .prose { font-size: 13px; }
.block { display: block; }

/* shared notes (docs/13 §8) */
.notes-sec { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.note-row { padding: 9px 12px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow-sm), 0 0 0 0.5px var(--sep); }
.note-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.note-body { margin-top: 5px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-cat { height: 18px; font-size: 10.5px; padding: 0 6px; }
.note-cat.cat-decision { background: var(--accent-soft); color: var(--accent-text); }
.note-cat.cat-conclusion { background: var(--green-soft); color: var(--green); }
.note-cat.cat-pitfall { background: var(--orange-soft); color: var(--orange); }
.note-cat.cat-note { background: var(--fill-2); color: var(--text-2); }
.note-history { display: flex; flex-direction: column; gap: 8px; }

/* team plan (docs/13 §6) */
.sheet-icon.zima { background: var(--purple-soft); color: var(--purple); }
.cmdk-working.big { justify-content: center; padding: 36px 0; font-size: 14px; }
.plan-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.plan-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--fill); }
.plan-row.grant { align-items: flex-start; }
.plan-row .field { min-width: 0; }
.plan-name { font-size: 13px; font-weight: 500; min-width: 90px; display: flex; align-items: center; gap: 6px; }
.plan-num { width: 20px; flex: none; text-align: right; font-size: 12px; color: var(--text-3); }
.plan-spacer { width: 28px; flex: none; }
.plan-steps { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; padding: 0; list-style: none; font-size: 13px; }
.plan-step { display: flex; align-items: center; gap: 8px; }
.plan-step.ok { color: var(--green); }
.plan-step.bad { color: var(--red); }
.conn-ai-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; padding: 9px 12px; border-radius: 10px; background: var(--fill); font-size: 13px; }
.plan-row .field.small { width: 110px; flex: none; }
.plan-row .field.small.grow { flex: 1 1 auto; width: auto; }
.plan-row .field.select.small { width: 150px; flex: none; }
.plan-row .plan-name { width: 120px; flex: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sheet .cmdk-reply { margin-bottom: 12px; }

/* 招聘 (docs/14) ------------------------------------------------------- */
.hire-card {
  background: var(--card); box-shadow: var(--shadow-sm); border-radius: 12px;
  padding: 14px 16px; margin: 0 0 12px; border: 0.5px solid var(--sep);
}
.hire-card.is-new { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm); }
.hire-card.status-pending { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.hire-head { display: flex; align-items: center; gap: 10px; }
.hire-head .grow { flex: 1; min-width: 0; }
.hire-rt { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; }
.hire-purpose { margin: 10px 0 0; font-size: 13.5px; color: var(--text-2); }
.hire-card .callout.small { margin-top: 8px; padding: 8px 12px; font-size: 12.5px; }
.pill.hire-pending { background: var(--accent); color: #fff; }
.pill.hire-approved, .pill.hire-claimed { background: var(--orange-soft); color: var(--orange); }
.pill.hire-active { background: var(--green-soft); color: var(--green); }
.perm-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 0.5px solid var(--sep); }
.perm-row .grow { flex: 1; min-width: 0; }
.perm-scopes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 10px; border-radius: 12px; background: var(--fill); font-size: 12px; }
.chip .icon-btn.small { width: 20px; height: 20px; }
.detail-actions-inline { margin-top: 12px; }
.hire-limits { margin: 6px 0 10px; padding-left: 18px; line-height: 1.7; }
.hire-origin { margin-top: 12px; }
.btn.secondary.danger { color: var(--red, #ff3b30); }

/* ------------------------------------------------ 自治程度 / Autonomy (docs/15) */
.auto-settings { display: contents; }
.auto-intro .set-label p { margin: 0; line-height: 1.5; }
.auto-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px 14px; }
.auto-level { text-align: left; border: 0; border-radius: 12px; padding: 12px 14px; background: var(--fill); color: var(--text); cursor: pointer; font: inherit; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .15s, background .15s; }
.auto-level:hover { background: var(--fill-2); }
.auto-level.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.auto-level p { margin: 6px 0 0; line-height: 1.45; }
.auto-level-head { display: flex; align-items: center; gap: 8px; }
.auto-radio { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--sep-strong); flex: none; }
.auto-level.on .auto-radio { background: var(--accent); box-shadow: none; color: #fff; }
.auto-radio svg { width: 12px; height: 12px; }
.auto-level .pill { margin-left: auto; }
.auto-cat { align-items: center; }
.auto-cat .set-label { min-width: 0; }
.auto-cat-name { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.auto-cat-name svg { width: 15px; height: 15px; color: var(--text-2); flex: none; }
.auto-cat.is-auto .auto-cat-name svg { color: var(--accent-text); }
.auto-cat-desc { margin-top: 3px; line-height: 1.45; }
.auto-usage { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.auto-bar { width: 72px; height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; flex: none; }
.auto-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.segmented.small button { padding: 0 10px; font-size: 12px; height: 24px; }
.auto-alert { background: var(--orange-soft); }
.auto-alert .auto-cat-name svg { color: var(--orange); }
.auto-floor { padding: 12px 14px; }
.auto-floor summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.auto-floor summary::-webkit-details-marker { display: none; }
.auto-floor summary svg { width: 15px; height: 15px; color: var(--text-2); }
.auto-floor summary .muted { margin-left: auto; }
.auto-floor ul { margin: 10px 0 0; padding-left: 22px; line-height: 1.7; font-size: 13px; color: var(--text-2); }
.auto-rails { margin: 0; padding: 0 14px 12px; line-height: 1.5; }
@media (max-width: 760px) { .auto-levels { grid-template-columns: 1fr; } }

.auto-feed { margin-top: 22px; }
.auto-feed-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 8px; }
.auto-feed-head .group-title { margin: 0; }
.auto-feed-list { display: flex; flex-direction: column; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm), 0 0 0 0.5px var(--sep); overflow: hidden; }
.auto-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; }
.auto-row + .auto-row { border-top: 0.5px solid var(--sep); }
.auto-row.undone { opacity: .55; }
.auto-row-title { display: flex; align-items: center; gap: 8px; }
.home-icon.auto { background: var(--green-soft); color: var(--green); }
.auto-reason { display: flex; align-items: center; gap: 5px; color: var(--text-3); margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.auto-reason svg { width: 12px; height: 12px; flex: none; }
.auto-reason span { overflow: hidden; text-overflow: ellipsis; }
.auto-empty { padding: 4px 2px; }
.kind-autonomy_brake .home-icon { background: var(--orange-soft); color: var(--orange); }
.auto-bar.full > span { background: var(--orange); }
.set-row.auto-intro { grid-template-columns: 1fr; }
.set-row.auto-cat, .set-row.auto-alert { grid-template-columns: minmax(0, 1fr) auto; }

/* Channel layout does not replace project/connector views. */
.app.view-channels { grid-template-columns: 228px minmax(260px, 320px) minmax(400px, 1fr); }
.channel-history-action { align-self: center; margin: 8px 0 16px; }
.channel-error { color: var(--red); padding: 8px 18px; flex: none; }
.app.view-channels .composer { padding-right: 80px; }
@media (max-width: 1080px) { .app.view-channels { grid-template-columns: 200px minmax(220px, 280px) minmax(340px, 1fr); } }
@media (max-width: 860px) { .app.view-channels { grid-template-columns: 64px 1fr; } }

/* Work inbox: local conversations, triage lanes and a readable thread. */
.app.view-work { grid-template-columns: 200px minmax(0, 1fr); }
.work-page { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.work-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 24px 16px; border-bottom: 1px solid var(--sep); }
.work-header h1 { font-size: 23px; letter-spacing: -.5px; margin-bottom: 3px; }
.work-header-actions { display: flex; align-items: center; gap: 12px; }
.work-sync-status { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12px; }
.work-error { color: var(--red); }
.work-alert { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--bg-2); }
.work-toolbar { display: flex; align-items: center; gap: 20px; padding: 12px 24px; border-bottom: 1px solid var(--sep); background: var(--bg-2); }
.work-source { width: 160px; flex: none; }
.work-search { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 400px; padding: 7px 10px; background: var(--control); border: 1px solid var(--control-border); border-radius: 7px; color: var(--text-2); }
.work-search input { border: 0; outline: none; padding: 0; width: 100%; background: transparent; }
.work-toolbar .check { white-space: nowrap; }
.work-columns { display: grid; grid-template-columns: 184px minmax(285px, .9fr) minmax(340px, 1.1fr); flex: 1; min-height: 0; }
.work-conversations { min-height: 0; display: flex; flex-direction: column; background: var(--bg-2); border-right: 1px solid var(--sep); }
.work-column-title { font-size: 12px; color: var(--text-2); padding: 20px 16px 12px; }
.work-conversation-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px; }
.work-conversation { display: flex; width: 100%; align-items: center; gap: 7px; text-align: left; border: 0; border-radius: 7px; padding: 11px 8px; background: transparent; margin-bottom: 3px; }
.work-conversation > .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-conversation > .icon { color: var(--text-2); width: 15px; }
.work-conversation.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.work-conversation:hover { background: var(--fill); }
.work-count { background: var(--fill-2); font-size: 10px; font-weight: 600; min-width: 18px; padding: 1px 5px; border-radius: 9px; text-align: center; }
.work-conversation.active .work-count { background: var(--accent); color: white; }
.work-manage { margin: 12px 6px; font-size: 12px; }
.work-inbox { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--sep); }
.work-tabs { display: flex; flex-wrap: wrap; gap: 3px 12px; padding: 13px 16px 0; border-bottom: 1px solid var(--sep); }
.work-tabs button { padding: 8px 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-size: 12px; }
.work-tabs button.active { border-bottom-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.work-list-tools { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; gap: 8px; background: var(--bg-2); border-bottom: 1px solid var(--sep); }
.work-list-tools .check { font-size: 11px; }
.work-thread-list { overflow-y: auto; flex: 1; min-height: 0; }
.work-thread-card { display: block; width: 100%; text-align: left; padding: 18px 18px 15px; background: transparent; border: 0; border-bottom: 1px solid var(--sep); border-left: 3px solid transparent; }
.work-thread-card:hover { background: var(--bg-2); }
.work-thread-card.selected { background: var(--accent-soft); border-left-color: var(--accent); }
.work-card-top { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.work-card-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-card-top time { white-space: nowrap; font-size: 10px; }
.work-preview { color: var(--text-2); font-size: 13px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; margin-bottom: 11px; }
.work-card-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.work-label { display: inline-block; padding: 2px 7px; border-radius: 5px; background: var(--gray-soft); color: var(--text-2); font-size: 10px; font-weight: 500; }
.work-label-todo_for_me { color: var(--accent-text); background: var(--accent-soft); }
.work-label-waiting_on_others { color: var(--orange); background: var(--orange-soft); }
.work-label-fyi { color: var(--teal); background: var(--teal-soft); }
.work-label-done_replied { color: var(--green); background: var(--green-soft); }
.work-new { margin-left: auto; font-size: 10px; color: var(--accent-text); }
.work-card-tasks { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: 11px; }
.work-card-tasks .icon { width: 13px; height: 13px; }
.work-detail { min-width: 0; overflow-y: auto; padding: 22px 24px 40px; }
.work-detail-head h2 { font-size: 20px; margin: 4px 0 7px; overflow-wrap: anywhere; }
.work-eyebrow { font-size: 10px; color: var(--text-3); letter-spacing: 1px; }
.work-summary { border: 1px solid var(--sep); background: var(--bg-2); border-radius: 10px; margin-top: 14px; padding: 12px 14px; }
.work-summary-title { display: flex; gap: 6px; align-items: center; color: var(--accent-text); font-weight: 600; font-size: 12px; margin-bottom: 8px; }
.work-summary p { line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.work-confidence { font-size: 10px; margin-top: 10px; }
.work-classify { margin: 10px 0; }
.work-classify label { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-2); }
.work-label-select { color: var(--text); width: auto; min-width: 125px; }
.work-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--sep); }
.work-actions a { text-decoration: none; }
.work-actions .btn { font-size: 12px; padding: 0 10px; }
.work-section-title { font-size: 12px; margin: 18px 0 10px; }
.work-messages { display: flex; flex-direction: column; gap: 8px; }
.work-message { background: var(--bg-2); border: 1px solid var(--sep); padding: 9px 12px; border-radius: 9px; }
.work-message.from-owner { background: var(--accent-soft); border-color: transparent; }
.work-message-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; }
.work-message-head time { margin-left: auto; font-size: 10px; }
.work-message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: 12px; }
.work-message-text a { color: var(--accent-text); }
.work-at { color: var(--accent-text); font-size: 10px; }
.work-task-row { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; background: var(--bg-2); border: 1px solid var(--sep); border-radius: 7px; padding: 11px; margin-bottom: 7px; }
.work-task-row strong { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.work-task-row .small { display: block; font-size: 10px; margin-top: 3px; }
.work-task-row .icon { color: var(--accent-text); }
.work-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 60px 28px; flex: 1; }
.work-empty > .icon { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 8px; }
.work-empty h2 { font-size: 17px; }
.work-empty p { max-width: 330px; font-size: 12px; line-height: 1.8; }
.work-thread-list .work-empty h2 { font-size: 14px; }
.work-more { margin: 16px; }
.work-settings .set-row { padding: 7px 0; }
.work-settings .set-label { width: 185px; }
.work-settings .set-value { flex: 1; }
.work-settings input[type=number] { width: 135px; }
.work-settings-note { margin-top: 12px; }
.work-manage-list { margin-top: 12px; max-height: 150px; overflow: auto; border: 1px solid var(--sep); border-radius: 8px; }
.work-manage-row { display: flex; align-items: center; gap: 20px; padding: 11px 14px; border-bottom: 1px solid var(--sep); }
.work-manage-row:last-child { border-bottom: 0; }
.work-manage-row small { display: block; font-size: 10px; }
.work-wipe { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 1100px) {
  .app.view-work { grid-template-columns: 64px minmax(0, 1fr); }
  .view-work .brand-name, .view-work .brand-sub, .view-work .nav-label, .view-work .nav-badge, .view-work .side-footer { display: none; }
  .view-work .brand, .view-work .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
  .work-columns { grid-template-columns: 150px minmax(240px, .9fr) minmax(300px, 1.1fr); }
  .work-header { padding: 14px 16px; }
  .work-toolbar { gap: 12px; padding: 12px 16px; }
  .work-detail { padding: 18px 16px 35px; }
}
@media (max-width: 800px) {
  .work-columns { display: grid; grid-template-columns: 1fr; overflow-y: auto; }
  .work-conversations { display: none; }
  .work-inbox { min-height: 300px; max-height: 45vh; }
  .work-detail { overflow: visible; border-top: 1px solid var(--sep); }
  .work-header { flex-wrap: wrap; }
  .work-toolbar { flex-wrap: wrap; gap: 12px; }
  .work-search { min-width: 140px; }
}

.work-settings .sheet-actions { position: sticky; bottom: -24px; background: var(--bg); padding: 14px 0; z-index: 1; border-top: 1px solid var(--sep); }

/* Work triage controls follow the settings label / field / hint grid. */
.zima-work-row { align-items: start; }
.zima-work-row .set-value { justify-content: flex-start; text-align: left; }
.zima-work-options { display: flex; flex-direction: column; gap: 12px; }
.zima-work-options .check { display: flex; align-items: flex-start; gap: 8px; }
.zima-work-options .check input { flex: none; margin-top: 3px; }
.zima-work-options .zima-btns { flex-wrap: wrap; justify-content: flex-start; }

/* External action drafts are inert, wrapped text with room for long recipients. */
.action-card { margin-bottom: 16px; overflow-wrap: anywhere; }
.action-draft { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-height: 28rem; overflow: auto; }
