* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
summary,
a,
label,
input[type="radio"],
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: var(--evidence);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
p,
ul,
ol,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
strong {
  font-weight: 700;
}

h1,
h2,
h3,
h4,
h5 {
  line-height: 1.25;
  letter-spacing: 0;
}

:focus-visible {
  outline: 3px solid rgba(20, 122, 75, 0.28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 8px 12px;
  color: #fff;
  background: var(--accent-strong);
  border-radius: var(--radius-sm);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  height: 100vh;
  padding: 24px 18px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: var(--accent-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 800;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.brand-copy strong {
  font-size: var(--text-base);
}

.brand-copy small {
  color: var(--muted);
  font-size: var(--text-xs);
}

.toc {
  display: grid;
  gap: 2px;
  margin-top: 28px;
}

.toc a {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px 8px;
  color: var(--ink-2);
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  text-decoration: none;
  transition: color var(--motion), background var(--motion), border-color var(--motion);
}

.toc a span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
}

.toc a strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
}

.toc a:hover {
  color: var(--accent-strong);
  background: var(--surface-soft);
}

.toc a.active {
  color: var(--accent-strong);
  background: #dceee4;
  border-left-color: var(--accent);
}

.sidebar-tools {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.auth-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.auth-state {
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.auth-button {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
}

.edit-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}

.edit-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.button,
.icon-button,
.edit-control,
.prototype-open-button {
  border: 0;
  border-radius: var(--radius-sm);
  transition: color var(--motion), background var(--motion), border-color var(--motion), transform var(--motion);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: var(--accent-strong);
}

.button-primary:hover {
  background: #0a4e2f;
}

.button-secondary {
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.button-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.button-quiet {
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
}

.button-quiet:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.save-state {
  min-height: 20px;
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: center;
}

.save-state[data-tone="saving"] {
  color: var(--evidence);
}

.save-state[data-tone="success"] {
  color: var(--accent-strong);
}

.save-state[data-tone="error"] {
  color: var(--danger);
}

main {
  min-width: 0;
  background: var(--page);
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 56px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 60px 32px 44px;
  border-bottom: 1px solid var(--line-strong);
}

.site-header-main {
  max-width: 820px;
}

.editable-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.eyebrow-line {
  align-items: center;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent-strong);
  font-size: var(--text-sm);
  font-weight: 750;
}

.site-header h1 {
  max-width: 780px;
  margin-bottom: 16px;
  font-size: var(--text-3xl);
}

.site-purpose {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: var(--text-lg);
  line-height: 1.65;
}

.site-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  align-self: start;
  min-width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.meta-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.meta-item:last-child {
  border-right: 0;
}

.meta-item span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.meta-item strong {
  font-size: var(--text-sm);
}

.audience-line {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.audience-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audience-list span,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: 650;
}

.edit-control {
  display: none;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 9px;
  color: var(--evidence);
  background: var(--evidence-soft);
  border: 1px solid #b7d2e7;
  font-size: var(--text-xs);
  font-weight: 700;
}

.edit-control:hover {
  color: #0f4f84;
  background: #dcecf7;
  border-color: var(--evidence);
}

.edit-mode .edit-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inline-editing {
  position: relative;
  scroll-margin-top: 88px;
  outline: 2px solid rgba(20, 122, 75, 0.22);
  outline-offset: 8px;
}

.inline-editing .edit-control {
  display: none !important;
}

.inline-editor-toolbar {
  position: sticky;
  top: 12px;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #b9d3c7;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(23, 33, 29, 0.12);
  backdrop-filter: blur(8px);
}

.inline-editor-toolbar > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.inline-editor-toolbar strong {
  min-width: 0;
  font-size: var(--text-sm);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.inline-editor-toolbar span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.inline-editor-toolbar .button {
  min-height: 34px;
  padding: 6px 11px;
}

.inline-editable {
  min-width: 1ch;
  border-radius: 3px;
  outline: 1px dashed rgba(20, 122, 75, 0.5);
  outline-offset: 3px;
  cursor: text;
  transition: background var(--motion), outline-color var(--motion), box-shadow var(--motion);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.inline-editable:hover {
  background: rgba(220, 238, 228, 0.5);
  outline-color: var(--accent);
}

.inline-editable:focus {
  background: #fff;
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 122, 75, 0.12);
}

.inline-editable:empty::before {
  color: var(--muted);
  content: '输入内容';
}

.inline-edit-dirty {
  outline-color: rgba(187, 107, 10, 0.48);
}

.section-list {
  min-width: 0;
}

.mindmap-section,
.chapter {
  scroll-margin-top: 24px;
}

.mindmap-section {
  max-width: 1500px;
  margin: 0 auto;
  padding: 54px 32px 72px;
  border-bottom: 1px solid var(--line-strong);
}

.mindmap-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--wide);
  margin: 0 auto 34px;
}

.chapter-number,
.chapter-status,
.region-kicker {
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 750;
}

.mindmap-heading h2 {
  margin-bottom: 10px;
  font-size: var(--text-2xl);
}

.mindmap-heading p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--ink-2);
}

