:root {
  color-scheme: light;
  --bg-canvas: #edf1f7;
  --glass-strong: rgb(255 255 255 / 0.86);
  --glass-base: rgb(255 255 255 / 0.76);
  --glass-soft: rgb(248 250 253 / 0.68);
  --bg-surface: #ffffff;
  --bg-subtle: rgb(244 247 252 / 0.82);
  --bg-groove: rgb(226 233 243 / 0.62);
  --bg-hover: rgb(238 243 250 / 0.88);

  --border-faint: rgb(15 23 42 / 0.06);
  --border-base: rgb(15 23 42 / 0.095);
  --border-strong: rgb(15 23 42 / 0.16);
  --glass-edge: rgb(255 255 255 / 0.88);

  --ink-primary: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --ink-faint: #94a3b8;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgb(239 246 255 / 0.92);
  --accent-border: rgb(59 130 246 / 0.28);
  --accent-ring: rgb(37 99 235 / 0.16);

  --obsidian: #0f172a;
  --obsidian-top: #1e293b;

  --green-fg: #047857;
  --green-bg: rgb(236 253 245 / 0.94);
  --green-border: rgb(16 185 129 / 0.30);

  --amber-fg: #b45309;
  --amber-bg: rgb(255 251 235 / 0.94);
  --amber-border: rgb(245 158 11 / 0.32);

  --red-fg: #be123c;
  --red-bg: rgb(255 241 242 / 0.94);
  --red-border: rgb(244 63 94 / 0.28);

  --shadow-keycap: 0 1px 2px rgb(15 23 42 / 0.06), 0 0 0 1px rgb(15 23 42 / 0.08), inset 0 1px 0 #ffffff;
  --shadow-groove: inset 0 1px 2.5px rgb(15 23 42 / 0.07), 0 1px 0 rgb(255 255 255 / 0.85);
  --shadow-panel: 0 0 0 1px rgb(15 23 42 / 0.065), 0 4px 16px -4px rgb(15 23 42 / 0.055), 0 14px 32px -12px rgb(15 23 42 / 0.065), inset 0 1px 0 rgb(255 255 255 / 0.92);
  --shadow-card: 0 0 0 1px rgb(15 23 42 / 0.07), 0 4px 12px -2px rgb(15 23 42 / 0.045), 0 18px 38px -12px rgb(15 23 42 / 0.085), inset 0 1px 0 #ffffff;
  --shadow-hover: 0 0 0 1px rgb(37 99 235 / 0.24), 0 8px 20px -4px rgb(15 23 42 / 0.06), 0 24px 48px -12px rgb(37 99 235 / 0.12), inset 0 1px 0 #ffffff;
  --shadow-widget: 0 1px 3px rgb(15 23 42 / 0.04), 0 0 0 1px rgb(15 23 42 / 0.06), inset 0 1px 0 #ffffff;
  --shadow-drawer: -16px 0 48px -8px rgb(15 23 42 / 0.15), 0 0 0 1px rgb(15 23 42 / 0.08), inset 0 1px 0 #ffffff;
  --shadow-dialog: 0 28px 70px -12px rgb(15 23 42 / 0.28), 0 0 0 1px rgb(15 23 42 / 0.08);

  --blur-glass: blur(22px) saturate(165%);
  --blur-heavy: blur(28px) saturate(180%);

  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius-md: 13px;
  --radius-lg: 17px;
  --radius-xl: 20px;

  --topbar-h: 60px;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  color: var(--ink-primary);
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(circle at 1px 1px, rgb(15 23 42 / 0.045) 1px, transparent 0),
    radial-gradient(920px 540px at 8% -6%, rgb(59 130 246 / 0.12), transparent 65%),
    radial-gradient(820px 520px at 94% 4%, rgb(99 102 241 / 0.085), transparent 62%),
    radial-gradient(760px 560px at 50% 104%, rgb(14 165 233 / 0.075), transparent 65%);
  background-size: 22px 22px, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: scroll, fixed, fixed, fixed;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p, dl, dd, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4 { letter-spacing: -0.022em; color: var(--ink-primary); }
svg { display: block; }
summary { list-style: none; cursor: pointer; user-select: none; }
summary::-webkit-details-marker { display: none; }

.mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
main:focus:not(:focus-visible) { outline: none; }

.icon { width: 15px; height: 15px; flex: 0 0 15px; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--obsidian);
  color: #fff;
  font-size: 12.5px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-smooth);
}
.skip-link:focus { transform: none; }

/* =========================================================
   1. Frosted Glass Top Shell
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
  border-bottom: 1px solid rgb(255 255 255 / 0.85);
  box-shadow: 0 1px 0 rgb(15 23 42 / 0.07), 0 8px 24px -10px rgb(15 23 42 / 0.06);
}
.topbar-inner {
  max-width: 1580px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(18px, 2.6vw, 38px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin-left: -10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
  flex-shrink: 0;
}
.brand:hover {
  background: rgb(255 255 255 / 0.78);
  border-color: var(--border-faint);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(180deg, var(--obsidian-top) 0%, var(--obsidian) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.20), inset 0 1px 0 rgb(255 255 255 / 0.22);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-name {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.topbar-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.crumb-sep { color: var(--ink-faint); font-size: 15px; }
.crumb-title {
  font-size: 14px;
  font-weight: 640;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.topbar-center { display: flex; justify-content: center; }
.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.local-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.9);
  background: rgb(255 255 255 / 0.68);
  box-shadow: 0 0 0 1px rgb(15 23 42 / 0.06), inset 0 1px 0 #ffffff;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 520;
  white-space: nowrap;
}
.status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgb(16 185 129 / 0.16);
}
.local-status.is-error {
  background: var(--red-bg);
  color: var(--red-fg);
  box-shadow: 0 0 0 1px var(--red-border);
}
.local-status.is-error .status-dot { background: var(--red-fg); box-shadow: none; }

/* Tactile Milled Groove Segmented Control */
.seg-nav {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 11px;
  background: var(--bg-groove);
  box-shadow: var(--shadow-groove);
  border: 1px solid rgb(15 23 42 / 0.05);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 560;
  white-space: nowrap;
  transition: background-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
}
.seg-btn:hover { color: var(--ink-primary); }
.seg-btn.is-active {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--ink-primary);
  font-weight: 660;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.10), 0 0 0 1px rgb(15 23 42 / 0.05), inset 0 1px 0 #ffffff;
}
.seg-count {
  padding: 0 6px;
  border-radius: 999px;
  background: rgb(15 23 42 / 0.065);
  color: var(--ink-secondary);
  font-size: 11px;
}
.seg-btn.is-active .seg-count {
  background: var(--accent-soft);
  color: var(--accent);
}

