:root {
  --paper: #faf9f5;
  --ink: #14161a;
  --plotter-blue: #1c3f6e;
  --chrome-fade: rgba(250, 249, 245, 0.92);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: "Literata", Georgia, serif;
  line-height: 1.55;
}

/* —— Startseite —— */
.title-page {
  max-width: 38rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
}

body.pdf-export:not(.chapter-body) .lang-switch,
body.pdf-export:not(.chapter-body) .title-col-chapters,
body.pdf-export:not(.chapter-body) .toc {
  display: none !important;
}
body.pdf-export:not(.chapter-body) .title-columns {
  display: block;
}
body.pdf-export:not(.chapter-body) .title-page {
  padding-top: 1.8rem;
  padding-bottom: 2.4rem;
}

body:has(> .chrome.bottom) .title-page {
  padding-bottom: 7.5rem;
}

body:has(> .chrome.bottom) .footer-copy {
  padding-bottom: 4.2rem;
}

.title-masthead .lang-switch {
  justify-content: flex-end;
  margin: -2.2rem 0 1.6rem;
}

@media (min-width: 64rem) {
  .title-page {
    max-width: 72rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .title-masthead .eyebrow,
  .title-masthead h1,
  .title-masthead .subtitle,
  .title-masthead .anniversary,
  .title-masthead p,
  .title-masthead .howto-steps {
    max-width: 38rem;
  }

  .title-columns {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
    gap: 0 2.8rem;
    align-items: start;
    margin-top: 0.5rem;
  }

  .title-col-chapters {
    border-left: 1px solid #d8d6cf;
    padding-left: 2.2rem;
  }

  .title-col-essay .howto {
    margin-top: 1.6rem;
  }

  .title-col-chapters .howto {
    margin-top: 1.6rem;
    padding-top: 0;
    border-top: 0;
  }

  .title-col-chapters .toc {
    margin-top: 1.8rem;
  }

  .title-col-chapters .toc ol {
    column-count: 2;
    column-gap: 1.6rem;
  }

  .title-col-chapters .toc li {
    break-inside: avoid;
    page-break-inside: avoid;
    grid-template-columns: 1.7rem minmax(0, 1fr);
    gap: 0.45rem 0.55rem;
    padding: 0.32rem 0;
  }

  .title-col-chapters .toc .meta {
    grid-column: 2;
  }
}

@media (min-width: 90rem) {
  .title-page {
    max-width: 96rem;
  }

  .title-columns {
    grid-template-columns: minmax(22rem, 32rem) minmax(0, 1fr);
  }

  .title-col-chapters .toc ol {
    column-count: 3;
    column-gap: 1.8rem;
  }
}

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plotter-blue);
}

.title-page h1 {
  font-family: "Literata", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0.35rem 0 0.2rem;
  letter-spacing: -0.02em;
}

.subtitle {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  margin: 0 0 1.4rem;
  color: #3a3d44;
}

.anniversary {
  display: inline-block;
  justify-self: start;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--plotter-blue);
  border: 1px solid var(--plotter-blue);
  padding: 0.28rem 0.55rem;
  margin-bottom: 1.75rem;
}

.title-page a {
  color: var(--plotter-blue);
}

.howto {
  margin: 2.1rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid #d8d6cf;
}

.howto h2,
.toc h2 {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 1rem;
}

.title-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 1.6rem;
  align-items: start;
}

.title-portrait {
  margin: 0 0 1.35rem;
  max-width: 13.5rem;
}

.title-portrait img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #d8d6cf;
}

.title-portrait figcaption {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  line-height: 1.4;
  color: #5c5f66;
  margin: 0.4rem 0 0;
}

@media (min-width: 40rem) {
  .title-masthead {
    grid-template-columns: minmax(0, 1fr) 13rem;
  }

  .title-masthead .lang-switch {
    grid-column: 1 / -1;
  }

  .title-portrait {
    grid-column: 2;
    grid-row: 2 / span 12;
    max-width: none;
    margin: 0.15rem 0 0;
  }
}

.howto-steps {
  list-style: disc;
  margin: 0.35rem 0 1rem;
  padding-left: 1.2rem;
}

.howto-steps li {
  display: list-item;
  margin: 0 0 0.42rem;
  font-size: 0.98rem;
}

.essay-plate {
  display: block;
  margin: 1.4rem 0 0;
  max-width: 18rem;
  text-decoration: none;
}

