/* Layout sizes live here as CSS variables. Colours have no value in this file: they are set from
   GET /settings (oberflaeche, einheit "Farbe") by js/einstellungen.js on load (guard test:
   test_keine_festwerte.py). */
:root {
  --raster: 8px;
  --seitenleiste-breite: 320px;
  --info-rand: 3px;
  --info-liste-hoehe: 160px;
  --ablage-hoehe: 240px; /* fallback: the page sets it from ablage_hoehe_px, the divider moves it */
  --trennlinie-hoehe: 6px; /* divider above the lower area (js/flaeche.js) */
  --ablagekarte-breite: 150px;
  --fensterliste-spalten: 11ch 14ch 20ch 9ch 1fr;
  --einst-inhalt-breite: 300px; /* contents column of the settings page on wide screens */
  --hb-textbreite: 90ch; /* line length of the handbook text */
  --gewichtskarte-breite: 340px; /* weight map beside the tray on the container page */
  --gk-zelle-hoehe: 34px;
  --container-unten-hoehe: 280px; /* tray + weight map on the container page (fallback: the page
                                     sets it from container_unten_hoehe_px, the divider moves it) */
  --info-knopf: 16px; /* the shared "i" (js/info.js) */
  --info-feld-breite: 320px; /* its hover field */
  --info-dialog-breite: 860px; /* its window (Quotes model) */
  --info-unschaerfe: 5px; /* blur of the page behind the window */
  --bk-liste-breite: 260px; /* list of pallet kinds on the pallet builder page */
  --bk-vorschau-hoehe: 460px; /* its 3D preview */
}
html[data-thema="dunkel"] { color-scheme: dark; } /* native controls, scrollbars, dialogs follow */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tinte);
  background: var(--hintergrund); font-size: 14px; line-height: 1.4; }
a { color: var(--eco-dunkel); }
h1, h2 { margin: 0 0 var(--raster); }

button, .knopf { font: inherit; padding: var(--raster) calc(var(--raster) * 2); border-radius: 6px;
  border: 1px solid var(--linie); background: var(--weiss); color: var(--tinte); cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--eco-dunkel); }
button:disabled { color: var(--grau); cursor: default; opacity: .6; }
button.primaer { background: var(--eco); color: var(--auf-eco); border-color: var(--eco-dunkel); font-weight: 600; }
button.primaer:hover:not(:disabled) { background: var(--eco-dunkel); color: var(--auf-eco); }
select, input[type=file], input, textarea { font: inherit; }
select, input, textarea { background: var(--weiss); color: var(--tinte); }
dialog { background: var(--weiss); color: var(--tinte); }

#fehlerleiste { background: var(--rot); color: var(--weiss); padding: var(--raster) calc(var(--raster) * 2);
  font-weight: 600; }
#fehlerleiste[hidden] { display: none; }
/* values of the planning's snapshot outside their range: red like the error bar */
#ungueltig { background: var(--rot); color: var(--weiss); }
/* container page: items loaded anew because they grew (NEU_GELADEN), orange like its level */
#neu-geladen { border-left: 4px solid var(--orange); }
#vorlaeufig { background: var(--vorlaeufig-farbe); padding: var(--raster) calc(var(--raster) * 2);
  font-size: 12px; border-bottom: 1px solid var(--linie); }
#vorlaeufig:empty { display: none; }
#vorlaeufig a { color: var(--tinte); } /* links on yellow: dark text keeps the contrast */
.streifen { display: flex; align-items: center; gap: var(--raster); flex-wrap: wrap;
  padding: var(--raster) calc(var(--raster) * 2); font-size: 12px; border-bottom: 1px solid var(--linie); }
.streifen[hidden] { display: none; }
#veraltet { background: var(--veraltet-farbe); }
#importmeldungen { background: var(--import-meldung-farbe); }
#importliste { margin: 0; padding-left: calc(var(--raster) * 2); flex: 1; }

/* Start page */
.start { max-width: 880px; margin: 0 auto; padding: calc(var(--raster) * 3); }
.start header { display: flex; align-items: center; gap: calc(var(--raster) * 2);
  margin-bottom: calc(var(--raster) * 3); }
.start header img { height: 48px; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px;
  padding: calc(var(--raster) * 2); margin-bottom: calc(var(--raster) * 2); }
/* step 1: folder choice and "new folder" side by side; step 2 locked until a folder is chosen */
.ordner-zeile, .ordner-form { display: flex; gap: var(--raster); align-items: center; flex-wrap: wrap; }
#ordner-wahl { min-width: 220px; padding: calc(var(--raster) / 2) var(--raster); }
#ordner-neu { flex: 1; min-width: 260px; padding: calc(var(--raster) / 2) var(--raster); }
.ordner-form { flex: 1; }
#ordner-zuerst, #ordner-gewaehlt { margin: 0 0 var(--raster); }
#ordner-gewaehlt { font-weight: 600; }
#hochladefelder { display: flex; gap: calc(var(--raster) * 2); align-items: center; flex-wrap: wrap;
  border: 0; margin: 0; padding: 0; min-width: 0; }
#hochladefelder:disabled { color: var(--grau); }
#hochladefelder:disabled label.knopf { color: var(--grau); cursor: default; }
/* import options after the file check: a line of their own; the customer colours scroll after
   "einspiel_farben_sichtbar" rows (set by einspielen.js as --farben-sichtbar) */
#einspiel-optionen { flex-basis: 100%; --farbzeile-hoehe: 32px; }
#einspiel-optionen[hidden] { display: none; }
#einspiel-optionen h3 { display: flex; align-items: center; gap: var(--raster); font-size: 15px;
  margin: var(--raster) 0 calc(var(--raster) / 2); }
.einspiel-haken { display: flex; align-items: center; gap: var(--raster); margin: 0; font-weight: 600; }
.einspiel-haken label { display: inline-flex; align-items: center; gap: var(--raster); cursor: pointer; }
#lieferanten-liste, #kundenfarben, #einspiel-meldungen { list-style: none; margin: 0; padding: 0; }
#lieferanten-liste { margin: calc(var(--raster) / 2) 0 0 calc(var(--raster) * 3); }
#kundenfarben { max-height: calc(var(--farben-sichtbar) * var(--farbzeile-hoehe)); overflow-y: auto;
  max-width: 480px; border: 1px solid var(--linie); border-radius: 4px; }
#kundenfarben li { height: var(--farbzeile-hoehe); box-sizing: border-box; display: flex;
  align-items: center; padding: 0 var(--raster); }
#kundenfarben label { display: flex; align-items: center; gap: var(--raster); cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#kundenfarben input[type="color"] { width: 40px; height: 24px; padding: 0; border: 1px solid var(--linie);
  background: none; cursor: pointer; }
#einspiel-meldungen-kasten { margin-top: var(--raster); }
#einspiel-meldungen-kasten[hidden] { display: none; }
/* file picker: the native input stays focusable for the keyboard but is not drawn; its label is the button */
.dateiwahl { display: inline-flex; gap: var(--raster); align-items: center; position: relative; }
.nur-lesbar { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dateiwahl label.knopf { cursor: pointer; display: inline-block; }
.dateiwahl .nur-lesbar:focus-visible + label.knopf { outline: 2px solid var(--eco-dunkel); outline-offset: 2px; }
#spaltentabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
#spaltentabelle th, #spaltentabelle td { text-align: left; padding: calc(var(--raster) / 2) var(--raster);
  border-bottom: 1px solid var(--linie); vertical-align: top; }
