* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --paper: #f7f9fc;
  --rail: #f1f5f9;
  --card: #fff;
  --subtle: #f3f6fa;
  --subtle-2: #edf2f8;
  --hover: #e7edf6;
  --active-bg: #dfe7f4;
  --line: #dde3ec;
  --line-strong: #cbd5e1;
  --line-mid: #b5c3d9;
  --ink: #0f172a;
  --ink-strong: #334155;
  --muted: #526075;
  --muted-soft: #94a3b8;
  --indigo: #1e3a8a;
  --indigo-solid: #1e3a8a;
  --indigo-soft: #edf2fb;
  --indigo-soft-hover: #dce7f8;
  --indigo-border: #bfcfe8;
  --focus: #3b67b8;
  --red: #9f1239;
  --red-text: #b91c1c;
  --red-bg: #fef2f2;
  --green-text: #047857;
  --green-bg: #ecfdf5;
  --amber-text: #b45309;
  --amber-bg: #fffbeb;
  --amber-border: #c88c36;
  --diff-add-bg: #e7f5e9;
  --diff-add-ink: #235539;
  --diff-del-bg: #fae9ea;
  --diff-del-ink: #7b2937;
  --diff-hunk-bg: #edf0f8;
  --backdrop: #0f172a58;
  --drawer-shadow: #0f172a24;
  --blank-grad: linear-gradient(115deg,#fff,#f3f6fb);
  --wf-board: #f1f5fa;
  --wf-node-hover: #f7faff;
  --wf-node-active: #eaf0fc;
  --btn-primary-ink: #fff;
  --zh-display: -apple-system,BlinkMacSystemFont,"SF Pro Display","Inter","Helvetica Neue","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Source Han Sans SC","Microsoft YaHei",sans-serif;
  --serif: "Iowan Old Style","New York",Georgia,"PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Source Han Sans SC","Microsoft YaHei",sans-serif;
  --sans: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter","Helvetica Neue","PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Source Han Sans SC","Microsoft YaHei",sans-serif;
  --mono: "SF Mono",ui-monospace,monospace;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b111b;
  --rail: #0f1623;
  --card: #131c2b;
  --subtle: #172234;
  --subtle-2: #152033;
  --hover: #1c2a40;
  --active-bg: #223450;
  --line: #223046;
  --line-strong: #31435f;
  --line-mid: #374c6b;
  --ink: #e4ecf7;
  --ink-strong: #c7d5e8;
  --muted: #93a5be;
  --muted-soft: #647894;
  --indigo: #7ba4f7;
  --indigo-solid: #2c52a3;
  --indigo-soft: #172742;
  --indigo-soft-hover: #1e3357;
  --indigo-border: #314d7c;
  --focus: #7ba4f7;
  --red: #f07492;
  --red-text: #f4829c;
  --red-bg: #2a151e;
  --green-text: #49c896;
  --green-bg: #112922;
  --amber-text: #eab45a;
  --amber-bg: #292113;
  --amber-border: #b8822e;
  --diff-add-bg: #122920;
  --diff-add-ink: #7adca6;
  --diff-del-bg: #2c161f;
  --diff-del-ink: #f290a6;
  --diff-hunk-bg: #18253a;
  --backdrop: #03071199;
  --drawer-shadow: #00000070;
  --blank-grad: linear-gradient(115deg,#131c2b,#0f1726);
  --wf-board: #0e1522;
  --wf-node-hover: #182438;
  --wf-node-active: #1c2d4a;
  --btn-primary-ink: #f8fafc;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0b111b;
    --rail: #0f1623;
    --card: #131c2b;
    --subtle: #172234;
    --subtle-2: #152033;
    --hover: #1c2a40;
    --active-bg: #223450;
    --line: #223046;
    --line-strong: #31435f;
    --line-mid: #374c6b;
    --ink: #e4ecf7;
    --ink-strong: #c7d5e8;
    --muted: #93a5be;
    --muted-soft: #647894;
    --indigo: #7ba4f7;
    --indigo-solid: #2c52a3;
    --indigo-soft: #172742;
    --indigo-soft-hover: #1e3357;
    --indigo-border: #314d7c;
    --focus: #7ba4f7;
    --red: #f07492;
    --red-text: #f4829c;
    --red-bg: #2a151e;
    --green-text: #49c896;
    --green-bg: #112922;
    --amber-text: #eab45a;
    --amber-bg: #292113;
    --amber-border: #b8822e;
    --diff-add-bg: #122920;
    --diff-add-ink: #7adca6;
    --diff-del-bg: #2c161f;
    --diff-del-ink: #f290a6;
    --diff-hunk-bg: #18253a;
    --backdrop: #03071199;
    --drawer-shadow: #00000070;
    --blank-grad: linear-gradient(115deg,#131c2b,#0f1726);
    --wf-board: #0e1522;
    --wf-node-hover: #182438;
    --wf-node-active: #1c2d4a;
    --btn-primary-ink: #f8fafc;
  }
}

body {
  margin: 0;
}

button,
select,
textarea,
input {
  font: inherit;
}

button,
a,
select,
summary {
  touch-action: manipulation;
}

button,
select,
summary {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: var(--indigo);
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: fixed;
  top: -5rem;
  z-index: 20;
  background: var(--card);
  padding: 12px;
}

.skip:focus {
  top: 0;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 36px 18px 22px;
  z-index: 2;
}

.bookplate {
  padding: 2px 4px 18px;
  border-bottom: 1px solid var(--line-strong);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
  text-decoration: none;
  color: var(--ink);
}
.mark {
  flex: none;
  display: block;
  width: 36px;
  height: auto;
  aspect-ratio: 32 / 30;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.wordmark {
  font: 500 1.06rem/1 var(--zh-display);
  letter-spacing: .28em;
  color: var(--ink);
}
.imprint {
  color: var(--indigo);
  font: 500 .78rem/1 var(--zh-display);
  letter-spacing: .42em;
}
.rubric,
.subtitle,
.colophon dt,
.local {
  text-transform: uppercase;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted);
}
.subtitle {
  margin: 10px 0 0;
  font-size: .58rem;
  letter-spacing: .1em;
  white-space: nowrap;
}
.contents {
  margin: 28px 0;
}
.toc-group + .toc-group {
  margin-top: 26px;
}
.toc-group .rubric {
  margin: 0 0 10px 6px;
}
.contents a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 8px;
  border-left: 2px solid transparent;
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  font-size: .9rem;
  white-space: nowrap;
}
.contents a:hover {
  background: var(--hover);
}
.contents a[aria-current="page"] {
  border-left-color: var(--indigo);
  background: var(--active-bg);
  font-weight: 650;
}
.folio,
.toc-count,
.colophon dd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.folio {
  width: 2ch;
  flex: none;
  color: var(--muted);
  font-size: .72rem;
}
.toc-count {
  margin-left: auto;
  font-size: .72rem;
  color: var(--muted);
}
.colophon {
  margin-top: auto;
  padding: 14px 5px 0;
  border-top: 1px solid var(--line-strong);
  font-size: .76rem;
}
.colophon dl {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 6px 12px;
  margin: 0;
  align-items: baseline;
}
.colophon dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.revision {
  padding: 0;
  border: 0;
  background: none;
  color: var(--indigo);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.edition {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}
.edition-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.languages {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
}
.languages button {
  padding: 5px 9px;
  background: transparent;
  border: 0;
  font-size: .75rem;
  color: var(--muted);
}
.languages button + button {
  border-left: 1px solid var(--line-strong);
}
.languages button[aria-pressed="true"] {
  background: var(--active-bg);
  color: var(--ink);
  font-weight: 700;
}
.languages button:focus-visible {
  outline-offset: -2px;
}
.rail {
  overflow-y: auto;
}
.workspace {
  margin-left: 240px;
}

.bar {
  min-height: 65px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(22px,4vw,64px);
  color: var(--muted);
  font-size: .84rem;
}

.bar b {
  margin: 0 10px;
  color: var(--muted-soft);
}

.bar strong {
  color: var(--ink);
  font-weight: 500;
}

.local {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--card);
  padding: 5px 11px;
  font-size: .76rem;
}

