:root {
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-subtle: #EEF2F7;
  --ink: #0F172A;
  --ink-muted: #475569;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --signal: #1D4ED8;
  --signal-hover: #1E40AF;
  --signal-soft: #EFF6FF;
  --amber: #D97706;
  --amber-hover: #B45309;
  --amber-soft: #FFFBEB;
  --emerald: #059669;
  --emerald-soft: #ECFDF5;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --stage-bg: #090E1A;
  --stage-surface: rgba(15, 23, 42, 0.86);
  --stage-grid: rgba(148, 163, 184, 0.08);
  --stage-line: rgba(148, 163, 184, 0.22);
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body:has(.works-main.is-chat-mode) {
  height: 100dvh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tab-label-short {
  display: none;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* Top navigation */
.works-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 248, 251, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.works-topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 5px 18px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.works-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.works-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.works-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.works-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.works-brand-text strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.works-topbar .mobile-sidebar-btn {
  display: none;
  padding: 5px 9px;
  min-height: 32px;
  font-size: 12.5px;
}

.primary-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  gap: 3px;
  flex-shrink: 0;
}

.primary-tab {
  border: 0;
  background: transparent;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.primary-tab:hover {
  color: var(--ink);
}

.primary-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.primary-tab-board {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.primary-tab-board.is-active {
  background: var(--signal);
  border-color: var(--signal);
  color: #FFFFFF;
}

.nav-red-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.nav-red-badge[hidden] {
  display: none !important;
}

.role-switch {
  display: inline-flex;
  padding: 2px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  gap: 2px;
}

.role-tab {
  border: 0;
  background: transparent;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}

.role-tab:hover {
  color: var(--ink);
}

.role-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.works-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.is-authenticated #btn-demo-seed {
  display: none;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  min-width: 0;
}

.user-chip span:last-child {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--signal-soft);
  color: var(--signal);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  min-height: 38px;
}

.btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 34px;
}

.btn-primary {
  background: var(--signal);
  color: #FFFFFF;
}
.btn-primary:hover:not(:disabled) {
  background: var(--signal-hover);
}

.btn-emerald {
  background: var(--emerald);
  color: #FFFFFF;
}
.btn-emerald:hover:not(:disabled) {
  background: #047857;
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}
.btn-danger:hover:not(:disabled) {
  background: #B91C1C;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-subtle);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
}

/* Main shell */
.works-main {
  width: 100%;
  min-width: 0;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 24px 56px;
  min-height: calc(100vh - 130px);
}

.works-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Status banner / Auth notice */
.notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  margin-bottom: 18px;
}

.notice-bar.is-amber {
  background: var(--amber-soft);
  border-color: rgba(217, 119, 6, 0.35);
}

.notice-bar.is-danger {
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.32);
  color: var(--danger);
}

.notice-bar.is-emerald {
  background: var(--emerald-soft);
  border-color: rgba(5, 150, 105, 0.28);
}

.notice-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Hero strip */
.workdesk-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.workdesk-hero-copy h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.workdesk-hero-copy p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  max-width: 680px;
}

.workdesk-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 4-KPI Row */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.kpi-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
}

.kpi-tile-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.kpi-tile-sub {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.kpi-tile.is-emerald .kpi-tile-value { color: var(--emerald); }
.kpi-tile.is-amber .kpi-tile-value { color: var(--amber-hover); }
.kpi-tile.is-danger .kpi-tile-value { color: var(--danger); }

.red-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 700;
}

.red-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

/* Section header */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.section-head p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* Cards & Grids */
.seats-grid, .templates-grid, .cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.templates-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.card > * {
  min-width: 0;
  max-width: 100%;
}

.seat-card {
  cursor: pointer;
}
.seat-card:hover {
  border-color: var(--signal);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.card-top > * {
  min-width: 0;
}

.card-top > :first-child {
  flex: 1 1 0%;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-subtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-subtle);
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-emerald {
  background: var(--emerald-soft);
  border-color: rgba(5, 150, 105, 0.28);
  color: var(--emerald);
}

.badge-amber {
  background: var(--amber-soft);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--amber-hover);
}

.badge-danger {
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--danger);
}

.heartbeat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-muted);
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.heartbeat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #A9A097;
  flex-shrink: 0;
}

.heartbeat-dot.is-online {
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
  animation: pulse-heartbeat 2s infinite;
}

@keyframes pulse-heartbeat {
  0%, 100% { box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.22); }
  50% { box-shadow: 0 0 0 5px rgba(5, 150, 105, 0.06); }
}

/* Progress bar */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.progress-track {
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--emerald);
  transition: width 0.25s ease;
}

.progress-fill.is-amber { background: var(--amber); }
.progress-fill.is-danger { background: var(--danger); }

.seat-summary {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: block;
  max-height: calc(1.55em * 2 + 20px);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  flex-wrap: wrap;
}

/* Benchmark template cards */
.template-card {
  position: relative;
}

.template-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.template-meta-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.template-meta-list li strong {
  flex-shrink: 0;
  white-space: nowrap;
}

.template-price-anchor {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--amber-soft);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

