:root {
  color-scheme: light;
  --ink: #17323e;
  --muted: #64777f;
  --line: #dce5e8;
  --paper: #fff;
  --bg: #f3f6f7;
  --nav: #102b39;
  --teal: #007f78;
  --mint: #d8f1e8;
  --orange: #bb5a24;
  --mono: ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
  font-family: Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg)
}

* {
  box-sizing: border-box
}

body {
  margin: 0
}

button,input,select {
  font: inherit
}

button,a,input,select {
  touch-action: manipulation
}

button {
  cursor: pointer
}

a {
  color: var(--teal);
  text-decoration: none
}

a:hover {
  text-decoration: underline
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible {
  outline: 3px solid #d58a35;
  outline-offset: 3px
}

button {
  color: inherit
}

button:disabled {
  cursor: default
}

h1,h2,h3,p {
  margin-top: 0
}

button svg {
  pointer-events: none
}

[hidden] {
  display: none!important
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0
}

.skip-link {
  position: fixed;
  left: 20px;
  top: -80px;
  background: #fff;
  padding: 14px;
  z-index: 20
}

.skip-link:focus {
  top: 12px
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 218px;
  background: var(--nav);
  color: #edf5f5;
  display: flex;
  flex-direction: column;
  padding: 30px 18px;
  z-index: 5
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.3px;
  margin: 0 5px 54px
}

.brand:hover {
  text-decoration: none
}

.brand small {
  display: block;
  font-size: 12px;
  letter-spacing: 2.1px;
  color: #92afb7;
  margin-top: 7px
}

.mark {
  width: 37px;
  height: 42px;
  border: 1px solid #5d817f;
  border-radius: 5px;
  background: #193d47;
  display: grid;
  place-items: center;
  color: #9ce0ca;
  font-size: 23px;
  font-family: serif;
  box-shadow: 3px 3px 0 #091e29
}

.rail nav {
  display: grid;
  gap: 6px
}

.rail nav a {
  display: flex;
  gap: 11px;
  align-items: center;
  border-radius: 6px;
  padding: 12px 10px;
  font-size: 14px;
  color: #b8cbd1;
  white-space: nowrap
}

.rail nav a:hover {
  background: #1a3946;
  text-decoration: none;
  color: white
}

.rail nav a[aria-current=page] {
  background: #224951;
  color: #d1f5e8
}

.nav-icon {
  font-size: 22px;
  width: 22px;
  text-align: center;
  line-height: 1
}

.nav-count {
  margin-left: auto;
  color: #92afb7;
  font-size: 14px;
  font-family: var(--mono)
}

.rail-foot {
  margin-top: auto;
  padding: 24px 8px 0;
  font-size: 14px;
  color: #b9cbd0;
  line-height: 1.5
}

.rail-foot p {
  margin-bottom: 5px
}

.rail-foot .rail-caption {
  color: #88a3ad
}

.rail-foot a {
  color: #b9dcd4;
  display: inline-block;
  margin-top: 19px;
  font-size: 14px
}

.rail-foot #source-version {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: #89a4ae;
  margin-top: 14px;
  overflow-wrap: anywhere
}

main {
  margin-left: 218px;
  padding: 34px 32px 0;
  min-height: 100vh
}

#atlas-nav[hidden] ~ main {
  margin-left: 0
}

#toggle-nav {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #b9cbd1;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink)
}

#toggle-nav:hover {
  border-color: var(--teal);
  color: var(--teal)
}

#toggle-nav[aria-expanded=false] .nav-chevron {
  transform: translateX(24px) scaleX(-1)
}

.page-header > div {
  flex: 1;
  min-width: 0
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--line)
}

.eyebrow {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 1.7px;
  color: var(--teal);
  margin-bottom: 13px
}

.page-header h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -1.2px;
  margin-bottom: 10px;
  font-weight: 650
}

.page-header>div>p:last-child {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0
}

.edition {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 550;
  align-self: flex-start;
  padding-top: 18px;
  white-space: nowrap
}

.edition span {
  font-family: ui-sans-serif,system-ui,sans-serif;
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 6px
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 21px 0
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 500px;
  border: 1px solid #cedbdf;
  border-radius: 6px;
  padding: 10px 13px;
  background: #fff;
  min-width: 130px
}

.search-icon {
  width: 13px;
  height: 13px;
  border: 1.5px solid #6c818a;
  border-radius: 50%;
  position: relative;
  flex: none
}

.search-icon:after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  background: #6c818a;
  transform: rotate(45deg)
}

.search-box input {
  border: 0;
  outline: 0!important;
  width: 100%;
  font-size: 14px;
  background: transparent;
  color: var(--ink);
  min-width: 0
}

.search-box:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px #007f7818
}

.search-box kbd {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
  color: #7e9198;
  font-size: 14px
}

.filter {
  position: relative
}

.filter:after {
  content: "";
  width: 6px;
  height: 6px;
  border-bottom: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
  position: absolute;
  right: 14px;
  top: 15px;
  pointer-events: none
}

.filter select {
  appearance: none;
  border: 1px solid #cedbdf;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  padding: 11px 32px 11px 12px;
  max-width: 210px
}

.toolbar>span {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0,1fr) 340px;
  gap: 22px;
  align-items: start
}

.explorer {
  min-width: 0
}

.inspector {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  position: sticky;
  top: 22px;
  overflow: hidden;
  min-width: 0
}

.inspect-head {
  padding: 24px 23px 21px;
  background: #fff;
  border-bottom: 1px solid var(--line)
}

.inspect-head .eyebrow {
  margin-bottom: 12px;
  font-size: 12px
}

.inspect-head h2 {
  font-size: 21px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.5px;
  margin-bottom: 8px;
  overflow-wrap: anywhere
}

.inspect-name {
  font-size: 14px;
  font-family: var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.6;
  display: block
}

.inspect-body {
  padding: 22px 23px;
  font-size: 16px;
  line-height: 1.65
}

.inspect-body>p {
  margin-bottom: 22px
}

.inspect-body h3 {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 25px 0 11px
}

.inspect-body h3:first-child {
  margin-top: 0
}

.inspect-body ul {
  padding-left: 18px;
  margin: 0 0 20px
}

.inspect-body li {
  margin-bottom: 9px
}

.detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px
}

.detail-facts div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0
}

.detail-facts dt {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .8px
}

.detail-facts dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  overflow-wrap: anywhere
}

.badge {
  display: inline-block;
  border: 1px solid #c9e5dc;
  color: #1c7060;
  background: #eff9f5;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .3px;
  line-height: 1.4;
  text-transform: uppercase
}

.badge.sideband {
  background: #fff5e8;
  border-color: #eddbbd;
  color: #956324
}

.inspect-head .badge {
  margin-bottom: 13px
}

.source-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 5px 0;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--teal);
  overflow-wrap: anywhere;
  line-height: 1.7
}

.source-link:hover {
  text-decoration: underline
}

.source-role {
  display: block;
  font-family: ui-sans-serif,system-ui,sans-serif;
  font-size: 13px;
  color: var(--muted)
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px
}

.related-link {
  background: #f3f7f7;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 14px;
  text-align: left
}

.related-link:hover {
  background: var(--mint);
  border-color: #92c7b8
}

.formula {
  font-family: var(--mono);
  background: #f3f7f7;
  border-left: 3px solid var(--teal);
  padding: 14px 12px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.8;
  margin: 14px 0 20px
}

.diagram-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden
}

.panel-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line)
}

.panel-caption h2 {
  font-size: 14px;
  font-weight: 650;
  margin: 0
}

.panel-caption span {
  font-size: 13px;
  color: var(--muted)
}