/* =========================================================
   2. Tactile Keycap Buttons & Badges
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 580;
  line-height: 1.3;
  white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform 100ms var(--ease-smooth), box-shadow var(--dur-fast);
}
.btn:active:not(:disabled) { transform: translateY(0.5px) scale(0.985); }
.btn:disabled { opacity: 0.52; }

.btn-primary {
  background: linear-gradient(180deg, var(--obsidian-top) 0%, var(--obsidian) 100%);
  border-color: var(--obsidian);
  color: #fff;
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.20), 0 0 0 1px var(--obsidian), inset 0 1px 0 rgb(255 255 255 / 0.20);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #27354c 0%, #152036 100%);
  box-shadow: 0 4px 12px rgb(15 23 42 / 0.24), 0 0 0 1px var(--obsidian), inset 0 1px 0 rgb(255 255 255 / 0.26);
}

.btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  border-color: transparent;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-keycap);
}
.btn-secondary:hover:not(:disabled) {
  background: #ffffff;
  color: var(--ink-primary);
  box-shadow: 0 2px 5px rgb(15 23 42 / 0.08), 0 0 0 1px rgb(15 23 42 / 0.13), inset 0 1px 0 #ffffff;
}

.btn-soft {
  min-height: 32px;
  padding: 4px 12px;
  background: linear-gradient(180deg, rgb(239 246 255 / 0.96) 0%, rgb(219 234 254 / 0.78) 100%);
  border-color: var(--accent-border);
  color: var(--accent-hover);
  box-shadow: 0 1px 2px rgb(37 99 235 / 0.08), inset 0 1px 0 rgb(255 255 255 / 0.85);
  font-size: 12.5px;
}
.btn-soft:hover:not(:disabled) {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: rgb(37 99 235 / 0.42);
}

.btn-ghost {
  min-height: 32px;
  background: transparent;
  color: var(--ink-muted);
  padding-inline: 10px;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--ink-primary);
}

.btn-ghost-danger {
  min-height: 32px;
  background: transparent;
  color: var(--ink-faint);
  padding-inline: 8px;
}
.btn-ghost-danger:hover:not(:disabled) {
  background: var(--red-bg);
  color: var(--red-fg);
}

.btn-danger {
  background: linear-gradient(180deg, #e11d48 0%, var(--red-fg) 100%);
  border-color: var(--red-fg);
  color: #fff;
  box-shadow: 0 2px 5px rgb(190 18 60 / 0.22), inset 0 1px 0 rgb(255 255 255 / 0.20);
}
.btn-danger:hover:not(:disabled) { opacity: 0.94; }

.btn-dashed {
  min-height: 30px;
  padding: 4px 12px;
  border: 1px dashed var(--border-strong);
  background: rgb(255 255 255 / 0.72);
  color: var(--ink-secondary);
  font-size: 12px;
}
.btn-dashed:hover:not(:disabled) {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  font-size: 11.5px;
  font-weight: 580;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.65);
}
.badge-neutral { background: rgb(241 245 249 / 0.88); border-color: var(--border-base); color: var(--ink-secondary); }
.badge-blue { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-hover); }
.badge-green { background: var(--green-bg); border-color: var(--green-border); color: var(--green-fg); }
.badge-amber { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-fg); }
.badge-red { background: var(--red-bg); border-color: var(--red-border); color: var(--red-fg); }

.chip-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.quiet-stat { color: var(--ink-muted); font-size: 12.5px; }

.progress-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--bg-groove);
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.08);
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35);
  transition: width var(--dur-base) var(--ease-smooth);
}

/* =========================================================
   3. Natural Whole-Page Layout (Zero Trapped Local Scroll!)
   ========================================================= */
.workspace {
  max-width: 1580px;
  margin: 0 auto;
}
main {
  min-width: 0;
  padding: 28px clamp(18px, 2.6vw, 38px) 72px;
}
main.is-project {
  padding: 22px clamp(18px, 2.6vw, 38px) 72px;
}

.panel {
  background: linear-gradient(165deg, var(--glass-strong) 0%, var(--glass-base) 100%);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-faint);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.55) 0%, transparent 100%);
}
.panel-head h2 { font-size: 15.5px; font-weight: 680; }
.panel-body { padding: 22px 24px; }

/* =========================================================
   4. Overview Dashboard & Unified Follow-up Inbox
   ========================================================= */
.overview-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.overview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.overview-toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.page-title { font-size: 22px; font-weight: 740; letter-spacing: -0.028em; }

.stat-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgb(15 23 42 / 0.055), 0 2px 6px rgb(15 23 42 / 0.035), inset 0 1px 0 #ffffff;
  font-size: 12px;
  color: var(--ink-secondary);
}
.stat-pill strong { font-size: 13.5px; font-weight: 700; color: var(--ink-primary); }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; }
.stat-dot.blue { background: var(--accent); box-shadow: 0 0 0 3px rgb(37 99 235 / 0.14); }
.stat-dot.amber { background: #f59e0b; box-shadow: 0 0 0 3px rgb(245 158 11 / 0.16); }
.stat-dot.green { background: #10b981; box-shadow: 0 0 0 3px rgb(16 185 129 / 0.15); }

.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  gap: 28px;
  align-items: start;
}
.projects-column { min-width: 0; }
.project-card-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-edge);
  background: linear-gradient(160deg, rgb(255 255 255 / 0.90) 0%, rgb(255 255 255 / 0.75) 100%);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base), background var(--dur-fast);
}
.project-card:hover {
  background: linear-gradient(160deg, rgb(255 255 255 / 0.96) 0%, rgb(255 255 255 / 0.84) 100%);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.project-card.is-archived {
  background: linear-gradient(160deg, rgb(250 252 255 / 0.82) 0%, rgb(245 248 252 / 0.72) 100%);
}
.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.card-date { color: var(--ink-muted); font-size: 12px; margin-left: 2px; }
.project-card-body { display: flex; flex-direction: column; gap: 12px; }
.project-card-title { font-size: 21px; font-weight: 720; line-height: 1.35; }
.project-title-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink-primary);
  text-align: left;
  transition: color var(--dur-fast);
}
.project-title-link:hover { color: var(--accent); }
.project-card-desc {
  max-width: 72ch;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.68;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-people {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}
.people-label { color: var(--ink-muted); font-size: 12px; font-weight: 560; }
.people-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.9);
  background: rgb(248 250 253 / 0.88);
  box-shadow: 0 0 0 1px rgb(15 23 42 / 0.06), 0 1px 2px rgb(15 23 42 / 0.03);
  font-size: 12px;
}
.person-chip strong { font-weight: 620; color: var(--ink-primary); }
.person-chip i { font-style: normal; color: var(--ink-muted); font-size: 11.5px; }