.essay-plate img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #d8d6cf;
}

.essay-plate span {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  margin-top: 0.4rem;
  color: var(--plotter-blue);
}

.essay-plate:hover span {
  text-decoration: underline;
}

.howto ul {
  list-style: none;
  margin: 0.2rem 0 1rem;
  padding: 0;
}

.howto li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
  margin: 0 0 0.85rem;
  font-size: 0.98rem;
}

.howto li span {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--plotter-blue);
}

.howto ul.howto-steps {
  list-style: disc;
  padding-left: 1.2rem;
}

.howto ul.howto-steps li {
  display: list-item;
  margin: 0 0 0.42rem;
}

.howto-note {
  font-size: 0.95rem;
  color: #3a3d44;
}

.memory {
  font-style: italic;
}

.memory-sign {
  display: block;
  margin-top: 0.55rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--plotter-blue);
}

.howto code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82em;
}

.toc {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d8d6cf;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eceae3;
}

.toc .num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--plotter-blue);
}

.chapter-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.chapter-link:hover { color: var(--plotter-blue); }

.toc .meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: #5c5f66;
}

.toc li.disabled .chapter-link,
.toc li.disabled .num {
  color: #9a9ca3;
  font-weight: 400;
}

.footer-copy {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  text-align: center;
  padding: 0 1rem 2.5rem;
  color: #5c5f66;
  line-height: 1.7;
  max-width: 42rem;
  margin: 0 auto;
}

.footer-copy a {
  color: #5c5f66;
  text-decoration: none;
}

.footer-copy a:hover { color: var(--plotter-blue); }

@media (min-width: 64rem) {
  .footer-copy {
    max-width: 72rem;
  }
}

.legal-h {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 1.75rem 0 0.7rem;
}

.legal-todo {
  background: #efece3;
  padding: 0 0.2em;
}

.related-list ul {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
}

.related-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eceae3;
}

.lang-switch {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
}

.lang-switch a {
  color: #5c5f66;
  text-decoration: none;
}

.lang-switch a:hover,
.lang-switch a[aria-current="page"] {
  color: var(--plotter-blue);
}

.lang-switch a[aria-current="page"] {
  font-weight: 600;
}

/* —— Kapitelseiten —— */
.chapter-body { overflow: hidden; }

canvas#c {
  position: fixed;
  inset: 0;
  display: block;
}

.chrome {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  pointer-events: none;
}

.chrome > * { pointer-events: auto; }

.chrome.top {
  top: 0;
  background: linear-gradient(to bottom, var(--chrome-fade), transparent);
}

.chrome.bottom {
  bottom: 0;
  z-index: 4;
  background: linear-gradient(to top, var(--chrome-fade) 55%, transparent);
}

.home-link,
.chapter-nav a,
.chapter-nav button {
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.home-link:hover,
.chapter-nav a:hover,
.chapter-nav button:hover {
  color: var(--plotter-blue);
}

.quadrant-mark {
  color: var(--plotter-blue);
  flex: 1;
  text-align: center;
}

.quadrant-mark b { font-weight: 600; }

.figure-approx {
  position: fixed;
  top: 2.55rem;
  left: 1.1rem;
  z-index: 3;
  margin: 0;
  max-width: min(28rem, calc(100vw - 3rem));
  padding: 0.35rem 0.55rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--plotter-blue);
  background: var(--chrome-fade);
  pointer-events: none;
}

.chapter-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.chapter-nav a[aria-disabled="true"] {
  color: #9a9ca3;
  pointer-events: none;
  cursor: default;
}

.param-dock {
  position: fixed;
  z-index: 2;
  top: 3.4rem;
  right: 0.7rem;
  left: auto;
  width: min(17.5rem, calc(100vw - 1.4rem));
  max-height: calc(100vh - 7.5rem);
  overflow: auto;
  background: rgba(250, 249, 245, 0.92);
  border: 1px solid #d8d6cf;
  padding: 0.75rem 0.85rem 0.9rem;
  transform: translateX(calc(100% + 1.2rem));
  transition: transform 0.22s ease;
  pointer-events: none;
}

.param-dock.open {
  transform: translateX(0);
  pointer-events: auto;
}

.param-dock.wide {
  width: min(22rem, calc(100vw - 1.4rem));
}