.diagram-scroll {
  overflow: auto;
  background-image: radial-gradient(#d6e1e5 .7px,transparent .7px);
  background-size: 18px 18px
}

.diagram-svg {
  display: block;
  min-width: 800px;
  width: 100%;
  height: auto
}

.graph-edge {
  fill: none;
  stroke: #b9cdd0;
  stroke-width: 1.5;
  transition: opacity .15s
}

.graph-edge.connected {
  stroke: var(--teal);
  stroke-width: 2
}

.graph-edge.dimmed {
  opacity: .22
}

.graph-node {
  cursor: pointer;
  outline: none
}

.graph-node rect {
  fill: white;
  stroke: #bacdd2;
  stroke-width: 1;
  filter: drop-shadow(0px 2px 2px #16303c09)
}

.graph-node:hover rect,.graph-node:focus-visible rect {
  stroke: var(--teal);
  stroke-width: 2
}

.graph-node.selected rect {
  fill: #e8f6f0;
  stroke: var(--teal);
  stroke-width: 2
}

.graph-node.dimmed {
  opacity: .45
}

.graph-node text {
  pointer-events: none
}

.graph-title {
  font-size: 14px;
  font-weight: 650;
  fill: var(--ink)
}

.graph-kind {
  font-size: 12px;
  letter-spacing: .5px;
  fill: #6d8189
}

.graph-accent {
  fill: var(--teal)
}

.diagram-legend {
  padding: 13px 20px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  flex-wrap: wrap
}

.legend-line {
  display: inline-block;
  vertical-align: middle;
  width: 17px;
  height: 2px;
  background: #b9cdd0;
  margin-right: 6px
}

.legend-node {
  display: inline-block;
  vertical-align: middle;
  width: 11px;
  height: 11px;
  border: 1px solid var(--teal);
  background: #e8f6f0;
  margin-right: 6px;
  border-radius: 2px
}

.section-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 13px
}

.section-caption h2 {
  font-size: 14px;
  font-weight: 650;
  margin: 0
}

.section-caption span {
  font-size: 13px;
  color: var(--muted)
}

.component-list {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px
}

.component {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0
}

.component:hover {
  border-color: #86b9ae
}

.component.selected {
  border-color: var(--teal);
  box-shadow: inset 3px 0 var(--teal)
}

.component .kind {
  font-size: 12px;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 1px
}

.component strong {
  font-size: 14px;
  font-weight: 650
}

.component p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0
}

.feature-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden
}

.table-scroll {
  overflow-x: auto
}