#spaltentabelle tr.pflicht td:nth-child(2) { color: var(--rot); font-weight: 600; }
#spaltentabelle tr.optional td:nth-child(2) { color: var(--grau); }
.knopfreihe { display: flex; gap: var(--raster); flex-wrap: wrap; }
/* search over all plannings above the list of the newest */
.suchform { display: flex; gap: var(--raster); align-items: center; flex-wrap: wrap; margin-bottom: var(--raster); }
#suche-text { flex: 1; min-width: 220px; padding: calc(var(--raster) / 2) var(--raster); }
#start-liste-hinweis { font-size: 12px; margin: var(--raster) 0 0; }
.eingabehilfe .knopfreihe { margin-bottom: 0; }
.eingabehilfe > p:first-child { margin-top: 0; }
#planungsliste ul { list-style: none; margin: 0; padding: 0; }
#planungsliste li { padding: var(--raster) 0; border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; gap: var(--raster); }
#planungsliste li > a { flex: 1; }
#planungsliste li:last-child { border-bottom: 0; }
/* one heading per folder above its plannings */
.ordner-gruppe + .ordner-gruppe { margin-top: calc(var(--raster) * 2); }
.ordner-kopf { display: flex; align-items: baseline; gap: var(--raster); margin: 0;
  padding-bottom: calc(var(--raster) / 2); border-bottom: 2px solid var(--eco); font-size: 15px; }
.ordner-anzahl { font-weight: normal; font-size: 12px; color: var(--grau); }
.ordner-alle { margin-left: auto; padding: 0; border: 0; background: none; color: var(--tinte);
  text-decoration: underline; font-size: 12px; }
.ordner-verschieben, .ordner-ziel { font-size: 12px; padding: calc(var(--raster) / 4) var(--raster); }
.leer { color: var(--grau); }

[hidden] { display: none !important; }

/* Navigation bar (js/navigation.js), the same on every page */
.navleiste { display: flex; align-items: stretch; gap: var(--raster); background: var(--weiss);
  border-bottom: 2px solid var(--eco); padding: 0 calc(var(--raster) * 2); }
.navleiste .nav-eintrag { display: flex; align-items: center; padding: calc(var(--raster) / 2) calc(var(--raster) * 1.5);
  color: var(--tinte); text-decoration: none; border: 0; border-bottom: 3px solid transparent;
  border-radius: 0; background: none; font: inherit; cursor: pointer; }
.navleiste a.nav-eintrag:hover, .navleiste button.nav-eintrag:hover { background: var(--eco-hell); }
.navleiste .nav-eintrag.aktiv { border-bottom-color: var(--eco); font-weight: 600; }
.navleiste .nav-aus { color: var(--grau); opacity: .6; cursor: not-allowed; }
.navleiste .nav-logo { padding-left: 0; }
.navleiste .nav-logo img { height: 28px; }
.navleiste #nav-handbuch { margin-left: auto; } /* handbook and quick help sit together on the right */
.navleiste .nav-platz { display: flex; }
.navleiste .nav-platz:empty { display: none; }
.navleiste .nav-sprache-knopf { padding-inline: var(--raster); }
.navleiste .nav-sprache-knopf[aria-pressed="true"] { border-bottom-color: var(--eco); font-weight: 600; }
#hilfe .hilfe-sprache { color: var(--grau); }
#hilfe h3 { margin: calc(var(--raster) * 2) 0 var(--raster); font-size: 14px; }
#hilfe ul, #hilfe ol { margin: 0; padding-left: calc(var(--raster) * 3); }
#hilfe .hilfe-handbuch { font-weight: 600; }

/* Shared "i" (js/info.js): green circle, hover field, window over a blurred, dimmed page */
.eco-info { display: inline-flex; align-items: center; justify-content: center; width: var(--info-knopf);
  height: var(--info-knopf); padding: 0; margin-left: calc(var(--raster) / 2); border-radius: 50%;
  border: 1px solid var(--eco-dunkel); background: var(--eco); color: var(--auf-eco); font-size: 11px;
  font-weight: 700; font-style: normal; line-height: 1; vertical-align: middle; text-transform: none;
  letter-spacing: normal; cursor: pointer; flex: none; }
.eco-info:hover:not(:disabled) { background: var(--eco-dunkel); border-color: var(--eco-dunkel); }
.eco-info-feld { position: fixed; z-index: 1001; width: var(--info-feld-breite); white-space: normal;
  overflow-wrap: break-word; background: var(--weiss); color: var(--tinte); border: 1px solid var(--eco);
  border-radius: 8px; padding: var(--raster) calc(var(--raster) * 1.5); font-size: 13px; font-weight: 400;
  line-height: 1.5; text-transform: none; letter-spacing: normal; text-align: left;
  box-shadow: 0 4px 14px var(--dialog-abdunklung); }
.eco-info-schleier { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: calc(var(--raster) * 3); background: var(--info-schleier-farbe);
  backdrop-filter: blur(var(--info-unschaerfe)); -webkit-backdrop-filter: blur(var(--info-unschaerfe)); }
.eco-info-dialog { width: min(var(--info-dialog-breite), 100%); max-height: min(84vh, 100%); display: flex;
  flex-direction: column; background: var(--weiss); color: var(--tinte); border: 2px solid var(--eco);
  border-radius: 14px; box-shadow: 0 18px 50px var(--dialog-abdunklung); text-align: left;
  text-transform: none; letter-spacing: normal; font-weight: 400; font-size: 14px; }
.eco-info-kopf { display: flex; align-items: center; justify-content: space-between;
  gap: calc(var(--raster) * 1.5); padding: var(--raster) calc(var(--raster) * 2);
  border-bottom: 1px solid var(--linie); }
.eco-info-kopf h2 { margin: 0; font-size: 16px; color: var(--tinte); }
.eco-info-zu { padding: 0 var(--raster); font-size: 20px; line-height: 1.3; }
.eco-info-rumpf { overflow-y: auto; padding: calc(var(--raster) * 2) calc(var(--raster) * 3) calc(var(--raster) * 3); }
.eco-info-text { margin: 0; line-height: 1.6; max-width: var(--hb-textbreite); }
.eco-info-rumpf > p:first-child { margin-top: 0; }

/* Editor shell */
body.editor { display: flex; flex-direction: column; height: 100vh; }
#werkzeugleiste { display: flex; align-items: center; gap: calc(var(--raster) * 2); flex-wrap: wrap;
  background: var(--weiss); border-bottom: 1px solid var(--linie); padding: var(--raster) calc(var(--raster) * 2); }
#werkzeugleiste .gruppe { display: flex; flex-direction: column; gap: 2px;
  border-left: 1px solid var(--linie); padding-left: var(--raster); }
