/* ==========================================================================
   Werkstatt-App - Design-System
   Warme, kontraststarke Oberflaeche. Ausgelegt auf Finger statt Maus:
   nichts Antippbares ist kleiner als 48px, am Terminal nichts unter 72px.
   ========================================================================== */

/* Farben und Formen stammen von beyer-tischlerei.at:
   Grün #006B2D, Flächenton #F4F4F4, Text #333333, Creme #FBF3EE,
   Knöpfe als Pillen. */
:root {
  /* Flaechen */
  --flaeche:      #f4f4f4;
  --karte:        #ffffff;
  --karte-2:      #eeeeec;
  --karte-3:      #e3e4e1;
  --rand:         #e0e0dd;
  --rand-stark:   #c7c9c4;
  --creme:        #fbf3ee;

  /* Text */
  --text:         #333333;
  --text-leise:   #6a6d68;
  --text-still:   #95988f;
  --text-auf-farbe: #ffffff;

  /* Hausfarbe und Zustaende */
  --akzent:       #006b2d;
  --akzent-hell:  #00843a;
  --akzent-weich: #e6f1ea;
  --gut:          #0a7d38;
  --gut-weich:    #e6f3ea;
  --warn:         #a7681a;
  --warn-weich:   #fbf1e3;
  --fehler:       #b3261e;
  --fehler-weich: #fbeceb;
  --info:         #35617f;
  --info-weich:   #ecf2f6;

  /* Form */
  --r-s:  6px;
  --r-m:  10px;
  --r-l:  16px;
  --r-xl: 22px;
  --r-rund: 999px;
  --r-knopf: 999px;   /* Pillen wie auf der Website */

  --schatten-s: 0 1px 2px rgba(28, 26, 23, .06);
  --schatten-m: 0 2px 8px rgba(28, 26, 23, .08), 0 1px 2px rgba(28, 26, 23, .04);
  --schatten-l: 0 12px 32px rgba(28, 26, 23, .14), 0 2px 8px rgba(28, 26, 23, .06);

  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;

  --kopf-hoehe: 56px;
  --nav-hoehe:  64px;
  --breite:     1280px;
}

/* Im Dunkelmodus ist #006B2D zu dunkel, um sich vom Hintergrund abzuheben.
   Deshalb dieselbe Farbe aufgehellt - der Grünton bleibt, der Kontrast stimmt. */
@media (prefers-color-scheme: dark) {
  :root:not([data-thema="hell"]) {
    --flaeche:      #141614;
    --karte:        #1c1f1d;
    --karte-2:      #252925;
    --karte-3:      #30352f;
    --rand:         #343a34;
    --rand-stark:   #495049;
    --creme:        #2a2724;

    --text:         #f2f1ee;
    --text-leise:   #a5a9a3;
    --text-still:   #777b75;

    --akzent:       #4fb87a;
    --akzent-hell:  #6bc992;
    --akzent-weich: #13251a;
    --gut:          #4fb87a;
    --gut-weich:    #13251a;
    --warn:         #e0a33e;
    --warn-weich:   #2a2111;
    --fehler:       #f07167;
    --fehler-weich: #2b1614;
    --info:         #6fa8cc;
    --info-weich:   #13202a;

    --text-auf-farbe: #0e1410;

    --schatten-s: 0 1px 2px rgba(0, 0, 0, .4);
    --schatten-m: 0 2px 8px rgba(0, 0, 0, .45);
    --schatten-l: 0 12px 32px rgba(0, 0, 0, .6);
  }
}

:root[data-thema="dunkel"] {
  --flaeche: #141614;  --karte: #1c1f1d;  --karte-2: #252925;  --karte-3: #30352f;
  --rand: #343a34;     --rand-stark: #495049;  --creme: #2a2724;
  --text: #f2f1ee;     --text-leise: #a5a9a3;  --text-still: #777b75;
  --akzent: #4fb87a;   --akzent-hell: #6bc992; --akzent-weich: #13251a;
  --gut: #4fb87a;      --gut-weich: #13251a;
  --warn: #e0a33e;     --warn-weich: #2a2111;
  --fehler: #f07167;   --fehler-weich: #2b1614;
  --info: #6fa8cc;     --info-weich: #13202a;
  --text-auf-farbe: #0e1410;
  --schatten-s: 0 1px 2px rgba(0,0,0,.4);
  --schatten-m: 0 2px 8px rgba(0,0,0,.45);
  --schatten-l: 0 12px 32px rgba(0,0,0,.6);
}

