/* Inter – liegt lokal bei (SIL Open Font License), kein CDN, kein Lizenzproblem. */
@font-face {
    font-family: "Inter";
    src: url("vendor/inter.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Arwico Portal – Hausstil.
   DREI Farben, mehr nicht: Arwico-Gelb, Arwico-Rot und Graustufen.
   Keine erfundenen Zusatzfarben – kein Grün für «in Ordnung», kein Blau für
   Fortschritt. Was sonst grün wäre, ist hier Kohle; was blau wäre, Gelb.

   Die einzige Ausnahme ist das ModellDepot-Navy: es steht ausschliesslich
   auf der Kachel, die zum ModellDepot-Modul führt – dort gehört es hin,
   sonst nirgends im Portal.

   Rot bleibt der Gefahrenfarbe vorbehalten (Löschen, Fehler, Aktionspreis);
   der Hauptknopf ist deshalb Kohle, nicht Rot – sonst sähen «Speichern» und
   «Löschen» gleich aus. Gelb heisst: hinschauen. */

:root {
    /* --- Arwico-Gelb, Leiter --------------------------------------------
       In OKLCH gerechnet: Helligkeit gleichmässig gestuft, Farbton gehalten,
       Buntheit über eine Glocke um die Grundfarbe. Wer Gelb einfach mit
       Schwarz mischt, bekommt Olive – deshalb diese Werte und keine anderen.
       Weisse Schrift wird erst ab 700 lesbar (Kontrast 5.5). */
    --gelb-50:   #FFF6E1;
    --gelb-100:  #FFEBBC;
    --gelb-200:  #FFD876;
    --gelb-300:  #F4C64C;   /* GRUNDFARBE */
    --gelb-400:  #D6AB33;
    --gelb-500:  #BB9424;
    --gelb-600:  #9F7D18;
    --gelb-700:  #816510;   /* ab hier trägt die Fläche weisse Schrift */
    --gelb-800:  #634C0C;
    --gelb-900:  #443409;

    /* --- Arwico-Rot, Leiter ---------------------------------------------
       Weisse Schrift ab 600, also schon auf der Grundfarbe (Kontrast 4.9). */
    --rot-50:    #FFF4F2;
    --rot-100:   #FFE6E2;
    --rot-200:   #FFD0C7;
    --rot-300:   #FFB0A3;
    --rot-400:   #FF8B79;
    --rot-500:   #F76350;
    --rot-600:   #D13626;   /* GRUNDFARBE */
    --rot-700:   #BC2A1C;
    --rot-800:   #961106;
    --rot-900:   #6C0300;

    /* --- Was die Oberfläche wirklich benutzt ----------------------------
       Die Leitern oben sind der Vorrat, diese Namen sind die Bedeutung.
       Im Code steht immer die Bedeutung, nie die Stufe. */
    --kohle:      #1F1F21;   /* Kopfleiste, Hauptknopf, «erledigt» */
    --kohle-hell: #34343A;   /* Hover auf Kohle */
    --rot:        var(--rot-600);   /* Marke, Gefahr, Aktionspreis */
    --rot-dunkel: var(--rot-700);   /* Hover auf Rot */
    --rot-flaeche:var(--rot-50);    /* Fehlerfläche */
    --gelb:       var(--gelb-300);  /* Warnung, aktiv, Fortschritt */
    --gelb-dunkel:var(--gelb-600);  /* Gelb als Schrift auf Weiss */
    --gelb-hell:  var(--gelb-50);   /* Warnfläche */

    --text:       #2B2B2D;   /* nicht ganz schwarz – ruhiger auf hellem Grund */
    --grau:       #86868A;   /* Fliesstext zweiter Ordnung, Beschriftungen */
    --grau-mittel:#B4B4B8;
    --grau-hell:  #DBDBDD;
    --grau-feld:  #EFEFF0;   /* gesperrte Felder, Kapseln */
    --linie:      #E8E8EA;   /* nur noch Trennlinien INNERHALB von Kacheln */
    --flaeche:    #F4F4F5;   /* Seitengrund, gegen den die Kacheln stehen */
    --weiss:      #FFFFFF;

    /* Kacheln tragen keinen Rahmen – sie heben sich durch Weiss auf Grau ab.
       Der Schatten ist so leise, dass er nur die Kante beruhigt. */
    --schatten:      0 1px 2px rgba(0, 0, 0, 0.04);
    --schatten-hoch: 0 4px 16px rgba(0, 0, 0, 0.08);

    /* Abstände als benannte Leiter – im ModellDepot-Modul stehen die Werte
       überall hart im Code, was beim Ändern jedes Mal Suchen bedeutet. */
    --abstand-1: 6px;
    --abstand-2: 10px;
    --abstand-3: 14px;
    --abstand-4: 22px;
    --abstand-5: 32px;

    --radius-klein: 8px;    /* Kapseln, kleine Flächen */
    --radius:       12px;   /* Knöpfe, Eingabefelder */
    --radius-gross: 20px;   /* Kacheln, Tabellenrahmen, Dialoge */
    --radius-rund:  999px;

    --spalte: 1560px;        /* Breite der Inhaltsspalte */
    --schrift: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: var(--schrift);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    background: var(--flaeche);
    -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ Kopf */

.kopf {
    display: flex;
    align-items: center;
    gap: var(--abstand-4);
    height: 56px;
    /* Die Leiste darf NIE umbrechen: mit acht Menüpunkten täte sie das auf
       jedem schmaleren Fenster und liefe über den Seiteninhalt. Statt zu
       brechen oder abzuschneiden, schiebt sich das Menü seitlich (siehe
       .navigation) – so bleibt jeder Punkt erreichbar. */
    flex-wrap: nowrap;
    /* dieselbe Spaltenbreite wie der Inhalt, damit Kopf und Seite fluchten */
    padding: 0 max(var(--abstand-4), calc((100vw - var(--spalte)) / 2));
    background: var(--kohle);
    color: var(--weiss);
    position: sticky;
    top: 0;
    z-index: 40;
}

/* Die Wortmarke liegt als SVG bei und wird als Maske gefüllt – so folgt sie
   der Textfarbe (weiss auf der Kohle-Leiste) und braucht keine zweite Datei
   für den hellen Grund. */
.marke {
    display: block;
    flex: none;
    color: var(--weiss);
    text-decoration: none;
}

.marke .logo {
    display: block;
    width: 141px;
    height: 22px;
    background: currentColor;
    -webkit-mask: url("/logo/arwico-portal.svg") no-repeat center / contain;
    mask: url("/logo/arwico-portal.svg") no-repeat center / contain;
}

.navigation {
    display: flex;
    gap: 2px;
    margin-left: var(--abstand-2);
    flex-wrap: nowrap;
    /* schmales Fenster: seitlich schiebbar statt abgeschnitten */
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.navigation::-webkit-scrollbar { display: none; }

.navigation a {
    font: inherit;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    padding: 7px var(--abstand-3);
    border-radius: var(--radius-rund);
    white-space: nowrap;
}
.navigation a:hover { background: var(--kohle-hell); color: var(--weiss); }
/* Der aktive Punkt hebt sich durch Helligkeit ab, nicht durch Farbe. */
.navigation a[aria-current="page"] { color: var(--kohle); font-weight: 700; background: var(--weiss); }

.kopf-rechts {
    margin-left: auto;
    flex: none;
    display: flex; align-items: center; gap: var(--abstand-3);
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px; white-space: nowrap;
    padding-left: var(--abstand-3);
}
/* Auf schmalen Fenstern gewinnt das Menü den Platz – der Name tritt zurück. */
@media (max-width: 1100px) { .kopf-rechts .name { display: none; } }
.kopf-rechts .knopf.still { color: rgba(255, 255, 255, 0.85); }
.kopf-rechts .knopf.still:hover { background: var(--kohle-hell); color: var(--weiss); }

/* ------------------------------------------------------------- Grundbau */

main {
    padding: var(--abstand-5) var(--abstand-4) 60px;
    max-width: var(--spalte);
    margin: 0 auto;
}

h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.2px; }
h2 { font-size: 15px; margin: 0 0 var(--abstand-2); font-weight: 700; }
.lead { color: var(--grau); margin: 0 0 var(--abstand-4); font-size: 13px; max-width: 78ch; }

.leiste { display: flex; align-items: center; gap: var(--abstand-2); flex-wrap: wrap; margin-bottom: var(--abstand-3); }
.leiste .schub { margin-left: auto; }

/* ------------------------------------------------- Eingaben und Knöpfe */

input[type="text"], input[type="search"], input[type="email"],
input[type="password"], input[type="number"], select, textarea {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--weiss);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 9px 12px;
    outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--kohle); }
input:disabled { background: var(--grau-feld); color: var(--grau); cursor: default; }
textarea { resize: vertical; min-height: 58px; line-height: 1.5; }

label.feld { display: block; }
label.feld > span {
    display: block; font-size: 11px; color: var(--grau);
    margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.4px;
}
label.feld > input, label.feld > select, label.feld > textarea { width: 100%; }

.knopf {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--weiss);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 9px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    /* Knopfbeschriftungen bleiben einzeilig */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.knopf:hover { border-color: var(--grau); }
.knopf:disabled { opacity: 0.45; cursor: default; border-color: var(--linie); }
.knopf.haupt { background: var(--kohle); border-color: var(--kohle); color: var(--weiss); }
.knopf.haupt:hover { background: var(--kohle-hell); border-color: var(--kohle-hell); }
.knopf.still { border-color: transparent; color: var(--grau); background: none; }
.knopf.still:hover { background: var(--flaeche); color: var(--text); border-color: transparent; }
.knopf.gefahr { background: var(--rot); border-color: var(--rot); color: var(--weiss); }
.knopf.gefahr:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); }
.knopf.klein { font-size: 12px; padding: 5px 10px; }

