/* Stunden – Wegner Tools
   Layout: feste blaue Kopfzeile mit Wochenwechsel, darunter ein Kärtchen pro Tag,
   unten eine feste Leiste mit Wochensumme und Senden. Für Daumenbedienung am iPhone. */
:root {
  --blau: #0067c0;
  --blau-dunkel: #00508f;
  --blau-hell: #e5f1fb;
  --gelb: #ffc83d;
  --text: #1b2430;
  --leise: #5f6b7a;
  --flaeche: #eef2f6;
  --karte: #ffffff;
  --linie: #d9e0e8;
  --rot: #c62828;
  --gruen: #1b7a34;
  --grau-feiertag: #f1f1f1;
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--schrift); font-size: 17px; line-height: 1.4; color: var(--text); background: var(--flaeche); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; }
[hidden] { display: none !important; }
.laden { padding: 40px 20px; text-align: center; color: var(--leise); }

/* Kopf */
.kopf { position: sticky; top: 0; z-index: 5; background: var(--blau); color: #fff; padding: calc(env(safe-area-inset-top) + 8px) 12px 10px; }
.kopf-oben { display: flex; align-items: center; gap: 10px; }
.kopf-oben .titel { font-weight: 700; font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kopf select { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 6px 8px; font-size: 15px; max-width: 48vw; }
.kopf select option { color: #000; }
.knopf-rund { background: rgba(255,255,255,.15); color: #fff; border: 0; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; display: grid; place-items: center; flex: none; }
.woche { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.woche .mitte { flex: 1; text-align: center; }
.woche .mitte b { display: block; font-size: 17px; }
.woche .mitte span { font-size: 13.5px; color: #d6e8f8; }
.woche .knopf-rund { font-size: 24px; }
.status { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; min-height: 18px; }
.marke { background: rgba(255,255,255,.18); padding: 1px 8px; border-radius: 99px; }
.marke.ok { background: #d8f2dd; color: var(--gruen); }
.marke.fehler { background: #ffe1e1; color: var(--rot); }
.link-hell { color: #fff; background: none; border: 0; text-decoration: underline; font-size: 13px; padding: 0; }

/* Tage */
main { padding: 12px 10px calc(env(safe-area-inset-bottom) + 96px); max-width: 720px; margin: 0 auto; display: grid; gap: 10px; }
.tag { background: var(--karte); border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); overflow: hidden; }
.tag.feiertag { background: var(--grau-feiertag); }
.tag-kopf { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 6px; }
.tag-kopf b { font-size: 16.5px; }
.tag-kopf .ft { font-size: 13px; color: var(--leise); flex: 1; }
.tag-kopf .summe { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag-kopf .summe.rot, .zeile .std.rot { color: var(--rot); }
.zeile { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--linie); padding: 10px 14px; }
.zeile:active { background: var(--blau-hell); }
.zeile .zeit { font-size: 13px; color: var(--leise); font-variant-numeric: tabular-nums; line-height: 1.25; }
.zeile .zeit small { display: block; color: #8a95a3; }
.zeile .was { min-width: 0; }
.zeile .was b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile .was span { display: block; font-size: 14px; color: var(--leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zeile .std { font-weight: 700; font-variant-numeric: tabular-nums; }
.tag-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 12px; border-top: 1px solid var(--linie); }
.tag.leer .tag-knoepfe { border-top: 0; padding-top: 2px; }
.klein-knopf { border: 1px solid var(--linie); background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 14.5px; }
.klein-knopf.haupt { background: var(--blau); color: #fff; border-color: var(--blau); }
.tag.wochenende:not(.offen) .tag-knoepfe .neben { display: none; }

/* Fussleiste */
.fuss { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--linie); padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px); display: flex; align-items: center; gap: 10px; }
.fuss .gesamt { flex: 1; }
.fuss .gesamt small { display: block; font-size: 12.5px; color: var(--leise); }
.fuss .gesamt b { font-size: 21px; font-variant-numeric: tabular-nums; }
.knopf { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; background: var(--blau-hell); color: var(--blau-dunkel); }
.knopf.haupt { background: var(--blau); color: #fff; }
.knopf.rot { background: #ffe9e9; color: var(--rot); }
.knopf.voll { width: 100%; }
.knopf:disabled { opacity: .5; }
.knopf.rot.scharf { background: var(--rot); color: #fff; }
.weg.scharf { font-weight: 700; }
#app { min-height: 100%; }
.anmelden { min-height: 100vh; }

/* Blätter (Bottom-Sheets) */
#schicht { position: fixed; inset: 0; z-index: 20; background: rgba(10,25,45,.45); display: flex; align-items: flex-end; justify-content: center; }
.blatt { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 14px 16px calc(env(safe-area-inset-bottom) + 16px); -webkit-overflow-scrolling: touch; }
.blatt h2 { font-size: 19px; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.blatt h2 .zu { margin-left: auto; background: var(--flaeche); border: 0; border-radius: 99px; width: 32px; height: 32px; font-size: 18px; color: var(--leise); }
.blatt h3 { font-size: 16px; margin: 20px 0 8px; color: var(--blau-dunkel); }
.feld { display: grid; gap: 4px; margin-bottom: 12px; }
.feld label { font-size: 14px; color: var(--leise); }
.feld input, .feld textarea, .feld select { width: 100%; border: 1px solid #c9d2dc; border-radius: 10px; padding: 11px 12px; background: #fff; font-size: 17px; }
.feld textarea { min-height: 70px; resize: vertical; }
.feld input:focus, .feld textarea:focus, .feld select:focus { border-color: var(--blau); outline: none; box-shadow: 0 0 0 3px var(--blau-hell); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--linie); background: #fff; border-radius: 99px; padding: 7px 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.chip.an { background: var(--blau); color: #fff; border-color: var(--blau); }
.vorschlaege { border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; max-height: 230px; overflow-y: auto; }
.vorschlaege button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--linie); background: #fff; padding: 10px 12px; font-size: 16px; }
.vorschlaege button:last-child { border-bottom: 0; }
.vorschlaege button:active { background: var(--blau-hell); }
.reihe { display: flex; gap: 8px; flex-wrap: wrap; }
.reihe > * { flex: 1; }
.schalter { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; font-size: 15.5px; }
.schalter input { width: 22px; height: 22px; }
.liste { border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
.liste button, .liste .eintrag { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--linie); background: #fff; padding: 12px; font-size: 16px; }
.liste > :last-child { border-bottom: 0; }
.liste .rechts { margin-left: auto; color: var(--leise); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.liste .weg { margin-left: auto; border: 0; background: none; color: var(--rot); font-size: 14px; padding: 4px 8px; width: auto; }
.text-leise { color: var(--leise); font-size: 14.5px; }
.fehlertext { color: var(--rot); font-size: 15px; margin: 8px 0; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--flaeche); padding: 2px 6px; border-radius: 6px; }

/* Anmelden */
.anmelden { min-height: 100%; display: grid; place-items: center; padding: calc(env(safe-area-inset-top) + 20px) 16px 30px; background: var(--blau); }
.anmelden .karte { background: #fff; border-radius: 18px; padding: 22px 18px; width: 100%; max-width: 420px; box-shadow: 0 16px 40px rgba(0,30,60,.3); }
.anmelden .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.anmelden .logo img { width: 44px; height: 44px; border-radius: 10px; }
.anmelden .logo b { font-size: 21px; display: block; }
.anmelden .logo span { font-size: 13.5px; color: var(--leise); }

#hinweis { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 86px); z-index: 30; background: #1b2430; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

@media (prefers-reduced-motion: no-preference) {
  .blatt { animation: hoch .18s ease-out; }
  @keyframes hoch { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
}
