/* GOLDWERT Aufgaben – Aussehen der Mitarbeiter-App (fürs Handy gebaut, hell und dunkel nach Systemeinstellung).
   Regeln: Tippflächen mindestens 44 px, Eingabefelder 16 px Schrift (sonst zoomt das iPhone hinein), Ränder für Notch
   und Home-Balken (safe-area). Keine Schriften aus dem Netz, nur die des Geräts. Farbe der App: Petrol (Panel: Gold). */

:root {
  --bg: #f3f6f5;
  --flaeche: #ffffff;
  --flaeche2: #e9efed;
  --text: #16201e;
  --leise: #5b6865;
  --linie: #dbe3e1;
  --akzent: #0b7480;
  --akzent-text: #ffffff;
  --akzent-hell: #e1f1f2;
  --gold: #946f1c;
  --gold-hell: #f8f0dc;
  --gruen: #24734a;
  --gruen-hell: #e3f2e9;
  --gelb: #8c5a0b;
  --gelb-hell: #fbefd9;
  --rot: #b23a28;
  --rot-hell: #fcece8;
  --schatten: 0 1px 2px rgba(16, 32, 30, .06), 0 2px 8px rgba(16, 32, 30, .05);
  --r: 14px;
  --f-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-zahl: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1514;
    --flaeche: #172120;
    --flaeche2: #22302e;
    --text: #e7eeec;
    --leise: #9eaca9;
    --linie: #2b3a38;
    --akzent: #41c2cc;
    --akzent-text: #04211f;
    --akzent-hell: #133436;
    --gold: #dcb05a;
    --gold-hell: #30281a;
    --gruen: #62c38f;
    --gruen-hell: #163024;
    --gelb: #e7b257;
    --gelb-hell: #33280f;
    --rot: #f08672;
    --rot-hell: #3b2420;
    --schatten: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--f-text);
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; }
a { color: var(--akzent); }
img { max-width: 100%; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }
.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }
h1[tabindex="-1"]:focus { outline: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { touch-action: manipulation; }

/* ------------------------------------------------------------------ Kopfzeile */
.kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--linie);
  padding-top: env(safe-area-inset-top, 0px);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .kopf { background: var(--bg); } }
.kopf-innen {
  max-width: 680px;
  margin: 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px max(8px, env(safe-area-inset-right, 0px)) 4px max(8px, env(safe-area-inset-left, 0px));
}
.kopf-titel { flex: 1; min-width: 0; padding: 0 8px; }
.kopf-titel h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf-titel .leise { font-size: 13px; line-height: 1.2; }

/* ------------------------------------------------------------------ Seite */
.seite {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: grid;
  gap: 16px;
}
.seite-mitte { min-height: 100vh; min-height: 100dvh; align-content: center; justify-items: stretch; }
.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--schatten);
  display: grid;
  gap: 12px;
}
.start { text-align: center; justify-items: center; padding: 28px 20px; gap: 14px; }
.start .knopf { width: 100%; }
.start-symbol { width: 72px; height: 72px; border-radius: 17px; display: block; }
.abschnitt { display: grid; gap: 10px; }
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.trenner { height: 1px; background: var(--linie); border: 0; margin: 4px 0; }