.card-stage-tray {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgb(237 242 249 / 0.65);
  border: 1px solid rgb(15 23 42 / 0.055);
  box-shadow: inset 0 1px 3px rgb(15 23 42 / 0.045), 0 1px 0 #ffffff;
}
.tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.tray-current { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.tray-label { color: var(--ink-muted); font-size: 12px; font-weight: 560; }
.tray-current strong { font-size: 14.5px; font-weight: 680; color: var(--ink-primary); }
.tray-progress { display: flex; align-items: center; gap: 12px; color: var(--ink-secondary); font-size: 12px; }
.tray-progress .progress-bar { width: 116px; }
.tray-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgb(15 23 42 / 0.06);
}
.stage-track { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.stage-node-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-keycap);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 540;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), color var(--dur-fast);
}
.stage-node-pill:hover {
  color: var(--accent-hover);
  box-shadow: 0 2px 6px rgb(37 99 235 / 0.12), 0 0 0 1px var(--accent-border), inset 0 1px 0 #ffffff;
  transform: translateY(-1px);
}
.stage-node-pill em { font-style: normal; font-size: 11px; font-weight: 680; color: var(--ink-faint); }
.stage-node-pill.is-done {
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  box-shadow: 0 1px 2px rgb(16 185 129 / 0.08), 0 0 0 1px var(--green-border), inset 0 1px 0 #ffffff;
  color: var(--green-fg);
}
.stage-node-pill.is-done em { color: var(--green-fg); }
.stage-node-pill.is-current {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 2px 6px rgb(37 99 235 / 0.14), 0 0 0 1.5px rgb(37 99 235 / 0.45), inset 0 1px 0 #ffffff;
  color: var(--accent-hover);
  font-weight: 640;
}
.stage-node-pill.is-current em { color: var(--accent); }
.tray-cta { flex-shrink: 0; }
.tray-cta .btn { min-height: 38px; padding-inline: 18px; }

.inbox-panel {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  overflow: hidden;
  border-radius: var(--radius-xl);
}
.inbox-sub { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.inbox-list {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.inbox-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgb(255 255 255 / 0.9);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.92) 0%, rgb(248 250 253 / 0.80) 100%);
  box-shadow: var(--shadow-widget);
  text-align: left;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
.inbox-card:hover {
  background: #ffffff;
  box-shadow: 0 4px 12px -2px rgb(15 23 42 / 0.08), 0 0 0 1px rgb(37 99 235 / 0.24), inset 0 1px 0 #ffffff;
  transform: translateY(-1px);
}
.inbox-card-top, .inbox-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}
.inbox-title { font-size: 13.5px; font-weight: 650; color: var(--ink-primary); line-height: 1.45; }
.inbox-empty { padding: 38px 20px; text-align: center; color: var(--ink-muted); font-size: 13px; }

.trash-panel { overflow: hidden; border-radius: var(--radius-lg); }
.trash-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 580;
}
.trash-summary:hover { background: rgb(255 255 255 / 0.55); color: var(--ink-primary); }
.trash-list { border-top: 1px solid var(--border-faint); padding: 6px 22px; }
.trash-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.trash-item + .trash-item { border-top: 1px solid var(--border-faint); }
.trash-item small { display: block; color: var(--ink-muted); font-size: 12px; margin-top: 3px; }

/* =========================================================
   5. Node Workbench Split (Sticky Rail + Spacious Natural Flow)
   ========================================================= */
.workbench-split {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.workbench-split.is-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
.workbench-split.is-collapsed .detail-panel {
  max-width: 1120px;
  width: 100%;
  margin-inline: auto;
}

.flow-rail {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.82) 0%, rgb(248 250 253 / 0.72) 100%);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.rail-title { font-size: 13.5px; font-weight: 680; color: var(--ink-primary); }
.rail-progress { margin: 0 16px 14px; height: 6px; }
.rail-body { padding: 2px 12px 14px; }
.rail-list { display: flex; flex-direction: column; gap: 6px; }
.rail-item { position: relative; }
.rail-node {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  transition: background-color var(--dur-fast), box-shadow var(--dur-fast);
}
.rail-node:hover { background: rgb(255 255 255 / 0.66); }
.rail-node.is-selected {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.06), 0 0 0 1px rgb(15 23 42 / 0.08), inset 0 1px 0 #ffffff;
}
.rail-step {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 0 0 1px rgb(15 23 42 / 0.09);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 680;
}
.rail-step .icon { width: 13px; height: 13px; }
.rail-node.is-done .rail-step {
  background: var(--green-bg);
  box-shadow: 0 0 0 1px var(--green-border);
  color: var(--green-fg);
}
.rail-node.is-current .rail-step {
  background: linear-gradient(180deg, #3b82f6 0%, var(--accent) 100%);
  box-shadow: 0 2px 5px rgb(37 99 235 / 0.28);
  color: #fff;
}
.rail-copy { min-width: 0; flex: 1; }
.rail-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 640;
  color: var(--ink-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-copy small { display: block; font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.rail-foot {
  display: flex;
  padding: 12px;
  border-top: 1px solid var(--border-faint);
  background: rgb(241 245 249 / 0.55);
}
.rail-foot .btn {
  width: 100%;
  font-size: 12.5px;
  min-height: 34px;
  background: rgb(255 255 255 / 0.86);
  box-shadow: var(--shadow-keycap);
  color: var(--ink-secondary);
}
.rail-foot .btn:hover { background: #ffffff; color: var(--ink-primary); }

/* Right Main Node Container (No Nested Overflow!) */
.detail-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.88) 0%, rgb(255 255 255 / 0.78) 100%);
}
.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border-faint);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.65) 0%, transparent 100%);
}
.node-head-main { min-width: 0; flex: 1; }
.node-heading { font-size: 20px; font-weight: 730; }
.confirmer-tag { color: var(--ink-muted); font-size: 12.5px; }
.node-subtitle { margin-top: 6px; color: var(--ink-secondary); font-size: 13.5px; line-height: 1.6; max-width: 76ch; }
.detail-body { padding: 24px 28px 34px; }

