:root,
html[data-theme="light"] {
  --canvas: #e9eef7;
  --glass-bg: rgba(255, 255, 255, 0.64);
  --glass-bg-strong: rgba(255, 255, 255, 0.80);
  --glass-card: rgba(255, 255, 255, 0.74);
  --glass-inset: rgba(240, 244, 252, 0.66);
  --glass-border: rgba(255, 255, 255, 0.68);
  --glass-stroke: rgba(15, 23, 42, 0.09);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.88), inset 0 -1px 0 rgba(15, 23, 42, 0.04);
  --shadow-panel: 0 10px 32px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 18px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sheet: 0 28px 70px rgba(15, 23, 42, 0.22), 0 4px 16px rgba(15, 23, 42, 0.10);

  --ink: #111827;
  --ink-soft: #334155;
  --muted: #64748b;
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.12);
  --accent-glow: 0 0 0 3.5px rgba(0, 122, 255, 0.22);
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, 0.12);

  --codex: #2563eb;
  --gemini: #0d9488;
  --claude: #d97706;
  --scorpio: #7c3aed;
  --doubao: #e11d48; --deepseek: #4d6bfe;

  --ok: #15803d;
  --ok-bg: rgba(22, 163, 74, 0.13);
  --warn: #b45309;
  --warn-bg: rgba(245, 158, 11, 0.16);
  --err: #b91c1c;
  --err-bg: rgba(239, 68, 68, 0.13);
  --run: #007aff;
  --run-bg: rgba(0, 122, 255, 0.12);

  --code-bg: rgba(15, 23, 42, 0.06);
  --code-block-bg: #0f172a;
  --code-block-ink: #e2e8f0;
  --orb-1: rgba(66, 133, 244, 0.50);
  --orb-2: rgba(168, 85, 247, 0.42);
  --orb-3: rgba(236, 72, 153, 0.34);
  --orb-4: rgba(6, 182, 212, 0.38);
}

html[data-theme="dark"] {
  --canvas: #090d16;
  --glass-bg: rgba(22, 27, 39, 0.62);
  --glass-bg-strong: rgba(28, 34, 48, 0.78);
  --glass-card: rgba(26, 32, 46, 0.70);
  --glass-inset: rgba(14, 18, 28, 0.60);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-stroke: rgba(255, 255, 255, 0.10);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.17), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  --shadow-panel: 0 14px 40px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 6px 22px rgba(0, 0, 0, 0.30), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sheet: 0 32px 80px rgba(0, 0, 0, 0.68), 0 4px 18px rgba(0, 0, 0, 0.42);

  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.20);
  --accent-glow: 0 0 0 3.5px rgba(10, 132, 255, 0.30);
  --danger: #ff453a;
  --danger-soft: rgba(255, 69, 58, 0.18);

  --codex: #60a5fa;
  --gemini: #2dd4bf;
  --claude: #fbbf24;
  --scorpio: #a78bfa;
  --doubao: #fb7185;
  --deepseek: #7b93ff;

  --ok: #4ade80;
  --ok-bg: rgba(34, 197, 94, 0.18);
  --warn: #fbbf24;
  --warn-bg: rgba(245, 158, 11, 0.20);
  --err: #fca5a5;
  --err-bg: rgba(239, 68, 68, 0.20);
  --run: #60a5fa;
  --run-bg: rgba(10, 132, 255, 0.20);

  --code-bg: rgba(255, 255, 255, 0.10);
  --code-block-bg: rgba(7, 10, 18, 0.88);
  --code-block-ink: #e2e8f0;
  --orb-1: rgba(56, 139, 253, 0.40);
  --orb-2: rgba(155, 81, 255, 0.36);
  --orb-3: rgba(244, 63, 142, 0.30);
  --orb-4: rgba(20, 184, 166, 0.32);
}

/* =========================================================
   Extra Mode · 蓝白雾感毛玻璃前卫美学（柔和矢车菊钴蓝 × 薰衣草白雾 × 左锐右雾 EXTRA × 三叉星辉）
   ========================================================= */
html[data-theme="extra"] {
  --canvas: #e4ecfe;
  --glass-bg: rgba(255, 255, 255, 0.58);
  --glass-bg-strong: rgba(255, 255, 255, 0.84);
  --glass-card: rgba(255, 255, 255, 0.68);
  --glass-inset: rgba(255, 255, 255, 0.50);
  --glass-border: rgba(255, 255, 255, 0.86);
  --glass-stroke: rgba(15, 23, 42, 0.085);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.96), inset 0 -1px 0 rgba(52, 82, 168, 0.04);
  --shadow-panel: 0 12px 36px rgba(52, 82, 168, 0.08), 0 2px 6px rgba(52, 82, 168, 0.04);
  --shadow-card: 0 8px 28px rgba(48, 78, 162, 0.065), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --shadow-sheet: 0 28px 72px rgba(32, 56, 128, 0.16);

  --ink: #0B0E14;
  --ink-soft: #252C3B;
  --muted: #475166;
  --accent: #3B67E0;
  --accent-soft: rgba(59, 103, 224, 0.11);
  --accent-glow: 0 0 0 3px rgba(92, 134, 245, 0.24);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.11);

  --codex: #2563eb; --gemini: #0d9488; --claude: #d97706; --scorpio: #7c3aed; --doubao: #e11d48; --deepseek: #4d6bfe;
  --ok: #15803d; --ok-bg: rgba(22, 163, 74, 0.11);
  --warn: #b45309; --warn-bg: rgba(245, 158, 11, 0.14);
  --err: #b91c1c; --err-bg: rgba(239, 68, 68, 0.12);
  --run: #2563eb; --run-bg: rgba(37, 99, 235, 0.12);

  --code-bg: rgba(15, 23, 42, 0.055);
  --code-block-bg: #111622;
  --code-block-ink: #edf2ff;
  --orb-1: rgba(88, 132, 244, 0.44);
  --orb-2: rgba(255, 255, 255, 0.95);
  --orb-3: rgba(146, 178, 252, 0.48);
  --orb-4: rgba(224, 218, 255, 0.68);
}