.mindmap-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mindmap-canvas {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 240px minmax(300px, 1fr);
  align-items: start;
  gap: 72px;
  min-height: 460px;
  padding: 24px 0;
}

.mindmap-links {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.mindmap-link {
  fill: none;
  stroke: #7faa96;
  stroke-width: 1.5;
}

.mindmap-link-right {
  stroke: #8aafc9;
}

.mindmap-link-dot {
  fill: var(--accent);
}

.mindmap-center {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  min-height: 150px;
  margin-top: 102px;
  padding: 22px;
  color: #fff;
  background: var(--accent-strong);
  border: 1px solid #084529;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  text-align: center;
}

.mindmap-center span {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 800;
}

.mindmap-center strong {
  margin-top: 8px;
  font-size: var(--text-lg);
  line-height: 1.45;
}

.mindmap-side {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.mind-branch,
.mind-node,
.scenario-item,
.deep-dive-item,
.source-detail,
.disclosure {
  min-width: 0;
}

.mind-branch > summary,
.mind-node > summary,
.scenario-item > summary,
.deep-dive-item > summary,
.source-detail > summary,
.disclosure > summary {
  list-style: none;
}

.mind-branch > summary::-webkit-details-marker,
.mind-node > summary::-webkit-details-marker,
.scenario-item > summary::-webkit-details-marker,
.deep-dive-item > summary::-webkit-details-marker,
.source-detail > summary::-webkit-details-marker,
.disclosure > summary::-webkit-details-marker {
  display: none;
}

.mind-branch > summary {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
}

.mind-branch > summary:hover {
  background: rgba(255, 255, 255, 0.66);
}

.mind-branch > summary::before,
.mind-node > summary::before {
  position: absolute;
  top: 50%;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--accent-strong);
  background: #edf2ef;
  border-radius: var(--radius-xs);
  content: "+";
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-50%);
}

.mind-branch[open] > summary::before,
.mind-node[open] > summary::before {
  content: "−";
}

.mind-branch-left > summary {
  padding-right: 38px;
  border-bottom-color: var(--accent);
  text-align: right;
}

.mind-branch-left > summary::before {
  right: 12px;
}

.mind-branch-right > summary {
  padding-left: 38px;
  border-bottom-color: var(--evidence);
}

.mind-branch-right > summary::before {
  left: 12px;
}

.mind-branch > summary span {
  width: 100%;
  font-size: var(--text-sm);
  font-weight: 750;
}

.mind-branch > summary small,
.mind-node > summary small,
.mind-leaf small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.mind-branch-children {
  display: grid;
  gap: 8px;
  margin: 9px 0 0;
  padding: 10px 0 2px 14px;
  border-left: 1px solid #b9d3c7;
}

