:root {
  --red: #a3261f; --red-soft: #f7e8e6; --ink: #2d2420; --muted: #75685f;
  --bg: #f6f3ee; --card: #ffffff; --line: #e6dfd6;
  --green: #2f7a4a; --green-soft: #e5f2ea; --amber: #a86d12; --amber-soft: #fbf1df;
  --turq: #4f8f8c; --turq-soft: #e6f2f1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(45, 36, 32, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.over { color: var(--red); }

#app { max-width: 680px; margin: 0 auto; min-height: 100vh; }
#app.has-tabs main { padding-bottom: 150px; }
main { padding: 4px 16px 110px; }

/* Probe-Leiste */
.proto { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 6px 16px; font-size: 13px; background: var(--amber-soft); border-bottom: 1px dashed #e2c48f; color: #6b4a12; }
.proto-tag { font-weight: 600; letter-spacing: .02em; }
.proto select { font-size: 13px; padding: 3px 6px; border-radius: 8px; border: 1px solid #e2c48f; background: #fffaf0; max-width: 220px; }

/* Kopf */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 10px 16px; background: rgba(246, 243, 238, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: auto; mix-blend-mode: multiply; }
.brand span { font-family: var(--serif); font-size: 21px; letter-spacing: .32em; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px;
  border: 0; border-radius: 10px; background: transparent; }
.icon-btn:hover { background: rgba(0, 0, 0, .05); }
.icon-btn.lang { font-size: 13px; font-weight: 600; letter-spacing: .04em; border: 1px solid var(--line); height: 32px; min-width: 40px; margin-top: 4px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font: 600 11px/18px var(--sans); font-style: normal; text-align: center; }

/* Reiter unten */
.tabs { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--n), 1fr);
  max-width: 680px; margin: 0 auto; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px;
  border: 0; background: none; color: var(--muted); font-size: 11.5px; }
.tab .ic { width: 23px; height: 23px; }
.tab.on { color: var(--red); font-weight: 600; }
.tab .badge { top: 3px; right: calc(50% - 24px); }

/* Überschriften */
.hello { margin: 18px 0 6px; }
.hello h1, h1.page { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0; }
h1.page { margin: 18px 0 8px; }
.hello p { margin: 2px 0 0; color: var(--muted); }
.lead { margin: 0 0 14px; color: var(--muted); }
section { margin-top: 22px; }
section h2, .done-list summary { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 11px; background: #ebe5dd; color: var(--muted);
  font-size: 12px; font-weight: 600; text-align: center; }
.sec-over h2 { color: var(--red); }
.sec-over h2 .count { background: var(--red-soft); color: var(--red); }
.summary { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; }
.card.pad { padding: 14px; }
.card.task, .card.need { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; }
.card.task.is-over { border-left: 4px solid var(--red); padding-left: 11px; }
.card.task.is-done, .card.is-done { opacity: .62; }
.card .body { flex: 1; min-width: 0; }
.card.task .body { cursor: pointer; }
.title { font-weight: 600; overflow-wrap: anywhere; }
.imp-ic { width: 16px; height: 16px; color: var(--amber); fill: var(--amber); stroke: var(--amber); vertical-align: -2px; margin-right: 4px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta .ic { width: 14px; height: 14px; }
.due.over { color: var(--red); font-weight: 600; }
.note { margin: 6px 0 0; white-space: pre-wrap; font-size: 14px; }
.check { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c9bfb4; background: #fff; padding: 0; }
.check:hover { border-color: var(--green); background: var(--green-soft); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check.on .ic { width: 16px; height: 16px; stroke-width: 2.6; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 11px;
  border: 1px solid var(--line); background: #fff; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #cfc5b9; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: #8d1f19; }
.btn.ok { color: var(--green); border-color: #bcdcc7; background: var(--green-soft); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.small { padding: 6px 11px; font-size: 13.5px; border-radius: 9px; }
.btn.small .ic { width: 16px; height: 16px; }
.btn.wide { width: 100%; margin-top: 14px; }
.fab { position: fixed; z-index: 9; right: max(16px, calc(50% - 324px)); bottom: 86px; display: inline-flex; align-items: center; gap: 6px;
  padding: 13px 18px 13px 14px; border: 0; border-radius: 28px; background: var(--red); color: #fff; font-weight: 650;
  box-shadow: 0 4px 14px rgba(163, 38, 31, .35); }
#app:not(.has-tabs) .fab { bottom: 24px; }

/* Filter-Chips */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; margin: 0 -16px 4px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 18px;
  border: 1px solid var(--line); background: #fff; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: inline-flex; margin-top: 12px; padding: 3px; border-radius: 12px; background: #ebe5dd; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
  min-height: 72px; padding: 12px 14px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; font-weight: 600; box-shadow: var(--shadow); }
.tile:hover { border-color: #cfc5b9; }
.tile small { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.tile-free { border-style: dashed; background: transparent; }
.tile.has.missing { border-color: #e5b3ad; background: var(--red-soft); }
.tile.has.ordered { border-color: #e9cf9e; background: var(--amber-soft); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 11.5px; font-weight: 600; font-style: normal; }
.tag.missing { background: var(--red); color: #fff; }
.tag.ordered { background: var(--amber); color: #fff; }
.tag.ph { background: #efe9e1; color: var(--muted); border: 1px dashed #cfc5b9; margin-left: 6px; }

/* Kennzahlen */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; text-align: left; box-shadow: var(--shadow); }
.stat b { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.over b { color: var(--red); }
.stat.ok b { color: var(--green); }

/* Listen-Zeilen */
.card.list { overflow: hidden; }
.card.list.flat { border: 0; box-shadow: none; background: none; margin: 0; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #faf8f5; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; }
.row-main .ic { display: inline; vertical-align: -4px; margin-right: 6px; }
.row-main small { font-weight: 400; font-size: 13px; color: var(--muted); }
.row-sub { font-size: 13px; color: var(--muted); }
.row > .ic:last-child { width: 16px; height: 16px; color: #b9aea3; }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--turq-soft); color: var(--turq);
  font-size: 13px; font-weight: 700; }
.avatar.ph { background: #f1ece5; color: var(--muted); border: 1px dashed #cfc5b9; }
.lang-code { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* Meldungen */
.card.report { display: flex; gap: 12px; padding: 12px 14px; }
.thumb { flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.route { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius);
  background: var(--turq-soft); color: #2f5f5d; font-size: 14.5px; }
.route .ic { margin-top: 2px; }

.empty { display: flex; flex-direction: column; align-items: center; padding: 40px 16px; color: var(--muted); text-align: center; }
.empty .ic { width: 40px; height: 40px; color: var(--green); }
.empty.small { padding: 14px; }
.empty p { margin: 8px 0 0; }
.done-list { margin-top: 22px; }
.done-list summary { cursor: pointer; list-style: none; color: var(--muted); }
.done-list summary::-webkit-details-marker { display: none; }
.done-list summary::before { content: "▸"; font-size: 12px; }
.done-list[open] summary::before { content: "▾"; }

/* Fenster */
#sheet { display: none; }
#sheet.open { display: block; }
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(35, 28, 24, .38); }
.sheet { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; margin: 0 auto; max-width: 680px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--bg);
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .15); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) {
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 560px; transform: translate(-50%, -50%); border-radius: 20px; max-height: 86vh; animation: none; }
}
.sheet-x { position: absolute; top: 10px; right: 10px; }
.sheet-title { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 2px 44px 10px 0; }
.sheet.photo { padding: 12px; }
.full { display: block; width: 100%; border-radius: 12px; }
.hint { margin: -4px 0 12px; color: var(--muted); font-size: 14px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sheet-actions .btn.primary { flex: 1 1 auto; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 6px; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.checklist { margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.cl-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cl-item:last-child { border-bottom: 0; }
.cl-item input { width: 20px; height: 20px; accent-color: var(--green); }

/* Formulare */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.field input:not([type=checkbox]), .field select, .field textarea, .cl-add input, .cl-row input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.field input:focus, .field select:focus, .field textarea:focus, .cl-add input:focus, .cl-row input:focus { outline: 2px solid rgba(163, 38, 31, .25); border-color: var(--red); }
.field textarea { resize: vertical; }
.due-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.due-row input { flex: 1 1 160px; }
.more { margin: 4px 0 8px; padding: 0 2px; }
.more summary { cursor: pointer; padding: 8px 0 12px; font-weight: 600; color: var(--red); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "＋ "; }
.more[open] summary::before { content: "－ "; }
.wd { display: flex; flex-wrap: wrap; gap: 6px; }
.wd .chip { padding: 6px 10px; }
.wd input { margin: 0 4px 0 0; accent-color: var(--red); }
.cl-row, .cl-add { display: flex; gap: 6px; margin-bottom: 6px; }
.toggle { display: flex; gap: 10px; align-items: center; margin: 4px 0 8px; font-weight: 600; }
.toggle input { width: 20px; height: 20px; accent-color: var(--amber); }
.photo-btn { cursor: pointer; }
.preview { display: block; max-width: 100%; max-height: 180px; margin-top: 8px; border-radius: 10px; }

/* Hinweis unten */
#toast { position: fixed; z-index: 30; left: 50%; bottom: 84px; transform: translate(-50%, 20px); display: flex; align-items: center; gap: 14px;
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; background: #2d2420; color: #fff; font-size: 14.5px;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: 0; background: none; color: #f3b9b3; font-weight: 700; padding: 0; }
.row-main .tag { align-self: flex-start; margin: 2px 0 1px; }

/* Erledigt-Ansicht */
.seg .count { margin-left: 4px; background: rgba(0, 0, 0, .06); }
.seg.tv { display: flex; width: fit-content; }
.chips + .seg { margin-top: 4px; }
.done-hint { margin: 12px 0 0; }

/* Material: Listen-Zeichen */
.tag.list { background: var(--turq-soft); color: var(--turq); }
.edit-list { margin-top: 10px; }
h1.page + .btn.small { margin-bottom: 4px; }

/* Listen bearbeiten */
.li-row { padding: 8px 10px 8px 14px; }
.li-main { flex: 1; min-width: 0; display: flex; border: 0; background: none; padding: 4px 0; text-align: left; }
.li-add { margin-top: 10px; }
.li-add .btn { flex: none; }

/* Betrieb mit Server: Funkloch-Hinweis, Anmeldung, Ich, PIN */
.sync { padding: 7px 16px; font-size: 13px; background: var(--amber-soft); border-bottom: 1px solid #e9cf9e; color: #6b4a12; }
.me-btn { padding: 0 2px; }
.avatar.small { width: 30px; height: 30px; font-size: 11.5px; }
.login-page { display: flex; align-items: flex-start; justify-content: center; }
.login { width: 100%; max-width: 420px; padding: 32px 16px 40px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 18px; }
.login-brand img { width: 52px; height: auto; mix-blend-mode: multiply; }
.login-brand span { font-family: var(--serif); font-size: 30px; letter-spacing: .32em; }
.login-langs { justify-content: center; margin: 0 0 6px; }
.login .card { margin-top: 6px; }
.login-msg { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 14.5px; font-weight: 600; }
.login-hint { margin-top: 14px; text-align: center; }
.login input[name=pin] { letter-spacing: .3em; font-size: 20px; }
.pin-box { margin-top: 26px; padding-top: 6px; border-top: 1px solid var(--line); }
.pin-box .hint { margin: 0 0 10px; }
.pin-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.pin-row input { flex: 1 1 130px; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 18px; letter-spacing: .25em; }
.ok-text { color: var(--green); font-weight: 600; margin: 0; }
.push-box p { margin: 0; }
.push-box .actions { margin-top: 12px; }