/* Output directory and shared consumer lists. */
.output-workspace { display: block }
.output-filters, .output-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 }
.output-filters a, .output-picker a, .output-picker select {
  color: var(--ink); background: white; border: 1px solid #c5d5d6; border-radius: 5px;
  padding: 6px 10px; font-size: 14px; line-height: 1.35;
}
.output-picker select { max-width: 100%; min-width: 0 }
.output-filters a[aria-current] { background: #20555a; border-color: #20555a; color: white }
.output-table {
  width: 100%; margin-bottom: 18px; table-layout: fixed; text-align: left;
  border: 1px solid var(--line); border-spacing: 0; border-radius: 6px; overflow: hidden; background: white;
}
.output-table caption { text-align: left; font-size: 20px; font-weight: 650; margin: 6px 0 }
.output-table caption small { color: var(--muted); font-size: 14px; padding-left: 3px }
.output-table th, .output-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
  overflow-wrap: anywhere; font-size: 14px; line-height: 1.4;
}
.output-table thead th { color: #455e69; background: #f5f8f8; font-size: 13px; font-weight: 600 }
.output-table thead th:first-child { width: 21% }
.output-table thead th:nth-child(2) { width: 28% }
.output-table thead th:nth-child(3) { width: 29% }
.output-table tr:last-child :is(td,th[scope="row"]) { border-bottom: 0 }
.output-table th[scope="row"] { border-left: 3px solid var(--output-color) }
.output-table a { color: var(--output-color); text-decoration: underline; text-underline-offset: 2px }
.output-table th small, .output-table td strong, .output-table td span { display: block }
.output-table th small { margin-top: 2px; color: #53676e; font-size: 12px; font-weight: 400 }
.output-table td strong { font-weight: 550 }
[data-group="Beliefs"] { --output-color: #66416e }
[data-group="Actor"] { --output-color: #845124 }
[data-group="Critic"] { --output-color: #395e84 }
[data-group="Training"] { --output-color: #395b58 }
.belief-uses + a { color: var(--teal) }
.route-destinations, .belief-uses { display: grid; gap: 4px }
.route-destinations.route-inline { display: block }
.route-destinations small, .route-support, .route-empty { color: var(--muted) }
.route-support { display: block; margin-top: 3px }
.belief-uses > div {
  display: grid;
  grid-template-columns: minmax(85px, .8fr) 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.belief-uses dt { color: var(--muted) }
.belief-uses dd { margin: 0 }
@media (max-width: 800px) {
  .output-table { display: block }
  .output-table caption { display: block; padding: 8px 12px; margin: 0 }
  .output-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
  .output-table tbody, .output-table tr { display: block }
  .output-table th[scope="row"] { display: block; padding: 8px 12px; background: #f6f8f8 }
  .output-table th small { display: inline; margin-left: 8px }
  .output-table td { display: block; padding: 6px 12px; border: 0 }
  .output-table td::before { display: block; content: attr(data-label); font-size: 12px; color: var(--muted) }
  .output-table td:last-child { padding-bottom: 12px }
}
.feature-table th {
  text-align: left;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #f8fafb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 650;
  white-space: nowrap
}

.feature-table td {
  padding: 14px 15px;
  border-bottom: 1px solid #edf1f3;
  vertical-align: middle
}

.feature-table tr:last-child td {
  border-bottom: 0
}

.feature-table tbody tr.selected td {
  background: #eef8f4
}

.feature-table tbody tr:hover td {
  background: #f4f9f7
}

.feature-table td:first-child {
  min-width: 220px
}

.feature-table .feature-button {
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  display: block;
  width: 100%;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
  color: var(--ink);
  line-height: 1.6
}

.feature-table .feature-button:after {
  content: "";
  position: absolute;
  inset: 0
}

.feature-table td:first-child {
  position: relative
}

.feature-table .feature-title {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px
}

.feature-table .shape,.feature-table .dtype {
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
  color: #526c76
}

.group-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5
}

.list-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden
}

.entry {
  display: block;
  width: 100%;
  text-align: left;
  padding: 20px 22px;
  background: white;
  border: 0;
  border-bottom: 1px solid var(--line)
}

.entry:last-child {
  border-bottom: 0
}

.entry:hover {
  background: #f7faf9
}

.entry.selected {
  background: #eef8f4;
  box-shadow: inset 3px 0 var(--teal)
}

.entry-head {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: start
}

.entry-title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere
}

.entry-shape {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  padding-top: 3px
}

.entry-description {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.overview-strip {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 18px 20px;
  background: #e8f1f0;
  border: 1px solid #d2e3de;
  border-radius: 7px;
  margin-bottom: 20px
}

.overview-strip div {
  display: flex;
  align-items: baseline;
  gap: 7px
}

.overview-strip strong {
  font-size: 18px;
  font-family: var(--mono);
  font-weight: 500
}

.overview-strip span {
  font-size: 13px;
  color: #4a6a68
}

.empty {
  padding: 45px 25px;
  text-align: center;
  border: 1px dashed #b9cdd0;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7
}

.empty h2 {
  font-size: 18px;
  color: var(--ink)
}

.empty button {
  border: 1px solid #b7d6cd;
  border-radius: 4px;
  color: var(--teal);
  background: white;
  padding: 8px 12px;
  font-size: 14px
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 35px;
  padding: 21px 0;
  font-size: 12px;
  color: #7b8c93;
  border-top: 1px solid var(--line)
}

.loading {
  padding: 45px 0;
  color: var(--muted)
}

dialog {
  border: 1px solid #91b1b6;
  border-radius: 9px;
  padding: 0;
  width: min(1100px,calc(100vw - 40px));
  max-height: 85vh;
  box-shadow: 0 20px 90px #06212b50;
  color: var(--ink)
}

dialog::backdrop {
  background: #0a223699;
  backdrop-filter: blur(3px)
}

dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 25px;
  border-bottom: 1px solid var(--line)
}

dialog header h2 {
  font-size: 16px;
  font-family: var(--mono);
  margin: 0;
  overflow-wrap: anywhere
}

dialog .eyebrow {
  font-size: 12px;
  margin-bottom: 8px
}

dialog header button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px
}

#source-digest {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  padding: 12px 25px;
  margin: 0;
  overflow-wrap: anywhere
}

#source-code {
  overflow: auto;
  max-height: calc(85vh - 145px);
  background: #f7fafb;
  padding: 12px 0;
  line-height: 1.6;
  font-size: 14px;
  font-family: var(--mono);
  counter-reset: line
}

.code-line {
  display: block;
  white-space: pre;
  padding: 0 24px 0 0;
  min-width: max-content
}

.code-line:before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 58px;
  text-align: right;
  padding-right: 18px;
  color: #91a3ab;
  user-select: none
}

.code-line.highlight {
  background: #d9eee5
}

.source-unavailable {
  padding: 25px;
  font-family: ui-sans-serif,system-ui,sans-serif;
  white-space: normal;
  font-size: 14px
}

@media(min-width:1700px) {
  main {
    padding-left: 48px;
    padding-right: 48px
  }
  .workspace {
    grid-template-columns: minmax(0,1fr) 390px;
    gap: 30px
  }
  .inspect-body {
    font-size: 16px
  }
  .component-list {
    grid-template-columns: repeat(3,minmax(0,1fr))
  }
}

@media(max-width:1250px) {
  .rail {
    width: 190px;
    padding-left: 12px;
    padding-right: 12px
  }
  .brand {
    font-size: 16px;
    gap: 9px
  }
  .rail nav a {
    font-size: 14px;
    gap: 7px
  }
  main {
    margin-left: 190px;
    padding: 28px 22px 0
  }
  .workspace {
    grid-template-columns: minmax(0,1fr) 295px;
    gap: 16px
  }
  .inspect-head,.inspect-body {
    padding: 20px
  }
  .toolbar {
    gap: 8px
  }
  .toolbar>span {
    display: none
  }
  .filter select {
    max-width: 160px;
    font-size: 14px
  }
  .component-list {
    grid-template-columns: 1fr
  }
  .feature-table th,.feature-table td {
    padding-left: 11px;
    padding-right: 11px
  }
}

@media(max-width:1000px) {
  .workspace {
    grid-template-columns: minmax(0,1fr)
  }
  .inspector {
    position: static;
    margin-top: 6px
  }
  .inspect-body {
    display: block
  }
  .component-list {
    grid-template-columns: repeat(2,minmax(0,1fr))
  }
  .inspector .detail-facts {
    grid-template-columns: repeat(4,minmax(0,1fr))
  }
  .inspect-head h2 {
    font-size: 24px
  }
  .inspect-body {
    font-size: 16px
  }
  .diagram-svg {
    max-height: 650px
  }
  .toolbar>span {
    display: block
  }
  .page-header h1 {
    font-size: 30px
  }
}

@media(max-width:700px) {
  .rail {
    position: static;
    width: 100%;
    padding: 18px 16px 0;
    gap: 0
  }
  .brand {
    margin: 0 0 18px;
    font-size: 16px
  }
  .brand small {
    display: inline;
    margin: 0 0 0 12px;
    font-size: 12px
  }
  .mark {
    width: 28px;
    height: 32px;
    font-size: 19px
  }
  .rail nav {
    display: flex;
    overflow: auto;
    gap: 4px;
    margin: 0 -6px
  }
  .rail nav a {
    padding: 13px 11px;
    font-size: 14px;
    border-radius: 5px 5px 0 0;
    gap: 6px
  }
  .rail nav .nav-icon {
    font-size: 17px;
    width: 17px
  }
  .nav-count {
    display: none
  }
  .rail-foot {
    display: none
  }
  main {
    margin: 0;
    padding: 24px 16px 0
  }
  .page-header {
    padding-bottom: 20px;
    gap: 10px
  }
  .page-header h1 {
    font-size: 29px
  }
  .page-header>div>p:last-child {
    font-size: 14px
  }
  .edition {
    font-size: 18px;
    padding-top: 18px
  }
  .edition span {
    font-size: 12px
  }
  .eyebrow {
    font-size: 12px
  }
  .toolbar {
    flex-wrap: wrap;
    padding: 17px 0;
    gap: 8px
  }
  .search-box {
    max-width: none;
    flex-basis: 100%;
    padding: 11px 12px
  }
  .filter {
    flex: 1
  }
  .filter select {
    width: 100%;
    max-width: none
  }
  .toolbar>span {
    font-size: 13px
  }
  .workspace {
    gap: 16px
  }
  .component-list {
    grid-template-columns: 1fr 1fr;
    gap: 8px
  }
  .component {
    padding: 13px
  }
  .component strong {
    font-size: 14px
  }
  .component p {
    font-size: 13px
  }
  .overview-strip {
    gap: 16px;
    padding: 15px
  }
  .overview-strip strong {
    font-size: 17px
  }
  .overview-strip span {
    font-size: 12px
  }
  .panel-caption {
    padding: 14px
  }
  .panel-caption span {
    font-size: 12px
  }
  .diagram-legend {
    padding: 11px 14px;
    font-size: 12px;
    gap: 12px
  }
  .page-footer {
    font-size: 12px;
    flex-direction: column;
    gap: 6px
  }
  .feature-table td:first-child {
    min-width: 210px
  }
  .feature-table td {
    padding-top: 13px;
    padding-bottom: 13px
  }
  .feature-table th:last-child,.feature-table td:last-child {
    display: none
  }
  .inspector .detail-facts {
    grid-template-columns: 1fr 1fr
  }
  .entry {
    padding: 18px
  }
  .entry-title {
    font-size: 14px
  }
  .entry-head {
    gap: 12px
  }
  dialog {
    width: calc(100vw - 20px)
  }
  dialog header {
    padding: 18px
  }
  dialog header h2 {
    font-size: 14px
  }
  .code-line {
    font-size: 13px
  }
  .code-line:before {
    width: 42px;
    padding-right: 12px
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto!important;
    transition: none!important
  }
}

.reference-list {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.reference-item {
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

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

.reference-item summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.reference-item > p, .symbol p {
  font-size: 16px;
  line-height: 1.7;
  margin: 16px 0 10px;
}

.module summary > span:first-child, .symbol code {
  font-family: var(--mono);
  font-size: 14px;
}

.module-count {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  padding-left: 16px;
}

.symbol {
  margin-top: 12px;
  padding: 12px 0 4px 12px;
  border-top: 1px solid var(--line);
}

.symbol-kind {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-right: 8px;
}

.symbol h3 {
  font-size: 13px;
  margin: 16px 0 12px;
}

.layer-code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 12px;
  background: #f2f6f7;
  border-radius: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.back-results {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--teal);
}

@media (max-width: 1000px) {
  .back-results {
    display: inline-block;
  }
}

.topic-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.topic-button, .gradient-controls button {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.topic-button.selected, .gradient-controls button[aria-pressed="true"] {
  border-color: var(--teal);
  background: #e8f6f0;
  color: #006c60;
}

.mathematical-topic {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.topic-header {
  padding: 25px;
  border-bottom: 1px solid var(--line);
}

.topic-header h2, .gradient-intro h2 {
  font-size: 24px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -.5px;
  margin-bottom: 13px;
}

.topic-header p:last-child, .gradient-intro p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 0;
}

.equation {
  padding: 22px 25px;
  border-bottom: 1px solid var(--line);
}

.equation:last-child {
  border-bottom: 0;
}

.equation h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

.math-display {
  overflow-x: auto;
  padding: 26px 6px;
  max-width: 100%;
  font-size: 21px;
}

.math-display math {
  min-width: max-content;
  margin: 0 auto;
}






.symbol-definitions {
  margin: 0;
}

.symbol-definitions > div {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.symbol-definitions > div:first-child {
  padding-top: 0;
}

.symbol-definitions > div:last-child {
  border-bottom: 0;
}

.symbol-definitions dt {
  font-size: 18px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.symbol-definitions dt code {
  font-size: 14px;
}

.symbol-definitions dd {
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

.gradient-intro {
  margin: 0 0 22px;
}

.gradient-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.gradient-svg {
  display: block;
  min-width: 800px;
  max-width: none;
}

.gradient-edge {
  fill: none;
  stroke-width: 2;
}

.gradient-edge.forward {
  stroke: #526d80;
  stroke-dasharray: 7 4;
}

.gradient-edge.backward {
  stroke: #007f78;
  stroke-width: 3;
}

.gradient-edge.stop {
  stroke: #bb5a24;
  stroke-width: 2.5;
  stroke-dasharray: 2 5;
}

.gradient-edge.dimmed {
  opacity: .14;
}

.gradient-node {
  cursor: pointer;
}

.gradient-node rect {
  fill: white;
  stroke: #93aab3;
  stroke-width: 1.5;
}

.gradient-node.trainable rect {
  fill: #eaf7f0;
  stroke: #408e76;
}

.gradient-node.frozen rect {
  fill: #edf0f3;
  stroke-dasharray: 6 4;
}

.gradient-node.target rect {
  fill: #fbf4e8;
  stroke: #be9e63;
}

.gradient-node.objective rect {
  fill: #193f4d;
  stroke: #193f4d;
}

.gradient-node.objective text {
  fill: #fff;
}

.gradient-node.deterministic rect, .gradient-node.operation rect {
  fill: #f0f6fb;
  stroke: #6a92aa;
}

.gradient-node.selected rect, .gradient-node:hover rect, .gradient-node:focus-visible rect {
  stroke: #bc7b21;
  stroke-width: 3;
}

.gradient-node.dimmed {
  opacity: .4;
}

.gradient-node-status {
  font-size: 12px;
  fill: #526d76;
  letter-spacing: .5px;
}

.gradient-node-title {
  font-size: 14px;
  font-weight: 600;
  fill: var(--ink);
}

.gradient-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
}

.gradient-line {
  display: inline-block;
  width: 24px;
  vertical-align: middle;
  margin-right: 8px;
}

.gradient-line.forward {
  border-top: 2px dashed #526d80;
}

.gradient-line.backward {
  border-top: 3px solid #007f78;
}

.gradient-line.stop {
  border-top: 2px dotted #bb5a24;
  position: relative;
}

.gradient-line.stop::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 10px;
  right: 0;
  top: -6px;
  background: #bb5a24;
}

.graph-note {
  margin: 15px 0 22px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.gradient-status, .edge-kind {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid #d5e0e4;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.5;
  background: #f3f7f8;
  color: #526d80;
}

.gradient-status.trainable, .edge-kind.backward {
  background: #eaf7f0;
  border-color: #bddccc;
  color: #087963;
}

.gradient-status.target, .edge-kind.stop {
  background: #fcf2e7;
  border-color: #ebd5ba;
  color: #a34f1d;
}

.gradient-status.frozen {
  border-style: dashed;
}

.gradient-status.objective {
  background: #193f4d;
  color: #fff;
}

.edge-details {
  list-style: none;
  padding: 0 !important;
}

.edge-details li {
  padding: 9px 0;
}

.edge-details .edge-kind {
  display: table;
  margin-bottom: 8px;
}

.connection-reference {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.connection-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.connection-list li {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.connection-list li:last-child {
  border-bottom: 0;
}

.connection-list strong {
  display: block;
  font-size: 14px;
  margin: 10px 0 5px;
  line-height: 1.6;
}

.connection-list p {
  font-size: 16px;
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 700px) {
  .topic-header, .equation {
    padding: 20px 17px;
  }
  .math-display {
    font-size: 19px;
  }
  .topic-header h2, .gradient-intro h2 {
    font-size: 22px;
  }
  .topic-button, .gradient-controls button {
    padding: 9px 11px;
  }
}

.gradient-node.disconnected rect {
  fill: #f6f7f8;
  stroke: #8e9fa7;
  stroke-dasharray: 3 4;
}

.gradient-status.disconnected {
  border-style: dotted;
  background: #f4f5f6;
}

.gradient-status.deterministic, .gradient-status.operation {
  background: #f0f6fb;
  border-color: #adc6d5;
  color: #416d85;
}

.gradient-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.gradient-workspace .inspector {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  position: static;
}

.gradient-workspace .inspect-head {
  border-bottom: 0;
  border-right: 1px solid var(--line);
}

.gradient-workspace .inspect-body {
  max-width: 900px;
}

.back-topics {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 12px;
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--teal);
}

@media (max-width: 1000px) {
  .back-topics {
    display: inline-block;
  }
  .gradient-workspace .inspector {
    display: block;
  }
  .gradient-workspace .inspect-head {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

.block-inventory {
  display: grid;
  gap: 18px;
}

.block-group {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  overflow: hidden;
}

.block-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
}

.block-group > header button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--teal);
  text-align: left;
}

.block-group > header span {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.block-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.block-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 15px;
  min-width: 0;
}

.block-card:hover {
  border-color: #86b9ae;
}

.block-card.selected {
  border-color: var(--teal);
  box-shadow: inset 3px 0 var(--teal);
  background: #f3faf7;
}

.block-kind {
  font-size: 12px;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.block-card strong {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.block-summary {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.block-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 4px;
}

.block-operations {
  list-style: none;
  padding: 0 !important;
  margin: 0;
}

.block-operations > li {
  margin: 0;
  border-top: 1px solid var(--line);
}

.block-operation > summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  padding: 15px 0;
  overflow-wrap: anywhere;
}

.operator-index {
  font-family: var(--mono);
  color: var(--teal);
  font-size: 13px;
  font-weight: 400;
  margin-right: 8px;
}

.block-operation p {
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 17px;
}

.block-operation h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  margin: 18px 0 9px;
}

.block-operation ul {
  padding-left: 17px;
  font-size: 14px;
  line-height: 1.7;
}

.operation-link {
  display: inline-block;
  font-size: 13px;
  margin: 9px 0 18px;
}

@media (max-width: 1250px) {
  .block-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 701px) and (max-width: 1000px) {
  .block-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.architecture-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.architecture-workspace .explorer {
  display: contents;
}

.architecture-workspace #overview {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.architecture-workspace .inspector {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  position: static;
}

.architecture-workspace .inspect-head {
  border-bottom: 0;
  border-right: 1px solid var(--line);
}

.architecture-workspace .inspect-body {
  max-width: 900px;
}

.architecture-workspace #results {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
}

.block-diagram .panel-caption {
  flex-wrap: wrap;
}

.block-diagram .panel-caption > div:first-child > span {
  display: block;
  margin-top: 7px;
  font-size: 13px;
}

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

.diagram-tools button {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 14px;
  background: white;
  min-width: 33px;
}

.diagram-tools button:hover {
  background: #eaf6f0;
  border-color: #8dbfaf;
}

.diagram-tools output {
  min-width: 42px;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
  text-align: right;
}

.block-diagram-viewport {
  overflow: auto;
  max-height: 660px;
  background: #fff;
  scrollbar-color: #8babae #edf3f4;
}

.block-diagram-svg {
  display: block;
  max-width: none;
  flex: none;
}

.block-lane > rect {
  fill: #f7fafb;
  stroke: #e0e9eb;
}

.block-lane-title {
  font-size: 14px;
  font-weight: 600;
  fill: #17323e;
}

.block-lane-count {
  font-size: 12px;
  fill: #64777f;
}

.block-edge {
  stroke: #78949c;
  opacity: .55;
  stroke-width: 1.5;
}

.block-edge.connected {
  stroke: #007f78;
  opacity: 1;
  stroke-width: 2.5;
}

.block-edge.dimmed {
  opacity: .1;
}

.block-edge.residual {
  stroke: #b86e28;
  stroke-dasharray: 5 3;
}

.block-graph-node .graph-kind {
  font-size: 12px;
}

.block-graph-node .graph-title {
  font-size: 14px;
}

.graph-size {
  fill: #315a59;
  font: 600 12px var(--mono);
}

.map-head-node .graph-size {
  font-size: 11px;
}

.stack-toggle {
  cursor: pointer;
}

.stack-toggle .stack-sheet {
  fill: #dcebe6;
  stroke: #90aaa0;
}

.stack-toggle .stack-face {
  stroke: #719c8c;
}

.stack-sign, .stack-heading text {
  fill: #356457;
  font-weight: 650;
}

.stack-heading rect {
  fill: #e6f0eb;
  stroke: #cbdcd3;
}

.stack-toggle:hover rect, .stack-toggle:focus-visible rect {
  stroke: var(--teal);
  stroke-width: 2;
}

.legend-line.residual {
  height: 0;
  background: transparent;
  border-top: 2px dashed #b86e28;
}

.architecture-index {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 13px;
  background: white;
}

.architecture-index .component-list {
  margin-top: 20px;
}

@media (max-width: 1000px) {
  .architecture-workspace .inspector {
    display: block;
  }
  .architecture-workspace .inspect-head {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .block-diagram-viewport {
    max-height: 540px;
  }
}

/* The architecture route is a spatial canvas; other reference routes retain
   the document layout. Pan offsets and zoom live in app.js across selections. */
.map-page {
  padding-top: 20px;
  padding-bottom: 0;
}

.map-page .page-header {
  padding-bottom: 15px;
  border-bottom: 0;
}

.map-page .page-header h1 {
  font-size: 28px;
  margin-bottom: 0;
}

.map-page #page-description, .map-page .page-footer {
  display: none;
}

.map-page .page-header .eyebrow {
  margin-bottom: 8px;
}

.map-page .edition {
  padding-top: 0;
}

.map-page .architecture-workspace {
  position: relative;
  display: block;
}

.map-panel {
  position: relative;
  border-color: #c8d8d1;
}

.map-panel .block-diagram-viewport {
  height: 100%;
  max-height: none;
  overflow: auto;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background-color: #edf2ef;
  background-image: radial-gradient(#c9d6d0 .8px, transparent .8px);
  background-size: 22px 22px;
}

.map-panel .block-diagram-viewport::-webkit-scrollbar {
  display: none;
}

.map-panel .block-diagram-viewport.dragging {
  cursor: grabbing;
  user-select: none;
}

.map-panel .block-diagram-viewport.dragging .graph-node {
  cursor: grabbing;
}

.map-world {
  width: max-content;
  padding: 600px;
}

.map-region > rect {
  fill: #f8fbf9;
  stroke: #cbdcd3;
  stroke-width: 1.5;
}

.map-region .block-lane-title {
  fill: #4f6e62;
  font-size: 16px;
  letter-spacing: .1px;
}

.map-toolbar-slot {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 420px;
  max-width: calc(100% - 110px);
  z-index: 7;
}

.map-toolbar-slot .toolbar {
  display: block;
  padding: 0;
}

.map-toolbar-slot .toolbar > span {
  display: none;
}

.map-toolbar-slot .search-box {
  width: 100%;
  max-width: none;
  background: white;
  padding: 15px;
  border-color: #c4d4cf;
  border-radius: 8px;
  box-shadow: 0 3px 14px #18392c20;
}

.map-toolbar-slot .search-box input {
  font-size: 15px;
}

.map-panel .diagram-tools {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: white;
  border: 1px solid #c4d4cf;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 3px 12px #18392c20;
}

.map-panel .diagram-tools button {
  width: 52px;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 14px;
}

.map-panel .diagram-tools button:first-child,
.map-panel .diagram-tools button:nth-child(2) {
  font-size: 23px;
}

.map-panel .diagram-tools output {
  text-align: center;
  font-size: 12px;
  padding: 8px 4px;
}

.map-caption {
  position: absolute;
  z-index: 3;
  left: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffffeb;
  border: 1px solid #d1ded7;
  border-radius: 5px;
  padding: 8px 11px;
  font-size: 12px;
  color: #547166;
  box-shadow: 0 2px 8px #18392c10;
}

.map-caption button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--teal);
  font-size: 14px;
}

.map-page .architecture-workspace .inspector,
.map-page .architecture-workspace #results {
  position: absolute;
  display: block;
  left: 18px;
  top: 83px;
  bottom: 22px;
  width: 420px;
  max-width: calc(100% - 110px);
  overflow: auto;
  z-index: 6;
  background: white;
  border: 1px solid #ccdcd4;
  border-radius: 8px;
  box-shadow: 0 5px 25px #173d2c25;
  overscroll-behavior: contain;
}

.map-page .architecture-workspace #results {
  padding: 22px 18px;
}

.map-page .architecture-workspace .inspect-head {
  border-right: 0;
  border-bottom: 1px solid var(--line);
  padding-right: 55px;
}

.map-page .architecture-workspace .back-results {
  display: none;
}

.map-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
  z-index: 2;
}