.mind-branch-intro {
  margin: 0 0 2px;
  padding: 0 4px 7px;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.mind-branch-left:nth-child(1),
.mind-branch-left:nth-child(6),
.mind-branch-right:nth-child(1),
.mind-branch-right:nth-child(6) {
  margin-right: 42px;
  margin-left: 42px;
}

.mind-branch-left:nth-child(2),
.mind-branch-left:nth-child(5),
.mind-branch-right:nth-child(2),
.mind-branch-right:nth-child(5) {
  margin-right: 20px;
  margin-left: 20px;
}

.mind-branch-left .mind-branch-children {
  padding-right: 14px;
  padding-left: 0;
  border-right: 1px solid #b9d3c7;
  border-left: 0;
}

.mind-node > summary,
.mind-leaf {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 8px 10px 8px 32px;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.mind-node > summary {
  cursor: pointer;
}

.mind-node > summary::before {
  left: 8px;
  width: 16px;
  height: 16px;
  font-size: 11px;
}

.mind-leaf {
  padding-left: 10px;
  background: #fff;
}

.mind-children {
  display: grid;
  gap: 6px;
  margin: 6px 0 0 12px;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}

.chapter {
  padding: 64px 32px 78px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}

.chapter:nth-of-type(even) {
  background: #fbfcfb;
}

.chapter > .chapter-header,
.chapter > .region-block:not(.prototype-region),
.chapter > .chapter-disclosures {
  max-width: var(--content);
  margin-right: auto;
  margin-left: auto;
}

.chapter > .prototype-region {
  max-width: var(--wide);
  margin-right: auto;
  margin-left: auto;
}

.chapter-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  margin-bottom: 36px;
}

.chapter-index {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #b9d3c7;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 800;
}

.chapter-title-block h2 {
  margin-bottom: 10px;
  font-size: var(--text-2xl);
}

.chapter-title-block > p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: var(--text-lg);
}

.chapter-status {
  margin-bottom: 5px;
}

.region-block {
  margin-top: 34px;
}

.region-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.region-heading h3 {
  margin-bottom: 0;
  font-size: var(--text-xl);
}