/* ---------------------------------------------------------------- Grundlage */

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

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

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--flaeche);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.175rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .75em; }
a  { color: var(--akzent); text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

/* Grundgrösse für alle Symbole. Ein inline-SVG hat ohne Angabe keine
   eigene Breite und zieht im Flex-Container sonst auf die volle Breite auf. */
svg { width: 24px; height: 24px; flex: none; }

/* Zahlen immer gleich breit - sonst zappelt die laufende Uhr */
.zahl, .uhr, td.zahl, .tabellarisch { font-variant-numeric: tabular-nums; }

:focus-visible {
  outline: 2.5px solid var(--akzent);
  outline-offset: 2px;
  border-radius: var(--r-s);
}

.verborgen { display: none !important; }

.nur-vorleser {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ Gerueste */

/* Am Handy: Kopf oben, Inhalt in der Mitte, Navigation unten am Daumen.
   Die Reihen werden ausdrücklich zugewiesen, weil die Navigation im HTML
   vor dem Inhalt steht - sonst landet sie oben. */
.huelle {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.huelle > .kopf   { grid-row: 1; }
.huelle > .inhalt { grid-row: 2; }
.huelle > .nav    { grid-row: 3; }

.kopf {
  position: sticky; top: 0; z-index: 30;
  height: var(--kopf-hoehe);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--karte) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rand);
}

.kopf__titel { font-size: 1.0625rem; font-weight: 650; }
.kopf__rechts { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.inhalt {
  width: 100%;
  max-width: var(--breite);
  margin: 0 auto;
  padding: 16px 16px 24px;
}

/* Untere Navigation am Handy */
.nav {
  position: sticky; bottom: 0; z-index: 30;
  display: flex;
  background: color-mix(in srgb, var(--karte) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--rand);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav__knopf {
  flex: 1;
  min-height: var(--nav-hoehe);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: 0; background: none; cursor: pointer;
  color: var(--text-leise);
  font-size: .6875rem; font-weight: 600;
  padding: 6px 2px;
  -webkit-tap-highlight-color: transparent;
}
.nav__knopf svg { width: 24px; height: 24px; }
.nav__knopf[aria-current="page"] { color: var(--akzent); }
.nav__zahl {
  position: absolute; transform: translate(16px, -14px);
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-rund);
  background: var(--fehler); color: #fff;
  font-size: .625rem; font-weight: 700; line-height: 18px; text-align: center;
}

@media (min-width: 900px) {
  /* minmax(0,1fr) statt 1fr: kein Inhalt darf die Seite breiter machen
     als das Fenster - sonst wandert die halbe App nach rechts hinaus. */
  .huelle { grid-template-rows: auto 1fr; grid-template-columns: 232px minmax(0, 1fr); }
  .huelle > .kopf   { grid-row: 1; grid-column: 1 / -1; }
  .huelle > .nav    { grid-row: 2; grid-column: 1; }
  .huelle > .inhalt { grid-row: 2; grid-column: 2; }
  .nav {
    position: sticky; top: var(--kopf-hoehe);
    flex-direction: column; align-items: stretch;
    height: calc(100dvh - var(--kopf-hoehe));
    border-top: 0; border-right: 1px solid var(--rand);
    padding: 12px 10px;
    gap: 2px;
  }
  .nav__knopf {
    flex: 0 0 auto; flex-direction: row; justify-content: flex-start;
    gap: 12px; min-height: 46px; border-radius: var(--r-m);
    font-size: .9375rem; padding: 0 12px;
  }
  .nav__knopf[aria-current="page"] { background: var(--akzent-weich); }
  .nav__zahl { position: static; transform: none; margin-left: auto; }
  .inhalt { padding: 24px 28px 40px; }
}

/* -------------------------------------------------------------------- Karten */

.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--r-l);
  box-shadow: var(--schatten-s);
}
.karte--flach { box-shadow: none; }
.karte__kopf {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rand);
}
.karte__kopf h2, .karte__kopf h3 { margin-right: auto; }
.karte__leib { padding: 16px; }
.karte__fuss {
  padding: 12px 16px; border-top: 1px solid var(--rand);
  display: flex; gap: 8px; justify-content: flex-end;
}

.raster { display: grid; gap: 14px; }
@media (min-width: 720px)  { .raster--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .raster--3 { grid-template-columns: repeat(3, 1fr); } }

.stapel { display: flex; flex-direction: column; gap: 14px; }
.reihe   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reihe--eng { gap: 6px; }
.schieber { margin-left: auto; }

