/* ==========================================================================
   Swarm App Build 78 — macOS Tahoe & iOS 27 Liquid Glass Prototype
   Inherits exact design tokens from apps/swarm/ios/Swarm/Web/app.css
   ========================================================================== */

:root {
  --paper: #ffffff;
  --paper-elev: #fbfbfd;
  --sidebar-bg: rgba(246, 247, 250, 0.78);
  --bubble: #f2f2f7;
  --card: #ffffff;
  --code-bg: #f4f4f8;
  --code-bar: rgba(0, 0, 0, 0.035);
  --line: rgba(60, 60, 67, 0.16);
  --line-soft: rgba(60, 60, 67, 0.09);
  --ink: #000000;
  --ink2: rgba(60, 60, 67, 0.64);
  --ink3: rgba(60, 60, 67, 0.36);
  --spin-ink: rgba(60, 60, 67, 0.78);
  --hover: rgba(0, 0, 0, 0.048);
  --accent: #007aff;
  --accent-ink: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.13);
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, 0.12);
  --ok: #34c759;
  --ok-soft: rgba(52, 199, 89, 0.14);
  --warn: #ff9500;
  --warn-soft: rgba(255, 149, 0, 0.14);
  --indigo: #5e6ad2;
  --indigo-soft: rgba(94, 106, 210, 0.14);

  /* Liquid Glass Material */
  --glass-bg: rgba(255, 255, 255, 0.74);
  --glass-bg-strong: rgba(255, 255, 255, 0.86);
  --glass-specular: rgba(255, 255, 255, 0.88);
  --glass-edge: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 2px 10px rgba(0, 0, 0, 0.055), 0 10px 28px rgba(15, 23, 42, 0.08);
  --popover-bg: rgba(255, 255, 255, 0.92);
  --window-shadow: 0 28px 80px rgba(15, 23, 42, 0.22), 0 4px 16px rgba(15, 23, 42, 0.08), inset 0 0 0 0.5px rgba(255, 255, 255, 0.72);
  --track-bg: rgba(60, 60, 67, 0.075);
  --track-edge: rgba(0, 0, 0, 0.045);
  --chip-active-bg: #ffffff;
  --chip-active-edge: rgba(0, 0, 0, 0.065);
  --chip-active-shadow: 0 1px 3px rgba(0, 0, 0, 0.09);

  /* Syntax highlighting (Light) */
  --tok-kw: #9b2393;
  --tok-str: #c41a16;
  --tok-num: #1c00cf;
  --tok-com: #5d6c79;
  --tok-fn: #326d74;
  --tok-type: #0b4f79;
  --tok-prop: #643820;

  /* Typography — Mac defaults (0.8x Catalyst scale from app.css) */
  --font-body: 14px;
  --line-body: 1.54;
  --font-ui: 13px;
  --font-sub: 12px;
  --font-code: 12px;
  --composer-btn: 28px;
  --composer-pad: 4px;
  --composer-gap: 8px;
  --hairline: 1px;
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  :root { --hairline: 0.5px; }
}

html[data-theme="dark"] {
  --paper: #1e1e1e;
  --paper-elev: #242426;
  --sidebar-bg: rgba(34, 34, 38, 0.78);
  --bubble: #2b2b2e;
  --card: #262629;
  --code-bg: #17171a;
  --code-bar: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.07);
  --ink: #f5f5f7;
  --ink2: rgba(235, 235, 245, 0.64);
  --ink3: rgba(235, 235, 245, 0.36);
  --spin-ink: rgba(235, 235, 245, 0.78);
  --hover: rgba(255, 255, 255, 0.075);
  --accent: #0a84ff;
  --accent-ink: #64b5ff;
  --accent-soft: rgba(10, 132, 255, 0.24);
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.18);
  --ok: #30d158;
  --ok-soft: rgba(48, 209, 88, 0.18);
  --warn: #ff9f0a;
  --warn-soft: rgba(255, 159, 10, 0.18);
  --indigo: #7c87f2;
  --indigo-soft: rgba(124, 135, 242, 0.2);

  --glass-bg: rgba(42, 42, 46, 0.72);
  --glass-bg-strong: rgba(46, 46, 52, 0.86);
  --glass-specular: rgba(255, 255, 255, 0.18);
  --glass-edge: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 2px 12px rgba(0, 0, 0, 0.42), 0 12px 32px rgba(0, 0, 0, 0.44);
  --popover-bg: rgba(38, 38, 42, 0.94);
  --window-shadow: 0 34px 96px rgba(0, 0, 0, 0.65), 0 6px 20px rgba(0, 0, 0, 0.42), inset 0 0 0 0.5px rgba(255, 255, 255, 0.14);
  --track-bg: rgba(255, 255, 255, 0.085);
  --track-edge: rgba(255, 255, 255, 0.06);
  --chip-active-bg: rgba(255, 255, 255, 0.16);
  --chip-active-edge: rgba(255, 255, 255, 0.1);
  --chip-active-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);

  --tok-kw: #fc5fa3;
  --tok-str: #fc6a5d;
  --tok-num: #d0bf69;
  --tok-com: #7f8c98;
  --tok-fn: #67b7a4;
  --tok-type: #5dd8ff;
  --tok-prop: #a167e6;
}

/* iOS dark uses true OLED #000000 paper as in app.css */
html[data-theme="dark"] .ios-stage {
  --paper: #000000;
  --paper-elev: #111113;
  --bubble: #1c1c1e;
  --card: #1c1c1e;
  --code-bg: #141416;
}

.ios-stage {
  --font-body: 15.5px;
  --line-body: 1.46;
  --font-ui: 14px;
  --font-sub: 12.5px;
  --font-code: 12.5px;
  --composer-btn: 40px;
  --composer-pad: 4px;
  --composer-gap: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}