main {
  max-width: 1080px;
  margin: auto;
  padding: 36px clamp(22px,4vw,60px) 65px;
}

.mast {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 185px;
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 0 27px;
  overflow: hidden;
}

.mast-copy {
  position: relative;
  z-index: 1;
  max-width: 65%;
}

.mast canvas {
  width: 39%;
  height: 184px;
  position: absolute;
  right: -1%;
  top: 0;
}

.mast.compact {
  min-height: 0;
  padding: 6px 0 24px;
}

.mast.compact canvas {
  display: none;
}

.mast.compact .mast-copy {
  max-width: 100%;
}

.eyebrow,
.caption {
  font: 600 .73rem/1.5 var(--sans);
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--muted);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--indigo);
}

.eyebrow:before {
  content: "";
  width: 23px;
  height: 1px;
  background: currentColor;
}

.mast h1 {
  font: normal clamp(3rem,5vw,4.65rem)/1.03 var(--serif);
  letter-spacing: -.055em;
  margin: 12px 0;
}

.mast p {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
  color: var(--muted);
  max-width: 480px;
}

h2,
h3,
p {
  overflow-wrap: anywhere;
}

h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.027em;
}

h2 {
  font-size: 1.7rem;
  margin: 0 0 14px;
}

h3 {
  font-size: 1.35rem;
  margin: 0 0 9px;
}

p {
  line-height: 1.55;
  margin: .5em 0;
}

.muted,
.meta {
  color: var(--muted);
}

.meta,
.hint {
  font-size: .82rem;
  line-height: 1.55;
}

.hint {
  color: var(--muted);
}

.mono,
code,
pre,
.ep,
.ident {
  font-family: var(--mono);
}

.mono,
.ident {
  font-size: .79rem;
  overflow-wrap: anywhere;
}

.toolbar,
.chips,
.actions,
.labels,
.switches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar {
  justify-content: space-between;
  margin: 21px 0;
}

.controls {
  margin: 18px 0;
  display: grid;
  gap: 12px;
}

.filter-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-row > .caption {
  min-width: 60px;
}

.btn,
.chip,
.tab,
.ep,
.source,
.close {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 5px;
  padding: .55rem .82rem;
  font-size: .85rem;
  line-height: 1.3;
}

.btn:hover,
.chip:hover,
.source:hover {
  border-color: var(--muted-soft);
  background: var(--subtle);
}

