/* lager.css — „Was im Regal liegt, ist Geld, das nicht arbeitet.“ (nur diese Seite).
   Richtung Regalwand: Kartonbraun als Grund, Schwarz für Regal und Schrift, Signalorange als Hausfarbe.
   Kennzahlen als weiße Regaletiketten, Hauptbild eine Flächenkarte in schwarzem Regalrahmen.
   Die Seite ist bewusst nur hell (Karton). */

@font-face { font-family: "Anybody"; src: url("../../schrift/muster/anybody-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../../schrift/muster/nunito-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../../schrift/muster/nunito-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../../schrift/muster/nunito-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Roboto Mono"; src: url("../../schrift/muster/roboto-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root, :root[data-theme="light"] {
  color-scheme: light;
  --flaeche-0: #d9a862;          /* Karton */
  --flaeche-1: #fffcf6;          /* Etikett, Karte */
  --flaeche-2: #f5e6cd;
  --linie: #17120c;
  --raster: #ecdcc2;
  --text-1: #17120c;
  --text-2: #3b2f20;
  --text-3: #5c4a35;
  --akzent: #f25a00;             /* Signalorange */
  --akzent-text: #a33c00;
  --schwarz: #17120c;
  --regal: #17120c;
  --fach: #2b2118;
  /* eine Farbskala für die Regalwand: hell = frisch bewegt bzw. knapp, dunkel = liegt lange */
  --r1: #fff1d8; --r2: #ffd08c; --r3: #ffa246; --r4: #f26a10; --r5: #b24200; --r6: #5a2100;
  --s1: #17120c; --s2: #f25a00; --s3: #2c5fae; --s4: #8a5a24;
  --s5: #b24200; --s6: #5c4a35; --s7: #2c5fae; --s8: #f25a00;
  --leer: rgb(242 90 0 / .22);
  --gut-text: #146b2b; --kritisch-text: #b0261c;
  --schatten: 3px 3px 0 rgb(23 18 12 / .9);
  --mono: "Roboto Mono", ui-monospace, Consolas, monospace;
  --kopf: "Anybody", "Nunito Sans", system-ui, sans-serif;
}

html { overflow-x: clip; }
body { overflow-x: clip; background: var(--flaeche-0); font-family: "Nunito Sans", system-ui, sans-serif; font-size: 16px; font-variant-numeric: tabular-nums; }
.breite { width: min(100% - 32px, 1600px); }

/* Tastatur: deutlich sichtbarer Rahmen */
:focus-visible { outline: 3px solid var(--schwarz); outline-offset: 2px; border-radius: 2px; }
.knopf:has(input:focus-visible) { outline: 3px solid var(--schwarz); outline-offset: 2px; }
input[type=range]:focus-visible { outline: 3px solid var(--schwarz); outline-offset: 4px; }

/* ---------- Kopfleiste ---------- */
.a-kopf { background: var(--schwarz); border-bottom: 4px solid var(--akzent); }
.a-kopf .a-zurueck { color: #f3e3c8; }
.a-kopf .a-zurueck:hover { color: #fff; }
.a-kopf .a-name { color: #fff; font-family: var(--kopf); font-weight: 760; letter-spacing: .01em; }
.a-kopf :focus-visible { outline-color: var(--akzent); }

/* ---------- Titel ---------- */
.r-kopf { padding: 48px 0 20px; }
.r-ort { display: inline-block; margin: 0 0 16px; padding: 5px 10px; background: var(--schwarz); color: #fff; font: 500 13px/1.2 var(--mono); }
.a-titel .r-ort { color: #fff; font-size: 13px; max-width: none; }
.a-titel h1 { font-family: var(--kopf); font-weight: 820; font-stretch: normal; font-size: clamp(36px, 5.6vw, 76px); line-height: .96; letter-spacing: -.03em; max-width: 15ch; margin-bottom: 18px; color: var(--schwarz); }
.a-titel p { font-size: 18px; max-width: 60ch; color: var(--text-2); }
.a-schild { border-radius: 2px; background: var(--flaeche-1); border: 1.5px solid var(--schwarz); color: var(--text-1); }
.a-schild i { background: var(--akzent); border-radius: 0; }
.a-schild.eigen i { background: var(--gut-text); }

/* ---------- Regaletiketten ---------- */
.r-etiketten { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 28px; }
.r-etikett { position: relative; background: var(--flaeche-1); color: var(--text-1); border: 1.5px solid var(--schwarz); border-radius: 2px; padding: 12px 14px 12px 18px; box-shadow: var(--schatten); min-width: 0; }
.r-etikett::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--schwarz); }
.r-etikett.warn::before { background: var(--akzent); }
.r-e-name { margin: 0; font: 500 12px/1.3 var(--mono); color: var(--text-2); }
.r-e-wert { margin: 4px 0 2px; font-family: var(--kopf); font-weight: 780; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.05; letter-spacing: -.01em; overflow-wrap: anywhere; }
.r-e-neben { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.35; }
.r-etiketten.klein { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 4px 0 14px; }
.r-etikett.klein { box-shadow: none; padding: 10px 12px 10px 16px; }
.r-etikett.klein .r-e-wert { font-size: 24px; }
@media (max-width: 520px) {
  .r-etiketten { grid-template-columns: 1fr 1fr; gap: 8px; }
  .r-etikett { padding: 10px 10px 10px 14px; }
  .r-e-wert { font-size: 21px; }
  .r-e-neben { font-size: 12px; }
}

/* ---------- Ablage, Knöpfe, Hinweis ---------- */
.ablage { border: 2px dashed var(--schwarz); border-radius: 2px; background: var(--flaeche-1); }
.ablage.drueber { border-color: var(--akzent); background: #fff3e6; }
.ablage svg { color: var(--schwarz); }
.ablage span { color: var(--text-2); }
.ablage .vorlage-satz { display: block; margin-top: 6px; color: var(--text-1); font-weight: 600; }
.knopf { background: var(--akzent); color: var(--schwarz); border: 1.5px solid var(--schwarz); border-radius: 2px; font-weight: 700; }
.knopf:hover { filter: none; background: #ff7426; }
.knopf.leise { background: var(--flaeche-1); color: var(--schwarz); border-color: var(--schwarz); }
.knopf.leise:hover { background: #fff; }
.r-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.r-hinweis { margin: -12px 0 24px; padding: 10px 14px; background: var(--flaeche-1); border-left: 6px solid var(--akzent); font-size: 14px; color: var(--text-1); line-height: 1.5; }

/* ---------- Abschnitte und Karten ---------- */
.abschnitt { margin-top: 48px; }
.abschnitt > h2 { font-family: var(--kopf); font-weight: 800; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -.02em; color: var(--schwarz); }
.abschnitt > p.unter { color: var(--text-1); max-width: 72ch; }
.gitter { gap: 14px; }
.karte { background: var(--flaeche-1); border: 1.5px solid var(--schwarz); border-radius: 2px; box-shadow: var(--schatten); }
.karte-kopf h2 { font-family: var(--kopf); font-weight: 760; font-size: 18px; letter-spacing: -.005em; }
.karte-kopf p { color: var(--text-2); }
.karte-kopf .tabelle-knopf { border: 1.5px solid var(--schwarz); border-radius: 2px; color: var(--text-1); font-weight: 600; }
.karte-kopf .tabelle-knopf:hover { background: var(--flaeche-2); }
.einsicht { color: var(--text-1); border-top-color: var(--raster); }
.legende { color: var(--text-2); }
.legende i { border-radius: 1px; }
.filter .f-name, .f-name { color: var(--text-2); font-size: 13px; font-weight: 600; }
.wahl { background: var(--flaeche-2); border: 1.5px solid var(--schwarz); border-radius: 2px; padding: 2px; }
.wahl button { border-radius: 1px; color: var(--text-1); min-height: 36px; }
.wahl button[aria-pressed="true"] { background: var(--schwarz); color: #fff; box-shadow: none; }
select.feld { border: 1.5px solid var(--schwarz); border-radius: 2px; background: #fff; max-width: 100%; }
.tipp { border: 1.5px solid var(--schwarz); border-radius: 2px; box-shadow: var(--schatten); }
.tabelle-huelle { border-color: var(--raster); border-radius: 2px; }
table.daten th { background: var(--schwarz); color: #fff; }
table.daten td small { display: block; font: 500 11px/1.3 var(--mono); color: var(--text-3); }
table.daten tr:hover td { background: #fff3e6; }
.status.warn { color: #8a5200; }
.status.ernst { color: #b43d00; }
.r-ab { font-size: 12px; font-weight: 600; color: var(--text-2); }

.r-steuer { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: flex-end; margin: 4px 0 12px; }
.r-feld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.r-feld select { min-width: 220px; }
@media (max-width: 520px) { .r-feld, .r-feld select { width: 100%; min-width: 0; } .wahl { flex-wrap: wrap; } }

.r-regler { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 14px; font-size: 14px; color: var(--text-2); }
.r-regler b { color: var(--text-1); font-family: var(--mono); font-weight: 500; }
.r-regler.kurz { max-width: 360px; }
.r-regler input { width: 100%; accent-color: var(--akzent); height: 28px; }

.r-zahlzeile { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px dashed #c9b597; font-size: 14px; }
.r-zahlzeile:first-child { border-top: 0; }
.r-zahlzeile b { font-family: var(--mono); font-weight: 500; white-space: nowrap; }

.r-leer { margin: 8px 0; color: var(--text-2); font-size: 14px; }
.r-leer.hell { color: #f3e3c8; padding: 16px; }
.r-h3 { margin: 22px 0 8px; font-family: var(--kopf); font-weight: 740; font-size: 16px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.r-h3 span { font: 400 13px/1 "Nunito Sans", sans-serif; color: var(--text-2); }
.r-tab { max-height: 460px; }

/* ---------- Regalwand ---------- */
.r-wandkarte { padding-bottom: 16px; }
.r-skala { margin: 0 0 10px; }
.r-skala i { width: 14px; height: 14px; border: 1px solid var(--schwarz); }
.r-skala i.r-eck-zeichen { background: #fff; border: 2px solid var(--schwarz); width: 11px; height: 11px; }
.r-skala i.r-rest-zeichen { background: repeating-linear-gradient(135deg, #f5e6cd 0 3px, #e3c99f 3px 6px); }
.r-wand { position: relative; background: var(--regal); border: 3px solid var(--regal); border-radius: 2px; overflow: hidden; contain: layout paint; }
.r-fach { position: absolute; background: var(--fach); border-radius: 1px; }
.r-schild { position: absolute; left: 4px; right: 4px; top: 3px; height: 20px; display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 0 6px; background: #fff; color: var(--schwarz); font-size: 12px; line-height: 1; border-radius: 1px; overflow: hidden; white-space: nowrap; }
.r-schild b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.r-schild span { font: 500 11px/1 var(--mono); flex: none; }
.r-kachel { position: absolute; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 4px 5px; border: 0; border-radius: 1px; font: inherit; text-align: left; cursor: pointer; overflow: hidden; color: var(--schwarz); background: var(--r1); }
.r-kachel.st0 { background: var(--r1); }
.r-kachel.st1 { background: var(--r2); }
.r-kachel.st2 { background: var(--r3); }
.r-kachel.st3 { background: var(--r4); }
.r-kachel.st4 { background: var(--r5); color: #fff; }
.r-kachel.st5 { background: var(--r6); color: #fff; }
.r-kachel.stx { background: #f5e6cd; }
.r-kachel.rest { background: repeating-linear-gradient(135deg, #f5e6cd 0 4px, #e3c99f 4px 8px); color: var(--schwarz); }
.r-kachel:hover { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--schwarz); }
.r-kachel.an { box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--akzent); z-index: 1; }
.r-kachel:focus-visible { outline: 3px solid #fff; outline-offset: -3px; box-shadow: inset 0 0 0 5px var(--schwarz); z-index: 2; }
.r-kachel.unter::after { content: ""; position: absolute; right: 3px; top: 3px; width: 9px; height: 9px; background: #fff; border: 2px solid var(--schwarz); }
.r-k-name { font-size: 11.5px; font-weight: 700; line-height: 1.18; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto; padding-right: 10px; }
.r-k-wert { font: 500 11px/1.1 var(--mono); opacity: .92; }

/* ---------- geöffnetes Fach ---------- */
.r-offen { border-top: 6px solid var(--akzent); }
.r-fach-kopf { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 16px 24px; align-items: start; }
.r-etikett.gross { box-shadow: none; }
.r-etikett.gross .r-e-titel { margin: 4px 0 6px; font-family: var(--kopf); font-weight: 780; font-size: 22px; line-height: 1.12; overflow-wrap: anywhere; }
.r-fakten { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0; border-top: 1.5px solid var(--schwarz); }
.r-fakten > div { padding: 8px 10px 9px 0; border-bottom: 1px dashed #c9b597; min-width: 0; }
.r-fakten dt { font: 500 11.5px/1.3 var(--mono); color: var(--text-2); }
.r-fakten dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.r-fakten dd.r-f-neben { font-weight: 400; font-size: 12.5px; color: var(--text-2); }
.r-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--akzent-text); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
@media (max-width: 760px) { .r-fach-kopf { grid-template-columns: 1fr; } .r-fakten { grid-template-columns: 1fr 1fr; } }

/* ---------- Balkenlisten ---------- */
.r-liste { display: flex; flex-direction: column; }
.r-zeile { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 6px 0; border: 0; border-top: 1px solid var(--raster); background: none; font: inherit; color: inherit; text-align: left; width: 100%; }
.r-zeile:first-child { border-top: 0; }
button.r-zeile { cursor: pointer; }
button.r-zeile:hover { background: #fff3e6; }
button.r-zeile[aria-pressed="true"] { background: #ffe3cc; box-shadow: inset 4px 0 0 var(--akzent); }
.r-name { font-size: 14px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; padding-left: 4px; }
.r-name small { display: block; font-weight: 400; font-size: 12px; color: var(--text-2); }
.r-spur { position: relative; height: 16px; background: var(--flaeche-2); }
.r-spur i { position: absolute; left: 0; top: 0; bottom: 0; }
.r-spur i.teil { top: 4px; bottom: 4px; }
.r-wert { font: 500 13px/1.2 var(--mono); white-space: nowrap; text-align: right; min-width: 64px; }
@media (max-width: 560px) {
  .r-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .r-name { grid-column: 1 / -1; }
}

/* ---------- ABC/XYZ ---------- */
.r-matrix { display: grid; grid-template-columns: minmax(84px, auto) repeat(var(--sp), minmax(0, 1fr)); gap: 6px; }
.r-mk { font: 500 12px/1.25 var(--mono); color: var(--text-2); align-self: end; padding: 0 2px 2px; }
.r-mk.links { align-self: center; }
.r-zelle { position: relative; background: #fff; border: 1.5px solid var(--schwarz); border-radius: 2px; padding: 8px 10px 14px; min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.r-zelle b { font-family: var(--kopf); font-weight: 800; font-size: 24px; line-height: 1.05; }
.r-zelle span { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.r-zelle i { position: absolute; left: 0; bottom: 0; height: 6px; background: var(--akzent); }
.r-zelle.leer { background: var(--flaeche-2); }
@media (max-width: 520px) { .r-matrix { grid-template-columns: 58px repeat(var(--sp), minmax(0, 1fr)); gap: 4px; } .r-zelle { padding: 6px 6px 12px; } .r-zelle b { font-size: 20px; } .r-zelle span { font-size: 11px; } }

/* ---------- Fuß ---------- */
.a-fuss { background: var(--schwarz); color: #f3e3c8; border-top: 4px solid var(--akzent); }
.a-fuss a { color: #ffb27a; }
.zeichen-link { color: #f3e3c8; }
.zeichen-link:hover { color: #fff; background: #2b2118; }
.a-fuss :focus-visible { outline-color: var(--akzent); }

/* Kartenanordnung */
@media (min-width: 1021px) {
  #k-gruppe { grid-column: span 5; }
  #k-ort { grid-column: span 4; }
  #k-kapital { grid-column: span 3; }
}
#a-reich .gitter, #a-hueter .gitter, #a-wert .gitter { align-items: start; }
h1, h2, .r-h3 { text-wrap: balance; }
.knopf:active, .wahl button:active, .r-kachel:active, button.r-zeile:active { transform: translateY(1px); }
.knopf, .tabelle-knopf { white-space: nowrap; }

/* Verweis auf „Datei erkennen lassen“ */
.erkennen-satz { display: block; margin-top: 6px; font-size: 14px; color: var(--text-2); }
.erkennen-satz a { color: var(--akzent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