html[data-theme="dark"] body {
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:focus { outline: none; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Material Symbols Rounded */
.sym {
  font-family: "Material Symbols Rounded", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: var(--sym-size, 18px);
  width: var(--sym-size, 18px);
  height: var(--sym-size, 18px);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  flex: none;
  user-select: none;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
}
.sym.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Shared Liquid Glass Utility */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  backdrop-filter: blur(26px) saturate(190%);
  box-shadow:
    inset 0 0.5px 0 var(--glass-specular),
    inset 0 0 0 var(--hairline) var(--glass-edge),
    var(--glass-shadow);
}

/* 12-spoke Apple radial starburst spinner (exact SVG mask from app.css) */
.spinner {
  width: 15px;
  height: 15px;
  display: inline-block;
  flex: none;
  background-color: var(--spin-color, var(--spin-ink));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23000'%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' opacity='1'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(330 12 12)' opacity='.88'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(300 12 12)' opacity='.77'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(270 12 12)' opacity='.66'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(240 12 12)' opacity='.56'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(210 12 12)' opacity='.47'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(180 12 12)' opacity='.39'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(150 12 12)' opacity='.32'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(120 12 12)' opacity='.26'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(90 12 12)' opacity='.21'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(60 12 12)' opacity='.17'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(30 12 12)' opacity='.14'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%23000'%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' opacity='1'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(330 12 12)' opacity='.88'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(300 12 12)' opacity='.77'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(270 12 12)' opacity='.66'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(240 12 12)' opacity='.56'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(210 12 12)' opacity='.47'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(180 12 12)' opacity='.39'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(150 12 12)' opacity='.32'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(120 12 12)' opacity='.26'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(90 12 12)' opacity='.21'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(60 12 12)' opacity='.17'/%3E%3Crect x='10.9' y='1.5' width='2.2' height='6' rx='1.1' transform='rotate(30 12 12)' opacity='.14'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  animation: swarm-spin 1s steps(12, end) infinite;
}
.spinner.sm { width: 13px; height: 13px; }
.spinner.on-accent { --spin-color: rgba(255, 255, 255, 0.88); }
@keyframes swarm-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Tahoe / iOS 27 Atmospheric Abstract Wallpaper
   ========================================================================== */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(140deg, #dbeafe 0%, #e0e7ff 38%, #d8f3f1 74%, #edf2ff 100%);
  transition: background 0.4s ease;
}
html[data-theme="dark"] .wallpaper {
  background: linear-gradient(140deg, #0b1120 0%, #111827 42%, #0c1f2c 76%, #131126 100%);
}
.wp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
  opacity: 0.65;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.wp-orb-1 {
  width: 680px; height: 680px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.55) 0%, rgba(129, 140, 248, 0.25) 55%, transparent 72%);
}
.wp-orb-2 {
  width: 640px; height: 640px;
  bottom: -200px; right: -100px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.45) 0%, rgba(56, 189, 248, 0.22) 55%, transparent 72%);
}
.wp-orb-3 {
  width: 520px; height: 520px;
  top: 28%; left: 46%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.34) 0%, rgba(244, 114, 182, 0.16) 55%, transparent 72%);
}
html[data-theme="dark"] .wp-orb-1 {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.42) 0%, rgba(79, 70, 229, 0.22) 55%, transparent 72%);
}
html[data-theme="dark"] .wp-orb-2 {
  background: radial-gradient(circle, rgba(13, 148, 136, 0.38) 0%, rgba(2, 132, 199, 0.2) 55%, transparent 72%);
}
html[data-theme="dark"] .wp-orb-3 {
  background: radial-gradient(circle, rgba(109, 40, 217, 0.28) 0%, rgba(190, 24, 93, 0.14) 55%, transparent 72%);
}
.wp-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.35), transparent 55%),
    radial-gradient(ellipse at 80% 85%, rgba(255,255,255,0.22), transparent 50%);
}
html[data-theme="dark"] .wp-mesh {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.04), transparent 55%),
    radial-gradient(ellipse at 80% 85%, rgba(255,255,255,0.03), transparent 50%);
}

/* ==========================================================================
   Minimal Floating External Preview Switcher Bar
   ========================================================================== */
.preview-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  backdrop-filter: blur(28px) saturate(200%);
  box-shadow:
    inset 0 0.5px 0 var(--glass-specular),
    inset 0 0 0 var(--hairline) var(--glass-edge),
    0 6px 24px rgba(0, 0, 0, 0.12);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.preview-bar::-webkit-scrollbar { display: none; }

.preview-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.preview-sep {
  width: 1px;
  height: 16px;
  background: var(--line);
  margin: 0 2px;
  flex: none;
}
.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.preview-btn:hover {
  color: var(--ink);
  background: var(--hover);
}
.preview-btn.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 0.5px var(--chip-active-edge), var(--chip-active-shadow);
}

/* ==========================================================================
   Main Stage
   ========================================================================== */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 58px 20px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   macOS Tahoe Three-Column Window
   ========================================================================== */
.mac-window {
  width: min(1440px, 100%);
  height: min(880px, 100%);
  min-height: 600px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  background: var(--paper);
  box-shadow: var(--window-shadow);
  border: 0.5px solid var(--glass-edge);
  position: relative;
  transition: background 0.25s ease;
}

/* Column 1: Flush Full-Height Sidebar */
.mac-sidebar {
  width: 266px;
  min-width: 224px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  backdrop-filter: blur(36px) saturate(180%);
  border-right: var(--hairline) solid var(--line);
  transition: width 0.22s ease, opacity 0.2s ease;
}
.mac-window.sidebar-collapsed .mac-sidebar {
  width: 0;
  min-width: 0;
  opacity: 0;
  border-right: 0;
  overflow: hidden;
}

.mac-sidebar-top {
  height: 44px;
  padding: 0 12px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
}
.traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.14);
}
.tl-red { background: #ff5f57; }
.tl-yellow { background: #febc2e; }
.tl-green { background: #28c840; }

.mac-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chrome-circle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink2);
  transition: background 0.14s ease, color 0.14s ease;
}
.chrome-circle-btn:hover {
  background: var(--hover);
  color: var(--ink);
}

/* Sidebar Search aligned with row edges (Build 58) */
.mac-search-wrap {
  margin: 2px 10px 8px;
  height: 30px;
  border-radius: 9px;
  background: var(--track-bg);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  flex: none;
}
.mac-search-icon { color: var(--ink2); }
.mac-search-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 400 13px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  outline: none;
}
.mac-search-input::placeholder { color: var(--ink2); }

.mac-threads-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 8px;
  scrollbar-width: thin;
}

.thread-section-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: 0.01em;
}
.thread-section-head:first-child { padding-top: 4px; }

/* Build 74 Messages-style SidebarRow */
.thread-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 12px;
  text-align: left;
  transition: background 0.12s ease;
  margin-bottom: 2px;
}
.thread-row:hover { background: var(--hover); }
.thread-row.selected {
  background: var(--accent);
  color: #ffffff;
}