.btn.primary,
.tab.active {
  background: var(--indigo-solid);
  color: var(--btn-primary-ink);
  border-color: var(--indigo-solid);
}

button:disabled {
  opacity: .55;
  cursor: wait;
}

.chip,
.ep {
  border-radius: 30px;
  padding: .32rem .66rem;
}

.chip.active {
  border-color: var(--indigo-border);
  background: var(--indigo-soft);
  color: var(--indigo);
}

.ep,
.ident {
  font-size: .75rem;
  color: var(--indigo);
  background: var(--indigo-soft);
}

.ep {
  padding: .13rem .46rem;
  vertical-align: baseline;
  white-space: nowrap;
  border: 1px solid var(--indigo-border);
}

.ep:hover {
  background: var(--indigo-soft-hover);
}

.ident {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.status {
  display: inline-block;
  border-radius: 20px;
  background: var(--subtle-2);
  color: var(--muted);
  font-size: .76rem;
  padding: .2rem .57rem;
  white-space: nowrap;
}

.active-status,
.validated,
.low {
  background: var(--green-bg);
  color: var(--green-text);
}

.at_risk,
.medium {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.invalidated,
.superseded,
.high {
  background: var(--red-bg);
  color: var(--red-text);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  gap: 12px;
}

.metric {
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  text-align: left;
  padding: 0 0 0 17px;
  color: var(--muted);
  font-size: .82rem;
}

.metric:first-child {
  border: 0;
  padding-left: 0;
}

.metric strong {
  font: 1.9rem/1.15 var(--serif);
  color: var(--ink);
  display: block;
}

.metric:hover strong {
  color: var(--indigo);
}

.card,
.lead,
.blank,
.question,
.drop {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 22px;
  min-width: 0;
}

.lead {
  padding: 26px 29px;
  border-top: 2px solid var(--indigo);
}

.lead .prose {
  font: 1.3rem/1.5 var(--serif);
}

.section {
  margin-top: 26px;
}

.section > h2,
.section-title {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

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

.stack {
  display: grid;
  gap: 12px;
}

.blank {
  padding: 30px;
  background: var(--blank-grad);
}

.blank p {
  color: var(--muted);
  max-width: 55ch;
}

.blank .btn {
  margin-top: 10px;
}

.card .labels {
  margin: 12px 0;
}

.card .actions {
  margin-top: 14px;
}

.card .caption,
.lead .caption {
  margin-bottom: 9px;
}

.card p:first-child,
.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.conflict {
  border-left: 3px solid var(--red-text);
}

.claims {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 16px 0;
}

.question {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
}

.question strong {
  color: var(--indigo);
  font: 1.35rem var(--serif);
}

.question p {
  margin: 0;
}

.error {
  color: var(--red);
}

.notice {
  padding: 12px 15px;
  border-left: 3px solid var(--muted);
  background: var(--rail);
  line-height: 1.5;
}

input[type=search],
textarea,
select {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--card);
  color: var(--ink);
  padding: 10px;
  font-size: .92rem;
}

input[type=search],
textarea {
  width: 100%;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.5;
}

label {
  font-size: .89rem;
}

select {
  max-width: 100%;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 5px;
  margin: 22px 0;
}

.tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 12px;
  font-size: .9rem;
}

.tabs button.active {
  color: var(--indigo);
  border-color: var(--indigo);
  font-weight: 600;
}

.mode {
  margin: 18px 0;
  display: inline-flex;
  background: var(--subtle-2);
  padding: 4px;
  border-radius: 7px;
  gap: 4px;
}

.tab {
  background: none;
  border: 0;
}

.red .tab.active,
.red .btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--btn-primary-ink);
}

.red .eyebrow,
.red h2 {
  color: var(--red);
}

.form {
  display: grid;
  gap: 14px;
}

.form .toolbar {
  margin: 0;
}

.source {
  display: block;
  text-align: left;
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 5px 0;
  color: var(--indigo);
}

.drop {
  display: block;
  width: 100%;
  border: 1px dashed var(--muted-soft);
  text-align: center;
  padding: 28px;
  background: var(--card);
}

.drop.over {
  background: var(--indigo-soft);
  border-color: var(--indigo);
}

.drop strong {
  display: block;
  font: 1.5rem var(--serif);
  margin: 6px;
}

.upload-icon {
  color: var(--indigo);
  font-size: 1.6rem;
}

summary {
  padding: 8px 0;
  color: var(--indigo);
  font-size: .9rem;
}

.prose {
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.prose h3,
.prose h4 {
  margin: 1em 0 .3em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: .35em;
}

.prose blockquote {
  margin: .9em 0;
  padding: .45em 1em;
  border-left: 3px solid var(--line-mid);
  background: var(--subtle);
  color: var(--ink-strong);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.2em 0;
}

.prose code {
  background: var(--subtle-2);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: .84em;
}

.prose pre {
  padding: 14px;
  background: var(--subtle);
  overflow: auto;
  white-space: pre-wrap;
  font-size: .82rem;
}

.scroll {
  overflow: auto;
}

.scroll table {
  min-width: 680px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .85rem;
}

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

th {
  background: var(--rail);
  font-weight: 600;
  white-space: nowrap;
}

.pathlist {
  list-style: none;
  padding: 0;
  overflow-wrap: anywhere;
}

.pathlist li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(520px,100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: -12px 0 50px var(--drawer-shadow);
}

dialog[open] {
  animation: slide .18s ease-out;
}

dialog::backdrop {
  background: var(--backdrop);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 22px 24px 15px;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}

.drawer-head h2 {
  margin: 3px 0 0;
}

.close {
  font-size: 1.4rem;
  padding: 2px 10px;
}

#drawer-content {
  padding: 23px;
}

