:root {
  color-scheme: light;
  --canvas: #edf1f2;
  --paper: #ffffff;
  --paper-soft: #f7f9f9;
  --navy: #102933;
  --navy-2: #183b46;
  --text: #18313a;
  --muted: #63757c;
  --faint: #8b999e;
  --teal: #14818e;
  --teal-dark: #0b6470;
  --teal-soft: #e4f2f3;
  --line: #d8e0e2;
  --line-strong: #bcc9cd;
  --green: #2c7659;
  --green-soft: #e6f2eb;
  --amber: #98651d;
  --amber-soft: #f8eedc;
  --red: #a7483d;
  --red-soft: #f8e8e5;
  --on-dark: #d3dfe2;
  --on-dark-muted: #78949c;
  --teal-highlight: #72d5da;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 41, 51, .04), 0 12px 30px -22px rgba(16, 41, 51, .32);
  --font: Inter, "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 14px/1.55 var(--font);
  text-rendering: optimizeLegibility;
}

::selection { background: var(--teal); color: #fff; }

a { color: var(--teal-dark); text-underline-offset: 2px; }

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

h1, h2, h3, h4 {
  color: var(--navy);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.018em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

.num, .mono, code {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
}

.skip:focus { top: 16px; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(20, 129, 142, .2);
  outline-offset: 2px;
}

/* Brand header */
.top {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 10px 35px -32px rgba(16, 41, 51, .55);
}

.top::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--teal);
}

.top-inner {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand-mark {
  min-width: 0;
  display: grid;
  grid-template-columns: 260px minmax(260px, 1fr);
  align-items: center;
  gap: 28px;
}

.brand-logo {
  display: block;
  width: 260px;
  height: 104px;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.title {
  max-width: 25ch;
  margin: 0;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 680;
}

.subtitle {
  max-width: 58ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.top-meta {
  flex: none;
  color: var(--faint);
  font: 10.5px/1.8 var(--mono);
  letter-spacing: .035em;
  text-align: right;
  text-transform: uppercase;
}

.header-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 36px);
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-soft);
}

.language-switch button {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font: 700 10px var(--mono);
  letter-spacing: .06em;
}

.language-switch button:hover { color: var(--teal-dark); }

.language-switch button.active {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 7px -4px rgba(16, 41, 51, .65);
}

.content-editing .language-switch {
  pointer-events: none;
  opacity: .45;
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.editor-toggle,
.editor-reset,
.owner-lock,
.owner-access {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: 650 10.5px var(--font);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.editor-toggle {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.editor-toggle:hover,
.editor-toggle[aria-pressed="true"] {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.editor-reset {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--muted);
}

.owner-lock {
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
  color: var(--muted);
}

.owner-lock:hover { border-color: var(--navy-2); color: var(--navy); }

.owner-access {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--navy-2);
}

.owner-access:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.editor-reset:hover {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: var(--red-soft);
  color: var(--red);
}

.editor-status {
  min-width: 72px;
  color: var(--faint);
  font-size: 9px;
  text-align: right;
}

[data-edit-key] { transition: outline-color .15s ease, background-color .15s ease; }

.content-editing [data-edit-key] {
  border-radius: 4px;
  outline: 1px dashed color-mix(in srgb, var(--teal) 55%, var(--line));
  outline-offset: 3px;
  cursor: text;
}

.content-editing [data-edit-key]:hover {
  background: color-mix(in srgb, var(--teal-soft) 46%, transparent);
}

.content-editing [data-edit-key]:focus {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  background: color-mix(in srgb, var(--teal-soft) 70%, var(--paper));
  box-shadow: 0 0 0 5px rgba(20, 129, 142, .09);
}

/* Owner access */
.owner-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text);
  box-shadow: 0 28px 80px -34px rgba(16, 41, 51, .75);
}

.owner-dialog::backdrop {
  background: rgba(16, 41, 51, .58);
  backdrop-filter: blur(4px);
}

.owner-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.owner-card h2 { margin: 0; font-size: 21px; }

.owner-kicker {
  margin: 0 34px 0 0;
  color: var(--teal-dark);
  font: 750 9px/1.3 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.owner-description {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.owner-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--muted);
  cursor: pointer;
  font: 400 21px/1 var(--font);
}

.owner-close:hover { background: var(--teal-soft); color: var(--teal-dark); }

.owner-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.owner-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  font: 18px/1 var(--mono);
  letter-spacing: .14em;
}

.owner-field input:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(20, 129, 142, .13);
}

.owner-field input:disabled { background: var(--paper-soft); cursor: not-allowed; }

.owner-error {
  min-height: 18px;
  margin: -2px 0;
  color: var(--red);
  font-size: 11px;
}