.agent-icon {
  width: var(--agent-size, 36px);
  height: var(--agent-size, 36px);
  border-radius: 50%;
  background: var(--agent-color, #5e6ad2);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
}
.agent-icon .sym {
  --sym-size: calc(var(--agent-size, 36px) * 0.56);
}
.thread-row.selected .agent-icon {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}
.agent-ask-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 2px var(--paper);
}

.thread-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.thread-top {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.thread-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.thread-row.selected .thread-title { color: #ffffff; }

.thread-time {
  font-size: 11px;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.thread-row.selected .thread-time { color: rgba(255, 255, 255, 0.82); }

.thread-bottom {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.thread-preview {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
  flex: 1;
}
.thread-row.selected .thread-preview { color: rgba(255, 255, 255, 0.84); }

.thread-mark {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-top: 1px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.asking { background: var(--warn); }
.status-dot.unread { background: var(--accent); }

.mac-sidebar-foot {
  padding: 8px 12px;
  border-top: var(--hairline) solid var(--line-soft);
  display: flex;
  align-items: center;
  flex: none;
}
.sidebar-gear-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink2);
  background: var(--glass-bg);
  box-shadow: inset 0 0 0 var(--hairline) var(--line);
  transition: background 0.14s ease, color 0.14s ease;
}
.sidebar-gear-btn:hover {
  color: var(--ink);
  background: var(--glass-bg-strong);
}

/* ==========================================================================
   Column 2: Main Coordinator Conversation
   ========================================================================== */
.mac-main {
  flex: 1 1 auto;
  min-width: 360px;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}

/* Floating Messages-style ChatHeader (Build 74–75: no fade bar behind header!) */
.chat-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 10px 14px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
}
.chat-header-overlay > * { pointer-events: none; }
.chat-header-center,
.chat-header-right {
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-header-right {
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}
.chat-header-center > *,
.chat-header-right > * { pointer-events: auto; }

.messages-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.messages-header-avatar {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}
.messages-name-capsule {
  margin-top: -3px;
  height: 24px;
  padding: 0 7px 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 var(--glass-specular),
    inset 0 0 0 var(--hairline) var(--line),
    0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: transform 0.14s ease, background 0.14s ease;
}
.messages-name-capsule:hover {
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}
.messages-name-capsule .sym { color: var(--ink2); }

.header-glass-pill {
  height: 30px;
  padding: 0 10px 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 var(--glass-specular),
    inset 0 0 0 var(--hairline) var(--line),
    0 2px 8px rgba(0, 0, 0, 0.06);
  transition: background 0.14s ease;
}
.header-glass-pill:hover { background: var(--glass-bg-strong); }

.count-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-glass-circle {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 var(--glass-specular),
    inset 0 0 0 var(--hairline) var(--line),
    0 2px 8px rgba(0, 0, 0, 0.06);
}
.header-glass-circle:hover { background: var(--glass-bg-strong); }

.header-ask-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 1.5px var(--paper);
}

/* Scrollable Chat Area */
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 78px 28px 88px;
  scroll-behavior: smooth;
}
.chat-container {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Transcript Blocks */
.block-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 48px;
  margin: 6px 0 2px;
}
.user-text {
  background: var(--bubble);
  color: var(--ink);
  border-radius: 20px;
  padding: 10px 15px;
  font-size: var(--font-body);
  line-height: var(--line-body);
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Folded Work Steps (Build 27: NO fold chevrons!) */
.fold-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fold-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  color: var(--ink2);
  font-size: var(--font-ui);
  text-align: left;
  align-self: flex-start;
  transition: color 0.14s ease;
}
.fold-trigger:hover { color: var(--ink); }

.fold-body {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding-left: 14px;
  margin-left: 3px;
  border-left: 1.5px solid var(--line);
}
.fold-block.open .fold-body { display: flex; }

.step-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 2px 6px 2px 2px;
  border-radius: 8px;
  font-size: var(--font-ui);
  text-align: left;
  transition: background 0.12s ease;
}
.step-row:hover { background: var(--hover); }
.step-row .step-icon { color: var(--ink2); }
.step-row .step-verb { color: var(--ink2); flex: none; }
.step-row .step-summary {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Build 45 Board Talk Block (no card background/border/box) */
.bcard {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 2px 0;
}
.bcard-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  font-size: var(--font-ui);
  color: var(--ink2);
  text-align: left;
}
.board-who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.board-who:hover { text-decoration: underline; text-underline-offset: 2px; }
.member-mini-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex: none;
}
.bcard-body {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-post-line {
  font-size: var(--font-ui);
  line-height: 1.48;
  color: var(--ink2);
}
.board-post-line.clamped {
  max-height: calc(2 * var(--font-ui) * 1.48);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
}
.bcard.open .board-post-line.clamped {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}
.board-meta-row {
  display: none;
  gap: 12px;
  font-size: 11px;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}
.bcard.open .board-meta-row { display: flex; }

/* Agent Body Markdown */
.agent-body {
  font-size: var(--font-body);
  line-height: var(--line-body);
  color: var(--ink);
}
.agent-body p { margin: 0 0 10px; }
.agent-body p:last-child { margin-bottom: 0; }

.member-ref {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px 1px 4px;
  border-radius: 7px;
  background: var(--bubble);
  font-size: calc(var(--font-body) - 1px);
  font-weight: 500;
  color: var(--ink);
  vertical-align: -1px;
  transition: background 0.12s ease;
}
.member-ref:hover { background: var(--hover); }

.sidecar-pill,
.file-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px 1px 6px;
  border-radius: 999px;
  font-size: calc(var(--font-body) - 1.5px);
  font-weight: 500;
  vertical-align: -1px;
  transition: background 0.14s ease, transform 0.12s ease;
}
.sidecar-pill {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
html[data-theme="dark"] .gh-alert.warning .sidecar-pill {
  background: rgba(10, 132, 255, 0.3);
  color: #7cc4ff;
}
.sidecar-pill:hover { filter: brightness(0.95); }
.file-pill {
  background: var(--bubble);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
}
.file-pill:hover { background: var(--hover); }

/* Transcript Artifact Card Row */
.artifact-row-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 14px;
  background: var(--card);
  border: var(--hairline) solid var(--line);
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}
.artifact-row-card:hover {
  background: var(--hover);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
}
.artifact-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.artifact-row-icon.html {
  background: var(--indigo-soft);
  color: var(--indigo);
}
.artifact-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.artifact-row-name {
  font-size: var(--font-ui);
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-row-summary {
  font-size: var(--font-sub);
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-status-pill {
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.artifact-status-pill.review {
  background: var(--warn-soft);
  color: var(--warn);
}
.artifact-status-pill.approved {
  background: var(--ok-soft);
  color: var(--ok);
}
.artifact-status-pill.updated {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Inline Generative UI <agent-embed> (Borderless, Transparent, <=450px) */
.agent-embed-host {
  margin: 6px 0 4px;
  padding: 4px 0;
  background: transparent;
  max-height: 400px;
}
.embed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.embed-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.embed-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.embed-metric-badge {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}
.embed-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--track-bg);
}
.embed-seg-btn {
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink2);
  transition: background 0.14s ease, color 0.14s ease;
}
.embed-seg-btn.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--chip-active-shadow);
}

