/* Regenerative Neighborhood Wizard — modern, minimal, dark/light */

:root {
  /* light mode (default) */
  --bg: #fafafa;
  --bg-2: #f4f4f5;
  --bg-3: #e8e8ec;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --ink: #0a0a0a;
  --ink-2: #404040;
  --ink-3: #737373;
  --ink-4: #a3a3a3;
  --rule: #e5e5e5;
  --rule-soft: #ededed;

  --accent: #10b981;          /* emerald — primary CTA */
  --accent-2: #059669;
  --accent-soft: rgba(16,185,129,0.08);

  --warn: #f59e0b;
  --warn-soft: rgba(245,158,11,0.1);

  /* framework colors (kept consistent across themes) */
  --rnf: #10b981;
  --alchemy: #f97316;
  --rcos: #8b5cf6;
  --clips: #06b6d4;

  --ecology: #10b981;
  --social: #f97316;
  --economy: #eab308;
  --hardware: #64748b;
  --governance: #8b5cf6;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px -4px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px -8px rgba(0,0,0,0.16);

  --display: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

[data-theme="dark"] {
  --bg: #09090b;
  --bg-2: #18181b;
  --bg-3: #27272a;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --ink: #fafafa;
  --ink-2: #d4d4d8;
  --ink-3: #a1a1aa;
  --ink-4: #71717a;
  --rule: #27272a;
  --rule-soft: #1f1f23;

  --accent: #34d399;
  --accent-2: #10b981;
  --accent-soft: rgba(52,211,153,0.12);

  --warn: #fbbf24;
  --warn-soft: rgba(251,191,36,0.14);

  --rnf: #34d399;
  --alchemy: #fb923c;
  --rcos: #a78bfa;
  --clips: #22d3ee;

  --ecology: #34d399;
  --social: #fb923c;
  --economy: #facc15;
  --hardware: #94a3b8;
  --governance: #a78bfa;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 12px -4px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px -8px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 200ms ease, color 200ms ease;
}

#root { position: relative; z-index: 1; }

.serif { font-family: var(--display); font-weight: 400; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

h1.display, h2.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0;
}

/* Layout */
.app {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  min-height: 100vh;
}

@media (max-width: 1280px) {
  .app { grid-template-columns: 240px 1fr; }
  .rail { display: none; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .sidebar.mobile-open { display: block; }
  .main { padding: 20px 18px 100px; }
  .rail { display: none; }
  .rail.mobile-open {
    display: block;
    position: relative;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--rule);
    padding: 24px 18px 100px;
  }
}

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--rule);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main {
  padding: 48px 64px 80px;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
}

.rail {
  background: var(--bg-2);
  border-left: 1px solid var(--rule);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule-soft);
}
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
[data-theme="dark"] .brand-logo { filter: invert(1); }
.brand-name {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-top: 2px;
  font-weight: 400;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-3);
  border-radius: 999px;
  margin-left: auto;
}
.theme-toggle button {
  width: 24px; height: 24px;
  border: none;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 150ms;
}
.theme-toggle button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Phase list */
.phase-list { margin: 0; padding: 0; list-style: none; }
.phase { margin-bottom: 4px; }
.phase-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 8px 8px;
  cursor: default;
  user-select: none;
  border-radius: var(--radius-sm);
  transition: background 150ms;
}
.phase.has-active > .phase-header {
  background: var(--bg-3);
}
.phase.has-active .phase-title {
  color: var(--ink);
}
.phase-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  width: 20px;
  font-weight: 500;
}
.phase-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  flex: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.phase-time {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-4);
}

.step-list { list-style: none; margin: 0; padding: 0; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 120ms ease;
  position: relative;
}
.step:hover { background: var(--bg-3); color: var(--ink); }
.step.active {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--accent);
  padding-left: 5px;
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-4);
  background: transparent;
  flex-shrink: 0;
  transition: all 150ms;
}
.step.active .step-dot { border-color: var(--accent); }
.step.complete .step-dot {
  background: var(--accent);
  border-color: var(--accent);
}
.step.gate .step-dot { border-color: var(--warn); border-style: solid; }
.step.gate.passed .step-dot { background: var(--accent); border-color: var(--accent); }
.step.gate-warning .step-dot { background: var(--warn); border-color: var(--warn); }

