/* ═══════════════════════════════════════════════
   Seampoint Map — Design System
   Plain CSS, no preprocessor, no framework.
   Colors, typography, and components from briefing-v2 prototype.
   ═══════════════════════════════════════════════ */

:root {
  --navy: #07192E;
  --navy-light: #0d2440;
  --navy-mid: #143F68;
  --gold: #EEC21B;
  --gold-light: #F4DE82;
  --gold-faint: #fdf8e8;
  --gold-bg: #fefbf0;
  --text: #1a2a3a;
  --text-light: #4a5d70;
  --text-muted: #8196AC;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-warm: #fdfcfa;
  --green: #2d8a6e;
  --green-light: #e8f5ef;
  --blue: #5b8fd4;
  --blue-light: #edf4fd;
  --amber: #c4882a;
  --amber-light: #fef8ee;
  --red: #b45252;
  --red-light: #fef2f2;
  --purple: #7c5cbf;
  --purple-light: #f3f0fa;
  --coral: #e8856c;
  --coral-light: #fdf0ec;
  --slate: #7a8a9c;
  --slate-light: #f0f2f5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

/* ═══════════════ Typography ═══════════════ */
h1, h2, h3 { font-family: 'Source Serif 4', 'Georgia', serif; }
h1 { font-size: 32px; font-weight: 700; line-height: 1.2; color: var(--navy); margin-bottom: 12px; }
h2 { font-size: 24px; font-weight: 700; line-height: 1.3; color: var(--navy); margin-bottom: 8px; }
h3 { font-size: 17px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.lead { font-size: 18px; line-height: 1.65; color: var(--text-light); margin-bottom: 20px; }
p { font-size: 15px; line-height: 1.7; color: var(--text); margin-bottom: 16px; }
.muted { color: var(--text-muted); }
.light { color: var(--text-light); }
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ═══════════════ App Shell ═══════════════ */
.app-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; font-size: 15px; color: var(--text-muted);
}
.app-loading-spinner {
  width: 24px; height: 24px; border: 2px solid var(--border);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════ Engagement Picker ═══════════════ */
.picker-page {
  max-width: 720px; margin: 0 auto; padding: 80px 32px;
}
.picker-brand {
  margin-bottom: 4px;
}
.picker-product {
  font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px;
  text-transform: uppercase; margin-bottom: 40px;
}
.picker-list {
  list-style: none;
}
.picker-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 10px; cursor: pointer; transition: all 0.15s;
  text-decoration: none; color: inherit;
}
.picker-item:hover {
  border-color: var(--gold); box-shadow: 0 2px 8px rgba(238,194,27,0.12);
}
.picker-item-name {
  font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 2px;
}
.picker-item-meta {
  font-size: 12px; color: var(--text-muted);
}
.picker-item-arrow {
  font-size: 18px; color: var(--text-muted);
}
.picker-item-status {
  display: inline-block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 3px; margin-left: 8px;
}
.picker-item-status.ready { background: var(--green-light); color: var(--green); }
.picker-item-status.running { background: var(--amber-light); color: var(--amber); }
.picker-item-status.incomplete { background: var(--slate-light); color: var(--slate); }

/* ═══════════════ Navigation Rail ═══════════════ */
.nav-rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 260px;
  background: var(--navy); color: #fff; z-index: 100;
  display: flex; flex-direction: column; overflow-y: auto;
}
.nav-brand { padding: 24px 24px 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.nav-brand-logo { margin-bottom: 4px; }
.nav-brand-logo img { height: 22px; width: auto; display: block; }
.nav-brand-product { font-size: 11px; color: rgba(255,255,255,0.4); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 16px; }
.nav-back {
  display: block; font-size: 12px; color: rgba(255,255,255,0.35);
  text-decoration: none; padding: 4px 0; cursor: pointer; transition: color 0.15s;
}
.nav-back:hover { color: rgba(255,255,255,0.6); }
.nav-company { padding: 20px 24px 4px; }
.nav-company-name { font-size: 17px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.nav-company-detail { font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.5; }
.nav-mode-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px; padding: 3px 8px;
  border-radius: 3px; background: rgba(238,194,27,0.15); color: var(--gold); margin-top: 8px;
}
.nav-sections { flex: 1; padding: 12px 0; }
.nav-sections-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: rgba(255,255,255,0.3); padding: 0 24px; margin-bottom: 4px; margin-top: 6px;
}
.nav-item {
  display: flex; align-items: flex-start; padding: 5px 24px; cursor: pointer;
  transition: all 0.15s; text-decoration: none; color: rgba(255,255,255,0.6); gap: 12px;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }
.nav-item.active { background: rgba(238,194,27,0.1); color: #fff; border-right: 2px solid var(--gold); }
.nav-item-num { font-size: 11px; font-weight: 700; color: var(--gold); min-width: 18px; padding-top: 2px; opacity: 0.7; }
.nav-item.active .nav-item-num { opacity: 1; }
.nav-item-text { flex: 1; }
.nav-item-title { font-size: 13px; font-weight: 500; line-height: 1.3; }
.nav-item-hint { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 1px; }
.nav-item.active .nav-item-hint { color: rgba(255,255,255,0.45); }
.nav-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.06); }
.nav-footer-link {
  display: block; font-size: 12px; color: rgba(255,255,255,0.35);
  text-decoration: none; padding: 6px 0; cursor: pointer; transition: color 0.15s;
}
.nav-footer-link:hover { color: rgba(255,255,255,0.6); }

/* ═══════════════ View Toggle ═══════════════ */
.view-toggle {
  position: fixed; top: 16px; right: 24px; z-index: 200;
  display: flex; background: var(--navy); border-radius: 6px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.view-toggle-btn {
  padding: 8px 16px; font-size: 12px; font-weight: 500;
  border: none; cursor: pointer; transition: all 0.15s;
  background: transparent; color: rgba(255,255,255,0.5);
}
.view-toggle-btn.active { background: var(--gold); color: var(--navy); }
.view-toggle-btn:hover:not(.active) { color: rgba(255,255,255,0.8); }

/* ═══════════════ Main Content ═══════════════ */
.main { margin-left: 260px; min-height: 100vh; }
.section { padding: 40px 64px 48px; border-bottom: 1px solid var(--border); max-width: 960px; margin: 0 auto; }
.section:last-child { border-bottom: none; }
.section-num { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--navy-mid); margin-bottom: 8px; }

/* ═══════════════ Hero ═══════════════ */
.hero { padding: 72px 64px 56px; border-bottom: 1px solid var(--border); max-width: 960px; margin: 0 auto; }
.hero-context { font-size: 13px; color: var(--navy-mid); margin-bottom: 24px; text-transform: uppercase; letter-spacing: 0.5px; }
.hero h1 { font-size: 36px; margin-bottom: 16px; }

.epistemic-note {
  background: var(--gold-bg); border: 1px solid #e8ddd0; border-radius: 8px;
  padding: 16px 20px; margin: 24px 0; display: flex; gap: 12px; align-items: flex-start;
}
.epistemic-note-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; color: var(--gold); }
.epistemic-note p { font-size: 13px; color: var(--text-light); margin-bottom: 0; line-height: 1.5; }