.embed-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.embed-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.embed-bar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.embed-bar-label {
  color: var(--ink);
  font-weight: 500;
}
.embed-bar-vals {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.embed-val-old {
  color: var(--ink3);
  text-decoration: line-through;
  font-size: 11.5px;
}
.embed-val-new {
  color: var(--ink);
  font-weight: 600;
}
.embed-val-delta {
  color: var(--ok);
  font-weight: 600;
  font-size: 11.5px;
}
.embed-track {
  height: 8px;
  border-radius: 2px;
  background: var(--track-bg);
  position: relative;
  overflow: hidden;
}
.embed-fill-old {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 2px;
  background: var(--ink3);
  opacity: 0.28;
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.embed-fill-new {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.embed-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink2);
}
.embed-legend-items {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.legend-swatch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.swatch-sq {
  width: 8px;
  height: 8px;
  border-radius: 1.5px;
  display: inline-block;
}
.swatch-sq.b77 { background: var(--ink3); opacity: 0.45; }
.swatch-sq.b78 { background: var(--accent); }

/* Composer Mask & Floating Glass Composer (Build 77 exact geometry) */
.composer-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  z-index: 15;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--paper) 0%, transparent) 0%,
    color-mix(in srgb, var(--paper) 75%, transparent) 55%,
    var(--paper) 100%
  );
}
.composer-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 0 24px 12px;
  pointer-events: none;
}
.composer-inner {
  max-width: 720px;
  margin: 0 auto;
}
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: var(--composer-gap);
}
.composer-row > * { pointer-events: auto; }

.icon-btn.plus-btn {
  width: calc(var(--composer-btn) + 2 * var(--composer-pad));
  height: calc(var(--composer-btn) + 2 * var(--composer-pad));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex: none;
  transition: transform 0.12s ease;
}
.icon-btn.plus-btn:active { transform: scale(0.95); }

.composer-box {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: calc(var(--composer-btn) / 2 + var(--composer-pad));
  padding: var(--composer-pad);
}
.composer-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.composer-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--composer-btn);
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 4px 4px 10px;
  font-size: var(--font-body);
  line-height: 1.44;
  color: var(--ink);
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.composer-input:empty::before {
  content: attr(data-placeholder);
  color: var(--ink2);
  pointer-events: none;
}
.send-btn {
  width: var(--composer-btn);
  height: var(--composer-btn);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.send-btn.ready {
  background: var(--accent);
  color: #ffffff;
}

/* Popover Menu */
.menu-anchor {
  position: relative;
  display: inline-flex;
}
.pop-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  border-radius: 14px;
  padding: 5px;
  z-index: 80;
  background: var(--popover-bg);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  backdrop-filter: blur(26px) saturate(190%);
  border: var(--hairline) solid var(--line);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.header-pop-menu,
.pane-more-menu {
  bottom: auto;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  min-width: 224px;
}
.pop-section-label {
  padding: 6px 10px 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
}
.pop-divider {
  height: var(--hairline);
  background: var(--line);
  margin: 4px 6px;
}
.pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  transition: background 0.12s ease;
}
.pop-item:hover { background: var(--hover); }
.pop-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pop-item-val {
  font-size: 12px;
  color: var(--ink2);
  flex: none;
}

/* ==========================================================================
   Pane Resizer & Column 3: Right Swarm Pane (Tahoe PaneTabBar)
   ========================================================================== */
.pane-resizer {
  width: 5px;
  margin-left: -2px;
  margin-right: -3px;
  cursor: col-resize;
  position: relative;
  z-index: 30;
  flex: none;
}
.pane-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: var(--hairline);
  background: var(--line);
  transition: background 0.14s ease, width 0.14s ease;
}
.pane-resizer:hover::after,
.pane-resizer.dragging::after {
  width: 2px;
  background: var(--accent);
}
.mac-window.pane-hidden .pane-resizer,
.mac-window.pane-hidden .mac-pane {
  display: none;
}

.mac-pane {
  width: 504px;
  min-width: 340px;
  max-width: 680px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
}

/* Tahoe PaneTabBar: 28pt capsule track (R=14), equal 2pt inset, 24pt concentric chip (R=12) */
.pane-tabbar-row {
  height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: var(--hairline) solid var(--line);
  background: var(--paper);
  flex: none;
}
.pane-tab-track {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 2px;
  border-radius: 14px;
  background: var(--track-bg);
  box-shadow: inset 0 0 0 0.5px var(--track-edge);
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.pane-tab-track::-webkit-scrollbar { display: none; }

.pane-tab-chip {
  position: relative;
  flex: 1 1 0;
  min-width: 72px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}
.pane-tab-chip.pinned { flex: 0 0 auto; padding: 0 8px; }
.pane-tab-chip:hover {
  background: var(--hover);
  color: var(--ink);
}
.pane-tab-chip.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 0 0 0.5px var(--chip-active-edge), var(--chip-active-shadow);
}
.pane-tab-chip.show-divider::after {
  content: "";
  position: absolute;
  right: 0;
  top: 5px;
  bottom: 5px;
  width: 0.5px;
  background: var(--line);
  pointer-events: none;
}