/* Seat Detail & 8 SDUI Blocks */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.detail-header > * {
  min-width: 0;
  max-width: 100%;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-breadcrumb > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sdui-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.sdui-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.sdui-two-col > *,
.seats-grid > *,
.templates-grid > *,
.cards-grid > *,
.two-col-grid > * {
  min-width: 0;
}

.sdui-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sdui-block-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sdui-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  border-left: 4px solid var(--emerald);
}

.sdui-status-banner.is-warn { border-left-color: var(--amber); }
.sdui-status-banner.is-danger { border-left-color: var(--danger); }

.sdui-quota-box {
  min-width: 240px;
  flex: 0 1 320px;
}

.sdui-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.sdui-kpi-cell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.sdui-kpi-cell label {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.sdui-kpi-cell strong {
  font-size: 22px;
  font-weight: 700;
}

.sdui-kpi-cell.is-ok strong { color: var(--emerald); }
.sdui-kpi-cell.is-warn strong { color: var(--amber-hover); }
.sdui-kpi-cell.is-danger strong { color: var(--danger); }

.goal-criteria-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink-muted);
  font-size: 13.5px;
}

.milestone-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  background: var(--bg);
}

.milestone-item:last-child { margin-bottom: 0; }

.milestone-item.is-review {
  border-color: rgba(217, 119, 6, 0.45);
  background: var(--amber-soft);
}

.milestone-item.is-approved {
  border-color: rgba(5, 150, 105, 0.35);
  background: var(--emerald-soft);
}

.milestone-item.is-rejected {
  border-color: rgba(220, 38, 38, 0.38);
  background: var(--danger-soft);
}

.milestone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg);
}

.checklist-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.checklist-body {
  flex: 1;
  min-width: 0;
}

.checklist-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.deliverable-item, .feed-item, .milestone-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--bg);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.deliverable-item:last-child, .feed-item:last-child { margin-bottom: 0; }

.checklist-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.sdui-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.action-bar-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Forms & Validation */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-field label {
  font-size: 13.5px;
  font-weight: 600;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--signal);
  outline: 2px solid rgba(29, 78, 216, 0.16);
  outline-offset: 0;
}

.form-textarea {
  min-height: 84px;
  resize: vertical;
}

.field-error {
  margin: 0;
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 500;
}

.field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Option chips (AI advisor) */
.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.chip-btn:hover {
  border-color: var(--signal);
}

.chip-btn.is-selected {
  background: var(--signal-soft);
  border-color: var(--signal);
  color: var(--ink);
  font-weight: 600;
}

/* Emerald Acceptance Certificate & Seal */
.certificate-card {
  position: relative;
  background: linear-gradient(180deg, #FFFFFF 0%, #F6F8FB 100%);
  border: 1.5px solid rgba(5, 150, 105, 0.42);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
  box-shadow: inset 0 0 0 4px rgba(5, 150, 105, 0.06);
}

.certificate-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(5, 150, 105, 0.28);
  border-radius: 12px;
  pointer-events: none;
}

.emerald-seal {
  position: relative;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  border: 3px solid var(--emerald);
  color: var(--emerald);
  background: rgba(236, 253, 245, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-11deg);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.22), inset 0 0 0 2px rgba(5, 150, 105, 0.25);
  user-select: none;
}