/* Legend */
.legend {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-soft);
}
.legend-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
  font-weight: 500;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--ink-2);
}
.legend-swatch {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-name { font-weight: 500; color: var(--ink); }
.legend-tag { color: var(--ink-3); font-size: 11px; margin-left: auto; }

/* Crumb */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.crumb-sep { opacity: 0.4; }

.step-title {
  font-family: var(--display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  font-weight: 400;
  text-wrap: balance;
}

.step-lede {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0 0 32px;
  font-weight: 400;
  max-width: 640px;
}

.framework-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 40px;
}
.fw-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0;
  padding: 3px 9px 3px 22px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  position: relative;
  border: 1px solid var(--rule);
  white-space: nowrap;
  font-weight: 500;
}
.fw-tag::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
}
.fw-tag.rnf::before { background: var(--rnf); }
.fw-tag.alchemy::before { background: var(--alchemy); }
.fw-tag.rcos::before { background: var(--rcos); }
.fw-tag.clips::before { background: var(--clips); }

/* Section */
.section { margin-bottom: 40px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.section-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.section-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Per-section AI import button */
.btn-section-import {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 120ms ease;
  line-height: 1;
  white-space: nowrap;
}
.btn-section-import:hover {
  background: var(--accent);
  color: #fff;
}
.btn-section-import-icon { font-size: 12px; }

/* Welcome helpers */
.welcome-helpers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) {
  .welcome-helpers { grid-template-columns: 1fr; }
}
.helper-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.helper-card-action {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.helper-icon-wrap {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
}
.helper-card-action .helper-icon-wrap { background: var(--surface); }
.helper-body { flex: 1; min-width: 0; }
.helper-title {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 8px;
  font-weight: 400;
}
.helper-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.helper-btn {
  margin-top: 14px;
}
.inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: 1px;
}

/* Form controls */
.field { margin-bottom: 24px; }
.field-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  flex: 1;
  min-width: 0;
}
.field-help {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 10px;
  line-height: 1.45;
}

.input, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  resize: vertical;
  transition: all 120ms ease;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 92px; line-height: 1.55; }

/* Slider */
.slider-row {
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.slider-row:last-child { border-bottom: none; }
.slider-meta { display: flex; flex-direction: column; gap: 4px; }
.slider-q { font-size: 13.5px; color: var(--ink); line-height: 1.4; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.slider-q > span:first-child { flex: 1; min-width: 0; }
.slider-track-wrap {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--rule);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border: 3px solid var(--surface);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
}
input[type="range"].slider::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--accent);
  border: 3px solid var(--surface);
  border-radius: 50%;
  cursor: pointer;
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
}
.slider-value {
  font-family: var(--display);
  font-size: 32px;
  text-align: center;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.check-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: opacity 150ms;
}
.check-item-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.check-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.check-item:last-child { border-bottom: none; }
.check-note {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  resize: vertical;
  min-height: 40px;
  line-height: 1.45;
  transition: all 120ms ease;
  margin-left: 30px;
  width: calc(100% - 30px);
}
.check-note:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.check-note::placeholder { color: var(--ink-4); font-style: italic; }