#werkzeugleiste button { padding: calc(var(--raster) / 2) var(--raster); }
#planname { display: inline-block; max-width: 24ch; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; text-transform: none; font-weight: 600; }
#werkzeugleiste .gruppenzeile { display: flex; align-items: center; gap: var(--raster); }
#werkzeugleiste .gruppentitel { font-size: 11px; color: var(--grau);
  text-transform: uppercase; line-height: 1; }
#werkzeugleiste button.an { background: var(--eco-hell); border-color: var(--eco-dunkel); }
#mitte { flex: 1; display: flex; min-height: 0; }
#leinwand { flex: 1; position: relative; min-width: 0; background: var(--weiss); }
#leinwand canvas { display: block; width: 100%; height: 100%; }
#seitenleiste { width: var(--seitenleiste-breite); flex: none; background: var(--weiss);
  border-left: var(--info-rand) solid var(--eco); overflow: auto; display: flex; flex-direction: column; }
#seitenleiste .info-kopf { display: flex; align-items: center; gap: var(--raster); background: var(--eco);
  color: var(--auf-eco); padding: var(--raster) calc(var(--raster) * 2); position: sticky; top: 0; z-index: 1; }
#seitenleiste .info-kopf h2 { flex: 1; margin: 0; overflow-wrap: anywhere; }
#seitenleiste .info-zu { padding: 0 var(--raster); font-size: 20px; line-height: 1.3; background: var(--weiss);
  border-color: var(--eco-dunkel); }
#seitenleiste .info-inhalt { padding: calc(var(--raster) * 2); }
#seitenleiste .info-leer { display: flex; align-items: center; gap: calc(var(--raster) * 2); color: var(--grau); }
#seitenleiste .info-zeiger { font-size: 28px; color: var(--eco-dunkel); }
#seitenleiste .info-leer p { margin: 0; }
#seitenleiste .info-elemente { display: flex; flex-direction: column; gap: 4px; margin: var(--raster) 0;
  max-height: var(--info-liste-hoehe); overflow: auto; }
#seitenleiste .info-element { text-align: left; padding: 2px var(--raster); }
#seitenleiste .info-element:hover { background: var(--eco-hell); }
#unten { height: var(--ablage-hoehe); flex: none; display: flex; } /* window list | tray, side by side */
/* divider above the lower area (js/flaeche.js): drag it or use the arrow keys */
.trennlinie { flex: none; height: var(--trennlinie-hoehe); cursor: row-resize; touch-action: none;
  background: var(--linie); }
.trennlinie:hover, .trennlinie.aktiv { background: var(--eco); }
/* fullscreen button (js/flaeche.js): both labels in one grid cell, the inactive one invisible -
   the button is as wide as the longer one in both states */
.vollbild-knopf { display: inline-grid; }
.vollbild-knopf > span { grid-area: 1 / 1; }
.vollbild-knopf > span.verborgen { visibility: hidden; }
.trennlinie:focus-visible { outline: 2px solid var(--eco-dunkel); outline-offset: -2px; background: var(--eco); }
#ablage { flex: 1; min-width: 0; background: var(--eco-hell);
  border-top: 1px solid var(--linie); padding: var(--raster) calc(var(--raster) * 2); overflow: auto;
  display: flex; flex-direction: column; gap: var(--raster); }

/* 3D scene */
#leinwand .kurzinfo { position: absolute; pointer-events: none; background: var(--tinte); color: var(--weiss);
  padding: var(--raster); border-radius: 6px; font-size: 12px; white-space: nowrap; z-index: 2; }
#leinwand .kurzinfo[hidden] { display: none; }
#ansichten { display: flex; gap: var(--raster); }
#seitenleiste h2 { font-size: 16px; }
#seitenleiste h3 { font-size: 13px; margin: calc(var(--raster) * 2) 0 var(--raster); }
#seitenleiste .feld { display: flex; gap: var(--raster); padding: 2px 0; }
#seitenleiste .feldname { flex: none; width: 96px; color: var(--grau); }
#seitenleiste .feldwert { min-width: 0; overflow-wrap: anywhere; }
#seitenleiste .verstoss.stufe-orange { border-left-color: var(--orange); }
#seitenleiste .verstoss:not(.stufe-rot):not(.stufe-orange) { border-left-color: var(--grau); }
#seitenleiste .verstoss { border-left: 4px solid var(--rot); padding: 2px var(--raster);
  margin-bottom: var(--raster); background: var(--hintergrund); }

/* tools and tray */
#seitenleiste .werkzeuge { display: flex; flex-wrap: wrap; gap: var(--raster);
  margin: calc(var(--raster) * 2) 0; }
.ablagekopf { display: flex; align-items: center; gap: var(--raster); flex-wrap: wrap; }
.ablage-erklaerung { font-size: 12px; color: var(--grau); }
.ablageliste { display: flex; gap: var(--raster); overflow-x: auto; min-height: 0; flex: 1; }
.ablagekarte { flex: none; width: var(--ablagekarte-breite); background: var(--weiss); border: 1px solid var(--linie);
  border-radius: 6px; padding: var(--raster); font-size: 12px; cursor: grab; user-select: none;
  touch-action: none; }
.ablagekarte:hover { border-color: var(--eco-dunkel); }
.ablagekarte.nicht-verplant { border: 2px solid var(--rot); }
.ablagekarte.nicht-verplant .grund { color: var(--rot); font-weight: 600; }

/* window list below the scene (js/fensterliste.js): the list scrolls, not the page */
#fensterliste { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--weiss);
  border-top: 1px solid var(--linie); border-right: 1px solid var(--linie);
  padding: var(--raster) calc(var(--raster) * 2) 0; }
#fensterliste .fl-titelzeile { display: flex; align-items: baseline; gap: var(--raster); flex-wrap: wrap; }
#fensterliste .fl-erklaerung { font-size: 12px; color: var(--grau); }
#fensterliste .fl-liste { flex: 1; min-height: 0; overflow: auto; padding-bottom: var(--raster); }
#fensterliste .fl-kopf { font-size: 12px; font-weight: 600; color: var(--grau); background: var(--weiss);
  padding: calc(var(--raster) / 2) var(--raster) 0; border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 1; }
/* an emptied pallet stays until deleted by hand (Task 15): its group shows the word "leer" */
#fensterliste .fl-leer { color: var(--grau); font-style: italic; padding: calc(var(--raster) / 2) var(--raster); }
#fensterliste .fl-eintrag { display: grid; grid-template-columns: var(--fensterliste-spalten);
  gap: var(--raster); width: 100%; text-align: left; font-size: 12px; padding: 1px var(--raster);
  border: 2px solid transparent; border-radius: 4px; background: none; color: var(--tinte); }
#fensterliste .fl-eintrag:hover:not(.markiert) { background: var(--eco-hell); border-color: transparent; }
#fensterliste .fl-eintrag.markiert { background: var(--eco); color: var(--auf-eco);
  border-color: var(--eco-dunkel); }
#fensterliste .fl-pos { font-weight: 600; }
/* locked windows (js markiereGesperrt): faint diagonal stripes behind the text and a lock symbol;
   stripe colour and width come from the settings, the hover/selected background stays below */