/* ------------------------------------------------------------------- Knoepfe */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid var(--rand-stark);
  border-radius: var(--r-knopf);
  background: var(--karte);
  color: var(--text);
  font-size: .9375rem; font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .06s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.knopf:hover  { background: var(--karte-2); }
.knopf:active { transform: scale(.985); }
.knopf svg { width: 20px; height: 20px; flex: none; }

.knopf--haupt {
  background: var(--akzent); border-color: var(--akzent);
  color: var(--text-auf-farbe);
}
.knopf--haupt:hover { background: var(--akzent-hell); border-color: var(--akzent-hell); }

/* --text-auf-farbe statt hart #fff: im Dunkelmodus sind Grün und Rot hell,
   weisse Schrift darauf wäre kaum lesbar. */
.knopf--gut  { background: var(--gut);    border-color: var(--gut);    color: var(--text-auf-farbe); }
.knopf--rot  { background: var(--fehler); border-color: var(--fehler); color: var(--text-auf-farbe); }
.knopf--leer { background: none; border-color: transparent; }
.knopf--leer:hover { background: var(--karte-2); }

.knopf--gross { min-height: 60px; padding: 0 28px; font-size: 1.0625rem; }
.knopf--breit { width: 100%; }
.knopf--rund  { border-radius: var(--r-rund); }
.knopf--klein { min-height: 36px; padding: 0 12px; font-size: .875rem; }

/* runde Symbolknöpfe wie die Telefon- und Mail-Kreise auf der Website */
.knopf--symbol {
  min-height: 44px; width: 44px; padding: 0; border-radius: 50%;
  border-color: transparent; background: none;
}
.knopf--symbol:hover { background: var(--karte-2); }

.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopf[aria-busy="true"] { pointer-events: none; opacity: .7; }

/* --------------------------------------------------------------------- Felder */

.feld { display: flex; flex-direction: column; gap: 6px; }
.feld > label { font-size: .8125rem; font-weight: 650; color: var(--text-leise); }

.eingabe, select.eingabe, textarea.eingabe {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--rand-stark);
  border-radius: var(--r-m);
  background: var(--karte);
  color: var(--text);
  appearance: none;
}
textarea.eingabe { min-height: 88px; resize: vertical; }
.eingabe::placeholder { color: var(--text-still); }
.eingabe:focus { border-color: var(--akzent); outline: 2px solid var(--akzent-weich); outline-offset: 0; }
.eingabe--gross { min-height: 60px; font-size: 1.25rem; }

select.eingabe {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-leise) 50%),
                    linear-gradient(135deg, var(--text-leise) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.feld__hinweis { font-size: .8125rem; color: var(--text-leise); }
.feld__fehler  { font-size: .8125rem; color: var(--fehler); font-weight: 600; }

/* ------------------------------------------------------------- Kleinteiliges */

.marke {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-rund);
  background: var(--karte-2);
  color: var(--text-leise);
  font-size: .75rem; font-weight: 650;
  white-space: nowrap;
}
.marke--gut    { background: var(--gut-weich);    color: var(--gut); }
.marke--warn   { background: var(--warn-weich);   color: var(--warn); }
.marke--fehler { background: var(--fehler-weich); color: var(--fehler); }
.marke--info   { background: var(--info-weich);   color: var(--info); }
.marke--akzent { background: var(--akzent-weich); color: var(--akzent); }

/* inline-block, sonst ignoriert der Punkt als reines inline-Element
   Breite und Höhe und wird zu einem dünnen Strich */
.punkt {
  display: inline-block; vertical-align: middle;
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex: none;
}