.emerald-seal strong {
  font-size: 16px;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.emerald-seal span {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

.certificate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.certificate-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

/* Comparison Table */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.compare-col {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Drawer & Modal */
.drawer-backdrop[hidden], .modal-backdrop[hidden] {
  display: none !important;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.44);
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: min(560px, 100vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.drawer-header, .modal-header {
  padding: 18px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.drawer-header > div, .modal-header > div {
  flex: 1 1 0%;
  min-width: 0;
}

.drawer-eyebrow, .modal-eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--signal);
}

.drawer-title, .modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.drawer-body, .modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  min-width: 0;
  overflow-wrap: anywhere;
  flex: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-dialog {
  width: min(720px, 100%);
  min-width: 0;
  max-height: min(90vh, 860px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
}

.icon-close-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-close-btn:hover {
  background: var(--surface-subtle);
}

/* Empty & Error States */
.state-box {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.state-box h3 {
  margin: 0;
  font-size: 16px;
}

.state-box p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13.5px;
  max-width: 540px;
}

.onboarding-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 6px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.step-pill-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--signal);
  color: #FFFFFF;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.code-block {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #F6F8FB;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Skeletons */
.skeleton-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skeleton-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.skeleton-hero { height: 96px; border-radius: var(--radius-lg); }
.skeleton-card { height: 94px; border-radius: var(--radius-md); }
.skeleton-tile { height: 200px; border-radius: var(--radius-md); }

.skeleton-shimmer {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-item {
  background: var(--ink);
  color: #FFFFFF;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.toast-item.is-ok { background: var(--emerald); }
.toast-item.is-err { background: var(--danger); }
.toast-item.is-warn { background: var(--amber-hover); }

/* Footer */
.works-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 16px 24px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.works-footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.works-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tables for developer bills / opportunities */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.works-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.works-table th, .works-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.works-table th {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Chat-First 3-Pane Workspace & Agent Workboard */
.works-main.is-chat-mode {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  flex: 1 1 0%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.works-main.is-chat-mode .works-content {
  flex: 1 1 0%;
  min-height: 0;
  gap: 0;
}

.works-main.is-workboard-mode {
  width: 100%;
  min-width: 0;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 20px 56px;
}

.chat-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  position: relative;
  background: var(--bg);
}

.chat-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: contain;
}

.chat-sidebar-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  padding: 8px 8px 4px;
  letter-spacing: 0.03em;
}

.chat-thread-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.chat-thread-item:hover {
  background: var(--bg);
}

.chat-thread-item.is-active {
  background: var(--signal-soft);
  border-color: rgba(29, 78, 216, 0.28);
}

.thread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  background: #94A3B8;
}
.thread-dot.is-emerald { background: var(--emerald); }
.thread-dot.is-amber { background: var(--amber); }
.thread-dot.is-danger { background: var(--danger); }

.thread-meta {
  flex: 1;
  min-width: 0;
}

.thread-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.thread-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-summary {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-center {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.chat-status-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.chat-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 0%;
  overflow: hidden;
}

.chat-status-left > .badge,
.chat-status-left > .status-dot {
  flex-shrink: 0;
}

.chat-status-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 55%;
}

.chat-status-metrics {
  font-size: 12.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 16px 24px;
}

.chat-stream-inner, .chat-composer-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.chat-bubble-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.chat-bubble-row.is-user {
  align-items: flex-end;
}

.chat-bubble-row.is-agent,
.chat-bubble-row.is-system {
  align-items: flex-start;
}

.chat-actor-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-bubble {
  max-width: min(640px, 92%);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: var(--surface);
  border: 1px solid var(--line);
}

.chat-bubble-row.is-user .chat-bubble {
  background: var(--ink);
  color: #F6F8FB;
  border-color: var(--ink);
  border-bottom-right-radius: 4px;
}

.chat-bubble-row.is-agent .chat-bubble {
  border-bottom-left-radius: 4px;
}

.chat-bubble-row.is-system .chat-bubble {
  background: var(--surface-subtle);
  color: var(--ink-muted);
  font-size: 12.5px;
  padding: 7px 12px;
}

/* 7 Embedded Light Cards in Chat */
.chat-card {
  width: min(620px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-card.is-emerald { border-left-color: var(--emerald); }
.chat-card.is-danger { border-left-color: var(--danger); }
.chat-card.is-amber { border-left-color: var(--amber); }

.card-compact-line {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.partner-pill-inline {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--signal-soft);
  color: var(--signal);
  font-size: 11.5px;
  font-weight: 600;
}

.card-more-fold summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--signal);
  user-select: none;
}

.chat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.chat-card-head > :first-child {
  flex: 1 1 0%;
  min-width: 0;
}

.chat-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* Bottom Universal Composer */
.chat-composer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
  flex-shrink: 0;
  position: relative;
}

.suggestion-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.suggestion-strip::-webkit-scrollbar { display: none; }

.suggest-pill {
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.suggest-pill:hover {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 7px 8px;
  position: relative;
}

.composer-box:focus-within {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.composer-input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  border: 0;
  background: transparent;
  resize: none;
  max-height: 120px;
  line-height: 1.45;
  padding: 5px 4px;
  font-size: 14px;
}
.composer-input:focus {
  outline: none;
}

.slash-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(300px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slash-menu[hidden] { display: none !important; }

.slash-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slash-item:hover {
  background: var(--signal-soft);
}

/* Right Split-Screen Single-Agent Workboard */
.chat-inspector {
  width: 440px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-inspector[hidden] {
  display: none !important;
}

.inspector-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.inspector-kpi-pair {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inspector-kpi-cell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  min-width: 0;
}

.inspector-kpi-cell small {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
}

.inspector-kpi-cell strong {
  font-size: 17px;
  font-weight: 700;
}

.sdui-fold {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 10px 12px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sdui-fold > * {
  min-width: 0;
  max-width: 100%;
}

.chat-inspector .sdui-two-col {
  grid-template-columns: 1fr;
}

.chat-inspector .sdui-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chat-inspector .sdui-quota-box {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

.chat-inspector .sdui-block,
.chat-inspector .sdui-block > *,
.chat-inspector .sdui-block-title > *,
.chat-inspector .deliverable-item,
.chat-inspector .deliverable-item * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sdui-fold summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  user-select: none;
}

.sdui-fold[open] summary {
  margin-bottom: 12px;
}

/* Product-Ops / Release-Driven components */
.ops-scorecard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ops-scorecard-cell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ops-scorecard-cell small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.ops-scorecard-cell strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}

.ops-compact-lanes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.release-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.release-preview-img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.release-board-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-card .badge,
.lane-card .badge,
.milestone-item .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge svg {
  flex-shrink: 0;
}

.chat-card,
.chat-card *,
.lane-card,
.lane-card * {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Global Agent Workboard (4-Swimlane Core Artifact) */
.workboard-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pulse-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pulse-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.pulse-pill:hover {
  border-color: var(--signal);
}

.pulse-pill.is-active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

.pulse-pill.is-warn strong { color: var(--amber-hover); }
.pulse-pill.is-danger strong { color: var(--danger); }
.pulse-pill.is-emerald strong { color: var(--emerald); }
.pulse-pill.is-active strong { color: #FFFFFF; }

/* Precision Atelier Live Workfield & Deep-Space Observatory */
.workfield-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.workfield-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.workfield-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.workfield-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.observatory-stage {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background-color: var(--stage-bg);
  background-image:
    radial-gradient(circle at 50% 24%, rgba(29, 78, 216, 0.22), transparent 54%),
    linear-gradient(var(--stage-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-grid) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
  border: 1px solid #1E293B;
  border-radius: var(--radius-lg);
  color: #F8FAFC;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 440px;
}

.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stage-topbar,
.stage-arena,
.stage-pulse-strip {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stage-line);
  background: rgba(9, 14, 26, 0.72);
}

.stage-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--stage-line);
  background: rgba(15, 23, 42, 0.76);
  font-size: 12px;
  color: #CBD5E1;
}

.stage-metric-pill strong {
  color: #FFFFFF;
}

.stage-motion-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
}

.stage-live-dot.is-paused {
  background: #94A3B8;
  box-shadow: none;
}

.stage-btn-ghost {
  color: #E2E8F0;
  border: 1px solid var(--stage-line);
  background: rgba(15, 23, 42, 0.72);
}

.stage-btn-ghost:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.9);
  color: #FFFFFF;
}

.stage-arena {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.stage-core-hub {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(29, 78, 216, 0.26);
  border: 1px solid rgba(96, 165, 250, 0.48);
  font-size: 13px;
}

.stage-core-ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #60A5FA;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.24);
}

.stage-pods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 420px));
  justify-content: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.stage-pod {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(6px);
  border: 1px solid var(--stage-line);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.stage-pod.is-selected {
  border-color: #60A5FA;
  background: rgba(15, 23, 42, 0.96);
}

.stage-pod-head {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  color: #F8FAFC;
  text-align: left;
  min-width: 0;
}

.stage-pod-title {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-pod-count {
  font-size: 11.5px;
  color: #94A3B8;
  flex-shrink: 0;
}

.stage-satellites {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.stage-node-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: #E2E8F0;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.stage-node-btn:hover {
  border-color: #60A5FA;
}

.stage-node-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748B;
}

.stage-node-btn.is-coding .stage-node-pulse {
  background: #60A5FA;
  animation: stageNodePulse 1.5s ease-in-out infinite;
}

.stage-node-btn.is-l2 .stage-node-pulse {
  background: #F59E0B;
}

.stage-node-btn.is-verify .stage-node-pulse,
.stage-node-btn.is-online .stage-node-pulse {
  background: #34D399;
}

.observatory-stage.is-motion-paused .stage-node-pulse {
  animation: none;
}

@keyframes stageNodePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.65; }
}