.ablagekarte.gesperrt, #fensterliste .fl-eintrag.gesperrt,
#fensterliste .fl-eintrag.gesperrt:hover:not(.markiert) {
  background-image: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--sperre-streifen-farbe) 35%, transparent) 0 var(--sperre-streifen-breite),
    transparent var(--sperre-streifen-breite) calc(var(--sperre-streifen-breite) * 2)); }
.sperre-symbol { margin-right: 2px; }
#fensterliste .fl-eintrag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Print page: screen preview as paper-like cards; @page margin is set from druck_rand_mm in druck.js */
:root { --druck-seitenbreite: 210mm; --druck-bildabstand: 3mm; } /* --druck-rand, --druck-bildhoehe,
  --druck-tabelle-zeilenhoehe: from druck.js */
body.druck { background: var(--hintergrund); height: auto; }
#druckleiste { display: flex; align-items: center; gap: var(--raster); background: var(--weiss);
  border-bottom: 2px solid var(--eco); padding: var(--raster) calc(var(--raster) * 2);
  position: sticky; top: 0; z-index: 2; }
#druckleiste img { height: 32px; }
#druckleiste [data-info] { margin-right: auto; } /* title and its "i" left, choices right */
#werkbank { position: absolute; left: -10000px; top: 0; width: 900px; height: 600px; }
#seiten .seite { background: var(--weiss); width: var(--druck-seitenbreite); margin: calc(var(--raster) * 2) auto;
  padding: var(--druck-rand); border: 1px solid var(--linie); font-size: 9pt; }
.seite .seitenkopf { display: flex; gap: calc(var(--raster) * 2); align-items: center;
  border-bottom: 2px solid var(--eco); padding-bottom: var(--raster); }
.seite .logo { height: 40px; }
.seite h1 { font-size: 16pt; margin: 0; }
.seite h2 { font-size: 10pt; margin: var(--raster) 0 4px; }
.seite .bilder { display: grid; grid-template-columns: 1fr 1fr; gap: var(--druck-bildabstand);
  margin: var(--raster) 0; }
.seite figure { margin: 0; border: 1px solid var(--linie); }
.seite figure img { width: 100%; height: var(--druck-bildhoehe); object-fit: contain; display: block; }
.seite figcaption { font-size: 8pt; color: var(--grau); padding: 2px 4px; }
.seite .stueckliste { width: 100%; border-collapse: collapse; font-size: 7.5pt;
  line-height: var(--druck-tabelle-zeilenhoehe, 1.2); } /* from druck_tabelle_zeilenhoehe */
.seite .stueckliste th { background: var(--eco); color: var(--auf-eco); text-align: left; }
.seite .stueckliste th, .seite .stueckliste td { border: 1px solid var(--linie); padding: 0 3px; }
.seite .verstoss { border-left: 4px solid var(--rot); padding: 1px 6px; margin-bottom: 2px;
  background: var(--hintergrund); }
.seite .umladen { font-weight: 600; color: var(--orange); }
/* Task 18: the padding note in the parts list - hatched like the padding blocks in the
   pictures, a packing instruction (no warning colour) */
.seite .stueckliste .zwischenlage { font-weight: 600; white-space: nowrap; padding: 0 2px;
  background: repeating-linear-gradient(45deg, var(--zwischenlage-farbe) 0 3px, var(--weiss) 3px 6px); }
.nicht-verplant-block { border: 2px solid var(--rot); padding: 4px var(--raster); margin: var(--raster) 0; }
.nicht-verplant-block h2 { color: var(--rot); }
.nicht-verplant-block .verstoss { border-left: 4px solid var(--rot); padding: 1px 6px; margin-bottom: 2px; }
.seite .sicherung, .seite .vorlaeufig-fuss { font-size: 8pt; color: var(--grau); margin: 4px 0 0; }
/* build plan sheets (A4 portrait, one per pallet kind): values | side view, then the top view;
   the drawings are true to scale (bauplan-svg.js: sizes from druck_bauplan_*) */
.bauplan .bauplan-oben { display: grid; grid-template-columns: 1fr auto; gap: calc(var(--raster) * 2);
  align-items: start; margin: var(--raster) 0; }
.bauplan dl { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--raster); margin: 0; }
.bauplan dt { font-weight: 600; }
.bauplan dd { margin: 0; }
.bauplan .lange-gabeln { font-weight: 700; margin: var(--raster) 0 0; }
.bauplan .bauplan-hinweise { margin: 0; padding-left: calc(var(--raster) * 2); }
.bauplan figure { width: max-content; }
.bauplan .bauplan-svg { display: block; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.bauplan-svg .bp-umriss, .bauplan-svg .bp-boden, .bauplan-svg .bp-wand,
.bauplan-svg .bp-innenkante { stroke: var(--tinte); }
.bauplan-svg .bp-boden { fill: var(--hintergrund); }
.bauplan-svg .bp-wand { fill: var(--linie); }
.bauplan-svg .bp-wand.bp-offen { fill: none; }
.bauplan-svg .bp-text { fill: var(--tinte); }
.bauplan-svg .bp-senkrecht { writing-mode: vertical-rl; }
/* container sheets: A4 landscape (named page; the margin comes from the unnamed @page of druck.js) */
@page container { size: A4 landscape; }
:root { --druck-seitenbreite-quer: 297mm; --druck-gk-breite: 62mm; --druck-tuer-breite: 9mm; }
#seiten .seite.containerseite { width: var(--druck-seitenbreite-quer); page: container; }
/* outline plan (SVG, true scale): as wide as the page allows times --plan-anteil (its length
   against the longest container of the planning: one scale for all sheets), at most
   --druck-plan-max-hoehe high; the aspect ratio (--plan-verhaeltnis = length / width) stays */
:root { --druck-plan-max-hoehe: 80mm; }
.containerseite .containerbild { margin: var(--raster) 0; border: 1px solid var(--linie); }
.containerseite .bildzeile { display: flex; align-items: stretch; }
.containerseite .containerbild svg { display: block; flex: none; height: auto;
  width: min(calc((100% - var(--druck-tuer-breite)) * var(--plan-anteil)),
             calc(var(--druck-plan-max-hoehe) * var(--plan-verhaeltnis))); }
.containerplan .cp-umriss { stroke: var(--tinte); }
.containerplan .cp-wand { stroke: var(--tinte); }
.containerplan .cp-schraffur { stroke: var(--grau); }
.containerplan .cp-text { fill: var(--tinte); }
.cp-waerme .cp-platz { stroke: var(--weiss); }
.containerseite .tuer-markierung { writing-mode: vertical-rl; display: flex; align-items: center;
  justify-content: center; background: var(--container-tuer-farbe); color: var(--umladen-schild-schrift);
  font-weight: 700; font-size: 9pt; width: var(--druck-tuer-breite); flex: none; }
.containerseite .container-unten { display: grid; grid-template-columns: 1fr auto;
  gap: calc(var(--raster) * 2); align-items: start; }
.containerseite .container-rechts { display: flex; flex-direction: column; gap: var(--raster);
  min-width: var(--druck-gk-breite); }
.containerseite .belastungskarte svg { display: block; height: auto; border: 1px solid var(--linie); }
.containerseite .waerme-tuer { width: 2mm; flex: none; background: var(--container-tuer-farbe);
  print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.containerseite .belastung-legende { display: flex; align-items: center; gap: 4px; font-size: 7pt; }
.containerseite .bl-balken { display: inline-block; width: 20mm; height: 3mm; flex: none; }
.containerseite .vermerk { color: var(--orange); font-weight: 600; }
.containerseite .summe { font-weight: 700; margin: 4px 0 0; }
.containerseite .gk-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; border: 1px solid var(--linie); }
.containerseite .gk-zelle { height: var(--gk-zelle-hoehe); display: flex; align-items: center; justify-content: center; }
.containerseite .gk-chip { background: var(--weiss); color: var(--tinte); border-radius: 3px; padding: 0 4px;
  display: flex; gap: 4px; align-items: baseline; font-size: 7pt; }
.containerseite .gk-wert { font-weight: 700; }
.containerseite .tuer-markierung, .containerseite .gk-zelle, .containerseite .stueckliste th,
.containerseite .containerplan, .containerseite .bl-balken {
  print-color-adjust: exact; -webkit-print-color-adjust: exact; }
@media print {
  body.druck { background: var(--weiss); }
  #druckleiste, #fehlerleiste, #werkbank, .navleiste { display: none; }
  .eco-info, .eco-info-feld, .eco-info-schleier { display: none; } /* an explanation button is no part of the paper */
  #seiten .seite { width: auto; margin: 0; padding: 0; border: 0; page-break-after: always;
    break-after: page; }
  #seiten .seite:last-child { page-break-after: auto; break-after: auto; }
  #seiten .seite.containerseite { width: auto; }
  .seite figure, .seite tr { break-inside: avoid; }
}