.puls { position: relative; }
.puls::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 2px solid currentColor;
  animation: puls 1.8s ease-out infinite;
}
@keyframes puls {
  0%   { transform: scale(.6); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .puls::after { animation: none; opacity: .3; }
  .knopf:active { transform: none; }
}

.kuerzel {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  background: var(--karte-3);
  color: var(--text);
  font-size: .8125rem; font-weight: 700;
  letter-spacing: .02em;
}
.kuerzel--gross { width: 56px; height: 56px; font-size: 1.125rem; }

.leise  { color: var(--text-leise); }
.still  { color: var(--text-still); }
.klein  { font-size: .8125rem; }
.fett   { font-weight: 650; }
.abschneiden { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.trenner { height: 1px; background: var(--rand); border: 0; margin: 14px 0; }

/* ------------------------------------------------------------------- Listen */

.liste { display: flex; flex-direction: column; }
.liste__zeile {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 16px;
  border-bottom: 1px solid var(--rand);
  text-align: left; width: 100%;
  background: none; border-left: 0; border-right: 0; border-top: 0;
  cursor: pointer; color: inherit;
}
.liste__zeile:last-child { border-bottom: 0; }
.liste__zeile:hover { background: var(--karte-2); }
.liste__zeile > .wachsen { flex: 1; min-width: 0; }

.leer {
  display: grid; place-items: center; gap: 8px;
  padding: 44px 20px; text-align: center; color: var(--text-leise);
}
.leer svg { width: 40px; height: 40px; opacity: .4; }

/* ---------------------------------------------------------------- Stempeluhr */

.uhr {
  font-size: clamp(3rem, 16vw, 4.5rem);
  font-weight: 350;
  letter-spacing: -.03em;
  line-height: 1;
}
.uhr--laeuft { color: var(--gut); font-weight: 450; }

/* Flex statt Grid: eine auto-breite Grid-Spalte richtet sich nach dem
   breitesten Kind, dadurch liefen die Knöpfe auf schmalen Geräten rechts
   aus dem Bild. */
.stempel {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 26px 18px;
  text-align: center;
}
.stempel > * { max-width: 100%; }
.stempel__was { font-size: 1.0625rem; font-weight: 650; }
.stempel__was .punkt { margin-right: 7px; }
.stempel__wo  { color: var(--text-leise); font-size: .9375rem; overflow-wrap: anywhere; }
.stempel__knoepfe { display: grid; gap: 10px; width: 100%; max-width: 420px; }
@media (min-width: 560px) { .stempel__knoepfe--zwei { grid-template-columns: 1fr 1fr; } }

.balken { height: 8px; border-radius: var(--r-rund); background: var(--karte-3); overflow: hidden; }
.balken__fuell { height: 100%; border-radius: var(--r-rund); background: var(--akzent); transition: width .4s; }
.balken__fuell--gut  { background: var(--gut); }
.balken__fuell--warn { background: var(--warn); }
.balken__fuell--rot  { background: var(--fehler); }

/* ------------------------------------------------------------- Aufträge */

.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter__knopf {
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--rand-stark); border-radius: var(--r-knopf);
  background: var(--karte); color: var(--text-leise);
  font-size: .875rem; font-weight: 600; cursor: pointer;
}
.filter__knopf[aria-pressed="true"] {
  background: var(--akzent); border-color: var(--akzent); color: var(--text-auf-farbe);
}

.auftrag {
  display: grid; gap: 3px;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%; padding: 11px 16px;
  border: 0; border-bottom: 1px solid var(--rand);
  background: none; color: inherit; text-align: left; cursor: pointer;
}
.auftrag:last-child { border-bottom: 0; }
.auftrag:hover { background: var(--karte-2); }
/* Ausdrückliche Platzierung: sonst setzt die automatische Verteilung die
   rechte Spalte neben die Auftragsnummer statt über beide Zeilen. */
.auftrag__kopf {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.auftrag__nr { font-weight: 700; font-variant-numeric: tabular-nums; }
.auftrag__wer {
  grid-column: 1; grid-row: 2;
  color: var(--text-leise); font-size: .875rem; min-width: 0;
}
.auftrag__rechts {
  grid-column: 2; grid-row: 1 / 3;
  text-align: right; display: grid; gap: 4px; justify-items: end;
}

/* Soll-Ist-Ampel */
.ampel { display: flex; align-items: center; gap: 7px; font-size: .75rem;
         color: var(--text-leise); font-variant-numeric: tabular-nums; }
.ampel .balken { width: 86px; height: 6px; }
.ampel--ueber { color: var(--fehler); font-weight: 650; }
.ampel--knapp { color: var(--warn); font-weight: 650; }

/* ---- Datei hineinziehen */

.ablage {
  display: grid; place-items: center; gap: 10px;
  padding: 32px 20px; text-align: center;
  border: 2px dashed var(--rand-stark);
  border-radius: var(--r-l);
  background: var(--karte-2);
  cursor: pointer;
}
.ablage:hover, .ablage--ziel { border-color: var(--akzent); background: var(--akzent-weich); }
.ablage svg { width: 36px; height: 36px; color: var(--text-still); }
.ablage--ziel svg { color: var(--akzent); }

/* ---- Spaltenzuordnung */

.zuord { display: grid; gap: 8px; }
.zuord__zeile {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center;
}
.zuord__ziel { font-size: .875rem; font-weight: 600; }
.zuord__ziel small { display: block; font-weight: 400; color: var(--text-still); }

.vorschau { overflow-x: auto; border: 1px solid var(--rand); border-radius: var(--r-m); }
.vorschau table { border-collapse: collapse; font-size: .75rem; min-width: max-content; }
.vorschau th, .vorschau td {
  padding: 6px 10px; border-bottom: 1px solid var(--rand); border-right: 1px solid var(--rand);
  text-align: left; white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis;
}
.vorschau th { background: var(--karte-2); font-weight: 650; position: sticky; top: 0; }
.vorschau th.zugeordnet { background: var(--akzent-weich); color: var(--akzent); }
.vorschau tr:last-child td { border-bottom: 0; }

.bilanz { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.bilanz__fach {
  padding: 10px 12px; border-radius: var(--r-m); background: var(--karte-2); text-align: center;
}
.bilanz__zahl { font-size: 1.375rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.bilanz__text { font-size: .75rem; color: var(--text-leise); }
.bilanz__fach--gut  { background: var(--gut-weich); color: var(--gut); }
.bilanz__fach--warn { background: var(--warn-weich); color: var(--warn); }

/* ------------------------------------------------------------- Aufgaben */

.auf { display: grid; gap: 16px; }
@media (min-width: 900px) {
  /* minmax(0,1fr): eine lange Notiz in einer Aufgabe darf die Spalte nicht
     breiter machen als den Platz, sonst scrollt die ganze Seite waagrecht. */
  .auf--zwei { grid-template-columns: 274px minmax(0, 1fr); align-items: start; }
}

/* Die vier Kacheln oben, wie in der Erinnerungen-App */
.smart { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 560px) and (max-width: 899px) { .smart { grid-template-columns: repeat(4, 1fr); } }

.smart__kachel {
  display: grid; gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--rand);
  border-radius: var(--r-l);
  background: var(--karte);
  cursor: pointer; text-align: left;
  box-shadow: var(--schatten-s);
}
.smart__kachel:hover { border-color: var(--rand-stark); }
.smart__kachel[aria-current="true"] { border-color: var(--akzent); background: var(--akzent-weich); }
.smart__kopf { display: flex; align-items: center; justify-content: space-between; }
.smart__ring {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--symbolfarbe, var(--akzent)); color: #fff;
}
.smart__ring svg { width: 17px; height: 17px; }
.smart__zahl  { font-size: 1.375rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.smart__text  { font-size: .8125rem; font-weight: 600; color: var(--text-leise); }

.listenzeile {
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 48px; padding: 8px 14px;
  border: 0; border-bottom: 1px solid var(--rand);
  background: none; color: inherit; cursor: pointer; text-align: left;
}
.listenzeile:last-of-type { border-bottom: 0; }
.listenzeile:hover { background: var(--karte-2); }
.listenzeile[aria-current="true"] { background: var(--akzent-weich); }
.listenzeile__punkt {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--listenfarbe, var(--akzent)); color: #fff;
}
.listenzeile__punkt svg { width: 15px; height: 15px; }

/* ---- Zeitraum-Filter ueber der Liste */

.auf__zeitraum {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rand);
}
.auf__zeitraum .filter__knopf { min-height: 34px; padding: 0 11px; }

/* ---- Aufgabenzeilen */

.auf__zeile {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rand);
}
.auf__zeile:last-child { border-bottom: 0; }
.auf__zeile--unter { padding-left: 46px; }
.auf__zeile--weg { opacity: .4; }