.region-heading > div > p:last-child {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.chapter-lead {
  padding: 22px 24px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
}

.chapter-lead > p:last-child {
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: var(--text-lg);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

.fact {
  display: grid;
  align-content: start;
  min-height: 156px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.fact-evidence {
  border-top-color: var(--evidence);
}

.fact-decision {
  border-top-color: var(--accent);
}

.fact-risk {
  border-top-color: var(--warning);
}

.fact > span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.fact > strong {
  margin: 7px 0;
  font-size: var(--text-lg);
}

.fact > p {
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.prototype-region {
  margin-top: 46px;
  padding: 24px;
  background: #eef2ef;
  border: 1px solid #cfd9d3;
  border-radius: var(--radius-md);
}

.prototype-heading {
  margin-bottom: 20px;
}

.prototype-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.prototype-state-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-column: 1;
  grid-row: 2;
  align-content: start;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.prototype-state-index li {
  min-width: 0;
  border-bottom: 1px solid #ccd7d1;
}

.prototype-state-button {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: start;
  padding: 11px 8px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
}

.prototype-state-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.56);
}

.prototype-state-index li.active .prototype-state-button {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

.prototype-state-button:disabled {
  cursor: default;
  opacity: 0.52;
}

.prototype-state-button > span {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.prototype-state-button small {
  padding-top: 1px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.prototype-state-index li.active .prototype-state-button small {
  color: var(--accent-strong);
  font-weight: 750;
}

.prototype-state-index strong {
  display: block;
  font-size: var(--text-sm);
}

.prototype-state-index p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.prototype-stage {
  position: relative;
  min-width: 0;
  width: 100%;
  grid-column: 1 / -1;
  grid-row: 1;
  aspect-ratio: 16 / 9;
  background: #fff;
  border: 1px solid #aebcb4;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(23, 33, 29, 0.11);
  overflow: hidden;
  transform-origin: top left;
}

.prototype-stage-media,
.prototype-stage-media img,
.prototype-stage-media iframe {
  width: 100%;
  height: 100%;
}

.prototype-stage-media img {
  object-fit: contain;
  background: #fff;
}

.prototype-iframe {
  display: block;
  border: 0;
  background: #fff;
}

.prototype-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  padding: 40px;
  text-align: center;
}

.prototype-placeholder::before,
.prototype-placeholder::after {
  position: absolute;
  background: #e4ebe7;
  content: "";
}

.prototype-placeholder::before {
  top: 50%;
  left: 8%;
  width: 84%;
  height: 1px;
}

.prototype-placeholder::after {
  top: 8%;
  left: 50%;
  width: 1px;
  height: 84%;
}

.prototype-placeholder > * {
  position: relative;
  z-index: 1;
}

.prototype-placeholder span {
  justify-self: center;
  min-width: 44px;
  padding: 4px 9px;
  color: #fff;
  background: var(--accent-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
}

.prototype-placeholder strong {
  margin: 12px 0 8px;
  font-size: var(--text-xl);
}

.prototype-placeholder p {
  max-width: 540px;
  margin: 0 auto;
  color: var(--muted);
  font-size: var(--text-sm);
}

.prototype-open-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  min-height: 36px;
  padding: 6px 11px;
  color: #fff;
  background: rgba(14, 96, 58, 0.94);
  font-size: var(--text-xs);
  font-weight: 750;
}

.prototype-open-button:hover {
  background: #084529;
}

.prototype-review-notes {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.review-note-list {
  margin: 14px 0 18px;
  padding-left: 19px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.review-note-list li + li {
  margin-top: 7px;
}

.prototype-callout {
  padding: 12px 0;
  border-top: 1px solid #ccd7d1;
}

.prototype-callout strong {
  font-size: var(--text-sm);
}

.prototype-callout p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

.requirement-statements {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: requirement;
}

.requirement-statements li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  counter-increment: requirement;
}

.requirement-statements li::before {
  color: var(--accent-strong);
  content: counter(requirement, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
}

.chapter-disclosures {
  display: grid;
  gap: 12px;
  margin-top: 38px;
}

.disclosure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 70px;
  padding: 15px 18px;
  cursor: pointer;
}

.disclosure > summary:hover {
  background: var(--surface-soft);
}

.disclosure > summary > div {
  display: grid;
  min-width: 0;
}

.disclosure > summary strong {
  font-size: var(--text-lg);
}

.disclosure > summary span:not(.disclosure-marker) {
  color: var(--muted);
  font-size: var(--text-sm);
}

.disclosure-marker {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-weight: 800;
}

.disclosure[open] > summary .disclosure-marker {
  transform: rotate(45deg);
}

.disclosure-decision {
  border-color: #add0bd;
}

.disclosure-validation {
  border-color: #e1c98e;
}

.disclosure-body {
  padding: 4px 18px 22px;
  border-top: 1px solid var(--line);
}

.disclosure-edit {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-height: 8px;
  padding-top: 12px;
}

.section-intro {
  max-width: 760px;
  margin: 16px 0 20px;
  color: var(--muted);
}

.rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin-top: 12px;
}

.rule-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.rule-item h4 {
  margin-bottom: 5px;
  font-size: var(--text-base);
}

.rule-item p {
  margin-bottom: 0;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.scenario-list,
.deep-dive-list,
.source-detail-list {
  display: grid;
  gap: 8px;
}

.scenario-item,
.deep-dive-item,
.source-detail {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.scenario-item > summary,
.deep-dive-item > summary,
.source-detail > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  cursor: pointer;
}

.scenario-item > summary > div,
.deep-dive-item > summary > div,
.source-detail > summary > div {
  display: grid;
}

.scenario-item > summary span,
.deep-dive-item > summary span,
.source-detail > summary span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.scenario-item[open] > summary > span:last-child,
.deep-dive-item[open] > summary > span:last-child,
.source-detail[open] > summary > span:last-child {
  transform: rotate(45deg);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  padding: 14px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.scenario-grid section {
  min-width: 0;
}

.scenario-grid h5 {
  margin-bottom: 7px;
  color: var(--accent-strong);
  font-size: var(--text-sm);
}

.scenario-grid ul,
.deep-dive-item ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.deep-dive-item > div,
.source-detail > div {
  padding: 14px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.deep-dive-item > div > p {
  margin: 14px 0 0;
  color: var(--ink-2);
}

.logic-view {
  margin-top: 24px;
}

.logic-view h4 {
  margin-bottom: 12px;
  font-size: var(--text-lg);
}

.journey-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  list-style: none;
}

.journey-steps li {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.journey-steps li:last-child {
  border-right: 0;
}

.journey-steps li > span {
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 800;
}

.journey-steps strong {
  display: block;
  margin: 5px 0;
  font-size: var(--text-sm);
}

.journey-steps p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
}

.state-lanes {
  border-top: 1px solid var(--line-strong);
}

.state-lane {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.state-lane > strong {
  font-size: var(--text-sm);
}

.state-lane > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.state-lane > div > span {
  display: grid;
  min-width: 145px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

.state-lane b {
  font-size: var(--text-xs);
}

.state-lane small {
  color: var(--muted);
  font-size: 11px;
}

.transition-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.transition-list span {
  padding: 4px 8px;
  color: var(--ink-2);
  background: var(--accent-soft);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #fff;
  font-size: var(--text-sm);
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: var(--surface-soft);
  font-size: var(--text-xs);
}

tr:last-child td {
  border-bottom: 0;
}

.diagram-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.diagram-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.diagram-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.diagram-card header span {
  color: var(--evidence);
  font-size: var(--text-xs);
  font-weight: 750;
}

.diagram-card h4 {
  margin: 4px 0 6px;
}

.diagram-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.diagram-target {
  min-height: 240px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  overflow: auto;
}

.diagram-target svg {
  min-width: 760px;
  margin: 0 auto;
}

.diagram-error {
  display: grid;
  place-items: center;
  color: var(--danger);
}

.confirmed-decision-list,
.review-decision-list,
.evidence-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.confirmed-decision,
.review-decision,
.evidence-item {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.confirmed-decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
}

.confirmed-decision > div span,
.review-decision > header span,
.evidence-item > header span {
  color: var(--accent-strong);
  font-size: var(--text-xs);
  font-weight: 750;
}

.confirmed-decision h4,
.review-decision h4,
.evidence-item h4 {
  margin: 3px 0 0;
}

.confirmed-decision > strong,
.confirmed-decision > p,
.confirmed-decision > small {
  grid-column: 1 / -1;
}

.confirmed-decision > p {
  margin-bottom: 0;
  color: var(--ink-2);
}

.confirmed-decision > small {
  color: var(--muted);
}

.review-decision > header,
.evidence-item > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.decision-recommendation {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  padding: 13px 15px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

.decision-recommendation p {
  margin: 0 0 4px;
  color: var(--ink-2);
}

.decision-recommendation small {
  color: var(--muted);
}

.decision-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.decision-options legend {
  margin-bottom: 8px;
  font-size: var(--text-sm);
  font-weight: 750;
}

.decision-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.decision-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.decision-option input {
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.decision-option > span {
  display: grid;
  min-width: 0;
}

.decision-option strong {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
}

.decision-option em {
  padding: 1px 5px;
  color: var(--accent-strong);
  background: #d8ecdf;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-style: normal;
}

.decision-option small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.decision-option .tradeoff {
  color: var(--warning);
}

.decision-review-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.decision-review-form h5 {
  grid-column: 1 / -1;
  margin: 0;
}

.decision-review-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-2);
  font-size: var(--text-xs);
  font-weight: 700;
}

.decision-review-form textarea,
.decision-review-form input {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
}

.decision-review-form textarea,
.decision-review-form input {
  padding: 9px 10px;
  font-size: var(--text-sm);
  font-weight: 400;
  resize: vertical;
}

.decision-review-form .button {
  align-self: end;
  justify-self: start;
}

.review-readonly .decision-option {
  cursor: default;
}

.review-readonly .decision-review-form textarea,
.review-readonly .decision-review-form input {
  color: var(--ink-2);
  background: var(--surface-soft);
  opacity: 1;
  -webkit-text-fill-color: var(--ink-2);
}

.review-readonly .decision-review-form .button {
  color: var(--muted);
  background: var(--surface-soft);
  border-color: var(--line);
  cursor: default;
  opacity: 0.72;
}

.evidence-item dl,
.source-detail dl {
  display: grid;
  gap: 0;
  margin: 14px 0 0;
}

.evidence-item dl > div,
.source-detail dl > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.evidence-item dt,
.source-detail dt {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.evidence-item dd,
.source-detail dd {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.evidence-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.evidence-source-links a,
.source-link {
  font-size: var(--text-xs);
  font-weight: 700;
}

.source-detail-list {
  margin-top: 24px;
}

.source-detail-list > h4 {
  margin-bottom: 4px;
}

.source-detail > div > .edit-control {
  float: right;
  margin-bottom: 8px;
}

.boundary-list {
  display: grid;
  gap: 0;
  margin-top: 10px;
}

.boundary-list article {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.boundary-list h4 {
  margin-bottom: 4px;
  font-size: var(--text-base);
}

.boundary-list p {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.glossary-list {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
}

.glossary-list > div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.glossary-list dt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 750;
}

.glossary-list dd {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.validation-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--ink-2);
}

.prototype-lightbox {
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dialog);
}

.prototype-lightbox::backdrop {
  background: rgba(11, 19, 15, 0.66);
}

.prototype-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.prototype-lightbox-header h2 {
  margin: 0;
  font-size: var(--text-xl);
}

.prototype-lightbox {
  width: min(1760px, 96vw);
  max-width: none;
  height: 94vh;
  max-height: none;
  overflow: hidden;
}

.prototype-lightbox-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  background: #eef2ef;
}

.prototype-lightbox-header {
  z-index: 3;
  min-height: 64px;
  padding: 10px 14px 10px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line-strong);
}

.prototype-lightbox-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.zoom-label {
  min-width: 58px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 750;
  text-align: center;
}

.close-button {
  margin-left: 8px;
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.close-button:hover {
  color: #fff;
  background: #084529;
}

.prototype-lightbox-body {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;
}

.prototype-zoom-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
}

.prototype-stage-lightbox {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  transform-origin: top left;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--motion), transform var(--motion);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-tone="success"] {
  background: var(--accent-strong);
}

.toast[data-tone="error"] {
  background: var(--danger);
}

.fatal-error {
  max-width: 760px;
  margin: 80px auto;
  padding: 24px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #efc5c0;
  border-radius: var(--radius-md);
}

@media (max-width: 1240px) {
  .site-header,
  .mindmap-section,
  .chapter {
    padding-right: 24px;
    padding-left: 24px;
  }

  .mindmap-canvas {
    grid-template-columns: minmax(260px, 1fr) 210px minmax(260px, 1fr);
    gap: 46px;
  }

  .prototype-workbench {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
  }
}

@media (max-width: 1080px) {
  :root {
    --sidebar: 220px;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .site-meta {
    width: 100%;
    min-width: 0;
  }

  .prototype-workbench {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .prototype-review-notes {
    grid-column: 2;
    display: block;
    padding-top: 0;
    border-top: 0;
  }

  .prototype-review-notes .review-note-list {
    margin: 14px 0 18px;
  }

  .prototype-callout {
    grid-column: auto;
  }
}

@media (max-width: 960px) {
  html {
    scroll-padding-top: 142px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: auto;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
    overflow: visible;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-copy {
    display: none;
  }

  .toc {
    display: flex;
    gap: 4px;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .toc::-webkit-scrollbar {
    display: none;
  }

  .toc a {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
  }

  .toc a strong {
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .toc a.active {
    border-color: #b9d3c7;
  }

  .sidebar-tools {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0;
  }

  .auth-panel {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .auth-state {
    display: none;
  }

  .auth-button {
    width: auto;
  }

  .edit-toggle {
    min-height: 36px;
    padding: 6px 8px;
  }

  .sidebar-tools .save-state {
    display: none;
  }

  .edit-toggle span {
    display: block;
    font-size: var(--text-xs);
    white-space: nowrap;
  }

  .sidebar-tools .button {
    min-height: 36px;
    padding: 6px 10px;
  }

  .inline-editor-toolbar {
    top: 66px;
  }

  .mindmap-section,
  .chapter {
    scroll-margin-top: 142px;
  }

  .mindmap-canvas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: 0;
    padding: 0;
  }

  .mindmap-links {
    display: none;
  }

  .mindmap-center {
    grid-row: 1;
    min-height: 112px;
    margin-top: 0;
  }

  .mindmap-left {
    grid-row: 2;
  }

  .mindmap-right {
    grid-row: 3;
  }

  .mindmap-side {
    gap: 10px;
  }

  .mind-branch-left > summary,
  .mind-branch-right > summary {
    padding-right: 38px;
    padding-left: 14px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-xs);
    text-align: left;
  }

  .mind-branch-left,
  .mind-branch-right,
  .mind-branch-left:nth-child(1),
  .mind-branch-left:nth-child(2),
  .mind-branch-left:nth-child(5),
  .mind-branch-left:nth-child(6),
  .mind-branch-right:nth-child(1),
  .mind-branch-right:nth-child(2),
  .mind-branch-right:nth-child(5),
  .mind-branch-right:nth-child(6) {
    margin-right: 0;
    margin-left: 0;
  }

  .mind-branch-left > summary::before,
  .mind-branch-right > summary::before {
    right: 12px;
    left: auto;
  }

  .mind-branch-left .mind-branch-children,
  .mind-branch-right .mind-branch-children {
    padding-right: 0;
    padding-left: 14px;
    border-right: 0;
    border-left: 1px solid #b9d3c7;
  }
}

@media (max-width: 760px) {
  .site-header,
  .mindmap-section,
  .chapter {
    padding-right: 16px;
    padding-left: 16px;
  }

  .site-header {
    padding-top: 38px;
    padding-bottom: 30px;
  }

  .site-header h1 {
    font-size: 32px;
  }

  .site-purpose,
  .chapter-title-block > p:last-child,
  .chapter-lead > p:last-child {
    font-size: var(--text-base);
  }

  .site-meta {
    grid-template-columns: 1fr;
  }

  .meta-item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .meta-item:last-child {
    border-bottom: 0;
  }

  .audience-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .mindmap-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .mindmap-actions {
    justify-content: flex-start;
  }

  .chapter {
    padding-top: 46px;
    padding-bottom: 58px;
  }

  .chapter-header {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
  }

  .chapter-header > .edit-control {
    grid-column: 2;
    justify-self: start;
  }

  .chapter-index {
    width: 44px;
    height: 44px;
  }

  .chapter-title-block h2,
  .mindmap-heading h2 {
    font-size: 26px;
  }

  .prototype-region {
    margin-right: -4px;
    margin-left: -4px;
    padding: 16px;
  }

  .prototype-workbench {
    grid-template-columns: 1fr;
  }

  .prototype-stage {
    grid-row: 1;
  }

  .prototype-state-index {
    grid-row: 2;
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .prototype-review-notes {
    grid-row: 3;
    grid-column: 1;
    display: block;
  }

  .prototype-callout {
    grid-column: auto;
  }

  .prototype-placeholder {
    padding: 24px;
  }

  .prototype-placeholder p {
    font-size: var(--text-xs);
  }

  .rule-list,
  .scenario-grid,
  .decision-review-form {
    grid-template-columns: 1fr;
  }

  .journey-steps {
    grid-template-columns: 1fr;
  }

  .journey-steps li {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .journey-steps li:last-child {
    border-bottom: 0;
  }

  .state-lane {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .state-lane > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .confirmed-decision {
    grid-template-columns: 1fr;
  }

  .confirmed-decision > .edit-control {
    justify-self: start;
  }

  .evidence-item dl > div,
  .source-detail dl > div,
  .glossary-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .prototype-lightbox {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .prototype-lightbox-header {
    padding: 8px 10px;
  }

  .prototype-lightbox-header h2 {
    max-width: 42vw;
    font-size: var(--text-sm);
  }

  .prototype-lightbox-tools {
    gap: 4px;
  }

  .prototype-lightbox-tools .icon-button {
    width: 36px;
    height: 36px;
  }

  .prototype-lightbox-body {
    padding: 14px;
  }

  .inline-editor-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .inline-editor-toolbar > div {
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  html {
    scroll-padding-top: 124px;
  }

  .sidebar {
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
    padding: 8px 10px;
  }

  .sidebar-tools {
    display: contents;
  }

  .edit-toggle {
    grid-column: 4;
    position: relative;
    width: 52px;
    min-height: 36px;
    padding: 6px;
    justify-content: center;
  }

  .edit-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }

  .edit-toggle span {
    display: block;
    color: var(--ink-2);
    font-size: 11px;
    white-space: nowrap;
  }

  .edit-toggle:has(input:checked) {
    color: #fff;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
  }

  .edit-toggle:has(input:checked) span {
    color: #fff;
  }

  .sidebar-tools .button,
  .sidebar-tools .save-state {
    display: none;
  }

  .auth-panel {
    grid-column: 3;
  }

  .auth-panel .auth-button {
    display: inline-flex;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .toc a strong {
    max-width: 108px;
  }

  .mindmap-section,
  .chapter {
    scroll-margin-top: 124px;
  }

  .site-header h1 {
    font-size: 29px;
  }

  .title-line,
  .purpose-line,
  .region-heading,
  .prototype-heading,
  .review-decision > header,
  .evidence-item > header,
  .diagram-card > header,
  .boundary-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .title-line,
  .purpose-line {
    display: grid;
  }

  .mindmap-actions .button,
  .mindmap-actions .edit-control {
    flex: 1 1 130px;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }

  .fact {
    min-height: 0;
  }

  .chapter-header {
    grid-template-columns: 1fr;
  }

  .chapter-index {
    width: 40px;
    height: 40px;
  }

  .chapter-header > .edit-control {
    grid-column: auto;
  }

  .chapter-lead,
  .prototype-region {
    padding: 15px;
  }

  .prototype-placeholder {
    padding: 18px;
  }

  .prototype-placeholder strong {
    font-size: var(--text-base);
  }

  .prototype-placeholder p {
    display: none;
  }

  .requirement-statements li {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .disclosure > summary {
    min-height: 64px;
    padding: 12px 13px;
  }

  .disclosure > summary strong {
    font-size: var(--text-base);
  }

  .disclosure-body {
    padding: 4px 12px 16px;
  }

  .scenario-grid {
    padding: 12px;
  }

  .state-lane > div {
    grid-template-columns: 1fr;
  }

  .review-decision,
  .confirmed-decision,
  .evidence-item,
  .diagram-card {
    padding: 14px;
  }

  .decision-option {
    padding: 10px;
  }

  .inline-editor-toolbar {
    top: 58px;
    margin-right: -7px;
    margin-left: -7px;
    padding: 9px;
  }

  .inline-editor-toolbar > div:first-child {
    display: grid;
    gap: 2px;
  }

  .zoom-label {
    min-width: 46px;
    font-size: var(--text-xs);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 场景×分层公式表：章节主路径常显，不折叠 */
.logic-views-region {
  margin: 1.25rem 0 1.75rem;
  padding: 1rem 1.1rem 1.25rem;
  border: 1px solid rgba(20, 122, 75, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(232, 244, 237, 0.55), rgba(255, 255, 255, 0.95));
}
.logic-views-region .region-kicker {
  color: #147a4b;
  font-weight: 600;
}
.logic-views-region .logic-view {
  margin-top: 1rem;
}
.logic-views-region .logic-view h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
.logic-views-region .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(23, 33, 29, 0.08);
  background: #fff;
}
.logic-views-region table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.logic-views-region th,
.logic-views-region td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(23, 33, 29, 0.08);
  vertical-align: top;
  text-align: left;
}
.logic-views-region th {
  background: #f4f7f5;
  font-weight: 600;
  white-space: nowrap;
}
.logic-views-region tr:last-child td {
  border-bottom: 0;
}