.map-result-heading {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.map-search-result {
  display: block;
  width: 100%;
  padding: 16px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.map-search-result:hover {
  background: #f0f8f3;
}

.map-search-result strong {
  display: block;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 7px;
}

.map-search-result span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.map-no-results {
  font-size: 16px;
  margin: 16px 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .map-page {
    padding: 14px 10px 0;
  }
  .map-page .page-header {
    padding: 0 5px 14px;
  }
  .map-page .page-header h1 {
    font-size: 25px;
  }
  .map-page .page-header .eyebrow {
    display: none;
  }
  .map-toolbar-slot {
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    max-width: none;
  }
  .map-toolbar-slot .search-box {
    padding: 13px;
  }
  .map-page .architecture-workspace .inspector {
    top: auto;
    bottom: 12px;
    left: 12px;
    width: calc(100% - 24px);
    max-width: none;
    max-height: 48%;
  }
  .map-page .architecture-workspace #results {
    top: 72px;
    bottom: 12px;
    left: 12px;
    width: calc(100% - 24px);
    max-width: none;
  }
  .map-panel .diagram-tools {
    right: 12px;
    bottom: 12px;
  }
  .architecture-workspace:has(.inspector:not([hidden])) .diagram-tools {
    bottom: calc(48% + 24px);
  }
  .map-panel .diagram-tools button {
    min-height: 36px;
    width: 44px;
  }
  .map-caption {
    left: 12px;
    bottom: 12px;
    gap: 8px;
    font-size: 12px;
  }
  .map-caption button {
    font-size: 13px;
  }
}

/* Allocate the map from the actual header/navigation height, including mobile
   wrapping, instead of subtracting an assumed pixel height from the viewport. */
body:has(.map-page) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

main.map-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 12px;
}