.auf__kreis {
  flex: none; width: 23px; height: 23px; margin-top: 1px;
  border: 1.8px solid var(--rand-stark);
  border-radius: 50%;
  background: none; cursor: pointer;
  display: grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.auf__kreis svg { width: 14px; height: 14px; opacity: 0; color: var(--text-auf-farbe); }
.auf__kreis:hover { border-color: var(--akzent); }
.auf__kreis[aria-checked="true"] {
  background: var(--akzent); border-color: var(--akzent);
}
.auf__kreis[aria-checked="true"] svg { opacity: 1; }
.auf__kreis--prio1 { border-color: var(--warn); }
.auf__kreis--prio2, .auf__kreis--prio3 { border-color: var(--fehler); }

.auf__leib { flex: 1; min-width: 0; cursor: pointer; }
.auf__titel { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.auf__zeile--fertig .auf__titel { color: var(--text-still); text-decoration: line-through; }
.auf__prio { color: var(--fehler); font-weight: 700; margin-right: 4px; }
.auf__unter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
              margin-top: 3px; font-size: .8125rem; color: var(--text-leise); }
.auf__faellig--heute { color: var(--akzent); font-weight: 650; }
.auf__faellig--spaet { color: var(--fehler); font-weight: 650; }
.auf__fahne { color: var(--warn); }

.auf__neu {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rand);
}
.auf__neu .auf__kreis { border-style: dashed; cursor: default; }
.auf__neu input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  font-size: 1rem; padding: 2px 0;
}
.auf__neu input::placeholder { color: var(--text-still); }