/* ═══════════════ Platform Nodes ═══════════════ */
.platform-node {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 4px; font-size: 11px;
  font-weight: 600; white-space: nowrap; letter-spacing: 0.2px;
}
.platform-node .p-letter {
  font-size: 10px; font-weight: 800; width: 16px; height: 16px;
  border-radius: 3px; display: flex; align-items: center;
  justify-content: center; color: #fff;
}
.platform-node.human { background: var(--coral-light); color: #b35a42; }
.platform-node.human .p-letter { background: var(--coral); }
.platform-node.prediction { background: var(--gold-faint); color: #9a7048; }
.platform-node.prediction .p-letter { background: var(--gold); }
.platform-node.logic { background: var(--blue-light); color: #3a6db5; }
.platform-node.logic .p-letter { background: var(--blue); }
.platform-node.matter { background: var(--slate-light); color: #5a6a7c; }
.platform-node.matter .p-letter { background: var(--slate); }

/* ═══════════════ Relationship Badges ═══════════════ */
.rel-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 4px; white-space: nowrap;
}
.rel-badge.autonomous { background: var(--green-light); color: var(--green); }
.rel-badge.verified, .rel-badge.verification_gated { background: var(--blue-light); color: #3a6db5; }
.rel-badge.guided, .rel-badge.guidance { background: var(--amber-light); color: var(--amber); }
.rel-badge.assisted, .rel-badge.assistant { background: var(--purple-light); color: var(--purple); }
.rel-badge.redesign, .rel-badge.process_elimination, .rel-badge.system_integration, .rel-badge.process_restructuring { background: var(--red-light); color: var(--red); }
.rel-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ═══════════════ Seam Cards ═══════════════ */
.seam-list { margin: 24px 0; }
.seam-card {
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 20px; overflow: hidden; background: #fff;
  transition: box-shadow 0.15s;
}
.seam-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.seam-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 24px 16px; cursor: pointer;
}
.seam-card-title { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.seam-card-subtitle { font-size: 13px; color: var(--text-light); line-height: 1.5; max-width: 560px; }
.seam-card-score { text-align: right; flex-shrink: 0; margin-left: 24px; display: flex; align-items: center; gap: 10px; }
.seam-card-body { padding: 0 24px 20px; }
.seam-card-body.collapsed { display: none; }

.seam-card-meta {
  display: flex; gap: 24px; padding: 12px 24px;
  background: var(--bg-warm); border-top: 1px solid var(--border); flex-wrap: wrap;
}
.seam-meta-item { display: flex; flex-direction: column; }
.seam-meta-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 2px; }
.seam-meta-value { font-size: 13px; font-weight: 500; color: var(--text); }

/* Score badge */
.seam-score-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 700; padding: 3px 10px;
  border-radius: 8px; letter-spacing: -0.01em; white-space: nowrap;
}
.seam-score-badge.high { background: var(--coral-light); color: #b35a42; }
.seam-score-badge.medium { background: var(--amber-light); color: var(--amber); }
.seam-score-badge.low { background: var(--green-light); color: var(--green); }
.seam-score-badge .score-suffix { font-weight: 400; opacity: 0.5; font-size: 11px; }
.seam-score-bar { width: 36px; height: 5px; border-radius: 3px; background: #e8e5e0; position: relative; overflow: hidden; }
.seam-score-fill { height: 100%; border-radius: 3px; }
.seam-score-badge.high .seam-score-fill { background: var(--coral); }
.seam-score-badge.medium .seam-score-fill { background: var(--amber); }
.seam-score-badge.low .seam-score-fill { background: var(--green); }

/* ═══════════════ Seam Detail Grid ═══════════════ */
.seam-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.seam-detail-box { padding: 14px 16px; border-radius: 6px; background: var(--bg-warm); }
.seam-detail-box h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; }
.seam-detail-box p { font-size: 13px; line-height: 1.55; color: var(--text); margin-bottom: 0; }
.seam-detail-box ul { list-style: none; padding: 0; }
.seam-detail-box li { font-size: 13px; color: var(--text); padding: 2px 0; line-height: 1.5; }
.seam-detail-box li::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: middle; }
.seam-detail-full { grid-column: 1 / -1; }

/* ═══════════════ Relationship Legend ═══════════════ */
.rel-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.rel-legend-item { display: flex; gap: 10px; padding: 10px 14px; border-radius: 6px; background: var(--bg-warm); align-items: flex-start; }
.rel-legend-badge { flex-shrink: 0; margin-top: 2px; }
.rel-legend-text h4 { font-size: 13px; margin-bottom: 2px; }
.rel-legend-text p { font-size: 12px; color: var(--text-light); margin-bottom: 0; line-height: 1.4; }

/* ═══════════════ Affirmation ═══════════════ */
.affirmation {
  border-left: 3px solid var(--green); background: var(--green-light);
  padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 24px 0;
}
.affirmation h4 { color: var(--green); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.affirmation p { font-size: 14px; color: var(--text); margin-bottom: 0; }

/* ═══════════════ Department Map ═══════════════ */
.seam-map { margin: 32px 0; }
.seam-map-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.seam-map-dept { width: 140px; font-size: 12px; font-weight: 500; color: var(--text-light); text-align: right; flex-shrink: 0; }
.seam-map-bar { flex: 1; height: 32px; background: #f1f5f9; border-radius: 4px; position: relative; overflow: hidden; display: flex; }
.seam-map-seg { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; white-space: nowrap; min-width: 0; transition: width 0.3s; }
.seam-map-seg:first-child { border-radius: 4px 0 0 4px; }
.seam-map-seg:last-child { border-radius: 0 4px 4px 0; }
.seam-map-seg:only-child { border-radius: 4px; }
.seam-map-label { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; color: var(--text-light); pointer-events: none; }

/* Segment colors by relationship type */
.seam-map-seg.autonomous { background: var(--green); }
.seam-map-seg.verified, .seam-map-seg.verification_gated { background: var(--blue); }
.seam-map-seg.guided, .seam-map-seg.guidance { background: var(--amber); }
.seam-map-seg.assisted, .seam-map-seg.assistant { background: var(--purple); }
.seam-map-seg.redesign, .seam-map-seg.process_elimination, .seam-map-seg.system_integration, .seam-map-seg.process_restructuring { background: var(--red); }

/* ═══════════════ Flywheel ═══════════════ */
.flywheel {
  display: flex; align-items: center; justify-content: center; gap: 0;
  margin: 32px 0; padding: 24px; background: var(--bg-warm);
  border-radius: 12px; border: 1px solid var(--border); flex-wrap: wrap;
}
.flywheel-step { text-align: center; padding: 12px 16px; max-width: 160px; }
.flywheel-step-title { font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.3; margin-bottom: 2px; }
.flywheel-step-desc { font-size: 11px; color: var(--text-light); line-height: 1.4; }
.flywheel-arrow { font-size: 18px; color: var(--gold); padding: 0 4px; font-weight: 300; }
.flywheel-return { width: 100%; text-align: center; padding-top: 12px; margin-top: 8px; border-top: 1px dashed var(--border); }
.flywheel-return-text { font-size: 12px; color: var(--navy-mid); font-weight: 500; font-style: italic; }

/* ═══════════════ Grounding Bar ═══════════════ */
.grounding-bar { background: #f8f9fa; border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; margin: 24px 0; }
.grounding-bar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.grounding-bar-tiers { display: flex; gap: 24px; flex-wrap: wrap; }
.grounding-tier { display: flex; align-items: baseline; gap: 6px; }
.grounding-tier-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; margin-top: 2px; }
.grounding-tier-label { font-size: 12px; color: var(--text-light); }
.grounding-tier-value { font-size: 14px; font-weight: 600; color: var(--navy); }

/* ═══════════════ Unlock Cards ═══════════════ */
.unlock-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 24px 0; }
.unlock-card { display: grid; grid-template-columns: 3fr 2fr; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.unlock-card-left { padding: 18px 20px; }
.unlock-card-from { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.unlock-card-to { font-size: 15px; font-weight: 600; color: var(--navy); line-height: 1.4; margin-bottom: 6px; }
.unlock-card-compound { font-size: 13px; color: var(--text-light); line-height: 1.5; }
.unlock-card-right { padding: 18px 20px; background: var(--bg-warm); border-left: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.unlock-card-seams { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.unlock-card-seam-list { font-size: 12px; color: var(--text); line-height: 1.6; }

/* ═══════════════ Innovation Cards ═══════════════ */
.innovation-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 24px 0; }
.innovation-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.innovation-card-header { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.innovation-card-title { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.innovation-card-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; padding: 3px 8px; border-radius: 3px; background: var(--amber-light); color: var(--amber); white-space: nowrap; flex-shrink: 0; margin-left: 16px; }
.innovation-card-body { padding: 8px 22px 18px; }
.innovation-card-insight { font-size: 14px; color: var(--text); line-height: 1.6; margin-bottom: 12px; }
.innovation-card-anchors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.innovation-anchor { font-size: 11px; padding: 3px 8px; border-radius: 4px; background: #f1f5f9; color: var(--text-light); font-weight: 500; }
.innovation-card-requires { font-size: 12px; color: var(--text-muted); line-height: 1.5; padding-top: 8px; border-top: 1px solid var(--border); }
.innovation-card-requires strong { color: var(--text-light); }

/* ═══════════════ Roadmap & Timeline ═══════════════ */
.roadmap { margin: 24px 0; }
.roadmap-tier { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.roadmap-tier:last-child { border-bottom: none; }
.roadmap-tier-num { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.roadmap-tier-content { flex: 1; }
.roadmap-tier-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.roadmap-tier-audience { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.roadmap-tier-desc { font-size: 13px; color: var(--text-light); line-height: 1.5; }

.phase-timeline { margin: 24px 0; position: relative; }
.phase-timeline::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.phase-item { display: flex; gap: 16px; padding: 16px 0; position: relative; }
.phase-dot { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--gold); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--navy); flex-shrink: 0; z-index: 1; }
.phase-content { flex: 1; padding-top: 4px; }
.phase-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.phase-timing { font-size: 12px; color: var(--navy-mid); font-weight: 600; margin-bottom: 4px; }
.phase-desc { font-size: 13px; color: var(--text-light); line-height: 1.5; }

.ask-list { margin: 24px 0; }
.ask-item { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #fff; align-items: flex-start; }
.ask-num { font-size: 13px; font-weight: 700; color: var(--navy-mid); min-width: 20px; padding-top: 1px; }
.ask-text { font-size: 14px; color: var(--text); line-height: 1.5; }

/* ═══════════════ Spiral Notebook Seam Diagrams ═══════════════ */
.spiral-spread { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 16px 0 12px; }
.spiral-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; padding: 0 0 6px; text-align: center; }
.spiral-label.today { color: var(--text-muted); }
.spiral-label.designed { color: var(--green); }

.spiral-notebook { display: flex; align-items: stretch; }
.spiral-page { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 140px; justify-content: center; }
.spiral-page.left { border-radius: 8px 0 0 8px; align-items: flex-end; }
.spiral-page.right { border-radius: 0 8px 8px 0; align-items: flex-start; }
.spiral-page-title { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 2px; width: 100%; }
.spiral-page.left .spiral-page-title { text-align: right; }
.spiral-page.right .spiral-page-title { text-align: left; }

.spiral-today .spiral-page { background: #faf8f6; box-shadow: inset 0 0 8px rgba(201,74,74,0.03); }
.spiral-today .spiral-page.left { box-shadow: -2px 1px 6px rgba(0,0,0,0.04), inset 0 0 8px rgba(201,74,74,0.03); }
.spiral-today .spiral-page.right { box-shadow: 2px 1px 6px rgba(0,0,0,0.04), inset 0 0 8px rgba(201,74,74,0.03); }
.spiral-today .spiral-actor { opacity: 0.7; border-width: 1px; }

.spiral-designed .spiral-page { background: #fff; }
.spiral-designed .spiral-page.left { box-shadow: -2px 1px 6px rgba(0,0,0,0.04); }
.spiral-designed .spiral-page.right { box-shadow: 2px 1px 6px rgba(0,0,0,0.04); }
.spiral-designed .spiral-actor { border-width: 2px; }

.spiral-spine { width: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; }
.spiral-today .spiral-spine { background: linear-gradient(to right, #ece6e0, #e0d8d0, #ece6e0); }
.spiral-designed .spiral-spine { background: linear-gradient(to right, #e6ede8, #dbe7df, #e6ede8); }

.spiral-actor { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; border: 1.5px solid; background: #fff; max-width: 155px; width: 100%; }
.spiral-actor.h { border-color: var(--coral); background: var(--coral-light); }
.spiral-actor.p { border-color: var(--gold); background: var(--gold-faint); }
.spiral-actor.l { border-color: var(--blue); background: var(--blue-light); }
.spiral-actor.m { border-color: var(--slate); background: var(--slate-light); }
.spiral-actor.governor { border-style: dashed; opacity: 0.85; }

.spiral-actor-icon { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.spiral-actor-icon.h { background: var(--coral); }
.spiral-actor-icon.p { background: var(--gold); }
.spiral-actor-icon.l { background: var(--blue); }
.spiral-actor-icon.m { background: var(--slate); }
.spiral-actor-icon svg { display: block; }

.spiral-actor-info { display: flex; flex-direction: column; gap: 0; flex: 1; }
.spiral-page.left .spiral-actor-info { text-align: right; }
.spiral-page.right .spiral-actor-info { text-align: left; }
.spiral-actor-name { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.2; }
.spiral-actor-role { font-size: 9px; color: var(--text-muted); line-height: 1.2; }

.spiral-gov {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 8px; border-radius: 8px; border: 1.5px solid;
}
.spiral-gov.autonomous { background: var(--green-light); color: var(--green); border-color: #a8d4b8; }
.spiral-gov.verified, .spiral-gov.verification_gated { background: var(--blue-light); color: #3a6db5; border-color: #a8c4e8; }
.spiral-gov.guided, .spiral-gov.guidance { background: var(--amber-light); color: var(--amber); border-color: #e4cc8a; }
.spiral-gov.assisted, .spiral-gov.assistant { background: var(--purple-light); color: var(--purple); border-color: #c8b4db; }

/* ═══════════════ Four Platforms Grid ═══════════════ */
.platforms-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.platform-card { padding: 14px; border-radius: 8px; border: 1px solid var(--border); }
.platform-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.platform-card-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.platform-card-desc { font-size: 12px; color: var(--text-light); line-height: 1.4; }

/* ═══════════════ Legend Row ═══════════════ */
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* ═══════════════ Workbench ═══════════════ */
.workbench { margin-left: 260px; min-height: 100vh; }
.wb-content { max-width: 960px; margin: 0 auto; padding: 32px 48px; }
.wb-header { margin-bottom: 32px; }
.wb-header h2 { margin-bottom: 4px; }
.wb-header-meta { font-size: 13px; color: var(--text-muted); }

/* Pipeline status */
.pipeline-panel {
  background: var(--bg-warm); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 24px; margin-bottom: 32px;
}
.pipeline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pipeline-header h3 { margin-bottom: 0; }
.pipeline-stages { display: flex; gap: 4px; align-items: center; }
.pipeline-stage {
  width: 32px; height: 32px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; font-size: 11px;
  font-weight: 700; border: 1px solid var(--border); background: #fff;
  color: var(--text-muted); position: relative;
}
.pipeline-stage.completed { background: var(--green-light); color: var(--green); border-color: #a8d4b8; }
.pipeline-stage.running { background: var(--amber-light); color: var(--amber); border-color: #e4cc8a; animation: pulse 1.5s ease-in-out infinite; }
.pipeline-stage.failed { background: var(--red-light); color: var(--red); border-color: #e8b4b4; }
.pipeline-stage-arrow { color: var(--border); font-size: 14px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.pipeline-btn {
  padding: 8px 20px; border-radius: 6px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s;
}
.pipeline-btn-primary { background: var(--gold); color: var(--navy); font-weight: 700; }
.pipeline-btn-primary:hover { background: var(--gold-light); }
.pipeline-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.pipeline-btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.pipeline-btn-secondary:hover { border-color: var(--gold); }

.pipeline-progress { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* Entity tables */
.entity-section { margin-bottom: 32px; }
.entity-section h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.entity-count { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.entity-table { width: 100%; border-collapse: collapse; }
.entity-table th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}
.entity-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.entity-table tr:hover td { background: var(--bg-warm); }
.entity-tag {
  display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px; letter-spacing: 0.3px;
}
.entity-tag.confirmed { background: var(--green-light); color: var(--green); }
.entity-tag.inferred { background: var(--amber-light); color: var(--amber); }
.entity-tag.hypothesis { background: var(--slate-light); color: var(--slate); }

/* ═══════════════ Profile Panel ═══════════════ */
.profile-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 20px 24px; margin-bottom: 32px;
}
.profile-panel h3 { margin-bottom: 12px; }
.profile-textarea {
  width: 100%; min-height: 200px; padding: 12px; border: 1px solid var(--border);
  border-radius: 6px; font-family: inherit; font-size: 13px; line-height: 1.6;
  color: var(--text); resize: vertical;
}
.profile-textarea:focus { outline: none; border-color: var(--gold); }
.profile-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ═══════════════ Responsive ═══════════════ */
@media (max-width: 1024px) {
  .nav-rail { width: 220px; }
  .main, .workbench { margin-left: 220px; }
  .wb-content { padding: 32px 32px; }
  .section, .hero { padding: 40px 32px 48px; }
  .seam-detail-grid { grid-template-columns: 1fr; }
  .rel-legend { grid-template-columns: 1fr; }
  .unlock-card { grid-template-columns: 1fr; }
  .spiral-spread { grid-template-columns: 1fr; }
  .platforms-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-rail { display: none; }
  .main, .workbench { margin-left: 0; }
  .view-toggle { top: 8px; right: 8px; }
}

/* ═══════════════ SOC Typeahead ═══════════════ */
.soc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 500; display: flex; align-items: center; justify-content: center; }
.soc-picker { background: #fff; border-radius: 10px; width: 480px; max-height: 70vh; box-shadow: 0 8px 32px rgba(0,0,0,0.2); display: flex; flex-direction: column; overflow: hidden; }
.soc-picker-header { padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.soc-picker-header h3 { font-size: 15px; margin-bottom: 8px; }
.soc-picker-input { width: 100%; padding: 8px 12px; border: 2px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; outline: none; }
.soc-picker-input:focus { border-color: var(--gold); }
.soc-picker-results { flex: 1; overflow-y: auto; padding: 4px 0; }
.soc-picker-item { display: flex; align-items: center; gap: 12px; padding: 8px 20px; cursor: pointer; transition: background 0.1s; }
.soc-picker-item:hover, .soc-picker-item.selected { background: var(--gold-faint); }
.soc-picker-code { font-size: 13px; font-weight: 700; color: var(--navy-mid); min-width: 64px; font-family: monospace; }
.soc-picker-title { font-size: 13px; color: var(--text); }
.soc-picker-empty { padding: 24px 20px; text-align: center; font-size: 13px; color: var(--text-muted); }
.soc-picker-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.soc-picker-footer button { padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); cursor: pointer; background: #fff; color: var(--text); }
.soc-picker-footer button.primary { background: var(--gold); color: var(--navy); border-color: var(--gold); }