.stage-node-label {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.stage-node-state {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.78);
  color: #CBD5E1;
  flex-shrink: 0;
}

.stage-pod-empty {
  font-size: 12px;
  color: #94A3B8;
}

.stage-empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 16px;
  border: 1px dashed var(--stage-line);
  border-radius: var(--radius-md);
}

.stage-hud {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(96, 165, 250, 0.34);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.stage-hud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.stage-hud-head > div,
.stage-hud-item > div {
  min-width: 0;
  max-width: 100%;
}

.stage-hud-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: #93C5FD;
}

.stage-hud-title {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stage-hud-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.stage-hud-tickets,
.stage-hud-subtasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stage-hud-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  min-width: 0;
  max-width: 100%;
}

.stage-hud-item strong {
  display: block;
  font-size: 13px;
  color: #F8FAFC;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stage-hud-meta {
  display: block;
  font-size: 11.5px;
  color: #94A3B8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stage-hud-item-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.stage-pulse-strip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid var(--stage-line);
  background: rgba(9, 14, 26, 0.85);
  font-size: 12px;
  min-width: 0;
  max-width: 100%;
}

.stage-pulse-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.stage-pulse-label {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(29, 78, 216, 0.35);
  color: #93C5FD;
  font-weight: 700;
  flex-shrink: 0;
}

.stage-pulse-item.is-single {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #CBD5E1;
}

.stage-pulse-toggle {
  flex-shrink: 0;
  min-height: 26px;
  padding: 2px 8px;
  font-size: 11.5px;
}

.stage-pulse-drawer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.24);
  min-width: 0;
}

.stage-pulse-drawer-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: #CBD5E1;
  overflow-wrap: anywhere;
}

.stage-pulse-drawer-item time,
.stage-pulse-item time {
  color: #94A3B8;
  margin-left: 4px;
  flex-shrink: 0;
}

/* Minimal List & Changelog */
.minimal-list-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.minimal-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.minimal-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.minimal-group-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.minimal-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.minimal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
}

.minimal-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 220px;
}