/* --------------------------------------------------- Kapazitaetsplanung */

.plan { display: flex; flex-direction: column; gap: 14px; }

.plan__kopf {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.plan__woche { font-size: 1.0625rem; font-weight: 650; min-width: 11.5em; }
.plan__kw    { color: var(--text-leise); font-weight: 500; }

.plan__koerper { display: grid; gap: 14px; }
/* Erst ab hier bleibt neben der Woche genug Platz für den Vorrat. Darunter
   steht er unter dem Raster - die fünf Tage haben Vorrang. */
@media (min-width: 1280px) {
  .plan__koerper { grid-template-columns: minmax(0, 1fr) 268px; align-items: start; }
}

/* Waagrecht scrollbar - gebraucht wird das nur noch mit Samstag und Sonntag */
.plan__rolle {
  overflow-x: auto;
  border: 1px solid var(--rand);
  border-radius: var(--r-l);
  background: var(--karte);
}
/* Montag bis Freitag stehen immer nebeneinander. Die Spalten dürfen dafür
   schmaler werden als ihr Inhalt - minmax(0,1fr) statt max-content. Ein langer
   Kundenname wird gekürzt, statt den Freitag aus dem Bild zu schieben. */
.plan__gitter {
  display: grid;
  grid-template-columns: clamp(112px, 12vw, 158px) repeat(var(--tage, 5), minmax(0, 1fr));
  min-width: 100%;
}
/* Sieben Spalten werden zu schmal - da ist Schieben das kleinere Übel. */
.plan__gitter--rollen {
  grid-template-columns: clamp(112px, 12vw, 158px) repeat(var(--tage, 7), minmax(132px, 1fr));
  min-width: max-content;
}

.plan__ecke, .plan__tag, .plan__name, .plan__zelle {
  border-right: 1px solid var(--rand);
  border-bottom: 1px solid var(--rand);
}
.plan__gitter > *:nth-child(calc(var(--tage) + 1)n) { border-right: 0; }

.plan__ecke, .plan__tag {
  position: sticky; top: 0; z-index: 3;
  background: var(--karte-2);
  padding: 9px 12px;
  font-size: .8125rem; font-weight: 650;
}
.plan__ecke { left: 0; z-index: 4; }
.plan__tag--heute { background: var(--akzent-weich); color: var(--akzent); }
.plan__tag--frei  { background: var(--karte-3); color: var(--text-still); }
.plan__tag span   { display: block; font-weight: 400; color: var(--text-leise); font-size: .75rem; }
.plan__tag--heute span { color: var(--akzent); }

.plan__name {
  position: sticky; left: 0; z-index: 2;
  background: var(--karte);
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  min-height: 92px;
}
.plan__name--offen { background: var(--creme); }

.plan__zelle {
  position: relative;
  display: flex; flex-direction: column; gap: 5px;
  padding: 7px;
  min-height: 92px;
  min-width: 0;
  background: var(--karte);
}
.plan__zelle--frei   { background: var(--karte-2); }
.plan__zelle--heute  { background: color-mix(in srgb, var(--akzent-weich) 55%, var(--karte)); }
.plan__zelle--ziel   { outline: 2.5px dashed var(--akzent); outline-offset: -3px; background: var(--akzent-weich); }
.plan__zelle--sperre { background: repeating-linear-gradient(135deg,
  var(--karte-2), var(--karte-2) 7px, var(--karte-3) 7px, var(--karte-3) 14px); }

.plan__block {
  display: block; width: 100%; min-width: 0; text-align: left;
  border: 1px solid var(--rand);
  border-left: 4px solid var(--block, var(--akzent));
  border-radius: var(--r-s);
  background: var(--karte);
  padding: 5px 7px;
  cursor: grab;
  font-size: .75rem; line-height: 1.3;
  box-shadow: var(--schatten-s);
}
.plan__block:active { cursor: grabbing; }
.plan__block:hover  { border-color: var(--rand-stark); }
.plan__block-kopf  { display: flex; gap: 5px; align-items: baseline; min-width: 0; }
.plan__block-nr    { font-weight: 700; flex: none; }
.plan__block-kunde { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
                     color: var(--text); }
.plan__block-titel { display: block; color: var(--text-leise); overflow: hidden;
                     text-overflow: ellipsis; white-space: nowrap; }
.plan__block-dauer { color: var(--text-still); font-variant-numeric: tabular-nums; }
.plan__block--erledigt { opacity: .55; }
.plan__block--erledigt .plan__block-nr { text-decoration: line-through; }

.plan__plus {
  margin-top: auto;
  min-height: 26px; border: 1px dashed var(--rand-stark); border-radius: var(--r-s);
  background: none; color: var(--text-still); cursor: pointer;
  font-size: .75rem; opacity: 0; transition: opacity .12s;
}
.plan__zelle:hover .plan__plus, .plan__plus:focus-visible { opacity: 1; }

.plan__kapa { font-size: .6875rem; color: var(--text-still); font-variant-numeric: tabular-nums; }
.plan__kapa--voll { color: var(--warn); font-weight: 650; }
.plan__kapa--ueber { color: var(--fehler); font-weight: 650; }
.plan__kapabalken { height: 3px; border-radius: var(--r-rund); background: var(--karte-3); overflow: hidden; }
.plan__kapabalken i { display: block; height: 100%; background: var(--akzent); }
.plan__kapabalken i.voll  { background: var(--warn); }
.plan__kapabalken i.ueber { background: var(--fehler); }

.plan__abwesend {
  position: absolute; inset: 6px;
  display: grid; place-items: center;
  border-radius: var(--r-s);
  background: var(--karte-2);
  color: var(--text-leise);
  font-size: .75rem; font-weight: 650;
  text-align: center;
}

/* Vorrat offener Arbeitsschritte */
.plan__backlog { position: sticky; top: calc(var(--kopf-hoehe) + 12px); }
.plan__vorrat {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 62vh; overflow-y: auto; padding: 10px;
}
.plan__vorrat .plan__block { cursor: grab; }
.plan__block--genommen {
  outline: 2.5px solid var(--akzent); outline-offset: 1px;
  background: var(--akzent-weich);
}

/* Schwebend, nicht im Textfluss: sonst rutscht beim Aufnehmen das ganze
   Raster nach unten und der nächste Tipp trifft die falsche Zelle. */
.plan__hinweis {
  position: fixed; z-index: 60;
  top: calc(var(--kopf-hoehe) + 12px); left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 540px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px 10px 16px;
  border-radius: var(--r-knopf);
  background: var(--akzent); color: var(--text-auf-farbe);
  box-shadow: var(--schatten-l);
  font-size: .875rem; font-weight: 600;
}
.plan__hinweis .knopf {
  background: color-mix(in srgb, var(--text-auf-farbe) 18%, transparent);
  border-color: transparent;
  color: var(--text-auf-farbe);
}
.plan__hinweis .knopf:hover {
  background: color-mix(in srgb, var(--text-auf-farbe) 30%, transparent);
}

/* Am Handy kein Wochenraster, sondern ein Tag nach dem anderen */
.plan__tagliste { display: flex; flex-direction: column; gap: 12px; }
.plan__person {
  display: grid; gap: 7px;
  padding: 12px;
  border-bottom: 1px solid var(--rand);
}
.plan__person:last-child { border-bottom: 0; }

/* ------------------------------------------------------------------ Terminal */

.terminal {
  min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr;
  background: var(--flaeche);
}
.terminal__kopf {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rand);
}
.terminal__uhr { margin-left: auto; font-size: 1.75rem; font-weight: 300; font-variant-numeric: tabular-nums; }
.terminal__leib { padding: 24px; }