html[data-font-pref="system"] { --ui-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; }
html[data-font-pref="grotesk"] { --ui-font-family: "Inter", "SF Pro Display", "HarmonyOS Sans SC", "PingFang SC", "Segoe UI", sans-serif; }
html[data-font-pref="serif"] { --ui-font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif; }
html[data-font-pref="mono"] { --ui-font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Monaco, "PingFang SC", monospace; }

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--canvas); color: var(--ink);
  font-family: var(--ui-font-family, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif);
  font-size: var(--ui-font-size, 14px);
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
}
code, pre { font-family: "SF Mono", ui-monospace, Menlo, Monaco, monospace; font-size: 12px; }
html {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.full { width: 100%; }

/* Gemini Mobile-Inspired Flowing RGB Aura Backdrop */
.ambient-bg {
  position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
  transition: filter 0.6s ease;
}
.aurora-ribbon {
  position: absolute; inset: -35%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    rgba(66, 133, 244, 0.22),
    rgba(139, 92, 246, 0.24),
    rgba(236, 72, 153, 0.18),
    rgba(6, 182, 212, 0.20),
    rgba(66, 133, 244, 0.22)
  );
  filter: blur(110px);
  opacity: 0.72;
  will-change: transform;
  animation: auroraSpin 26s linear infinite;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(92px); opacity: 0.92;
  will-change: transform, opacity;
}
.orb-1 {
  width: 540px; height: 540px; top: -150px; left: -110px; background: var(--orb-1);
  animation: orbDrift1 16s ease-in-out infinite alternate;
}
.orb-2 {
  width: 580px; height: 580px; top: 12%; right: -170px; background: var(--orb-2);
  animation: orbDrift2 20s ease-in-out infinite alternate;
}
.orb-3 {
  width: 480px; height: 480px; bottom: -170px; left: 26%; background: var(--orb-3);
  animation: orbDrift3 18s ease-in-out infinite alternate;
}
.orb-4 {
  width: 440px; height: 440px; bottom: 8%; right: 18%; background: var(--orb-4);
  animation: orbDrift4 22s ease-in-out infinite alternate;
}

body.is-thinking .aurora-ribbon { opacity: 1; animation-duration: 11s; }
body.is-thinking .orb-1 { animation-duration: 8s; }
body.is-thinking .orb-2 { animation-duration: 10s; }
body.is-thinking .orb-3 { animation-duration: 9s; }
body.is-thinking .orb-4 { animation-duration: 11s; }

@keyframes auroraSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}
@keyframes orbDrift1 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.82; }
  50% { transform: translate3d(110px, 75px, 0) scale(1.16); opacity: 1; }
  100% { transform: translate3d(45px, 140px, 0) scale(0.95); opacity: 0.86; }
}
@keyframes orbDrift2 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.84; }
  50% { transform: translate3d(-120px, 90px, 0) scale(1.14); opacity: 1; }
  100% { transform: translate3d(-65px, -85px, 0) scale(0.94); opacity: 0.80; }
}
@keyframes orbDrift3 {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.78; }
  50% { transform: translate3d(130px, -95px, 0) scale(1.18); opacity: 0.98; }
  100% { transform: translate3d(-90px, -55px, 0) scale(0.96); opacity: 0.84; }
}
@keyframes orbDrift4 {
  0% { transform: translate3d(0, 0, 0) scale(0.96); opacity: 0.76; }
  50% { transform: translate3d(-105px, -85px, 0) scale(1.16); opacity: 0.96; }
  100% { transform: translate3d(70px, -110px, 0) scale(1.04); opacity: 0.82; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-ribbon, .orb { animation: none !important; }
  .modal, .sidebar-backdrop { transition-duration: 80ms, 0s !important; }
  .modal-card { transform: none !important; }
  .sidebar { transition-duration: 1ms !important; }
}

/* Liquid Glass Material Primitives */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--specular), var(--shadow-panel);
}
.glass-sheet {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--specular), var(--shadow-sheet);
}

/* Floating Shell Layout */
.app {
  position: relative;
  display: grid; grid-template-columns: var(--sidebar-w, 296px) 10px minmax(0, 1fr);
  gap: 0; padding: 12px;
  height: 100%;
}
body.sidebar-collapsed .app {
  grid-template-columns: 0px 0px minmax(0, 1fr);
}
body.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar-resizer {
  opacity: 0; pointer-events: none; overflow: hidden; border: none; padding: 0;
}

.sidebar {
  border-radius: 22px; display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; min-height: 0;
  scrollbar-gutter: stable;
}
.sidebar-resizer {
  width: 10px; cursor: col-resize; position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  user-select: none; touch-action: none;
}
.sidebar-resizer::after {
  content: ""; width: 3px; height: 42px; border-radius: 999px;
  background: var(--glass-stroke); transition: background 0.15s ease, height 0.15s ease;
}
.sidebar-resizer:hover::after,
body.resizing-sidebar .sidebar-resizer::after {
  background: var(--accent); height: 68px;
}
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.42);
  z-index: 48;
  opacity: 0; pointer-events: none;
  transition: opacity 280ms var(--ease-out);
}
.sidebar-backdrop.is-in { opacity: 1; pointer-events: auto; }
@media (min-width: 961px) {
  .sidebar-backdrop { display: none !important; }
}
.brand { padding: 13px 15px 10px; border-bottom: 1px solid var(--glass-stroke); flex-shrink: 0; }
.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(140deg, #0a84ff, #6366f1 60%, #a855f7);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55), 0 6px 16px rgba(10,132,255,.32);
}
.brand-title { font-size: 15px; font-weight: 700; letter-spacing: -0.25px; }
.brand-sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.ok { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.55); }
.dot.warn { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.55); }

.side-block { padding: 10px 13px; border-bottom: 1px solid var(--glass-stroke); flex-shrink: 0; }
.side-block.grow { flex: 1 0 auto; min-height: 140px; border-bottom: none; }
.side-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.2px; margin-bottom: 7px;
}
.side-foot { padding: 10px 13px 12px; border-top: 1px solid var(--glass-stroke); flex-shrink: 0; }
.count-pill {
  font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: var(--glass-inset); color: var(--muted);
}