.param-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.7rem;
  border: 0;
  padding: 0;
}

.param-figures legend {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plotter-blue);
  padding: 0;
  margin: 0 0 0.35rem;
  flex: 1 0 100%;
}

.param-dock .param-figures label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-width: 1.7rem;
  padding: 0.18rem 0.2rem;
  border: 1px solid #d8d6cf;
  cursor: pointer;
  font-size: 0.68rem;
}

.param-figures input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.param-figures label:has(input:checked) {
  border-color: var(--plotter-blue);
  background: var(--plotter-blue);
  color: #fff;
}

.param-note {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  color: #5c5f66;
  margin: 0 0 0.55rem;
}

.param-live {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d8d6cf;
  padding: 0.4rem 0.45rem;
  margin: 0 0 0.65rem;
}

.param-dock label span[data-for],
.param-note [data-powers] {
  font-weight: 600;
  color: var(--plotter-blue);
}

.param-note a {
  color: var(--plotter-blue);
  text-underline-offset: 0.12em;
}

.param-kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plotter-blue);
  margin: 0 0 0.65rem;
}

.param-dock label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.6rem;
  align-items: baseline;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  margin: 0 0 0.45rem;
}

.param-dock input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  accent-color: var(--plotter-blue);
}

.param-dock input[type="number"] {
  grid-column: 1 / -1;
  font: inherit;
  border: 1px solid #d8d6cf;
  background: #fff;
  color: var(--ink);
  padding: 0.2rem 0.35rem;
}

.param-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.param-actions button {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--plotter-blue);
  background: none;
  border: 1px solid var(--plotter-blue);
  padding: 0.22rem 0.45rem;
  cursor: pointer;
}

.param-actions button:hover {
  background: var(--plotter-blue);
  color: #fff;
}

.param-actions button.is-playing,
.param-actions button[aria-pressed="true"] {
  background: var(--plotter-blue);
  color: #fff;
}

.original-preview {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid #d8d6cf;
  text-align: center;
}

.original-switch {
  display: flex;
  gap: 0.3rem;
  margin: 0 0 0.45rem;
}

.original-switch button {
  min-width: 1.7rem;
  padding: 0.18rem 0.35rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid #d8d6cf;
  cursor: pointer;
}

.original-switch button[aria-pressed="true"] {
  border-color: var(--plotter-blue);
  background: var(--plotter-blue);
  color: #fff;
}

.original-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  background: #fff;
  border: 1px solid #d8d6cf;
  vertical-align: top;
}

.original-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 12.5rem;
  cursor: zoom-in;
}

.original-zoom {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--plotter-blue);
  background: rgba(250, 249, 245, 0.92);
  border: 1px solid #d8d6cf;
  cursor: pointer;
}

.original-zoom:hover {
  background: var(--plotter-blue);
  color: #fff;
}

.original-zoom svg {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.original-preview figcaption {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: #5c5f66;
  margin: 0.4rem 0 0;
}

.original-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20, 22, 26, 0.72);
  cursor: zoom-out;
}

.original-lightbox[hidden] {
  display: none;
}

.original-lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  width: auto;
  height: auto;
  background: #fff;
  box-shadow: 0 0.4rem 2rem rgba(0, 0, 0, 0.35);
  cursor: default;
}

.original-lightbox-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}

.code-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  max-height: min(78vh, 42rem);
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid #d8d6cf;
  padding: 1.15rem 1.25rem 4.75rem;
  transform: translateY(110%);
  transition: transform 0.28s ease;
  pointer-events: none;
}

.code-panel.open,
.book-panel.open {
  transform: translateY(0);
  pointer-events: auto;
}

.book-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  max-height: min(78vh, 42rem);
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid #d8d6cf;
  padding: 1.15rem 1.25rem 4.75rem;
  transform: translateY(110%);
  transition: transform 0.28s ease;
  pointer-events: none;
}

.book-quote {
  font-family: "Literata", Georgia, serif;
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.6;
  max-width: 40rem;
  margin: 0 0 0.95rem;
  padding: 0 0 0 0.9rem;
  border-left: 2px solid var(--plotter-blue);
}

.book-cite {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.55;
  color: #5c5f66;
  margin: 1rem 0 0;
  max-width: 52rem;
}

.param-dock-close,
.code-panel-close {
  float: right;
  margin: 0 0 0.6rem 1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--plotter-blue);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.param-dock-close:hover,
