:root {
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #ffffff;
  --wash: #f7f8fa;
  --green: #16a34a;
  --green-pale: #ecfdf3;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; background: var(--ink); color: white; padding: 10px 14px; z-index: 20; }
.skip-link:focus { top: 12px; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); padding: 26px 18px 18px; display: flex; flex-direction: column; background: var(--paper); z-index: 5; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 0 9px 28px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 16px var(--mono); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
#navigation { display: grid; gap: 2px; }
#navigation a { border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 560; padding: 10px 11px; text-decoration: none; transition: background .15s, color .15s; }
#navigation a:hover, #navigation a:focus-visible { background: var(--wash); color: var(--ink); outline: none; }
#navigation a.active { color: var(--ink); background: #f0f2f5; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 17px 9px 4px; color: var(--muted); font-size: 11px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.pulse { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(22,163,74,.1); flex: none; }
main { min-width: 0; }
.topbar { height: 69px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 42px; position: sticky; top: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); z-index: 4; }
.crumb { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.crumb span { color: var(--muted); }
.crumb span::after { content: "/"; margin-left: 9px; color: #c5cad1; }
.top-actions { display: flex; gap: 8px; }
.quiet-button, .menu-button { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 8px 11px; font-size: 12px; font-weight: 650; color: var(--ink-soft); cursor: pointer; text-decoration: none; }
.quiet-button:hover, .menu-button:hover { background: var(--wash); }
.menu-button { display: none; }
.page { max-width: 1120px; padding: 70px 64px 110px; }
.doc-section { display: none; animation: enter .25s ease-out; }
.doc-section.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } }
.eyebrow, .section-heading span, .brief-block > span, .talk-track > span, .column-label span { color: var(--green); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .09em; }
h1 { font-size: clamp(42px, 6vw, 74px); line-height: .99; letter-spacing: -.055em; margin: 16px 0 25px; max-width: 900px; }
h1 em { color: var(--muted); font-style: normal; font-weight: 430; }
h2 { font-size: 28px; letter-spacing: -.035em; margin: 8px 0 0; }
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-soft); max-width: 790px; text-wrap: pretty; }
.status-strip { margin: 45px 0 64px; display: grid; grid-template-columns: 2fr 1fr 1fr; border-block: 1px solid var(--line); }
.status-strip div { padding: 17px 20px 17px 0; }
.status-strip div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.status-strip span, .status-strip strong { display: block; }
.status-strip span { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.status-strip strong { font-size: 13px; }
.statement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.statement-grid article { background: var(--paper); padding: 26px; min-height: 170px; }
.statement-grid article:first-child { grid-row: span 2; }
.statement-grid article.signal { background: var(--ink); color: white; }
.statement-grid article > span { font: 700 10px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.statement-grid .signal > span { color: #9ca3af; }
.statement-grid p { font-size: 17px; line-height: 1.5; margin: 35px 0 0; }
.section-heading { margin: 74px 0 25px; display: flex; justify-content: space-between; align-items: end; }
.principle-list { border-top: 1px solid var(--ink); }
.principle { display: grid; grid-template-columns: 42px minmax(180px, .65fr) 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.principle b { font: 500 11px var(--mono); color: var(--muted); }
.principle strong { font-size: 15px; }
.principle p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.brief { border-top: 2px solid var(--ink); margin-top: 45px; }
.brief-block { display: grid; grid-template-columns: 210px 1fr; gap: 30px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.brief-block p { margin: 0; font-size: 16px; line-height: 1.65; max-width: 700px; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { background: var(--wash); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; width: 22%; }
.talk-track { margin-top: 26px; border-radius: var(--radius); background: var(--ink); color: white; padding: 30px; }
.talk-track span { color: #86efac; }
.talk-track blockquote { margin: 25px 0 0; font-size: 21px; line-height: 1.5; letter-spacing: -.02em; max-width: 820px; }
.architecture-stack { margin-top: 48px; display: grid; gap: 8px; }
.arch-layer { display: grid; grid-template-columns: 170px 1fr; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.arch-layer:first-child { background: var(--ink); color: white; border-color: var(--ink); }
.arch-layer > strong { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.arch-items { display: flex; flex-wrap: wrap; gap: 7px; }
.arch-items span { border: 1px solid currentColor; border-color: rgba(107,114,128,.3); border-radius: 6px; padding: 5px 8px; font-size: 12px; }
.boundary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 38px; }
.boundary-grid article { border-top: 3px solid var(--ink); background: var(--wash); padding: 20px; }
.boundary-grid article:nth-child(2) { border-color: var(--red); }
.boundary-grid article:nth-child(3) { border-color: var(--green); }
.boundary-grid span { font: 700 11px var(--mono); text-transform: uppercase; }
.boundary-grid ul { padding-left: 18px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.agent-list { display: grid; grid-template-columns: repeat(3, 1fr); list-style-position: inside; padding: 0; border-top: 1px solid var(--ink); }
.agent-list li { padding: 18px 10px 18px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.agent-list li::marker { font: 500 11px var(--mono); color: var(--muted); }
.workflow-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; }
.column-label { display: flex; justify-content: space-between; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.column-label strong { font: 500 11px var(--mono); color: var(--muted); }
.workflow-columns ol { list-style: none; padding: 0; margin: 0; counter-reset: workflow; }
.workflow-columns li { counter-increment: workflow; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.workflow-columns li::before { content: counter(workflow, decimal-leading-zero); font: 500 10px var(--mono); color: var(--muted); margin-right: 16px; }
.workflow-loop { margin-top: 50px; background: var(--ink); color: white; border-radius: var(--radius); padding: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 11px; font: 650 12px var(--mono); }
.workflow-loop i { color: #6b7280; font-style: normal; }
.roadmap-summary { margin: 40px 0 32px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 120px 1fr; gap: 32px; align-items: center; }
.progress-ring { --progress: 0deg; width: 112px; height: 112px; border-radius: 50%; background: conic-gradient(var(--green) var(--progress), #e8ebef 0); position: relative; display: grid; place-content: center; text-align: center; }
.progress-ring::before { content: ""; position: absolute; inset: 9px; background: white; border-radius: 50%; }
.progress-ring strong, .progress-ring span { position: relative; z-index: 1; display: block; }
.progress-ring strong { font-size: 25px; letter-spacing: -.04em; }
.progress-ring span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.roadmap-summary p { font-size: 16px; line-height: 1.55; max-width: 660px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd0d7; }
.dot.done { background: var(--green); }.dot.active { background: var(--blue); }.dot.blocked { background: var(--red); }
.roadmap-controls { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; }
.roadmap-controls button { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 7px 12px; color: var(--muted); font-size: 11px; cursor: pointer; white-space: nowrap; }
.roadmap-controls button.selected { background: var(--ink); border-color: var(--ink); color: white; }
.phase-list { display: grid; gap: 12px; }
.phase { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.phase[hidden] { display: none; }
.phase-head { width: 100%; border: 0; background: white; padding: 20px; display: grid; grid-template-columns: 52px 1fr auto; gap: 15px; text-align: left; cursor: pointer; align-items: center; }
.phase-head:hover { background: var(--wash); }
.phase-id { font: 700 11px var(--mono); color: var(--muted); }
.phase-name strong, .phase-name span { display: block; }
.phase-name strong { font-size: 15px; }
.phase-name span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.phase-score { font: 650 11px var(--mono); color: var(--muted); }
.phase-body { display: none; padding: 0 20px 20px 87px; }
.phase.open .phase-body { display: block; }
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { border-top: 1px solid var(--line); padding: 13px 0; display: flex; gap: 10px; font-size: 13px; line-height: 1.4; }
.task-status { width: 17px; height: 17px; border-radius: 50%; border: 1px solid #cbd0d7; flex: none; margin-top: 1px; }
.task-status.done { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 4px white; }
.task-status.in_progress { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 4px white; }
.task-status.blocked { background: var(--red); border-color: var(--red); box-shadow: inset 0 0 0 4px white; }
.exit-criteria { margin-top: 16px; padding: 12px 14px; background: var(--wash); border-radius: 8px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.exit-criteria strong { font: 700 10px var(--mono); text-transform: uppercase; margin-right: 6px; }
.decision-list, .risk-list { border-top: 2px solid var(--ink); margin-top: 42px; }
.decision, .risk { display: grid; grid-template-columns: 120px 1fr; gap: 25px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.decision time, .risk-level { color: var(--muted); font: 600 10px var(--mono); }
.decision h3, .risk h3 { font-size: 17px; margin: 0 0 8px; }
.decision p, .risk p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.risk-level.high { color: var(--red); }.risk-level.medium { color: var(--amber); }
.glossary { margin-top: 42px; }
.glossary-row { display: grid; grid-template-columns: 190px 1fr; gap: 30px; padding: 19px 0; border-top: 1px solid var(--line); }
.glossary dt { font: 700 12px var(--mono); }
.glossary dd { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: white; border-radius: 8px; padding: 11px 14px; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; transform: translateX(-100%); transition: transform .2s; width: 270px; box-shadow: 20px 0 40px rgba(17,24,39,.12); }
  .sidebar.open { transform: none; }
  .menu-button { display: inline-block; }
  .topbar { padding: 0 20px; }
  .crumb { display: none; }
  .page { padding: 50px 24px 80px; }
  .boundary-grid, .agent-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .top-actions .quiet-button:first-child { display: none; }
  .status-strip { grid-template-columns: 1fr; }
  .status-strip div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .statement-grid, .workflow-columns { grid-template-columns: 1fr; }
  .statement-grid article:first-child { grid-row: auto; }
  .principle, .brief-block, .arch-layer, .decision, .risk, .glossary-row { grid-template-columns: 1fr; gap: 8px; }
  .roadmap-summary { grid-template-columns: 1fr; }
  .phase-head { grid-template-columns: 42px 1fr; }
  .phase-score { grid-column: 2; }
  .phase-body { padding-left: 20px; }
  h1 { font-size: 43px; }
}
@media print {
  .sidebar, .topbar, .roadmap-controls, .toast { display: none !important; }
  .shell { display: block; }
  .page { max-width: none; padding: 0; }
  .doc-section { display: block !important; break-before: page; animation: none; }
  .doc-section:first-child { break-before: auto; }
  .phase-body { display: block; }
  h1 { font-size: 42pt; }
  .statement-grid, .phase, .talk-track { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