.knopf svg, .symbol { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.4; flex: none; }

/* ------------------------------------------------------------- Kärtchen */

/* Weisse Kachel auf hellem Grund – kein Rahmen, grosszügiger Radius, Luft
   innen. Das ist der Grundbaustein der ganzen Oberfläche. */
.karte {
    background: var(--weiss);
    border: 0;
    border-radius: var(--radius-gross);
    box-shadow: var(--schatten);
    padding: var(--abstand-4) 24px;
}
.karte + .karte { margin-top: var(--abstand-3); }
.karte > h2:first-child { margin-top: 0; }
.karte .lead:last-child { margin-bottom: 0; }

/* Eine Kachel, die selbst wieder Reihen trägt (Listen, Verlauf) */
.karte.eng { padding: var(--abstand-2) 0; }
.karte.eng .reihe {
    display: flex; align-items: center; gap: var(--abstand-3);
    padding: var(--abstand-2) 24px;
}
.karte.eng .reihe + .reihe { border-top: 1px solid var(--linie); }

/* --------------------------------------------------------------- Chips */

.chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 9px;
    border-radius: var(--radius-rund);
    background: var(--grau-hell);
    color: var(--text);
    white-space: nowrap;
}
.chip.rot    { background: var(--rot);   color: var(--weiss); }
.chip.gelb   { background: var(--gelb);  color: var(--text); }
/* «in Ordnung» trägt kein Grün, sondern einen ruhigen grauen Rand mit
   Kohle-Schrift – das reicht und bleibt bei den drei Hausfarben. */