/* Field status tri-button */
.field-status {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  position: relative;
  flex-wrap: wrap;
}
.fs-btn {
  flex: 1;
  min-width: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 120ms ease;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.fs-btn:hover { color: var(--ink); border-color: var(--ink-4); }
.fs-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  flex-shrink: 0;
}
.fs-btn.on .fs-dot { background: currentColor; }
.fs-pending.on { color: var(--ink-2); border-color: var(--ink-3); background: var(--bg-3); }
.fs-help.on, .fs-help.open {
  color: #fff;
  background: var(--warn);
  border-color: var(--warn);
}
.fs-ready.on {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.fs-help-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 33%;
  transform: translateX(-50%);
  z-index: 80;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 18px 44px -16px rgba(0,0,0,0.22), 0 4px 12px -4px rgba(0,0,0,0.08);
  padding: 16px 18px 14px;
  animation: guidePopIn 140ms ease-out;
}
.fs-help-pop::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  margin-left: -5px;
  width: 10px; height: 10px;
  background: var(--surface);
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  transform: rotate(45deg);
}
.fs-help-title {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
}
.fs-help-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-height: 280px;
  overflow-y: auto;
}
.fs-help-body p { margin: 0 0 10px; }
.fs-help-body p:last-child { margin-bottom: 0; }
.fs-help-close {
  margin-top: 12px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--sans);
  color: var(--ink-3);
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fs-help-close:hover { border-color: var(--accent); color: var(--accent); }
.check-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink-4);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 120ms;
}
.check-item.checked .check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.check-item.checked .check-box::after {
  content: '';
  width: 5px; height: 9px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg) translate(-1px, -1px);
}
.check-text { font-size: 14px; line-height: 1.5; color: var(--ink); }
.check-item.checked .check-text { color: var(--ink-3); }

/* ---- Guide button + popover ---- */
.guide-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 5px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: all 120ms ease;
  line-height: 1;
  white-space: nowrap;
}
.guide-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.guide-btn.open {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.guide-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--ink-4);
  color: var(--paper, #fff);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--serif, Georgia, serif);
}
.guide-btn:hover .guide-icon,
.guide-btn.open .guide-icon {
  background: var(--accent);
  color: #fff;
}
.guide-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 18px 44px -16px rgba(0,0,0,0.22), 0 4px 12px -4px rgba(0,0,0,0.08);
  padding: 16px 18px 14px;
  animation: guidePopIn 140ms ease-out;
  text-align: left;
}
@keyframes guidePopIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.guide-pop::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 16px;
  width: 10px; height: 10px;
  background: var(--surface);
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  transform: rotate(45deg);
}
.guide-pop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.guide-pop-title {
  font-family: var(--serif, Georgia, serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.guide-pop-source {
  font-family: var(--mono, monospace);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.guide-pop-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-height: 340px;
  overflow-y: auto;
}
.guide-pop-body p {
  margin: 0 0 10px;
}
.guide-pop-body p:last-child { margin-bottom: 0; }
.guide-pop-close {
  margin-top: 12px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--sans);
  color: var(--ink-3);
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.guide-pop-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}



/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 120ms ease;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.btn:hover { background: var(--bg-3); border-color: var(--ink-4); }
.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--ink); }
.btn-warm {
  background: var(--warn);
  border-color: var(--warn);
  color: #1a1a1a;
}
.btn-warm:hover { filter: brightness(0.95); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  gap: 12px;
}

/* Right rail */
.rail-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule-soft);
}
.rail-section:last-child { border-bottom: none; }
.rail-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.pillar-bar { margin-bottom: 12px; }
.pillar-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--ink-2);
}
.pillar-bar-name { font-weight: 500; }
.pillar-bar-val { font-family: var(--mono); color: var(--ink-3); }
.pillar-bar-track {
  height: 3px;
  background: var(--rule);
  border-radius: 999px;
  overflow: hidden;
}
.pillar-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
.pillar-tip {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 10px 0;
  min-width: 220px;
  z-index: 200;
}
.pillar-tip-head {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
  padding: 0 14px 8px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 4px;
}
.pillar-tip-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 7px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 100ms;
}
.pillar-tip-step:hover { background: var(--bg-3); }
.pillar-tip-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--serif);
}
.pillar-tip-note {
  font-size: 10.5px;
  color: var(--ink-3);
  font-family: var(--mono);
  margin-top: 1px;
}

/* Spiral mini */
.spiral-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.spiral-cell {
  aspect-ratio: 1;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  background: var(--surface);
  font-weight: 500;
}
.spiral-cell.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.spiral-cell.passed { background: var(--bg-3); color: var(--ink-2); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 14px;
}
.card-warm {
  background: var(--warn-soft);
  border-color: var(--warn);
}
.card-quote {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 28px;
  font-weight: 400;
}
.card-quote-attr {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 12px;
  font-weight: 500;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Welcome */
.welcome-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}
.welcome-title {
  font-family: var(--display);
  font-size: 88px;
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 24px 0 18px;
  font-weight: 400;
  text-wrap: balance;
}
.welcome-lede {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 580px;
  font-weight: 400;
}