/* dialogs and pallet profile */
dialog.dialog { border: 1px solid var(--linie); border-radius: 8px; padding: calc(var(--raster) * 3);
  min-width: 320px; }
dialog.dialog::backdrop { background: var(--dialog-abdunklung); }
#seitenleiste .bodenhoehe { align-items: center; flex-wrap: wrap; }
#seitenleiste .bodenhoehe input { width: 80px; font: inherit; }
#bodenhoehe-meldung { color: var(--rot); flex-basis: 100%; }
dialog .vorgaben-hinweis { max-width: 360px; font-size: 12px; }

/* settings page */
.start header .knopf { margin-left: auto; }
a.knopf { text-decoration: none; display: inline-block; }
body.einstellungen { height: auto; }
#einstellungen-inhalt { max-width: 1320px; margin: 0 auto; padding: calc(var(--raster) * 2); }
#einst-werkzeuge { display: flex; gap: var(--raster); flex-wrap: wrap; margin: var(--raster) 0; }
#einst-suche { flex: 1; min-width: 240px; font: inherit; padding: var(--raster); }
#einst-suche-leer { color: var(--grau); }
#einst-inhalt { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px;
  padding: var(--raster) calc(var(--raster) * 2); margin-bottom: calc(var(--raster) * 2); font-size: 13px; }
#einst-inhalt h2 { font-size: 15px; }
#einst-inhalt ol { margin: 0; padding-left: calc(var(--raster) * 2); }
#einst-inhalt .inhalt-abschnitt { margin: 4px 0; }
#einst-inhalt .inhalt-abschnitt.aktiv > .inhalt-link { font-weight: 700; color: var(--tinte);
  border-left: 3px solid var(--eco); padding-left: 4px; }
#einst-inhalt details.inhalt-werte summary { cursor: pointer; color: var(--grau); }
#einst-inhalt a.inhalt-wert { color: var(--tinte); text-decoration: none; }
#einst-inhalt a.inhalt-wert:hover { text-decoration: underline; }
/* wide screens: contents stay at the side while scrolling (media queries cannot read variables) */
@media (min-width: 1100px) {
  #einst-layout { display: grid; grid-template-columns: var(--einst-inhalt-breite) 1fr;
    gap: calc(var(--raster) * 2); align-items: start; }
  #einst-inhalt { position: sticky; top: var(--raster); max-height: calc(100vh - var(--raster) * 2);
    overflow: auto; margin-bottom: 0; }
}
.einst-abschnitt h2 { margin: 0; }
.einst-abschnitt-kopf { width: 100%; text-align: left; font-size: 18px; font-weight: 700;
  background: none; border: none; padding: 0; color: var(--tinte); cursor: pointer; }
.einst-abschnitt-kopf::before { content: "▸ "; color: var(--eco-dunkel); }
.einst-abschnitt-kopf[aria-expanded="true"]::before { content: "▾ "; }
.einst-einleitung { margin: 4px 0 0; }
.einst-zaehler { margin: 2px 0 0; font-size: 12px; color: var(--grau); }
.einst-nach-oben { display: inline-block; margin-top: var(--raster); font-size: 12px; }
.einst-schluessel { font-size: 11px; font-weight: 400; color: var(--grau); margin-left: auto; }
.einst-zeile.einst-blitz { background: var(--einst-blitz-farbe); transition: background .3s; }
details.einst-info summary { cursor: pointer; }
.einst-info-text { margin: 4px 0; max-width: 90ch; }
.einst-herkunft { margin: 0 0 4px; }
#nach-oben { position: fixed; right: calc(var(--raster) * 3); bottom: calc(var(--raster) * 3);
  background: var(--eco); color: var(--auf-eco); border: none; border-radius: 20px;
  box-shadow: 0 2px 6px var(--dialog-abdunklung); }
.einst-abschnitt { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px;
  padding: calc(var(--raster) * 2); margin-bottom: calc(var(--raster) * 2); }
.einst-abschnitt h3 { margin: calc(var(--raster) * 2) 0 var(--raster); font-size: 14px; }
.einst-zeile { border-top: 1px solid var(--linie); padding: var(--raster) 0; }
.einst-kopf { display: flex; gap: var(--raster); align-items: center; font-weight: 600; }
.einst-vorlaeufig { background: var(--vorlaeufig-farbe); border-radius: 4px; padding: 0 var(--raster);
  font-size: 12px; font-weight: 400; }
.einst-eingabe { display: flex; gap: var(--raster); align-items: flex-start; flex-wrap: wrap;
  margin: 4px 0; }
.einst-eingabe input[type=text], .einst-eingabe textarea { min-width: 320px; font: inherit; }
.einst-eingabe textarea { width: 60ch; resize: vertical; }
.einst-eingabe input[type=number] { width: 140px; font: inherit; }
.einst-info, .einst-herkunft { font-size: 12px; color: var(--grau); }
.einst-i { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center;
  border-radius: 50%; background: var(--eco-hell); color: var(--eco-dunkel); font-weight: 700;
  margin-right: 4px; }
.einst-modus { width: 5em; color: var(--grau); }
.einst-rueckmeldung { color: var(--eco-dunkel); align-self: center; }