.chip.gut    { background: var(--weiss); border: 1px solid var(--grau-hell); color: var(--kohle); font-weight: 600; }
.chip.dunkel { background: var(--kohle); color: var(--weiss); }
.chip.grau   { background: var(--grau);  color: var(--weiss); }
.chip.offen  { background: none; border: 1px solid var(--grau-hell); color: var(--grau); font-weight: 600; }

/* -------------------------------------------------------------- Tabelle */

.tabelle-rahmen {
    background: var(--weiss);
    border: 0;
    border-radius: var(--radius-gross);
    box-shadow: var(--schatten);
    overflow: auto;
}

table { border-collapse: collapse; width: 100%; font-size: 13px; }

thead th {
    position: sticky;
    top: 0;
    background: var(--weiss);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--grau);
    padding: 9px var(--abstand-2);
    border-bottom: 1px solid var(--linie);
    white-space: nowrap;
}

tbody td { padding: 8px var(--abstand-2); border-bottom: 1px solid var(--linie); vertical-align: top; }
tbody tr:hover { background: #FAFAFA; }
tbody tr.gewaehlt { background: var(--flaeche); }
td.nr { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--grau); }
td.mittig, th.mittig { text-align: center; }

.leer { padding: 40px; text-align: center; color: var(--grau); }