.framework-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}
.fw-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  transition: all 200ms;
}
.fw-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.fw-card-bar {
  width: 28px; height: 3px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.fw-card-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}
.fw-card-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
  font-weight: 500;
}
.fw-card-text {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* Gate */
.gate-hero {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: left;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.gate-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--warn);
}
.gate-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 500;
}
.gate-title {
  font-family: var(--display);
  font-size: 48px;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 12px;
  font-weight: 400;
  text-wrap: balance;
}
.gate-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  margin-top: 16px;
  white-space: nowrap;
  font-weight: 500;
}
.gate-status.ready { background: var(--accent); color: white; }
.gate-status.warning { background: var(--warn); color: #1a1a1a; }
.gate-status.not-ready { background: var(--bg-3); color: var(--ink-2); border: 1px solid var(--rule); }

.criteria-list { list-style: none; margin: 0; padding: 0; }
.criterion {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.criterion:last-child { border-bottom: none; }
.criterion-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}
.criterion-icon.met { background: var(--accent); color: white; }
.criterion-icon.unmet { background: var(--bg-3); color: var(--ink-3); }
.criterion-text { font-size: 14px; line-height: 1.4; }
.criterion-meta { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }

/* Dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .framework-grid { grid-template-columns: 1fr; }
  .welcome-title { font-size: 56px; }
  .step-title { font-size: 40px; }
}

.metric {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.metric-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.metric-value {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-top: 8px;
  font-weight: 400;
}
.metric-note {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
}

@media (max-width: 820px) {
  .mobile-hidden { display: none !important; }
}
.mobile-tabs {
  display: none;
}
@media (max-width: 820px) {
  .mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 50;
    background: var(--surface);
    border-top: 1px solid var(--rule);
    padding: 0;
    gap: 0;
    box-shadow: 0 -4px 24px -8px rgba(0,0,0,0.12);
  }
  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 150ms;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tab.active { color: var(--accent); }
  .mobile-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 2px 2px;
  }
  .mobile-tab {
    position: relative;
  }
  .mobile-tab-icon {
    font-size: 20px;
    line-height: 1;
  }
  .mobile-tab-indicator { display: none; }
}
@media print {
  .sidebar, .rail, .nav-row, .no-print { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: 100%; }
  body { background: white; color: black; }
  [data-theme="dark"] { --bg: white; --ink: black; }
  /* Print-mode: hide everything except the standalone print root */
  body.printing > * { display: none !important; }
  body.printing #__print_root {
    display: block !important;
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    padding: 32px 48px !important;
    background: white !important;
    color: black !important;
  }
}

/* Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 32px;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 36px 40px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: var(--bg-3);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-2);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--ink-3); color: var(--bg); }

/* Spinner */
.scan-spinner {
  width: 40px; height: 40px;
  border: 2px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* SVG defaults */
svg { display: block; }

/* Helpers */
.row { display: flex; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.muted { color: var(--ink-3); }
.center { text-align: center; }

/* Status explainer on welcome screen */
.status-explainer {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.status-explainer-intro {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 20px;
  line-height: 1.6;
}
.status-explainer-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.status-explainer-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.status-explainer-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  width: fit-content;
  letter-spacing: 0.01em;
}
.status-explainer-pending { background: var(--bg-3); color: var(--ink-2); border: 1px solid var(--rule); }
.status-explainer-help { background: #fef3d6; color: #a06a00; border: 1px solid #f0c040; }
[data-theme="dark"] .status-explainer-help { background: rgba(232,168,56,0.15); color: #e8a838; border-color: rgba(232,168,56,0.3); }
.status-explainer-ready { background: #e6f8ee; color: #1d7a42; border: 1px solid #8fddb0; }
[data-theme="dark"] .status-explainer-ready { background: rgba(61,186,108,0.12); color: #3dba6c; border-color: rgba(61,186,108,0.3); }
.status-explainer-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.55;
}
.status-explainer-cta {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  line-height: 1.55;
}
@media (max-width: 600px) {
  .status-explainer-row { grid-template-columns: 1fr; }
}