.tab-lead-slot {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
}
.tab-close-btn {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--track-bg);
  color: var(--ink);
  align-items: center;
  justify-content: center;
}
.pane-tab-chip.closable:hover .tab-lead-icon,
.pane-tab-chip.closable:hover .tab-lead-spin {
  display: none;
}
.pane-tab-chip.closable:hover .tab-close-btn {
  display: inline-flex;
}
.tab-close-btn:hover {
  background: color-mix(in srgb, var(--ink) 16%, transparent);
}
.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}
.tab-alert-badge {
  min-width: 15px;
  height: 15px;
  padding: 0 4.5px;
  border-radius: 999px;
  background: var(--warn);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.pane-new-tab-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink2);
  background: var(--chip-active-bg);
  box-shadow: inset 0 0 0 0.5px var(--chip-active-edge), var(--chip-active-shadow);
  flex: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.pane-new-tab-btn:hover {
  color: var(--ink);
  background: var(--hover);
}

.pane-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   Overview Tab (swarm_pane protocol)
   ========================================================================== */
.pane-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pane-scroll > * {
  flex: none;
}

/* Compact Attention Banner */
.attention-banner {
  border-radius: 13px;
  background: color-mix(in srgb, var(--warn) 10%, var(--card));
  border: var(--hairline) solid color-mix(in srgb, var(--warn) 34%, var(--line));
  overflow: hidden;
}
.attention-banner.resolved {
  background: color-mix(in srgb, var(--ok) 9%, var(--card));
  border-color: color-mix(in srgb, var(--ok) 30%, var(--line));
}
.attention-summary {
  width: 100%;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.attention-pill {
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--warn);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 600;
  flex: none;
  display: inline-flex;
  align-items: center;
}
.attention-banner.resolved .attention-pill { background: var(--ok); }
.attention-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attention-chevron {
  color: var(--ink2);
  transition: transform 0.16s ease;
}
.attention-banner.expanded .attention-chevron { transform: rotate(90deg); }
.attention-detail {
  padding: 0 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink2);
}
.attention-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.compact-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bubble);
  color: var(--ink);
  transition: background 0.12s ease;
}
.compact-btn:hover { background: var(--hover); }
.compact-btn.primary {
  background: var(--accent);
  color: #ffffff;
}
.compact-btn.primary:hover { filter: brightness(1.06); }

/* Goal Header with subtle progress ring */
.goal-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}
.goal-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.goal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.28;
}
.goal-line {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.44;
  color: var(--ink2);
}
.goal-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
}
.goal-ring-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px 0 6px;
  border-radius: 999px;
  background: var(--bubble);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.goal-ring-svg { width: 16px; height: 16px; transform: rotate(-90deg); }
.goal-ring-bg { fill: none; stroke: var(--line); stroke-width: 2.5; }
.goal-ring-fg { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset 0.35s ease; }

/* Section Label */
.pane-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 6px;
}
.pane-section-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: 0.01em;
}
.pane-section-meta {
  font-size: 11.5px;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}

/* Outcome Threads (plan.json.threads[]) */
.outcome-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.outcome-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.outcome-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}
.outcome-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.outcome-state {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.outcome-state.done { color: var(--ok); }
.outcome-state.asking { color: var(--warn); }
.outcome-goal {
  padding: 0 4px 3px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink2);
}

.member-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 11px;
  text-align: left;
  transition: background 0.12s ease;
}
.member-row:hover { background: var(--hover); }
.member-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.member-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-row-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.member-row-name.stopped { color: var(--ink2); }
.member-row-activity {
  font-size: 12px;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-row-state-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink2);
  flex: none;
}
.member-row-state-tag.done { color: var(--ok); }
.member-row-state-tag.asking { color: var(--warn); }

/* Progress Reel Filmstrip */
.reel-strip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}
.reel-strip-scroll::-webkit-scrollbar { display: none; }

.reel-thumb-card {
  width: 146px;
  flex: none;
  border-radius: 11px;
  overflow: hidden;
  background: var(--code-bg);
  border: var(--hairline) solid var(--line);
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.reel-thumb-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.reel-thumb-preview {
  width: 100%;
  height: 82px;
  overflow: hidden;
  background: var(--paper-elev);
  position: relative;
}
.reel-thumb-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}
.reel-thumb-foot {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reel-thumb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}
.reel-thumb-cap {
  font-size: 11px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Collapsible Stopped Section (collapsed by default per Build 73) */
.stopped-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  align-self: flex-start;
}
.stopped-toggle:hover { color: var(--ink); }
.stopped-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

/* ==========================================================================
   Board Tab (Channels + Search + #seq Pills + Inline Screenshots)
   ========================================================================== */
.board-toolbar {
  padding: 10px 12px 8px;
  border-bottom: var(--hairline) solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}
.channel-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.channel-pills::-webkit-scrollbar { display: none; }
.channel-pill {
  height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  background: var(--track-bg);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s ease, color 0.12s ease;
}
.channel-pill:hover { color: var(--ink); }
.channel-pill.active {
  background: var(--accent);
  color: #ffffff;
}
.channel-pill-count {
  font-size: 10.5px;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

.board-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.board-search-box {
  flex: 1;
  height: 28px;
  border-radius: 8px;
  background: var(--track-bg);
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.board-search-box input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  outline: none;
}
.board-search-box input::placeholder { color: var(--ink2); }

.board-member-select {
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 0;
  background: var(--track-bg);
  color: var(--ink);
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  outline: none;
  cursor: pointer;
}

.board-feed {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 24px;
}

/* Left-aligned restrained channel control line (never centered!) */
.board-control-line {
  padding: 7px 4px;
  font-size: 11.5px;
  color: var(--ink3);
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: var(--hairline) solid var(--line-soft);
}
.board-control-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.board-msg {
  padding: 10px 6px;
  border-bottom: var(--hairline) solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 8px;
  transition: background 0.35s ease;
}
.board-msg:last-child { border-bottom: 0; }
.board-msg.pulse-highlight {
  animation: board-pulse 1.5s ease;
}
@keyframes board-pulse {
  0% { background: color-mix(in srgb, var(--accent) 24%, transparent); }
  100% { background: transparent; }
}

.board-msg-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.board-seq-label {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}
.board-agent-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--ink);
}
.board-agent-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.board-chan-tag {
  font-size: 11px;
  color: var(--ink2);
  background: var(--track-bg);
  padding: 1px 6px;
  border-radius: 5px;
}
.board-msg-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
}

