:root {
  --ink: #172026;
  --ink-strong: #0b1216;
  --muted: #65717a;
  --soft: #89949c;
  --canvas: #f3f5f2;
  --paper: #ffffff;
  --paper-warm: #fbfaf6;
  --line: #d9dfd8;
  --line-strong: #bbc6bf;
  --rail: #111a1f;
  --rail-2: #18252b;
  --rail-muted: #9aaba8;
  --rail-line: #2a383d;
  --green: #0f766e;
  --green-soft: #dff1eb;
  --clay: #9a5a2e;
  --clay-soft: #f7e8dc;
  --gold: #b98524;
  --gold-soft: #fff3d6;
  --red: #b5423d;
  --red-soft: #fae3df;
  --blue: #315f83;
  --blue-soft: #e4edf4;
  --violet: #6f557d;
  --violet-soft: #efe6f3;
  --radius: 8px;
  --shadow: 0 20px 50px rgba(17, 29, 35, .12);
  --shadow-soft: 0 1px 2px rgba(17, 29, 35, .07), 0 12px 28px rgba(17, 29, 35, .08);
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(15, 118, 110, .35); outline-offset: 2px; }
a { color: inherit; }

.boot-screen, .error-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.boot-mark {
  width: 34px;
  height: 34px;
  margin: auto;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-screen { max-width: 620px; margin: auto; color: var(--ink); }
.error-screen h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.error-screen p { margin: 0; line-height: 1.55; }

.app-shell { min-height: 100vh; }
.workspace { min-height: 100vh; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 292px;
  overflow-y: auto;
  padding: 24px 16px 20px;
  color: #edf3ee;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0) 260px),
    var(--rail);
  border-right: 1px solid var(--rail-line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px;
  border-bottom: 1px solid var(--rail-line);
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  gap: 3px;
  width: 19px;
  flex: 0 0 auto;
}
.brand-mark i { display: block; height: 8px; background: var(--green); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: var(--gold); }
.brand-name { display: block; font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.brand-type {
  display: block;
  margin-top: 2px;
  color: var(--rail-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rail-project {
  margin: 18px 0 18px;
  padding: 18px 14px;
  background: var(--rail-2);
  border: 1px solid var(--rail-line);
  border-radius: var(--radius);
}
.rail-project p {
  margin: 0 0 8px;
  color: var(--rail-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rail-project h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.02;
  letter-spacing: -.04em;
}
.rail-project small {
  display: block;
  margin-top: 10px;
  color: #bac8c4;
  font-size: 12px;
  line-height: 1.45;
}
.nav-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}
.nav-list button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  color: #c9d3ce;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
}
.nav-list button:hover { color: #fff; background: #1b2a30; }
.nav-list button[aria-current="page"] {
  color: #fff;
  background: #21333a;
  border-color: #31474f;
}
.nav-index {
  color: #7e8e8b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}
.rail-controls {
  margin-top: 22px;
  padding: 18px 9px 0;
  border-top: 1px solid var(--rail-line);
}
.rail-controls label {
  display: block;
  margin-bottom: 8px;
  color: var(--rail-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rail-controls select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #edf4ef;
  background: #172328;
  border: 1px solid #3b4a4f;
  border-radius: 6px;
  font-size: 12px;
}
.tier-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.main {
  min-width: 0;
  width: calc(100% - 292px);
  margin-left: 292px;
}
.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(243, 245, 242, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.crumb {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb strong { color: var(--ink); font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.search-button, .quiet-button, .menu-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.7);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.search-button {
  min-width: 220px;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 600;
}
.search-button kbd {
  color: var(--soft);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
}
.quiet-button:hover, .search-button:hover, .menu-button:hover { border-color: #95a59f; background: #fff; }
.menu-button { display: none; }

.content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 38px 34px 72px;
}
.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.view-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.view-head h2 {
  max-width: 860px;
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(34px, 4.2vw, 62px);
  font-weight: 820;
  letter-spacing: -.055em;
  line-height: .96;
}
.view-head p:not(.eyebrow) {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }

.status-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.status-copy, .status-gate { padding: 20px 22px; }
.status-copy h3 {
  margin: 0 0 8px;
  color: var(--ink-strong);
  font-size: 20px;
  letter-spacing: -.025em;
}
.status-copy p {
  max-width: 780px;
  margin: 0;
  color: #445159;
  font-size: 14px;
  line-height: 1.5;
}
.status-gate {
  background: var(--gold-soft);
  border-left: 1px solid #ecd4a3;
  color: #755211;
  font-size: 12px;
  line-height: 1.45;
}
button.status-gate {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  cursor: pointer;
  text-align: left;
}
button.status-gate:hover { background: #fff0ca; }
.status-gate b {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 14px;
}

.section { margin-top: 34px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}
.section-head h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.metric-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.overview-metrics .metric {
  min-height: 142px;
}

.next-steps {
  display: grid;
  gap: 8px;
  max-width: 860px;
}

.next-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.next-step:hover {
  border-color: var(--teal);
}

.next-step > span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.next-step strong {
  min-width: 0;
  font-size: 14px;
}

.next-step small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.summary-metrics article {
  min-height: 142px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
}

.summary-metrics p,
.summary-next p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.summary-metrics strong {
  display: block;
  color: var(--ink-strong);
  font-size: 31px;
  letter-spacing: -.02em;
}

.summary-metrics span {
  display: block;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.summary-section {
  max-width: 860px;
  margin-top: 34px;
}

.summary-section h3 {
  margin: 0 0 13px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.summary-section ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.summary-section li {
  position: relative;
  padding: 15px 0 15px 26px;
  color: #344146;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
}

.summary-section li::before {
  position: absolute;
  left: 2px;
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 8px;
  background: var(--teal);
  border-radius: 50%;
}

.summary-next {
  max-width: 860px;
  margin-top: 22px;
  padding: 20px 22px;
  background: var(--green-soft);
  border-left: 4px solid var(--teal);
}

.summary-next p { margin-bottom: 7px; }
.summary-next strong { color: var(--ink-strong); font-size: 16px; line-height: 1.45; }

.source-link {
  margin-top: 28px;
  padding: 0;
  color: var(--teal);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.metric {
  min-width: 0;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-align: left;
}
.metric:hover { border-color: #a8b6af; transform: translateY(-1px); }
.metric-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.metric-value {
  width: 100%;
  margin: 13px 0 8px;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -.045em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-note {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.4;
}

.blocker-table, .source-table {
  width: 100%;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.blocker-table th, .source-table th {
  padding: 12px 14px;
  color: var(--muted);
  background: #f7f8f5;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-align: left;
  text-transform: uppercase;
}
.blocker-table td, .source-table td {
  padding: 15px 14px;
  color: #2d3a41;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
  vertical-align: top;
}
.blocker-table tr:last-child td, .source-table tr:last-child td { border-bottom: 0; }
.blocker-name {
  display: block;
  margin-top: 6px;
  color: var(--ink-strong);
  font-weight: 800;
}
.blocker-reason { color: var(--muted); font-size: 12px; }
.table-action {
  padding: 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.principles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.principle {
  min-height: 150px;
  padding: 16px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.principle b {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 1.25;
}
.principle span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.document-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 28px;
}
.markdown {
  min-width: 0;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.markdown > :first-child { margin-top: 0; }
.markdown h1 {
  margin: 0 0 18px;
  color: var(--ink-strong);
  font-size: 38px;
  letter-spacing: -.05em;
  line-height: 1.02;
}
.markdown h2 {
  margin: 42px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-strong);
  font-size: 24px;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.markdown h3 { margin: 28px 0 10px; color: var(--ink-strong); font-size: 17px; }
.markdown h4 { margin: 22px 0 8px; color: var(--ink-strong); font-size: 14px; }
.markdown p, .markdown li {
  color: #354249;
  font-size: 14px;
  line-height: 1.66;
}
.markdown p { margin: 0 0 15px; }
.markdown ul, .markdown ol { margin: 0 0 18px; padding-left: 22px; }
.markdown li { margin: 5px 0; }
.markdown blockquote {
  margin: 20px 0;
  padding: 14px 17px;
  color: #294b4d;
  background: var(--green-soft);
  border: 1px solid #bddbd3;
  border-left: 4px solid var(--green);
  border-radius: 0 6px 6px 0;
}
.markdown blockquote p { margin: 0; }
.markdown code {
  padding: 2px 5px;
  color: #25434c;
  background: #edf1ed;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
}
.markdown pre {
  overflow: auto;
  margin: 18px 0;
  padding: 16px;
  color: #dce8e4;
  background: #162228;
  border-radius: 6px;
}
.markdown pre code { padding: 0; color: inherit; background: transparent; }
.markdown table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 12px;
}
.markdown th {
  color: #526066;
  background: #f0f2ef;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.markdown td, .markdown th {
  padding: 10px;
  border: 1px solid var(--line);
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
}
.markdown a { color: var(--blue); text-underline-offset: 3px; }
.markdown hr { margin: 36px 0; border: 0; border-top: 1px solid var(--line); }
.markdown input[type="checkbox"] { accent-color: var(--green); }
.mermaid { overflow-x: auto; padding: 14px 0; }

.doc-aside {
  align-self: start;
  position: sticky;
  top: 92px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.doc-aside h3 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.doc-aside button {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 7px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-aside button:hover { color: var(--green); }
.source-stamp {
  margin-top: 12px;
  padding-top: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}
.source-stamp strong { color: var(--ink); }
.source-stamp code {
  color: var(--soft);
  font-size: 10px;
  word-break: break-all;
}

.document-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.document-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.document-item h4 {
  margin: 0 0 6px;
  color: var(--ink-strong);
  font-size: 15px;
}
.document-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.document-item button {
  align-self: start;
  padding: 0;
  color: var(--green);
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  color: #4f5b61;
  background: #eef1ee;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
  line-height: 1;
  white-space: nowrap;
}
.tier-P1 { color: #14675d; background: var(--green-soft); }
.tier-P2 { color: #1d607e; background: var(--blue-soft); }
.tier-P3 { color: #8a5a00; background: var(--gold-soft); }
.tier-A { color: var(--violet); background: var(--violet-soft); }
.status-blocked, .severity-p0, .severity-critical { color: var(--red); background: var(--red-soft); }
.status-working, .severity-p1, .severity-high { color: var(--clay); background: var(--clay-soft); }
.status-ready { color: var(--green); background: var(--green-soft); }
.tier-internal, .tier-P3-pending-P1-upgrade { color: #59686c; background: #e8edeb; }

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(11, 20, 23, .42);
}
.evidence-drawer {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  width: min(500px, 100vw);
  height: 100vh;
  overflow-y: auto;
  padding: 28px 30px 36px;
  background: var(--paper);
  box-shadow: -18px 0 48px rgba(18, 30, 32, .2);
}
.drawer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-top h2 {
  margin: 8px 0 0;
  color: var(--ink-strong);
  font-size: 25px;
  letter-spacing: -.035em;
}
.drawer-close {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}
.drawer-body { padding-top: 6px; }
.drawer-body dt {
  margin-top: 20px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.drawer-body dd {
  margin: 6px 0 0;
  color: #344146;
  font-size: 14px;
  line-height: 1.5;
}

.search-dialog {
  position: fixed;
  z-index: 40;
  inset: 0;
  padding-top: min(14vh, 110px);
  background: rgba(11, 20, 23, .48);
}
.search-panel {
  width: min(740px, calc(100% - 28px));
  max-height: min(680px, 76vh);
  overflow-y: auto;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.search-row input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 18px;
}
.search-result {
  display: block;
  width: 100%;
  padding: 15px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.search-result:hover { background: #f4f7f3; }
.search-result b { display: block; margin-bottom: 4px; color: var(--ink-strong); font-size: 14px; }
.search-result span { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.search-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 18px;
  color: var(--muted);
  font-size: 13px;
}
.hidden { display: none !important; }
.noscript { padding: 28px; color: var(--ink); }

@media (max-width: 1180px) {
  .metric-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .workspace { display: block; }
  .rail {
    width: min(304px, 88vw);
    transform: translateX(-100%);
    transition: transform .18s ease;
    box-shadow: 14px 0 34px rgba(0,0,0,.24);
  }
  .rail.is-open { transform: translateX(0); }
  .main { width: 100%; margin-left: 0; }
  .topbar { min-height: 62px; padding: 0 18px; }
  .menu-button { display: inline-flex; }
  .search-button { min-width: 0; padding: 8px 10px; }
  .search-button kbd { display: none; }
  .content { padding: 28px 18px 54px; }
  .view-head {
    display: block;
    margin-bottom: 22px;
  }
  .view-head h2 { font-size: 38px; }
  .head-actions { margin-top: 16px; }
  .status-band { grid-template-columns: 1fr; }
  .status-gate { border-left: 0; border-top: 1px solid #ecd4a3; }
  .document-grid { display: block; }
  .doc-aside { display: none; }
  .document-list { grid-template-columns: 1fr; }
  .blocker-table th:nth-child(3), .blocker-table td:nth-child(3) { display: none; }
}

@media (max-width: 560px) {
  .topbar { gap: 9px; }
  .crumb { display: none; }
  .top-actions { margin-left: auto; }
  .quiet-button { padding: 8px 10px; }
  .view-head h2 { font-size: 33px; }
  .metric-shelf, .principles { grid-template-columns: 1fr; }
  .summary-metrics { grid-template-columns: 1fr; }
  .summary-metrics article { min-height: 124px; }
  .metric { min-height: 124px; }
  .metric-value { font-size: 31px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .next-step {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
  }
  .next-step small { grid-column: 2; white-space: normal; }
  .blocker-table, .blocker-table thead, .blocker-table tbody, .blocker-table tr, .blocker-table td,
  .source-table, .source-table thead, .source-table tbody, .source-table tr, .source-table td {
    display: block;
    width: 100%;
  }
  .blocker-table thead, .source-table thead { display: none; }
  .blocker-table tr, .source-table tr { border-bottom: 1px solid var(--line); }
  .blocker-table tr:last-child, .source-table tr:last-child { border-bottom: 0; }
  .blocker-table td, .source-table td { border-bottom: 0; }
  .markdown { padding: 20px; }
  .markdown h1 { font-size: 31px; }
}