/* handbook page (hilfe.html, js/hilfe-seite.js): contents, search and "nach oben" like the settings page */
body.handbuch-seite { height: auto; }
#hb-seite { max-width: 1320px; margin: 0 auto; padding: calc(var(--raster) * 2); }
#hb-einleitung { max-width: var(--hb-textbreite); }
#hb-werkzeuge { display: flex; gap: var(--raster); margin: var(--raster) 0; }
#hb-suche { flex: 1; min-width: 240px; max-width: var(--hb-textbreite); padding: var(--raster); }
#hb-suche-info, #hb-suche-leer { color: var(--grau); margin: 0 0 var(--raster); }
#hb-suche-info:empty { display: none; }
#hb-inhalt { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px;
  padding: var(--raster) calc(var(--raster) * 2); margin-bottom: calc(var(--raster) * 2); font-size: 13px; }
#hb-inhalt h2 { font-size: 15px; }
#hb-inhalt ol { margin: 0; padding-left: calc(var(--raster) * 2); }
#hb-inhalt .inhalt-abschnitt { margin: 4px 0; }
#hb-inhalt .inhalt-link { font-weight: 600; color: var(--tinte); }
/* links in the handbook: text colour with a green underline (green text is too faint on white) */
#handbuch a { color: var(--tinte); text-decoration-color: var(--eco-dunkel); text-underline-offset: 2px; }
#hb-inhalt .hb-unterkapitel { font-size: 12px; list-style: none; } /* headings carry own numbers */
#hb-inhalt a.inhalt-wert { color: var(--tinte); text-decoration: none; }
#hb-inhalt a.inhalt-wert:hover { text-decoration: underline; }
@media (min-width: 1100px) {
  #hb-layout { display: grid; grid-template-columns: var(--einst-inhalt-breite) 1fr;
    gap: calc(var(--raster) * 2); align-items: start; }
  #hb-inhalt { position: sticky; top: var(--raster); max-height: calc(100vh - var(--raster) * 2);
    overflow: auto; margin-bottom: 0; }
}
#handbuch section { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px;
  padding: calc(var(--raster) * 2); margin-bottom: calc(var(--raster) * 2); scroll-margin-top: var(--raster); }
#handbuch h3 { margin: calc(var(--raster) * 2) 0 var(--raster); font-size: 15px; scroll-margin-top: var(--raster); }
#handbuch p, #handbuch ul, #handbuch ol, #handbuch dl { max-width: var(--hb-textbreite); }
#handbuch li { margin: 2px 0; }
#handbuch dt { font-weight: 600; margin-top: var(--raster); }
#handbuch dd { margin-left: calc(var(--raster) * 2); }
#handbuch table { border-collapse: collapse; margin: var(--raster) 0; font-size: 13px; }
#handbuch th, #handbuch td { border: 1px solid var(--linie); padding: 4px var(--raster); text-align: left;
  vertical-align: top; }
#handbuch th { background: var(--hintergrund); }
#handbuch kbd { border: 1px solid var(--linie); border-bottom-width: 2px; border-radius: 4px;
  padding: 0 4px; background: var(--hintergrund); font: inherit; font-size: 12px; }
#handbuch .formel { font-family: ui-monospace, Consolas, monospace; background: var(--hintergrund);
  padding: var(--raster); border-radius: 6px; display: inline-block; }
#handbuch dl.warnung { border: 1px solid var(--linie); border-left: 4px solid var(--grau); border-radius: 6px;
  padding: 0 var(--raster) var(--raster); scroll-margin-top: var(--raster); }
#handbuch dl.warnung.stufe-rot { border-left-color: var(--rot); }
#handbuch dl.warnung.stufe-orange { border-left-color: var(--orange); }
#handbuch dl.warnung:target { box-shadow: 0 0 0 3px var(--eco); }
#handbuch .hb-nach-oben { display: inline-block; margin-top: var(--raster); font-size: 12px; }
::highlight(hb-treffer) { background-color: var(--vorlaeufig-farbe); color: var(--tinte); }

/* Container page (container.html, js/container-seite.js): tray | weight map below the scene */
#hinweisleiste { background: var(--umladen-schild-farbe); color: var(--umladen-schild-schrift);
  padding: var(--raster) calc(var(--raster) * 2); font-weight: 600; }
.container-seite #unten { height: var(--container-unten-hoehe); }
.container-seite #ablage { border-right: 1px solid var(--linie); }
.ablagekarte.nicht-geladen { border: 2px solid var(--rot); }
.ablagekarte .grund { color: var(--rot); font-weight: 600; }
.ablagekarte .grund.ausgeladen { color: var(--grau); font-weight: 400; }
#gewichtskarte { width: var(--gewichtskarte-breite); flex: none; background: var(--weiss);
  border-top: 1px solid var(--linie); padding: var(--raster) calc(var(--raster) * 2); overflow: auto;
  font-size: 12px; }
#gewichtskarte .gk-titel { display: block; font-size: 14px; color: var(--tinte); }
#gewichtskarte .gk-erklaerung { color: var(--grau); margin-bottom: var(--raster); }
#gewichtskarte .gk-container { margin-bottom: var(--raster); }
#gewichtskarte .gk-kopf { font-weight: 600; margin-bottom: 2px; }
#gewichtskarte .gk-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  border: 1px solid var(--linie); }
#gewichtskarte .gk-zelle { height: var(--gk-zelle-hoehe); display: flex; align-items: center;
  justify-content: center; }
/* name and share sit on a chip of their own: readable on every corner colour, in both modes */
#gewichtskarte .gk-chip { background: var(--weiss); color: var(--tinte); border-radius: 4px;
  padding: 0 calc(var(--raster) * .75); display: flex; gap: calc(var(--raster) / 2); align-items: baseline; }
#gewichtskarte .gk-name { font-size: 11px; }
#gewichtskarte .gk-wert { font-weight: 700; }
#seitenleiste .umladen-hinweis { background: var(--umladen-schild-farbe); color: var(--umladen-schild-schrift);
  font-weight: 600; padding: 2px var(--raster); border-radius: 4px; margin: var(--raster) 0; }
#packstueck-dialog .feld { display: flex; gap: var(--raster); align-items: center; margin: 4px 0; }
#packstueck-dialog .feldname { width: 110px; color: var(--grau); }
#packstueck-dialog input { flex: 1; padding: 4px var(--raster); }
.packstueck-meldung { color: var(--rot); font-weight: 600; max-width: 320px; }
/* the container page has more tools than the others: tighter spacing, so the German toolbar
   stays one row at 1400 px wide (tested) */
.container-seite #werkzeugleiste { gap: calc(var(--raster) * .75); }
.container-seite #werkzeugleiste .gruppe { padding-left: calc(var(--raster) * .75); }
.container-seite #werkzeugleiste .gruppenzeile { gap: calc(var(--raster) * .625); }
.container-seite #werkzeugleiste button { padding: calc(var(--raster) / 2); }
/* "+ Container": its menu of container kinds hangs below the button (the chosen kind first) */
.plus-huelle { position: relative; display: inline-flex; }
.plus-menue { position: absolute; top: 100%; left: 0; z-index: 5; margin-top: 2px; display: flex;
  flex-direction: column; min-width: 100%; background: var(--weiss); border: 1px solid var(--linie);
  border-radius: 6px; padding: 4px; box-shadow: 0 4px 14px var(--dialog-abdunklung); }