.inline-confirmer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 10px;
  border-radius: 999px;
  background: rgb(248 250 253 / 0.90);
  box-shadow: var(--shadow-keycap);
  font-size: 11.5px;
  color: var(--ink-muted);
}
.inline-confirmer select {
  border: 0;
  background: transparent;
  color: var(--ink-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
}

/* =========================================================
   6. Clickable 4-Step Flow Stepper & Focused Step Card
   ========================================================= */
.alignment-shell,
.deliverable-shell {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.step-flow-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-lg);
  background: var(--bg-groove);
  box-shadow: var(--shadow-groove);
  border: 1px solid rgb(15 23 42 / 0.05);
}
.step-flow-bar.is-2steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.step-node-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.55);
  text-align: left;
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.step-node-btn:hover {
  background: rgb(255 255 255 / 0.88);
  transform: translateY(-1px);
}
.step-node-btn.is-active {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 4px 12px rgb(37 99 235 / 0.12), 0 0 0 1.5px var(--accent), inset 0 1px 0 #ffffff;
}
.step-num {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: var(--shadow-keycap);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 720;
}
.step-node-btn.is-active .step-num {
  background: linear-gradient(180deg, #3b82f6 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgb(37 99 235 / 0.28);
}
.step-node-btn.is-done:not(.is-active) .step-num {
  background: var(--green-bg);
  color: var(--green-fg);
  box-shadow: 0 0 0 1px var(--green-border);
}
.step-node-btn.is-warn:not(.is-active) .step-num {
  background: var(--amber-bg);
  color: var(--amber-fg);
  box-shadow: 0 0 0 1px var(--amber-border);
}
.step-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.step-copy strong {
  font-size: 13.5px;
  font-weight: 680;
  color: var(--ink-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-copy small {
  font-size: 11.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-card {
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.96) 0%, rgb(250 252 255 / 0.90) 100%);
  box-shadow: var(--shadow-widget);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.stream-card-accent {
  background: linear-gradient(180deg, rgb(241 247 255 / 0.96) 0%, rgb(255 255 255 / 0.94) 100px);
  box-shadow: 0 4px 16px rgb(37 99 235 / 0.07), 0 0 0 1px rgb(37 99 235 / 0.20), inset 0 1px 0 #ffffff;
}
.stream-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-faint);
}
.stream-card-head h3 { font-size: 16px; font-weight: 700; }
.step-card-desc {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.55;
}
.step-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-faint);
}

.step-pill {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: var(--shadow-keycap);
  color: var(--ink-primary);
  font-size: 12px;
  font-weight: 720;
}
.step-pill-accent {
  background: linear-gradient(180deg, #3b82f6 0%, var(--accent) 100%);
  box-shadow: 0 2px 5px rgb(37 99 235 / 0.25), inset 0 1px 0 rgb(255 255 255 / 0.28);
  color: #fff;
}

/* =========================================================
   7. Visual Chat Screenshot Wall & Attachment Chips
   ========================================================= */
.shot-wall {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgb(244 248 254 / 0.90) 0%, rgb(249 251 255 / 0.80) 100%);
  border: 1px solid rgb(59 130 246 / 0.18);
  box-shadow: inset 0 1px 0 #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
[data-attach-zone].is-drop-hover {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  box-shadow: 0 0 0 3px var(--accent-ring) !important;
}
.shot-wall-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}
.shot-card {
  border-radius: var(--radius-sm);
  background: #ffffff;
  box-shadow: var(--shadow-keycap);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}
.shot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(15 23 42 / 0.10), 0 0 0 1px var(--accent-border);
}
.shot-preview-btn {
  width: 100%;
  height: 112px;
  padding: 0;
  border: 0;
  background: #f1f5f9;
  display: block;
  overflow: hidden;
}
.shot-preview-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.shot-file-link {
  height: 112px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  text-decoration: none;
  font-size: 12px;
  text-align: center;
}
.shot-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px 6px 10px;
  border-top: 1px solid var(--border-faint);
  font-size: 11.5px;
  color: var(--ink-secondary);
}
.shot-del {
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 14px;
  line-height: 1;
}
.shot-del:hover { background: var(--red-bg); color: var(--red-fg); }

.shot-drop-empty {
  width: 100%;
  padding: 24px 20px;
  border: 1.5px dashed rgb(59 130 246 / 0.36);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.shot-drop-empty:hover {
  border-style: solid;
  border-color: var(--accent);
  background: #ffffff;
}
.shot-drop-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}
.shot-drop-empty strong { font-size: 13.5px; color: var(--ink-primary); }
.shot-drop-empty small { font-size: 12px; color: var(--ink-muted); max-width: 58ch; }

.paste-split-box {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgb(244 247 252 / 0.72);
  border: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.att-bar { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chip {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.94);
  box-shadow: var(--shadow-keycap);
  overflow: hidden;
}
.att-chip-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 10px 5px 6px;
  border: 0;
  background: transparent;
  text-decoration: none;
  color: var(--ink-primary);
  text-align: left;
}
.att-thumb {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-faint);
}
.att-file-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}
.att-meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.att-meta strong { font-size: 12px; font-weight: 600; max-width: 165px; }
.att-meta small { font-size: 10.5px; color: var(--ink-muted); }
.att-del {
  align-self: stretch;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid var(--border-faint);
  background: transparent;
  color: var(--ink-faint);
  font-size: 15px;
}
.att-del:hover { background: var(--red-bg); color: var(--red-fg); }
.att-upload-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.att-hint { color: var(--ink-muted); font-size: 11.5px; }

/* =========================================================
   8. Step 2 AI Completeness 4-Dimension Grid
   ========================================================= */
.ai-result-stack { display: flex; flex-direction: column; gap: 16px; }
.ai-score-banner {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgb(239 246 255 / 0.94) 0%, rgb(255 255 255 / 0.90) 100%);
  border: 1px solid var(--accent-border);
  box-shadow: inset 0 1px 0 #ffffff;
}
.ai-summary-text { margin-top: 6px; font-size: 14px; font-weight: 620; color: var(--ink-primary); }

.completeness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.comp-dim-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow-widget);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comp-dim-card.is-ok {
  background: linear-gradient(180deg, rgb(240 253 244 / 0.85) 0%, #ffffff 100%);
  border-color: var(--green-border);
}
.comp-dim-card.is-warn {
  background: linear-gradient(180deg, rgb(255 251 235 / 0.85) 0%, #ffffff 100%);
  border-color: var(--amber-border);
}
.comp-dim-card.is-missing {
  background: linear-gradient(180deg, rgb(255 241 242 / 0.85) 0%, #ffffff 100%);
  border-color: var(--red-border);
}
.comp-dim-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comp-dim-top strong { font-size: 13.5px; }
.comp-dim-card p { font-size: 12.5px; color: var(--ink-secondary); }

.ai-finding {
  padding-top: 10px;
  border-top: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
}
.ai-ask-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-faint);
}
.ai-ask-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ai-empty-box {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgb(248 250 253 / 0.65);
}

/* =========================================================
   9. Post-Finalization Stage Deliverable Hero & Communication Trail
   ========================================================= */
.deliverable-hero {
  background: linear-gradient(180deg, rgb(240 253 244 / 0.72) 0%, rgb(255 255 255 / 0.96) 120px);
  box-shadow: 0 8px 28px -8px rgb(16 185 129 / 0.14), 0 0 0 1.5px rgb(16 185 129 / 0.30), inset 0 1px 0 #ffffff;
}
.deliverable-hero.is-editing-final {
  background: linear-gradient(180deg, rgb(239 246 255 / 0.88) 0%, rgb(255 255 255 / 0.96) 120px);
  box-shadow: 0 8px 28px -8px rgb(37 99 235 / 0.15), 0 0 0 1.5px var(--accent), inset 0 1px 0 #ffffff;
}
.deliverable-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-faint);
}
.deliverable-title-group { flex: 1; min-width: 260px; }
.deliverable-purpose {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  max-width: 72ch;
}
.deliverable-main-scope {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgb(16 185 129 / 0.24);
  box-shadow: var(--shadow-widget);
}
.deliverable-kicker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-fg);
  margin-bottom: 6px;
}
.deliverable-scope-text {
  font-size: 16px;
  font-weight: 660;
  color: var(--ink-primary);
  line-height: 1.65;
  white-space: pre-wrap;
}
.deliverable-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.deliverable-meta-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgb(244 247 252 / 0.72);
  border: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.deliverable-meta-box.is-wide { grid-column: 1 / -1; }
