/* RackPlaner – Gestaltung
   Arbeitsoberfläche, kein Schaufenster: dicht, ruhig, das Rack ist die
   Hauptsache. Farben nach EDV-Galli; Abstände nur aus der Skala
   4 / 8 / 12 / 16 / 24 / 32 / 48, ein Radius, Schatten nur für Dialoge.

   Abweichung von der Markenvorgabe: Haupt-Knöpfe sind dunkelblau statt
   #4A90D9, weil weiße Schrift auf #4A90D9 den Kontrast 4,5:1 nicht erreicht.
   #4A90D9 kennzeichnet stattdessen Fokus, aktive Zustände und die Vorschau. */

:root {
  --dunkelblau: #1B2F5E;
  --blau: #4A90D9;
  --tuerkis: #00BCD4;
  --text: #1D2433;
  --text-leise: #56607A;
  --flaeche: #FFFFFF;
  --grund: #F3F5F8;
  --linie: #D5DAE3;
  --rot: #B3261E;
  --rot-grund: #FCEEEE;
  --gelb-grund: #FFF4D6;
  --gelb-linie: #B58100;
  --gruen: #1B7A3E;
  --radius: 4px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 14px/1.5 var(--schrift);
}

h1, h2 { color: var(--dunkelblau); line-height: 1.2; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
p { margin: 0; }
a { color: var(--dunkelblau); }

:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; }