.diff {
  font: 12px/1.65 var(--mono);
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 10px 0;
}

.diff span {
  display: block;
  min-width: max-content;
  padding: 0 10px;
}

.diff .added {
  background: var(--diff-add-bg);
  color: var(--diff-add-ink);
}

.diff .removed {
  background: var(--diff-del-bg);
  color: var(--diff-del-ink);
}

.diff .hunk {
  background: var(--diff-hunk-bg);
  color: var(--indigo);
}

.diffstat {
  white-space: pre-wrap;
  font: 12px/1.5 var(--mono);
}

.hidden,
[hidden] {
  display: none!important;
}

@keyframes slide {
  from {
    transform: translateX(40px);
    opacity: .65;
  }
}

@media (max-width:900px) {
  .rail {
    width: 205px;
    padding-inline: 12px;
  }
  .workspace {
    margin-left: 205px;
  }
  .wordmark {
    font-size: 1.24rem;
  }
  .mast-copy {
    max-width: 68%;
  }
  .mast canvas {
    width: 34%;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width:860px) {
  #session-controls:not([hidden]) { grid-row: 4; grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .rail {
    position: static;
    width: 100%;
    padding: 12px 16px 6px;
    border: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: start;
  }
  .bookplate {
    border: 0;
    padding: 0;
  }
  .brand {
    gap: 11px;
    padding: 4px 0;
  }
  .mark {
    width: 32px;
  }
  .wordmark {
    font-size: .96rem;
    letter-spacing: .24em;
  }
  .subtitle {
    font-size: .56rem;
    margin-top: 4px;
  }
  .imprint {
    font-size: .72rem;
    letter-spacing: .34em;
  }
  .contents {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    margin: 12px 0 0;
    border-top: 1px solid var(--line);
    padding-top: 4px;
  }
  .toc-group {
    display: flex;
  }
  .toc-group + .toc-group {
    margin: 0;
  }
  .toc-group .rubric {
    display: none;
  }
  .contents a {
    font-size: .78rem;
    padding: 8px;
    gap: 5px;
  }
  .colophon {
    display: contents;
  }
  .colophon dl {
    grid-row: 3;
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 5px;
    margin: 5px 0 0;
    padding: 6px 0 2px;
    border-top: 1px solid var(--line);
  }
  .colophon dt {
    font-size: .58rem;
  }
  .colophon dd {
    font-size: .66rem;
    margin-right: 7px;
  }
  .edition {
    grid-row: 1;
    grid-column: 2;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
  }
  .edition-row > .rubric {
    display: none;
  }
  .workspace {
    margin: 0;
  }
  .bar {
    min-height: 43px;
    padding: 8px 18px;
  }
  main {
    padding: 18px 18px 42px;
  }
  .mast {
    min-height: 160px;
  }
  .mast-copy {
    max-width: 75%;
  }
  .mast canvas {
    opacity: .65;
    width: 29%;
    height: 125px;
    top: 10px;
  }
  .mast p {
    font-size: .9rem;
  }
  .mast h1 {
    font-size: 2.9rem;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .metric:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }
  .claims {
    grid-template-columns: 1fr;
  }
  .card,
  .lead,
  .blank {
    padding: 18px;
  }
  .tabs {
    flex-wrap: wrap;
  }
  .toolbar {
    gap: 12px;
  }
  .eyebrow {
    font-size: .7rem;
  }
}

@media (prefers-reduced-motion:reduce) {
  dialog[open] {
    animation: none;
  }
}

