:root {
  color-scheme: light;
  --board-column-min: 116px;
  --board-column-gap: 10px;
  --program-marker-width: 32px;
  --program-row-padding-left: 8px;
  --patchboard-left-inset: calc(var(--program-row-padding-left) + var(--program-marker-width) + var(--board-column-gap));
  --board-main-min: 1300px;
  --board-control-width: 96px;
  --case: #4d4539;
  --case-dark: #302d28;
  --case-edge: #786f5e;
  --panel: #e4d7af;
  --panel-blue: #1e9ac4;
  --panel-gold: #f4c858;
  --ink: #201d19;
  --muted: #6d665c;
  --line: #b5a985;
  --lamp-off: #f5eee1;
  --lamp-on: #ffcf4a;
  --green: #26724b;
  --red: #b13d32;
  --blue: #176f9d;
  --paper: #faf7ec;
  --shadow: 0 18px 45px rgba(39, 33, 25, 0.2);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 32%, rgba(0, 0, 0, 0.05)),
    #d8ccad;
  color: var(--ink);
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 18vw, 340px);
  gap: 18px;
  width: 100%;
  min-height: 100vh;
  padding: 18px;
  margin: 0 auto;
}

.shell.side-collapsed {
  grid-template-columns: minmax(0, 1fr) 52px;
}

.console {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--case), var(--case-dark));
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 6px 4px 0;
  color: #fff8e8;
}

.maker {
  margin: 0 0 3px;
  color: #d8caa9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.7rem, 3vw, 3.2rem);
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
}

.program-picker {
  display: grid;
  gap: 6px;
  min-width: 280px;
}

