/* Pflegebuch – Tablet-Oberfläche. Farben laut CLAUDE.md, große Bedienelemente für Handschuhe. */
:root {
  --oliv: #4F5D22; --salbei: #A7B690; --braun: #806033; --hellblau: #B3DFEC;
  --bg: #EEF0EA; --surface: #FFFFFF; --ink: #1C2414; --muted: #5B6650; --line: #CBD2C3;
  --primary: var(--oliv); --primary-ink: #FFFFFF;
  --signal: #C2410C; --signal-bg: #FBE6DA;
  --done: #2F7A45; --done-bg: #DCEBDD; --focus: #1D4ED8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12160E; --surface: #1C2216; --ink: #E7ECDF; --muted: #A2AD96; --line: #33402A;
    --primary: #A7B690; --primary-ink: #12160E;
    --signal: #FF8A4C; --signal-bg: #3A2117;
    --done: #86CC98; --done-bg: #1F3326; --focus: #93C5FD;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12160E; --surface: #1C2216; --ink: #E7ECDF; --muted: #A2AD96; --line: #33402A;
  --primary: #A7B690; --primary-ink: #12160E;
  --signal: #FF8A4C; --signal-bg: #3A2117;
  --done: #86CC98; --done-bg: #1F3326; --focus: #93C5FD;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 18px; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.cond { font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif; font-weight: 700; letter-spacing: .01em; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* Kopf: hell mit Logo */
header.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
header.top img { height: 44px; width: auto; display: block; }
:root[data-theme="dark"] header.top img { filter: brightness(1.4); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) header.top img { filter: brightness(1.4); } }
header.top .crew { margin-left: auto; font-size: 15px; color: var(--muted); text-align: right; }
header.top .crew b { color: var(--ink); }

/* Offline-Hinweis */
.netbar { background: var(--signal-bg); color: var(--ink); border-bottom: 2px solid var(--signal); padding: 8px 18px; font-size: 15px; font-weight: 600; }
.netbar.ok { background: var(--done-bg); border-color: var(--done); }

main { max-width: 1060px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 32px; line-height: 1.1; margin: 4px 0 14px; }
h2 { font-size: 22px; margin: 24px 0 10px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.narrow { max-width: 460px; margin: 6vh auto 0; }

label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 16px; margin-bottom: 14px; }
label.f input {
  font-weight: 400; font-size: 19px; padding: 14px 16px; min-height: 56px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--bg);
}