:root:lang(zh-CN) {
  --serif: var(--zh-display);
}
:lang(zh-CN) .brand {
  font-weight: 600;
  letter-spacing: -.035em;
}
:lang(zh-CN) .mast h1 {
  font-size: clamp(2.25rem,3.9vw,3.25rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.2;
}
:lang(zh-CN) h2,
:lang(zh-CN) h3 {
  font-weight: 600;
  letter-spacing: -.012em;
  line-height: 1.38;
}
:lang(zh-CN) h2 {
  font-size: 1.4rem;
}
:lang(zh-CN) h3 {
  font-size: 1.15rem;
}
:lang(zh-CN) .lead .prose {
  font-size: 1.08rem;
  line-height: 1.78;
  font-weight: 450;
}
:lang(zh-CN) .metric strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
:lang(zh-CN) .question strong {
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
:lang(zh-CN) .drawer-head h2 {
  font-size: 1.28rem;
  font-weight: 600;
}
:lang(zh-CN) p,
:lang(zh-CN) li {
  line-height: 1.72;
}
:lang(zh-CN) .rubric {
  letter-spacing: .09em;
}
@media (max-width:760px) {
  :lang(zh-CN) .mast h1 {
    font-size: 2.15rem;
  }
}

/* Domain systems */
.domain-dateline { color: var(--muted); font: .8rem var(--mono); }
.guardrails { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.guardrail, .desk-task { min-width: 0; }
.task-line { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.task-line h3 { flex: 1 1 10rem; margin: 0; overflow-wrap: anywhere; }
.risk-value { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 6px; }
.risk-value strong, .allocation-strip dd { font: 500 1.75rem var(--serif); font-variant-numeric: tabular-nums; }
.rail-meter { appearance: none; display: block; width: 100%; height: 4px; border: 0; color: var(--indigo); background: var(--line); }
.rail-meter::-webkit-progress-bar { background: var(--line); }
.rail-meter::-webkit-progress-value { background: currentColor; }
.rail-meter::-moz-progress-bar { background: currentColor; }
.near_limit, .watch, .awaiting_approval { color: var(--amber-text); }
.status.near_limit, .status.watch, .status.awaiting_approval { background: var(--amber-bg); }
.breached, .rejected, .loss { color: var(--red); }
.status.breached, .status.rejected { background: var(--red-bg); }
.gain, .approved, .completed, .status.ok { color: var(--green-text); }
.status.approved, .status.completed, .status.ok { background: var(--green-bg); }
.status.in_progress { background: var(--indigo-soft); color: var(--indigo); }
@media (max-width:760px) {
  .allocation-strip { grid-template-columns: 1fr; }
  .allocation-strip div + div { border-left: 0; border-top: 1px solid var(--line); }
}
.allocation-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0 0 12px; background: var(--subtle-2); border-block: 1px solid var(--line); }
.allocation-strip div { padding: 12px; }
.allocation-strip div + div { border-left: 1px solid var(--line); }
.allocation-strip dd { margin: 5px 0 0; color: var(--indigo); }
.domain-table { min-width: 0; font-variant-numeric: tabular-nums; }
.domain-table table { min-width: 680px; }
.domain-table td { vertical-align: top; }
.domain-table .chips { margin: 0; }
.task-filters, .new-task { margin-bottom: 14px; }
.desk-task .task-line { margin-bottom: 10px; }
.decision-note { padding-left: 12px; border-left: 2px solid var(--line-mid); }
.task-controls, .task-fields { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.task-controls { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.task-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit,minmax(min(220px,100%),1fr)); align-items: end; }
.new-task summary { font-weight: 600; color: var(--indigo); }
.task-fields label, .task-controls label { display: grid; gap: 5px; color: var(--muted); font-size: .85rem; }
.task-fields input, .task-fields textarea, .task-fields select, .task-controls input {
  width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line-mid); background: var(--card); color: var(--ink);
}

/* Event routing and the execution ledger */
@media (min-width:861px) {
  .rail { overflow-y: auto; }
  .contents a > [data-i18n] { min-width: 0; white-space: normal; }
}
.control-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-block: 2px solid var(--line-mid); background: var(--subtle-2); }
.control-strip > div { display: grid; grid-template-rows: minmax(2.2em,auto) auto auto; gap: 5px; align-content: start; padding: 14px; }
.control-strip > div + div { border-left: 1px solid var(--line-strong); }
.control-strip .caption { letter-spacing: .06em; }
.control-strip strong, .resource-reading { font: 500 1.65rem var(--serif); color: var(--indigo); font-variant-numeric: tabular-nums; }
.resource-reading { font-size: 1.08rem; }
.execution-card, .resource-card, .feedback-card { min-width: 0; overflow-wrap: anywhere; }
.execution-progress { display: flex; align-items: center; gap: 12px; margin: 12px 0; font: .8rem var(--mono); }
.execution-progress .rail-meter { flex: 1; }
.interrupt-reason { border-left: 3px solid var(--amber-border); padding: 8px 12px; background: var(--amber-bg); }
.operations-rules { margin-block: 12px; }
.operations-rules summary { cursor: pointer; color: var(--indigo); }
.operations-rules[open] summary { margin-bottom: 12px; }
.control-notice:not(:empty) { padding: 10px 14px; border-left: 2px solid var(--indigo); background: var(--subtle-2); }
.status.available, .status.ready { color: var(--green-text); background: var(--green-bg); }
.status.locked, .status.constrained, .status.paused, .status.escalated, .status.warning { color: var(--amber-text); background: var(--amber-bg); }
.status.blocked, .status.failed { color: var(--red); background: var(--red-bg); }
.status.running, .status.state_changed { color: var(--indigo); background: var(--indigo-soft); }
@media (max-width:760px) {
  .control-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .control-strip > div:nth-child(3) { border-left: none; }
  .control-strip > div:nth-child(n+3) { border-top: 1px solid var(--line-strong); }
}

/* Execution engines and backend assets */
.engine-grid, .cap-grid { display: grid; gap: 12px; }
.engine-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.engine-summary {
  display: grid; align-content: start; gap: 6px; text-align: start;
  border: 1px solid var(--line); border-top: 2px solid var(--line-mid); background: var(--subtle);
  padding: 14px; color: var(--indigo); cursor: pointer;
}
.engine-summary strong { font: 500 2rem var(--serif); font-variant-numeric: tabular-nums; }
.engine-title { min-height: 2.5em; font-weight: 600; }
.engine-summary:hover, .engine-summary.active { background: var(--hover); border-color: var(--indigo-border); }
.registry-filters { margin-bottom: 14px; }
.cap-grid { grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); }
.capability { min-width: 0; overflow-wrap: anywhere; }
.capability h3 { margin: 0 0 4px; }
.capability > .chips { margin-top: 10px; }
.cap-details { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 10px; font-size: .83rem; }
.cap-details dt { color: var(--muted); }
.cap-details dd { margin: 0; gap: 4px; }
.cap-path { padding: 2px 5px; background: var(--subtle-2); font: .76rem var(--mono); }
.registry-result { border-left: 2px solid var(--line-mid); background: var(--subtle); padding: 12px; margin-top: 12px; }
.registry-result p { margin: 8px 0; }
.registry-result ul { padding-inline-start: 1.2rem; margin-block: 4px; }
.registry-result ul:empty { display: none; }
.skill-list { border-top: 1px solid var(--line); margin-bottom: 24px; }
.skill-row {
  width: 100%; text-align: start; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 4px 14px; padding: 12px 4px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--indigo);
}
.skill-row:hover { background: var(--subtle-2); }
.skill-source { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: .87rem; }
@media (max-width:1000px) {
  .engine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.engine-total { font-size: .76rem; }

/* Team authority and member intake */
.authority-matrix table { min-width: 670px; }
.weight-score { display: inline-flex; gap: .55rem; align-items: center; font: .82rem var(--mono); }
.weight-bar { width: 3.1rem; height: 4px; appearance: none; border: 0; background: var(--line); color: var(--indigo); }
.weight-bar::-webkit-progress-bar { background: var(--line); }
.weight-bar::-webkit-progress-value { background: var(--indigo); }
.weight-bar::-moz-progress-bar { background: var(--indigo); }
.team-card { min-width: 0; overflow-wrap: anywhere; }
.team-card > .chips, .member-editor { margin-block: .8rem; }
.member-editor summary { cursor: pointer; }
.member-fields { grid-template-columns: repeat(auto-fit, minmax(min(170px,100%), 1fr)); }
.member-fields label.ic-check { display: flex; align-items: center; gap: .5rem; }
.member-fields .ic-check input { width: auto; }
.inbox-route:not([hidden]) { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.inbox-route label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.inbox-route select { padding: 7px; min-width: 10rem; color: var(--ink); border: 1px solid var(--line); background: var(--card); }

#signin {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.signin-card {
  width: min(100%, 26rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-top: 3px solid var(--indigo);
  background: var(--card);
}
.signin-imprint {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}
.signin-card h1 { margin: 1.5rem 0 1.25rem; font: 2rem/1.2 var(--serif); }
.signin-card dt { color: var(--muted); font-size: .85rem; }
.signin-card dd { margin: .25rem 0 .75rem; overflow-wrap: anywhere; }
:lang(zh-CN) .signin-card h1 { font-family: var(--zh-display); font-weight: 600; font-size: 1.65rem; }
#signin-form { display: grid; gap: .75rem; }
#signin-form label { font-size: .88rem; color: var(--muted); }
#access-token { width: 100%; padding: .65rem .75rem; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
#signin-language {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
#signin-language .edition { margin-top: 0; }
#session-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  color: var(--muted);
  font-size: .76rem;
  padding: .5rem 0;
}
#signout { color: var(--indigo); border: 0; background: transparent; text-decoration: underline; padding: 0; }

/* Workflow folio */
.workflow-folio { max-width: 1520px; padding-top: 22px; }
.workflow-folio .mast.compact { min-height: auto; padding: 6px 0 16px; }
.workflow-folio .mast.compact h1 { font-size: clamp(1.75rem, 2.5vw, 2.35rem); margin: 4px 0 6px; }
.workflow-folio .mast.compact p { margin: 0; font-size: .92rem; }
.wf-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.wf-strip > div {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px;
  padding: 10px clamp(10px, 1.4vw, 20px); border-left: 1px solid var(--line);
}
.wf-strip > div:first-child { border-left: 0; }
.wf-strip dt, .wf-stage, .wf-io dt {
  font: 600 .7rem/1.45 var(--sans); color: var(--muted); letter-spacing: .035em;
}
.wf-strip dd { margin: 0; font: 600 1.08rem var(--mono); color: var(--indigo); }
.wf-strip .revision { font: inherit; }
.wf-toolbar, .wf-tools-right, .wf-tabs, .wf-legend, .wf-actions, .wf-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wf-toolbar { justify-content: space-between; margin-top: 14px; }
.wf-tools-right { gap: 12px; }
.wf-tabs { gap: 0; border: 1px solid var(--line-mid); }
.wf-tab { min-height: 38px; padding: 6px 12px; border: 0; background: var(--card); color: var(--indigo); font-size: .82rem; }
.wf-tab[aria-pressed="true"] { background: var(--indigo-solid); color: var(--btn-primary-ink); }
.wf-focus-btn { min-height: 38px; padding: 6px 11px; font-size: .8rem; color: var(--indigo); }
.wf-focus-btn[aria-pressed="true"] { background: var(--indigo-soft); border-color: var(--indigo-border); }
.wf-legend { gap: 14px; font-size: .72rem; color: var(--muted); }
.wf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wf-legend span::before { content: ""; width: 19px; border-top: 2px solid var(--indigo); }
.wf-legend .feedback::before { border-color: var(--red); border-top-style: dashed; }
.wf-caption { margin: 8px 0 10px; font-size: .84rem; color: var(--muted); }
.wf-viewport { border: 1px solid var(--line-strong); overflow-x: auto; }
.wf-board { position: relative; isolation: isolate; padding: 16px 26px 32px; background: var(--wf-board); }
.wf-board.wf-mode-flywheel { padding: 18px 42px 22px 34px; }
.wf-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wf-path { fill: none; stroke: var(--indigo); stroke-width: 1.6; }
.wf-path.feedback { stroke: var(--red); stroke-dasharray: 5 4; }
.wf-tip.flow { fill: var(--indigo); }
.wf-tip.feedback { fill: var(--red); }
.wf-path.is-dim { opacity: .28; }
.wf-path.is-active { stroke-width: 2.4; }
.wf-lanes { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(29px, 3vw, 48px); }
.wf-lanes.wf-mode-flywheel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 38px clamp(42px, 5vw, 72px); }
.wf-lanes.wf-mode-flywheel .wf-lane-1 { grid-column: 1; grid-row: 1; }
.wf-lanes.wf-mode-flywheel .wf-lane-2 { grid-column: 2; grid-row: 1; }
.wf-lanes.wf-mode-flywheel .wf-lane-3 { grid-column: 2; grid-row: 2; }
.wf-lanes.wf-mode-flywheel .wf-lane-4 { grid-column: 1; grid-row: 2; }
.wf-lane { display: flex; flex-direction: column; align-items: stretch; gap: 14px; min-width: 0; }
.wf-lanes.wf-mode-flywheel .wf-lane { gap: 11px; }
.wf-lane h2 { margin: 0; min-height: 2.2em; padding-bottom: 5px; border-bottom: 1px solid var(--line-mid); font: 650 .76rem/1.3 var(--sans); color: var(--ink-strong); }
.wf-lanes.wf-mode-flywheel .wf-lane h2 { min-height: auto; }
.wf-node {
  position: relative; text-align: start; min-height: 76px; padding: 9px 10px;
  border: 1px solid var(--line-mid); border-radius: 2px; background: var(--card); overflow-wrap: anywhere;
}
.wf-node-text { display: block; min-width: 0; }
.wf-node strong { display: block; margin: 3px 0 6px; font: 600 .99rem/1.15 var(--serif); }
.wf-lanes.wf-mode-flywheel .wf-node {
  min-height: 54px; padding: 9px 12px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 14px;
}
.wf-lanes.wf-mode-flywheel .wf-node strong { margin: 2px 0 0; font-size: .96rem; }
.wf-lanes.wf-mode-flywheel .wf-measure { justify-content: flex-end; text-align: right; white-space: nowrap; }
.wf-node.is-active, .wf-node:hover, .wf-node:focus-visible { border-color: var(--focus); background: var(--wf-node-hover); }
.wf-node[aria-pressed="true"] { background: var(--wf-node-active); border-color: var(--indigo); box-shadow: inset 3px 0 var(--indigo); }
.wf-measure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; color: var(--muted); font: .71rem/1.2 var(--sans); }
.wf-measure b { font: 600 .88rem/1.2 var(--mono); color: var(--indigo); }
.wf-node.wf-warning .wf-measure b { color: var(--amber-text); }
.wf-inspector { margin-top: 14px; padding: clamp(16px, 2vw, 24px); background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--indigo); }
.wf-inspect-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.wf-inspect-head h2 { margin: 4px 0; font: 500 1.45rem var(--serif); }
.wf-inspect-head p { margin: 4px 0; font-size: .9rem; color: var(--muted); }
.wf-actions a { text-decoration: none; }
.wf-inspector > .wf-tags { margin: 12px 0; }
.wf-engine, .wf-state, .wf-io code, .wf-walk { border: 1px solid var(--line); padding: 3px 7px; border-radius: 2px; font-size: .76rem; overflow-wrap: anywhere; }
.wf-state { color: var(--ink-strong); background: var(--subtle-2); }
.wf-state.wf-active, .wf-state.wf-ready { color: var(--green-text); background: var(--green-bg); }
.wf-state.wf-warning { color: var(--amber-text); background: var(--amber-bg); }
.wf-engine, .wf-io code { background: var(--paper); font-family: var(--mono); }
.wf-inspect-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
.wf-io { display: grid; grid-template-columns: minmax(5em, auto) 1fr; gap: 9px; align-items: baseline; margin: 6px 0 13px; }
.wf-io dd { margin: 0; min-width: 0; }
.wf-walk { background: var(--card); color: var(--indigo); }
.wf-walk.feedback { color: var(--red); border-style: dashed; }
.wf-artifacts h3 { margin: 4px 0; font: 600 .83rem var(--sans); }
.wf-artifact { display: block; text-align: start; width: 100%; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--indigo); font: 500 .83rem var(--sans); text-decoration: none; overflow-wrap: anywhere; }
.wf-artifact:hover { text-decoration: underline; }
.wf-artifact small { display: block; margin-top: 3px; font: .7rem var(--mono); color: var(--muted); }
:lang(zh-CN) .wf-node strong, :lang(zh-CN) .wf-inspector h2, :lang(zh-CN) .wf-inspector h3 { font-family: var(--zh-display); }
@media (min-width: 861px) {
  body.wf-focus .rail { display: none; }
  body.wf-focus .workspace { margin-left: 0; }
}
@media (max-width: 860px) {
  .wf-focus-btn { display: none; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .wf-board.wf-mode-columns { min-width: 740px; }
}
@media (max-width: 760px) {
  .wf-strip { grid-template-columns: 1fr 1fr; }
  .wf-strip > div { border-top: 1px solid var(--line); }
  .wf-board, .wf-board.wf-mode-flywheel { padding: 15px; }
  .wf-lanes, .wf-lanes.wf-mode-flywheel, .wf-inspect-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .wf-lanes.wf-mode-flywheel .wf-lane { grid-column: auto; grid-row: auto; }
  .wf-edges { display: none; }
  .wf-lane { gap: 6px; }
  .wf-lane h2 { min-height: auto; padding-bottom: 6px; }
  .wf-lane + .wf-lane h2::before { content: "↓ "; color: var(--indigo); }
  .wf-node, .wf-lanes.wf-mode-flywheel .wf-node { min-height: 54px; display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; }
  .wf-node strong { margin-bottom: 0; }
  .wf-measure { align-self: center; max-width: 8em; white-space: normal; }
  .wf-io { grid-template-columns: 1fr; gap: 4px; }
  .wf-walk, .wf-actions > * { min-height: 44px; }
}

.goals-head, .mcp-endpoint, .mcp-snippet-head, .mcp-copy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
}
.goals-head, .mcp-endpoint, .mcp-snippet-head { justify-content: space-between; }
.goals-editor, .goals-editor label { display: grid; gap: .5rem; }
.goals-editor { gap: 1rem; margin-top: 1rem; }
.goals-editor input, .goals-editor textarea {
  width: 100%;
  padding: .7rem;
  border: 1px solid var(--line-mid);
  background: var(--paper);
  color: var(--ink);
}
.goals-editor textarea { min-height: 18rem; resize: vertical; font-family: var(--mono); }
.goals-saved { background: var(--green-bg); color: var(--green-text); }
.mcp-hub { margin-top: 22px; border-top: 2px solid var(--indigo); }
.mcp-endpoint, .mcp-snippets pre { padding: .75rem; background: var(--subtle); }
.mcp-endpoint { margin: .8rem 0 1.2rem; }
.mcp-endpoint code, .mcp-tools h4 { overflow-wrap: anywhere; }
.mcp-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
.mcp-tools article, .mcp-snippets { border-top: 1px solid var(--line); padding: .85rem 0; }
.mcp-tools h4, .mcp-snippet-head h4 { margin: 0; }
.mcp-tools p { margin: .4rem 0; }
.mcp-snippets summary { cursor: pointer; color: var(--indigo); font-weight: 600; }
.mcp-snippets section { margin-top: 1rem; }
.mcp-snippets pre { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
@media (max-width: 680px) {
  .mcp-tools { grid-template-columns: minmax(0, 1fr); }
}

/* Layer 2 reading desk */
.kb-toolbar, .kb-related-row { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem; }
.kb-toolbar { justify-content:space-between; margin-bottom:1rem; }
.kb-toolbar input { flex:1 1 15rem; padding:.7rem; background:var(--paper); color:var(--ink); border:1px solid var(--line-mid); }
.kb-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap:1rem; }
.kb-title, .kb-link { color:var(--indigo); border:0; background:transparent; padding:0; font:inherit; text-align:start; cursor:pointer; }
.kb-title:hover, .kb-link { text-decoration:underline; text-underline-offset:.18em; }
.kb-unresolved { border-bottom:1px dashed var(--muted); color:var(--muted); }
.kb-related, .kb-preview { padding-top:1rem; border-top:1px solid var(--line); }
.kb-related-row { padding:.4rem 0; }
.kb-fields { border:0; padding:0; margin:0; display:grid; gap:.8rem; min-width:0; }
.kb-fields [hidden] { display:none; }
.kb-graph { display:grid; grid-template-columns:minmax(0,2fr) minmax(12rem,1fr); align-items:center; gap:1rem; }
.kb-svg { width:100%; height:auto; background:var(--subtle); }
.kb-edge { stroke:var(--indigo); stroke-width:2; }
.kb-edge.shared_entity { stroke:var(--muted); stroke-dasharray:4 5; stroke-width:1.4; }
.kb-dot { cursor:pointer; fill:var(--ink); }
.kb-dot circle { stroke:var(--indigo); fill:var(--card); stroke-width:3; }
.kb-dot.core circle, .kb-dot.kb-current circle { fill:var(--indigo); }
.kb-dot.member circle { stroke:var(--red); }
.kb-dot text { font-size:12px; paint-order:stroke; stroke:var(--subtle); stroke-width:3px; }
.kb-dot:focus-visible circle { stroke-width:5; }
.kb-svg .kb-dim { opacity:.27; }
@media (max-width:860px) { .kb-graph { grid-template-columns:1fr; } }
.kb-back { margin-bottom:.8rem; color:var(--indigo); background:transparent; border:0; cursor:pointer; }
.kb-legend { display:flex; flex-wrap:wrap; gap:1rem; color:var(--muted); font-size:.85rem; }
.kb-key::before { content:""; display:inline-block; width:1.4rem; margin-right:.4rem; vertical-align:middle; border-top:2px solid var(--indigo); }
.kb-key.shared::before { border-top:1px dashed var(--muted); }