/* --------------------------------------------------------------- Meldung */

/* Meldungen sind weisse Kacheln wie alles andere. Gekennzeichnet wird mit
   einem farbigen Punkt IN der Kachel – kein Balken am Rand, keine getönte
   Fläche. Das hält die Farbmenge klein und die Kachelform sauber. */
.warnung {
    background: var(--weiss);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    padding: var(--abstand-3) var(--abstand-4);
    font-size: 13px;
    margin-bottom: var(--abstand-3);
    display: flex;
    align-items: baseline;
    gap: var(--abstand-2);
}
.warnung::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gelb);
    transform: translateY(-1px);
}
.hinweis::before { background: var(--grau-mittel); }
.hinweis.fehler::before { background: var(--rot); }

.fehler { color: var(--rot); font-size: 12px; margin-top: var(--abstand-2); min-height: 16px; }

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

.anmeldung {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--abstand-5);
    background: var(--kohle);
    padding: var(--abstand-5);
}

.anmelde-marke {
    width: 282px; max-width: 70vw;
    aspect-ratio: 331.6 / 51.8;
    background: var(--weiss);
    -webkit-mask: url("/logo/arwico-portal.svg") no-repeat center / contain;
    mask: url("/logo/arwico-portal.svg") no-repeat center / contain;
}
.anmeldung .karte { width: 340px; max-width: 90vw; }
.anmeldung label.feld { margin-bottom: 12px; }
.anmeldung .knopf { width: 100%; justify-content: center; }
.anmelde-fuss { display: flex; justify-content: space-between; margin-top: var(--abstand-2); }
.anmelde-fuss .knopf { width: auto; font-size: 12px; }

/* Wartestand: registriert, aber noch nicht freigeschaltet */
.wartestand { text-align: center; color: var(--weiss); max-width: 420px; }
.wartestand h2 { color: var(--weiss); font-size: 17px; }
.wartestand p { color: rgba(255,255,255,0.72); font-size: 13px; line-height: 1.55; }

/* ----------------------------------------------------------------- Start */

.willkommen { margin: 26px 0; }
.willkommen h1 { font-size: 27px; margin-bottom: 4px; }
.willkommen .lead { font-size: 15px; margin: 0; }