/* ------------------------------------------------------------------ Knöpfe */
.knopf {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--flaeche2);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  overflow-wrap: normal;   /* Knopftexte nie mitten im Wort trennen („aufnehme|n“) – lieber bricht die Reihe um */
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
}
.knopf:active:not(:disabled) { transform: scale(.98); }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf .ico { width: 20px; height: 20px; flex: none; }
.knopf-haupt { background: var(--akzent); color: var(--akzent-text); }
.knopf-gruen { background: var(--gruen); color: #fff; }
@media (prefers-color-scheme: dark) { .knopf-gruen { color: #08200f; } }
.knopf-rand { background: transparent; border-color: var(--linie); }
.knopf-gefahr { background: transparent; border-color: var(--linie); color: var(--rot); }
.knopf-breit { width: 100%; }
.knopf-klein { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 8px; }
.knopf-reihe > .knopf { flex: 1 1 140px; }

.icon-knopf {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.icon-knopf:active { background: var(--flaeche2); }
.icon-knopf:disabled { opacity: .45; }
.icon-knopf .ico { width: 24px; height: 24px; }
.dreht .ico { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------------ Reiter Offen / Erledigt */
.reiter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--flaeche2);
  border-radius: 13px;
}
.reiter a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  color: var(--leise);
  font-weight: 600;
  text-decoration: none;
}
.reiter a[aria-current="page"] { background: var(--flaeche); color: var(--text); box-shadow: var(--schatten); }
@media (prefers-color-scheme: dark) { .reiter a[aria-current="page"] { background: var(--bg); } }
.zahl {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ Aufgabenliste */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.aufgabe {
  display: grid;
  gap: 8px;
  min-height: 44px;
  padding: 14px 16px 14px 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-left: 4px solid var(--linie);
  border-radius: var(--r);
  box-shadow: var(--schatten);
  color: var(--text);
  text-decoration: none;
}
.aufgabe:active { background: var(--flaeche2); }
.aufgabe.hoch { border-left-color: var(--gold); }
.aufgabe.heute { border-left-color: var(--gelb); }
.aufgabe.ueberfaellig { border-left-color: var(--rot); }
.aufgabe.ist-erledigt { border-left-color: var(--gruen); }
.aufgabe-kopf { display: flex; align-items: flex-start; gap: 10px; }
.aufgabe-titel { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.ist-erledigt .aufgabe-titel { color: var(--leise); }
.aufgabe-pfeil { color: var(--leise); margin-top: 2px; }
.aufgabe-text { color: var(--leise); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aufgabe-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.zaehler { display: inline-flex; align-items: center; gap: 12px; color: var(--leise); font-size: 14px; margin-left: auto; white-space: nowrap; }
.zaehler > span { display: inline-flex; align-items: center; gap: 4px; }
.zaehler .ico { width: 16px; height: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--flaeche2);
  color: var(--leise);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.chip .ico { width: 14px; height: 14px; }
.chip-rot { background: var(--rot-hell); color: var(--rot); }
.chip-gelb { background: var(--gelb-hell); color: var(--gelb); }
.chip-gold { background: var(--gold-hell); color: var(--gold); }
.chip-gruen { background: var(--gruen-hell); color: var(--gruen); }
.chip-akzent { background: var(--akzent-hell); color: var(--akzent); }

.leer { text-align: center; padding: 36px 16px; color: var(--leise); display: grid; gap: 8px; justify-items: center; }
.leer .ico { width: 40px; height: 40px; stroke-width: 1.5; color: var(--akzent); }
.lade-zeile { text-align: center; padding: 28px 0; color: var(--leise); }

/* ------------------------------------------------------------------ Hinweise und Meldungen */
.hinweis {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--akzent-hell);
  border: 1px solid color-mix(in srgb, var(--akzent) 30%, transparent);
  text-align: left;
}
.hinweis-gold { background: var(--gold-hell); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.hinweis h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.hinweis ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.hinweis .inline-ico { width: 18px; height: 18px; vertical-align: -3px; color: var(--akzent); }
.fehler-text { color: var(--rot); }
.ok-text { color: var(--gruen); }
.feld-meldung { min-height: 1.5em; font-size: 15px; }

.meldung {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  /* nur zum Lesen: Tipps gehen durch auf das, was darunter liegt (z. B. „Senden“ ganz unten) */
  pointer-events: none;
}
.meldung.fehler { background: var(--rot); color: #fff; }
@media (prefers-color-scheme: dark) { .meldung.fehler { color: #2a0d08; } }

/* ------------------------------------------------------------------ Formulare */
.feld { display: grid; gap: 6px; }
.feld > span { font-weight: 600; }
input[type="text"], input[type="tel"], input:not([type]), textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  font-size: 16px;
  line-height: 1.4;
  background: var(--flaeche);
  color: var(--text);
  border: 1px solid var(--linie);
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, textarea:focus { outline: 2px solid var(--akzent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; min-height: 96px; }
.code-feld {
  font-family: var(--f-zahl);
  font-size: 26px;
  letter-spacing: .28em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding-left: calc(13px + .28em);
}
.wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wahl-knopf {
  appearance: none;
  -webkit-appearance: none;
  min-height: 64px;
  border-radius: 14px;
  border: 2px solid var(--linie);
  background: var(--flaeche);
  font-size: 18px;
  font-weight: 650;
  cursor: pointer;
}
.wahl-knopf[aria-pressed="true"] { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent); }
.schritt { display: grid; gap: 10px; }
.schritt-nr { color: var(--leise); font-size: 14px; font-weight: 600; }

/* ------------------------------------------------------------------ Detail */
.detail-kopf { display: grid; gap: 10px; }
.detail-titel { font-size: 22px; line-height: 1.3; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aufgabe-volltext { white-space: pre-wrap; font-size: 16px; line-height: 1.55; }
.status-info { display: flex; align-items: center; gap: 8px; color: var(--gruen); font-weight: 600; }
.status-info .ico { width: 20px; height: 20px; }

.vorschauen { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.vorschau {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  padding: 0;
  border: 1px solid var(--linie);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--flaeche2);
  cursor: zoom-in;
  display: grid;
  place-items: center;
  color: var(--leise);
}
.vorschau img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vorschau .ico { width: 28px; height: 28px; }
.dateien { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.datei {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--linie);
  border-radius: 12px;
  background: var(--flaeche);
}
.datei > .ico { width: 24px; height: 24px; color: var(--akzent); }
.datei-name { flex: 1; min-width: 0; display: grid; }
.datei-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.datei-name span { font-size: 13px; color: var(--leise); }

.hochladen-liste { display: grid; gap: 8px; }
.hochladen-zeile {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--flaeche2);
}
.hochladen-zeile .datei-name { grid-column: 1; }
.hochladen-zeile progress { grid-column: 1 / -1; }
progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--linie);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--linie); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--akzent); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--akzent); border-radius: 4px; }
.datei-waehler { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.kommentare { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kommentar {
  display: grid;
  gap: 2px;
  padding: 10px 13px;
  border-radius: 14px;
  background: var(--flaeche2);
  margin-right: 36px;
}
.kommentar.eigen { background: var(--akzent-hell); margin-right: 0; margin-left: 36px; }
.kommentar-meta { font-size: 13px; color: var(--leise); display: flex; gap: 6px; flex-wrap: wrap; }
.kommentar-meta b { color: var(--text); font-weight: 650; }
.kommentar-text { white-space: pre-wrap; }
.kommentar-eingabe { display: grid; gap: 8px; }
.kommentar-unten { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zeichen { font-size: 13px; color: var(--leise); font-variant-numeric: tabular-nums; }
.zeichen.viel { color: var(--rot); }

/* ------------------------------------------------------------------ Bild-Betrachter */
.betrachter {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  overscroll-behavior: contain;
}
.betrachter::backdrop { background: rgba(0, 0, 0, .9); }
.betrachter-innen {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.betrachter-kopf { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 16px; }
.betrachter-kopf b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.betrachter .icon-knopf { color: #fff; }
.betrachter .icon-knopf:active { background: rgba(255, 255, 255, .15); }
.betrachter-bild { min-height: 0; display: grid; place-items: center; overflow: auto; padding: 8px; }
.betrachter-bild img { max-width: 100%; max-height: 100%; object-fit: contain; }
.betrachter-fuss { display: flex; justify-content: center; gap: 10px; padding: 8px 16px 16px; }
.betrachter-fuss .knopf { background: rgba(255, 255, 255, .14); color: #fff; }

/* ------------------------------------------------------------------ Größere Bildschirme */
@media (min-width: 720px) {
  .seite { padding-top: 24px; gap: 20px; }
  .karte { padding: 20px; }
}

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

/* ------------------------------------------------------------------ nicht hochgeladene Dateien, Links im Text */
.abgelehnt {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--rot-hell);
  border: 1px solid color-mix(in srgb, var(--rot) 35%, transparent);
  color: var(--text);
}
.abgelehnt-titel { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--rot); }
.abgelehnt-titel .ico { width: 20px; height: 20px; flex: none; }
.abgelehnt ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; overflow-wrap: anywhere; }
.abgelehnt .knopf { justify-self: start; }
.text-link { color: var(--akzent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