.nur-vorlesen {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.lade-hinweis { padding: 48px 16px; text-align: center; color: var(--text-leise); }

/* ---------- Kopfzeile ---------- */

.kopf {
  display: flex; align-items: center; gap: 24px;
  padding: 0 16px; min-height: 48px;
  background: var(--dunkelblau); color: #fff;
}
.kopf__marke { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; font-size: 16px; text-decoration: none; }
.kopf__menue { display: flex; gap: 4px; flex: 1; align-self: stretch; }
.kopf__punkt {
  display: flex; align-items: center; padding: 0 12px;
  color: #D7DEEC; text-decoration: none; border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.kopf__punkt:hover { color: #fff; }
.kopf__punkt[aria-current="page"] { color: #fff; border-bottom-color: var(--tuerkis); font-weight: 600; }
.kopf__benutzer { display: flex; align-items: center; gap: 12px; }
.kopf :focus-visible { outline-color: #fff; }

/* ---------- Seitenaufbau ---------- */

.inhalt { max-width: 1440px; margin: 0 auto; padding: 16px; }

.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.seitenkopf__unter { color: var(--text-leise); margin-top: 4px; }
.seitenkopf__aktionen { display: flex; flex-wrap: wrap; gap: 8px; }

.pfad { color: var(--text-leise); font-size: 12px; margin-bottom: 4px; }

.leer { padding: 32px 16px; text-align: center; color: var(--text-leise); background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius); }
.leer p + p, .leer h1 + p { margin-top: 8px; }
.leer .knopf { margin-top: 16px; }
.leer--klein { padding: 16px; }

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 4px 12px;
  border: 1px solid #9AA4B8; border-radius: var(--radius);
  background: var(--flaeche); color: var(--text);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.knopf:hover { background: #EAEEF4; }
.knopf:disabled { opacity: .55; cursor: not-allowed; }
.knopf--haupt { background: var(--dunkelblau); border-color: var(--dunkelblau); color: #fff; }
.knopf--haupt:hover { background: #142447; }
.knopf--gefahr { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf--gefahr:hover { background: #8F1E18; }
.knopf--still-gefahr { color: var(--rot); border-color: transparent; background: transparent; }
.knopf--still-gefahr:hover { background: var(--rot-grund); }
.knopf--kopf { background: transparent; border-color: #7C8BAE; color: #fff; }
.knopf--kopf:hover { background: #2A4078; }

/* ---------- Tabellen ---------- */

.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabelle th, .tabelle td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--linie); }
.tabelle thead th { font-size: 12px; font-weight: 600; color: var(--text-leise); background: #F8F9FB; white-space: nowrap; }
.tabelle tbody th { font-weight: 600; }
.tabelle tbody tr:last-child > * { border-bottom: 0; }
.tabelle tfoot th, .tabelle tfoot td { font-weight: 600; border-top: 2px solid var(--dunkelblau); border-bottom: 0; }
.tabelle .zahl { text-align: right; white-space: nowrap; }
.tabelle__neben { display: block; font-size: 12px; font-weight: 400; color: var(--text-leise); }
.tabelle__aktionen { white-space: nowrap; text-align: right; }
.tabelle__aktionen .knopf + .knopf { margin-left: 16px; }

.marke { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: var(--radius); font-size: 12px; font-weight: 600; }
.marke--warnung { background: var(--gelb-grund); color: #6B4B00; border: 1px solid var(--gelb-linie); }

.marke--quelle { background: #E3EEFB; color: var(--dunkelblau); border: 1px solid #A9C6EC; font-weight: 400; }
.warnungen { list-style: none; margin: 12px 0 0; padding: 8px 12px; background: var(--gelb-grund); border-left: 4px solid var(--gelb-linie); border-radius: var(--radius); }

/* ---------- Übersicht ---------- */

.standort { margin-bottom: 32px; }
.standort__kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: 8px; }
.standort__ort { font-weight: 400; }
.standort__adresse { color: var(--text-leise); font-size: 12px; }
.standort__aktionen { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Formulare ---------- */

.formular__felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.feld--breit { grid-column: 1 / -1; }
.feld label, .anschluesse legend { display: block; margin-bottom: 4px; font-weight: 600; }
.feld__optional { font-weight: 400; color: var(--text-leise); }
.feld__eingabe { display: flex; align-items: center; gap: 8px; }
.feld__einheit { color: var(--text-leise); }
.feld__hinweis { margin-top: 4px; font-size: 12px; color: var(--text-leise); }
.feld__fehler { font-size: 12px; font-weight: 600; color: var(--rot); }
.feld__fehler:empty { display: none; }

input, select, textarea {
  width: 100%; min-height: 36px; padding: 4px 8px;
  border: 1px solid #7C8699; border-radius: var(--radius);
  background: var(--flaeche); color: var(--text); font: inherit;
}
textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--rot); border-width: 2px; }

.formular__fehler { margin-bottom: 16px; padding: 8px 12px; background: var(--rot-grund); border-left: 4px solid var(--rot); border-radius: var(--radius); color: #7A1A14; font-weight: 600; }
.formular__aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.formular__gefahr { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--linie); }

.vorschlag { margin-bottom: 16px; padding: 12px; background: #EEF3FA; border-left: 4px solid var(--blau); border-radius: var(--radius); font-size: 12px; }
.vorschlag p + p, .vorschlag ul + p { margin-top: 8px; }
.vorschlag ul { margin: 4px 0 0; padding-left: 16px; }
.vorschlag a { overflow-wrap: anywhere; }
.vorschlag__titel { font-weight: 600; }
.abruf__art { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0 0 16px; padding: 0; border: 0; }
.abruf__art legend { margin-bottom: 4px; font-weight: 600; }
input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--dunkelblau); }
input[type="file"] { padding: 4px; }
.abruf__stand { margin-top: 16px; color: var(--text-leise); }
.abruf__stand:empty { display: none; }
.seitenkopf__hinweis { margin: -8px 0 16px; }

.dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 24px; border: 0; border-radius: var(--radius); box-shadow: 0 8px 32px rgba(27, 47, 94, .28); color: var(--text); }
.dialog::backdrop { background: rgba(20, 30, 55, .5); }
.dialog--schmal { width: min(420px, calc(100vw - 32px)); }
.dialog h2 { font-size: 20px; margin-bottom: 16px; }

.anschluesse { margin: 24px 0 0; padding: 0; border: 0; }
.anschluesse__zeilen { display: grid; gap: 8px; margin-bottom: 8px; }
.anschluesse__zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.anschluesse__zeile select { width: auto; flex: 1 1 120px; }
.anschluesse__anzahl { width: 72px; }
.anschluesse__start { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.anschluesse__start input { width: 72px; }

/* ---------- Anmeldung ---------- */

.anmeldung-seite { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.anmeldung { width: min(360px, 100%); padding: 32px 24px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.anmeldung__logo { display: block; margin-bottom: 16px; }
.anmeldung__text { margin: 4px 0 24px; color: var(--text-leise); }
.anmeldung__hinweis { margin-top: 16px; }
.anmeldung .formular__aktionen { margin-top: 0; }
.anmeldung .formular__aktionen .knopf { width: 100%; min-height: 44px; }

/* ---------- Schrankansicht ---------- */

.schrank-zahlen { margin-bottom: 16px; }
.schrank-zahlen dl { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 12px 16px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.schrank-zahlen dt { font-size: 12px; color: var(--text-leise); }
.schrank-zahlen dd { margin: 0; font-size: 20px; font-weight: 600; color: var(--dunkelblau); font-variant-numeric: tabular-nums; }
.schrank-zahlen__grenze { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--text-leise); }

.arbeitsflaeche { display: grid; grid-template-columns: 280px minmax(320px, 1fr) 340px; gap: 16px; align-items: start; }
.bibliothek-spalte, .detail { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; }
.bibliothek-spalte h2, .detail h2 { margin-bottom: 12px; }
.bibliothek-spalte { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }

.vorlagen { list-style: none; margin: 12px -16px -16px; padding: 0; overflow-y: auto; border-top: 1px solid var(--linie); }
.vorlagen li + li { border-top: 1px solid var(--linie); }
.vorlage { display: block; width: 100%; min-height: 44px; padding: 8px 16px; border: 0; border-left: 4px solid transparent; background: none; color: inherit; font: inherit; text-align: left; cursor: grab; }
.vorlage:hover { background: #EEF3FA; }
.vorlage[aria-pressed="true"] { background: #E3EEFB; border-left-color: var(--blau); }
.vorlage:disabled { cursor: not-allowed; color: var(--text-leise); }
.vorlage__name { display: block; font-weight: 600; }
.vorlage__daten { display: block; font-size: 12px; color: var(--text-leise); }

.rack-leiste { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 24px; margin-bottom: 12px; }
.schalter { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--dunkelblau); }

.seitenwahl { display: inline-flex; border: 1px solid #9AA4B8; border-radius: var(--radius); overflow: hidden; }
.seitenwahl__knopf { min-height: 36px; padding: 4px 16px; border: 0; background: var(--flaeche); color: var(--text); font: inherit; cursor: pointer; }
.seitenwahl__knopf + .seitenwahl__knopf { border-left: 1px solid #9AA4B8; }
.seitenwahl__knopf[aria-pressed="true"] { background: var(--dunkelblau); color: #fff; font-weight: 600; }
.seitenwahl__knopf:focus-visible { outline-offset: -3px; }

.rack-spalte { text-align: center; }
.rack-halter { max-width: 560px; margin: 0 auto; }
.rack-hinweis { min-height: 42px; margin-top: 8px; color: var(--rot); font-weight: 600; }

.detail__leer { color: var(--text-leise); }
.detail__leer + .detail__leer { margin-top: 8px; }
.detail__modell { margin: -8px 0 12px; color: var(--text-leise); }
.detail__daten { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0 16px; padding-bottom: 16px; border-bottom: 1px solid var(--linie); font-size: 12px; }
.detail__daten dt { color: var(--text-leise); }
.detail__daten dd { margin: 0; }

.detail__anschluesse { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--linie); }
.detail__abschnitt { margin: 24px 0 12px; padding-top: 16px; border-top: 1px solid var(--linie); font-size: 14px; color: var(--dunkelblau); }
.portraster h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--text-leise); }
.portraster + .portraster { margin-top: 12px; }
.portraster__ports { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; }
.portknopf { min-height: 36px; padding: 0; border: 1px solid #7C8699; border-radius: var(--radius); background: var(--flaeche); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.portknopf:hover { background: #E3EEFB; }
.portknopf--verbunden { background: var(--dunkelblau); border-color: var(--dunkelblau); color: #fff; font-weight: 600; }
.portknopf--verbunden:hover { background: #2A4078; }
.knopf--zurueck { margin-bottom: 12px; }
.knopf[aria-pressed="true"] { background: #E3EEFB; border-color: var(--blau); }
.verbindung__ziel { margin-bottom: 8px; }
.verbindung__ziel + .knopf { margin-bottom: 16px; }
.beschriftung__vorschau { margin-top: 16px; color: var(--text-leise); }
.beschriftung__vorschau:empty { display: none; }

.verlauf { margin-top: 24px; }
.verlauf summary { padding: 8px 0; font-weight: 600; color: var(--dunkelblau); cursor: pointer; }
.verlauf__zeit { white-space: nowrap; }

/* ---------- Rack (SVG) ---------- */

.rack { display: block; width: 100%; height: auto; font-family: var(--schrift); user-select: none; -webkit-user-select: none; }
.rack__gehaeuse { fill: #2B3242; }
.rack__innen { fill: #EEF1F5; }
.rack__schiene { fill: #C3CAD6; }
.rack__linie { stroke: #CCD2DC; stroke-width: 1; }
.rack__he { fill: #3A4358; font-size: 10px; text-anchor: middle; font-variant-numeric: tabular-nums; }

.rack__geraet { cursor: pointer; }
.rack__geraet:focus { outline: none; }
.rack__koerper { fill: #2A3550; stroke: #141B2B; stroke-width: 1; }
.rack__name { fill: #fff; font-size: 11px; font-weight: 600; }
.rack__modell { fill: #C5CEE0; font-size: 9.5px; }
.rack__geraet--hell .rack__koerper { fill: #D3D8E1; stroke: #7C8699; }
.rack__geraet--hell .rack__name { fill: var(--text); }
.rack__geraet--hell .rack__modell { fill: #4A5468; }
.rack__geraet:hover .rack__koerper { stroke: var(--blau); stroke-width: 2; }
.rack__geraet:focus-visible .rack__koerper { stroke: var(--blau); stroke-width: 3; }
.rack__geraet--gewaehlt .rack__koerper { stroke: var(--tuerkis); stroke-width: 3; }

.rack__geraet--abgewandt .rack__koerper { fill: #DCE1EA; stroke: #7C8699; stroke-dasharray: 4 3; }
.rack__geraet--abgewandt .rack__name { fill: #4A5468; font-weight: 400; }
.rack__geraet--abgewandt .rack__modell { fill: #4A5468; }
.rack__geraet--abgewandt .rack__port--kupfer { fill: #56607A; }

.rack__port { stroke-width: 1; }
.rack__port--kupfer { fill: #A9B8D1; stroke: #0F1626; }
.rack__port--modul { fill: #141B2B; stroke: #A9B8D1; }
.rack__port--strom { fill: #6B7487; stroke: #0F1626; }
.rack__geraet--hell .rack__port--kupfer { fill: #56607A; }

.rack__port[data-port] { cursor: pointer; }
.rack__port[data-port]:hover { stroke: var(--tuerkis); stroke-width: 2; }
.rack__port--verbunden { fill: #F2F5FA; }
.rack__geraet--hell .rack__port--verbunden { fill: #1D2433; }
.rack__port--gewaehlt { stroke: var(--tuerkis); stroke-width: 2.5; }

.rack__kabelschicht { pointer-events: none; }
.rack__kabel, .rack__kabel-rand { fill: none; stroke-linecap: round; }
.rack__kabel-rand { stroke: #0F1626; stroke-width: 4; opacity: .55; }
.rack__kabel { stroke-width: 2.2; }

.rack__vorschau { pointer-events: none; stroke-width: 2; }
.rack__vorschau[hidden] { display: none; }
.rack__vorschau--passt { fill: rgba(74, 144, 217, .3); stroke: var(--blau); }
.rack__vorschau--passt-nicht { fill: rgba(179, 38, 30, .22); stroke: var(--rot); stroke-dasharray: 6 4; }

.zieh-schild { position: fixed; z-index: 10; pointer-events: none; padding: 4px 8px; border-radius: var(--radius); background: var(--dunkelblau); color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 4px 12px rgba(27, 47, 94, .3); }
body.zieht, body.zieht * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* ---------- Rückmeldung ---------- */

.meldung { position: fixed; left: 50%; bottom: 16px; z-index: 20; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--radius); background: var(--gruen); color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(27, 47, 94, .3); }
.meldung--fehler { background: var(--rot); }

/* ---------- Dokumentation ---------- */

.doku__leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; color: var(--text-leise); }
.doku { max-width: 960px; margin: 0 auto; padding: 32px; background: var(--flaeche); border: 1px solid var(--linie); }
.doku__kopf { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 3px solid var(--dunkelblau); }
.doku__kopf > div { flex: 1; }
.doku__art { font-size: 12px; font-weight: 600; color: var(--text-leise); }
.doku__stand { text-align: right; font-size: 12px; color: var(--text-leise); }
.doku__zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin: 16px 0; }
.doku__zahlen dt { font-size: 12px; color: var(--text-leise); }
.doku__zahlen dd { margin: 0; font-weight: 600; }
.doku__ansichten { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 24px 0; }
.doku__ansicht { margin: 0; }
.doku__ansicht figcaption { margin-bottom: 8px; font-weight: 600; color: var(--dunkelblau); }
.doku__liste h2 { margin-bottom: 8px; }
.doku__liste .tabelle { font-size: 12px; }
.doku__liste .tabelle th, .doku__liste .tabelle td { padding: 4px 8px; }
.doku__fuss { margin-top: 24px; padding-top: 8px; border-top: 1px solid var(--linie); font-size: 12px; color: var(--text-leise); }

.doku__liste + .doku__liste { margin-top: 24px; }

/* ---------- Etiketten ---------- */

.etiketten-wahl { align-items: flex-end; }
.etiketten-wahl .feld { min-width: 240px; }
.etiketten { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.etikett { display: flex; flex-direction: column; justify-content: center; width: 50mm; padding: 0 2mm; overflow: hidden; background: #fff; border: 1px solid var(--linie); color: #000; white-space: nowrap; line-height: 1.15; }
.etikett__haupt { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.etikett__neben { font-size: 6pt; overflow: hidden; text-overflow: ellipsis; }
.etiketten--band9 .etikett { height: 9mm; }
.etiketten--band9 .etikett__haupt { font-size: 11pt; }
.etiketten--band12 .etikett { height: 12mm; }
.etiketten--band12 .etikett__haupt { font-size: 14pt; }
.etiketten--band9 .etikett__neben, .etiketten--band12 .etikett__neben { display: none; }
.etiketten--band18 .etikett { height: 18mm; }
.etiketten--band18 .etikett__haupt { font-size: 16pt; }
.etiketten--band24 .etikett { height: 24mm; }
.etiketten--band24 .etikett__haupt { font-size: 20pt; }
.etiketten--a4 .etikett { width: 60mm; height: 16mm; border-style: dashed; }
.etiketten--a4 .etikett__haupt { font-size: 14pt; }
.etiketten--a4 { gap: 0; }

/* ---------- Kleinere Bildschirme ---------- */

@media (max-width: 1100px) {
  .arbeitsflaeche { grid-template-columns: 260px minmax(0, 1fr); }
  .detail { grid-column: 1 / -1; grid-row: 1; position: static; max-height: none; }
}

@media (max-width: 720px) {
  .inhalt { padding: 12px; }
  .kopf { flex-wrap: wrap; gap: 0 12px; padding: 0 12px; }
  .kopf__menue { order: 3; flex: 1 0 100%; min-height: 44px; margin: 0 -12px; padding: 0 4px; border-top: 1px solid #33477A; }
  .kopf__benutzer { margin-left: auto; padding: 4px 0; }
  .kopf__name { display: none; }
  /* Am Handy zuerst das Gerät, dann der Schrank, darunter die Bibliothek. */
  .arbeitsflaeche { grid-template-columns: minmax(0, 1fr); }
  .detail { grid-column: auto; grid-row: auto; order: 1; }
  .rack-spalte { order: 2; }
  .bibliothek-spalte { order: 3; position: static; max-height: 70vh; }
  .formular__felder { grid-template-columns: minmax(0, 1fr); }
  .knopf, .seitenwahl__knopf, .portknopf, .schalter, input, select { min-height: 44px; }
  .portraster__ports { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  input[type="checkbox"] { min-height: 0; }
  .doku { padding: 16px; }
  .doku__ansichten { grid-template-columns: 1fr; }
}

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

/* ---------- Druck / PDF ---------- */

@page { size: A4; margin: 14mm; }
/* Schriftbänder: Seite = ein Etikett in Bandbreite, ohne Rand. */
@page band9 { size: 50mm 9mm; margin: 0; }
@page band12 { size: 50mm 12mm; margin: 0; }
@page band18 { size: 50mm 18mm; margin: 0; }
@page band24 { size: 50mm 24mm; margin: 0; }

@media print {
  body { background: #fff; font-size: 10pt; }
  .kopf, .doku__leiste, .meldung { display: none !important; }
  .inhalt { max-width: none; padding: 0; }
  .doku { max-width: none; padding: 0; border: 0; }
  .doku__ansichten { grid-template-columns: 1fr 1fr; gap: 12mm; break-inside: avoid; }
  .doku__ansicht .rack { max-height: 200mm; }
  .doku__liste { break-before: auto; }
  .tabelle-rahmen { border: 0; }
  .tabelle tr { break-inside: avoid; }
  .tabelle thead { display: table-header-group; }
  .rack, .rack * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .etiketten { margin: 0; }
  .etiketten--band9 { page: band9; }
  .etiketten--band12 { page: band12; }
  .etiketten--band18 { page: band18; }
  .etiketten--band24 { page: band24; }
  .etiketten:not(.etiketten--a4) { display: block; }
  .etiketten:not(.etiketten--a4) .etikett { border: 0; break-after: page; }
  .etiketten--a4 .etikett { break-inside: avoid; }
}