/* Thread List with Folders, Rename & Drag-and-Drop */
.side-head-btns { display: inline-flex; align-items: center; gap: 5px; }
.extra-brand-bar { display: none; }
.thread-list { display: flex; flex-direction: column; gap: 4px; max-height: 235px; overflow-y: auto; padding-right: 2px; }
.folder-group {
  border-radius: 12px; border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.folder-group.drag-over {
  border-color: var(--accent); background: var(--accent-soft);
}
.folder-head {
  display: flex; align-items: center; gap: 4px; padding: 5px 6px;
  border-radius: 10px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); user-select: none;
}
.folder-head:hover { background: var(--glass-inset); }
.folder-caret { width: 14px; text-align: center; font-size: 10px; color: var(--muted); flex-shrink: 0; }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-children { padding-left: 12px; margin: 2px 0 4px; display: flex; flex-direction: column; gap: 3px; border-left: 1px dashed var(--glass-stroke); margin-left: 11px; }
.folder-children.collapsed { display: none; }
.folder-empty { font-size: 11px; color: var(--muted); padding: 4px 8px; }
.root-dropzone {
  font-size: 11px; color: var(--muted); text-align: center;
  border: 1px dashed var(--glass-stroke); border-radius: 10px;
  padding: 5px 8px; margin-top: 4px; transition: all 0.15s ease;
}
.root-dropzone.drag-over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.thread-row {
  display: flex; align-items: center; gap: 2px; border-radius: 12px;
  border: 1px solid transparent;
  transition: background 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}
.thread-row.dragging { opacity: 0.45; }
.thread-row.merge-over { border-color: var(--accent); background: var(--accent-soft); }
.thread-row:hover { background: var(--glass-inset); }
.thread-row.active {
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 4px 12px rgba(0, 122, 255, 0.28);
}
.thread-item {
  flex: 1; min-width: 0; text-align: left; padding: 6px 8px;
  border: none; border-radius: 12px; background: transparent; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  color: var(--ink); font-size: 12.5px; font-weight: 500;
}
.thread-row.active .thread-item { color: #fff; font-weight: 600; }
.thread-row.active .muted { color: rgba(255, 255, 255, 0.8); }
.thread-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-actions { display: inline-flex; align-items: center; gap: 1px; flex-shrink: 0; margin-right: 3px; }
.item-icon-btn, .thread-del {
  flex-shrink: 0; width: 22px; height: 22px;
  border: none; border-radius: 7px; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
  opacity: 0; transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  font-size: 12px;
}
.thread-row:hover .item-icon-btn,
.thread-row:focus-within .item-icon-btn,
.thread-row:hover .thread-del,
.thread-row:focus-within .thread-del,
.folder-head:hover .item-icon-btn,
.folder-head:focus-within .item-icon-btn { opacity: 1; }
.item-icon-btn:hover { background: var(--code-bg); color: var(--ink); }
.thread-del:hover { background: var(--danger-soft); color: var(--danger); }
.thread-row.active .item-icon-btn,
.thread-row.active .thread-del { color: rgba(255, 255, 255, 0.78); }
.thread-row.active .item-icon-btn:hover,
.thread-row.active .thread-del:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* Seats & Tasks */
.seat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.seat-item {
  padding: 7px 10px; border-radius: 12px;
  background: var(--glass-inset); border: 1px solid var(--glass-stroke);
}
.seat-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.seat-name { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.seat-hint { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }
.badge.run { background: var(--run-bg); color: var(--run); }

.bench-box {
  margin-top: 8px; padding: 8px 10px; border-radius: 12px;
  background: var(--glass-inset); border: 1px solid var(--glass-stroke);
  font-size: 11.5px; line-height: 1.5;
}
.task-list { display: flex; flex-direction: column; gap: 6px; }
.task-item {
  padding: 9px 11px; border-radius: 13px;
  background: var(--glass-inset); border: 1px solid var(--glass-stroke);
}
.task-item.needs { border-color: var(--warn); background: var(--warn-bg); }
.task-title { font-weight: 600; font-size: 12.5px; margin-bottom: 5px; word-break: break-word; line-height: 1.4; }
.task-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }

/* Main Floating Column */
.main {
  display: flex; flex-direction: column; gap: 10px;
  height: 100%; min-height: 0;
  min-width: 0;
}
.topbar {
  border-radius: 18px; padding: 11px 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  flex-shrink: 0;
}
.topbar-info { min-width: 0; }
.topbar-title { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Centered Scrollable Timeline */
.timeline {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 6px 12px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty {
  width: min(600px, 100%); margin: auto; text-align: center;
  background: var(--glass-card); backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-border); border-radius: 24px; padding: 32px 28px;
  box-shadow: var(--specular), var(--shadow-panel);
}
.empty h2 { margin: 0 0 10px; font-size: 18px; letter-spacing: -0.3px; }
.empty p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.msg-card {
  width: min(920px, 100%);
  background: var(--glass-card);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 20px; padding: 14px 18px;
  box-shadow: var(--specular), var(--shadow-card);
}
.msg-card.human {
  background: var(--glass-bg-strong);
  border-color: rgba(0, 122, 255, 0.28);
}
.msg-card.escalation { border-color: var(--warn); background: var(--warn-bg); }
.msg-card.completed { border-color: rgba(34, 197, 94, 0.42); }
.msg-card.plan { border-color: rgba(0, 122, 255, 0.30); }

.msg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.msg-author { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; }
.msg-head-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-seat { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.msg-body { white-space: normal; word-break: break-word; font-size: var(--ui-font-size, 14px); line-height: 1.68; color: var(--ink); }
.msg-body.plain-text { white-space: pre-wrap; }
.quote-ref {
  font-size: 12px; color: var(--muted); background: var(--glass-inset);
  border-left: 3px solid var(--accent); padding: 6px 10px; border-radius: 8px; margin-bottom: 8px;
}

.receipt-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--glass-stroke);
}
.r-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--glass-inset); color: var(--muted);
  display: inline-flex; align-items: center; gap: 4px; font-weight: 500;
}
.r-chip.replied { background: var(--ok-bg); color: var(--ok); }
.r-chip.received, .r-chip.dispatched { background: var(--run-bg); color: var(--run); }
.r-chip.offline { background: var(--warn-bg); color: var(--warn); }
.r-chip.error, .r-chip.timeout { background: var(--err-bg); color: var(--err); }