.btn {
  border: 0; border-radius: 12px; padding: 16px 24px; min-height: 60px;
  font-weight: 700; font-size: 19px; background: var(--primary); color: var(--primary-ink);
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.error { background: var(--signal-bg); border-left: 4px solid var(--signal); padding: 10px 12px; border-radius: 8px; margin: 0 0 14px; font-size: 16px; }

/* Tagesstart: große Namens-Kacheln */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.person {
  text-align: left; min-height: 72px; padding: 14px 16px 14px 58px; position: relative;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 19px; font-weight: 600;
}
.person::before {
  content: ""; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 2px solid var(--muted); border-radius: 8px;
}
.person[aria-pressed="true"] { border-color: var(--done); background: var(--done-bg); }
.person[aria-pressed="true"]::before { background: var(--done); border-color: var(--done); }
.person[aria-pressed="true"]::after {
  content: "✓"; position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
  color: var(--surface); font-weight: 800; font-size: 18px;
}

/* Startkacheln */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile {
  text-align: left; min-height: 120px; padding: 18px; border: 2px solid var(--line); border-radius: 16px;
  background: var(--surface);
}
.tile b { display: block; font-size: 24px; }
.tile span { font-size: 15px; color: var(--muted); }
.tile[disabled] { opacity: .55; cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 20; max-width: 90vw;
}
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

@media (max-width: 600px) { h1 { font-size: 27px; } header.top img { height: 36px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Navigation und Auswahl */
.back { border: 0; background: none; color: var(--primary); font-weight: 600; font-size: 18px; padding: 8px 0; min-height: 44px; }
.linkbtn { border: 0; background: none; color: var(--primary); font-weight: 600; text-decoration: underline; padding: 0; }
h2.cond { font-size: 20px; margin: 18px 0 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 18px; min-height: 52px; font-weight: 600; font-size: 17px; }
.chip[aria-pressed="true"] { border-color: var(--primary); background: var(--done-bg); }
.rule { border-left: 4px solid var(--signal); background: var(--signal-bg); padding: 12px 14px; border-radius: 8px; font-size: 16px; margin: 10px 0; }
.btn.sm { padding: 10px 16px; min-height: 48px; font-size: 16px; border-radius: 10px; }
.btn.warn { background: var(--signal); color: #fff; }
.btn.light { background: var(--surface); color: var(--ink); margin-top: 10px; }
.tile.live { border-color: var(--signal); background: var(--signal-bg); }
.search { width: 100%; padding: 14px 16px; min-height: 56px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 18px; margin: 12px 0; }
label.f textarea { font-weight: 400; font-size: 18px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); resize: vertical; }

/* Winterdienst */
.wbar { background: var(--ink); color: var(--bg); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; font-size: 17px; }
.wbar b { font-size: 24px; }
.wprog { height: 12px; background: rgba(255,255,255,.2); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.wprog i { display: block; height: 100%; background: var(--salbei); }
.street { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.street > button { display: flex; width: 100%; justify-content: space-between; align-items: center; border: 0; background: none; padding: 16px; min-height: 60px; text-align: left; font-size: 19px; font-weight: 600; }
.street .cnt { font-size: 16px; color: var(--muted); font-weight: 500; }
.street .cnt.full { color: var(--done); font-weight: 700; }
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 0 12px 12px; }
.door { border: 2px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 8px; min-height: 72px; font-size: 20px; font-weight: 700; text-align: center; }
.door small { display: block; font-weight: 500; font-size: 14px; color: var(--muted); }
.door[aria-pressed="true"] { border-color: var(--done); background: var(--done-bg); }
.door[aria-pressed="true"] small { color: var(--done); }

/* Aufgaben und Fotos */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.card h3 { margin: 0 0 4px; font-size: 21px; }
.late { color: var(--signal); font-weight: 600; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.photos .ph { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--line); display: grid; place-items: center; font-size: 13px; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 999px; width: 30px; height: 30px; background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; }
.addph { display: grid; place-items: center; width: 96px; height: 96px; border: 2px dashed var(--muted); border-radius: 10px; color: var(--muted); font-weight: 600; cursor: pointer; }
.addph input { display: none; }

/* Grünpflege */
.objlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.obj { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-height: 96px; }
.obj .we { font-size: 14px; color: var(--muted); }
.obj .nm { font-size: 22px; line-height: 1.15; margin: 2px 0 8px; }
.gp { display: inline-block; font-size: 14px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin: 2px 4px 2px 0; background: var(--line); }
.gp.gruen { background: var(--done-bg); color: var(--done); }
.gp.gelb { background: #FBF1C7; color: #7A5B00; }
.gp.rot { background: var(--signal-bg); color: var(--signal); }
.gp.neu { background: var(--bg); color: var(--muted); border: 1px dashed var(--muted); }
.gp.pause { background: var(--bg); color: var(--muted); }
:root[data-theme="dark"] .gp.gelb { background: #3A3214; color: #F2D36B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gp.gelb { background: #3A3214; color: #F2D36B; } }
.angef { display: block; width: 100%; text-align: left; border: 0; border-left: 5px solid var(--signal); background: var(--signal-bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; font-size: 16px; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ptile { position: relative; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px 14px 58px; min-height: 100px; }
.ptile .box { position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border: 2px solid var(--muted); border-radius: 8px; display: grid; place-items: center; font-weight: 800; }
.ptile[aria-pressed="true"] { border-color: var(--done); background: var(--done-bg); }
.ptile[aria-pressed="true"] .box { background: var(--done); border-color: var(--done); color: var(--surface); }
.ptile .t { font-weight: 700; font-size: 19px; line-height: 1.2; }
.ptile .c { font-size: 15px; color: var(--muted); margin-top: 2px; }
.ptile .season { font-size: 14px; color: var(--signal); }
.fertigzeile { padding: 10px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.uhr { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.chip.big { font-size: 20px; }
.arten { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.art { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px; min-height: 80px; }
.art[aria-pressed="true"] { border-color: var(--signal); background: var(--signal-bg); }
.art b { display: block; font-size: 18px; }
.art span { font-size: 15px; color: var(--muted); }
.log { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.log li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }

/* Baustellen */
.bar { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--done); }
.bar.over i { background: var(--signal); }
.amrow { display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.amfeld { display: flex; align-items: center; gap: 6px; }
.amfeld input { font-size: 19px; padding: 12px; min-height: 52px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); width: 100%; text-align: right; }
.amfeld span { min-width: 40px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; overflow: hidden; width: 160px; }
.thumb img, .thumbleer { display: block; width: 100%; height: 112px; object-fit: cover; background: #fff; }
.thumbleer { display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.thumb span { display: block; font-size: 14px; padding: 6px 8px; }
.skwrap { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; touch-action: none; }
.skwrap canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.swatch { width: 48px; height: 48px; border-radius: 999px; border: 3px solid var(--line); padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
@media (max-width: 600px) { .amrow { grid-template-columns: 1fr; } }
