/* PicoVerse — app-specific layout only
 * factory-theme.css provides all design tokens — never redefine them here.
 * Rules: no rem/em/clamp, no color overrides, no border-radius overrides. */

.af-main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 48px;
}

body[data-af-page="admin"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
}

body[data-af-page="dashboard"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
}

body[data-af-page="security"] .af-main,
body[data-af-page="auditor"] .af-main,
body[data-af-page="breakroom"] .af-main,
body[data-af-page="catalog"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
}

body[data-af-page="supervisor"] {
  overflow: hidden;
}

body[data-af-page="builder"] {
  overflow: hidden;
}

body[data-af-page="supervisor"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
  height: calc(100vh - var(--factory-shell-height, 48px));
  box-sizing: border-box;
  padding: 12px 0;
  display: flex;
  overflow: hidden;
}

body[data-af-page="builder"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
  height: calc(100vh - var(--factory-shell-height, 48px));
  box-sizing: border-box;
  padding: 12px 0;
  display: flex;
  overflow: hidden;
}

body[data-af-page="ai"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
  padding: 12px 0 24px;
}

body[data-af-page="dellebonding"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
  padding: 18px 0 32px;
}

body[data-af-page="dellebonding"] .factory-page-header {
  margin-bottom: 16px;
}


body[data-af-page="ai"] .factory-page-header {
  margin-bottom: 12px;
}

.localai-workspace {
  height: 60vh;
  min-height: 360px;
  max-height: 640px;
  display: flex;
  flex-direction: column;
}

.localai-chat-shell {
  width: 100%;
}

body[data-af-page="ai"] .chat-sidebar {
  width: 260px;
}

body[data-af-page="ai"] .chat-zone {
  min-width: 0;
}

body[data-af-page="ai"] .chat-messages {
  padding: 18px 24px;
}

.localai-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.localai-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.localai-controls select {
  min-width: 180px;
  height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.localai-model-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  font-size: 11px;
  color: var(--text-muted);
}