/* Live Collaboration Thinking & Streaming Panel */
.live-panel {
  margin-top: 10px; padding: 10px 12px; border-radius: 14px;
  background: var(--glass-inset); border: 1px solid rgba(0, 122, 255, 0.24);
  display: flex; flex-direction: column; gap: 8px;
}
.live-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--accent);
}
.live-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  display: inline-block; margin-right: 6px; animation: pulse 1.4s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 7px; }
.live-seat-card {
  padding: 8px 10px; border-radius: 11px;
  background: var(--glass-card); border: 1px solid var(--glass-stroke);
  font-size: 12px; line-height: 1.48;
}
.live-seat-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 600; margin-bottom: 4px; }
.live-seat-snippet {
  color: var(--ink-soft); white-space: pre-wrap; word-break: break-word;
  max-height: 76px; overflow-y: auto; font-size: 11.5px;
}

.stream-box {
  margin-top: 8px; padding: 10px 12px; border-radius: 13px;
  background: var(--glass-inset); border: 1px solid var(--glass-stroke);
  font-size: 13px; line-height: 1.6;
}
.thought-box {
  margin-top: 6px; padding: 7px 11px; border-radius: 11px;
  background: rgba(139, 92, 246, 0.10); border: 1px dashed rgba(139, 92, 246, 0.34);
  font-size: 12px; color: var(--scorpio); white-space: pre-wrap; max-height: 96px; overflow-y: auto;
}