.deliverable-meta-box.is-amber {
  background: var(--amber-bg);
  border-color: var(--amber-border);
}
.deliverable-meta-box strong { font-size: 14px; color: var(--ink-primary); }
.deliverable-meta-box p { font-size: 13.5px; color: var(--ink-primary); white-space: pre-wrap; }
.deliverable-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-base);
}

/* Unified Communication Trail Section */
.trail-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}
.trail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 4px;
}
.trail-head h3 { font-size: 15px; font-weight: 700; color: var(--ink-secondary); }
.trail-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trail-card {
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.90);
  box-shadow: var(--shadow-widget);
  border: 1px solid var(--border-faint);
  overflow: hidden;
}
.trail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 15px 20px;
}
.trail-summary:hover { background: var(--bg-subtle); }
.trail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
}
.trail-dot.is-version {
  background: #10b981;
  box-shadow: 0 0 0 3px rgb(16 185 129 / 0.18);
}
.trail-body {
  padding: 4px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--border-faint);
}
.trail-block {
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trail-label {
  font-size: 12px;
  font-weight: 660;
  color: var(--ink-muted);
}

/* =========================================================
   10. Shared Display, Form Controls & Sub-cards
   ========================================================= */
.adopted-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-border);
  background: linear-gradient(90deg, rgb(239 246 255 / 0.92) 0%, rgb(248 250 255 / 0.85) 100%);
  font-size: 13px;
}
.adopted-strip-main { min-width: 0; display: flex; align-items: center; gap: 10px; flex: 1; }

.quote-list { display: flex; flex-direction: column; gap: 10px; }
.quote-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgb(244 247 252 / 0.75);
  border: 1px solid var(--border-faint);
  box-shadow: inset 0 1px 0 #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quote-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.quote-text { color: var(--ink-primary); font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }

.check-display-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgb(244 247 252 / 0.75);
  border: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.check-display-card.is-confirmed {
  background: linear-gradient(180deg, rgb(240 253 244 / 0.85) 0%, rgb(247 254 250 / 0.80) 100%);
  border-color: var(--green-border);
}
.check-display-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.check-title { font-size: 13.5px; font-weight: 650; }
.check-reply-box {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.88);
  border-left: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.check-display-card.is-confirmed .check-reply-box { border-left-color: #10b981; }

.message-preview-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgb(244 247 252 / 0.80);
  border: 1px solid var(--border-faint);
  color: var(--ink-primary);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.subtle-disclosure {
  border-radius: var(--radius-md);
  background: rgb(241 245 251 / 0.65);
  border: 1px solid var(--border-faint);
  padding: 12px 16px;
}
.subtle-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 580;
  color: var(--ink-secondary);
}
.subtle-disclosure > summary::before { content: "▸"; color: var(--ink-faint); font-size: 11.5px; }
.subtle-disclosure[open] > summary::before { content: "▾"; }
.disclosure-body { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }

.meta-disclosure { margin-top: 2px; }
.meta-disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-size: 12.5px;
  padding: 4px 0;
}
.meta-disclosure > summary:hover { color: var(--accent); }
.meta-disclosure[open] > summary { margin-bottom: 10px; color: var(--ink-secondary); font-weight: 600; }

.item-stack { display: flex; flex-direction: column; gap: 12px; }
.sub-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgb(244 247 252 / 0.75);
  border: 1px solid var(--border-faint);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.question-card.is-confirmed {
  border-color: var(--green-border);
  background: linear-gradient(180deg, rgb(240 253 244 / 0.85) 0%, rgb(247 254 250 / 0.80) 100%);
}

.statement-row {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}
.statement-who { display: flex; flex-direction: column; gap: 8px; }
.statement-del { padding-top: 24px; }
.question-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 180px 156px auto;
  gap: 14px;
  align-items: start;
}
.message-grid {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.person-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 14px;
  align-items: start;
}

.guard-notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--amber-border);
  background: var(--amber-bg);
  color: var(--amber-fg);
  font-size: 13px;
}
.finalize-body { display: flex; flex-direction: column; gap: 14px; }
.revision-box {
  padding-top: 14px;
  border-top: 1px dashed var(--border-base);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stream-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-faint);
}

.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 580; color: var(--ink-secondary); }
.req-mark { margin-left: 3px; color: var(--red-fg); font-style: normal; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgb(15 23 42 / 0.11);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.94);
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.03), 0 1px 0 rgb(255 255 255 / 0.8);
  color: var(--ink-primary);
  font-size: 13.5px;
  line-height: 1.55;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast);
}
.field input, .field select { min-height: 38px; padding: 7px 12px; }
.field textarea { padding: 9px 12px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgb(15 23 42 / 0.20); background: #ffffff; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-ring);
}
.field [aria-invalid="true"] {
  border-color: var(--red-fg);
  box-shadow: 0 0 0 3px rgb(190 18 60 / 0.12);
}

.field-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.template-grid { display: flex; flex-direction: column; gap: 10px; }
.template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-widget);
  cursor: pointer;
}
.template-card.is-selected {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
  box-shadow: 0 4px 12px rgb(37 99 235 / 0.12), 0 0 0 1.5px var(--accent), inset 0 1px 0 #ffffff;
}
.template-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.template-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.template-card-top strong { font-size: 13.5px; }
.template-card-top span { padding: 2px 7px; border-radius: 999px; background: rgb(15 23 42 / 0.06); font-size: 11px; }
.template-card.is-selected .template-card-top span { background: var(--accent); color: #fff; }
.template-card p { font-size: 12px; color: var(--ink-secondary); }
.template-card small { font-size: 11.5px; color: var(--ink-muted); }

.check-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  font-size: 12.5px;
  cursor: pointer;
}
.check-banner input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }

.prop-readonly { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; }
.prop-label { font-size: 11.5px; color: var(--ink-muted); }
.prop-value { font-size: 13.5px; color: var(--ink-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.prop-value.is-empty { color: var(--ink-faint); }

.prop-table { border-top: 1px solid var(--border-faint); }
.prop-table > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-faint);
  font-size: 13px;
}
.prop-table dt { color: var(--ink-muted); }
.prop-table dd { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Full Flow Swimlane Canvas & Reorder Editor */
.flow-canvas-panel { min-height: 460px; }
.section-heading { font-size: 17px; font-weight: 720; }
.swimlane-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
  gap: 20px;
  align-items: start;
}
.swimlane-item { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.stage-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
  box-shadow: var(--shadow-widget);
  transition: box-shadow var(--dur-fast), transform var(--dur-fast);
}
.stage-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stage-card.is-current {
  background: linear-gradient(180deg, #f5f9ff 0%, #ffffff 100%);
  box-shadow: 0 0 0 1.5px var(--accent), 0 8px 20px -6px rgb(37 99 235 / 0.14), inset 0 1px 0 #ffffff;
}
.stage-card.is-done { background: linear-gradient(180deg, #f9fefb 0%, #ffffff 100%); }
.stage-card-body {
  width: 100%;
  padding: 18px 20px;
  border: 0;
  background: transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stage-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stage-idx { color: var(--ink-faint); font-size: 12px; font-weight: 680; }
.stage-name { font-size: 16px; font-weight: 700; }
.stage-need {
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.6;
  min-height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stage-meta {
  padding-top: 10px;
  border-top: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink-muted);
  font-size: 12px;
}

.flow-editor { padding: 20px 24px 28px; max-width: 960px; }
.flow-edit-bar {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-edge);
  background: rgb(255 255 255 / 0.85);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-widget);
  font-size: 12.5px;
  color: var(--ink-secondary);
}
.flow-edit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.92);
  box-shadow: var(--shadow-widget);
}
.flow-edit-row.is-matter { margin-left: 42px; background: var(--amber-bg); box-shadow: 0 0 0 1px var(--amber-border); }
.flow-edit-row.drag-source, .flow-edit-row:has(.drag-handle.is-moving) { outline: 2px solid var(--accent); background: var(--accent-soft); }
.flow-edit-copy { min-width: 0; flex: 1; }
.flow-edit-copy small { display: block; color: var(--ink-muted); font-size: 12px; margin-top: 3px; }
.node-index { color: var(--ink-muted); font-size: 12.5px; font-weight: 650; }
.drag-handle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 7px;
  border: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  box-shadow: var(--shadow-keycap);
  color: var(--ink-secondary);
  font-size: 11.5px;
  cursor: grab;
  touch-action: none;
}
.flow-drop-slot {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 5px 0;
  border-radius: var(--radius-sm);
  border: 1px dashed transparent;
}
.gap-insert-group { display: flex; gap: 8px; }
.is-dragging .flow-drop-slot { border-color: var(--border-strong); background: rgb(255 255 255 / 0.5); }
.flow-drop-slot.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.place-target-btn {
  width: 100%;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 12.5px;
  font-weight: 580;
}

.context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 24px;
  align-items: start;
}
.context-card .panel-body { display: flex; flex-direction: column; gap: 16px; }
.review-section {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sub-heading { font-size: 13.5px; font-weight: 660; color: var(--ink-secondary); }
.md-preview {
  margin: 0;
  max-height: 68dvh;
  overflow: auto;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-faint);
  background: rgb(244 247 252 / 0.82);
  color: var(--ink-secondary);
  font: 12.5px/1.7 ui-monospace, "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.empty-box {
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.empty-inline { color: var(--ink-muted); font-size: 13px; padding: 8px 2px; }

/* Slide-over Drawer, Lightbox & Modal */
.drawer-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  padding: 12px;
}
.drawer-shell[hidden] { display: none; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.20);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 200ms var(--ease-smooth);
}
.drawer-panel {
  position: relative;
  z-index: 1;
  width: min(492px, calc(100vw - 24px));
  height: 100%;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.92) 0%, rgb(248 250 253 / 0.86) 100%);
  backdrop-filter: var(--blur-heavy);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-drawer);
  overflow: hidden;
  transform: translateX(calc(100% + 16px));
  transition: transform 230ms var(--ease-spring);
  display: flex;
  flex-direction: column;
}
.drawer-shell.is-open .drawer-backdrop { opacity: 1; }
.drawer-shell.is-open .drawer-panel { transform: translateX(0); }
.drawer-shell.is-closing .drawer-backdrop { opacity: 0; }
.drawer-shell.is-closing .drawer-panel { transform: translateX(calc(100% + 16px)); }

.drawer-inner { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-faint);
}
.drawer-head h2 { font-size: 16px; font-weight: 700; }
.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pos-pill {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  background: rgb(241 245 251 / 0.8);
  border: 1px solid var(--border-faint);
  color: var(--ink-secondary);
  font-size: 12.5px;
}
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 24px;
  border-top: 1px solid var(--border-faint);
  background: rgb(244 247 252 / 0.78);
}
.form-error { color: var(--red-fg); font-size: 12.5px; }
.form-error:empty { display: none; }

.lightbox-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 0;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-xl);
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: var(--blur-heavy);
  box-shadow: var(--shadow-dialog);
}
.lightbox-dialog::backdrop { background: rgb(15 23 42 / 0.52); backdrop-filter: blur(6px); }
.lightbox-card { display: flex; flex-direction: column; max-height: 90dvh; }
.lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border-faint); }
.lightbox-body { padding: 18px; overflow: auto; display: grid; place-items: center; background: rgb(241 245 249 / 0.65); }
.lightbox-body img { max-width: 100%; max-height: 74dvh; border-radius: var(--radius-sm); box-shadow: 0 8px 28px rgb(15 23 42 / 0.14); }

#edit-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-xl);
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: var(--blur-heavy);
  color: var(--ink-primary);
  box-shadow: var(--shadow-dialog);
}
#edit-dialog::backdrop { background: rgb(15 23 42 / 0.30); backdrop-filter: blur(4px); }
.dialog-card { display: flex; flex-direction: column; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border-faint); }
.dialog-head h2 { font-size: 16px; font-weight: 700; }
.dialog-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border-faint); background: rgb(244 247 252 / 0.8); }