.minimal-row-title {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.minimal-row-sub {
  font-size: 12.5px;
  color: var(--ink-muted);
}

.minimal-row-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.changelog-track {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.changelog-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.changelog-node {
  border: 1px solid var(--line);
  border-left: 3px solid var(--emerald);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.changelog-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.changelog-node-title {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.changelog-node-acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Micro-Map inside Split-Screen Inspector */
.micro-map-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.micro-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.micro-map-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--signal);
}

.micro-map-title {
  font-size: 13.5px;
}

.partner-chip-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.partner-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  min-width: 0;
}

.partner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94A3B8;
  flex-shrink: 0;
}

.partner-dot.is-online {
  background: var(--emerald);
}

.partner-chip-text {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.partner-role-tag {
  font-size: 11px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.subtask-block {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.subtask-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.subtask-row.is-done {
  opacity: 0.72;
}

.subtask-title {
  font-size: 12.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.subtask-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.template-pitch {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.sidebar-backdrop {
  display: none;
}

/* Responsive Breakpoints (Tablet & Mobile <= 768px / 390px) */
@media (max-width: 1120px) {
  .chat-inspector {
    width: 360px;
  }
}

@media (max-width: 960px) {
  body:has(.works-main.is-chat-mode) .works-topbar .mobile-sidebar-btn {
    display: inline-flex;
  }
  .chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow-lg);
  }
  .chat-sidebar.is-open {
    transform: translateX(0);
  }
  .sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 55;
  }
  .chat-inspector {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(78dvh, 640px);
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    box-shadow: var(--shadow-lg);
    z-index: 70;
    overscroll-behavior: contain;
  }
}

@media (max-width: 1040px) {
  .seats-grid, .templates-grid, .cards-grid, .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sdui-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .works-topbar-inner {
    padding: 4px 8px;
    min-height: 48px;
    height: 48px;
    gap: 4px;
    flex-wrap: nowrap;
  }
  .works-brand-group {
    gap: 4px;
    min-width: 0;
    flex: 0 1 auto;
  }
  .works-brand-text {
    display: none;
  }
  .works-brand-mark {
    width: 26px;
    height: 26px;
  }
  .tab-label-full {
    display: none;
  }
  .tab-label-short {
    display: inline;
  }
  .primary-tab {
    padding: 4px 8px;
    font-size: 11.5px;
  }
  .primary-tab svg {
    display: none;
  }
  #btn-demo-seed {
    display: none;
  }
  .works-topbar-actions {
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
  }
  .role-tab {
    padding: 4px 6px;
    font-size: 11px;
  }
  .account-pill {
    gap: 4px;
    min-width: 0;
  }
  .user-chip {
    padding: 2px 6px 2px 4px;
    gap: 4px;
    font-size: 11px;
  }
  .user-avatar-dot {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
  .user-chip span:last-child {
    max-width: 40px;
  }
  .account-pill .btn-sm {
    padding: 3px 6px;
    font-size: 11px;
    min-height: 28px;
  }
  .works-main.is-chat-mode {
    flex: 1 1 0%;
    min-height: 0;
  }
  .works-main.is-workboard-mode {
    padding: 12px 10px 44px;
  }
  .chat-status-bar {
    padding: 8px 10px;
  }
  .chat-status-title {
    max-width: none;
  }
  .chat-status-metrics {
    display: none;
  }
  .composer-input {
    min-height: 36px;
    font-size: 14px;
  }
  .chat-stream {
    padding: 10px 10px 16px;
  }
  .chat-card-actions .btn,
  .minimal-row-acts .btn,
  .stage-hud-actions .btn,
  .stage-hud-item-acts .btn {
    min-height: 44px;
  }
  .stage-pods-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage-arena {
    padding: 12px 10px;
  }
  .stage-topbar {
    padding: 10px;
  }
  .stage-hud {
    padding: 12px 10px;
  }
  .seats-grid, .templates-grid, .cards-grid, .two-col-grid, .skeleton-grid, .changelog-rail {
    grid-template-columns: minmax(0, 1fr);
  }
  .certificate-meta {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal-dialog {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
  }
  .toast-stack {
    top: calc(env(safe-area-inset-top, 0px) + 56px);
    bottom: auto;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .works-topbar .mobile-sidebar-btn span {
    display: none;
  }
  .works-brand {
    display: none;
  }
}

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

/* ---- 2026-12 七角色走查后的补齐：访客首屏、待办提示条、如实提示、接入进度、空工作场 ---- */

/* 访客第一屏：手机顶部放不下品牌和演示按钮，这里一定有。 */
.visitor-intro {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  max-width: 520px;
}
.visitor-intro-brand {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}
.visitor-intro p {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.65;
}
.visitor-intro ul {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-muted);
}
.visitor-intro .chat-card-actions {
  margin-top: 4px;
}

/* “待你处理”：放在输入框上方，按身份算出来，一步到位。 */
.next-step-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.next-step-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.10);
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.next-step-item:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--signal);
}
.next-step-item.is-note {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink-muted);
  cursor: default;
}
.next-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
}
.next-step-item.is-note .next-step-dot {
  background: var(--ink-muted);
}
.next-step-arrow {
  color: var(--ink-muted);
}

/* 对话里的提示条：席位没接入 Agent、席位链接打不开。 */
.notice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 12.5px;
  line-height: 1.6;
}
.notice-strip.is-amber {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.10);
}
.notice-strip.is-danger {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.07);
}