.plus-menue[hidden] { display: none; }
.plus-menue button { text-align: left; white-space: nowrap; border-color: transparent; }
.plus-menue button:hover, .plus-menue button:focus-visible { background: var(--eco-hell); }
.plus-menue button.gewaehlt { font-weight: 700; border-color: var(--eco-dunkel); }
/* pallet kind list of the editor (vorlagenwahl.js): rows without gaps, so the list's height is
   exactly vorlagen_liste_sichtbar rows (set by the script); more rows scroll */
.vorlagen-liste { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.vorlagen-liste li { margin: 0; padding: 0; }
.vorlagen-zeile { display: block; width: 100%; text-align: left; white-space: normal; }
/* right-click menu on a pallet in the editor (szene.js), at the pointer */
#palette-menue { position: fixed; z-index: 20; display: flex; flex-direction: column;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: 6px; padding: 4px;
  box-shadow: 0 4px 14px var(--dialog-abdunklung); }
#palette-menue[hidden] { display: none; }
#palette-menue button { text-align: left; white-space: nowrap; border-color: transparent; }
#palette-menue button:hover, #palette-menue button:focus-visible { background: var(--eco-hell); }
/* load plan legend over the scene: colour bar lightest -> heaviest, numbers below */
#belastung-legende { position: absolute; left: var(--raster); bottom: var(--raster); z-index: 2;
  background: var(--weiss); color: var(--tinte); border: 1px solid var(--linie); border-radius: 6px;
  padding: calc(var(--raster) / 2) var(--raster); font-size: 12px; display: flex; flex-direction: column;
  gap: 4px; min-width: 220px; }
#belastung-legende[hidden] { display: none; }
#belastung-legende .bl-balken { height: 10px; border-radius: 3px; background: linear-gradient(to right,
  var(--belastung-farbe-niedrig), var(--belastung-farbe-mittel), var(--belastung-farbe-hoch)); }

/* ---- pallet builder (baukasten.html) ------------------------------------------------------ */
body.baukasten { height: auto; }
#baukasten-inhalt { max-width: 1480px; margin: 0 auto; padding: calc(var(--raster) * 2); }
#baukasten-inhalt h1 { display: flex; align-items: center; gap: var(--raster); }
#baukasten-layout { display: grid; gap: calc(var(--raster) * 2);
  grid-template-columns: var(--bk-liste-breite) minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
#baukasten-liste, #baukasten-arbeit { background: var(--weiss); border: 1px solid var(--linie);
  border-radius: 8px; padding: calc(var(--raster) * 2); }
#baukasten-liste h2, #baukasten-arbeit h2 { font-size: 16px; }
#vorlagen { list-style: none; margin: 0 0 var(--raster); padding: 0; display: flex;
  flex-direction: column; gap: calc(var(--raster) / 2); }
#vorlagen .vorlage-knopf { width: 100%; text-align: left; }
#vorlagen .vorlage-knopf[aria-current="true"] { border-color: var(--eco-dunkel); font-weight: 700;
  box-shadow: inset 4px 0 0 var(--eco); }
#baukasten-form { display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--raster) calc(var(--raster) * 2); align-items: center; }
#baukasten-form .bk-feld { font-weight: 600; }
#baukasten-form .bk-wert { display: flex; gap: var(--raster); align-items: center; flex-wrap: wrap; }
#baukasten-form input[type=text] { flex: 1; min-width: 180px; font: inherit; padding: calc(var(--raster) / 2); }
#baukasten-form input[type=number] { width: 120px; font: inherit; padding: calc(var(--raster) / 2); }
#baukasten-form input:read-only:not([type=checkbox]) { color: var(--grau); }
#baukasten-form select { font: inherit; }
#baukasten-form .bk-haken { display: inline-flex; gap: calc(var(--raster) / 2); align-items: center; }
#baukasten-form .bk-haken[hidden], #baukasten-form .bk-notiz[hidden] { display: none; }
#baukasten-form .bk-notiz { flex-basis: 100%; color: var(--grau); }
#baukasten-form #wand-frage { display: inline-flex; align-items: center; }
#baukasten-form input:disabled { color: var(--grau); }
#winkel { font-weight: 700; }
#bk-werte { margin-top: calc(var(--raster) * 2); border-top: 1px solid var(--linie);
  padding-top: var(--raster); }
#bk-werte p { margin: 0 0 calc(var(--raster) / 2); font-weight: 600; }
#hinweise h3 { display: flex; align-items: center; font-size: 14px; margin: var(--raster) 0 calc(var(--raster) / 2); }
#hinweis-liste { margin: 0; padding-left: calc(var(--raster) * 2); }
#hinweis-liste .hinweis { border-left: 4px solid var(--orange); padding-left: var(--raster); list-style: none;
  margin-left: calc(var(--raster) * -2); margin-bottom: calc(var(--raster) / 2); }
#hinweis-liste .leer { list-style: none; margin-left: calc(var(--raster) * -2); color: var(--grau); }
#bk-knoepfe { display: flex; gap: var(--raster); flex-wrap: wrap; align-items: center;
  margin-top: calc(var(--raster) * 2); }
#vorschau { height: var(--bk-vorschau-hoehe); border: 1px solid var(--linie); border-radius: 8px;
  overflow: hidden; background: var(--weiss); }
#vorschau canvas { display: block; width: 100%; height: 100%; }
#seitenleiste .baukasten-hinweis { margin: var(--raster) 0; }
@media (max-width: 1100px) {
  #baukasten-layout { grid-template-columns: var(--bk-liste-breite) minmax(0, 1fr); }
  #vorschau { grid-column: 1 / -1; }
}

/* Sign-in page (anmeldung.html, js/anmeldung.js): start state here, the script animates to the
   final state, which <body data-anmeldung="fertig"> then holds. Colours: anmeldung_* settings. */
body.anmeldung { overflow: hidden; background: var(--anmeldung-farbe-dunkel); }
.anm-buehne { position: fixed; inset: 0; overflow: hidden; }
.anm-schwarz { position: absolute; inset: 0 auto 0 0; width: 100%;
  background: var(--anmeldung-farbe-dunkel); color: var(--anmeldung-schrift-farbe); }
.anm-weiss { position: absolute; inset: 0 0 0 auto; width: 50%; transform: translateX(100%);
  background: var(--anmeldung-farbe-hell); display: flex; align-items: center;
  justify-content: center; }
.anm-marke { position: absolute; left: 0; right: 0; top: 16%; display: flex;
  flex-direction: column; align-items: center; gap: calc(var(--raster) * 2); }
.anm-logo { width: min(340px, 60%); opacity: 0; }
.anm-produkt { font-size: 22px; font-weight: 300; letter-spacing: .45em; text-indent: .45em;
  opacity: 0; }
.anm-video-feld { opacity: 0; line-height: 0; }
.anm-video { display: block; aspect-ratio: 9 / 16;
  width: calc(var(--anm-wort-breite) * (100 + var(--anm-video-mehr)) / 100 * var(--anm-video-skala));
  object-fit: contain; background: var(--anmeldung-farbe-dunkel); }