.map-page .page-header {
  flex: 0 0 auto;
}

.map-page .architecture-workspace {
  flex: 1 1 auto;
  min-height: 0;
}

.map-page .architecture-workspace #overview {
  height: 100%;
  min-height: 0;
}

.map-page .map-panel {
  height: 100%;
  min-height: 0;
}

@media (max-width: 700px) {
  body:has(.map-page) > .rail {
    flex: 0 0 auto;
  }
  main.map-page {
    height: auto;
    flex: 1 1 auto;
    padding-bottom: 10px;
  }
}

/* Map layers retain the same spatial graph while exposing autodiff boundaries. */
.map-phase-controls {
  position: absolute;
  z-index: 8;
  top: 77px;
  left: 18px;
  display: flex;
  padding: 4px;
  gap: 3px;
  border: 1px solid #ccdcd4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 14px #173d2c18;
}

.map-phase-controls button {
  padding: 9px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 14px;
  white-space: nowrap;
}

.map-phase-controls button[aria-pressed="true"] {
  background: #007f78;
  color: #fff;
}

.map-page .architecture-workspace .inspector,
.map-page .architecture-workspace #results {
  top: 132px;
}

.map-layer-legend {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  max-width: 290px;
  padding: 12px;
  border-radius: 7px;
  background: #ffffffed;
  color: var(--muted);
  font-size: 13px;
}

.map-layer-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-gradient-active .block-edge {
  opacity: .13;
}

.map-gradient-edge.backward {
  stroke: #007f78;
  stroke-width: 2.5;
  stroke-dasharray: none;
}

.map-gradient-edge.stop {
  stroke: #bb5a24;
  stroke-width: 2.5;
  stroke-dasharray: 5 4;
}

.map-gradient-edge.dimmed {
  opacity: .22;
}

.phase-status-trainable rect {
  fill: #e8f7ee;
  stroke: #348361;
}

.phase-status-partial rect {
  fill: #fff4da;
  stroke: #ac751b;
  stroke-dasharray: 8 3;
}

.phase-status-frozen rect,
.phase-status-disconnected rect {
  fill: #f1f3f4;
  stroke: #8c969e;
  stroke-dasharray: 4 3;
}

.phase-status-objective rect {
  fill: #173247;
  stroke: #173247;
}

.phase-status-objective .graph-kind,
.phase-status-objective .graph-title,
.phase-status-objective .graph-size {
  fill: #fff;
}

.block-graph-node.phase-status-objective.selected .graph-kind,
.block-graph-node.phase-status-objective.selected .graph-title,
.block-graph-node.phase-status-objective.selected .graph-size {
  fill: #173247;
}


.description-equations {
  margin-top: 24px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.description-equation h4 {
  margin-bottom: 8px;
  font-size: 14px;
}

.description-equation .math-display {
  padding: 16px 8px;
  font-size: 18px;
}

.equation-symbols summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 14px;
  padding: 12px 0;
}

@media (max-width: 700px) {
  .map-phase-controls {
    top: 72px;
    left: 12px;
    right: 12px;
  }
  .map-phase-controls button {
    flex: 1;
    padding: 9px 4px;
    font-size: 13px;
  }
  .map-layer-legend {
    top: 124px;
    left: 12px;
    right: auto;
    gap: 6px 12px;
    padding: 7px 10px;
  }
  .map-page .architecture-workspace .inspector {
    top: auto;
  }
  .map-page .architecture-workspace #results {
    top: 124px;
  }
}

.phase-status-deterministic rect {
  fill: #edf5fb;
  stroke: #6a92aa;
}

.phase-status-target rect {
  fill: #faf5eb;
  stroke: #a79570;
}

.gradient-status.partial {
  background: #fff4da;
  color: #805710;
  border: 1px dashed #ac751b;
}