.owner-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.owner-cancel,
.owner-submit {
  min-height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: 650 11px var(--font);
}

.owner-cancel {
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--muted);
}

.owner-submit {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.owner-submit:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
.owner-submit:disabled { opacity: .45; cursor: not-allowed; }

/* Page frame */
.shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 22px 28px 70px;
}

.disclaimer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  margin: 0 0 20px;
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--amber) 24%, var(--line));
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber-soft) 64%, var(--paper));
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.disclaimer .ico {
  flex: none;
  margin-top: 1px;
  color: var(--amber);
}

.disclaimer strong { color: var(--amber); }

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

/* Dark navigation rail */
.toc {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-lg);
  background: var(--navy);
  box-shadow: 0 18px 38px -26px rgba(16, 41, 51, .7);
}

.toc::before {
  content: "MODULES";
  padding: 6px 10px 10px;
  color: var(--on-dark-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .14em;
}

html[lang="pl"] .toc::before { content: "MODUŁY"; }

.toc a {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 7px;
  align-items: baseline;
  padding: 8px 9px;
  border-radius: 7px;
  color: var(--on-dark);
  font-size: 11.5px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.toc a .n {
  color: var(--on-dark-muted);
  font: 9.5px var(--mono);
}

.toc a:hover,
.toc a:focus-visible {
  background: rgba(78, 194, 203, .11);
  color: #fff;
}

.toc a:hover .n { color: var(--teal-highlight); }

main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Unified modules */
.sheet {
  overflow: hidden;
  scroll-margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sheet.pinned {
  border-color: color-mix(in srgb, var(--teal) 28%, var(--line));
  box-shadow: inset 3px 0 0 var(--teal), var(--shadow);
}

.sheet-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.sheet-head .tag {
  flex: none;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font: 750 9px/1 var(--mono);
  letter-spacing: .08em;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.lead {
  max-width: 82ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.lead b { color: var(--text); font-weight: 650; }

.panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.subsection-title {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Forms */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-group .gk {
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.field label .unit {
  color: var(--faint);
  font-family: var(--mono);
  font-weight: 400;
}

.field.optional label::after {
  content: "optional";
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

html[lang="pl"] .field.optional label::after { content: "opcjonalne"; }

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(16, 41, 51, .025);
  font: 13.5px var(--mono);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:hover { border-color: color-mix(in srgb, var(--teal) 42%, var(--line-strong)); }

.field input:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(20, 129, 142, .13);
}

.field input::placeholder { color: var(--faint); opacity: .72; }

.clear-btn {
  flex: none;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  font: 600 11px var(--font);
  transition: .15s ease;
}

.clear-btn:hover {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: var(--red-soft);
  color: var(--red);
}

/* Summaries and calculated values */
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}

.summary-strip .lbl {
  margin-right: 3px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
}

.chip.lg { padding: 6px 10px; font-size: 10.5px; }
.chip.good { border-color: color-mix(in srgb, var(--green) 24%, var(--line)); background: var(--green-soft); color: var(--green); }
.chip.warn { border-color: color-mix(in srgb, var(--amber) 24%, var(--line)); background: var(--amber-soft); color: var(--amber); }
.chip.bad { border-color: color-mix(in srgb, var(--red) 24%, var(--line)); background: var(--red-soft); color: var(--red); }
.chip.neutral { border-color: var(--line); background: var(--paper-soft); color: var(--muted); }

.readout-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.readout {
  min-height: 86px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}

.readout .k { color: var(--muted); font-size: 10px; font-weight: 650; }
.readout .v { color: var(--navy); font: 650 18px/1.35 var(--mono); letter-spacing: -.025em; }
.readout .v.small { font-size: 13px; font-weight: 550; letter-spacing: 0; }
.readout .sub { color: var(--faint); font-size: 10px; line-height: 1.4; }
.readout.empty { min-height: 68px; align-items: center; justify-content: center; border-style: dashed; color: var(--faint); font-size: 11px; }

.headline-box {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--teal-soft) 58%, var(--paper));
}

.headline-box .hb-ico {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font: 750 13px var(--mono);
}

.headline-box .hb-text { font-size: 13px; line-height: 1.55; }

.formula {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  background: var(--paper-soft);
  color: var(--teal-dark);
  font: 12px/1.55 var(--mono);
}

.note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.note b { color: var(--text); }

.note.warn2 {
  border-color: color-mix(in srgb, var(--amber) 22%, var(--line));
  border-left-color: var(--amber);
  background: color-mix(in srgb, var(--amber-soft) 48%, var(--paper));
}

/* Data tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.ref-table,
.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.ref-table th,
.ref-table td,
.plan-table th,
.plan-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.ref-table th,
.plan-table th {
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ref-table tbody tr:last-child td,
.plan-table tbody tr:last-child td { border-bottom: 0; }

.ref-table tbody tr:hover,
.plan-table tbody tr:hover { background: color-mix(in srgb, var(--teal-soft) 34%, var(--paper)); }

.plan-table td.num { white-space: nowrap; }
.plan-table td.param { color: var(--navy); font-weight: 650; }
.plan-table td.delta { font: 700 13px var(--mono); white-space: nowrap; }
.plan-table tr.row-good td.delta { color: var(--green); }
.plan-table tr.row-warn td.delta { color: var(--amber); }
.plan-table tr.row-bad td.delta { color: var(--red); }

.src-tag {
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Content-specific grids */
.anatomy-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.anatomy-layout > img {
  width: 236px !important;
  height: auto !important;
  padding: 8px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--paper) !important;
}

.anatomy-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.type-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}

.type-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  font-size: 12px;
}

.type-card h4 .dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--teal);
}