.anm-intro { position: absolute; left: 0; right: 0; top: 42%; display: flex;
  flex-direction: column; align-items: center; opacity: 0; }
.anm-bild { width: 120px; height: 140px; color: var(--anmeldung-schrift-farbe); }
.anm-strich { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.anm-strich.anm-fein { stroke-width: 1; }
.anm-gruss { margin: calc(var(--raster) * 3) 0 0; font-family: Georgia, "Palatino Linotype",
  "Book Antiqua", serif; font-style: italic; font-weight: 400; font-size: 44px;
  letter-spacing: .06em; }
.anm-fenster { width: min(360px, 80%); display: flex; flex-direction: column;
  gap: var(--raster); color: var(--tinte); opacity: 0; visibility: hidden; }
.anm-fenster h1 { font-weight: 600; margin-bottom: calc(var(--raster) * 2); }
.anm-fenster input { padding: var(--raster); border: 1px solid var(--linie); border-radius: 6px;
  margin-bottom: var(--raster); }
.anm-fenster input:focus { outline: 2px solid var(--eco); border-color: var(--eco-dunkel); }
.anm-fehler { color: var(--rot); margin: 0; }
body[data-anmeldung="fertig"] .anm-schwarz { width: 50%; }
body[data-anmeldung="fertig"] .anm-weiss { transform: none; }
body[data-anmeldung="fertig"] .anm-logo,
body[data-anmeldung="fertig"] .anm-produkt,
body[data-anmeldung="fertig"] .anm-video-feld { opacity: 1; }
body[data-anmeldung="fertig"] .anm-intro { opacity: 0; visibility: hidden; }
body[data-anmeldung="fertig"] .anm-fenster { opacity: 1; visibility: visible; }

/* Labels page (Update 02 Paket 5): one label per element, A6 portrait, (columns x rows) on an A4
   sheet. --aufkleber-* come from the settings (js/aufkleber.js); each section.bogen is one A4 page
   without margin, the labels sit edge to edge from the top left corner. --af-mass < 1 shrinks the
   font of a label whose text would not fit (the QR code keeps its size). */
@page aufkleber { size: A4 portrait; margin: 0; }
:root { --aufkleber-bogen-breite: 210mm; --aufkleber-bogen-hoehe: 297mm; --aufkleber-logo-hoehe: 7mm;
  --aufkleber-auswahl-breite: 280px; }
#aufkleberleiste { display: flex; align-items: center; gap: var(--raster); flex-wrap: wrap;
  background: var(--weiss); border-bottom: 2px solid var(--eco); padding: var(--raster) calc(var(--raster) * 2);
  position: sticky; top: 0; z-index: 2; }
#aufkleberleiste [data-info] { margin-right: auto; }
#keine-auswahl { margin: 0; background: var(--vorlaeufig-farbe); color: var(--tinte); }
#aufkleber-inhalt { display: grid; grid-template-columns: var(--aufkleber-auswahl-breite) 1fr;
  gap: calc(var(--raster) * 2); padding: calc(var(--raster) * 2); align-items: start; }
#auswahl { background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px;
  padding: var(--raster) calc(var(--raster) * 2); position: sticky; top: 64px;
  max-height: calc(100vh - 80px); overflow: auto; }
#auswahl h2 { font-size: 14px; }
#auswahl .af-gruppe { margin-bottom: var(--raster); }
#auswahl .af-gruppe-kopf { display: flex; gap: 6px; align-items: center; font-weight: 600; }
#auswahl ul { list-style: none; margin: 2px 0 0; padding-left: calc(var(--raster) * 3); }
#auswahl li label { display: flex; gap: 6px; align-items: center; overflow-wrap: anywhere; }
#boegen { display: flex; flex-direction: column; align-items: center; gap: calc(var(--raster) * 2); }
section.bogen { page: aufkleber; width: var(--aufkleber-bogen-breite); height: var(--aufkleber-bogen-hoehe);
  display: grid; grid-template-columns: repeat(var(--aufkleber-spalten), var(--aufkleber-breite));
  grid-template-rows: repeat(var(--aufkleber-zeilen), var(--aufkleber-hoehe));
  background: var(--weiss); outline: 1px solid var(--linie); break-after: page; flex: none; }
section.bogen:last-child { break-after: auto; }
article.aufkleber { --af-mass: 1; width: var(--aufkleber-breite); height: var(--aufkleber-hoehe);
  padding: var(--aufkleber-innenrand); display: flex; flex-direction: column; gap: 2mm;
  background: var(--weiss); color: var(--tinte); outline: 1px dashed var(--linie); outline-offset: -1px;
  font-size: calc(var(--aufkleber-schrift-zeile) * var(--af-mass)); line-height: 1.25;
  overflow-wrap: anywhere; min-width: 0; }
.aufkleber .af-kopf { display: flex; align-items: center; justify-content: space-between; gap: 3mm;
  border-bottom: 0.6mm solid var(--eco); padding-bottom: 2mm; print-color-adjust: exact;
  -webkit-print-color-adjust: exact; }
.aufkleber .af-logo { height: var(--aufkleber-logo-hoehe); width: auto; flex: none; max-width: 55%; object-fit: contain; }
.aufkleber .af-pos { --af-pos-mass: 1; font-size: calc(var(--aufkleber-schrift-pos) * var(--af-mass) * var(--af-pos-mass));
  font-weight: 800; line-height: 1; text-align: right; min-width: 0; flex: 1 1 auto; white-space: nowrap; }
.aufkleber .af-pos.af-pos-umbruch { white-space: normal; }
.aufkleber .af-band { font-size: calc(var(--aufkleber-schrift-band) * var(--af-mass)); font-weight: 700;
  padding: 1.5mm 3mm; border-radius: 1mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.aufkleber .af-band-neutral { background: var(--hintergrund); color: var(--tinte); border: 0.3mm solid var(--linie); }
.aufkleber .af-zeilen { display: grid; grid-template-columns: auto 1fr; gap: 1mm 3mm; margin: 0;
  align-content: start; flex: 1 0 auto; } /* never shrinks under its lines: a label too full
  overflows and js/aufkleber.js makes its font smaller instead of the QR code covering lines */
.aufkleber .af-zeilen dt { font-weight: 400; }
.aufkleber .af-zeilen dd { margin: 0; font-weight: 700; min-width: 0; }
.aufkleber .af-unten { display: flex; justify-content: space-between; align-items: flex-end; gap: 3mm; }
.aufkleber .af-fuss { font-size: 0.75em; min-width: 0; }
.aufkleber .af-qr { flex: none; color: var(--tinte); }
.aufkleber .af-qr svg { display: block; }
.aufkleber .af-qr-zu-lang { display: block; max-width: 40mm; color: var(--rot); font-weight: 600; }
@media print {
  body.aufkleber-seite { background: var(--weiss); }
  #aufkleberleiste, #auswahl, #keine-auswahl { display: none; }
  #aufkleber-inhalt { display: block; padding: 0; }
  #boegen { display: block; }
  section.bogen { outline: 0; }
  article.aufkleber { outline: 0; }
}
