/* norvolt Aufgaben — Oberflaeche
   Reines CSS, keine externen Schriften, keine Abhaengigkeiten.
   Farbwelt laut Bau-Kontrakt: Navy, Gruen, Gelb, heller Hintergrund. */

:root {
  --navy: #0B2D4F;
  --navy-hell: #14456f;
  --navy-tief: #072037;
  --gruen: #5AA154;
  --gruen-hell: #eaf4e9;
  --gelb: #F5C518;
  --grund: #F4F6F9;
  --karte: #ffffff;
  --linie: #e2e7ee;
  --linie-kraeftig: #ccd5e0;
  --text: #1c2b3a;
  --text-leise: #66748a;
  --rot: #c0392b;
  --rot-hell: #fdeceb;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(11, 45, 79, .06), 0 2px 8px rgba(11, 45, 79, .06);
  --schatten-hoch: 0 8px 28px rgba(11, 45, 79, .18);
  --kopf-hoehe: 60px;
  --tipp: 44px; /* Mindestgroesse aller Bedienelemente (Finger) */
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; } /* gescrollt wird in den Spalten, nicht in der Seite */

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

/* ------------------------------------------------------------ Meldungszeile */

.meldung {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(560px, calc(100vw - 24px));
  padding: 11px 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--linie-kraeftig);
  border-left: 4px solid var(--navy);
  box-shadow: var(--schatten-hoch);
  font-size: 15px;
  color: var(--text);
}
.meldung.ist-fehler { border-left-color: var(--rot); }
.meldung.ist-erfolg { border-left-color: var(--gruen); }

/* ------------------------------------------------------- Mittige Ansichten */

.ansicht { height: 100%; }

.ansicht-mitte {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  overflow: auto;
}

.karte-mitte {
  width: 100%;
  max-width: 400px;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 14px;
  box-shadow: var(--schatten);
  padding: 30px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.logo-gross {
  display: block;
  height: 40px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 4px;
}

.mitte-titel { font-size: 24px; }
.mitte-text { margin: -6px 0 4px; color: var(--text-leise); font-size: 15px; }

/* --------------------------------------------------------------- Formulare */

.feld { display: flex; flex-direction: column; gap: 6px; }
.feld-name { font-size: 13px; font-weight: 600; color: var(--text-leise); }
.feld-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.eingabe {
  width: 100%;
  min-height: var(--tipp);
  padding: 10px 12px;
  font: inherit;
  font-size: 16px; /* unter 16px zoomt iOS-Safari beim Fokus hinein */
  color: var(--text);
  background: #fff;
  border: 1px solid var(--linie-kraeftig);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
}
.eingabe:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(11, 45, 79, .14);
}
.eingabe-mehrzeilig { min-height: 90px; resize: vertical; line-height: 1.5; }

select.eingabe {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2366748a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
  padding-right: 36px;
}

.feld-fehler {
  margin: 0;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--rot-hell);
  color: var(--rot);
  font-size: 14px;
}

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