.program-picker label {
  color: #d8caa9;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

select,
.small-button {
  min-height: 38px;
  border: 1px solid #9c8f6d;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

select {
  width: 100%;
  padding: 0 32px 0 10px;
}

.lamp-panel {
  display: grid;
  grid-template-columns: minmax(var(--board-main-min), 1fr) var(--board-control-width);
  row-gap: 10px;
  column-gap: 12px;
  padding: 14px;
  overflow: auto;
  border-radius: 7px;
  background: #27241f;
  border: 2px solid #786d5a;
}

.lamp-row {
  position: relative;
  grid-column: 1;
  display: grid;
  grid-template-columns: repeat(10, minmax(var(--board-column-min), 1fr));
  gap: 0 var(--board-column-gap);
  padding: 7px 0 8px var(--patchboard-left-inset);
  border-radius: 5px;
  background: #171511;
}

.program-row-markers,
.program-card-column {
  display: grid;
  grid-template-rows: minmax(52px, auto) 84px;
  gap: 5px;
  min-width: 0;
}

.program-row-markers {
  position: absolute;
  left: var(--program-row-padding-left);
  top: 7px;
  bottom: 8px;
  width: var(--program-marker-width);
  align-items: center;
  justify-items: center;
  color: #f6f0dc;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.25rem, 1.8vw, 1.8rem);
  line-height: 1;
  text-transform: uppercase;
}

.question-cell {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 52px;
  padding: 6px 5px;
  border-radius: 5px;
  border: 2px solid #171511;
  background: linear-gradient(#fffaf0, #e9dfc8);
  color: #342f27;
  text-align: center;
}

.lamp {
  min-height: 84px;
  padding: 8px 6px;
  border-radius: 5px;
  border: 2px solid #171511;
  background: linear-gradient(#fbf6e9, var(--lamp-off));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  color: #342f27;
  text-align: center;
}

.lamp.on {
  background: radial-gradient(circle at 50% 34%, #fff6b3, var(--lamp-on) 58%, #d68e23);
  box-shadow: 0 0 22px rgba(255, 197, 48, 0.78);
}

.question-label,
.lamp-label {
  min-height: 28px;
  display: grid;
  place-items: center;
  font-size: clamp(0.58rem, 0.95vw, 0.78rem);
  font-weight: 850;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.question-label {
  min-height: 30px;
}

.workbench {
  display: grid;
  min-height: 0;
}

.board,
.side,
.facts {
  border-radius: 8px;
}

.board {
  background: var(--panel);
  border: 2px solid var(--case-edge);
  min-width: 0;
}

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

.small-button {
  padding: 0 12px;
  font-weight: 800;
}

.small-button.active {
  background: #244d3e;
  border-color: #244d3e;
  color: #fff9e9;
}

.small-button.confirming {
  background: #8f2f27;
  border-color: #6d241d;
  color: #fff9e9;
}

.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.board-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  flex-wrap: wrap;
}

.patch-deck {
  position: relative;
  display: grid;
  grid-template-columns: minmax(var(--board-main-min), 1fr) var(--board-control-width);
  grid-template-areas: "main controls";
  gap: 12px;
  min-height: 620px;
  padding: 14px;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(111, 98, 64, 0.1), transparent 9%, transparent 91%, rgba(111, 98, 64, 0.1)),
    #dccb94;
}

.wire-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
}

.wire-layer path {
  fill: none;
  stroke-linecap: round;
  stroke-width: 5;
  filter: drop-shadow(0 2px 2px rgba(34, 25, 14, 0.38));
}

.wire-layer .guide-wire {
  opacity: 0.36;
  stroke-dasharray: 12 10;
  stroke-width: 4;
  filter: drop-shadow(0 1px 1px rgba(34, 25, 14, 0.18));
}

.wire-layer .preview-wire {
  stroke: #ffe16b;
  stroke-dasharray: 10 8;
  stroke-width: 6;
  opacity: 0.92;
  pointer-events: none;
  filter:
    drop-shadow(0 0 5px rgba(255, 220, 83, 0.82))
    drop-shadow(0 2px 2px rgba(34, 25, 14, 0.38));
}

.wire-layer .real-wire {
  opacity: 0.96;
  pointer-events: none;
}

.wire-layer .wire-group {
  pointer-events: auto;
}

.wire-layer .wire-hit {
  stroke: transparent;
  stroke-width: 20;
  pointer-events: stroke;
  filter: none;
}

.wire-layer .wire-delete {
  cursor: pointer;
  opacity: 0;
  pointer-events: all;
  transition: opacity 120ms ease, transform 120ms ease;
}

.wire-layer .wire-delete circle {
  fill: #fff8e4;
  stroke: #6d3329;
  stroke-width: 2;
  filter: drop-shadow(0 2px 3px rgba(34, 25, 14, 0.35));
}

.wire-layer .wire-delete line {
  stroke: #6d3329;
  stroke-linecap: round;
  stroke-width: 3;
  filter: none;
}

.wire-layer .wire-group:hover .wire-delete,
.wire-layer .wire-hit:hover ~ .wire-delete,
.wire-layer .wire-delete:hover,
.wire-layer .wire-delete.visible,
.wire-layer .wire-delete:focus {
  opacity: 1;
}

.wire-layer .wire-group:hover .real-wire,
.wire-layer .wire-group.is-hovered .real-wire {
  stroke-width: 7;
  opacity: 1;
  filter:
    drop-shadow(0 0 5px rgba(255, 245, 184, 0.9))
    drop-shadow(0 3px 3px rgba(34, 25, 14, 0.45));
}

.lamp-springs,
.switch-modules,
.main-board,
.right-controls,
.supply-row,
.switch-terminal-row {
  position: relative;
  z-index: 5;
}

.main-board {
  grid-area: main;
  display: grid;
  grid-template-rows: auto minmax(400px, 1fr);
  gap: 12px;
  min-width: var(--board-main-min);
  padding-left: var(--patchboard-left-inset);
}

.right-controls {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  min-width: var(--board-control-width);
  padding-top: 80px;
}

.lamp-springs {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--board-column-gap);
}

.lamp-spring-card,
.supply-card {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 68px;
  padding: 7px 6px;
  border-radius: 5px;
  border: 1px solid #b8a672;
  background: #efe3bb;
}

.switch-modules {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--board-column-gap);
  align-items: stretch;
}

.switch-module {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-width: var(--board-column-min);
  min-height: 560px;
  padding: 9px 7px;
  border-radius: 5px;
  background: #eadcae;
  border: 1px solid #b6a06a;
}

.switch-module:nth-child(even) {
  background: #1d9eca;
  border-color: #167a9b;
}

.module-head {
  display: grid;
  gap: 3px;
  min-height: 44px;
  text-align: center;
}

.module-head strong {
  font-size: 0.94rem;
  font-weight: 950;
}

.module-head span {
  min-height: 26px;
  color: #4a4339;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.switch-module:nth-child(even) .module-head span {
  color: #093847;
}

.spring-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  align-content: start;
}