/* Stepper */
.stepper {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 11px; border-radius: 13px;
  background: var(--glass-inset); border: 1px solid var(--glass-stroke); font-size: 11.5px;
}
.step-node { padding: 3px 10px; border-radius: 999px; background: var(--code-bg); color: var(--muted); font-weight: 500; white-space: nowrap; }
.step-node.done { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.step-node.active { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 2px 10px rgba(0, 122, 255, 0.30); }
.step-sep { color: var(--muted); opacity: 0.6; }
.step-timer { margin-left: auto; font-family: "SF Mono", Menlo, monospace; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Markdown Typography */
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h2 { margin: 14px 0 8px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.2px; color: var(--ink); }
.md-body h3 { margin: 12px 0 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.md-body h4 { margin: 10px 0 5px; font-size: 14px; font-weight: 700; color: var(--ink); }
.md-body p { margin: 6px 0; }
.md-body ul, .md-body ol { margin: 6px 0 8px 20px; padding: 0; }
.md-body li { margin: 3px 0; }
.md-body li.md-sub-li { margin-left: 16px; list-style-type: circle; }
.md-body code { background: var(--code-bg); padding: 1px 5px; border-radius: 5px; color: var(--ink); }
.md-body a { color: var(--accent); text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-hr { border: none; border-top: 1px solid var(--glass-stroke); margin: 12px 0; }
.md-pre {
  margin: 8px 0; padding: 11px 13px; border-radius: 12px;
  background: var(--code-block-bg); color: var(--code-block-ink);
  overflow-x: auto; line-height: 1.55;
}
.md-pre code { background: transparent; padding: 0; color: inherit; font-size: 12px; }
.md-table-wrap {
  margin: 10px 0; overflow-x: auto; border-radius: 12px;
  border: 1px solid var(--glass-stroke); background: var(--glass-inset);
}
.md-table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table-wrap th, .md-table-wrap td {
  padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--glass-stroke);
  vertical-align: top;
}
.md-table-wrap th { font-weight: 700; background: var(--code-bg); color: var(--ink); white-space: nowrap; }
.md-table-wrap tr:last-child td { border-bottom: none; }
.md-body blockquote {
  margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent);
  background: var(--glass-inset); border-radius: 0 10px 10px 0; color: var(--ink-soft);
}
.drawer-actions { margin-top: 6px; display: flex; justify-content: flex-end; }

/* Internal Discussion Drawer */
.internal-drawer {
  margin-top: 10px; border: 1px solid var(--glass-stroke);
  border-radius: 14px; background: var(--glass-inset); overflow: hidden;
}
.internal-drawer summary {
  cursor: pointer; padding: 8px 12px; font-size: 12px;
  color: var(--ink-soft); font-weight: 600; user-select: none;
}
.internal-list { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.internal-item {
  padding: 9px 12px; border-radius: 12px;
  background: var(--glass-card); border: 1px solid var(--glass-stroke); font-size: 12.5px;
}
.internal-item-head { font-weight: 600; font-size: 12px; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.phase-tag {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: var(--code-bg); color: var(--muted); margin-left: 6px;
}

/* Floating Composer Dock */
.composer {
  position: relative;
  border-radius: 22px; padding: 11px 15px 13px; flex-shrink: 0;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
body.is-thinking .composer {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: var(--specular), 0 0 0 1px rgba(66, 133, 244, 0.25), 0 10px 36px rgba(139, 92, 246, 0.22);
}
.composer-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 10px; margin-bottom: 9px;
}
.composer-controls-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0;
}
.seg {
  display: inline-flex; align-items: center; flex-wrap: nowrap; flex-shrink: 0;
  background: var(--glass-inset);
  border: 1px solid var(--glass-stroke); border-radius: 999px; padding: 3px; gap: 2px;
}
.seg button {
  border: none; background: transparent; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; line-height: 1.35; cursor: pointer; color: var(--muted); font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.16s ease, color 0.16s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.active {
  background: var(--glass-bg-strong); color: var(--ink); font-weight: 600;
  box-shadow: var(--specular), 0 2px 6px rgba(0, 0, 0, 0.08);
}
.theme-seg button { padding: 4px 9px; font-size: 11.5px; }

.target-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.t-pill {
  border: 1px solid var(--glass-stroke); background: var(--glass-inset);
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; line-height: 1.35;
  cursor: pointer; color: var(--muted); font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  transition: all 0.15s ease;
}
.t-pill.on {
  border-color: transparent; background: var(--accent); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 2px 8px rgba(0, 122, 255, 0.25);
}
.t-pill.off-seat { opacity: 0.5; }

.context-banner {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(0, 122, 255, 0.28); border-radius: 11px;
  padding: 6px 11px; font-size: 12px; margin-bottom: 8px;
}
.upload-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.up-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok); font-weight: 500;
}
.upload-trigger { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }

.composer-row { display: flex; gap: 10px; align-items: stretch; }
textarea, .glass-input {
  flex: 1; border: 1px solid var(--glass-stroke); border-radius: 14px;
  padding: 10px 13px; font: inherit; outline: none;
  background: var(--glass-inset); color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
textarea { resize: vertical; min-height: 60px; max-height: 170px; }
textarea::placeholder, .glass-input::placeholder { color: var(--muted); }
textarea:focus, .glass-input:focus {
  border-color: var(--accent); background: var(--glass-bg-strong);
  box-shadow: var(--accent-glow);
}

/* Buttons */
button { font: inherit; }
.btn-primary {
  background: linear-gradient(180deg, #1b8cff, var(--accent));
  color: #fff; border: none; border-radius: 14px; padding: 8px 20px;
  font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 14px rgba(0, 122, 255, 0.30);
  transition: transform 0.12s ease, filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary-soft {
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(0, 122, 255, 0.25); border-radius: 999px;
  padding: 5px 13px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.btn-primary-soft:hover { background: var(--accent); color: #fff; }
.btn-pill-soft {
  background: var(--accent-soft); color: var(--accent); border: none;
  border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.btn-pill-soft:hover { background: var(--accent); color: #fff; }
.btn-secondary {
  background: var(--glass-inset); color: var(--ink);
  border: 1px solid var(--glass-stroke); border-radius: 12px;
  padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--glass-bg-strong); }
.btn-ghost {
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--glass-stroke); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 500; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.btn-ghost:hover { color: var(--ink); background: var(--glass-inset); }
.btn-link { background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn-danger {
  background: linear-gradient(180deg, #f43f5e, var(--danger));
  color: #fff; border: none; border-radius: 12px; padding: 8px 18px;
  font-weight: 600; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 4px 12px rgba(225, 29, 72, 0.30);
}
.btn-copy {
  background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; flex-shrink: 0;
}

/* Modals */
.modal {
  position: fixed; inset: 0; background: rgba(7, 10, 18, 0.48);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 60;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 220ms var(--ease-out), visibility 0s linear 220ms;
}
.modal.is-in {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 220ms var(--ease-out), visibility 0s linear 0s;
}
#auth-overlay { z-index: 10002; }
.modal-card {
  border-radius: 24px; width: min(760px, 100%); max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.96); transform-origin: center;
  transition: transform 220ms var(--ease-out);
}
.modal.is-in .modal-card { transform: scale(1); }
.modal-card.modal-sm { width: min(410px, 100%); }
.modal-head, .modal-foot {
  padding: 15px 20px; border-bottom: 1px solid var(--glass-stroke);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.modal-foot { border-bottom: none; border-top: 1px solid var(--glass-stroke); }
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; }
.confirm-text { margin: 0; font-size: 14px; line-height: 1.55; }

.guide-box {
  border: 1px solid var(--glass-stroke); border-radius: 15px;
  padding: 13px 15px; background: var(--glass-inset);
}
.guide-title { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.code-row {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--code-block-bg); color: var(--code-block-ink);
  border-radius: 10px; padding: 9px 12px; margin-top: 6px;
}
.code-row code, .code-row pre { flex: 1; margin: 0; white-space: pre-wrap; word-break: break-all; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.form-grid label, .cfg-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-grid input, .cfg-row input, .cfg-row select {
  border: 1px solid var(--glass-stroke); border-radius: 10px; padding: 7px 10px;
  font-size: 12.5px; background: var(--glass-card); color: var(--ink); outline: none;
}
.form-grid input:focus, .cfg-row input:focus, .cfg-row select:focus {
  border-color: var(--accent); box-shadow: var(--accent-glow);
}
.cfg-grid { display: flex; flex-direction: column; gap: 8px; }
.cfg-row {
  display: grid; grid-template-columns: 92px 1fr 1fr 86px;
  gap: 8px; align-items: end; padding: 9px 10px;
  border: 1px solid var(--glass-stroke); border-radius: 12px; background: var(--glass-card);
}

/* Visual Division Board, Round-1 Reveal & Changelog */
.plan-board { display: flex; flex-direction: column; gap: 10px; }
.plan-board-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.plan-board-summary { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.plan-board-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.plan-seat-card {
  border: 1px solid var(--glass-stroke); border-radius: 14px; padding: 11px 13px;
  background: var(--glass-inset); display: flex; flex-direction: column; gap: 6px;
}
.plan-seat-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-seat-who { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.spec-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: var(--accent-soft, rgba(59,130,246,0.14)); color: var(--accent); font-weight: 600;
}
.plan-subtask { font-size: 13px; line-height: 1.5; color: var(--ink); }
.plan-meta-line { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.r1-board { display: flex; flex-direction: column; gap: 8px; }
.r1-board-head { font-size: 13px; font-weight: 600; color: var(--ink); }
.r1-seat-item {
  border: 1px solid var(--glass-stroke); border-radius: 12px; padding: 8px 12px;
  background: var(--glass-inset);
}
.r1-seat-item summary {
  cursor: pointer; list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; font-size: 13px;
}
.r1-seat-item summary::-webkit-details-marker { display: none; }
.r1-seat-title { display: flex; align-items: center; gap: 6px; font-weight: 700; flex-shrink: 0; }
.r1-seat-preview { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.r1-seat-full { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--glass-stroke); }

.cl-release {
  border: 1px solid var(--glass-stroke); border-radius: 14px; padding: 13px 15px;
  background: var(--glass-inset);
}
.cl-release.latest { border-color: var(--accent); }
.cl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.cl-title { font-weight: 700; font-size: 14px; }
.cl-list { margin: 6px 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; }

/* Announcement Board Button, Unread Red Dot & Pinned Hero Card */
.btn-announce {
  position: relative; display: inline-flex; align-items: center; gap: 5px; font-weight: 600;
}
.btn-announce.has-unread {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.08);
  color: var(--ink);
}
.unread-dot {
  position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #ff3b30;
  border: 1.5px solid #ffffff;
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.65);
  pointer-events: none;
  animation: unreadDotPulse 1.8s ease-out infinite;
}
html[data-theme="dark"] .unread-dot { border-color: #161b27; }
@keyframes unreadDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.68); transform: scale(1); }
  70% { box-shadow: 0 0 0 7px rgba(255, 59, 48, 0); transform: scale(1.08); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); transform: scale(1); }
}
.announce-hero {
  border-radius: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.14) 0%, rgba(59, 103, 224, 0.13) 55%, rgba(22, 163, 74, 0.12) 100%);
  border: 1px solid rgba(217, 119, 6, 0.36);
  box-shadow: var(--specular), 0 6px 20px rgba(217, 119, 6, 0.08);
  display: flex; flex-direction: column; gap: 7px;
}
.announce-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.announce-pin {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: rgba(217, 119, 6, 0.18); color: var(--claude); letter-spacing: 0.2px;
}
.announce-hero-title { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.2px; line-height: 1.4; }
.announce-hero-desc { font-size: 13px; line-height: 1.6; color: var(--ink-soft); }

/* Display & Font/Scale Controls */
.display-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.disp-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 9px 11px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--glass-stroke); background: var(--glass-card); color: var(--ink);
  font-weight: 600; font-size: 12.5px; text-align: left; transition: all 0.15s ease;
}
.disp-opt span { font-size: 11px; font-weight: 400; color: var(--muted); }
.disp-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.scale-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.scale-row input[type="range"] { flex: 1; accent-color: var(--accent); cursor: pointer; }
.scale-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.scale-presets button.active { background: var(--accent); color: #fff; }

/* Extra Mode Architectural & Frosted Blue-White Overrides */
.extra-dof-stage, .extra-fg-sparkles { display: none; }
html[data-theme="extra"] body {
  background:
    radial-gradient(ellipse 80% 75% at 8% 12%, rgba(92, 134, 245, 0.38) 0%, rgba(132, 166, 250, 0.14) 44%, transparent 72%),
    radial-gradient(ellipse 70% 70% at 90% 82%, rgba(235, 230, 255, 0.82) 0%, rgba(246, 248, 255, 0.35) 48%, transparent 76%),
    linear-gradient(122deg, #7EA3F6 0%, #ACC4FC 24%, #DCE6FE 50%, #F5F7FF 76%, #F1EEFC 100%);
  font-family: var(--ui-font-family, 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif);
}
html[data-theme="extra"] .aurora-ribbon { display: none; }
html[data-theme="extra"] .orb { filter: blur(64px); opacity: 0.62; }
html[data-theme="extra"] .extra-dof-stage {
  display: block; position: absolute; inset: 0; pointer-events: none; user-select: none; overflow: hidden;
}
.extra-wordmark {
  position: absolute; left: clamp(24px, 16vw, 310px); top: 49%; transform: translateY(-50%) scaleY(1.08);
  font-family: 'DIN Condensed', 'Avenir Next Condensed', 'Arial Narrow', sans-serif;
  font-size: clamp(160px, 25vw, 380px); font-weight: 700; line-height: 0.86;
  letter-spacing: 0.08em; white-space: nowrap;
}
.extra-wordmark.sharp { color: rgba(255, 255, 255, 0.68); -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 32%, transparent 62%); mask-image: linear-gradient(90deg, #000 0%, #000 32%, transparent 62%); }
.extra-wordmark.mid { color: rgba(255, 255, 255, 0.52); filter: blur(3.5px); -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 48%, transparent 78%); mask-image: linear-gradient(90deg, transparent 20%, #000 48%, transparent 78%); }
.extra-wordmark.deep { color: rgba(110, 146, 238, 0.34); filter: blur(11px); -webkit-mask-image: linear-gradient(90deg, transparent 42%, #000 74%, #000 100%); mask-image: linear-gradient(90deg, transparent 42%, #000 74%, #000 100%); }
.extra-star { position: absolute; color: #FFFFFF; filter: drop-shadow(0 0 6px rgba(255,255,255,0.95)) drop-shadow(0 0 12px rgba(92,134,245,0.45)); animation: extraTwinkle 4.8s ease-in-out infinite alternate; }
.extra-star.on-light { color: #7C9FF5; filter: drop-shadow(0 0 4px rgba(255,255,255,0.95)) drop-shadow(0 0 10px rgba(79,120,232,0.5)); }
.extra-star.s1 { width: 24px; height: 24px; top: 10%; left: 10%; }
.extra-star.s2 { width: 16px; height: 16px; top: 68%; left: 14%; animation-delay: -1.4s; }
.extra-star.s3 { width: 20px; height: 20px; top: 26%; left: 26%; animation-delay: -2.6s; }
.extra-star.s4 { width: 14px; height: 14px; bottom: 16%; left: 28%; animation-delay: -0.9s; }
.extra-star.s5 { width: 18px; height: 18px; top: 48%; left: 6%; animation-delay: -3.2s; }
.extra-star.s6 { width: 24px; height: 24px; top: 12%; right: 10%; animation-delay: -2.1s; }
.extra-star.s7 { width: 16px; height: 16px; top: 44%; right: 6%; animation-delay: -3.5s; }
.extra-star.s8 { width: 22px; height: 22px; bottom: 18%; right: 12%; animation-delay: -1.1s; }
.extra-star.s9 { width: 15px; height: 15px; top: 28%; right: 26%; animation-delay: -2.9s; }
.extra-star.s10 { width: 13px; height: 13px; top: 18%; left: 42%; animation-delay: -1.8s; }
.extra-star.s11 { width: 18px; height: 18px; bottom: 30%; right: 28%; animation-delay: -0.6s; }
.extra-star.s12 { width: 14px; height: 14px; top: 66%; right: 18%; animation-delay: -3.8s; }
.extra-dot { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff, 0 0 14px rgba(88,132,244,0.65); animation: extraFloat 6.5s ease-in-out infinite alternate; }
.extra-dot.on-light { background: #7D9FF5; box-shadow: 0 0 5px rgba(255,255,255,0.95), 0 0 12px rgba(88,132,244,0.55); }
.extra-dot.d1 { top: 20%; left: 14%; } .extra-dot.d2 { top: 76%; left: 22%; animation-delay: -2s; }
.extra-dot.d3 { top: 38%; left: 32%; animation-delay: -3.5s; } .extra-dot.d4 { bottom: 22%; left: 10%; animation-delay: -5s; }
.extra-dot.d5 { top: 14%; left: 34%; animation-delay: -1.4s; } .extra-dot.d6 { top: 58%; left: 8%; animation-delay: -2.7s; }
.extra-dot.d7 { top: 32%; left: 19%; animation-delay: -4.2s; } .extra-dot.d8 { bottom: 12%; left: 38%; animation-delay: -1.1s; }
.extra-dot.d9 { top: 22%; right: 16%; animation-delay: -1.2s; } .extra-dot.d10 { top: 60%; right: 10%; animation-delay: -3.2s; }
.extra-dot.d11 { bottom: 14%; right: 22%; animation-delay: -4.1s; } .extra-dot.d12 { top: 36%; right: 28%; animation-delay: -2.4s; }
.extra-dot.d13 { top: 16%; right: 32%; animation-delay: -0.8s; } .extra-dot.d14 { bottom: 28%; right: 8%; animation-delay: -3.9s; }
.extra-dot.d15 { top: 44%; left: 46%; animation-delay: -2.9s; } .extra-dot.d16 { top: 72%; right: 34%; animation-delay: -4.7s; }
html[data-theme="extra"] .extra-fg-sparkles {
  display: block; position: fixed; inset: 0; pointer-events: none; user-select: none; overflow: hidden; z-index: 12;
}
.extra-fg-sparkles .fg-s1 { width: 14px; height: 14px; top: 8%; left: 20%; opacity: 0.85; }
.extra-fg-sparkles .fg-s2 { width: 16px; height: 16px; top: 11%; right: 14%; animation-delay: -1.8s; opacity: 0.78; }
.extra-fg-sparkles .fg-s3 { width: 13px; height: 13px; bottom: 22%; right: 7%; animation-delay: -3.1s; opacity: 0.72; }
.extra-fg-sparkles .fg-s4 { width: 12px; height: 12px; bottom: 14%; left: 12%; animation-delay: -2.4s; opacity: 0.8; }
.extra-fg-sparkles .fg-s5 { width: 15px; height: 15px; top: 52%; right: 22%; animation-delay: -0.9s; opacity: 0.65; }
.extra-fg-sparkles .fg-d1 { top: 15%; left: 24%; } .extra-fg-sparkles .fg-d2 { top: 20%; right: 19%; animation-delay: -2.1s; }
.extra-fg-sparkles .fg-d3 { bottom: 19%; right: 15%; animation-delay: -3.6s; }
@keyframes extraTwinkle { 0% { opacity: 0.42; transform: scale(0.84) rotate(-8deg); } 100% { opacity: 0.96; transform: scale(1.12) rotate(8deg); } }
@keyframes extraFloat { 0% { transform: translate3d(0, 0, 0); opacity: 0.45; } 100% { transform: translate3d(6px, -10px, 0); opacity: 0.95; } }
html[data-theme="extra"] .glass-panel {
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-panel), var(--specular);
}
html[data-theme="extra"] .sidebar { background: rgba(255, 255, 255, 0.48); border-radius: 18px; }
html[data-theme="extra"] .topbar, html[data-theme="extra"] .composer { background: rgba(255, 255, 255, 0.62); border-radius: 18px; }
html[data-theme="extra"] .msg-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(155%); -webkit-backdrop-filter: blur(20px) saturate(155%);
  border: 1px solid rgba(255, 255, 255, 0.88); border-radius: 16px;
}
html[data-theme="extra"] .msg-card.human { background: rgba(255, 255, 255, 0.84); border-color: rgba(59, 103, 224, 0.24); }
html[data-theme="extra"] .msg-card.completed { border-color: rgba(21, 128, 61, 0.34); }
html[data-theme="extra"] .brand-mark {
  border-radius: 8px; background: #0B0E14; color: #FFFFFF;
  font-family: 'DIN Condensed', 'Avenir Next Condensed', 'PingFang SC', sans-serif;
  font-weight: 700; letter-spacing: 0.04em; font-size: 16px;
  box-shadow: 0 4px 14px rgba(11, 14, 20, 0.20);
}
html[data-theme="extra"] .brand-title, html[data-theme="extra"] .topbar-title {
  font-family: 'DIN Condensed', 'Avenir Next Condensed', 'PingFang SC', sans-serif;
  letter-spacing: 0.03em; font-weight: 700; color: #0B0E14;
}
html[data-theme="extra"] .extra-brand-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
html[data-theme="extra"] .extra-hatch { width: 48px; height: 6px; flex-shrink: 0; background: repeating-linear-gradient(-55deg, rgba(11,14,20,0.62) 0 1.5px, transparent 1.5px 4.5px); }
html[data-theme="extra"] .extra-micro { font-family: 'DIN Condensed', 'Avenir Next Condensed', 'SF Mono', sans-serif; font-size: 11px; letter-spacing: 0.14em; color: #2B313F; font-weight: 700; }
html[data-theme="extra"] .thread-row.active, html[data-theme="extra"] .btn-primary,
html[data-theme="extra"] .step-node.active, html[data-theme="extra"] .scale-presets button.active {
  background: #0B0E14; color: #FFFFFF; box-shadow: 0 6px 18px rgba(11, 14, 20, 0.16);
}
html[data-theme="extra"] .t-pill.on, html[data-theme="extra"] .seg button.active {
  background: rgba(255, 255, 255, 0.92); color: #0B0E14; border-color: rgba(11, 14, 20, 0.26);
  box-shadow: 0 2px 8px rgba(52, 82, 168, 0.08); font-weight: 600;
}
html[data-theme="extra"] .thread-row.active .thread-item, html[data-theme="extra"] .thread-row.active .muted,
html[data-theme="extra"] .thread-row.active .item-icon-btn, html[data-theme="extra"] .thread-row.active .thread-del { color: #FFFFFF; }
html[data-theme="extra"] .btn-primary-soft { background: #0B0E14; color: #FFFFFF; border-color: #0B0E14; border-radius: 999px; }
html[data-theme="extra"] .btn-primary-soft:hover { background: #2B313F; color: #FFFFFF; }
html[data-theme="extra"] .pill-seat { border-radius: 2px; }
html[data-theme="extra"] .disp-opt.active { border-color: #3B67E0; background: rgba(59, 103, 224, 0.09); }

/* Custom Subtle Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.58); }

/* v2.6.0 Verbosity Seg, TXT Export & Clickable Needs-Human Jump */
#verbosity-seg button { padding: 4px 8px; font-size: 11.5px; }
#btn-export-thread { font-weight: 600; }
.thread-right-meta { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.thread-needs-pill { font-size: 10px; padding: 1px 6px; }
.clickable-task { cursor: pointer; transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease; }
.clickable-task:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); }
.task-item.needs.clickable-task:hover { border-color: var(--warn); box-shadow: 0 4px 14px rgba(217, 119, 6, 0.18); }
.task-meta-btns { display: inline-flex; align-items: center; gap: 6px; }
.badge-jump, .needs-jump, .step-needs-jump {
  cursor: pointer; border: 1px solid rgba(217, 119, 6, 0.42);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.needs-jump { background: var(--warn-bg); color: var(--warn); padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.step-needs-jump { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 700; }
.badge-jump:hover, .needs-jump:hover, .step-needs-jump:hover { transform: translateY(-1px); filter: brightness(0.97); box-shadow: 0 2px 8px rgba(217, 119, 6, 0.22); }
@keyframes flashTargetCard {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.55); }
  45% { box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.35); }
  100% { box-shadow: var(--specular), var(--shadow-panel); }
}
.msg-card.flash-target { animation: flashTargetCard 1.4s ease; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr !important; padding: 8px; }
  .sidebar-resizer { display: none !important; }
  .sidebar,
  html[data-theme="extra"] .sidebar {
    position: fixed; left: 8px; top: 8px; bottom: 8px; width: min(320px, 86vw);
    z-index: 55; transform: translateX(-115%); transition: transform 280ms var(--ease-drawer);
    opacity: 1 !important; pointer-events: auto !important;
    background: rgba(250, 252, 255, 0.98) !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.26);
  }
  html[data-theme="dark"] .sidebar {
    background: rgba(18, 22, 33, 0.98) !important;
  }
  .sidebar.drawer-open { transform: translateX(0); }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 9px 12px; }
  .topbar-info { flex: 1 1 160px; }
  .topbar-sub { display: none; }
  .topbar-actions { flex: 1 1 100%; max-width: 100%; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .topbar-actions::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .composer { padding: 9px 11px 11px; }
  .cfg-row { grid-template-columns: 1fr 1fr; }
}
@media (hover: none), (max-width: 960px) {
  .item-icon-btn, .thread-del { opacity: 0.85; }
}
@media (max-width: 640px) {
  textarea, .glass-input { font-size: 16px; }
}

/* v2.6.12 · 用户消息醒目区分：淡蓝底 + 左侧强调条 */
.msg-card.human,
html[data-theme] .msg-card.human {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.13), rgba(88, 86, 214, 0.09)), var(--glass-card);
  border: 1px solid rgba(0, 122, 255, 0.38);
  border-left: 4px solid #007aff;
}
html[data-theme="dark"] .msg-card.human {
  background: linear-gradient(135deg, rgba(64, 156, 255, 0.24), rgba(125, 122, 255, 0.16)), var(--glass-card);
  border-color: rgba(100, 170, 255, 0.45);
  border-left-color: #4da3ff;
}
html[data-theme="extra"] .msg-card.human {
  background: linear-gradient(135deg, rgba(59, 103, 224, 0.16), rgba(120, 90, 230, 0.10)), rgba(255, 255, 255, 0.82);
  border-color: rgba(59, 103, 224, 0.42);
  border-left-color: #3b67e0;
}

/* v2.6.14 · 网页原生图片展示卡片 + 点击放大灯箱 + 生图授权弹窗 */
.md-img-card {
  margin: 10px 0; padding: 8px; border-radius: 14px;
  background: var(--glass-inset, rgba(15, 23, 42, 0.04));
  border: 1px solid var(--glass-border, rgba(148, 163, 184, 0.25));
  display: inline-flex; flex-direction: column; gap: 6px; max-width: 100%;
}
.md-img {
  display: block; max-width: 100%; max-height: 460px; width: auto; height: auto;
  border-radius: 10px; object-fit: contain; cursor: zoom-in; background: rgba(0, 0, 0, 0.06);
}
.md-img-cap {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted); padding: 0 2px; flex-wrap: wrap;
}
.md-img-acts { display: inline-flex; gap: 10px; align-items: center; }
.md-img-fallback { display: none; font-size: 12px; padding: 6px 4px; }
.md-img-card.img-err .md-img { display: none; }
.md-img-card.img-err .md-img-fallback { display: block; }
.md-svg-card {
  margin: 10px 0; padding: 12px; border-radius: 12px; overflow: auto;
  background: var(--glass-inset, rgba(255, 255, 255, 0.7));
  border: 1px solid var(--glass-border, rgba(148, 163, 184, 0.28));
}
.md-svg-card svg { max-width: 100%; height: auto; display: block; }
.img-perm-card { max-width: 480px; width: min(480px, 94vw); }
.img-lightbox {
  position: fixed; inset: 0; z-index: 10050; background: rgba(9, 13, 24, 0.86);
  backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.img-lightbox.hidden { display: none; }
.img-lightbox-inner {
  max-width: min(94vw, 1280px); max-height: 92vh; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.img-lightbox-inner img {
  max-width: 100%; max-height: calc(92vh - 56px); border-radius: 12px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
.img-lightbox-bar {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  color: #e5e7eb; font-size: 13px; flex-wrap: wrap;
}