.compare-warning,
.composer-note.is-warn {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.10);
  font-size: 13px;
  line-height: 1.6;
}
.composer-note.is-warn {
  margin: 0 0 8px;
  font-size: 12.5px;
}

/* 接入 Agent：步骤清单，做到哪一步哪一步打勾。 */
.connect-steps {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.connect-steps li {
  position: relative;
  padding-left: 26px;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.6;
}
.connect-steps li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong, #CBD5E1);
  background: var(--surface);
}
.connect-steps li.is-done {
  color: var(--ink);
}
.connect-steps li.is-done::before {
  border-color: var(--emerald);
  background: var(--emerald);
  box-shadow: inset 0 0 0 2.5px var(--surface);
}
.connect-steps li + li::after {
  content: "";
  position: absolute;
  left: 9.5px;
  top: -8px;
  width: 1.5px;
  height: 8px;
  background: var(--line);
}

/* “待你处理”入口把对应的卡滚到眼前时闪一下，告诉人看哪里。 */
.is-flash {
  animation: worksFlashTarget 1.6s ease-out;
}
@keyframes worksFlashTarget {
  0%, 25% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* 一个席位都没有时的工作场：一张卡说清楚，不再摆一座空的观测台。 */
.stage-empty-compact {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(1200px 260px at 10% -10%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(900px 220px at 100% 110%, rgba(16, 185, 129, 0.10), transparent 60%),
    var(--surface);
}
.stage-empty-compact-text strong {
  display: block;
  font-size: 17px;
  margin-bottom: 6px;
}
.stage-empty-compact-text p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 620px;
}
.stage-empty-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
}
.stage-empty-steps li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stage-empty-steps b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--signal);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.stage-empty-compact-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 已发出、还没签约的需求单：发完单的人在工作场里要能看到它们在匹配。 */
.stage-matching-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stage-matching-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
}
.stage-matching-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stage-matching-text strong {
  font-size: 14px;
  margin: 0;
  overflow-wrap: anywhere;
}
.stage-matching-text .field-hint {
  margin: 0;
}
@media (max-width: 960px) {
  .stage-matching-item {
    flex-wrap: wrap;
  }
}

/* 星图上的圆桌标记：受阻、未接入 Agent。 */
.stage-pod-flag {
  font-size: 11px;
  line-height: 1.5;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #FCD34D;
  white-space: nowrap;
}
.stage-pod-flag.is-danger {
  border-color: rgba(248, 113, 113, 0.7);
  color: #FCA5A5;
}
.stage-pod.is-blocked {
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.55);
}
.stage-pod.is-unstaffed .stage-node-pulse {
  animation: none;
  opacity: 0.4;
}