.board-msg-body {
  font-size: 13px;
  line-height: 1.48;
  color: var(--ink);
  padding-left: 24px;
}
.tag-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  margin-right: 4px;
  vertical-align: 1px;
}
.tag-badge.done { background: var(--ok-soft); color: var(--ok); }
.tag-badge.stall { background: var(--warn-soft); color: var(--warn); }

.seq-ref-pill {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 0;
  transition: transform 0.12s ease, background 0.12s ease;
}
.seq-ref-pill:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}
.mention-span {
  color: var(--accent);
  font-weight: 500;
}

.board-shot-card {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 10px 5px 5px;
  border-radius: 10px;
  background: var(--code-bg);
  border: var(--hairline) solid var(--line);
  max-width: 100%;
  text-align: left;
  transition: border-color 0.14s ease;
}
.board-shot-card:hover { border-color: var(--accent); }
.board-shot-mini {
  width: 66px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex: none;
  border: var(--hairline) solid var(--line);
}
.board-shot-mini svg { width: 100%; height: 100%; display: block; }
.board-shot-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.board-shot-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
}
.board-shot-cap {
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Graph Tab (Minimal Tahoe Topology + Replay Control Bar)
   ========================================================================== */
.graph-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.graph-canvas-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}
.graph-svg {
  width: 100%;
  height: 100%;
  max-height: 540px;
  display: block;
}
.graph-edge {
  fill: none;
  stroke: var(--ink3);
  opacity: 0.35;
  transition: opacity 0.2s ease, stroke 0.2s ease;
}
.graph-edge.highlighted {
  stroke: var(--accent);
  opacity: 0.85;
}
.graph-edge.dimmed { opacity: 0.08; }

.graph-node {
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.graph-node.dimmed { opacity: 0.28; }
.graph-node-ring {
  fill: var(--glass-bg);
  stroke: var(--line);
  stroke-width: 1;
  transition: stroke 0.16s ease, stroke-width 0.16s ease;
}
.graph-node:hover .graph-node-ring,
.graph-node.selected .graph-node-ring {
  stroke: var(--accent);
  stroke-width: 2;
}
.graph-node.active-speaker .graph-node-pulse {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  animation: node-ping 1.2s ease-out infinite;
}
@keyframes node-ping {
  0% { r: 22; opacity: 0.8; }
  100% { r: 34; opacity: 0; }
}
.graph-node-label {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4.5px;
  stroke-linejoin: round;
}
.graph-node-sub {
  fill: var(--ink2);
  font-size: 9.5px;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.graph-inspector {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.graph-live-caption {
  pointer-events: auto;
  padding: 6px 11px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--ink);
  max-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.graph-caption-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.graph-caption-body {
  font-size: 11.5px;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-node-card {
  pointer-events: auto;
  margin-left: auto;
  padding: 8px 11px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.graph-node-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.graph-node-meta-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.graph-node-meta-stat {
  font-size: 11px;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}

/* Compact Glass Replay Control Bar */
.replay-bar-wrap {
  padding: 0 12px 12px;
  flex: none;
}
.replay-bar {
  height: 40px;
  padding: 0 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.replay-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  flex: none;
}
.replay-step-label {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}
.replay-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}
.replay-pill-btn {
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink2);
  background: var(--track-bg);
  font-variant-numeric: tabular-nums;
}
.replay-pill-btn:hover { color: var(--ink); }
.replay-pill-btn.live {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ==========================================================================
   Worker Tab (NO duplicate header per Build 75!)
   ========================================================================== */
.worker-pane-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.worker-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 76px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inbox-card {
  background: var(--card);
  border: var(--hairline) solid var(--line);
  border-radius: 16px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inbox-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink2);
}
.inbox-head .sym { color: var(--accent); }
.inbox-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.inbox-body {
  font-size: 13px;
  line-height: 1.48;
  color: var(--ink);
}

/* Code Block with Syntax Highlighting & Copy Button (Build 45) */
.md-code {
  border-radius: 11px;
  background: var(--code-bg);
  border: var(--hairline) solid var(--line);
  overflow: hidden;
  margin: 4px 0;
}
.md-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: var(--code-bar);
  border-bottom: var(--hairline) solid var(--line-soft);
  font-size: 11px;
  color: var(--ink2);
}
.md-code-lang { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.md-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink2);
  font-size: 11.5px;
  font-weight: 500;
}
.md-copy-btn:hover { background: var(--hover); color: var(--ink); }
.md-copy-btn.copied { color: var(--ok); }
.md-code pre {
  margin: 0;
  padding: 10px 12px;
}
.md-code code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--font-code);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: block;
}
.tok-kw { color: var(--tok-kw); font-weight: 500; }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-com { color: var(--tok-com); font-style: italic; }
.tok-fn { color: var(--tok-fn); }
.tok-type { color: var(--tok-type); }

.worker-composer-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 12px 10px;
  z-index: 20;
  pointer-events: none;
}

/* ==========================================================================
   Artifact Tab (Markdown Extensions + Proceed Bar + Standalone Dashboard)
   ========================================================================== */
.artifact-pane-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.artifact-switcher-bar {
  padding: 8px 12px;
  border-bottom: var(--hairline) solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: none;
}
.artifact-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 10px;
  background: var(--track-bg);
  flex: 1;
  min-width: 0;
}
.artifact-seg-btn {
  flex: 1;
  min-width: 0;
  height: 25px;
  padding: 0 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  overflow: hidden;
}
.artifact-seg-btn span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-seg-btn.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--chip-active-shadow);
}

.artifact-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 86px;
}
.artifact-doc {
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-size: 13.5px;
  line-height: 1.56;
  color: var(--ink);
}
.artifact-doc h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.artifact-doc h2 {
  margin: 6px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.artifact-doc p { margin: 0; }
.artifact-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink2);
}

/* GitHub Alerts */
.gh-alert {
  border-radius: 11px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  line-height: 1.46;
}
.gh-alert-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
}
.gh-alert.important {
  border-left-color: var(--indigo);
  background: var(--indigo-soft);
}
.gh-alert.important .gh-alert-title { color: var(--indigo); }
.gh-alert.warning {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}
.gh-alert.warning .gh-alert-title { color: var(--warn); }