.knopf {
  min-height: var(--tipp);
  min-width: var(--tipp);
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.knopf-breit { width: 100%; }
.knopf-primaer { background: var(--navy); color: #fff; }
.knopf-primaer:hover { background: var(--navy-hell); }
.knopf-still { background: #fff; border-color: var(--linie-kraeftig); color: var(--text); }
.knopf-still:hover { background: #f2f5f9; }
.knopf-gefahr { background: #fff; border-color: #e6b7b1; color: var(--rot); }
.knopf-gefahr:hover { background: var(--rot-hell); }
.knopf:disabled { opacity: .55; cursor: default; }

.knopf-schliessen {
  flex: none;
  width: var(--tipp);
  height: var(--tipp);
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.knopf-schliessen:hover { background: #eef1f6; }
.knopf-schliessen svg {
  width: 20px; height: 20px; fill: none;
  stroke: var(--text-leise); stroke-width: 1.8; stroke-linecap: round;
}

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

.kopf {
  height: calc(var(--kopf-hoehe) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0 16px;
  background: var(--navy);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.kopf-logo { height: 26px; width: auto; max-width: 130px; object-fit: contain; display: block; }

.kopf-titel {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  padding-left: 12px;
  margin-left: 2px;
  border-left: 1px solid rgba(255, 255, 255, .25);
  color: rgba(255, 255, 255, .92);
}

.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 2px; }

/* Der eigene Name ist der Knopf zu den Einstellungen (Kontrakt v3). */
.kopf-nutzer {
  display: flex;
  align-items: center;
  min-height: var(--tipp);
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: rgba(255, 255, 255, .92);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kopf-nutzer:hover { background: rgba(255, 255, 255, .12); }
.kopf-nutzer-name {
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Der Kreis mit den Initialen tritt erst auf dem iPhone an die Stelle des Namens. */
.kopf-nutzer-kurz { display: none; }

.kopf-knopf {
  position: relative;
  width: var(--tipp);
  height: var(--tipp);
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kopf-knopf:hover { background: rgba(255, 255, 255, .12); }
.kopf-knopf svg {
  width: 23px; height: 23px; fill: none;
  stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.kopf-knopf svg .voll { fill: #fff; stroke: none; }

.glocke-punkt {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--gelb);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--navy);
}

/* ------------------------------------------------------------ Bereichsreiter */

.reiter-leiste {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid var(--linie);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.reiter-leiste::-webkit-scrollbar { display: none; }

.reiter {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tipp);
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 22px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.reiter:hover { background: #f2f5f9; color: var(--text); }
.reiter.ist-aktiv { background: var(--navy); color: #fff; }
.reiter.ist-aktiv:hover { background: var(--navy-hell); }
.reiter-neu { border: 1px dashed var(--linie-kraeftig); color: var(--text-leise); }

.punkt {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--linie-kraeftig);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06) inset;
}

/* --------------------------------------------------------------- Statusreiter */

.statusreiter { display: none; }

/* ---------------------------------------------------------------- Das Board */

.board {
  height: calc(100% - var(--kopf-hoehe) - env(safe-area-inset-top) - 61px);
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: stretch;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spalte {
  flex: 1 1 0;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background: #eef1f6;
  border: 1px solid var(--linie);
  border-radius: 12px;
  transition: background-color .12s ease, box-shadow .12s ease;
}
/* Hebt sich ab, waehrend eine Karte darueber schwebt */
.spalte.ist-ziel {
  background: #e4ecf5;
  box-shadow: 0 0 0 2px var(--navy) inset;
}

/* Der Spaltenkopf ist zugleich die Schaltflaeche zum Bearbeiten der Spalte. */
.spalten-kopf {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: var(--tipp);
  padding: 12px 14px 10px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.spalten-kopf:hover .spalten-name { color: var(--navy); }
/* Ohne Verwaltungsrechte ist der Kopf ab v3 nur noch eine Ueberschrift. */
.spalten-kopf-fest { cursor: default; }
.spalten-kopf-fest:hover .spalten-name { color: inherit; }
.spalten-name { font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.spalten-zahl {
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 11px;
  background: #dbe2ec;
  color: var(--text-leise);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
/* Farbbalken: die Farbe kommt als Inline-Stil aus spalte.farbe. */
.spalten-strich { height: 3px; margin: 0 14px 8px; border-radius: 2px; background: var(--linie-kraeftig); }
/* Spalten mit „zählt als erledigt“ tragen den Zaehler in Gruen. */
.spalte-erledigt .spalten-zahl { background: var(--gruen-hell); color: var(--gruen); }

/* Gestrichelte Schaltflaeche rechts neben der letzten Spalte */
.spalte-neu {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 116px;
  min-height: var(--tipp);
  padding: 16px 12px;
  border: 2px dashed var(--linie-kraeftig);
  border-radius: 12px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.spalte-neu:hover { border-color: var(--navy); color: var(--navy); background: rgba(255, 255, 255, .6); }
.spalte-neu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.board-leer { align-self: center; max-width: 320px; }

.knopf-neu {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tipp);
  margin: 0 12px 10px;
  padding: 10px;
  border: 1px dashed var(--linie-kraeftig);
  border-radius: 8px;
  background: rgba(255, 255, 255, .6);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.knopf-neu:hover { background: #fff; color: var(--navy); border-color: var(--navy); }
.knopf-neu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.spalten-liste {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.leer-hinweis {
  margin: 6px 2px;
  padding: 22px 14px;
  border: 1px dashed var(--linie-kraeftig);
  border-radius: 10px;
  text-align: center;
  color: var(--text-leise);
  font-size: 14px;
  line-height: 1.5;
}

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

.karte {
  position: relative;
  flex: none;
  padding: 12px 14px;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  cursor: pointer;
  /* pan-y: senkrechtes Scrollen der Spalte bleibt Sache des Browsers,
     waagerechtes Ziehen meldet der Browser als pointermove an uns. */
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.karte:hover { border-color: var(--linie-kraeftig); }

.karte-titel { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
/* Ersatzname (erste Beschreibungszeile oder Bereich) — sichtbar zurueckhaltender */
.karte-titel.ist-ersatzname { font-weight: 500; color: #3d4d61; }

.karte-bereich {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-leise);
}

.karte-fuss {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  min-height: 26px;
}

.avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  display: grid;
  place-items: center;
}
.avatar-leer { background: #e6eaf0; color: var(--text-leise); }
.avatar-klein { width: 22px; height: 22px; font-size: 10px; }

.marke {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f0f3f7;
  color: var(--text-leise);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.marke svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.marke-ueberfaellig { background: var(--rot-hell); color: var(--rot); }
.marke-fertig { background: var(--gruen-hell); color: var(--gruen); }
.marke-klein { padding: 2px 6px; font-size: 11.5px; }

.karte-abstand { margin-left: auto; }

.karte.ist-erledigt .karte-titel { color: var(--text-leise); }
.karte.ist-erledigt { border-left: 3px solid var(--gruen); }

/* Original waehrend des Ziehens ausblenden — die Einfuege-Marke zeigt die Stelle */
.karte.wird-gezogen { display: none; }

/* Der Klon, der dem Finger folgt */
.karte-klon {
  position: fixed;
  z-index: 120;
  margin: 0;
  pointer-events: none;
  box-shadow: var(--schatten-hoch);
  transform-origin: center;
  will-change: transform;
}

/* Einfuege-Marke in der Zielspalte */
.einfuege-marke {
  flex: none;
  height: 3px;
  margin: -6px 0;
  border-radius: 2px;
  background: var(--navy);
}

body.zieht { cursor: grabbing; }
body.zieht * { cursor: grabbing !important; }

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

.ueberlagerung {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 45, 79, .38);
  overscroll-behavior: contain;
}

.dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100% - 20px);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--schatten-hoch);
  overflow: hidden;
}
.dialog-schmal { max-width: 400px; }

.panel-kopf {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 20px;
  border-bottom: 1px solid var(--linie);
}
.panel-kopf h2 { flex: 1 1 auto; font-size: 17px; }

.panel-inhalt {
  flex: 1 1 auto;
  padding: 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-fuss {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--linie);
  background: #fafbfd;
}
.fuss-rechts { margin-left: auto; display: flex; gap: 10px; }
.fuss-hinweis { font-size: 13.5px; color: var(--text-leise); }

.frage-titel { font-size: 18px; }
.frage-text { margin: 8px 0 0; color: var(--text-leise); font-size: 15px; }

/* ------------------------------------------- Spalten-Umschalter im Dialog */

.status-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }

.status-knopf {
  flex: 1 1 auto;
  min-width: 120px;
  min-height: var(--tipp);
  padding: 10px 12px;
  border: 1px solid var(--linie-kraeftig);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.status-knopf:hover { background: #f2f5f9; }
/* Die aktive Spalte traegt ihre eigene Farbe (Inline-Stil aus spalte.farbe). */
.status-knopf.ist-aktiv { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------------------------------- Unteraufgaben */

.unterliste { display: flex; flex-direction: column; }

.unter-zeile {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--linie);
}
.unter-zeile:first-child { border-top: 1px solid var(--linie); }

/* Links das Kaestchen (hakt ab), daneben der Text (oeffnet die Unteraufgabe). */
.unter-haken {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tipp);
  min-height: var(--tipp);
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.unter-oeffnen {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tipp);
  padding: 8px 2px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.unter-oeffnen:hover .unter-text { color: var(--navy); text-decoration: underline; }
.unter-zusatz { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.unter-kasten {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--linie-kraeftig);
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #fff;
}
.unter-kasten svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.unter-zeile.ist-fertig .unter-kasten { background: var(--gruen); border-color: var(--gruen); }
.unter-zeile.ist-fertig .unter-text { color: var(--text-leise); text-decoration: line-through; }
.unter-text { overflow-wrap: anywhere; min-width: 0; }

.unter-weg {
  flex: none;
  width: var(--tipp);
  height: var(--tipp);
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.unter-weg:hover { background: var(--rot-hell); }
.unter-weg svg { width: 17px; height: 17px; fill: none; stroke: var(--text-leise); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.unter-weg:hover svg { stroke: var(--rot); }

.unter-neu { display: flex; gap: 8px; margin-top: 10px; }
.unter-neu .eingabe { flex: 1 1 auto; }

.unter-leer { padding: 10px 2px; color: var(--text-leise); font-size: 14px; }

/* ------------------------------------------------------- Glocken-Panel */

.ueberlagerung#ueberlagerung-glocke { align-items: flex-start; justify-content: flex-end; padding: 0; }

.panel-glocke {
  display: flex;
  flex-direction: column;
  width: min(390px, 100%);
  max-height: 100%;
  margin: calc(var(--kopf-hoehe) + env(safe-area-inset-top) + 8px) 12px 12px;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--schatten-hoch);
  overflow: hidden;
}
.panel-glocke .panel-inhalt { padding: 6px 0; gap: 0; }

.hinweis-zeile {
  display: block;
  width: 100%;
  min-height: var(--tipp);
  padding: 12px 20px;
  border: none;
  border-bottom: 1px solid var(--linie);
  background: transparent;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hinweis-zeile:last-child { border-bottom: none; }
.hinweis-zeile:hover { background: #f6f8fb; }
.hinweis-text { font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.hinweis-zeit { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-leise); }
.hinweis-zeile.ist-neu { background: #fffdf2; }
.hinweis-zeile.ist-neu .hinweis-text { font-weight: 700; }

.panel-leer { padding: 34px 20px; text-align: center; color: var(--text-leise); font-size: 15px; }

/* -------------------------------------------------------------- Dateien */

.dateien { display: flex; flex-direction: column; gap: 10px; }

.datei-kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.datei-kachel { position: relative; }

.datei-bild {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--linie-kraeftig);
  border-radius: 10px;
  background: #f0f3f7;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.datei-bild:hover { border-color: var(--navy); }
.datei-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }

.datei-zeile {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: #fff;
}

.datei-oeffnen {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tipp);
  padding: 8px 4px 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.datei-oeffnen:hover .datei-name { color: var(--navy); text-decoration: underline; }
.datei-oeffnen svg, .datei-wahl svg {
  flex: none; width: 18px; height: 18px; fill: none;
  stroke: var(--text-leise); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.datei-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei-groesse { flex: none; font-size: 12.5px; color: var(--text-leise); }

/* Der Loesch-Knopf sitzt bei Kacheln in der Ecke, bei Zeilen am Ende. */
.datei-weg {
  flex: none;
  width: var(--tipp);
  height: var(--tipp);
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.datei-weg:hover { background: var(--rot-hell); }
.datei-weg svg { width: 17px; height: 17px; fill: none; stroke: var(--text-leise); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.datei-weg:hover svg { stroke: var(--rot); }
.datei-kachel .datei-weg {
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 0 10px 0 10px;
  background: rgba(255, 255, 255, .88);
}
.datei-kachel .datei-weg:hover { background: var(--rot-hell); }

/* Liste der vor dem Anlegen gewaehlten Dateien */
.datei-wahl-liste { display: flex; flex-direction: column; gap: 4px; }
.datei-wahl {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f0f3f7;
  font-size: 14px;
}

.knopf-datei-neu {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tipp);
  margin-top: 4px;
  padding: 10px 16px;
  border: 1px dashed var(--linie-kraeftig);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-leise);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.knopf-datei-neu:hover { color: var(--navy); border-color: var(--navy); }
.knopf-datei-neu:disabled { opacity: .55; cursor: default; }
.knopf-datei-neu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.datei-eingabe { display: none; }

/* --------------------------------------------------------- Umschalter */

.umschalter {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tipp);
  padding: 6px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.umschalter input { position: absolute; opacity: 0; width: 0; height: 0; }
.umschalter-kasten {
  flex: none;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--linie-kraeftig);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #fff;
}
.umschalter-kasten svg {
  width: 16px; height: 16px; fill: none;
  stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.umschalter input:checked + .umschalter-kasten { background: var(--gruen); border-color: var(--gruen); }
.umschalter input:focus-visible + .umschalter-kasten { box-shadow: 0 0 0 3px rgba(11, 45, 79, .18); }
.umschalter-text { font-size: 15px; font-weight: 600; }

.reihen-knoepfe { display: flex; gap: 10px; }
.reihen-knoepfe .knopf { flex: 1 1 0; }

/* -------------------------------------------- Zurueck (Unteraufgabe) */

.knopf-zurueck {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tipp);
  margin-left: -8px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.knopf-zurueck:hover { background: #eef1f6; }
.knopf-zurueck svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Nur fuer Vorleseprogramme — die Ueberschrift steht schon im Zurueck-Knopf */
.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------- Farbwahl */

.farbwahl { display: flex; flex-wrap: wrap; gap: 10px; }
.farb-knopf {
  width: var(--tipp);
  height: var(--tipp);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.farb-knopf span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset;
}
.farb-knopf.ist-aktiv { border-color: var(--navy); }

/* --------------------------------------------------------------- Hilfe */

.hilfe-liste { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.hilfe-liste h3 { font-size: 15.5px; color: var(--navy); }
.hilfe-liste p { margin: 4px 0 0; color: var(--text-leise); font-size: 14.5px; line-height: 1.55; }

/* --------------------------------------------------------------- Claude */

/* Kennzeichen auf Karten und in Unteraufgaben-Zeilen: Funke in der Statusfarbe.
   Die Funken-Pfade sind Flaechen — anders als die uebrigen Strich-Symbole. */
.claude-marke svg { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.claude-marke.marke-klein svg { width: 12px; height: 12px; }
.claude-grau { background: #eceff4; color: var(--text-leise); }
.claude-gelb { background: #fdf3d2; color: #8a6b06; }
.claude-gruen { background: var(--gruen-hell); color: var(--gruen); }

.claude-abschnitt {
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--linie);
}
.claude-lage { margin: 0; color: var(--text-leise); font-size: 14.5px; line-height: 1.5; }
.claude-herkunft { margin: -6px 0 0; color: var(--text-leise); font-size: 13px; }

.claude-kasten {
  padding: 12px 14px;
  border: 1px solid var(--linie);
  border-left: 4px solid var(--linie-kraeftig);
  border-radius: 10px;
  background: #fff;
}
.claude-kasten-titel { font-size: 14.5px; }
.claude-text {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;      /* Zeilenumbrueche von Claude bleiben erhalten */
  overflow-wrap: anywhere;
}
.claude-fertig { background: var(--gruen-hell); border-color: #cfe3cd; border-left-color: var(--gruen); }
.claude-fertig .claude-kasten-titel { color: #3d7a38; }
.claude-rueckfrage { background: #fffaea; border-color: #f0e0ae; border-left-color: var(--gelb); }
.claude-rueckfrage .claude-kasten-titel { color: #8a6b06; }

.claude-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.knopf-claude { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.knopf-claude svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }

/* ------------------------------------------------------- Einstellungen */

.einst-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--linie);
}
.einst-block:last-child { padding-bottom: 0; border-bottom: none; }
.einst-titel { font-size: 16px; color: var(--navy); }
.einst-text { margin: -2px 0 0; color: var(--text-leise); font-size: 14.5px; line-height: 1.55; }

.einst-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }

.einst-schritte {
  margin: 0;
  padding-left: 22px;
  color: var(--text-leise);
  font-size: 14.5px;
  line-height: 1.6;
}
.einst-schritte li { margin-bottom: 2px; }

/* Eine Zeile je Bereich: Name, Farbpunkt, Papierkorb. */
.einst-bereiche { display: flex; flex-direction: column; gap: 8px; }

.bereich-zeile { display: flex; align-items: center; gap: 8px; }
.bereich-zeile .eingabe { flex: 1 1 auto; min-width: 0; }

.bereich-farbe {
  flex: none;
  width: var(--tipp);
  height: var(--tipp);
  display: grid;
  place-items: center;
  border: 1px solid var(--linie-kraeftig);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bereich-farbe.ist-aktiv { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(11, 45, 79, .14); }
.punkt-gross { width: 18px; height: 18px; }

.farbwahl-zeile {
  margin: -2px 0 4px;
  padding: 8px;
  border: 1px solid var(--linie);
  border-radius: 10px;
  background: #f6f8fb;
}

.claude-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
}
.claude-status.ist-verbunden { background: var(--gruen-hell); color: var(--gruen); }
.claude-status.ist-getrennt { background: #eceff4; color: var(--text-leise); }

/* ------------------------------------------------ iPhone: Wisch-Ansicht */

@media (max-width: 700px) {
  .kopf-titel { display: none; }
  .kopf-logo { height: 24px; }

  /* Auf dem iPhone bleibt vom Namen der Kreis mit den Initialen — der Weg in
     die Einstellungen darf nicht verschwinden. */
  .kopf-nutzer { width: var(--tipp); padding: 0; justify-content: center; }
  .kopf-nutzer-name { display: none; }
  .kopf-nutzer-kurz {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
  }

  /* Die Spalten werden zu Reitern — bei vielen Spalten waagerecht wischbar. */
  .statusreiter {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid var(--linie);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .statusreiter::-webkit-scrollbar { display: none; }
  .status-reiter-knopf {
    flex: 1 0 auto;
    max-width: 60vw;
    min-height: var(--tipp);
    padding: 8px 12px;
    border: 1px solid var(--linie);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-leise);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
  }
  .status-reiter-knopf.ist-aktiv { background: var(--navy); border-color: var(--navy); color: #fff; }
  .reiter-plus { flex: none; min-width: var(--tipp); font-size: 20px; line-height: 1; border-style: dashed; }

  /* Auf dem iPhone fuehrt der Weg zur neuen Spalte ueber den „+“-Reiter. */
  .spalte-neu { display: none; }

  .board {
    /* Kopf + Bereichsreiter + Statusreiter abziehen */
    height: calc(100% - var(--kopf-hoehe) - env(safe-area-inset-top) - 61px - 61px);
    gap: 0;
    padding: 0;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }
  .spalte {
    flex: 0 0 100%;
    min-width: 100%;
    scroll-snap-align: start;
    border: none;
    border-radius: 0;
    background: var(--grund);
  }
  .spalten-kopf { padding-top: 14px; }
  .spalten-liste { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

  .ueberlagerung { padding: 0; align-items: flex-end; }
  .dialog, .dialog-schmal {
    max-width: 100%;
    max-height: 92%;
    border-radius: 14px 14px 0 0;
  }
  .feld-paar { grid-template-columns: 1fr; }
  .panel-glocke { width: 100%; margin: 0; max-height: 88%; border-radius: 14px 14px 0 0; }
  .ueberlagerung#ueberlagerung-glocke { align-items: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