.startkarten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.startkarte {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--abstand-2);
    padding: 26px 24px;
    text-align: left;
    text-decoration: none;
    color: var(--text);
    font: inherit;
    background: var(--weiss);
    border: 0;
    border-radius: var(--radius-gross);
    box-shadow: var(--schatten);
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.startkarte:hover { box-shadow: var(--schatten-hoch); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .startkarte { transition: none; } .startkarte:hover { transform: none; } }
.startkarte svg {
    width: 40px; height: 40px;
    stroke: var(--kohle); fill: none;
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.startkarte strong { font-size: 15px; }
.startkarte span { font-size: 13px; color: var(--grau); line-height: 1.45; }
/* Die einzige Stelle im Portal, an der das ModellDepot-Navy vorkommt:
   die Kachel, die zum ModellDepot-Modul führt. */
.startkarte.aussen svg { stroke: #111D3D; }
.startkarte.aussen .marker { color: #111D3D; }
.startkarte .marker { font-size: 11px; font-weight: 700; color: var(--grau); letter-spacing: 0.4px; text-transform: uppercase; }

@media (max-width: 1000px) { .startkarten { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .startkarten { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- Raster */

.zweispaltig { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--abstand-3); }
.dreispaltig { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--abstand-3); }
@media (max-width: 800px) { .zweispaltig, .dreispaltig { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- Dialoge */

.dialog-schatten {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(31, 31, 33, 0.45);
    backdrop-filter: blur(2px);
}

.dialog {
    width: min(440px, 100%);
    background: var(--weiss);
    border-radius: var(--radius-gross);
    box-shadow: 0 18px 50px rgba(31, 31, 33, 0.28);
    padding: 24px 26px 20px;
}
.dialog h2 { font-size: 16px; margin: 0 0 8px; }
.dialog-text { font-size: 13px; color: var(--grau); margin: 0 0 16px; line-height: 1.5; }
.dialog-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: var(--abstand-3); }
.dialog label.feld { margin-bottom: var(--abstand-2); }

/* ----------------------------------------------------------- Fortschritt */

/* Die Klassennamen stammen aus fortschritt.js (aus dem ModellDepot-Modul
   übernommen) – dort heissen sie .balken und .balken-fuellung. Hier standen
   zuerst andere Namen, wodurch das Ladefenster überall unformatiert blieb. */
.balken {
    height: 8px;
    border-radius: var(--radius-rund);
    background: var(--grau-hell);
    overflow: hidden;
}
.balken-fuellung {
    height: 100%;
    width: 0;
    background: var(--kohle);
    border-radius: var(--radius-rund);
    transition: width 240ms ease;
}
/* Unbestimmter Lauf: fortschritt.js setzt `.laeuft` auf die FÜLLUNG und
   zieht sie auf volle Breite – die Bewegung kommt deshalb aus dem
   Farbverlauf, nicht aus der Breite. (Zwei Anläufe gebraucht: erst hiessen
   die Klassen anders, dann sass die Klasse am falschen Element.) */
.balken-fuellung.laeuft {
    background: linear-gradient(90deg,
        var(--grau-hell) 0%, var(--grau-hell) 30%,
        var(--kohle) 50%,
        var(--grau-hell) 70%, var(--grau-hell) 100%);
    background-size: 250% 100%;
    animation: balkenlauf 1.3s linear infinite;
    transition: none;
}
@keyframes balkenlauf { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) {
    .balken-fuellung { transition: none; }
    .balken-fuellung.laeuft { animation: none; background: var(--grau-mittel); }
}

/* Standzeile im Ladefenster – schlichter Text, kein Meldungskasten.
   (Die Klasse heisst dort .hinweis, meint aber etwas anderes als die
   Meldungskachel weiter oben; deshalb hier ausdrücklich zurückgesetzt.) */
.fortschritt .hinweis {
    font-size: 12px;
    color: var(--grau);
    margin: var(--abstand-2) 0 0;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    display: block;
    min-height: 18px;
}
.fortschritt .hinweis::before { content: none; }
.fortschritt .dialog-text { margin-bottom: var(--abstand-3); }

/* -------------------------------------------------- Auswahlfelder (auswahl.js) */

select[data-eigen] {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; border: 0;
    clip-path: inset(50%);
    overflow: hidden;
}

.auswahl { position: relative; display: inline-block; min-width: 0; }
label.feld > .auswahl { display: block; }
.leiste .auswahl { flex: 0 1 auto; }

.auswahl-knopf {
    display: flex;
    align-items: center;
    gap: var(--abstand-2);
    width: 100%;
    min-height: 33px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    text-align: left;
    background: var(--weiss);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 7px 11px;
    cursor: pointer;
}
.auswahl-knopf:hover { border-color: var(--grau-mittel); }
.auswahl-knopf:focus-visible { outline: none; border-color: var(--kohle); }
.auswahl-knopf:disabled { color: var(--grau-mittel); background: var(--flaeche); cursor: default; }
.auswahl.leer .auswahl-text { color: var(--grau); }
.auswahl-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.auswahl-pfeil {
    flex: none;
    width: 11px; height: 7px;
    background: currentColor;
    color: var(--grau);
    transition: transform 0.12s ease;
    -webkit-mask: no-repeat center / 11px 7px
        url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask: no-repeat center / 11px 7px
        url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.auswahl-offen .auswahl-knopf { border-color: var(--kohle); }
.auswahl-offen .auswahl-pfeil { transform: rotate(180deg); color: var(--kohle); }

.auswahl-liste {
    position: absolute;
    z-index: 60;
    top: calc(100% + 5px);
    left: 0;
    min-width: 100%;
    max-width: min(420px, 92vw);
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
    background: var(--weiss);
    border: 1px solid var(--linie);
    border-radius: var(--radius-gross);
    box-shadow: 0 8px 26px rgba(31, 31, 33, 0.16);
}
.auswahl.nach-oben .auswahl-liste { top: auto; bottom: calc(100% + 5px); }

.auswahl-eintrag {
    display: flex;
    align-items: center;
    gap: var(--abstand-2);
    width: 100%;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    text-align: left;
    background: none;
    border: 0;
    border-radius: var(--radius-klein);
    padding: 7px var(--abstand-2);
    cursor: pointer;
}
.auswahl-eintrag > span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auswahl-eintrag:hover, .auswahl-eintrag:focus-visible { background: var(--flaeche); outline: none; }
.auswahl-eintrag.gewaehlt { color: var(--kohle); font-weight: 600; }
.auswahl-haken { flex: none; width: 12px; color: var(--kohle); font-weight: 700; }

/* ══════════════════════════════════════════════════════════ Vorschau ════ */
/* Der Seitenplan aus `js/vorschau.js`: eine Miniatur je Seite, im
   Seitenverhältnis A4 (1 : 1,414). Sie zeigt die GLIEDERUNG, nicht das
   Layout – deshalb graue Kästen und lesbare Artikelnummern statt einer
   nachgebauten Seite, die dann doch anders aussieht als der Druck.

   FARBE NUR, WO SIE ETWAS BEDEUTET: die Miniaturen sind grau. Gelb trägt
   allein ein Block, an dem etwas fehlt. */

.vorschau-titel { margin: var(--abstand-4) 0 var(--abstand-2); font-size: 14px; }

.seitenplan {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: var(--abstand-2);
    margin: var(--abstand-2) 0 var(--abstand-3);
}

.minseite {
    position: relative;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1.414;
    padding: 5px;
    background: var(--weiss);
    border: 1px solid var(--grau-hell);
    border-radius: var(--radius-klein);
    overflow: hidden;
}

/* Titel und Inhaltsverzeichnis bleiben von Hand gesetzt – sie tragen keine
   Blöcke und heben sich deshalb als Fläche ab. */
.minseite.vorspann {
    align-items: center;
    justify-content: center;
    background: var(--grau-feld);
    border-style: dashed;
}
.minseite.vorspann .minkopf {
    font-size: 10px;
    font-weight: 600;
    color: var(--grau);
    text-align: center;
    line-height: 1.3;
    padding: 0 4px;
}

/* Das Rubrik-Kopfband – im Heft der dunkle Streifen mit dem Rubriktitel. */
.minband {
    flex: none;
    padding: 3px 4px;
    margin: -5px -5px 4px;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--weiss);
    background: var(--kohle);
    text-align: center;
    overflow: hidden;
}

.minkoerper { display: flex; flex-direction: column; gap: 3px; flex: 1; }

.minblock {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 3px 4px;
    background: var(--flaeche);
    border-radius: 2px;
    overflow: hidden;
}
.minblock.leer { background: none; border: 1px dashed var(--grau-hell); }
.minblock.luecke { background: var(--gelb-50); box-shadow: inset 2px 0 0 var(--gelb); }

.minnrtext {
    font-size: 8px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mintext {
    font-size: 7px;
    line-height: 1.25;
    color: var(--grau);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Die Seitenzahl steht wie im Heft unten – abwechselnd aussen wäre in der
   Miniatur nur Unruhe. */
.minnr {
    flex: none;
    margin-top: 4px;
    font-size: 8px;
    font-weight: 700;
    color: var(--grau);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