/* Theme-Aware Mermaid Box */
.mermaid-card {
  border-radius: 12px;
  background: var(--code-bg);
  border: var(--hairline) solid var(--line);
  padding: 12px;
  overflow-x: auto;
}
.mermaid-card svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Interactive Markdown Carousel */
.md-carousel {
  border-radius: 13px;
  background: var(--code-bg);
  border: var(--hairline) solid var(--line);
  overflow: hidden;
}
.carousel-viewport {
  padding: 14px 14px 10px;
  min-height: 132px;
}
.carousel-slide-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.carousel-slide-body {
  font-size: 12.5px;
  color: var(--ink2);
  line-height: 1.48;
  margin-bottom: 10px;
}
.carousel-foot {
  padding: 8px 12px;
  border-top: var(--hairline) solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.carousel-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink3);
  transition: background 0.16s ease, transform 0.16s ease;
}
.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}
.carousel-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.carousel-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bubble);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.carousel-nav-btn:hover { background: var(--hover); }

/* Embedded Brain Screenshot inside Markdown */
.artifact-shot-btn {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: var(--hairline) solid var(--line);
  background: var(--code-bg);
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: border-color 0.14s ease;
}
.artifact-shot-btn:hover { border-color: var(--accent); }
.artifact-shot-btn svg { width: 100%; height: 146px; display: block; }
.artifact-shot-cap {
  padding: 7px 11px;
  font-size: 11.5px;
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Floating Liquid Glass Proceed Approval Bar */
.proceed-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 25;
}
.proceed-bar {
  border-radius: 16px;
  padding: 7px 8px 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.proceed-note-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}
.proceed-note-input::placeholder { color: var(--ink2); }
.proceed-primary-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  transition: filter 0.14s ease, transform 0.12s ease;
}
.proceed-primary-btn:hover { filter: brightness(1.07); }
.proceed-primary-btn:active { transform: scale(0.97); }
.proceed-approved-state {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px;
}
.proceed-approved-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ok);
}
.proceed-approved-time {
  font-size: 11.5px;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}

/* Standalone Generative UI Artifact (latency_dashboard.html >450px) */
.sandbox-host {
  flex: 1;
  overflow-y: auto;
  background: var(--paper-elev);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}
.dash-range-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--track-bg);
}
.dash-range-btn {
  height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}
.dash-range-btn.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--chip-active-shadow);
}
.dash-filter-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.dash-kpi-card {
  border-radius: 12px;
  background: var(--card);
  border: var(--hairline) solid var(--line);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dash-kpi-label {
  font-size: 11.5px;
  color: var(--ink2);
}
.dash-kpi-val {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.dash-kpi-delta {
  font-size: 11px;
  font-weight: 600;
  color: var(--ok);
}
.dash-chart-card {
  border-radius: 12px;
  background: var(--card);
  border: var(--hairline) solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.dash-chart-readout {
  font-size: 11.5px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.dash-table-card {
  border-radius: 12px;
  background: var(--card);
  border: var(--hairline) solid var(--line);
  overflow: hidden;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.dash-table th,
.dash-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: var(--hairline) solid var(--line-soft);
}
.dash-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  background: var(--code-bar);
}
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table td.num,
.dash-table th.num { text-align: right; }

/* Builtin Board Fallback View */
.builtin-board-banner {
  padding: 9px 12px;
  background: var(--code-bg);
  border-bottom: var(--hairline) solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink2);
}

/* ==========================================================================
   iOS 27 iPhone 17 Pro Mobile Frame
   ========================================================================== */
.ios-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.iphone-chassis {
  width: 398px;
  height: min(842px, calc(100vh - 82px));
  max-height: 842px;
  padding: 10px;
  border-radius: 56px;
  background: linear-gradient(155deg, #3c3e45 0%, #1c1d21 48%, #32343a 100%);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.36),
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.22),
    inset 0 0 0 3px rgba(0, 0, 0, 0.55);
  position: relative;
}
.iphone-screen {
  width: 100%;
  height: 100%;
  border-radius: 47px;
  overflow: hidden;
  position: relative;
  background: var(--paper);
}

/* Status Bar + Dynamic Island */
.ios-statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  padding: 0 26px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  color: var(--ink);
}
.ios-time {
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dynamic-island {
  width: 116px;
  height: 32px;
  border-radius: 20px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 11px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}
.di-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2b3d63, #0b101f 70%);
}
.ios-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ios-battery {
  width: 22px;
  height: 11px;
  border-radius: 3.5px;
  border: 1.2px solid currentColor;
  padding: 1.5px;
  display: inline-flex;
  align-items: center;
}
.ios-battery-fill {
  width: 82%;
  height: 100%;
  border-radius: 1.5px;
  background: currentColor;
}

/* Push-Aside Drawers (SwarmApp.swift L448-L502) */
.ios-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 318px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding-top: 52px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ios-drawer-left { left: 0; }
.ios-drawer-right { right: 0; }

.iphone-screen.drawer-threads .ios-drawer-left {
  opacity: 1;
  pointer-events: auto;
}
.iphone-screen.drawer-swarm .ios-drawer-right {
  opacity: 1;
  pointer-events: auto;
}

.ios-drawer-head {
  padding: 4px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ios-drawer-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.ios-drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 18px;
}
.ios-drawer-search-foot {
  padding: 8px 14px 24px;
}
.ios-search-pill {
  height: 38px;
  border-radius: 999px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink2);
}
.ios-search-pill input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  outline: none;
}

.ios-swarm-drawer-head {
  padding: 6px 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: var(--hairline) solid var(--line-soft);
}
.ios-seg-track {
  flex: 1;
  height: 30px;
  padding: 2px;
  border-radius: 15px;
  background: var(--track-bg);
  display: flex;
}
.ios-seg-btn {
  flex: 1;
  height: 26px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
}
.ios-seg-btn.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--chip-active-shadow);
}
.ios-drawer-plus {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--track-bg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ios-swarm-scroll {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Main iPhone Card that pushes aside with 44px radius */
.ios-main-card {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.28s ease, box-shadow 0.28s ease;
}
.iphone-screen.drawer-threads .ios-main-card {
  transform: translateX(318px);
  border-radius: 44px;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.2);
}
.iphone-screen.drawer-swarm .ios-main-card {
  transform: translateX(-318px);
  border-radius: 44px;
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.2);
}
.ios-scrim {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.08);
}