.feedback {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.16);
  background: rgb(15 23 42 / 0.88);
  backdrop-filter: blur(16px);
  color: #fff;
  box-shadow: 0 12px 32px -6px rgb(15 23 42 / 0.28);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: toast-in 180ms var(--ease-spring);
}
.feedback:empty { display: none; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .view-enter { animation: view-in 180ms var(--ease-smooth); }
}

/* =========================================================
   12. Unified Project Layout + Minimalist Symbol-Only Rail Toggles
   ========================================================= */
.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.project-layout.has-left-rail.has-right-ai {
  grid-template-columns: 220px minmax(0, 1fr) 388px;
}
.project-layout.has-left-slim.has-right-ai {
  grid-template-columns: 42px minmax(0, 1fr) 396px;
  gap: 22px;
}
.project-layout.has-left-rail.has-right-slim {
  grid-template-columns: 244px minmax(0, 1fr) 42px;
  gap: 22px;
}
.project-layout.has-left-slim.has-right-slim {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 22px;
}
.project-layout:not(.has-left-rail):not(.has-left-slim).has-right-ai {
  grid-template-columns: minmax(0, 1fr) 396px;
  gap: 24px;
}
.project-layout:not(.has-left-rail):not(.has-left-slim).has-right-slim {
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 22px;
}
.project-main-col {
  min-width: 0;
}

/* Minimalist Symbol-Only Collapse Button inside Rail Headers */
.rail-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rail-icon-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.rail-icon-toggle:hover {
  background: rgb(255 255 255 / 0.92);
  border-color: var(--border-base);
  color: var(--ink-primary);
}
.rail-icon-toggle .icon {
  width: 15px;
  height: 15px;
}

/* Minimalist Symbol-Only Collapsed Slim Strips (42px, Zero Text Clutter) */
.rail-slim {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 5px;
  border-radius: 14px;
  border: 1px solid var(--glass-edge);
  background: rgb(255 255 255 / 0.72);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-panel);
}
.rail-slim.is-right {
  border-color: rgb(59 130 246 / 0.18);
  background: linear-gradient(180deg, rgb(243 248 255 / 0.88) 0%, rgb(255 255 255 / 0.76) 100%);
}
.slim-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 0;
  background: rgb(255 255 255 / 0.85);
  box-shadow: var(--shadow-keycap);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  transition: background var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.slim-icon-btn:hover {
  background: #ffffff;
  color: var(--accent-hover);
  box-shadow: 0 3px 8px rgb(37 99 235 / 0.16), 0 0 0 1px var(--accent-border);
  transform: scale(1.05);
}
.slim-icon-btn.is-ai {
  background: linear-gradient(180deg, #3b82f6 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgb(37 99 235 / 0.28), inset 0 1px 0 rgb(255 255 255 / 0.28);
}
.slim-icon-btn.is-ai:hover {
  color: #fff;
  box-shadow: 0 4px 10px rgb(37 99 235 / 0.36);
}
.slim-node-dots {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-faint);
}
.slim-dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 0;
  background: #ffffff;
  box-shadow: var(--shadow-keycap);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 680;
  display: grid;
  place-items: center;
  transition: transform var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.slim-dot:hover {
  transform: scale(1.06);
  color: var(--accent);
}
.slim-dot.is-done {
  background: var(--green-bg);
  box-shadow: 0 0 0 1px var(--green-border);
  color: var(--green-fg);
}
.slim-dot.is-current {
  background: linear-gradient(180deg, #3b82f6 0%, var(--accent) 100%);
  color: #fff;
}
.slim-dot.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Right-Side Dedicated AI Copilot Rail (Spacious, Zero Nested Scrollbar Trap) */
.ai-rail {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  border: 1px solid rgb(255 255 255 / 0.92);
  background: linear-gradient(168deg, rgb(247 250 255 / 0.94) 0%, rgb(255 255 255 / 0.86) 48%, rgb(244 247 253 / 0.90) 100%);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  box-shadow: 0 0 0 1px rgb(59 130 246 / 0.14), 0 12px 32px -10px rgb(37 99 235 / 0.09), inset 0 1px 0 #ffffff;
  overflow: hidden;
}
.ai-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px 15px;
  border-bottom: 1px solid rgb(59 130 246 / 0.12);
  background: linear-gradient(180deg, rgb(239 246 255 / 0.72) 0%, transparent 100%);
  flex-shrink: 0;
}
.ai-rail-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(180deg, #3b82f6 0%, var(--accent) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgb(37 99 235 / 0.25), inset 0 1px 0 rgb(255 255 255 / 0.28);
}
.ai-rail-title {
  display: block;
  font-size: 14px;
  font-weight: 720;
  color: var(--ink-primary);
  line-height: 1.2;
}
.ai-rail-scene {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 3px;
}
.ai-engine-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.90);
  box-shadow: var(--shadow-keycap);
  font-size: 11px;
  font-weight: 560;
  color: var(--ink-secondary);
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-engine-pill i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #10b981;
}
.ai-engine-pill.is-blue i { background: var(--accent); }
.ai-engine-pill.is-neutral i { background: var(--ink-faint); }

.ai-rail-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-module {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.94);
  box-shadow: var(--shadow-widget);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-compact-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-faint);
}
.ai-compact-toolbar.is-single {
  grid-template-columns: minmax(0, 1fr);
}
.ai-compact-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-faint);
}
.ai-compact-stack .ai-compact-toolbar {
  padding-bottom: 0;
  border-bottom: 0;
}
.ai-paste-disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.ai-paste-disclosure > summary::-webkit-details-marker {
  display: none;
}
.ai-paste-disclosure > summary:hover {
  text-decoration: underline;
}
.ai-paste-drawer {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-half-btn {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}
.ai-mod-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ai-mod-head .badge {
  flex-shrink: 0;
  white-space: nowrap;
}
.ai-mod-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-primary);
}
.ai-mod-desc {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.6;
}
.ai-report-summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.62;
}

.ai-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ai-full-btn {
  width: 100%;
  min-height: 38px;
  font-size: 13px;
}