.block-graph-node.selected rect {
  stroke: #007f78;
  stroke-width: 3.5;
}

.gradient-edge-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }
.gradient-path-item:focus-visible { outline: none; }
.gradient-path-item:focus-visible .map-gradient-edge, .map-gradient-edge.selected-gradient { stroke: #b02c8d; stroke-width: 5; opacity: 1; }
.gradient-path-item:hover .map-gradient-edge { stroke-width: 5; opacity: 1; }

.map-gradient-node { cursor: pointer; outline: none; }
.map-gradient-node rect { fill: #e6fff7; stroke: #007f78; stroke-width: 1.5; }
.map-gradient-node.stop rect { fill: #fff1e5; stroke: #b75d25; stroke-dasharray: 4 2; }
.map-gradient-node text { pointer-events: none; fill: #175b55; }
.map-gradient-node.stop text { fill: #8a461b; }
.gradient-item-kind { font: 700 10px system-ui, sans-serif; letter-spacing: .8px; }
.gradient-item-target { font: 600 11px system-ui, sans-serif; }
.map-gradient-node:hover rect, .map-gradient-node:focus-visible rect, .map-gradient-node.selected rect { stroke: #b02c8d; stroke-width: 3; fill: #fff0fb; }

.map-head-node rect { fill: #f1f0ff; stroke: #6965a0; stroke-width: 1.4; }
.map-head-node text { fill: #494275; pointer-events: none; }
.map-head-node.selected rect, .map-head-node:hover rect, .map-head-node:focus-visible rect { stroke: #9b348d; stroke-width: 3; fill: #fff0fb; }
.belief-head-frame { fill: #563962; stroke: #402748; stroke-width: 1.5; }
.belief-head-heading { fill: #fff; font: 700 15px system-ui, sans-serif; }
.head-block .graph-title { font: 650 14px system-ui, sans-serif; }
.head-block .graph-kind { font: 650 10px system-ui, sans-serif; letter-spacing: .55px; }
.head-block .graph-size { font: 12px var(--mono); }
.belief-head-row rect { fill: #705077; stroke: #b99fbb; stroke-width: 1; }
.belief-head-row .graph-title { fill: #fff; }
.belief-head-row .graph-size { fill: #fae9ff; }
.belief-head-row:is(:hover, :focus-visible, .selected) rect {
  fill: #87598c;
  stroke: #fff1ff;
  stroke-width: 3;
}
.band-outputs text { fill: #3e536d; font: 600 15px system-ui, sans-serif; text-decoration: underline; }
.graph-output-count { fill: #51436f; font: 600 11px system-ui, sans-serif; }
.head-contract dd { overflow-wrap: anywhere; }
.head-inputs { list-style: none; margin: 0; padding: 0; }
.head-inputs li { padding: 9px 0; border-bottom: 1px solid #dbe3e3; font-size: 13px; line-height: 1.45; }
.head-inputs strong { display: block; font-size: 14px; }
.head-inputs .input-route { margin: 2px 0 4px; }
.head-inputs details { margin-top: 5px; }
.head-inputs summary { cursor: pointer; }
.head-inputs .source-link { font-size: 12px; padding-bottom: 0; }
.block-diagram-svg .head-input[data-proximity="default"] { stroke-width: 2; }
.block-diagram-svg .head-input-belief[data-proximity="default"] { stroke: #76547e; }
.block-diagram-svg .head-input-actor[data-proximity="default"] { stroke: #956b42; }
.block-diagram-svg .head-input-critic[data-proximity="default"] { stroke: #537897; }
.gradient-status.shared { background: #eeecff; color: #494275; }

/* Operator identity remains visible alongside phase status and selection. */
.operator-convolution { --operator-fill: #fff0d9; --operator-stroke: #b77520; }
.operator-attention { --operator-fill: #d9f1f8; --operator-stroke: #267b99; }
.block-graph-node.operator-convolution rect,
.block-graph-node.operator-attention rect {
  fill: var(--operator-fill);
  stroke: var(--operator-stroke);
}
.block-graph-node.operator-convolution .stack-sheet,
.block-graph-node.operator-attention .stack-sheet {
  filter: brightness(.93);
}
.block-graph-node.selected rect { stroke-width: 3.5; }
.operator-legend { display: inline-flex; align-items: center; gap: 5px; }
.operator-legend i { width: 10px; height: 10px; border: 1px solid; border-radius: 2px; }
.conv-key { background: #fff0d9; border-color: #b77520; }
.attention-key { background: #d9f1f8; border-color: #267b99; }

.block-edge.sink-path { stroke: #c14666; opacity: 1; stroke-width: 2.5; }

.root-key { background: #007f78; border-color: #007f78; }
.sink-key { background: #c14666; border-color: #c14666; }
.map-caption { flex-wrap: wrap; max-width: calc(100% - 85px); }

.block-diagram-svg .graph-edge[data-proximity] { stroke-linejoin: round; }
.block-diagram-svg .graph-edge[data-proximity="direct"] { stroke-width: 4.5; opacity: 1; }
.block-diagram-svg .graph-edge[data-proximity="near"] { stroke-width: 3; opacity: .78; }
.block-diagram-svg .graph-edge[data-proximity="distant"] { stroke-width: 1.7; opacity: .48; }
.block-diagram-svg .graph-edge[data-proximity="unrelated"] { stroke-width: 1; opacity: .1; }
.map-gradient-active .block-edge[data-proximity] { opacity: .16; }
.block-diagram-svg .graph-edge[data-proximity="selected"],
.block-diagram-svg .gradient-path-item:is(:hover, :focus-visible) .map-gradient-edge { stroke-width: 5.5; opacity: 1; }

/* Section navigation stays outside the pannable drawing. */
.map-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 14px;
  align-items: center;
}
.map-navigation a {
  padding: 5px 10px;
  border-radius: 5px;
  color: #34545d;
  font-size: 14px;
}
.map-navigation a[aria-current], .map-navigation a:hover {
  background: #e0ede9;
  color: #164e46;
}
.overview-workspace { display: block }
.architecture-overview { max-width: 1180px }
.overview-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.overview-card {
  --accent: #507482;
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(16px, 2.1vw, 28px);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, white);
  border-top: 5px solid var(--accent);
  border-radius: 9px;
  background: #fff;
}
.overview-card > p { color: var(--accent); font-size: 13px; font-weight: 650; margin-bottom: 9px }
.overview-card h2 { margin: 0 0 13px; font-size: clamp(20px, 2vw, 28px); line-height: 1.12; letter-spacing: -.03em }
.overview-card h2 a { color: #193846 }
.overview-board, .band-board { --accent: #287660 }
.overview-belief, .band-belief { --accent: #805277 }
.overview-actor, .band-actor { --accent: #a05b24 }
.overview-critic, .band-critic { --accent: #3e659b }
.overview-belief { background-color: #faf6fa }
.overview-actor, .overview-critic { grid-column: span 3 }
.overview-summary, .overview-foot p { line-height: 1.5; color: #405761; font-size: 15px }
.overview-heads { display: flex; flex-wrap: wrap; gap: 4px 9px }
.overview-heads a { color: #713a6a; font-size: 13px; text-decoration: underline; text-underline-offset: 2px }
.overview-action { margin-top: auto; padding-top: 22px; color: var(--accent); font-weight: 650; font-size: 14px }
.overview-foot { display: flex; align-items: center; gap: 28px; justify-content: space-between; padding: 24px 2px }
.overview-foot p { margin: 5px 0 0; max-width: 720px }
.all-blocks { flex: none; font-size: 14px; font-weight: 650 }
.section-band > rect { fill: color-mix(in srgb, var(--accent, #547585) 5%, white); stroke: color-mix(in srgb, var(--accent, #547585) 60%, white); stroke-width: 2 }
.section-band text.block-lane-title { fill: var(--accent, #547585); font-size: 24px; font-weight: 700 }
.graph-node.operator-input rect { fill: #edf4f7; stroke: #517785 }
.map-detail-link { display: inline-block; margin: 4px 0 12px; font-weight: 650 }
.object-link { display: block; overflow-wrap: anywhere; line-height: 1.5; margin: 4px 0 }
.tensor-readers { margin: 16px 0 }
.tensor-readers summary { cursor: pointer; font-weight: 600 }
@media (max-width: 850px) {
  .overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
  .overview-card { grid-column: span 1 }
  .overview-belief { grid-column: span 2 }
  .overview-foot { flex-wrap: wrap; gap: 10px }
}
@media (max-width: 700px) {
  .map-navigation { gap: 1px 2px; margin-bottom: 6px }
  .map-navigation a { padding: 5px 6px; font-size: 12px }
  .overview-card { padding: 13px }
  .overview-summary { font-size: 14px }
}

/* Ownership and section views use the available line width at reading size. */
.overview-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
.overview-card { grid-column: span 2; padding: 16px 20px }
.overview-input { grid-column: 1 / -1 }
.overview-card h2 { font-size: 21px; margin-bottom: 6px }
.overview-action { padding-top: 10px }
.owner-links, .ownership-grid, .section-blocks { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(168px, 100%), 1fr)) }
.owner-links, .overview-heads, .section-blocks { margin-top: 8px }
.input-owner, .section-block, .ownership-card {
  min-width: 0; padding: 9px 12px; border: 1px solid #cfdddf; border-radius: 6px;
  background: #f6f9f9; font-size: 14px; overflow-wrap: anywhere;
}
.input-owner { display: flex; align-items: center; justify-content: space-between; gap: 6px }
.input-owner b, .member-set summary span, .section-owner summary span { font-variant-numeric: tabular-nums; color: #52716c }
.area-detail .overview-card { grid-column: 1 / -1 }
.area-detail .overview-card > h3 { font-size: 16px; margin: 18px 0 6px }
.section-block strong, .section-block small { display: block }
.section-block small { color: #526a72; margin-top: 3px }
.ownership-grid { align-items: start; grid-template-columns: repeat(auto-fit,minmax(min(230px,100%),1fr)); margin-top: 8px }
.ownership-card h3 { margin: 0 0 3px; font-size: 16px }
.owner-count { display: inline-block; margin-bottom: 6px }
.member-set, .section-owner { border-top: 1px solid #d9e2e2; padding: 6px 0; font-size: 14px }
.member-set summary, .section-owner summary, .overview-foot summary { cursor: pointer }
.member-set summary span, .section-owner summary span { margin-left: 5px }
.section-owner .member-set { margin-left: 14px }
.overview-foot { padding: 12px 2px }
.toolbar:has(#owner-filter:not([hidden])) { flex-wrap: wrap }
.toolbar:has(#owner-filter:not([hidden])) .filter { max-width: 100%; min-width: 0 }
.area-detail .overview-belief .overview-heads { background: #563962; border-radius: 5px; padding: 9px 12px }
.area-detail .overview-belief .overview-heads a { color: #fff }

/* Controls, drawing and inspector each occupy their own layout track. */
.map-page .architecture-workspace {
  display: grid; gap: 8px; align-items: stretch;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
}
.map-page .architecture-workspace:has(:is(.inspector, #results):not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(235px, 31%) }
.map-page .architecture-workspace :is(.inspector, #results) {
  position: relative; inset: auto; grid-column: 2; grid-row: 1; width: auto; height: auto; min-height: 0;
  max-width: none; max-height: none; margin: 0; box-shadow: none;
}
.map-page .map-panel {
  display: grid; grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr);
  overflow: hidden;
}
.map-topbar, .map-bottombar { display: flex; gap: 5px 10px; align-items: center; flex-wrap: wrap; padding: 5px 7px; background: white }
.map-topbar { border-bottom: 1px solid var(--line) }
.map-bottombar { grid-row: 3; border-top: 1px solid var(--line); justify-content: space-between }
.map-topbar .map-toolbar-slot { position: static; width: auto; max-width: none; flex: 1 1 130px; min-width: 0 }
.map-topbar .search-box { padding: 5px 9px; box-shadow: none; min-width: 0 }
.map-topbar .map-phase-controls, .map-topbar .map-layer-legend, .map-bottombar .map-caption,
.map-bottombar .diagram-tools { position: static; inset: auto; max-width: none; margin: 0; box-shadow: none }
.map-topbar .map-phase-controls { gap: 1px; padding: 1px }
.map-topbar .map-phase-controls button { padding: 5px 8px; font-size: 13px }
.map-topbar .map-layer-legend, .map-bottombar .map-caption { padding: 0; border: none; gap: 5px 10px }
.map-bottombar .diagram-tools { display: flex; flex-direction: row; gap: 0 }
.map-bottombar .diagram-tools button { width: auto; padding: 3px 7px; min-height: 26px; font-size: 12px; border: 0 }
.map-bottombar .diagram-tools button:nth-child(-n+2) { font-size: 17px }
.map-bottombar .diagram-tools output { min-width: 38px; padding: 6px 4px }
.map-panel .block-diagram-viewport { grid-row: 2; min-height: 0; container-type: size }
.map-world { padding: 50cqh 50cqw }
@media (max-width: 800px) {
  .map-page .architecture-workspace:has(:is(.inspector, #results):not([hidden])) { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) minmax(0,.56fr) }
  .map-page .architecture-workspace :is(.inspector, #results) { grid-column: 1; grid-row: 2 }
}
@media (max-width: 700px) {
  .overview-cards { gap: 8px }
  .overview-card { padding: 11px }
  .overview-card h2 { font-size: 17px }
  .overview-action { font-size: 13px }
  .owner-links { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .input-owner { padding: 5px 7px }
  .map-topbar .map-phase-controls button { font-size: 12px; padding: 4px }
  .map-topbar .map-layer-legend { font-size: 11px }
  .map-bottombar { gap: 3px; padding: 3px 5px }
  .map-bottombar .map-caption { gap: 3px 7px; font-size: 11px }
}
@media (max-height: 500px) and (orientation: landscape) {
  .map-page .architecture-workspace:has(:is(.inspector, #results):not([hidden])) { grid-template-columns: minmax(0,1fr) minmax(170px,31%); grid-template-rows: minmax(0,1fr) }
  .map-page .architecture-workspace :is(.inspector, #results) { grid-column: 2; grid-row: 1 }
  .map-page .page-header .eyebrow { display: none }
}

@media (max-width: 700px) {
  main:has(.overview-workspace) { padding-top: 12px }
  main:has(.overview-workspace) .page-header { align-items: center; padding-bottom: 8px }
  main:has(.overview-workspace) .page-header :is(.eyebrow,.edition,#page-description) { display: none }
  main:has(.overview-workspace) .page-header h1 { font-size: 23px; margin: 0 }
  .overview-card .overview-summary { font-size: 13px; line-height: 1.35 }
  .overview-heads { gap: 2px 7px }
}
@media (max-height: 500px) and (orientation: landscape) {
  body:has(.map-page) > .rail { position: static; width: 100%; height: auto; flex: none; flex-direction: row; align-items: center; padding: 2px 6px; gap: 8px }
  body:has(.map-page) .rail .brand { margin: 0; font-size: 13px }
  body:has(.map-page) .rail :is(.rail-foot,.brand small,.mark,.nav-icon) { display: none }
  body:has(.map-page) .rail nav { display: flex; flex: 1; gap: 1px; margin: 0; overflow: auto }
  body:has(.map-page) .rail nav a { padding: 5px 8px; font-size: 12px }
  main.map-page { flex: 1 1 auto; height: auto; margin-left: 0; padding: 5px 7px }
  .map-page .page-header { padding: 0 0 4px }
  .map-page .page-header h1 { font-size: 19px }
  .map-page .page-header .edition { display: none }
  .map-page #toggle-nav { width: 26px; height: 26px }
  .map-page .map-navigation { margin: 0 0 3px }
  .map-page .map-navigation a { padding: 2px 7px; font-size: 12px }
}

/* Section directories and the focused forward-pass view. */
.architecture-overview { max-width: 1500px }
.overview-card p.overview-summary { margin: 0; font-size: 14px; font-weight: 400; line-height: 1.4; color: #405761 }
.ownership-card h4 { margin: 0 0 4px; font-size: 15px }
.area-detail .board-family h3 { font-size: 18px; margin-top: 18px }
.area-heads .section-block { background: #f8f2f7; border-color: #dac5d6 }

.belief-trace {
  container-type: inline-size; padding: clamp(12px, 2vw, 28px); overflow-wrap: anywhere;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
}
.trace-columns {
  position: relative; display: grid; align-items: center; gap: clamp(30px, 4cqw, 60px);
  grid-template-columns: minmax(0, 1fr) minmax(0, .94fr) minmax(0, 1fr);
}
.trace-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.trace-edge { fill: none; stroke-width: 1.8; stroke-linejoin: round }
.trace-edge.edge-in { stroke: #287974 }
.trace-edge.edge-out { stroke: #955270 }
.trace-inputs, .trace-center, .trace-outputs { position: relative; min-width: 0 }
.trace-inputs > h3, .trace-outputs > h3 { font-size: 17px; margin: 0 0 10px }
.trace-input { margin: 6px 0; border: 1px solid #a9cbc4; border-radius: 6px; background: #f1f8f6 }
.trace-input summary {
  padding: 9px 11px; cursor: pointer; color: #204e4d; font-size: 14px; font-weight: 600;
}
.trace-input summary small {
  display: inline-block; margin-left: 5px; color: #415b63; font-size: 11px; font-weight: normal;
}
.trace-input[open] > :not(summary) { margin: 0 11px 9px }
.trace-input p, .trace-input .trace-links { font-size: 13px; line-height: 1.5 }
.trace-fields code { font-size: 12px; overflow-wrap: anywhere }
.trace-input .source-link { max-width: calc(100% - 22px); white-space: normal; overflow-wrap: anywhere }
.trace-prediction { padding: 17px; border: 1px solid var(--output-color); border-radius: 7px; background: var(--output-color); color: white }
.trace-prediction h2 { color: inherit; font-size: clamp(18px, 2cqw, 26px); line-height: 1.2; margin: 0 0 10px }
.trace-prediction code, .trace-prediction p { color: white; font-size: 13px; line-height: 1.4 }
.trace-prediction code { background: transparent }
.trace-prediction p { margin: 3px 0 13px }
.trace-prediction a { color: white; font-size: 13px; text-decoration: underline; text-underline-offset: 3px }
.trace-consumers h4 { margin: 11px 0 4px; color: #526872; font-size: 13px }
.trace-consumer {
  display: block; margin: 4px 0; padding: 8px 10px; border: 1px solid #d3c3d8; border-radius: 5px;
  background: #f8f4f9; color: #52325e; font-size: 14px; line-height: 1.35;
}
.trace-group-actor .trace-consumer { border-color: #dbc3aa; background: #faf5ed; color: #77481f }
.trace-group-critic .trace-consumer { border-color: #bbcddd; background: #f0f5fa; color: #33577f }
.trace-absent { margin: 0; color: var(--muted); font-size: 13px }
.trace-input summary:focus-visible { outline: 3px solid #d58a35; outline-offset: 2px }
@container (max-width: 670px) {
  .trace-columns { grid-template-columns: minmax(0, 1fr); gap: 6px }
  .trace-wires { display: none }
  .trace-center::before, .trace-outputs::before { content: "↓"; display: block; text-align: center; font-size: 22px; color: #287974 }
  .trace-outputs::before { color: #955270 }
}


.output-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(180px,100%),1fr)); gap: 8px 18px; border-top: 1px solid var(--line); margin: 18px 0 10px; padding: 10px 0 }
.output-facts dt { color: #536770; font-size: 13px; font-weight: 650 }
.output-facts dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere }
.belief-trace > p { color: #40545d; font-size: 14px; line-height: 1.5 }
.output-extra { margin: 8px 0 }
.output-extra summary { cursor: pointer; font-size: 14px; font-weight: 600 }
button.trace-consumer { width: 100%; text-align: left }

.axis-overview { display: grid; gap: 10px; margin-bottom: 16px }
.axis-rows, .hand-axes, .axis-association, .axis-reads { padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0 }
.axis-rows h3, .hand-axes h3, .axis-association h3, .axis-reads h3 { margin: 0 0 5px; color: #254957; font-size: 15px }
.axis-rows p { margin: 6px 0; font-size: 14px; line-height: 1.45 }
.position-example { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; text-align: left }
.position-example caption { padding: 6px 0; text-align: left; color: var(--ink); font-weight: 650 }
.position-example :is(th, td) { padding: 6px 9px; vertical-align: top; border-bottom: 1px solid var(--line) }
.position-example thead { color: #435e65; background: #eff5f4 }
.position-example tbody th { width: 16% }
.position-example tbody td:nth-child(2) { width: 39% }
.position-example strong { color: #155d57 }
.position-axes strong { margin-right: 6px }
.hand-axes header span, .tile-branch, .tile-operator, .hand-join { font-size: 13px }
.hand-axes header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px }
.hand-axes header span, .tile-operator { color: #526872 }
.tile-paths { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; margin: 5px 0 }
.tile-paths > div { display: flex; flex-wrap: wrap; gap: 4px }
.tile-branch { flex: 1; border-radius: 4px; background: #fff4df; border: 1px solid #e1c99f; color: #63481e; padding: 5px 8px; line-height: 1.3 }
.tile-paths > div + div .tile-branch { background: #f1f4f7; color: #344e62; border-color: #c9d7df }
.tile-branch strong, .tile-branch span, .tile-operator { display: block }
.tile-operator { flex-basis: 100% }
.hand-join { font-weight: 600 }
.hand-parameters { margin-top: 8px; color: var(--ink); font-size: 13px }
.hand-parameters summary { cursor: pointer; font-weight: 600 }
.hand-parameters dl { margin: 4px 0 0 }
.hand-parameters dl > div { display: flex; flex-wrap: wrap; gap: 3px 12px; border-top: 1px solid var(--line); padding: 5px 0 }
.hand-parameters dt { flex: 0 1 150px }
.hand-parameters dd { margin: 0; flex: 1 1 190px }
.axis-association, .axis-reads { margin-top: 12px }
.axis-association p, .axis-reads p { color: var(--ink); font-size: 14px; margin: 5px 0; }
.axis-rows { container-type: inline-size }
#inspector .tile-paths, #inspector .hand-axes header { display: block }
#inspector .tile-paths > div { margin-top: 7px }
.axis-member-table { width: 100%; border-collapse: collapse; font-size: 13px }
.axis-member-table :is(th, td) { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere }
.axis-member-table td a { text-decoration: underline; text-underline-offset: 2px }
.shared-inputs .ownership-card { min-width: 0 }
.shared-inputs .ownership-grid { grid-template-columns: repeat(auto-fit,minmax(min(315px,100%),1fr)) }
.axis-row-link { fill: #176965; font: 12px system-ui, sans-serif; text-decoration: underline }
@container (max-width: 585px) {
  .position-example, .position-example caption, .position-example tbody { display: block }
  .position-example thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden }
  .position-example tbody tr { display: block; border-top: 1px solid var(--line); padding: 4px 0 }
  .position-example tbody th, .position-example tbody td:nth-child(2) { width: auto }
  .position-example tbody :is(th, td) { display: block; border: 0; padding: 3px 0 }
  .position-example tbody td { display: grid; grid-template-columns: 76px minmax(0, 1fr); column-gap: 9px }
  .position-example td::before { content: attr(data-label); font-size: 12px; color: #516871 }
}
@media(max-width: 850px) {
  .tile-paths { grid-template-columns: minmax(0,1fr) }
}

.map-links { display: inline-flex; padding: 1px; border: 1px solid var(--line); border-radius: 5px; background: white }
.map-links button { border: 0; border-radius: 3px; padding: 4px 8px; background: transparent; font-size: 12px }
.map-links button[aria-pressed="true"] { background: #dcece9; color: #164c48 }
.map-panel[data-link-scope="nearby"] .block-edge[data-proximity="default"] { opacity: .85; stroke-width: 2.2 }
.map-panel[data-link-scope="nearby"] [data-map-link][data-local="false"] { display: none }
.map-panel[data-link-scope="nearby"] svg[data-preview]:not([data-preview=""]) [data-map-link] { display: none }
.map-panel[data-link-scope="nearby"] svg[data-preview]:not([data-preview=""]) [data-map-link]:is(.preview-input,.preview-output) { display: inline }
.map-panel[data-link-scope="all"] svg[data-preview]:not([data-preview=""]) [data-map-link]:not(.preview-input,.preview-output) { opacity: .09 }
.block-diagram-svg [data-map-link]:is(.preview-input,.preview-output).graph-edge,
.block-diagram-svg [data-map-link]:is(.preview-input,.preview-output) .map-gradient-edge { opacity: 1; stroke-width: 3.8 }
.block-diagram-svg .block-edge.preview-input { stroke: #007f78; marker-end: url(#block-arrow-active) }
.block-diagram-svg .block-edge.preview-output { stroke: #c14666; marker-end: url(#block-arrow-sink) }

.graph-parameters {
  fill: #315a59;
  font: 600 11px var(--mono);
}