.kacheln {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.kachel {
  display: grid; gap: 10px; place-items: center;
  min-height: 150px; padding: 18px 14px;
  border: 2px solid var(--rand);
  border-radius: var(--r-xl);
  background: var(--karte);
  cursor: pointer; text-align: center;
  transition: transform .08s, border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.kachel:active { transform: scale(.97); }
.kachel:hover  { border-color: var(--rand-stark); box-shadow: var(--schatten-m); }
/* pre-line, damit Vor- und Nachname untereinander stehen */
.kachel__name { font-size: 1.0625rem; font-weight: 650; line-height: 1.25; white-space: pre-line; }
.kachel--laeuft { border-color: var(--gut); background: var(--gut-weich); }
.kachel__was { font-size: .8125rem; color: var(--text-leise); }

/* Zifferntastatur */
.pin { display: grid; gap: 20px; place-items: center; padding: 8px 0 20px; }
.pin__punkte { display: flex; gap: 14px; height: 20px; }
.pin__punkt {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--rand-stark); background: none;
}
.pin__punkt--voll { background: var(--akzent); border-color: var(--akzent); }
.pin__punkte--fehler .pin__punkt { border-color: var(--fehler); background: var(--fehler-weich); }
.pin__punkte--fehler { animation: wackeln .4s; }
@keyframes wackeln {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9px); }
  75% { transform: translateX(9px); }
}