/* iOS Top Bar + Messages Floating Header */
.ios-chat-header {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 4px 14px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
}
.ios-chat-header > * { pointer-events: auto; }
#ios-open-threads { justify-self: start; }
.ios-header-trailing {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ios-glass-circle {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    inset 0 0.5px 0 var(--glass-specular),
    inset 0 0 0 var(--hairline) var(--line),
    0 2px 8px rgba(0, 0, 0, 0.08);
}
.ios-mini-count {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ios-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ios-chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 132px 15px 96px;
}
.ios-transcript {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ios-composer-mask {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54px;
  z-index: 18;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--paper) 0%, transparent) 0%,
    color-mix(in srgb, var(--paper) 82%, transparent) 58%,
    var(--paper) 100%
  );
}
.ios-composer-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 0 14px 22px;
  pointer-events: none;
}
.ios-plus-btn { color: var(--ink2) !important; }

/* iOS PhoneCoverHost Full-Screen Layered Glass Sheet */
.ios-cover-host {
  position: absolute;
  inset: 0;
  z-index: 55;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding-top: 50px;
  animation: cover-slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cover-slide-up {
  from { transform: translateY(100%); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}
.ios-cover-header {
  padding: 6px 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ios-cover-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bubble);
  border: var(--hairline) solid var(--line);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.ios-cover-title-wrap {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 10px;
  background: var(--bubble);
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.ios-phone-tabstrip-wrap {
  padding: 0 12px 8px;
  border-bottom: var(--hairline) solid var(--line-soft);
}
.ios-phone-tabstrip {
  height: 32px;
  padding: 2px 16px 2px 2px;
  border-radius: 16px;
  background: var(--track-bg);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 88%, transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 88%, transparent 100%);
}
.ios-phone-tabstrip::-webkit-scrollbar { display: none; }
.ios-phone-tabchip {
  flex: 0 0 auto;
  min-width: 84px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  white-space: nowrap;
}
.ios-phone-tabchip.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--chip-active-shadow);
}
.ios-cover-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}
.ios-cover-host .artifact-scroll {
  padding-bottom: 108px;
}
.ios-cover-host .artifact-pane-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 84px;
  z-index: 18;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--paper) 0%, transparent) 0%,
    color-mix(in srgb, var(--paper) 82%, transparent) 38%,
    var(--paper) 64%,
    var(--paper) 100%
  );
}
.ios-cover-host .proceed-dock {
  bottom: 22px;
}
.ios-cover-host .worker-composer-dock {
  bottom: 16px;
}

.ios-home-indicator {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 5px;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.25;
  z-index: 70;
  pointer-events: none;
}

/* ==========================================================================
   Progress Reel Lightbox Modal (Scrubber + Clip-Path Before/After Wipe)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 14, 24, 0.56);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: swarm-fade 0.18s ease;
}
@keyframes swarm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.glass-modal {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  backdrop-filter: blur(34px) saturate(190%);
  border: var(--hairline) solid var(--glass-edge);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.38), inset 0 0.5px 0 var(--glass-specular);
  border-radius: 20px;
  overflow: hidden;
}

.reel-dialog {
  width: min(940px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.reel-modal-head {
  padding: 12px 16px;
  border-bottom: var(--hairline) solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reel-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.reel-head-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.reel-head-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.reel-head-sub {
  font-size: 11.5px;
  color: var(--ink2);
  font-variant-numeric: tabular-nums;
}
.reel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reel-mode-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--track-bg);
}
.reel-mode-btn {
  height: 25px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
}
.reel-mode-btn.active {
  background: var(--chip-active-bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--chip-active-shadow);
}
.reel-jump-btn {
  height: 29px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.reel-jump-btn:hover { filter: brightness(0.95); }
.modal-close-btn {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--track-bg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover { background: var(--hover); }

.reel-stage {
  position: relative;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--code-bg);
}
.wipe-container {
  position: relative;
  width: 100%;
  max-width: 820px;
  aspect-ratio: 16 / 10;
  border-radius: 13px;
  overflow: hidden;
  border: var(--hairline) solid var(--line);
  background: var(--paper);
  user-select: none;
  touch-action: none;
}
.wipe-layer {
  position: absolute;
  inset: 0;
}
.wipe-layer svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wipe-before {
  z-index: 2;
}
.wipe-after {
  z-index: 1;
}
.wipe-badge {
  position: absolute;
  top: 10px;
  z-index: 5;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: inset 0 0 0 0.5px var(--line), 0 2px 8px rgba(0,0,0,0.12);
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}
.wipe-badge.left { left: 10px; }
.wipe-badge.right { right: 10px; }

.wipe-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 6;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
  cursor: ew-resize;
  transform: translateX(-1px);
}
.wipe-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111111;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28), inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reel-controls {
  padding: 12px 16px 14px;
  border-top: var(--hairline) solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.reel-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--track-bg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.reel-nav-btn:hover { background: var(--hover); }
.reel-scrubber-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reel-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
.reel-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.reel-strip-item {
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid transparent;
  background: var(--code-bg);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px 4px 4px;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.reel-strip-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.reel-strip-item-svg {
  width: 44px;
  height: 28px;
  border-radius: 5px;
  overflow: hidden;
  flex: none;
}
.reel-strip-item-svg svg { width: 100%; height: 100%; display: block; }
.reel-strip-item-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.reel-strip-item-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.reel-strip-item-agent {
  font-size: 10.5px;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Quick Modal (File preview / Session Details) */
.quick-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}
.quick-modal-head {
  padding: 12px 16px;
  border-bottom: var(--hairline) solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.quick-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.quick-modal-body {
  padding: 14px 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}
.facts-card {
  border-radius: 12px;
  background: var(--card);
  border: var(--hairline) solid var(--line);
  overflow: hidden;
}
.fact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: var(--hairline) solid var(--line-soft);
  font-size: 12.5px;
}
.fact-row:last-child { border-bottom: 0; }
.fact-label { color: var(--ink2); }
.fact-val { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Toast Pill */
.toast-pill {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

/* Responsive fallback for smaller desktop viewports */
@media (max-width: 1020px) {
  .mac-sidebar { width: 218px; min-width: 196px; }
  .mac-pane { width: 380px; min-width: 310px; }
}
@media (max-width: 820px) {
  .stage { padding: 54px 8px 8px; }
  .mac-sidebar { display: none; }
}