.contact-row {
  position: relative;
  display: grid;
  grid-template-columns: 15px 28px 28px 15px;
  gap: 3px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 2px 1px;
  border-radius: 4px;
}

.contact-row::before {
  content: "";
  position: absolute;
  left: 35px;
  right: 35px;
  top: 50%;
  height: 3px;
  border-radius: 99px;
  transform: translateY(-50%);
  background: rgba(81, 68, 43, 0.16);
}

.contact-row.closed::before {
  height: 6px;
  background: rgba(31, 95, 58, 0.56);
  box-shadow: 0 0 9px rgba(255, 241, 161, 0.78);
}

.up-contact {
  background: rgba(255, 249, 220, 0.32);
}

.down-contact {
  background: rgba(79, 64, 35, 0.08);
}

.up-contact + .down-contact {
  margin-top: 3px;
}

.down-contact + .up-contact {
  margin-top: 12px;
}

.spring-terminal {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 26px;
  min-height: 28px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(68, 55, 33, 0.48);
  background: transparent;
  color: #2f281e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 900;
  z-index: 2;
}

.spring-terminal::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #f9f0cf 0 2px, #6f624a 2px 4px, #f9f0cf 4px 6px);
  box-shadow:
    inset 0 0 0 2px #3c3327,
    0 1px 2px rgba(0, 0, 0, 0.32);
}