.tasten { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px; }
.taste {
  height: 84px;
  border: 1px solid var(--rand-stark);
  border-radius: var(--r-l);
  background: var(--karte);
  font-size: 1.75rem; font-weight: 500;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
.taste:active { transform: scale(.95); background: var(--karte-2); }
.taste--still { background: none; border-color: transparent; font-size: 1.125rem; font-weight: 600; }

/* ------------------------------------------------------- Meldungen und Lagen */

.meldungen {
  position: fixed; left: 50%; bottom: calc(var(--nav-hoehe) + 16px);
  transform: translateX(-50%);
  z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: calc(100% - 32px); max-width: 460px;
  pointer-events: none;
}
@media (min-width: 900px) { .meldungen { bottom: 24px; } }

.meldung {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-m);
  background: var(--text);
  color: var(--flaeche);
  box-shadow: var(--schatten-l);
  font-size: .9375rem; font-weight: 550;
  animation: auftauchen .22s ease-out;
}
.meldung--gut    { background: var(--gut);    color: var(--text-auf-farbe); }
.meldung--fehler { background: var(--fehler); color: var(--text-auf-farbe); }
.meldung--warn   { background: var(--warn);   color: var(--text-auf-farbe); }
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.lage {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: end center;
  background: rgba(18, 16, 14, .5);
  animation: einblenden .18s;
}
@media (min-width: 640px) { .lage { place-items: center; } }
@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }

.lage__blatt {
  width: 100%; max-width: 560px;
  max-height: 92dvh; overflow-y: auto;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--schatten-l);
  animation: hochfahren .24s cubic-bezier(.22, 1, .36, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 640px) {
  .lage__blatt { border-radius: var(--r-xl); animation: auftauchen .2s; }
}
@keyframes hochfahren { from { transform: translateY(100%); } to { transform: none; } }

.lage__kopf {
  position: sticky; top: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  background: var(--karte);
  border-bottom: 1px solid var(--rand);
}
.lage__kopf h2 { margin-right: auto; }
.lage__leib { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.lage__fuss {
  position: sticky; bottom: 0;
  display: flex; gap: 10px; padding: 14px 16px;
  background: var(--karte); border-top: 1px solid var(--rand);
}
.lage__fuss .knopf { flex: 1; }

/* ------------------------------------------------------------------- Ladezeug */

.ladebalken {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 3px; overflow: hidden;
}
.ladebalken::after {
  content: ""; display: block; height: 100%; width: 40%;
  background: var(--akzent);
  animation: durchlaufen 1.1s ease-in-out infinite;
}
@keyframes durchlaufen {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.platzhalter {
  background: linear-gradient(90deg, var(--karte-2) 25%, var(--karte-3) 37%, var(--karte-2) 63%);
  background-size: 400% 100%;
  animation: schimmern 1.3s linear infinite;
  border-radius: var(--r-s);
  height: 1em;
}
@keyframes schimmern { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .platzhalter { animation: none; }
  .ladebalken::after { animation: none; width: 100%; opacity: .5; }
}

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

.anmelden {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 20px;
}
.anmelden__karte { width: 100%; max-width: 400px; }
.anmelden__logo {
  display: grid; place-items: center; gap: 12px;
  margin-bottom: 26px; text-align: center;
}
.anmelden__zeichen {
  display: grid; place-items: center;
  width: 60px; height: 60px;
  border-radius: var(--r-l);
  background: var(--akzent); color: var(--text-auf-farbe);
}
.anmelden__zeichen svg { width: 32px; height: 32px; }

/* ------------------------------------------------------------------- Drucken */

@media print {
  .kopf, .nav, .meldungen, .knopf { display: none !important; }
  body { background: #fff; color: #000; }
  .karte { border-color: #ccc; box-shadow: none; }
}