.code-panel-close:hover { text-decoration: underline; }

.code-credit {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.55;
  color: #5c5f66;
  margin: 1rem 0 0;
  max-width: 52rem;
}

.code-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
  margin-bottom: 1.15rem;
}

.code-col {
  min-width: 0;
}

.code-col + .code-col {
  border-left: 1px solid #d8d6cf;
  padding-left: 1.5rem;
}

.code-kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plotter-blue);
  margin: 0 0 0.2rem;
}

.code-panel h3 {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.7rem;
}

.code-panel pre {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  line-height: 1.45;
  white-space: pre-wrap;
  margin: 0;
}

.explainer {
  font-size: 0.95rem;
  margin: 0;
  max-width: 52rem;
  padding-top: 0.85rem;
  border-top: 1px solid #eceae3;
}

.explainer code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82em;
}

.explainer a {
  color: var(--plotter-blue);
  text-underline-offset: 0.15em;
}

@media (max-width: 800px) {
  .code-compare {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .code-col + .code-col {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid #d8d6cf;
    padding-top: 1.15rem;
  }
}

/* PDF-Export (?pdf=1) und Druck: Grafik + Code, ohne Dock und Buchtext */
body.pdf-export {
  overflow: auto;
}
body.pdf-export.chapter-body {
  overflow: auto;
}
body.pdf-export .param-dock,
body.pdf-export .book-panel,
body.pdf-export #bookPanel,
body.pdf-export #toggleBook,
body.pdf-export #toggleParams,
body.pdf-export .original-preview,
body.pdf-export .original-lightbox,
body.pdf-export .figure-approx,
body.pdf-export .chrome.bottom,
body.pdf-export .lang-switch,
body.pdf-export .code-panel-close {
  display: none !important;
}
body.pdf-export .chrome.top {
  position: relative;
  background: transparent;
}
body.pdf-export canvas#c {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}
body.pdf-export .code-panel,
body.pdf-export .code-panel.open {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  max-height: none;
  overflow: visible;
  pointer-events: auto;
  padding: 1.15rem 1.25rem 2rem;
  page-break-before: always;
  break-before: page;
}

@media print {
  html, body {
    background: #fff;
  }
  .param-dock,
  .book-panel,
  #bookPanel,
  #toggleBook,
  #toggleParams,
  .original-preview,
  .original-lightbox,
  .figure-approx,
  .chrome.bottom,
  .lang-switch,
  .code-panel-close {
    display: none !important;
  }
  .chrome.top {
    position: relative;
    background: transparent;
  }
  canvas#c {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: 240mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .code-panel,
  .code-panel.open {
    position: relative !important;
    transform: none !important;
    max-height: none !important;
    overflow: visible !important;
    pointer-events: auto;
    padding-bottom: 1.5rem;
    break-before: page;
  }
  .code-panel pre {
    white-space: pre-wrap;
  }
}

@media (max-width: 959px) {
  .param-dock {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 3;
    width: 100%;
    max-height: none;
    overflow: auto;
    transform: translateY(100%);
    padding: 0.55rem 0.85rem calc(3.8rem + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid #d8d6cf;
    background: rgba(250, 249, 245, 0.97);
  }

  .param-dock.open,
  .param-dock.wide.open {
    transform: none;
    width: 100%;
    max-height: min(46vh, 24rem);
    pointer-events: auto;
  }

  .param-dock-close {
    display: none;
  }

  .param-dock form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.75rem;
  }

  .param-dock .param-kicker,
  .param-dock .param-figures,
  .param-dock .param-note,
  .param-dock .param-live,
  .param-dock .param-actions {
    grid-column: 1 / -1;
  }

  .param-dock input[type="range"] {
    min-height: 1.7rem;
  }

  .param-dock input[type="number"] {
    font-size: 1rem;
    padding: 0.35rem 0.4rem;
  }

  .original-preview img {
    max-height: 5rem;
  }
}

@media (max-width: 520px) {
  .original-preview {
    display: none;
  }
}

@media (max-width: 640px) {
  .chrome {
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    padding: 0.55rem 0.8rem;
  }
  .figure-approx {
    top: 4.4rem;
    left: 0.8rem;
  }
  .toc li {
    grid-template-columns: 1.6rem 1fr;
  }
  .toc .meta {
    grid-column: 2;
  }
}