.spring-terminal.hot::before {
  background:
    repeating-radial-gradient(circle at 50% 50%, #fff8b4 0 2px, #d88915 2px 4px, #fff8b4 4px 6px);
  box-shadow:
    inset 0 0 0 2px #654319,
    0 0 13px rgba(255, 199, 53, 0.86);
}

.spring-terminal.selected {
  outline: 4px solid #f7c948;
  outline-offset: 3px;
  background: rgba(255, 226, 95, 0.42);
  box-shadow:
    0 0 0 6px rgba(87, 53, 19, 0.18),
    0 0 22px rgba(255, 217, 75, 0.9);
  animation: selected-spring-pulse 1.1s ease-in-out infinite;
}

.spring-terminal.selected::before {
  background:
    repeating-radial-gradient(circle at 50% 50%, #fff9ba 0 2px, #d88915 2px 4px, #fff9ba 4px 6px);
  box-shadow:
    inset 0 0 0 2px #6c4612,
    0 0 13px rgba(255, 207, 74, 0.96);
}

@keyframes selected-spring-pulse {
  0%,
  100% {
    outline-offset: 3px;
  }

  50% {
    outline-offset: 6px;
  }
}

.spring-terminal.connected {
  border-color: rgba(30, 61, 92, 0.8);
  background: rgba(255, 255, 255, 0.32);
}

.spring-terminal.guided {
  outline: 2px dashed rgba(36, 77, 62, 0.68);
  outline-offset: 2px;
}

.switch-toggle {
  justify-self: center;
  width: 44px;
  height: 78px;
  padding: 7px;
  border-radius: 5px;
  background: #2f2b24;
  display: grid;
  align-content: end;
}

.switch-toggle.up {
  align-content: start;
}

.switch-knob {
  height: 35px;
  border-radius: 4px;
  background: linear-gradient(#f6f1e6, #9b917d);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.terminal-label {
  color: #433a2a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 950;
  text-align: center;
  z-index: 2;
}

.switch-module:nth-child(even) .terminal-label {
  color: #053747;
}

.labeled-terminal {
  display: inline-grid;
  grid-template-columns: 28px minmax(0, auto);
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.spring-name {
  color: #393226;
  font-size: 0.72rem;
  font-weight: 950;
  text-align: left;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.board-head p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.switch-station {
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: start;
  justify-items: center;
  justify-self: stretch;
  align-self: end;
  margin-top: auto;
  width: 100%;
  padding: 0 0 17px;
}

.power-button {
  width: 82px;
  min-height: 62px;
  border-radius: 6px;
  background: linear-gradient(#f9f3df, #d3c392);
  border: 3px solid #7c704f;
  color: #5b2720;
  font-weight: 950;
  box-shadow: 0 7px 0 #514731;
}

.power-button.held {
  translate: 0 5px;
  box-shadow: 0 2px 0 #514731;
}

.supply-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  align-self: start;
  justify-self: stretch;
  min-width: 0;
}

.switch-terminal-row {
  display: grid;
  grid-template-columns: repeat(2, 28px);
  gap: 14px;
  width: 100%;
  justify-content: center;
  align-items: start;
}

.supply-card {
  min-height: 78px;
  background: #d2c087;
}

.switch-terminal-card {
  min-height: 0;
}

.switch-terminal-card .labeled-terminal {
  grid-template-columns: 28px;
  justify-items: center;
  gap: 3px;
}

.right-controls .supply-card {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.right-controls .spring-terminal {
  background: rgba(255, 248, 221, 0.24);
}

.wire-tray {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 248, 224, 0.55);
}

.guide-list {
  min-height: 36px;
  max-height: 132px;
  overflow: auto;
  border-radius: 5px;
  background: rgba(255, 247, 223, 0.78);
}

.guide-list:empty {
  display: none;
}

.guide-head,
.guide-empty {
  padding: 8px 10px 5px;
  color: #4d4434;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.guide-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 5px;
  padding: 0 8px 8px;
}

.guide-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #fff4cf;
  border-left: 4px solid #8b7348;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.guide-item span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #244d3e;
  color: #fff9e9;
  font-size: 0.66rem;
}

.guide-item strong {
  overflow-wrap: anywhere;
}

.guide-item.done {
  opacity: 0.58;
  text-decoration: line-through;
}

.manual-guide {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  border-radius: 5px;
  background: rgba(255, 247, 223, 0.78);
}

.manual-guide:empty {
  display: none;
}

.manual-guide a {
  display: block;
  padding: 8px;
  color: inherit;
}

.manual-guide img {
  display: block;
  width: 100%;
  max-height: min(76vh, 900px);
  object-fit: contain;
  object-position: left top;
  border-radius: 4px;
  border: 1px solid rgba(75, 65, 48, 0.26);
  background: #f8f2df;
}

.wire-list {
  display: flex;
  grid-column: auto / -1;
  flex-wrap: wrap;
  gap: 7px;
  align-content: center;
  max-height: 132px;
  overflow: auto;
  padding-right: 4px;
}

.guide-list:empty + .wire-list {
  grid-column: 1 / -1;
}

.wire {
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 5px;
  background: #fff7df;
  border-left: 5px solid var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  min-width: 172px;
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.wire > span {
  overflow-wrap: anywhere;
}

.wire.is-hovered {
  background: #fff0bc;
  box-shadow:
    inset 0 0 0 2px rgba(64, 49, 23, 0.18),
    0 3px 8px rgba(66, 48, 20, 0.18);
  transform: translateY(-1px);
}

.wire-remove {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: #fff8e4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

.wire-remove::before,
.wire-remove::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 3px;
  border-radius: 99px;
  background: #6d3329;
}

.wire-remove::before {
  transform: rotate(45deg);
}

.wire-remove::after {
  transform: rotate(-45deg);
}

.wire:hover .wire-remove,
.wire.is-hovered .wire-remove,
.wire:focus-within .wire-remove {
  opacity: 1;
  pointer-events: auto;
}

.wire-remove:hover,
.wire-remove:focus {
  transform: scale(1.08);
}

.wire:nth-child(4n + 2) {
  border-left-color: var(--red);
}

.wire:nth-child(4n + 3) {
  border-left-color: var(--green);
}

.wire:nth-child(4n + 4) {
  border-left-color: #c8891c;
}

.side {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-width: 0;
  align-content: start;
}

.side-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid rgba(75, 65, 48, 0.24);
}

.side-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.side-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-title h2 {
  overflow-wrap: anywhere;
}

.side-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  background: #244d3e;
  color: #fff9e9;
  font-weight: 850;
}

.toggle-icon {
  width: 10px;
  height: 10px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.side-content {
  display: grid;
  gap: 14px;
  min-width: 0;
  align-content: start;
  align-items: start;
}

.side.is-collapsed {
  gap: 0;
}

.side.is-collapsed .side-head {
  justify-content: center;
  padding: 8px;
}

.side.is-collapsed .side-title,
.side.is-collapsed .side-content {
  display: none;
}

.side.is-collapsed .side-toggle {
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.side.is-collapsed .toggle-icon {
  transform: rotate(225deg);
}

.side.is-collapsed .toggle-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

figure {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #241f18;
  border: 2px solid rgba(55, 47, 36, 0.25);
  align-self: start;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
}

.facts {
  padding: 14px;
  background: var(--paper);
  border: 1px solid rgba(75, 65, 48, 0.24);
}

.facts h2 {
  margin-bottom: 10px;
}

.facts p {
  margin: 0 0 10px;
  color: #554c41;
  line-height: 1.45;
}

.pdf-download {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 56px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  background: #244d3e;
  color: #fff9e9;
  text-decoration: none;
}

.pdf-download:focus,
.pdf-download:hover {
  background: #1c3f32;
}

.pdf-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 36px;
  border-radius: 4px;
  background: #fff9e9;
  color: #244d3e;
  font-size: 0.68rem;
  font-weight: 950;
}

.pdf-download strong,
.pdf-download small {
  display: block;
  overflow-wrap: anywhere;
}

.pdf-download strong {
  font-size: 0.88rem;
  line-height: 1.1;
}

.pdf-download small {
  margin-top: 3px;
  color: #d8e4d5;
  font-size: 0.72rem;
  font-weight: 750;
}

@media (max-width: 1500px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .shell.side-collapsed {
    grid-template-columns: 1fr;
  }

  .side {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .side-head,
  .facts {
    grid-column: 1 / -1;
  }

  .side-content {
    display: contents;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 10px;
  }

  .console {
    padding: 10px;
  }

  .topbar,
  .side {
    grid-template-columns: 1fr;
  }

  .side-content {
    display: grid;
  }

  .topbar {
    display: grid;
  }

  .program-picker {
    min-width: 0;
  }

  h1 {
    font-size: 1.55rem;
    line-height: 0.98;
  }

  .lamp-label {
    font-size: 0.62rem;
  }

  .board-head,
  .board-actions,
  .switch-station,
  .wire-tray {
    display: grid;
    grid-template-columns: 1fr;
  }

  .patch-deck {
    grid-template-columns: minmax(var(--board-main-min), 1fr) minmax(var(--board-control-width), 0.11fr);
    grid-template-areas: "main controls";
    min-height: 600px;
  }

  .wire-list {
    max-height: none;
  }

  .main-board {
    min-width: var(--board-main-min);
  }

  .right-controls {
    width: var(--board-control-width);
    min-width: 0;
  }

  .supply-row {
    min-width: 0;
  }

  .switch-station {
    min-width: 0;
    justify-self: stretch;
  }

  .switch-terminal-row {
    grid-template-columns: repeat(2, minmax(42px, 1fr));
  }

  .power-button {
    justify-self: center;
  }
}