.type-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.type-card.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px var(--teal);
}

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

.pso-grid > div {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}

.biblio-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.biblio-item:last-child { border-bottom: 0; }
.biblio-item .idx { color: var(--faint); font: 10px var(--mono); }
.biblio-item .cite { font-size: 11.5px; line-height: 1.6; }
.biblio-item .cite .t { color: var(--text); font-weight: 650; }
.biblio-item .cite .a { color: var(--muted); }
.biblio-item .cite .j { color: var(--faint); font-style: italic; }
.biblio-item .cite a.doi { font: 10px var(--mono); }

.pagefoot {
  margin-top: 28px;
  padding: 18px 12px 0;
  border-top: 1px solid var(--line-strong);
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
}

.pagefoot-note {
  margin: 0;
  text-align: center;
}

.creator-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .015em;
}

.creator-credit strong { color: var(--navy); font-weight: 700; }

.creator-logo-wrap {
  position: relative;
  width: 104px;
  height: 78px;
  flex: 0 0 104px;
  overflow: hidden;
}

.creator-logo-wrap img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 112px;
  height: 112px;
  object-fit: contain;
  transform: translate(-50%, -48%);
  filter: brightness(0) saturate(100%) invert(16%) sepia(25%) saturate(1035%) hue-rotate(145deg) brightness(91%) contrast(91%);
  opacity: .96;
}

@media (max-width: 1060px) {
  .top-meta { display: none; }
  .header-actions { align-self: flex-start; }
  .brand-mark { width: 100%; grid-template-columns: 235px minmax(0, 1fr); }
  .brand-logo { width: 235px; height: 96px; }
}

@media (max-width: 880px) {
  .top-inner, .shell { padding-left: 18px; padding-right: 18px; }
  .brand-mark { grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
  .brand-logo { width: 210px; height: 88px; }
  .brand-copy { padding-left: 18px; }
  .layout { grid-template-columns: 1fr; }
  .toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .toc::before { grid-column: 1 / -1; }
  .toc a { min-width: 0; }
}

@media (max-width: 680px) {
  .top-inner { padding-top: 18px; padding-bottom: 18px; }
  .top-inner { align-items: flex-start; }
  .header-actions { position: absolute; top: 18px; right: 18px; }
  .editor-status { display: none; }
  .brand-mark { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
  .brand-logo { width: 230px; height: 92px; }
  .brand-copy { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .title { max-width: none; font-size: 22px; }
  .subtitle { font-size: 12.5px; }
  .shell { padding-top: 16px; padding-bottom: 48px; }
  .disclaimer { font-size: 11.5px; }
  .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet { border-radius: var(--radius); }
  .sheet-head { min-height: 54px; padding: 14px 16px; }
  .sheet-head h2 { font-size: 15px; }
  .sheet-body { padding: 17px 16px; }
  .panel-head-row { flex-direction: column; }
  .anatomy-layout, .pso-grid, .type-grid { grid-template-columns: 1fr; }
  .anatomy-layout > img { width: min(100%, 300px) !important; justify-self: center; }
}

@media (max-width: 430px) {
  .top-inner, .shell { padding-left: 12px; padding-right: 12px; }
  .header-actions { position: static; width: 100%; align-items: stretch; }
  .editor-tools { justify-content: flex-start; }
  .brand-logo { width: 210px; height: 84px; }
  .toc { grid-template-columns: 1fr; }
  .toc a { padding: 7px 9px; }
  .grid-inputs, .readout-row { grid-template-columns: 1fr; }
  .disclaimer { grid-template-columns: 1fr; }
}

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

@media print {
  body { background: #fff; }
  .top, .sheet { box-shadow: none; }
  .toc, .clear-btn { display: none; }
  .layout { display: block; }
  .sheet { break-inside: avoid; margin-bottom: 14px; }
}