.localai-dot-ok,
.localai-dot-bad {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.localai-dot-ok { background: var(--success, #22c55e); }
.localai-dot-bad { background: var(--error, #ef4444); }

.localai-hop-panel {
  width: 260px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.localai-hop-title {
  padding: 12px 14px 2px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.localai-hop-subtitle {
  padding: 0 14px 10px;
  font-size: 10px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.localai-hop-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 16px;
}

.localai-hop-empty {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.localai-hop-step {
  position: relative;
  display: flex;
  gap: 9px;
  padding: 0 0 14px;
}

.localai-hop-step::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: 1px;
  width: 1px;
  background: var(--border);
}

.localai-hop-step:last-child::after {
  display: none;
}

.localai-hop-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 3px;
  background: var(--text-muted);
  flex-shrink: 0;
  z-index: 1;
}

.localai-hop-step.done .localai-hop-dot { background: var(--success, #22c55e); }
.localai-hop-step.active .localai-hop-dot { background: var(--accent); }
.localai-hop-step.warn .localai-hop-dot { background: var(--warning, #f59e0b); }
.localai-hop-step.error .localai-hop-dot { background: var(--error, #ef4444); }

.localai-hop-body {
  min-width: 0;
}

.localai-hop-step-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.localai-hop-step-detail {
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.localai-hop-step-time {
  margin-top: 3px;
  font-size: 9px;
  color: var(--text-muted);
}

body[data-af-page="supervisor"] #af-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body[data-af-page="builder"] #af-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body[data-af-page="supervisor"] .footer {
  display: none;
}

body[data-af-page="builder"] .footer {
  display: none;
}

.supervisor-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.builder-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.supervisor-workspace {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.builder-workspace {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.supervisor-workspace .chat-shell {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
}

.builder-workspace .chat-shell {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
}

body[data-af-page="supervisor"] .chat-sidebar,
body[data-af-page="supervisor"] .chat-zone {
  min-height: 0;
}

body[data-af-page="builder"] .chat-sidebar,
body[data-af-page="builder"] .chat-zone {
  min-height: 0;
}

body[data-af-page="supervisor"] .chat-sidebar-body,
body[data-af-page="supervisor"] .chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body[data-af-page="builder"] .chat-sidebar-body,
body[data-af-page="builder"] .chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Designer surface — full-height workspace layout, same as supervisor/builder.
   Was missing, so the workspace collapsed to 0 height (page looked empty). */
body[data-af-page="designer"] { overflow: hidden; }
body[data-af-page="designer"] .af-main {
  width: calc(100% - 24px);
  max-width: none;
  height: calc(100vh - var(--factory-shell-height, 48px));
  box-sizing: border-box;
  padding: 12px 0;
  display: flex;
  overflow: hidden;
}
body[data-af-page="designer"] #af-app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body[data-af-page="designer"] .footer { display: none; }
body[data-af-page="designer"] .chat-sidebar,
body[data-af-page="designer"] .chat-zone { min-height: 0; }
body[data-af-page="designer"] .chat-sidebar-body,
body[data-af-page="designer"] .chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Guides / docs — themed prose. .factory-prose wraps rendered markdown
   (factory-docs.js) but had NO styles, so guides rendered as raw browser
   defaults (unthemed). Use theme tokens only. */
.factory-prose { color: var(--text); font-size: 14px; line-height: 1.65; }
.factory-prose h1 { font-size: 24px; font-weight: 700; margin: 0 0 14px; line-height: 1.25; }
.factory-prose h2 { font-size: 19px; font-weight: 700; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.factory-prose h3 { font-size: 16px; font-weight: 700; margin: 22px 0 8px; }
.factory-prose h4 { font-size: 14px; font-weight: 700; margin: 18px 0 6px; }
.factory-prose p { margin: 0 0 12px; }
.factory-prose ul, .factory-prose ol { margin: 0 0 12px; padding-left: 22px; }
.factory-prose li { margin: 4px 0; }
.factory-prose a { color: var(--accent); text-decoration: none; }
.factory-prose a:hover { text-decoration: underline; }
.factory-prose code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; background: var(--surface2); padding: 1px 5px; border-radius: 4px; }
.factory-prose pre { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 0 0 14px; }
.factory-prose pre code { background: none; padding: 0; }
.factory-prose blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--border); color: var(--text-muted); }
.factory-prose table { border-collapse: collapse; margin: 0 0 14px; font-size: 13px; }
.factory-prose th, .factory-prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.factory-prose th { background: var(--surface2); font-weight: 700; }
.factory-prose hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.factory-prose h1:first-child, .factory-prose h2:first-child, .factory-prose h3:first-child { margin-top: 0; }

/* Expanded input box — matches storyfactory "+ Idea" AI Section sizing */
#sup-chat-input {
  min-height: 81px;
  max-height: 217px;
  overflow-y: hidden;
}

/* Login page */
.af-login-card {
  max-width: 420px;
  margin: 80px auto 0;
  text-align: center;
}
.af-login-users {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}
.af-login-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.af-login-btn:hover {
  background: var(--surface2);
}
.af-login-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 95, 2, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* Dashboard stats */
.af-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

/* Review 3-panel: uses workbench pattern from factory-demo/pages/workbench.html */
.workbench-grid {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .workbench-grid { grid-template-columns: 1fr; }
}
.workbench-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.workbench-panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.wb-score-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px 0;
}
.wb-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wb-ai-notes {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.wb-ai-notes p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* Knowledge sidebar tree */
.af-knowledge-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .af-knowledge-layout { grid-template-columns: 1fr; }
}
.af-tree-sidebar {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: sticky;
  top: 64px;
}
.af-tree-item {
  padding: 6px 10px;
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.1s;
}
.af-tree-item:hover, .af-tree-item.active {
  background: var(--surface2);
  color: var(--text);
}
.af-tree-item.indent-1 { padding-left: 24px; }
.af-tree-item.indent-2 { padding-left: 40px; }

/* Board table tweaks */
.af-board-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.af-board-filters .form-select,
.af-board-filters .form-input {
  max-width: 200px;
}

/* AF-662: PM workspace zone — compact strip + expanded split layout */
.bd-pm-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.bd-pm-strip--off { border-left-color: var(--text-muted); }
.bd-pm-strip--waiting,
.bd-pm-strip--warn  { border-left-color: #b45309; }
.bd-pm-strip--error { border-left-color: #b91c1c; }

.bd-pm-strip__info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}
.bd-pm-strip__pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface2);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.bd-pm-strip__headline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.bd-pm-strip__meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.bd-pm-strip__talk-btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 10px;
}

/* Expanded PM workspace: main (left ~80%) + attention rail (right ~20%) */
/* Inline attention links in dispatcher strip */
.bd-pm-strip__attn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-left: auto;
  padding-left: 12px;
  flex-shrink: 0;
}
.bd-pm-strip__attn-warn {
  color: #b45309;
  font-weight: 600;
  white-space: nowrap;
}
.bd-pm-attn-link {
  color: #92400e;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.bd-pm-attn-link:hover {
  text-decoration: underline;
  color: #78350f;
}

/* PM chat modal */
.bd-pm-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  max-height: 60vh;
}
.bd-pm-chat--large {
  min-height: 450px;
  max-height: 70vh;
}
.bd-pm-chat__msgs {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px;
  min-height: 200px;
}
.bd-pm-chat--large .bd-pm-chat__msgs {
  min-height: 350px;
}
.bd-pm-chat__msg {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 85%;
}
.bd-pm-chat--large .bd-pm-chat__msg {
  max-width: 80%;
}
.bd-pm-chat__msg--user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-radius: 8px 8px 2px 8px;
}
.bd-pm-chat__msg--assistant {
  background: var(--surface2);
  color: var(--text);
  align-self: flex-start;
  border: 1px solid var(--border);
  border-radius: 8px 8px 8px 2px;
}
.bd-pm-chat__meta {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.3;
}
.bd-pm-chat__msg--user .bd-pm-chat__meta {
  color: rgba(255, 255, 255, 0.84);
  text-align: right;
}
.bd-pm-chat__msg--assistant .bd-pm-chat__meta {
  color: var(--text-muted);
}
.bd-pm-chat__msg--assistant p { margin: 0 0 6px; }
.bd-pm-chat__msg--assistant p:last-child { margin-bottom: 0; }
.bd-pm-chat__input-bar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

@media (max-width: 600px) {
  .bd-pm-workspace { grid-template-columns: 1fr; }
  .bd-pm-workspace__rail { max-width: 100%; }
}

.bd-dispatch-summary { display: none; }

/* Builder layout + terminal: uses patterns from factory-demo/ui/terminal.html */
.builder-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .builder-layout { grid-template-columns: 1fr; }
}
.builder-sidebar {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  position: sticky;
  top: 64px;
}
.builder-session-item {
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 150ms;
}
.builder-session-item:hover { background: var(--surface2); }
.builder-session-title { font-size: 12px; font-weight: 500; color: var(--text); }
.builder-session-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.factory-terminal {
  background: var(--terminal-bg, #0a0e14);
  color: var(--terminal-text, #b3b1ad);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.factory-terminal::-webkit-scrollbar { width: 6px; }
.factory-terminal::-webkit-scrollbar-track { background: transparent; }
.factory-terminal::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.factory-terminal .t-accent { color: #FF5F02; }
.factory-terminal .t-success { color: #04CE7E; }
.factory-terminal .t-error { color: #ef4444; }
.factory-terminal .t-muted { color: #555; }
.factory-terminal .t-info { color: #3053F4; }

.terminal-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.terminal-header .terminal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.terminal-wrap .factory-terminal {
  border: none;
  border-radius: 0;
}

/* Admin tabs */
.af-tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.af-tab {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.af-tab:hover { color: var(--text); }
.af-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Guides content */
.af-guide-content {
  max-width: 740px;
  line-height: 1.7;
}
.af-guide-content h2 { font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
.af-guide-content h3 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }
.af-guide-content p { margin: 8px 0; font-size: 13px; color: var(--text-secondary); }
.af-guide-content ul { padding-left: 20px; }
.af-guide-content li { font-size: 13px; color: var(--text-secondary); margin: 4px 0; }
.af-guide-content code {
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 12px;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Modal — from factory-demo/ui/feedback.html spec (not in factory-theme.css) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.modal-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* Toast — from factory-demo/ui/feedback.html spec (not in factory-theme.css) */
.toast {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
}
.toast.success { background: rgba(4, 206, 126, 0.15); color: #04CE7E; }
.toast.warning { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.toast.error   { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.toast.info    { background: rgba(48, 83, 244, 0.15); color: #3053F4; }

/* Danger button variant — for reject/delete actions */
.btn-danger {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 150ms ease;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

/* Identity chip — from factory-demo/ui/topbar.html spec */
.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.identity-chip:hover { background: rgba(255, 255, 255, 0.1); }
.identity-chip .ic-name { font-weight: 600; }
.identity-chip .ic-caret { font-size: 10px; color: rgba(255, 255, 255, 0.5); }
.identity-chip.logged-out {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.identity-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-size: 13px;
}
.identity-dropdown .id-email {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.identity-dropdown .id-action {
  padding: 9px 14px;
  color: var(--text);
  cursor: pointer;
}
.identity-dropdown .id-action:hover { background: var(--surface2); }
.identity-dropdown .id-action.danger {
  color: var(--danger);
  border-top: 1px solid var(--border);
}

/* Chat UI — from factory-demo/ui/chat.html spec */
.chat-shell {
  display: flex;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
  text-align: center;
  padding: 32px;
}
.sup-load-earlier-btn {
  display: block;
  margin: 4px auto 12px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-alt, #f3f4f6);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.sup-load-earlier-btn:hover { background: var(--border); }
.sup-load-earlier-btn:disabled { opacity: 0.6; cursor: default; }
.chat-empty .ce-icon { font-size: 32px; opacity: 0.4; }
.chat-empty .ce-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.chat-empty .ce-hint { font-size: 12px; }

/* Message bubbles */
.msg { display: flex; gap: 10px; max-width: 90%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.assistant { align-self: flex-start; }
.msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.6;
}
.msg.user .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: var(--radius-sm);
}
.msg.assistant .msg-bubble {
  background: var(--surface2);
  color: var(--text);
  border-bottom-left-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.msg-bubble p { margin: 0 0 6px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble code { font-size: 11px; background: rgba(0,0,0,0.15); padding: 1px 4px; border-radius: 3px; }
.msg.user .msg-bubble code { background: rgba(255,255,255,0.2); }
.msg-meta { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.msg.user .msg-meta { text-align: right; }

/* Typing indicator */
.msg-typing .msg-bubble { padding: 12px 16px; }
.typing-dots { display: flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  animation: dot-bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Input bar */
.chat-input-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.chat-input-wrap { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-bar textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  resize: none;
  min-height: 42px;
  max-height: 160px;
  line-height: 1.5;
  outline: none;
}
.chat-input-bar textarea:focus { border-color: var(--accent); }
.chat-input-bar textarea::placeholder { color: var(--text-muted); }
.chat-send-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 150ms;
}
.chat-send-btn:hover { background: var(--accent-hover, #e65500); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-stop-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--danger, #dc2626);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 150ms;
}
.chat-stop-btn:hover { background: #b91c1c; }
.chat-input-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: right;
}

/* Chat sidebar — from factory-demo/ui/chat.html spec */
.chat-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface2);
}
.chat-sidebar.collapsed { width: 40px; }
.chat-sidebar.collapsed .chat-sidebar-body,
.chat-sidebar.collapsed .new-session-btn { display: none; }
.chat-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-toggle-btn {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 3px; line-height: 1;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover { color: var(--text); }
.new-session-btn {
  flex: 1; padding: 6px 10px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.new-session-btn:hover { background: var(--accent-hover, #e65500); }
.chat-sidebar-body {
  flex: 1; overflow-y: auto; padding: 6px;
}
.sup-team-filter-wrap {
  padding: 4px 8px;
}
.sup-team-filter-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--text-muted) 18%);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface2) 90%, var(--surface) 10%);
  color: var(--text);
}
.sup-team-filter-input::placeholder {
  color: var(--text-muted);
}
.sup-team-filter-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border) 45%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent 82%);
}
.session-item {
  position: relative;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 150ms;
}
.session-item-row {
  display: block;
  min-width: 0;
}
.session-item:hover { background: var(--surface); }
.session-item.is-active {
  background: rgba(255, 95, 2, 0.1);
  border-left: 3px solid var(--accent);
  padding-left: 7px;
}
.session-title {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px; font-weight: 500;
  color: var(--text);
}
.session-title-text {
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.25;
}
.session-meta {
  font-size: 10px; color: var(--text-muted); margin-top: 4px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
}
.session-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 4px;
  position: absolute;
  top: 8px;
  right: 10px;
  margin: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 150ms ease, transform 150ms ease;
}
.session-actions--owner {
  min-width: 0;
}
.session-item:hover .session-actions,
.session-item:focus-within .session-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.session-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: color-mix(in srgb, var(--surface) 78%, transparent 22%);
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent 28%);
  color: color-mix(in srgb, var(--text-muted) 82%, var(--text) 18%);
  cursor: pointer;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 6px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(3px);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease, opacity 150ms ease;
}
.session-action-btn.pin {
  min-width: 52px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 600;
}
.session-action-btn:hover {
  color: var(--danger);
  border-color: rgba(239,68,68,0.35);
  background: rgba(239,68,68,0.08);
  box-shadow: 0 2px 6px rgba(239,68,68,0.12);
  transform: translateY(-1px);
}
.session-action-btn.edit:hover {
  color: var(--accent);
  border-color: rgba(255,95,2,0.35);
  background: rgba(255,95,2,0.08);
  box-shadow: 0 2px 6px rgba(255,95,2,0.12);
}
.session-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface2) 92%, transparent 8%);
  border-color: color-mix(in srgb, var(--border) 88%, transparent 12%);
  box-shadow: none;
  transform: none;
}
.session-action-btn:disabled:hover {
  color: var(--text-muted);
  border-color: color-mix(in srgb, var(--border) 88%, transparent 12%);
  background: color-mix(in srgb, var(--surface2) 92%, transparent 8%);
  box-shadow: none;
  transform: none;
}
.session-rename-form {
  display: none; flex-direction: column; gap: 6px; margin-top: 4px;
}
.session-rename-form.open { display: flex; }
.session-rename-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  padding: 5px 8px; font-size: 12px; font-family: var(--font);
}
.session-rename-input:focus { outline: none; border-color: var(--accent); }
.session-rename-btns { display: flex; gap: 4px; }
.session-rename-btns button {
  flex: 1; padding: 4px; font-size: 11px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.session-rename-btns .save { background: var(--accent); color: #fff; border-color: var(--accent); }
.session-delete-confirm {
  display: none; flex-direction: column; gap: 6px; margin-top: 4px;
}
.session-delete-confirm.open { display: flex; }
.session-delete-confirm .confirm-msg {
  font-size: 11px; color: var(--danger); font-weight: 500;
}
.session-delete-btns { display: flex; gap: 4px; }
.session-delete-btns button {
  flex: 1; padding: 4px; font-size: 11px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.session-delete-btns .delete-yes { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Builder status spinner */
.bld-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: middle;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: bld-spin 0.6s linear infinite;
}
@keyframes bld-spin { to { transform: rotate(360deg); } }

/* Chat context bar */
.chat-context-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 95, 2, 0.06);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  flex-shrink: 0;
}
.chat-context-bar.visible { display: flex; }

/* ═══ Submit workspace layout ═══ */
.af-submit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .af-submit-grid { grid-template-columns: 1fr; }
}

/* Chat panel — matches draft preview height, scrolls internally */
.af-submit-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.af-submit-chat .chat-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.af-submit-chat .chat-messages {
  flex: 1;
  min-height: 200px;
  overflow-y: auto;
}

/* Draft preview panel */
.af-draft-preview {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.af-draft-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.af-draft-field {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.af-draft-field:last-child { border-bottom: none; }
.af-draft-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.af-draft-field-value {
  font-size: 13px;
  color: var(--text);
}
.af-draft-field-value.gathering {
  color: var(--text-muted);
  font-style: italic;
}
.af-ac-list {
  font-size: 12px;
  line-height: 1.7;
}
.af-ac-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.af-ac-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}
.af-ac-list li:last-child { border-bottom: none; }
.af-ac-list input[type="checkbox"] {
  accent-color: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

/* AC row editor in review page */
.af-ac-row .af-ac-input {
  font-size: 12px;
  padding: 6px 10px;
  line-height: 1.4;
}
.af-ac-row .af-ac-input:focus {
  border-color: var(--accent);
}

/* Progress bar */
.af-progress-bar {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  margin-bottom: 14px;
  overflow: hidden;
}
.af-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 300ms ease;
}

/* ═══ Submissions queue section ═══ */
.af-submissions-section {
  margin-top: 32px;
}
.af-status-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.af-status-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
}
.af-status-pill:hover { background: var(--surface2); }
.af-status-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Submission detail panel */
.af-sub-detail {
  margin-top: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.af-sub-detail-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px;
}
@media (max-width: 900px) {
  .af-sub-detail-grid { grid-template-columns: 1fr; }
}
.af-sub-detail-block { margin-bottom: 12px; }
.af-sub-detail-block h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.af-sub-detail-block p { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* Timeline */
.af-timeline-item {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}
.af-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
}
.af-timeline-dot.complete { background: var(--success); }
.af-timeline-dot.pending { background: var(--border); }
.af-timeline-label {
  color: var(--text);
  font-weight: 500;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.af-timeline-date { color: var(--text-muted); font-size: 11px; }

/* Clickable stat cards */
.stat-card-link { transition: border-color 150ms, box-shadow 150ms; }
.stat-card-link:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.stat-card-link .stat-value { color: var(--accent); }

/* Inline select — matches btn-sm height in action bars */
.af-select-sm {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  min-height: 0;
  height: auto;
  line-height: 1.4;
  width: auto;
}

/* Kanban board */
.kanban {
  display: grid;
  grid-template-columns: repeat(var(--kanban-cols, 7), minmax(160px, 1fr));
  gap: 10px;
  padding-bottom: 8px;
  overflow-x: auto;
}
.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}
.kanban-col-header {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.kanban-col-header .kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border-emphasis);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kanban-col-body {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kanban-card {
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
  font-size: 12px;
}
.kanban-card:hover {
  border-color: var(--accent);
}
.kanban-card-id {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}
.kanban-card-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-card-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* AF-1268: compounding-asset scorecard (home page) */
.sc-headline { margin-bottom: 24px; }
/* Compounding signals side by side (output, capital, human capital, token capital) */
.sc-hero-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; align-items: stretch; }
.sc-hero-row > div { flex: 1 1 320px; margin-bottom: 0; }
.sc-hero-row-4 > div { flex: 1 1 240px; }
.sc-hero-row .sc-headline { margin-bottom: 0; }
.sc-hero-row .sc-indicator { height: 100%; box-sizing: border-box; }
.sc-indicator-kicker { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 2px; }
.sc-indicator {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 22px; box-shadow: var(--shadow-sm);
}
.sc-indicator-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.sc-indicator-label { font-size: 18px; font-weight: 700; }
.sc-indicator-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.sc-claim {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 20px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 14px;
}
.sc-claim strong { color: var(--accent); }
.sc-provider-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.sc-chip {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 14px; min-width: 110px;
}
.sc-chip-name { font-size: 12px; font-weight: 700; color: var(--text); text-transform: capitalize; }
.sc-chip-val { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sc-chip-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--success); border: 1px solid var(--success); border-radius: 9999px; padding: 0 5px; margin-left: 4px; vertical-align: middle; }
.sc-chart {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 18px 12px; min-height: 180px; overflow-x: auto;
}
.sc-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 44px; }
.sc-bar-track { width: 100%; max-width: 56px; height: 120px; display: flex; align-items: flex-end;
  background: var(--surface2); border-radius: var(--radius) var(--radius) 0 0; }
.sc-bar-fill { width: 100%; background: linear-gradient(180deg, var(--accent), var(--success));
  border-radius: var(--radius) var(--radius) 0 0; transition: height 300ms ease; min-height: 2px; }
.sc-bar-pct { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.sc-bar-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.sc-bar-interv { font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.sc-bar-interv-on { color: var(--warning); }

/* Scorecard narrative additions (Supervisor extension) */
.sc-intro { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 14px; }

/* Part 2 — living human-agent pipeline */
.sc-pipe-flow {
  display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm);
}
.sc-pipe-node {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; min-width: 84px; flex: 1; text-align: center;
}
.sc-pipe-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sc-pipe-human { background: transparent; border-style: dashed; }
.sc-pipe-shipped { background: transparent; border-color: var(--success); }
.sc-pipe-role { font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; }
.sc-pipe-count { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.sc-pipe-shipped .sc-pipe-count { color: var(--success); }
.sc-pipe-hint { font-size: 10px; color: var(--text-muted); }
.sc-pipe-arrow { display: flex; align-items: center; color: var(--text-muted); font-size: 16px; }
.sc-pipe-wk { font-size: 10px; font-weight: 700; margin-top: 4px; }
.sc-pipe-wk-up { color: var(--success); }
.sc-pipe-wk-flat { color: var(--text-muted); }
.sc-pipe-caption { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 12px 0 0; }
.sc-pipe-caption strong { color: var(--accent); }

/* Part 3 — named feedback systems */
.sc-feedback-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.sc-feedback-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
}
.sc-feedback-name { font-size: 12px; font-weight: 700; color: var(--text); }
.sc-feedback-val { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; margin: 2px 0; }
.sc-feedback-sub { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.sc-cap-delta { font-size: 11px; font-weight: 700; margin: 2px 0 4px; }
.sc-cap-up { color: var(--success); }
.sc-cap-flat { color: var(--text-muted); }
.sc-cap-none { color: var(--text-muted); font-weight: 400; font-style: italic; }

/* Factory Voice */
.sc-voice {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg); padding: 16px 20px;
}
.sc-voice-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.sc-voice-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sc-voice-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.sc-voice-text strong { color: var(--accent); }

/* Equal-column rows (Yield cards), collapse on narrow screens */
.sc-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sc-5col { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.sc-6col { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 1000px) { .sc-5col, .sc-6col { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .sc-3col, .sc-5col, .sc-6col { grid-template-columns: 1fr; } }

/* Methodology tooltip — "how this number is computed" (hover / focus / tap) */
.sc-info { position: relative; display: inline-flex; align-items: center; margin-left: 8px; cursor: help; vertical-align: middle; }
.sc-info-mark { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.sc-info:hover .sc-info-mark, .sc-info:focus .sc-info-mark, .sc-info:focus-within .sc-info-mark { color: var(--accent); }
.sc-info-pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  width: 340px; max-width: 78vw;
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,0.28));
  padding: 12px 14px; font-size: 12px; font-weight: 400; line-height: 1.55;
  text-transform: none; letter-spacing: normal; white-space: normal;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.sc-info-pop strong { color: var(--text); }
.sc-info-pop em { color: var(--accent); font-style: normal; }
.sc-info:hover .sc-info-pop, .sc-info:focus .sc-info-pop, .sc-info:focus-within .sc-info-pop {
  opacity: 1; visibility: visible; transform: translateY(0);
}

/* Utility */
.af-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.af-section { margin-bottom: 24px; }
.af-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* AF-126: markdown body rendered inside the board story modal (description + comments) */
.af-md-body { color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.af-md-body p { margin: 6px 0; }
.af-md-body ul, .af-md-body ol { padding-left: 22px; margin: 6px 0; }
.af-md-body li { margin: 2px 0; }
.af-md-body ul:has(> li > input[type="checkbox"]) { list-style: none; padding-left: 4px; }
.af-md-body li:has(> input[type="checkbox"]) {
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  list-style: none;
}
.af-md-body li:has(> input[type="checkbox"]):last-child { border-bottom: none; }
.af-md-body input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px; height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  cursor: default;
}
.af-md-body code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.af-md-body pre {
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 12px;
  margin: 8px 0;
}
.af-md-body pre code { background: transparent; padding: 0; }
.af-md-body h1, .af-md-body h2, .af-md-body h3, .af-md-body h4 {
  margin: 12px 0 4px;
  color: var(--text);
  font-weight: 600;
}
.af-md-body h1 { font-size: 16px; }
.af-md-body h2 { font-size: 15px; }
.af-md-body h3 { font-size: 14px; }
.af-md-body h4 { font-size: 13px; }
.af-md-body blockquote {
  border-left: 3px solid var(--border);
  margin: 8px 0;
  padding: 2px 12px;
  color: var(--text-muted);
}
.af-md-body a { color: var(--accent); }

/* AF-126: comment cards in story modal */
.af-comment-card {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 12px;
  margin-bottom: 10px;
}
.af-comment-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.af-comment-body { font-size: 12px; }
.af-qa-report-card { border-left: 3px solid var(--success, #22c55e); }