/* 手机：状态栏里的指标可以收窄，账号名不挤占按钮。 */
@media (max-width: 960px) {
  .chat-status-left {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .chat-status-metrics {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-chip > span:last-child {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .next-step-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .next-step-strip::-webkit-scrollbar { display: none; }
  .next-step-item {
    white-space: nowrap;
  }
  .stage-empty-compact {
    padding: 18px 14px;
  }
}

/* ==========================================================================
   实时工作场 · 项目指挥台（2026-12-06 晚改版）
   浅色、按「轮到谁 / 做到哪」组织；动效只用 transform / opacity，减少动态效果时全部关闭。
   ========================================================================== */
.workfield-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-muted); }
.cs-board { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cs-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }
.cs-brief {
  position: relative; overflow: hidden; min-width: 0;
  background: linear-gradient(135deg, #FFFFFF 0%, #F3F7FF 100%);
  border: 1px solid #D6E2FB; border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.cs-brief::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.10), transparent 70%); pointer-events: none;
}
.cs-brief-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cs-steward { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--signal); }
.cs-ai-tag { font-size: 11.5px; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-subtle); color: var(--ink-muted); }
.cs-ai-tag.is-ai { background: var(--signal-soft); color: var(--signal); }
.cs-brief-text { margin: 0 0 10px; font-size: 15.5px; line-height: 1.6; color: var(--ink); font-weight: 600; }
.cs-brief-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cs-brief-item {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: baseline;
  text-align: left; background: rgba(255, 255, 255, 0.9); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; cursor: pointer; min-height: 44px; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.cs-brief-item:hover { border-color: var(--signal); box-shadow: var(--shadow-xs); transform: translateY(-1px); }
.cs-brief-item.is-urgent { border-left: 3px solid var(--amber); }
.cs-brief-who { grid-row: span 2; font-size: 12px; font-weight: 700; color: var(--amber-hover); white-space: nowrap; }
.cs-brief-title { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-brief-what { font-size: 12.5px; color: var(--ink-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cs-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.cs-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: var(--shadow-xs);
}
.cs-kpi span { font-size: 12.5px; color: var(--ink-muted); }
.cs-kpi strong { font-size: 24px; line-height: 1.2; font-weight: 700; }
.cs-kpi.is-hot strong { color: var(--amber-hover); }
.cs-kpi.is-danger strong { color: var(--danger); }

.cs-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.cs-section-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; min-width: 0; }
.cs-section-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.cs-section-head .btn { margin-left: auto; }
.cs-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.cs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.cs-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 14px 12px;
  box-shadow: var(--shadow-xs); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  border-top: 3px solid var(--line-strong);
}
.cs-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.cs-card.is-selected { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12), var(--shadow-sm); }
.cs-card.is-amber { border-top-color: var(--amber); }
.cs-card.is-danger { border-top-color: var(--danger); }
.cs-card.is-signal { border-top-color: var(--signal); }
.cs-card.is-emerald { border-top-color: var(--emerald); }
.cs-card.is-muted { border-top-color: var(--line-strong); }
.cs-card-hit { position: absolute; inset: 0; border: 0; background: transparent; border-radius: inherit; cursor: pointer; z-index: 0; }
.cs-card > *:not(.cs-card-hit) { position: relative; z-index: 1; pointer-events: none; }
.cs-card .btn, .cs-card a, .cs-card button:not(.cs-card-hit) { pointer-events: auto; }
.cs-card-head { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 56px; }
.cs-card-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cs-phase { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--surface-subtle); color: var(--ink-muted); }
.cs-card.is-amber .cs-phase { background: var(--amber-soft); color: var(--amber-hover); }
.cs-card.is-danger .cs-phase { background: var(--danger-soft); color: var(--danger); }
.cs-card.is-signal .cs-phase { background: var(--signal-soft); color: var(--signal); }
.cs-card.is-emerald .cs-phase { background: var(--emerald-soft); color: var(--emerald); }
.cs-card-time { position: absolute; top: 14px; right: 14px; font-size: 12px; color: var(--ink-muted); z-index: 1; }
.cs-card-body { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cs-ring { position: relative; flex: 0 0 auto; width: 44px; height: 44px; display: inline-grid; place-items: center; }
.cs-ring svg { position: absolute; inset: 0; }
.cs-ring b { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.cs-ring-track { fill: none; stroke: var(--surface-subtle); stroke-width: 4; }
.cs-ring-bar { fill: none; stroke: var(--signal); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.cs-card.is-emerald .cs-ring-bar { stroke: var(--emerald); }
.cs-card.is-amber .cs-ring-bar { stroke: var(--amber); }
.cs-card.is-danger .cs-ring-bar { stroke: var(--danger); }
.cs-next { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cs-next-who { font-size: 12px; font-weight: 700; color: var(--ink-muted); }
.cs-card.is-amber .cs-next-who { color: var(--amber-hover); }
.cs-next-text { margin: 0; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cs-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; margin-top: auto; }
.cs-card-cta { flex: 0 0 auto; }
.cs-team { display: inline-flex; align-items: center; min-width: 0; }
.cs-team-empty { font-size: 12.5px; color: var(--ink-muted); }
.cs-avatar {
  position: relative; width: 30px; height: 30px; border-radius: 50%; margin-right: -6px; flex: 0 0 auto;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: #64748B; border: 2px solid var(--surface);
}
.cs-avatar.is-agent { background: #94A3B8; color: #fff; }
.cs-avatar.is-agent.is-online { background: var(--emerald); }
.cs-avatar.is-more { background: var(--surface-subtle); color: var(--ink-muted); }
.cs-heartbeat { position: absolute; inset: -2px; border-radius: 50%; pointer-events: none; }
.cs-avatar.is-online .cs-heartbeat { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.55); animation: cs-heartbeat 2.2s ease-out infinite; }
@keyframes cs-heartbeat { 0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); } 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); } }

.cs-board[data-animate="1"] .cs-card { animation: cs-rise .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms); }
.cs-board[data-animate="1"] .cs-kpi, .cs-board[data-animate="1"] .cs-brief { animation: cs-rise .38s ease-out both; }
@keyframes cs-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.cs-detail:empty { display: none; }
.cs-detail { margin-top: 12px; }
.cs-detail .stage-hud { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); color: var(--ink); backdrop-filter: none; }
.cs-detail .stage-hud p, .cs-detail .stage-hud strong { color: var(--ink) !important; }
.cs-detail .stage-hud-badge { background: var(--signal-soft); color: var(--signal); border-color: transparent; }
.cs-detail .stage-hud-title { color: var(--ink); }
.cs-detail .stage-hud-item { background: var(--surface-subtle); border-color: var(--line); color: var(--ink); }
.cs-detail .stage-hud-meta { color: var(--ink-muted); }
.cs-detail .stage-btn-ghost { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }

.cs-feed { position: sticky; top: 72px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; max-height: calc(100dvh - 96px); overflow: auto; min-width: 0; }
.cs-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.cs-timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--surface-subtle); }
.cs-ev { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; padding: 6px 0 10px; }
.cs-ev-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--line-strong); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); z-index: 1; }
.cs-ev.is-signal .cs-ev-dot { background: var(--signal); }
.cs-ev.is-emerald .cs-ev-dot { background: var(--emerald); }
.cs-ev.is-danger .cs-ev-dot { background: var(--danger); }
.cs-ev-body p { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.cs-ev-seat { border: 0; background: none; padding: 0; font-size: 12px; color: var(--signal); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.cs-ev time { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; }
.cs-ev.is-new { animation: cs-ev-in .5s cubic-bezier(.2,.8,.2,1) both; }
.cs-ev.is-new .cs-ev-body { animation: cs-flash 1.8s ease-out both; border-radius: 6px; }
@keyframes cs-ev-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes cs-flash { 0% { background: rgba(29, 78, 216, 0.12); } 100% { background: transparent; } }
.cs-timeline-empty { margin: 0; font-size: 13px; color: var(--ink-muted); }

.cs-opps { margin-top: 6px; }
.cs-opps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cs-opp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cs-opp.is-invited { border-color: #FCD34D; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.10); }
.cs-opp-head { display: flex; gap: 6px; align-items: center; }
.cs-invited { font-size: 12px; font-weight: 700; color: var(--amber-hover); background: var(--amber-soft); border-radius: var(--radius-pill); padding: 2px 8px; }
.cs-opp h3 { margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-opp-summary { margin: 0; font-size: 13px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cs-fit { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cs-fit li { font-size: 12px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--surface-subtle); color: var(--ink-muted); }
.cs-opp-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: auto; }

.cs-board.is-motion-paused *, .cs-board.is-motion-paused *::before, .cs-board.is-motion-paused *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .cs-board *, .cs-board *::before, .cs-board *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 1120px) {
  .cs-main { grid-template-columns: minmax(0, 1fr); }
  .cs-feed { position: static; max-height: none; }
}
@media (max-width: 760px) {
  .cs-top { grid-template-columns: minmax(0, 1fr); }
  .cs-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cs-kpi { padding: 8px; }
  .cs-kpi span { font-size: 11.5px; line-height: 1.3; }
  .cs-kpi strong { font-size: 19px; }
  .cs-cards, .cs-opps-grid { grid-template-columns: minmax(0, 1fr); }
  .cs-brief { padding: 14px; }
  .cs-brief-text { font-size: 15px; }
}

/* ---------- AI 与系统消息标识（对话流） ---------- */
.msg-ai-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: var(--radius-pill); background: var(--signal-soft); color: var(--signal); vertical-align: 1px; }
.msg-ai-tag.is-rule { background: var(--surface-subtle); color: var(--ink-muted); }
.msg-event-tag { margin-left: 6px; font-size: 11.5px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-subtle); color: var(--ink-muted); }
.chat-typing { display: inline-flex; gap: 4px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); animation: chat-typing 1.2s infinite ease-in-out; }
.chat-typing i:nth-child(2) { animation-delay: .15s; } .chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .chat-typing i { animation: none; } }
.bubble-steward { border-left: 3px solid var(--signal) !important; }

/* ---------- 推荐开发者（撮合） ---------- */
.match-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.match-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; }
.match-item h4 { margin: 0 0 4px; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.match-score { font-size: 12px; font-weight: 700; color: var(--signal); background: var(--signal-soft); border-radius: var(--radius-pill); padding: 1px 8px; }
.match-reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.match-reasons li { font-size: 12px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--emerald-soft); color: var(--emerald); }
.match-reasons li.is-caution { background: var(--amber-soft); color: var(--amber-hover); }
.ai-draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--signal-soft); color: var(--signal); font-size: 13px; }
.proposal-ms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.proposal-ms-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-subtle); }
.chat-bubble { white-space: pre-wrap; }
.cs-card > .cs-card-time { position: absolute; top: 14px; right: 14px; }
.cs-card-head { padding-right: 64px; }
@media (max-width: 760px) {
  .cs-brief-items li:nth-child(n+3) { display: none; }
  .cs-brief-items:not([data-more="0"])::after { content: "还有 " attr(data-more) " 件，在下方席位卡里"; font-size: 12.5px; color: var(--ink-muted); padding: 2px 2px 0; }
}

/* ---------- 账号面板与手机顶栏 ---------- */
.user-chip { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-pill); padding: 3px 10px 3px 3px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 36px; max-width: 220px; }
.user-chip:hover { border-color: var(--line-strong); }
.user-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.user-chip-flag { font-size: 11px; font-weight: 700; color: var(--amber-hover); background: var(--amber-soft); border-radius: var(--radius-pill); padding: 0 6px; }
.account-sheet { display: flex; flex-direction: column; gap: 12px; }
.account-role-switch { display: grid; grid-template-columns: 1fr 1fr; }
.account-role-switch .role-tab { min-height: 44px; }
.account-upgrade { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius-md); background: var(--amber-soft); border: 1px solid #FCD34D; }
.account-upgrade .field-hint { margin: 0; }
.account-age { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.account-sheet-foot { display: flex; justify-content: flex-end; }
@media (max-width: 680px) {
  .works-topbar .role-switch, .works-topbar .topbar-logout, .works-topbar .user-chip-name { display: none !important; }
  .works-topbar .user-chip { padding: 3px; max-width: none; }
  .works-topbar .primary-tab { min-height: 40px; padding-inline: 14px; font-size: 14px; }
  .works-topbar .mobile-sidebar-btn { min-height: 40px; min-width: 40px; }
}