.ai-rail-input {
  width: 100%;
  border: 1px solid rgb(15 23 42 / 0.12);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  color: var(--ink-primary);
}
.ai-rail-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* Spacious Single-Column Completeness Dimension Rows (Zero Cramped Wrapping!) */
.comp-row-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comp-row-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-base);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comp-row-item.is-ok {
  background: linear-gradient(90deg, rgb(236 253 245 / 0.88) 0%, rgb(255 255 255 / 0.94) 100%);
  border-color: var(--green-border);
}
.comp-row-item.is-warn {
  background: linear-gradient(90deg, rgb(255 251 235 / 0.92) 0%, rgb(255 255 255 / 0.94) 100%);
  border-color: var(--amber-border);
}
.comp-row-item.is-missing {
  background: linear-gradient(90deg, rgb(255 241 242 / 0.90) 0%, rgb(255 255 255 / 0.94) 100%);
  border-color: var(--red-border);
}
.comp-row-item.is-info {
  background: linear-gradient(90deg, rgb(239 246 255 / 0.90) 0%, rgb(255 255 255 / 0.96) 100%);
  border-color: var(--accent-border);
}
.comp-row-item.is-neutral {
  background: #f8fafc;
  border-color: var(--border-base);
}
.comp-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.comp-row-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 660;
  color: var(--ink-primary);
  white-space: nowrap;
}
.comp-row-top .badge {
  flex-shrink: 0;
  white-space: nowrap;
}
.comp-row-note {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.55;
}
.comp-row-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Unified Minimalist Modular Cards for Flow Overview & Step 2 Questions */
.question-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-faint);
}

.flow-stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.flow-stage-row {
  width: 100%;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-edge);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.96) 0%, rgb(250 252 255 / 0.88) 100%);
  box-shadow: var(--shadow-widget);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast);
}
.flow-stage-row:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: 0 10px 24px -10px rgb(37 99 235 / 0.14), 0 0 0 1px var(--accent-border), inset 0 1px 0 #ffffff;
}
.flow-stage-row.is-current {
  background: linear-gradient(180deg, rgb(242 247 255 / 0.96) 0%, rgb(255 255 255 / 0.94) 100%);
  box-shadow: 0 6px 18px -8px rgb(37 99 235 / 0.14), 0 0 0 1.5px var(--accent), inset 0 1px 0 #ffffff;
}
.flow-stage-row.is-done:not(.is-current) {
  background: linear-gradient(180deg, rgb(246 254 250 / 0.92) 0%, rgb(255 255 255 / 0.92) 100%);
}
.flow-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.flow-stage-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-primary);
}
.flow-stage-enter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.flow-stage-desc {
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.62;
}
.flow-stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-faint);
  font-size: 12px;
  color: var(--ink-muted);
}
.flow-stage-foot strong {
  color: var(--ink-secondary);
  font-weight: 620;
}

.comp-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.comp-mini-top strong {
  font-size: 12.5px;
  color: var(--ink-primary);
}

.ai-list-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.ai-sub-kicker {
  font-size: 12px;
  font-weight: 660;
  color: var(--ink-secondary);
}
.ai-sub-kicker.is-red { color: var(--red-fg); }

.ai-mini-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgb(244 247 252 / 0.82);
  border: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.58;
}
.ai-mini-card.is-green { background: var(--green-bg); border-color: var(--green-border); }
.ai-mini-card.is-amber { background: var(--amber-bg); border-color: var(--amber-border); }
.ai-mini-card.is-red { background: var(--red-bg); border-color: var(--red-border); }
.ai-mini-card.is-blue { background: var(--accent-soft); border-color: var(--accent-border); }
.ai-mini-card small { color: var(--ink-muted); font-size: 11.5px; }

.ai-inline-link {
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 620;
}
.ai-inline-link:hover { text-decoration: underline; }

.ai-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber-fg);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-rail-foot {
  border-top: 1px solid var(--border-faint);
  background: rgb(241 245 249 / 0.65);
  flex-shrink: 0;
}
.ai-settings-accordion > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 560;
  color: var(--ink-secondary);
}
.ai-settings-accordion > summary:hover { color: var(--ink-primary); }
.ai-settings-body {
  padding: 4px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 290px;
  overflow-y: auto;
}
.ai-settings-body .field input,
.ai-settings-body .field select {
  min-height: 33px;
  padding: 5px 9px;
  font-size: 12px;
}

.subtle-disclosure textarea {
  width: 100%;
  border: 1px solid rgb(15 23 42 / 0.12);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.5;
}

/* Responsive Breakpoints */
@media (max-width: 1260px) {
  .project-layout.has-left-rail.has-right-ai {
    grid-template-columns: minmax(0, 1fr) 316px;
  }
  .project-layout.has-left-rail.has-right-ai .flow-rail {
    grid-column: 1 / -1;
    position: static;
  }
  .project-layout.has-left-rail.has-right-ai .rail-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
  }
  .project-layout.has-left-rail.has-right-ai .rail-item {
    flex: 0 0 196px;
  }
  .context-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; height: auto; min-height: var(--topbar-h); padding-block: 8px; }
  .topbar { height: auto; }
  .topbar-center { grid-column: 1 / -1; order: 3; justify-content: flex-start; overflow-x: auto; }
  .desk-grid,
  .project-layout.has-left-rail.has-right-ai,
  .project-layout.has-left-slim.has-right-ai,
  .project-layout.has-left-rail.has-right-slim,
  .project-layout.has-left-slim.has-right-slim,
  .project-layout:not(.has-left-rail):not(.has-left-slim).has-right-ai,
  .project-layout:not(.has-left-rail):not(.has-left-slim).has-right-slim {
    grid-template-columns: 1fr;
  }
  .inbox-panel, .flow-rail, .ai-rail, .rail-slim { position: static; max-height: none; }
  .rail-slim { flex-direction: row; justify-content: space-between; padding: 8px 14px; }
  .slim-expand-btn, .slim-expand-btn.is-ai { width: auto; flex-direction: row; padding: 6px 12px; }
  .slim-vertical-text { writing-mode: horizontal-tb; letter-spacing: normal; }
  .slim-node-dots { width: auto; flex-direction: row; padding-top: 0; border-top: 0; }
  .rail-list { flex-direction: row; overflow-x: auto; gap: 8px; }
  .rail-item { flex: 0 0 200px; }
  .statement-row, .question-top-grid, .message-grid, .field-grid-3, .deliverable-meta-grid { grid-template-columns: 1fr; }
  .statement-del { padding-top: 0; }
}

@media (max-width: 640px) {
  main, main.is-project { padding: 18px 14px 48px; }
  .project-card { padding: 20px 18px; gap: 16px; }
  .step-flow-bar { grid-template-columns: 1fr; }
  .detail-body { padding: 18px 16px 28px; }
  .node-head { padding: 18px 16px 14px; }
  .stream-card { padding: 18px 16px; }
  .field-grid-2, .person-grid, .comp-mini-grid { grid-template-columns: 1fr; }
  .drawer-shell { padding: 0; }
  .drawer-panel { width: 100vw; border-radius: 0; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .topbar, .flow-rail, .ai-rail, .rail-slim, .step-flow-bar, .step-card-foot, .drawer-shell, .feedback, .btn { display: none !important; }
  body, main { height: auto; padding: 0; background: #fff; }
  .panel, .stream-card, .project-card { border: 0; box-shadow: none; padding: 0; }
}
