/* WineToolPro Web – Gestaltung nach dem Erscheinungsbild des Weinguts Klostermühlenhof
   Olivgrün (Website) als Leitfarbe, Salbeigrün und Anthrazit aus dem Canva-Markenauftritt,
   Überschriften in Bebas Neue (Versalien), Text in Source Sans 3. Beide Schriften liegen lokal vor (SIL OFL). */

@font-face { font-family: "Bebas Neue"; src: url("fonts/BebasNeue.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
    --oliv: #8f9322;
    --oliv-dunkel: #6c6f17;
    --oliv-hell: #eceed3;
    /* markierte Zeile in Auswahllisten (Kunden-, Artikel-, Kontosuche): deutlich dunkler hinterlegt (08.11.) */
    --auswahl: #c9d09a;
    --salbei: #a8ae90;
    --salbei-dunkel: #7c826a;
    --salbei-hell: #eef0e7;
    --grund: #f5f5f0;
    --flaeche: #ffffff;
    --anthrazit: #4e4e54;
    --text: #2e2e33;
    --grau: #76767c;
    --linie: #dcdccf;
    --rot: #a83a2c;
    --rot-hell: #f7e3df;
    --gelb-hell: #fbf6dc;
    --radius: 6px;
    --schatten: 0 1px 2px rgba(46, 46, 51, .06), 0 2px 8px rgba(46, 46, 51, .05);
    --titel: "Bebas Neue", "Arial Narrow", sans-serif;
    --schrift: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 15px; line-height: 1.4; }
a { color: var(--oliv-dunkel); }
h1, h2, h3 { font-family: var(--titel); font-weight: 400; letter-spacing: .04em; color: var(--anthrazit); margin: 0; }
h1 { font-size: 2.1rem; line-height: 1; }
h2 { font-size: 1.45rem; line-height: 1.1; margin-bottom: .6rem; }
h3 { font-size: 1.15rem; margin-bottom: .4rem; }
h1:focus { outline: none; }

/* ---------- Kopfzeile */
.kopf { display: flex; align-items: center; gap: 2rem; background: var(--salbei); padding: .55rem 1.5rem; position: sticky; top: 0; z-index: 20; }
.marke img { height: 44px; display: block; }
.hauptmenue { display: flex; gap: .3rem; flex: 1; }
.hauptmenue a { font-family: var(--titel); font-size: 1.25rem; letter-spacing: .06em; color: #fff; text-decoration: none; padding: .35rem .85rem; border-radius: var(--radius); }
.hauptmenue a:hover { background: rgba(255, 255, 255, .15); }
.hauptmenue a.active { background: rgba(255, 255, 255, .95); color: var(--oliv-dunkel); }
.kopf-rechts { display: flex; flex-direction: column; align-items: flex-end; color: #fff; font-size: .82rem; line-height: 1.2; }
.kopf-rechts .benutzer { font-weight: 600; font-size: .95rem; }

.inhalt { padding: 1.4rem 1.5rem 3rem; max-width: 1500px; margin: 0 auto; }

/* ---------- Seitenkopf */
.seitenkopf { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.seitenkopf h1 { flex: 1; }
/* Paket iq: Meldungen im Seitenkopf stehen in eigener Zeile darunter – die Knopfreihe behält ihre Breite */
.seitenkopf > .hinweis { flex: 1 0 100%; order: 99; margin: 0; }
.seitenkopf .unterzeile { font-size: .95rem; color: var(--grau); font-family: var(--schrift); letter-spacing: 0; display: block; margin-top: .25rem; }
/* Unterzeile im Kartenkopf (Paket io): klein, grau, mit Abstand zur Überschrift */
h2 .unterzeile, h3 .unterzeile { font-size: .85rem; font-weight: 400; color: var(--grau); font-family: var(--schrift); letter-spacing: 0; margin-left: .6rem; }

/* ---------- Karten */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1rem 1.15rem; }
.karte + .karte { margin-top: 1rem; }
.karte > h2:first-child, .karte > .kartenkopf { margin-top: 0; }
.kartenkopf { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.kartenkopf h2 { flex: 1; margin: 0; }

.raster { display: grid; gap: 1rem; }
.raster-2 { grid-template-columns: 1fr 1fr; }
.raster-3 { grid-template-columns: repeat(3, 1fr); }
.raster-haupt { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (max-width: 1100px) { .raster-2, .raster-3, .raster-haupt { grid-template-columns: 1fr; } }

/* ---------- Schaltflächen */
.knopf { font-family: var(--schrift); font-size: .95rem; font-weight: 600; border: 1px solid var(--linie); background: var(--flaeche); color: var(--anthrazit);
         padding: .45rem .95rem; border-radius: var(--radius); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.knopf:hover { border-color: var(--salbei-dunkel); background: var(--salbei-hell); }
.knopf:disabled { opacity: .45; cursor: default; background: var(--flaeche); border-color: var(--linie); }
.knopf.haupt, a.knopf.haupt { background: var(--oliv); border-color: var(--oliv); color: #fff; }
.knopf.haupt:hover { background: var(--oliv-dunkel); border-color: var(--oliv-dunkel); }
.knopf.gefahr { color: var(--rot); border-color: #e3c3bd; }
.knopf.gefahr:hover { background: var(--rot-hell); }
.knopf.klein { padding: .2rem .55rem; font-size: .85rem; }
.knopf.gross { padding: .75rem 1.2rem; font-size: 1.02rem; justify-content: center; }
.knopfreihe { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare */
label.feld { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--grau); font-weight: 600; }
input, select, textarea { font-family: var(--schrift); font-size: .95rem; color: var(--text); border: 1px solid var(--linie); border-radius: 4px; padding: .38rem .5rem; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--oliv-hell); border-color: var(--oliv); }
input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--oliv); }
textarea { resize: vertical; min-height: 4.5rem; }
.formular { display: grid; grid-template-columns: repeat(6, 1fr); gap: .65rem .8rem; }
.formular .b1 { grid-column: span 1; } .formular .b2 { grid-column: span 2; } .formular .b3 { grid-column: span 3; }
.formular .b4 { grid-column: span 4; } .formular .b6 { grid-column: span 6; }
.haken { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; color: var(--text); font-weight: 400; cursor: pointer; }
/* 11.11.: in Formular-Rasterzeilen Eingabefelder unten bündig (auch bei zweizeiliger Beschriftung), Haken auf Höhe der Felder */
.formular > label.feld { justify-content: flex-end; }
/* 12.11.: Zeilen nicht strecken, wenn das Formular höher ist als sein Inhalt (z. B. zwei Formulare nebeneinander im Ernte-Dialog) */
.formular { align-content: start; }
.formular input, .formular select { min-width: 0; max-width: 100%; }
.formular input:not([type=checkbox]):not([type=radio]), .formular select { box-sizing: border-box; height: 2.15rem; }
.formular > label.haken { align-self: end; min-height: 2.15rem; }
.suchfeld { font-size: 1.15rem; padding: .6rem .8rem; width: 100%; border-width: 2px; border-color: var(--salbei); }
.suchfeld:focus { border-color: var(--oliv); }

/* ---------- Tabellen */
.tabelle { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tabelle th { text-align: left; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--grau);
              border-bottom: 2px solid var(--linie); padding: .45rem .5rem; background: var(--flaeche); position: sticky; top: 0; }
.tabelle td { border-bottom: 1px solid #ecece4; padding: .42rem .5rem; vertical-align: top; }
.tabelle tbody tr.klickbar { cursor: pointer; }
.tabelle tbody tr.klickbar:hover td { background: var(--salbei-hell); }
.tabelle tbody tr.gewaehlt td { background: var(--oliv-hell); }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle .mitte { text-align: center; }
.tabelle .klein { font-size: .82rem; color: var(--grau); }
.tabellenrahmen { max-height: calc(100vh - 290px); overflow: auto; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; }

/* ---------- Kennzeichen */
.marke-k { display: inline-block; font-size: .72rem; font-weight: 700; padding: .05rem .4rem; border-radius: 3px; background: var(--salbei-hell); color: var(--salbei-dunkel); letter-spacing: .03em; }
.marke-k.oliv { background: var(--oliv-hell); color: var(--oliv-dunkel); }
.marke-k.rot { background: var(--rot-hell); color: var(--rot); }
.marke-k.grau { background: #eee; color: #888; }
.hinweis { padding: .55rem .8rem; border-radius: var(--radius); background: var(--gelb-hell); border: 1px solid #ece0a8; font-size: .92rem; }
.hinweis.fehler { background: var(--rot-hell); border-color: #e9c4bd; color: #7b2a20; }
.hinweis.ok { background: var(--oliv-hell); border-color: #d5d8a6; color: #4e5110; }
.leer { color: var(--grau); font-style: italic; padding: .5rem 0; }
.gedaempft { color: var(--grau); }

/* ---------- Startseite */
.start-suche { padding: 1.4rem 1.4rem 1.2rem; background: linear-gradient(135deg, var(--salbei-hell), #fff); }
.schnellzugriff { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; margin-top: 1rem; }
.kachel { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff;
          text-decoration: none; color: var(--text); cursor: pointer; text-align: left; font-family: var(--schrift); }
.kachel:hover { border-color: var(--oliv); box-shadow: var(--schatten); }
.kachel strong { font-family: var(--titel); font-weight: 400; font-size: 1.25rem; letter-spacing: .04em; color: var(--oliv-dunkel); }
.kachel span { font-size: .85rem; color: var(--grau); }

/* ---------- Notizen */
.notizen { display: flex; flex-direction: column; gap: .55rem; max-height: 460px; overflow: auto; }
.notiz { border-left: 3px solid var(--salbei); padding: .35rem .6rem; background: var(--grund); border-radius: 0 4px 4px 0; }
.notiz.telefonat { border-left-color: var(--oliv); }
.notiz.wv-offen { border-left-color: #c9a227; background: var(--gelb-hell); }
.notiz-kopf { font-size: .78rem; color: var(--grau); display: flex; gap: .5rem; align-items: center; }
.notiz-text { white-space: pre-wrap; font-size: .93rem; }
.vorlieben { background: var(--oliv-hell); border-radius: var(--radius); padding: .55rem .75rem; font-size: .93rem; white-space: pre-wrap; }

/* ---------- Auftrag */
.positionen td { vertical-align: middle; }
.positionen input { width: 100%; padding: .28rem .4rem; }
.positionen input.zahl { text-align: right; }
.positionen .unterzeile { font-size: .8rem; color: var(--grau); }
.positionen input.zweite-zeile { font-size: .8rem; color: var(--grau); margin-top: .2rem; padding: .15rem .45rem; }
.positionen input.zweite-zeile:placeholder-shown:not(:focus) { border-color: transparent; background: transparent; }
.positionen tr.inhalt td { font-size: .84rem; color: var(--grau); padding-top: .1rem; padding-bottom: .1rem; }
.eingabezeile td { background: var(--salbei-hell); }
.vorschlaege { position: absolute; z-index: 30; background: #fff; border: 1px solid var(--salbei); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0,0,0,.12);
               min-width: 560px; max-height: 340px; overflow: auto; margin-top: 2px; }
.vorschlag { display: grid; grid-template-columns: 82px 1fr 70px 80px; gap: .5rem; padding: .4rem .6rem; cursor: pointer; font-size: .9rem; border-bottom: 1px solid #f0f0ea; }
.vorschlag:hover { background: var(--oliv-hell); }
.vorschlag.aktiv { background: var(--auswahl); box-shadow: inset 4px 0 0 var(--oliv-dunkel); }
.vorschlag .nr { font-weight: 600; }
.summenblock { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1.2rem; font-size: .95rem; }
.summenblock .gesamt { font-family: var(--titel); font-size: 1.7rem; letter-spacing: .03em; color: var(--oliv-dunkel); }
.summenblock .klein { font-size: .82rem; color: var(--grau); }
.status-band { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- Fehleranzeige / Wiederverbindung */
#blazor-error-ui { background: var(--rot-hell); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- PDF-Vorschau */
.overlay { position: fixed; inset: 0; background: rgba(46, 46, 51, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.overlay-fenster { background: #fff; border-radius: 8px; width: min(1000px, 100%); height: 100%; display: flex; flex-direction: column; padding: .9rem 1rem 1rem; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.overlay-fenster iframe { flex: 1; width: 100%; border: 1px solid var(--linie); border-radius: 4px; }

/* ---------- Dialoge, Weinbuch */
.overlay-fenster.dialog { height: auto; max-height: 92vh; width: min(680px, 100%); overflow: auto; padding: 1.1rem 1.25rem 1.25rem; }
.overlay-fenster.dialog.breit { width: min(900px, 100%); }
.dialog h2 { margin-bottom: .75rem; }
.reiter { display: flex; gap: .25rem; border-bottom: 1px solid var(--linie); margin-bottom: 1rem; }
.reiter button { border: 0; background: none; padding: .5rem .9rem; font: inherit; font-weight: 600; color: var(--grau); border-bottom: 3px solid transparent; cursor: pointer; }
.reiter button.aktiv { color: var(--oliv-dunkel); border-bottom-color: var(--oliv); }
.reiter button .anzahl { display: inline-block; min-width: 1.4rem; margin-left: .35rem; padding: 0 .35rem; border-radius: 9px; background: var(--oliv-hell); color: var(--oliv-dunkel); font-size: .78rem; }
.bestaende { display: flex; gap: .6rem; flex-wrap: wrap; }
.bestand { border: 1px solid var(--linie); border-radius: var(--radius); padding: .5rem .8rem; min-width: 120px; background: #fff; }
.bestand strong { display: block; font-family: var(--titel); font-weight: 400; font-size: 1.6rem; letter-spacing: .03em; color: var(--oliv-dunkel); line-height: 1.1; }
.bestand span { font-size: .82rem; color: var(--grau); }
.bestand.vorlaeufig { border-style: dashed; border-color: #d9c46a; background: var(--gelb-hell); }
.tabelle tr.korrektur td { background: var(--gelb-hell); }
.tabelle tr.annulliert td { color: #999; text-decoration: line-through; }
.tabelle td.ab { color: #8a3b2e; }
.baum { list-style: none; margin: 0; padding: 0; }
.baum li { padding: .3rem 0 .3rem calc(var(--t, 0) * 1.4rem); border-bottom: 1px dotted var(--linie); }
.baum li:last-child { border-bottom: 0; }
.baum .ernte { font-size: .85rem; color: var(--grau); margin-left: 1.4rem; }
.vergleich { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1.5rem; font-size: .98rem; margin: .5rem 0 1rem; }
.vergleich .z { text-align: right; font-variant-numeric: tabular-nums; }
.vergleich .summe { border-top: 1px solid var(--anthrazit); font-weight: 700; padding-top: .2rem; }

/* ---------- Kasse (Touch) */
.kasse { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr); gap: 1rem; align-items: start; }
.kasse-links, .kasse-rechts { display: flex; flex-direction: column; gap: .7rem; }
.kasse-reiter { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.kasse-reiter button { font: inherit; font-weight: 700; font-size: 1rem; padding: .65rem 1rem; border: 1px solid var(--linie); border-radius: 6px 6px 0 0; background: #fff; color: var(--anthrazit); cursor: pointer; }
.kasse-reiter button.aktiv { background: var(--oliv); border-color: var(--oliv); color: #fff; }
.kasse-reiter-bearbeiten { margin-left: auto; text-decoration: none; font-size: 1.2rem; padding: .3rem .6rem; color: var(--grau); }
.kasse-tasten { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .45rem; background: #fff; border: 1px solid var(--linie); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: .55rem; min-height: 420px; align-content: start; }
.kasse-taste { min-height: 78px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .2rem; padding: .4rem; border: 1px solid #d7d9cc; border-radius: 6px; background: var(--grund); font: inherit; cursor: pointer; touch-action: manipulation; }
.kasse-taste:active { background: var(--oliv-hell); transform: scale(.98); }
.kasse-taste .b { font-weight: 700; font-size: .95rem; text-align: center; line-height: 1.15; }
.kasse-taste .p { font-size: .8rem; color: var(--grau); }
.kasse-kunde { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: .6rem; position: relative; z-index: 20; }
.kasse-kunde-gewaehlt { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.kasse-treffer { position: absolute; left: .6rem; right: .6rem; top: 3.2rem; z-index: 10; background: #fff; border: 1px solid var(--linie); border-radius: 6px; box-shadow: var(--schatten); }
.kasse-treffer button { display: block; width: 100%; text-align: left; font: inherit; padding: .55rem .7rem; border: 0; border-bottom: 1px solid var(--linie); background: #fff; cursor: pointer; }
.kasse-treffer button:hover { background: var(--auswahl); }
.kasse-funktionen { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; }
.kf { font: inherit; font-weight: 700; color: #fff; border: 0; border-radius: 8px; padding: .8rem .3rem; text-align: center; text-decoration: none; cursor: pointer; }
.kf.gruen { background: #4f6b2c; } .kf.rot { background: #b8322a; } .kf.blau { background: #3a5f8f; } .kf.lila { background: #6b3d8f; } .kf.grau { background: var(--anthrazit); } .kf.gelb { background: #a8781e; }
.kasse-bon { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); min-height: 240px; max-height: 330px; overflow-y: auto; }
.kasse-bon-kopf { display: flex; justify-content: space-between; padding: .4rem .7rem; font-weight: 700; color: var(--grau); border-bottom: 1px solid var(--linie); }
.kasse-zeile { display: grid; grid-template-columns: 46px 1fr auto 34px; gap: .4rem; align-items: center; padding: .45rem .6rem; border-bottom: 1px dotted var(--linie); cursor: pointer; }
.kasse-zeile.gewaehlt { background: var(--oliv-hell); }
.kasse-zeile .m { font-weight: 700; } .kasse-zeile .s { font-variant-numeric: tabular-nums; font-weight: 600; }
.kasse-zeile .x { border: 0; background: none; font-size: 1rem; color: #b8322a; cursor: pointer; }
.kasse-summe { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: .5rem .8rem; }
.kasse-summe > div { display: flex; justify-content: space-between; align-items: center; padding: .15rem 0; }
.kasse-summe .gross { font-family: var(--titel); font-size: 2rem; letter-spacing: .03em; color: var(--oliv-dunkel); }
#kasse-rabatt.aktiv { border: 2px solid var(--oliv-dunkel); background: #f6f8e9; font-weight: 700; }
.kasse-summe .rueck { font-size: 1.4rem; font-weight: 700; color: #b8322a; }
.kasse-eingabe { display: grid; grid-template-columns: 1fr 120px; gap: .45rem; }
.kasse-anzeige { grid-column: 1 / -1; background: var(--anthrazit); color: #fff; font-size: 1.5rem; font-variant-numeric: tabular-nums; padding: .35rem .7rem; border-radius: 6px; }
.kasse-anzeige .klein { color: #cfd1c4; font-size: .8rem; }
.kasse-block { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.kasse-block2 { display: grid; grid-template-rows: repeat(4, 1fr); gap: .35rem; }
.kasse-block button, .kasse-block2 button { font: inherit; font-size: 1.35rem; font-weight: 700; min-height: 54px; border: 1px solid #d7d9cc; border-radius: 6px; background: #fff; cursor: pointer; touch-action: manipulation; }
.kasse-block2 button { font-size: .95rem; }
.kasse-block2 button.rot { color: #b8322a; }
.kasse-zahlung { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .45rem; }
.kasse-zahlung button { font: inherit; font-size: 1.15rem; font-weight: 700; min-height: 64px; border: 0; border-radius: 8px; background: var(--anthrazit); color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.kasse-zahlung button.bar { background: var(--oliv); }
.kasse-zahlung button:disabled { opacity: .45; cursor: default; }
@media (max-width: 1000px) { .kasse { grid-template-columns: 1fr; } }

/* Keller */
.fuell { position: relative; height: 8px; background: var(--linie); border-radius: 4px; overflow: hidden; min-width: 70px; }
.fuell > span { position: absolute; inset: 0 auto 0 0; background: var(--oliv); border-radius: 4px; }
.fuell.voll > span { background: var(--oliv-dunkel); }
.fuell.ueber > span { background: #b54a3a; }
tr.frei td { color: var(--grau); }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: var(--oliv-hell); }

/* Steuersatz einer Position weicht vom Artikel ab */
select.warnung { border-color: #c27a2c; background: #fbf1e3; }

/* Sortierbare Spaltenköpfe */
.tabelle th.sortierbar { cursor: pointer; user-select: none; white-space: nowrap; }
.tabelle th.sortierbar:hover { color: var(--oliv); }
.tabelle th.sortierbar .sortpfeil { display: inline-block; margin-left: .3em; font-size: .85em; opacity: .35; }
.tabelle th.sortierbar.aktiv { color: var(--oliv); }
.tabelle th.sortierbar.aktiv .sortpfeil { opacity: 1; }

/* Anmeldung */
.anmelden-seite { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--salbei-hell); }
.anmelden-karte { background: var(--flaeche); border-radius: 10px; box-shadow: var(--schatten); padding: 1.6rem 1.8rem; width: min(400px, 100%); display: flex; flex-direction: column; gap: .7rem; }
.anmelden-karte h1 { font-family: var(--titel); font-weight: 400; font-size: 2rem; letter-spacing: .03em; margin: 0; color: var(--anthrazit); }
.anmelden-karte form { display: flex; flex-direction: column; gap: .7rem; }
.anmelden-karte .knopf { margin-top: .3rem; justify-content: center; }
.anmelden-logo { width: 280px; max-width: 100%; }
.benutzermenue { position: relative; }
.benutzermenue summary { cursor: pointer; list-style: none; }
.benutzermenue summary::-webkit-details-marker { display: none; }
.benutzermenue summary::after { content: " ▾"; font-size: .75em; }
.benutzermenue-liste { position: absolute; right: 0; top: 1.6rem; background: #fff; border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.18); min-width: 220px; z-index: 50; display: flex; flex-direction: column; padding: .3rem 0; }
.benutzermenue-liste a, .benutzermenue-liste button { color: var(--text); text-decoration: none; padding: .5rem .9rem; font: inherit; font-size: .9rem; text-align: left; background: none; border: 0; cursor: pointer; }
.benutzermenue-liste a:hover, .benutzermenue-liste button:hover { background: var(--salbei-hell); }

/* Kasse füllt genau das Fenster: Funktionsleiste oben, Artikeltasten scrollen innen, Bon und Zahlarten bleiben sichtbar */
@media (min-width: 1000px) and (min-height: 600px) {
    .inhalt:has(> .kasse) { padding-bottom: .8rem; }
    .kasse { height: calc(100vh - 62px - 2.2rem); align-items: stretch; }
    .kasse-links, .kasse-rechts { min-height: 0; }
    .kasse-tasten { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; }
    .kasse-rechts { overflow-y: auto; }
    .kasse-bon { flex: 1 1 auto; min-height: 110px; max-height: none; }
}

.testmarke { background: #f2c94c; color: #3a3000; border-radius: 4px; padding: .05rem .4rem; font-size: .75rem; letter-spacing: .05em; margin-right: .3rem; }

/* Benutzer und Rechte: Zellen mittig, Spalten bündig mit den Überschriften */
.tabelle.rechte td { vertical-align: middle; }
.tabelle.rechte th { vertical-align: bottom; }
.tabelle.rechte td:nth-child(n+3):nth-child(-n+11), .tabelle.rechte th:nth-child(n+3):nth-child(-n+11) { text-align: center; }
.tabelle.rechte input[type=checkbox] { display: block; margin: 0 auto; }

/* Kopfzeile passt auch auf schmalere Bildschirme (sonst verschiebt sich die ganze Seite seitlich) */
.kopf, .hauptmenue { min-width: 0; }
.hauptmenue { flex-wrap: wrap; }
@media (max-width: 1500px) {
    .kopf { gap: 1rem; padding: .5rem 1rem; }
    .hauptmenue { gap: .1rem; }
    .hauptmenue a { font-size: 1.12rem; padding: .3rem .55rem; }
}
@media (max-width: 1300px) {
    .kopf-rechts .betrieb { display: none; }
    .hauptmenue a { font-size: 1.02rem; padding: .28rem .42rem; letter-spacing: .04em; }
    .marke img { height: 36px; }
}
.tabelle.rechte th { font-size: .7rem; letter-spacing: .02em; padding-left: .35rem; padding-right: .35rem; }
.tabelle.rechte td { padding-left: .35rem; padding-right: .35rem; }

/* Splitzeilen im Lexware-Export */
.tabelle tr.split td { color: var(--grau); font-size: .88rem; padding-top: .2rem; padding-bottom: .2rem; }
.tabelle tr.split td:nth-child(4) { padding-right: 1.4rem; }

/* ---------- Maske Weinkonto (wie „Neues Weinkonto anlegen“ im Altsystem) */
.overlay-fenster.dialog.sehrbreit { width: min(1180px, 100%); }
.wk-maske { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1rem; margin-top: .4rem; }
.wk-raster { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .9rem; }
.wk-nummer { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.wk-weinnr { background: #fff7a8 !important; font-weight: 700; font-size: 1.05rem; }
.wk-auto { background: #fde3d3 !important; }
.wk-rechts { background: var(--salbei-hell, #eef1e6); border-radius: 6px; padding: .6rem .8rem; }
.wk-rechts h3 { font-size: .85rem; margin: .5rem 0 .3rem; }
.wk-rechts h3:first-child { margin-top: 0; }
.wk-rechts .wahl { display: flex; gap: .4rem; align-items: flex-start; font-size: .85rem; margin: .15rem 0; }
.wk-rechts .wk-text { display: grid; grid-template-columns: 3.5rem 1fr; align-items: center; gap: .4rem; margin: .2rem 0; }
@media (max-width: 900px) { .wk-maske, .wk-raster, .wk-nummer { grid-template-columns: 1fr; } .wk-nummer, .wk-raster > * { grid-column: auto; } }
.fehlertext { color: var(--rot, #b3261e); font-weight: 700; }
.kasse-ident { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .2rem 0 .4rem; }
.kasse-ident .suchfeld { flex: 1 1 320px; font-size: 1rem; padding: .4rem .6rem; }
.kasse-ident-feld { position: relative; flex: 1 1 320px; }
.kasse-ident-feld .suchfeld { width: 100%; }
.kasse-ident-feld .vorschlaege { left: 0; right: 0; min-width: 0; }
.kasse-ident-feld .vorschlag { grid-template-columns: 82px 1fr auto 80px; }
.kasse-ident-feld .vorschlag .zahl { white-space: nowrap; }
.kasse-preis { border: 1px dashed var(--linie, #ccc); background: #fff; border-radius: 4px; padding: .05rem .35rem; font: inherit; cursor: pointer; }
.kasse-preis:hover { border-color: var(--oliv, #8a9a2b); }
.kasse-preis-ein { width: 90px; text-align: right; font-size: 1rem; padding: .15rem .3rem; }

/* Tabellenansicht zum Bearbeiten (T12) */
.tab-edit-leiste { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; margin:.3rem 0 .5rem; }
.tab-edit-rahmen { overflow:auto; max-height:calc(100vh - 260px); border:1px solid var(--linie, #ddd); border-radius:6px; }
table.tab-edit { font-size:.86rem; }
table.tab-edit thead th { position:sticky; top:0; z-index:2; background:var(--flaeche, #fff); }
table.tab-edit td { padding:1px 3px; vertical-align:middle; }
table.tab-edit td input:not([type=checkbox]), table.tab-edit td select { width:100%; min-width:60px; border:1px solid transparent; background:transparent; padding:3px 4px; font:inherit; border-radius:3px; }
table.tab-edit td input:not([type=checkbox]):focus, table.tab-edit td select:focus { border-color:#859B32; background:#fff; outline:none; }
table.tab-edit td input.zahl { text-align:right; }
table.tab-edit td.tab-geaendert { background:#f9eeda; }
table.tab-edit td.tab-fehler { background:#fbebeb; box-shadow:inset 0 0 0 1px #d9534f; }
table.tab-edit tr.tab-neu td { background:#e5f4e4; }
table.tab-edit tr.tab-neu td.tab-fehler { background:#fbebeb; }
table.tab-edit .tab-fest { color:#666; padding:0 4px; white-space:nowrap; }

/* ---------- Lesbarkeit (Wunsch Betrieb 05.11.): Schrift Verdana, Text überall schwarz statt grau ---------- */
:root {
    --schrift: Verdana, Geneva, Tahoma, sans-serif;
    --titel: Verdana, Geneva, Tahoma, sans-serif;
    --text: #000;
    --grau: #000;
    --gedaempft: #000;
}
html, body { font-size: 14px; }
h1, h2, h3, .knopf, .kasse-reiter button, .anmelden-karte h1 { color: #000; }
h1, h2, h3, .anmelden-karte h1 { font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 1.55rem; line-height: 1.15; }
h2 { font-size: 1.1rem; line-height: 1.2; }
.anmelden-karte h1 { font-size: 1.5rem; }
.hauptmenue a { font-size: .82rem; font-weight: 700; letter-spacing: .01em; padding: .35rem .6rem; }
.kachel strong { font-size: 1rem; font-weight: 700; letter-spacing: 0; }
.summenblock .gesamt, .bestand strong { font-size: 1.35rem; font-weight: 700; letter-spacing: 0; }
.kasse-summe .gross { font-size: 1.6rem; font-weight: 700; letter-spacing: 0; }
.tabelle th { color: #000; letter-spacing: .02em; }
.marke-k.grau { color: #000; }
.tabelle tr.annulliert td { color: #000; }
table.tab-edit .tab-fest { color: #000; }
input::placeholder, textarea::placeholder { color: #555; }
.seitenkopf .unterzeile { font-weight: 400; letter-spacing: 0; }
/* Kassentasten: höchstens 3 Zeilen Bezeichnung + 1 Zeile Preis/Ident-Nr. (Wunsch Betrieb 05.11.) */
.kasse-taste { height: 6.2em; min-height: 0; justify-content: center; overflow: hidden; }
.kasse-taste .b { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; max-width: 100%; }
.kasse-taste .p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; flex: none; }

/* WineToolPro-Schriftzug auf der Anmeldeseite (unter dem Weingut-Logo) */
.anmelden-programm { margin: .2rem 0 .3rem; line-height: 0; }
.anmelden-programm img { width: 230px; max-width: 100%; height: auto; }

/* Fußzeile mit dem WineToolPro-Zeichen (nicht an der Kasse) */
.programmfuss { display: flex; align-items: center; justify-content: center; gap: .45rem; padding: 1.2rem 1rem 1.4rem; font-size: .8rem; color: #63523B; }
.programmfuss b { font-weight: 700; } .programmfuss .t { color: #859B32; font-weight: 400; }
.programmfuss .marke { color: #6B604F; letter-spacing: .115em; font-size: .92em; } .programmfuss .marke b { color: #63523B; }
.programmfuss .stand { color: #63523B; opacity: .8; } .programmfuss .stand::before { content: "·"; margin-right: .45rem; }
.programmfuss img { display: block; }
.fehlerseite { max-width: 640px; margin: 3rem auto; display: flex; flex-direction: column; gap: .8rem; }
.fehlerseite img { height: auto; max-width: 100%; }

/* Umschalter Keller | Weinbuch | Herbstbuch links neben der Überschrift */
.seitenkopf h1:has(+ .bereich-umschalter) { flex: 0 1 auto; }
.bereich-umschalter { display: inline-flex; margin-right: auto; align-self: flex-start; margin-top: .15rem; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; background: var(--flaeche); }
.bereich-umschalter a { padding: .45rem 1rem; font-weight: 700; font-size: .95rem; color: #000; text-decoration: none; border-right: 1px solid var(--linie); }
.bereich-umschalter a:last-child { border-right: 0; }
.bereich-umschalter a:hover { background: var(--oliv-hell); }
.bereich-umschalter a.aktiv { background: var(--oliv-dunkel); color: #fff; }

/* Kassen-Funktionsknöpfe: Text immer mittig (der Link „Kassenbericht“ stand sonst oben) */
.kf { display: flex; align-items: center; justify-content: center; line-height: 1.2; }

/* Belegvorschau mit pdf.js */
.pdf-werkzeuge { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; margin: .2rem 0 .4rem; }
.pdf-ansicht { flex: 1; overflow: auto; background: #525659; padding: 12px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdf-ansicht canvas { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); max-width: none; }
.beleg-aktionen { display: flex; gap: .4rem; flex-wrap: wrap; margin: .2rem 0 .3rem; }

/* Seitenkopf zweigeteilt: links Überschrift (linksbündig), rechts die Knöpfe (rechtsbündig, umbrechen rechtsbündig) */
.seitenkopf h1 { flex: 0 1 auto; }
.seitenkopf > .knopfreihe { flex: 1 1 0; min-width: min(100%, 380px); justify-content: flex-end; }

/* Kassentasten einrichten: Raster mit festen Plätzen (Ziehen mit der Maus) */
.tasten-raster { display: grid; gap: .35rem; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: .45rem; grid-auto-rows: 4.6em; }
.tasten-raster .tr-taste, .tasten-raster .tr-frei { position: relative; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: .3rem .35rem .3rem .35rem; overflow: hidden; }
.tasten-raster .tr-taste { border: 1px solid #d7d9cc; background: var(--grund); cursor: grab; font-weight: 700; font-size: .78rem; text-align: center; line-height: 1.15; }
.tasten-raster .tr-taste:active { cursor: grabbing; }
.tasten-raster .tr-taste.markiert { outline: 3px solid var(--oliv); outline-offset: -1px; }
.tasten-raster .tr-taste.inaktiv { opacity: .45; }
.tasten-raster .tr-text { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tasten-raster .tr-frei { border: 1px dashed #cfd2c3; color: #b7baa9; cursor: pointer; }
.tasten-raster .tr-frei.ziel { border-color: var(--oliv); background: #f6f7ef; }
.tasten-raster .tr-nr { position: absolute; top: 2px; left: 5px; font-size: .65rem; font-weight: 400; color: #8b8e7e; }
.tasten-raster .tr-taste { flex-direction: column; gap: .15rem; padding-top: 1rem; }
.tasten-raster .tr-werkzeug { position: absolute; top: 1px; right: 2px; display: flex; gap: 1px; }
.tasten-raster .tr-werkzeug button { border: 0; background: transparent; cursor: pointer; font-size: .85rem; line-height: 1; padding: 2px 3px; color: #6d705f; border-radius: 3px; }
.tasten-raster .tr-werkzeug button:hover { background: rgba(0,0,0,.08); color: #2e2e33; }
.tasten-raster .tr-werkzeug button.weg:hover { color: var(--fehler, #b00020); }
.tasten-raster .tr-info { font-size: .66rem; font-weight: 400; color: #77796b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tasten-raster .tr-neu { border: 0; background: transparent; font-size: 1.4rem; color: #c2c5b4; cursor: pointer; width: 100%; height: 100%; }
.tasten-raster .tr-neu:hover { color: var(--oliv); }
.tasten-raster { grid-auto-rows: 5.2em; }
/* Dialog ohne eigene Bildlaufleiste: Auswahllisten (z. B. Ident-Nr.) dürfen über den Fensterrand hinausragen */
.overlay-fenster.dialog.ueberlauf { overflow: visible; max-height: none; }
/* Zahlenfeld ohne Auf-/Ab-Pfeile (z. B. gezählter Kassenbestand) */
input.ohne-pfeile { -moz-appearance: textfield; appearance: textfield; }
input.ohne-pfeile::-webkit-outer-spin-button, input.ohne-pfeile::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tabelle tr.aktiv td { background: var(--oliv-hell, #eef0dc); }
.geld-block button.rot { color: #b8322a; font-size: 1.05rem; }

/* Zahlenfeld mit eigenen Pfeilen (gleich in allen Browsern, Komma als Dezimalzeichen) */
.zahl-pfeile { display: flex; align-items: stretch; }
.zahl-pfeile > input { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.zahl-pfeile .pfeile { display: flex; flex-direction: column; border: 1px solid var(--linie); border-left: 0; border-radius: 0 4px 4px 0; overflow: hidden; }
.zahl-pfeile .pfeile button { flex: 1; border: 0; background: #f4f3ee; padding: 0 .45rem; font-size: .6rem; line-height: 1; cursor: pointer; color: inherit; }
.zahl-pfeile .pfeile button:hover { background: #e6e3d6; }
.zahl-pfeile .pfeile button + button { border-top: 1px solid var(--linie); }

/* PDF-Fenster im Programm (statt neuem Tab) */
#wtp-pdf { position: fixed; inset: 0; z-index: 9999; background: rgba(30,30,30,.55); display: none; flex-direction: column; padding: 1rem; gap: .5rem; }
#wtp-pdf .wtp-pdf-kopf { display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: 8px; padding: .5rem .8rem; }
#wtp-pdf .wtp-pdf-titel { font-weight: 700; }
#wtp-pdf .wtp-pdf-rahmen { flex: 1; width: 100%; border: 0; border-radius: 8px; background: #fff; }

/* ---------- 08.11.: Touch an der Kasse, Rabatt-Eingabe, Bemerkung */
/* Listen und Auswahlfelder: mit dem Finger ziehen = scrollen (echtes Touch); Maus-Touch über winetoolpro.ziehen in App.razor */
.vorschlaege, .tabellenrahmen, .kasse-bon, .kasse-tasten, .kasse-rechts, .overlay-fenster, .notizen, .tab-edit-rahmen, .pdf-ansicht, [data-scroll] {
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y;
}
body.wtp-ziehen, body.wtp-ziehen * { user-select: none !important; cursor: grabbing !important; }
@media (pointer: coarse) {
    .vorschlaege::-webkit-scrollbar, .kasse-bon::-webkit-scrollbar, .kasse-tasten::-webkit-scrollbar, .tabellenrahmen::-webkit-scrollbar { width: 18px; height: 18px; }
}
/* Rabatt-Eingabe: alles außer Rabattfeld, Zehnertastatur und „Rabatt OK“ gesperrt, bis bestätigt */
.kasse.rabatt-sperre .kasse-links, .kasse.rabatt-sperre .kasse-bon, .kasse.rabatt-sperre .kasse-zahlung { opacity: .45; pointer-events: none; }
.kasse-block2 .rabatt-ok { background: var(--oliv); color: #fff; border-color: var(--oliv-dunkel); }
#kasse-rabatt.aktiv { outline: 3px solid var(--oliv); background: var(--gelb-hell); }
.kasse-bemerkung { background: var(--gelb-hell); }
.kasse-block2-paar { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.kasse-block2-paar button { font-size: .85rem; padding: 0 .2rem; }
.kasse-kunde-zeile { display: flex; gap: .5rem; align-items: stretch; }
.kasse-kunde-zeile > .kasse-kunde { flex: 1; min-width: 0; }
.kasse-bonbem { flex: none; align-self: stretch; padding: 0 .9rem; white-space: nowrap; }
.kasse-block2 button.gesetzt, .kasse-bonbem.gesetzt { background: var(--gelb-hell); border-color: var(--oliv); }

/* ---------- Spaltenbreiten (T31) */
th.spalte-rand { cursor: col-resize; box-shadow: inset -3px 0 0 var(--oliv); }
table.tabelle[data-breiten-gesetzt] td, table.tabelle[data-breiten-gesetzt] th { overflow: hidden; text-overflow: ellipsis; }
#wtp-breiten-menue { position: absolute; z-index: 300; display: none; background: #fff; border: 1px solid var(--linie); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.15); padding: .25rem; }
#wtp-breiten-menue button { font: inherit; background: none; border: 0; padding: .45rem .7rem; cursor: pointer; display: block; width: 100%; text-align: left; }
#wtp-breiten-menue button:hover { background: var(--auswahl); }

/* T29: Buchung deutlich später erfasst als ihr Datum */
td.nachtrag { background: var(--gelb-hell); }

/* M8: Termine und Erinnerungen */
.termin-form div.feld { display: flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: var(--grau); font-weight: 600; }
.termin-benutzer { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; padding: .3rem 0; }
.marke-k.gelb { background: #f3e3a3; color: #6b5410; }
.tabelle tr.termin-bald td { background: var(--gelb-hell); }
.tabelle tr.termin-hervor td { background: #f6e9b0; }
.tabelle tr.termin-ueberfaellig td { background: var(--rot-hell); }
.tabelle tr.termin-ueberfaellig td:first-child { box-shadow: inset 3px 0 0 var(--rot); }
.kopf-glocke { position: relative; color: #fff; text-decoration: none; font-size: 1.2rem; padding: 0 .35rem; line-height: 1; }
.kopf-glocke .anzahl { position: absolute; top: -.45rem; right: -.35rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .2rem; border-radius: .55rem;
    background: #c9a227; color: #fff; font-size: .68rem; font-weight: 700; line-height: 1.05rem; text-align: center; }
.kopf-glocke.rot .anzahl { background: var(--rot); }
.termine-start { display: flex; flex-direction: column; gap: .45rem; }
.termin-erinnerung { border-left: 3px solid #c9a227; padding: .4rem .6rem; background: var(--gelb-hell); border-radius: 0 4px 4px 0; }
.termin-erinnerung.hervor { background: #f6e9b0; border-left-color: #a8781e; }
.termin-erinnerung.ueberfaellig { background: var(--rot-hell); border-left-color: var(--rot); }
.termin-erinnerung .termin-kopf { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--grau); }
.termin-erinnerung .termin-titel { font-weight: 600; color: var(--text); text-decoration: none; }
.termin-erinnerung .knopfreihe { margin-top: .3rem; }
/* Spalten wählen (T32) */
.overlay-fenster.dialog.spalten-fenster { width: min(820px, 100%); height: auto; max-height: 90vh; overflow: auto; }
.spalten-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: .6rem; }
.spalten-raster h3 { font-size: .95rem; margin: 0 0 .4rem; }
.spalten-liste { list-style: none; margin: 0; padding: 0; }
.spalten-liste li { display: flex; justify-content: space-between; align-items: center; gap: .4rem; padding: .15rem 0; border-bottom: 1px solid var(--linie); }
.spalten-pfeile { display: flex; gap: .2rem; }
.spalten-pfeile .knopf { padding: .1rem .45rem; }
.spalten-raster .haken { display: block; padding: .15rem 0; }
.spalten-gruppe { margin: .5rem 0 .1rem; text-transform: uppercase; letter-spacing: .04em; }
.spalten-suche { width: 100%; margin-bottom: .3rem; }
.tabellen-werkzeug { display: flex; justify-content: flex-end; gap: .4rem; margin: 0 0 .3rem; }
/* Spalten wählen (T32): Liste nur so breit wie ihre Spalten – freier Platz rechts bleibt frei (Weinbuch, Kunden, Artikel, Aufträge) */
.spalten-block { width: fit-content; max-width: 100%; min-width: 0; }
.spalten-block > .tabellenrahmen > table.tabelle { width: auto; }
/* letzte Spalte: Platz rechts zum Greifen des Spaltenrands, Bildlaufleiste überdeckt die Tabelle nicht */
.spalten-block > .tabellenrahmen { scrollbar-gutter: stable; padding-right: 10px; }

/* ---------- Testsystem (Lastenheft T33): roter Balken oben, andere Kopffarbe ---------- */
.testsystem-balken { position: sticky; top: 0; z-index: 30; height: 26px; line-height: 26px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    background: repeating-linear-gradient(-45deg, #c01010 0 18px, #a00c0c 18px 36px); color: #fff; font-weight: 700; text-align: center; font-size: .9rem; letter-spacing: .02em; padding: 0 .5rem; }
html[data-testsystem] .kopf { top: 26px; background: #b3541e; }
html[data-testsystem] .anmelden-seite { min-height: calc(100vh - 26px); }
@media (min-width: 1000px) and (min-height: 600px) {
    html[data-testsystem] .kasse { height: calc(100vh - 62px - 2.2rem - 26px); }
}
/* kleines Kopier-Symbol (z. B. E-Mail-Adresse in der Kunden-Seitenleiste des Auftrags) */
.kopier-knopf { background: none; border: 1px solid var(--linie, #ccc); border-radius: 3px; cursor: pointer; font-size: .8rem; line-height: 1; padding: .05rem .3rem; margin-left: .3rem; color: inherit; vertical-align: middle; }
.kopier-knopf:hover { background: var(--salbei-hell); }
/* Etiketten-Tablet (/etiketten/scan): große Bedienelemente für Touch */
.scan-seite { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: .8rem; }
.scan-kopf { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.scan-eingabe { display: flex; gap: .5rem; }
.scan-feld { flex: 1; font-size: 1.4rem; padding: .7rem .8rem; min-width: 0; }
.scan-knopf { font-size: 1.1rem; padding: .6rem 1rem; }
.scan-video video { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); background: #000; }
.scan-meldung { font-size: 1.1rem; }
.scan-treffer { display: flex; flex-direction: column; gap: .4rem; }
.scan-wahl { text-align: left; font-size: 1.1rem; padding: .7rem; }
.scan-artikel-kopf { display: flex; gap: 1rem; align-items: center; }
.scan-artikel-kopf > div:nth-child(2) { flex: 1; }
.scan-nr { font-size: 2.6rem; font-weight: 700; min-width: 3.5rem; text-align: center; }
.scan-bez { font-size: 1.3rem; font-weight: 600; }
.scan-anzahl { display: flex; gap: .6rem; justify-content: center; align-items: center; margin: 1rem 0 .6rem; }
.scan-pm { font-size: 2rem; width: 4.5rem; height: 4.5rem; }
.scan-zahl { font-size: 2.2rem; width: 8rem; text-align: center; height: 4.5rem; }
.scan-schnell { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.scan-schnell .knopf { font-size: 1.2rem; min-width: 4rem; padding: .6rem; }
.scan-drucken { width: 100%; font-size: 1.5rem; padding: 1rem; margin-top: 1rem; }
.scan-feldrahmen { position: relative; flex: 1; min-width: 0; display: flex; }
.scan-feldrahmen .scan-feld { width: 100%; }
.scan-vorschlaege { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; max-height: 55vh; overflow: auto; background: var(--flaeche, #fff); border: 1px solid var(--linie, #ccc); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.scan-vorschlag { padding: .7rem .8rem; font-size: 1.1rem; cursor: pointer; border-bottom: 1px solid var(--linie, #eee); }
.scan-vorschlag.aktiv, .scan-vorschlag:hover { background: var(--auswahl); box-shadow: inset 4px 0 0 var(--oliv-dunkel); }
/* Etiketten-Tablet auf kleinen Bildschirmen (Handy, kleines Tablet) */
@media (max-width: 700px) {
    .scan-seite { gap: .6rem; }
    .scan-kopf h1 { font-size: 1.3rem; }
    .scan-eingabe { flex-wrap: wrap; }
    .scan-feldrahmen { flex-basis: 100%; }
    .scan-feld { font-size: 1.2rem; }
    .scan-knopf { flex: 1; }
    .scan-artikel-kopf { gap: .6rem; align-items: flex-start; }
    .scan-nr { font-size: 1.8rem; min-width: 2.5rem; }
    .scan-bez { font-size: 1.1rem; }
    .scan-pm { width: 3.6rem; height: 3.6rem; font-size: 1.6rem; }
    .scan-zahl { width: 6rem; height: 3.6rem; font-size: 1.8rem; }
    .scan-schnell .knopf { min-width: 3.2rem; font-size: 1.05rem; padding: .5rem; }
    .scan-drucken { font-size: 1.25rem; padding: .85rem; }
}
/* Handy (10.11.): die wischbare Menüleiste entfällt mit Paket jq – unter 900 px gibt es das ☰-Menü (Block „responsive“ am Ende) */
/* KI-Hilfe (T35): Seitenleiste rechts */
.ki-hilfe { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 95; background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.2); padding: 1rem; display: flex; flex-direction: column; }
.ki-verlauf { flex: 1; overflow: auto; }
.ki-frage { font-weight: 700; margin: .8rem 0 .3rem; }
.ki-antwort { background: #f4f4ee; border-radius: var(--radius); padding: .5rem .7rem; font-size: .93rem; }
.ki-antwort p { margin: .25rem 0; } .ki-antwort ul, .ki-antwort ol { margin: .25rem 0 .25rem 1.2rem; padding: 0; }
.kopf-hilfe { background: none; border: 1px solid rgba(255,255,255,.6); color: #fff; border-radius: 50%; width: 1.6rem; height: 1.6rem; font-weight: 700; cursor: pointer; padding: 0; line-height: 1; }
/* Bestellung einlesen (T34) */
.ki-ergaenzt { border-color: #c27a2c !important; background: #fbf1e3 !important; }
tr.ki-warnung > td { background: #fbf1e3; }
tr.ki-offen > td { background: var(--rot-hell); }

/* 11.11.: Trefferliste Kartonetiketten (Tablet) und Suchvorschläge – Scrollbalken immer sichtbar, auch auf Android-Tablets
   (dort blendet Chrome den normalen Balken aus). */
.scan-vorschlaege, .vorschlaege { overflow-y: scroll; scrollbar-width: auto; scrollbar-color: var(--oliv-dunkel, #6b6b2a) var(--linie, #eee); }
.scan-vorschlaege::-webkit-scrollbar, .vorschlaege::-webkit-scrollbar { width: 16px; }
.scan-vorschlaege::-webkit-scrollbar-track, .vorschlaege::-webkit-scrollbar-track { background: var(--linie, #eee); border-radius: 0 6px 6px 0; }
.scan-vorschlaege::-webkit-scrollbar-thumb, .vorschlaege::-webkit-scrollbar-thumb { background: var(--oliv-dunkel, #6b6b2a); border-radius: 8px; border: 3px solid var(--linie, #eee); min-height: 48px; }
@media (pointer: coarse) { .scan-vorschlaege::-webkit-scrollbar, .vorschlaege::-webkit-scrollbar { width: 22px; } }

/* ---------- Auswertungsseiten (12.11.): links Auswahl, Mitte Liste, darunter Berichtsart + Ausgabe */
.auswertung-raster { display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.auswertung-links { display: flex; flex-direction: column; gap: .6rem; }
.auswertung-unten { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 1rem; align-items: start; margin-top: 1rem; }
.auswahlblock { border: 1px solid var(--linie); border-radius: var(--radius); padding: .4rem .6rem .55rem; margin: 0; }
.auswahlblock legend { font-size: .78rem; font-weight: 600; padding: 0 .3rem; }
.auswahlblock .knopf, .auswertung-unten a.knopf { text-align: center; }
tr.gewaehlt td { background: var(--salbei-hell, #eef3e6); }
@media (max-width: 1100px) { .auswertung-raster, .auswertung-unten { grid-template-columns: 1fr; } }

/* Benutzer und Rechte: Benutzername und Name bleiben beim Seitwärtsscrollen stehen */
.tabelle.rechte th:nth-child(1), .tabelle.rechte td:nth-child(1) { position: sticky; left: 0; width: 120px; min-width: 120px; max-width: 120px; background: var(--flaeche); z-index: 1; }
.tabelle.rechte th:nth-child(2), .tabelle.rechte td:nth-child(2) { position: sticky; left: 120px; min-width: 150px; background: var(--flaeche); z-index: 1; box-shadow: 2px 0 0 var(--linie); }
.tabelle.rechte thead th:nth-child(1), .tabelle.rechte thead th:nth-child(2) { z-index: 3; }
.tabelle.rechte thead th { z-index: 2; }

/* Zeilen per Maus verschieben (Analytische Werte) */
.zieh-zeile .zieh-griff { cursor: grab; font-size: 1.15rem; color: var(--grau); text-align: center; user-select: none; vertical-align: middle; }
.zieh-zeile.wird-gezogen { opacity: .45; }
.zieh-zeile:hover .zieh-griff { color: var(--oliv); }

/* Ablagefeld für Dateien (Bestellung einlesen): Datei hineinziehen, klicken oder Strg+V */
.ablagefeld { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; min-height: 150px; margin-top: .25rem;
              border: 2px dashed var(--linie); border-radius: var(--radius); background: var(--flaeche); color: var(--grau); padding: 1rem; cursor: pointer; }
.ablagefeld input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ablagefeld.drueber { border-color: var(--oliv); background: #f3f5e6; color: var(--anthrazit); }
.ablagefeld .ablage-text { pointer-events: none; line-height: 1.5; }
.haken input[type=checkbox], .haken input[type=radio] { flex-shrink: 0; }

/* Artikel → Kasse: Bezeichnung direkt in einer Taste wie an der Kasse bearbeiten */
.kasse-taste.kasse-taste-vorschau { width: 11rem; cursor: default; }
.kasse-taste-vorschau textarea.b { display: block; width: 100%; height: auto; min-height: 0; max-height: 3.5em; border: none; background: transparent; resize: none; overflow: hidden; padding: 0;
    text-align: center; font: inherit; font-weight: 700; font-size: .95rem; line-height: 1.15; white-space: pre-wrap; outline: none; }
.kasse-taste-vorschau:focus-within { border-color: var(--oliv); box-shadow: 0 0 0 2px var(--oliv-hell); }

/* Kundenpflege: Hinweise unten rechts (Anruf, Erinnerung) */
.hinweis-stapel { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 32px)); }
.hinweis-karte { background: var(--flaeche); border: 1px solid var(--linie); border-left: 4px solid var(--oliv); border-radius: var(--radius); padding: .6rem .7rem; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.hinweis-karte.anruf { border-left-color: var(--warnung, #c58a00); }
.taste { display: inline-block; min-width: 1.2em; padding: 0 .25em; border: 1px solid var(--linie); border-radius: 4px; font-size: .78em; line-height: 1.3; text-align: center; opacity: .75; }
.ergebnisse .knopf { min-height: 2.4rem; }

/* Kundenpflege (CRM, 14.11.) */
.kpi-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .6rem .8rem; box-shadow: var(--schatten); text-align: left; font: inherit; color: inherit; }
button.kpi { cursor: pointer; }
button.kpi:hover, button.kpi:focus-visible { border-color: var(--oliv); outline: none; }
.kpi.aktiv { border-color: var(--oliv-dunkel); background: var(--oliv-hell); }
.kpi strong { font-size: 1.5rem; line-height: 1.1; }
.kpi span { font-size: .82rem; color: var(--grau); }
.pflege-bereich { margin-bottom: .8rem; }
.pflege-bereich.kompakt .tabelle td { padding-top: .15rem; padding-bottom: .15rem; }
.pflege-bereich.kompakt .grund + .klein { display: none; }
.anrufliste tr.gewaehlt td { background: var(--auswahl); }
.anrufliste tr { cursor: pointer; }
.tabellenrahmen:focus-visible { outline: 2px solid var(--oliv); outline-offset: 2px; }
.grund { display: inline-block; font-size: .78rem; font-weight: 600; padding: .05rem .4rem; border-radius: 3px; background: var(--salbei-hell); white-space: nowrap; }
.grund-wiedervorlage { background: var(--gelb-hell); }
.grund-gefahr { background: var(--rot-hell); color: var(--rot); }
.grund-nachbestellung, .grund-rhythmus { background: var(--oliv-hell); }
.stufe { display: inline-block; min-width: 1.4rem; text-align: center; font-weight: 700; border-radius: 3px; padding: 0 .3rem; background: var(--salbei-hell); }
.stufe-a { background: var(--oliv-dunkel); color: #fff; }
.stufe-b { background: var(--oliv-hell); }
.aufgabenliste { list-style: none; margin: 0; padding: 0; }
.aufgabenliste li { display: flex; gap: .6rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px solid var(--linie); }
.aufgabenliste li.ueberfaellig .datum { color: var(--rot); font-weight: 600; }
.aufgabenliste .datum { white-space: nowrap; min-width: 6.5rem; font-size: .88rem; }
.aufgabenliste .text { flex: 1; }
.aufgabenliste .knoepfe { white-space: nowrap; display: flex; gap: .25rem; }
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: .5rem; overflow-x: auto; }
.pipeline-spalte { background: var(--grund); border-radius: var(--radius); padding: .4rem; min-height: 4rem; }
.pipeline-spalte h3 { font-size: .9rem; margin: 0 0 .4rem; }
.pipeline-karte { background: var(--flaeche); border: 1px solid var(--linie); border-left: 3px solid var(--oliv); border-radius: var(--radius); padding: .4rem .5rem; margin-bottom: .4rem; }
.pipeline-karte.ruht { border-left-color: var(--rot); }
.mehrfachwahl { position: relative; }
.mehrfachwahl summary { cursor: pointer; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); padding: .35rem .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; list-style: none; }
.mehrfachwahl summary::after { content: " ▾"; color: var(--grau); }
.mehrfachwahl[open] .mehrfachwahl-liste { position: absolute; z-index: 20; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); padding: .4rem .6rem; max-height: 18rem; overflow: auto; min-width: 14rem; }
.mehrfachwahl-liste .haken, .haken-liste .haken { display: flex; padding: .1rem 0; }
.haken-liste { display: flex; flex-wrap: wrap; gap: .1rem .8rem; }
.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; }
.kennzahlen > div { display: flex; flex-direction: column; background: var(--grund); border-radius: var(--radius); padding: .35rem .5rem; }
.ansprechpartner-zeile { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--linie); }
.formular.ansprechpartner { background: var(--grund); border-radius: var(--radius); padding: .5rem; margin: .3rem 0; }
code.adresse { display: block; padding: .4rem .5rem; background: var(--grund); border-radius: var(--radius); word-break: break-all; font-size: .85rem; user-select: all; }
.telefonlink { display: inline-flex; gap: .3rem; align-items: center; }
@media (max-width: 900px) { .pipeline { grid-template-columns: repeat(5, 160px); } }

/* Briefpapier (Einstellungen → Drucker): kleines Ablagefeld je Zeile */
.ablagefeld.klein { min-height: 0; padding: .3rem .7rem; margin: 0; display: inline-flex; vertical-align: middle; font-size: .8rem; border-width: 1.5px; min-width: 9.5rem; }
.ablagefeld.klein .ablage-text { line-height: 1.25; }
.bild-knoepfe { display: flex; gap: .3rem; align-items: center; }

/* Rechnen in Zahlenfeldern: Formel nicht verstanden */
input.rechenfehler { border-color: var(--rot) !important; background: var(--rot-hell); }

/* Neuer Artikel aus Weinkonto: frühere Nummern zum Übernehmen */
.fruehere { display: flex; flex-direction: column; gap: .25rem; margin-top: .25rem; max-height: 12rem; overflow: auto; }
.fruehere .knopf { justify-content: flex-start; text-align: left; font-weight: normal; white-space: normal; }

/* Feld-Karte (ig): beim Ziehen greifende Hand */
.wtp-karte.zieht { cursor: grabbing !important; }
.wtp-karte:focus-visible { outline: 2px solid var(--akzent, #4a3d2c); outline-offset: 2px; }

/* Speichern-Leiste (Paket in, wie ERechnungBridge): volle Breite der Inhaltsspalte, klebt unten; letztes Element der Seite */
.speichern-leiste { position: sticky; bottom: 0; z-index: 15; display: flex; flex-wrap: wrap; gap: .7em; align-items: center;
    background: var(--grund); border-top: 1px solid var(--linie); padding: .6em 0; margin-top: 1rem; }
.speichern-leiste .klein { color: var(--grau); }

/* Kampagne als Schritt-Folge (Paket jb) */
.schritt { border-top: 1px solid var(--linie); padding: .8rem 0 .9rem; display: grid; grid-template-columns: 2rem minmax(0,1fr); gap: .2rem .6rem; }
.schritt:first-of-type { border-top: 0; padding-top: .2rem; }
.schritt-nr { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--oliv-hell); color: var(--oliv-dunkel); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.schritt-nr.ok { background: var(--oliv); color: #fff; }
.schritt h3 { font-size: 1rem; margin: .15rem 0 .45rem; }
.kachel-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .45rem; }
.kachel-wahl button { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .55rem .3rem; border: 1px solid var(--linie); border-radius: var(--radius);
    background: var(--flaeche); color: var(--text); cursor: pointer; font: inherit; font-size: .9rem; line-height: 1.15; text-align: center; }
.kachel-wahl button:hover { border-color: var(--salbei-dunkel); }
.kachel-wahl button.an { border: 2px solid var(--oliv); background: var(--oliv-hell); padding: calc(.55rem - 1px) calc(.3rem - 1px); font-weight: 600; }
.schritt-zeile { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: .35rem; background: var(--flaeche); }
.schritt-zeile.klickbar { cursor: pointer; }
.schritt-zeile.klickbar:hover { border-color: var(--salbei-dunkel); }
.schritt-zeile.offen { border-color: var(--oliv); box-shadow: 0 0 0 1px var(--oliv); }
.schritt-zeile .name { flex: 1; min-width: 0; }
.schritt-zeile .leer { color: var(--grau); font-style: italic; }
.punkt { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; flex: none; }
.schildchen { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .45rem; border-radius: 999px; font-size: .82rem; color: #fff; margin: 0 .25rem .25rem 0; }
.kampagne-vorschau { position: sticky; top: .8rem; }
.knopf.breit { width: 100%; justify-content: center; padding-top: .65rem; padding-bottom: .65rem; font-size: 1.05rem; }
.gespann-spalte { border: 1px solid var(--linie); border-radius: var(--radius); max-height: 320px; overflow: auto; padding: .25rem; }
.gespann-eintrag { display: flex; gap: .4rem; align-items: center; padding: .25rem .35rem; border-left: 5px solid #bbb; border-radius: 3px; margin-bottom: .2rem; cursor: pointer; }
.gespann-eintrag.an { background: var(--oliv-hell); }
@media (max-width: 900px) { .kampagne-raster { grid-template-columns: minmax(0,1fr) !important; } .kampagne-vorschau { position: static; } }

/* =====================================================================================================
   Paket jq: responsive (Handy und Tablet) – Auftrag docs/Auftrag_Responsive.md, Stufe 1 (Grundgerüst).
   Steht am Ende, damit es ältere Regeln überstimmt. Die Kasse (.inhalt.ist-kasse) behält ihr eigenes Touch-Layout.
   ===================================================================================================== */
.menue-knopf { display: none; }
.menue-schleier { display: none; }

/* ---------- Menü: unter 900 px ☰ oben links, Hauptmenü als Seitenleiste (alle Punkte untereinander, groß) */
@media (max-width: 900px) {
    .kopf { flex-wrap: nowrap; gap: .5rem; padding: .4rem .75rem; }
    .menue-knopf { display: inline-flex; align-items: center; justify-content: center; order: -1; flex: 0 0 auto;
        width: 44px; height: 44px; margin-left: -.3rem; background: none; border: 0; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; border-radius: var(--radius); }
    .menue-knopf:active, .menue-knopf:focus-visible { background: rgba(255, 255, 255, .18); }
    .marke img { height: 32px; }
    .hauptmenue { position: fixed; top: 0; left: 0; bottom: 0; z-index: 1001; width: min(320px, 86vw); flex-direction: column; flex-wrap: nowrap; gap: .15rem;
        padding: .9rem .7rem 1.5rem; background: inherit; overflow-y: auto; box-shadow: 6px 0 28px rgba(0, 0, 0, .28);
        transform: translateX(-105%); transition: transform .2s ease; visibility: hidden; }
    .hauptmenue.offen { transform: none; visibility: visible; }
    .hauptmenue a { font-size: 1.2rem; padding: .7rem 1rem; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }
    .menue-schleier { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(46, 46, 51, .45); }
    /* rechts kompakt: Glocke, ?, von außen, Benutzer als Kürzel; kein Vollbild-Knopf (nur am PC); kein Betriebsname */
    .kopf-vollbild { display: none !important; }
    .kopf-rechts .betrieb { display: none; }
    .kopf-glocke { margin-left: auto !important; }
    .kopf-rechts { margin-left: 0 !important; }
    .kopf > .kopf-hilfe, .kopf > a[title="Einstellungen"] { flex: 0 0 auto; }
    .kopf-glocke:only-of-type + .kopf-hilfe { margin-left: 0; }
}
/* ohne Glocke rückt der Rest nach rechts */
@media (max-width: 900px) { .kopf > .kopf-hilfe:first-of-type { margin-left: auto; } .kopf-glocke ~ .kopf-hilfe { margin-left: 0; } }
.benutzer-kurz { display: none; }
@media (max-width: 700px) {
    .benutzer-lang { display: none; }
    .benutzer-kurz { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
        background: rgba(255, 255, 255, .22); color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .02em; }
    .benutzermenue > summary { list-style: none; }
    .benutzermenue > summary::-webkit-details-marker { display: none; }
    .benutzermenue-liste { right: 0; left: auto; min-width: 230px; }
}

/* ---------- Seite, Karten, Raster: einspaltig unter 700 px, seitlich 12 px */
@media (max-width: 700px) {
    .inhalt:not(.ist-kasse) { padding: .75rem 12px 2.5rem; }
    .inhalt:not(.ist-kasse) h1 { font-size: 1.45rem; }
    .inhalt:not(.ist-kasse) .karte { padding: .8rem 12px; }
    .inhalt:not(.ist-kasse) .raster, .inhalt:not(.ist-kasse) .raster-2, .inhalt:not(.ist-kasse) .raster-3, .inhalt:not(.ist-kasse) .raster-haupt,
    .inhalt:not(.ist-kasse) div[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
    .inhalt:not(.ist-kasse) div[style*="grid-template-columns"] > *, .inhalt:not(.ist-kasse) .raster > * { grid-column: auto !important; min-width: 0; }
    /* Formulare: Felder untereinander, volle Breite, Beschriftung über dem Feld */
    .inhalt:not(.ist-kasse) .formular { grid-template-columns: minmax(0, 1fr) !important; }
    .inhalt:not(.ist-kasse) .formular > * { grid-column: auto !important; }
    .inhalt:not(.ist-kasse) .formular input:not([type=checkbox]):not([type=radio]), .inhalt:not(.ist-kasse) .formular select, .inhalt:not(.ist-kasse) .formular textarea { width: 100%; }
    /* Seitenkopf: Knöpfe brechen sauber um, Unterzeile darunter */
    .inhalt:not(.ist-kasse) .seitenkopf { flex-direction: column; align-items: stretch; gap: .5rem; }
    .inhalt:not(.ist-kasse) .seitenkopf .knopfreihe { flex-wrap: wrap; }
    .inhalt:not(.ist-kasse) .seitenkopf .knopfreihe > input, .inhalt:not(.ist-kasse) .seitenkopf .knopfreihe > select { flex: 1 1 100%; width: 100% !important; }
    .inhalt:not(.ist-kasse) .kartenkopf { flex-wrap: wrap; gap: .4rem; }
    /* Tabellen: scrollen innerhalb ihrer Karte statt die Seite zu verbreitern */
    .inhalt:not(.ist-kasse) .tabellenrahmen { max-height: none; }
    .inhalt:not(.ist-kasse) table.tabelle:not(.kartenliste) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .inhalt:not(.ist-kasse) pre, .inhalt:not(.ist-kasse) img { max-width: 100%; }
    .inhalt:not(.ist-kasse) input, .inhalt:not(.ist-kasse) select, .inhalt:not(.ist-kasse) textarea { max-width: 100%; }
    /* Speichern-Leiste über die volle Breite */
    .speichern-leiste { left: 0 !important; right: 0 !important; margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
    /* Dialoge bildschirmfüllend */
    .overlay { padding: 0; }
    .overlay-fenster, .overlay-fenster.dialog, .overlay-fenster.dialog.breit { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .overlay-fenster.dialog > .kartenkopf:first-child, .overlay-fenster.dialog > h2:first-child { position: sticky; top: -1.1rem; background: #fff; z-index: 1; padding-top: .3rem; }
    .programmfuss { flex-wrap: wrap; gap: .3rem .8rem; padding-left: 12px; padding-right: 12px; }
}

/* ---------- Listen-Tabellen als Kartenliste (Klasse „kartenliste“, Zellen mit data-titel) */
@media (max-width: 700px) {
    table.kartenliste, table.kartenliste tbody { display: block; width: 100%; }
    table.kartenliste thead { display: none; }
    table.kartenliste tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .6rem; padding: .6rem .2rem; border-bottom: 1px solid #ecece4; }
    table.kartenliste td { display: block; border: 0; padding: 0; text-align: left !important; white-space: normal; }
    table.kartenliste td.haupt { grid-column: 1; grid-row: 1; font-weight: 600; font-size: 1rem; }
    table.kartenliste td.rechts { grid-column: 2; grid-row: 1; text-align: right !important; font-weight: 600; white-space: nowrap; }
    table.kartenliste td:not(.haupt):not(.rechts) { grid-column: 1 / -1; font-size: .85rem; color: var(--grau); }
    table.kartenliste td:empty { display: none; }
    table.kartenliste td[data-titel]:not(.haupt):not(.rechts)::before { content: attr(data-titel) ": "; }
    table.kartenliste tr.klickbar { cursor: pointer; }
}

/* ---------- Touch: Knöpfe und Links mindestens 44 px hoch (nicht in der Kasse) */
@media (pointer: coarse) {
    .inhalt:not(.ist-kasse) .knopf, .inhalt:not(.ist-kasse) button:not(.kopf-hilfe), .speichern-leiste .knopf, .overlay .knopf { min-height: 44px; }
    .inhalt:not(.ist-kasse) .knopf.klein { min-height: 40px; }
    .inhalt:not(.ist-kasse) input:not([type=checkbox]):not([type=radio]), .inhalt:not(.ist-kasse) select { min-height: 44px; }
    .inhalt:not(.ist-kasse) .formular input:not([type=checkbox]):not([type=radio]), .inhalt:not(.ist-kasse) .formular select { height: auto; }
    .inhalt:not(.ist-kasse) input[type=checkbox], .inhalt:not(.ist-kasse) input[type=radio] { width: 22px; height: 22px; }
    .benutzermenue-liste a, .benutzermenue-liste button { min-height: 44px; display: flex; align-items: center; }
    .kopf-hilfe { width: 36px; height: 36px; }
}

/* ---------- Paket jq, Teil 2: Reiter und Bereichsumschalter wischbar, Formulare in Tablet-Breite zweispaltig */
@media (max-width: 900px) {
    .inhalt:not(.ist-kasse) .reiter { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; }
    .inhalt:not(.ist-kasse) .reiter::-webkit-scrollbar { display: none; }
    .inhalt:not(.ist-kasse) .reiter > * { flex: 0 0 auto; white-space: nowrap; }
    .inhalt:not(.ist-kasse) .bereich-umschalter { display: flex; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .inhalt:not(.ist-kasse) .bereich-umschalter::-webkit-scrollbar { display: none; }
    .inhalt:not(.ist-kasse) .bereich-umschalter a { flex: 0 0 auto; white-space: nowrap; }
    .inhalt:not(.ist-kasse) .seitenkopf h1 { min-width: 0; overflow-wrap: anywhere; }
    .inhalt:not(.ist-kasse) .kartenkopf .knopfreihe, .inhalt:not(.ist-kasse) .kartenkopf { flex-wrap: wrap; }
}
@media (max-width: 900px) and (min-width: 701px) {
    .inhalt:not(.ist-kasse) .formular { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .inhalt:not(.ist-kasse) .formular > * { grid-column: auto !important; }
    .inhalt:not(.ist-kasse) .formular > .b4, .inhalt:not(.ist-kasse) .formular > .b6, .inhalt:not(.ist-kasse) .formular > [style*="span 3"],
    .inhalt:not(.ist-kasse) .formular > [style*="span 4"], .inhalt:not(.ist-kasse) .formular > [style*="span 6"], .inhalt:not(.ist-kasse) .formular > [style*="1 / -1"] { grid-column: 1 / -1 !important; }
}
/* zu breite Tabellen (vom Skript erkannt): scrollen innerhalb ihrer Karte */
table.zu-breit { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 700px) { .inhalt:not(.ist-kasse) table.liste:not(.kartenliste) { display: block; max-width: 100%; overflow-x: auto; } }
@media (max-width: 700px) { .inhalt:not(.ist-kasse) .knopf, .inhalt:not(.ist-kasse) button { max-width: 100%; white-space: normal; } }
@media (max-width: 700px) { .inhalt:not(.ist-kasse) div[style*="display:flex"], .inhalt:not(.ist-kasse) div[style*="display: flex"] { flex-wrap: wrap; } }
/* Paket jq: offenes Menue ueber den Balken (Testsystem, Zertifikatswarnung) heben – die Seitenleiste liegt in der Kopfleiste */
.kopf:has(.hauptmenue.offen) { z-index: 1000; }

/* Paket jx: Visitenkarten scannen (handytauglich, große Knöpfe) */
.knopf.gross { font-size: 1.1rem; padding: .8rem 1.2rem; min-height: 52px; }
.vk-scan { display: grid; gap: .9rem; max-width: 46rem; }
.vk-fotos { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.vk-foto { display: grid; gap: .5rem; align-content: start; }
.vk-foto img, .vk-gross { max-width: 100%; border-radius: 6px; border: 1px solid var(--rand, #ddd); }
.vk-pruefen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem; align-items: start; }
.vk-pruefen > .karte:nth-child(n+3) { grid-column: 1 / -1; }
.vk-formular { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vk-formular .breit, .formular .breit { grid-column: 1 / -1; }
.vk-unsicher input, .vk-unsicher textarea, span.vk-unsicher { background: #fff3b0; }
.vk-kategorien { display: flex; flex-wrap: wrap; gap: .4rem; }
.vk-treffer { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem; border-radius: 6px; cursor: pointer; }
.vk-treffer.gewaehlt { background: var(--hell, #f1f0e6); }
.vk-dokumente { display: flex; flex-wrap: wrap; gap: .8rem; }
.vk-dokumente a { display: grid; gap: .2rem; max-width: 180px; text-decoration: none; }
.vk-dokumente img { max-width: 180px; max-height: 120px; border-radius: 4px; border: 1px solid var(--rand, #ddd); }
@media (max-width: 900px) {
  .vk-pruefen, .vk-fotos { grid-template-columns: 1fr; }
  .vk-formular { grid-template-columns: 1fr 1fr; }
  .vk-formular input { font-size: 16px; min-height: 44px; }
}
