:root {
  --bg: #f3f7f8; --panel: #fff; --ink: #111; --muted: #66757a; --line: #d6e1e3;
  --accent: #1b9aaa; --accent-ink: #fff; --brand: #2ab7c6; --auto: #eef1f4; --warn-bg: #fdecec; --warn: #b42318;
  --ok-bg: #e8f5ec; --ok: #1e7a3c; --today: #fff6cc; --weekend: #eceff3; --blocked: #fbe1e1;
  --b1: #e7f0fa; --b2: #eef7ea; --b3: #f2f2f2; --b4: #fbf0e4; --b5: #efeafa; --b6: #e9f6f6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d; --panel: #1c2229; --ink: #e5e9ee; --muted: #93a0ae; --line: #303a45;
    --accent: #3cc3d2; --accent-ink: #061a1d; --brand: #3cc3d2; --auto: #252d36; --warn-bg: #3a1f1f; --warn: #ff8f85;
    --ok-bg: #1d3325; --ok: #7fd49b; --today: #3d3720; --weekend: #20262d; --blocked: #3a2326;
    --b1: #1d2836; --b2: #1f2b22; --b3: #22262b; --b4: #2f281f; --b5: #26213a; --b6: #1c2d2d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 15px; margin: 16px 0 8px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

.top { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.top { border-bottom: 3px solid var(--brand); }
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; }
.logo-img { height: 34px; width: auto; display: block; }
.logo-text { display: inline-flex; align-items: flex-end; gap: 2px; font-size: 22px; letter-spacing: 1px; line-height: 1; color: var(--ink); }
.logo-text b { font-weight: 800; }
.logo-text span { font-weight: 300; }
.logo-mark { width: 34px; height: 28px; color: var(--brand); margin-right: 4px; }
.login-logo { text-align: center; margin-bottom: 12px; }
.login-logo .logo-img { height: 90px; margin: 0 auto; }
.login-logo .logo-text { font-size: 40px; }
.login-logo .logo-mark { width: 64px; height: 52px; }
.login h1 { text-align: center; font-weight: 300; color: var(--muted); }
@media (prefers-color-scheme: dark) { .logo-img { filter: invert(1) hue-rotate(180deg); } }
.top nav { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; }
.top nav { gap: 2px 4px; align-items: center; }
.top nav a { text-decoration: none; padding: 4px 8px; border-radius: 5px; color: var(--ink); }
.top nav a:hover { background: var(--auto); }
.top nav a.active { background: var(--brand); color: #fff; }
.top nav .sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.me { display: flex; gap: 10px; align-items: center; }
main { padding: 12px 16px 40px; max-width: 100%; }
.foot { color: var(--muted); font-size: 11px; padding: 8px 16px; }

.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.button, button { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); text-decoration: none; cursor: pointer; font: inherit; }
.button.primary, button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { background: var(--warn); color: #fff; border-color: var(--warn); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select, textarea { font: inherit; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); color: var(--ink); max-width: 100%; }
input:disabled, select:disabled, textarea:disabled { background: var(--auto); color: var(--ink); }

.flash { padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--warn-bg); color: var(--warn); }
.flash.warn { background: var(--today); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 10px 0; }
.card.narrow { max-width: 560px; }
.card.danger { border-color: var(--warn); }
.card label, .login label { display: block; margin-bottom: 10px; }
.card label input:not([type=checkbox]), .card label select, .card label textarea { display: block; width: 100%; margin-top: 3px; }
.check input { margin-right: 6px; }
.login { max-width: 380px; margin: 60px auto; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }

.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.tile b { font-size: 22px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); max-height: 75vh; }
table.grid { border-collapse: collapse; width: 100%; background: var(--panel); }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 5px 7px; text-align: left; vertical-align: top; }
.grid th { background: var(--auto); position: sticky; top: 0; font-weight: 600; font-size: 12px; z-index: 1; }
.grid td:first-child, .grid td[data-sort], .plan td:first-child { white-space: nowrap; }
.grid.small td, .grid.small th { font-size: 12px; padding: 3px 6px; }
.sortable th { cursor: pointer; user-select: none; }
.sortable th.asc::after { content: " ▲"; } .sortable th.desc::after { content: " ▼"; }
.num { text-align: right; }
td.zero { color: var(--muted); }
.warnrow td { background: var(--warn-bg); }
tr.cancelled td { color: var(--muted); text-decoration: line-through; }
tr.inactive td { color: var(--muted); }
td.old { color: var(--warn); } td.new { color: var(--ok); }
td.hint { max-width: 320px; font-size: 12px; }
th.pos { min-width: 90px; }
.plan tr.weekend td { background: var(--weekend); }
.plan tr.blocked td { background: var(--blocked); }
.plan tr.today td { background: var(--today); font-weight: 600; }
.kv th { text-align: left; padding: 3px 12px 3px 0; color: var(--muted); font-weight: normal; vertical-align: top; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--auto); white-space: nowrap; }
.st-Anfrage { background: #e3e8ef; color: #334; }
.st-beauftragt { background: #dbe9fb; color: #164a85; }
.st-Spender-offen, .st-Transport-offen { background: #fff0c2; color: #6b4e00; }
.st-geplant { background: #d6f2df; color: #155c2e; }
.st-abzurechnen { background: #ffd9b3; color: #7a3d00; }
.st-abgerechnet { background: #e2e2e2; color: #444; }
.st-Storno { background: #f6d2d2; color: #8a1c1c; }
.badge.locked { background: #333; color: #fff; }

form.order .block, section.block { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.block h2 { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.block h2 .no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
.block h2 .who { color: var(--muted); font-weight: normal; font-size: 12px; }
.b1 { border-left: 5px solid #6aa0d8 !important; } .b2 { border-left: 5px solid #7fbf6a !important; }
.b3 { border-left: 5px solid #9aa4ae !important; } .b4 { border-left: 5px solid #e0a35a !important; }
.b5 { border-left: 5px solid #9d86d6 !important; } .b6 { border-left: 5px solid #5bb5b5 !important; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 14px; }
.fld { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); position: relative; }
.fld input, .fld select, .fld textarea, .fld output { color: var(--ink); font-size: 14px; }
.fld.wide { grid-column: span 2; }
.fld input[type=checkbox] { align-self: flex-start; width: 18px; height: 18px; }
.fld .wd { position: absolute; right: 36px; bottom: 7px; font-size: 12px; color: var(--muted); pointer-events: none; }
.fld.auto output { background: var(--auto); padding: 5px 7px; border-radius: 5px; min-height: 30px; }
.billing td, .billing th { text-align: center; }
fieldset.reason { border: 1px dashed var(--accent); border-radius: 6px; margin: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; }
fieldset.reason input { flex: 1; min-width: 220px; }
.req { color: var(--warn); font-size: 12px; }
.actions { margin-top: 10px; }
.signform { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 10px; }
.sign { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sign p { flex-basis: 100%; margin: 0; }
details.history { margin: 12px 0; }
details.history summary { cursor: pointer; color: var(--accent); }
input.qty { width: 70px; }
.tablefilter { margin: 6px 0; width: 280px; }

/* Workflow */
ol.progress { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 4px 0 10px; counter-reset: st; }
ol.progress li { counter-increment: st; }
ol.progress li a { display: block; padding: 4px 10px; border-radius: 14px; background: var(--auto); color: var(--muted); text-decoration: none; font-size: 12px; }
ol.progress li a::before { content: counter(st) ". "; }
ol.progress li.done a { background: var(--ok-bg); color: var(--ok); }
ol.progress li.done a::after { content: " ✔"; }
ol.progress li.current a { background: var(--brand); color: #fff; font-weight: 600; }
nav.steptabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--brand); margin: 8px 0 0; }
nav.steptabs a { padding: 6px 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; text-decoration: none; color: var(--ink); background: var(--panel); }
nav.steptabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
nav.steptabs .no { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--auto); color: var(--ink); font-size: 11px; }
.b7 { border-left: 5px solid #333 !important; }
.gate { border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 12px; margin: 12px 0; background: var(--bg); }
.gate.done { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.gate h3 { margin: 0 0 6px; font-size: 14px; }
.gate summary { cursor: pointer; color: var(--warn); }
ul.todo { margin: 4px 0; color: var(--warn); }
ul.checklist { list-style: none; padding: 0; margin: 4px 0; }
ul.checklist li::before { content: "☐ "; color: var(--warn); }
ul.checklist li.ok::before { content: "☑ "; color: var(--ok); }
ul.checklist li.ok { color: var(--muted); }
.hint { background: var(--today); padding: 6px 10px; border-radius: 6px; }
form.upload, form.inlineform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
details.replace form { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
tr.resp-zugesagt td { background: var(--ok-bg); }
form.takeover { display: flex; flex-direction: column; gap: 4px; min-width: 190px; }
form.takeover label, form.inlineform label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
tr.resp-abgesagt td { color: var(--muted); }
/* Kalender */
:root { --ev-vu: #7b5cd6; --ev-mob: #e08a1e; --ev-abnahme: #d64545; --ev-transport: #2f7fd1; --ev-lieferung: #1e9c5a; }
.calnav { display: flex; gap: 6px; }
label.calfilter { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px; border-left: 4px solid; background: var(--panel); }
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--panel); }
table.cal th { background: var(--auto); padding: 4px; font-size: 12px; }
table.cal td { border: 1px solid var(--line); vertical-align: top; height: 110px; padding: 2px 3px; overflow: hidden; }
table.cal th.kw, table.cal td.kw { width: 34px; text-align: center; color: var(--muted); font-size: 11px; vertical-align: middle; }
table.cal td.other { opacity: .45; }
table.cal td.weekend { background: var(--weekend); }
table.cal td.blocked { background: var(--blocked); }
table.cal td.today { outline: 2px solid var(--brand); outline-offset: -2px; }
table.cal td.today .dnum { color: var(--brand); font-weight: 700; }
.dnum { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.dnum .hol { font-weight: normal; color: var(--warn); font-size: 10px; margin-left: 3px; }
a.ev { display: block; font-size: 11px; line-height: 1.25; margin: 1px 0; padding: 1px 4px; border-radius: 3px; color: #fff;
       text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.ev:hover { white-space: normal; position: relative; z-index: 2; }
a.ev.done { opacity: .6; }
a.ev.warn { box-shadow: inset 0 0 0 2px #ff3b30; }
.ev-vu { --c: var(--ev-vu); } .ev-mob { --c: var(--ev-mob); } .ev-abnahme { --c: var(--ev-abnahme); }
.ev-transport { --c: var(--ev-transport); } .ev-lieferung { --c: var(--ev-lieferung); }
.ev-sp_vu { --c: #a58ce6; } .ev-sp_spende { --c: #e07a7a; }
a.ev.ev-sp_vu, a.ev.ev-sp_spende { background: repeating-linear-gradient(135deg, var(--c), var(--c) 6px, color-mix(in srgb, var(--c) 80%, #000) 6px, color-mix(in srgb, var(--c) 80%, #000) 12px); }
a.ev { background: var(--c); } label.calfilter { border-left-color: var(--c); }
.dnum a, table.cal.week th a { color: inherit; text-decoration: none; }
.dnum a:hover, table.cal.week th a:hover { color: var(--brand); text-decoration: underline; }
section.dayview { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-width: 1000px; }
section.dayview.weekend { background: var(--weekend); }
section.dayview.blocked { background: var(--blocked); }
.dayflags { margin: 0 0 10px; display: flex; gap: 6px; }
article.daycard { display: grid; grid-template-columns: 170px 1fr; border: 1px solid var(--line); border-left: 6px solid var(--c);
                  border-radius: 8px; background: var(--panel); margin-bottom: 10px; overflow: hidden; }
article.daycard.done { opacity: .75; }
article.daycard.warn { box-shadow: 0 0 0 2px #ff3b30; }
.daycard .dc-type { background: var(--c); color: #fff; padding: 10px; font-weight: 600; font-size: 13px; }
.daycard .dc-main { padding: 8px 12px; }
.daycard h3 { margin: 0 0 6px; font-size: 15px; }
.daycard table.kv th { width: 120px; }
@media (max-width: 700px) { article.daycard { grid-template-columns: 1fr; } }
.calnav .seg { display: inline-flex; margin-right: 8px; }
.calnav .seg .button { border-radius: 0; }
.calnav .seg .button:first-child { border-radius: 6px 0 0 6px; }
.calnav .seg .button:last-child { border-radius: 0 6px 6px 0; }
.calnav .seg .button + .button { border-left: 0; }
.calnav .button.active { background: var(--brand); color: #fff; border-color: var(--brand); pointer-events: none; }
table.cal td.kw a { color: var(--muted); text-decoration: none; display: block; padding: 20px 0; }
table.cal td.kw a:hover { color: var(--brand); text-decoration: underline; }
table.cal.week td { height: 420px; padding: 4px; }
table.cal.week th { font-size: 13px; }
table.cal.week .dhead { font-weight: normal; color: var(--muted); }
table.cal.week a.ev { white-space: normal; font-size: 12px; line-height: 1.35; padding: 4px 6px; margin: 0 0 5px; border-radius: 5px; }
table.cal.week .evtype { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; opacity: .9; }
table.cal.week .evdonor { font-size: 11px; opacity: .95; }
@media (max-width: 760px) {
  table.cal.week, table.cal.week thead, table.cal.week tbody, table.cal.week tr, table.cal.week td, table.cal.week th { display: block; width: 100%; height: auto; }
  table.cal.week thead { display: none; } }
a.ev.inline { display: inline-block; max-width: 100%; vertical-align: middle; }
.okc { color: var(--ok); }
tr.blockedrow td { color: var(--muted); background: var(--auto); }
.blocked { color: var(--warn); font-size: 12px; }
.info h2 { margin-top: 20px; }
.info table.kv td, .info table.kv th { padding: 4px 12px 4px 0; }
.letter { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Consolas, monospace; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; max-width: 900px; }
.badge.prelim { background: #ffe1a8; color: #6b4300; }
.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.task { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 8px 12px; }
.task h3 { margin: 0 0 6px; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.task h3 .no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; }
.task ul { margin: 0; padding-left: 18px; }
.task .warn { color: var(--warn); }

@media (max-width: 700px) {
  .fld.wide { grid-column: span 1; }
  main { padding: 8px 16px 40px; }
}
/* Nächster Schritt */
a.nextstep { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 10px 14px; border-radius: 8px;
             text-decoration: none; border: 2px solid var(--brand); background: var(--panel); color: var(--ink); }
a.nextstep.mine { background: var(--brand); color: #fff; }
a.nextstep .ns-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
a.nextstep .ns-text { font-size: 16px; font-weight: 600; flex: 1; }
a.nextstep .ns-go { font-size: 20px; }
a.nextstep .ns-who { font-size: 12px; color: var(--muted); }
a.nextstep.mine:hover { filter: brightness(1.08); }
.target-hl { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; transition: outline-color 1s; }

/* Verschieben per Ziehen */
a.ev.movable { cursor: grab; }
a.ev.movable::before { content: "⇄ "; opacity: .8; }
body.dragging table.cal td[data-date] { transition: background .1s; }
table.cal td.drop-hl { background: color-mix(in srgb, var(--brand) 25%, var(--panel)) !important; outline: 2px dashed var(--brand); outline-offset: -3px; }
dialog#move-dialog { border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; max-width: 560px; width: 92vw;
                     background: var(--panel); color: var(--ink); }
dialog#move-dialog::backdrop { background: rgba(0,0,0,.35); }
dialog#move-dialog form:not([hidden]) + .actions { display: none; }

/* Spendersuche: Antwort-Schnellknöpfe, Anruf-Links */
form.respform { display: flex; flex-direction: column; gap: 4px; }
form.respform .quick { display: flex; flex-wrap: wrap; gap: 4px; }
button.q { padding: 4px 10px; border-radius: 14px; font-size: 12px; }
button.q.on.q-zugesagt { background: var(--ok); color: #fff; border-color: var(--ok); }
button.q.on.q-abgesagt { background: var(--warn); color: #fff; border-color: var(--warn); }
button.q.on.q-keine-Antwort { background: var(--muted); color: #fff; border-color: var(--muted); }
button.implicit { display: none; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.more[open] { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
details.more[open] summary { flex-basis: 100%; }
a.tel { white-space: nowrap; text-decoration: none; margin-right: 8px; }
.selcount { font-weight: 600; color: var(--muted); }
.selcount.has { color: var(--brand); }
tr.picked td { background: color-mix(in srgb, var(--brand) 12%, var(--panel)); }
.menu-toggle { display: none; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px; }            /* kein Auto-Zoom auf iOS */
  .top { position: static; padding: 8px 12px; gap: 8px; }
  .menu-toggle { display: inline-block; margin-left: auto; padding: 8px 12px; }
  .top nav, .top .me { display: none; flex-basis: 100%; }
  body.nav-open .top nav { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
  body.nav-open .top nav a { padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  body.nav-open .top nav .sep { display: none; }
  body.nav-open .top .me { display: flex; flex-wrap: wrap; justify-content: space-between; padding-top: 8px; }
  main { padding: 8px 12px 90px; }
  h1 { font-size: 18px; }
  .head { align-items: flex-start; }
  ol.progress, nav.steptabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  ol.progress li, nav.steptabs a { flex: 0 0 auto; }
  nav.steptabs a { padding: 8px 10px; }
  .fields { grid-template-columns: 1fr; }
  .fld.wide { grid-column: span 1; }
  a.nextstep .ns-text { font-size: 15px; }
  button, .button { min-height: 40px; }

  /* Tabellen als Karten */
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { position: relative; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 8px 10px;
                   background: var(--panel); }
  table.cards td { border: 0; padding: 3px 0; display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
  table.cards td[data-label]::before { content: attr(data-label); flex: 0 0 115px; color: var(--muted); font-size: 12px; }
  table.cards td[data-label=""]::before { display: none; }
  table.cards td:empty { display: none; }
  table.cards td.card-title { font-size: 16px; font-weight: 600; padding-right: 48px; display: block; }
  table.cards td.card-title::before { display: none; }
  table.cards td.pick { position: absolute; top: 6px; right: 8px; width: auto; padding: 0; }
  table.cards td.pick input { width: 30px; height: 30px; }
  table.cards tr.blockedrow { opacity: .7; }
  table.cards td.blocked:empty, table.cards td.blocked:has(:empty) { display: none; }
  form.respform .quick { flex-wrap: nowrap; }
  button.q { padding: 10px 4px; font-size: 13px; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.cards td[data-label="Antwort"] { display: block; }
  table.cards td[data-label="Antwort"]::before { display: block; margin-bottom: 4px; }
  a.tel { display: inline-block; padding: 6px 10px; border: 1px solid var(--line); border-radius: 18px; margin: 2px 6px 2px 0; }
  form.takeover button { width: 100%; }
  .tablefilter { width: 100%; }
  .stickybar { position: sticky; bottom: 0; z-index: 5; background: var(--panel); border-top: 2px solid var(--brand);
               margin: 0 -12px; padding: 8px 12px; box-shadow: 0 -4px 12px rgba(0,0,0,.12);
               display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }
  .stickybar label { font-size: 0; }                       /* Beschriftung ausblenden, Feld bleibt */
  .stickybar label input { width: 100%; font-size: 16px; }
  .stickybar input[name=note] { display: none; }
  .stickybar .selcount { order: 3; }
  .stickybar button { order: 4; }
  /* Spendersuche: Spender zuerst, Organisator/Kontaktdatum ans Ende */
  section.b2.suche { display: flex; flex-direction: column; }
  section.b2.suche > form.suche-meta { order: 99; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
}

/* Kalender: Filter-Klappe, Handy-Tageskopf, Verschieben-Formular */
details.calfilters > summary { cursor: pointer; color: var(--accent); margin: 4px 0; font-size: 13px; }
a.mday { display: none; }
details.moveform { margin-top: 8px; }
details.moveform summary { cursor: pointer; color: var(--accent); font-size: 13px; }
details.moveform form { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; margin-top: 6px; }
details.moveform label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  .calnav { flex-wrap: wrap; gap: 4px; width: 100%; }
  .calnav .seg { flex: 1 1 100%; margin: 0 0 2px; }
  .calnav .seg .button { flex: 1 1 0; text-align: center; }
  .calnav > .button { flex: 1 1 0; text-align: center; padding: 6px 4px; font-size: 13px; }
  .calnav [data-print] { display: none; }
  .head h1 .muted { display: block; font-size: 14px; }
  details.calfilters .filters { flex-direction: column; align-items: stretch; }
  details.calfilters label.calfilter { padding: 8px 10px; }

  /* Woche: Tage untereinander mit eigenem Tageskopf */
  table.cal.week td { height: auto; padding: 0 0 6px; border: 0; border-bottom: 1px solid var(--line); }
  table.cal.week td.today { outline: none; }
  a.mday { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px; font-weight: 600;
           color: var(--ink); text-decoration: none; position: sticky; top: 0; background: var(--bg); z-index: 1; }
  table.cal.week td.today a.mday { color: var(--brand); }
  a.mday .mcount { background: var(--auto); border-radius: 10px; padding: 0 8px; font-size: 12px; color: var(--muted); }
  table.cal.week td.empty a.mday { font-weight: normal; color: var(--muted); padding: 5px 4px; }
  table.cal.week td.empty > p, table.cal.week td .dnum:empty { display: none; }
  table.cal.week td.weekend a.mday { color: var(--muted); }
  table.cal.week a.ev { font-size: 14px; padding: 8px 10px; margin: 0 0 6px; }
  table.cal.week a.ev.movable::before { content: ""; }

  /* Monat: kompakte Farbbalken, Tippen öffnet den Tag */
  table.cal:not(.week) th.kw, table.cal:not(.week) td.kw { display: none; }
  table.cal:not(.week) td { height: 58px; padding: 2px; cursor: pointer; }
  table.cal:not(.week) .dnum .hol { display: none; }
  table.cal:not(.week) a.ev { font-size: 0; height: 5px; padding: 0; margin: 2px 0; border-radius: 3px; pointer-events: none; }
  table.cal:not(.week) a.ev::before { content: none; }
  table.cal:not(.week) th { font-size: 11px; padding: 2px; }

  /* Tag: Karten untereinander */
  article.daycard .dc-type { padding: 6px 10px; }
  details.moveform form > * { flex: 1 1 100%; }
}

/* Formulare drucken */
.forms-box { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 8px 12px; margin: 12px 0; background: var(--bg); }
.forms-box h3 { margin: 0 0 4px; }
.forms-box .button { margin: 4px 6px 4px 0; }
@media (max-width: 760px) { .forms-box .button { display: block; text-align: center; margin: 6px 0; } }

/* Zertifikat einrichten */
.certpage { max-width: 980px; margin: 0 auto; }
.certpage h1 { text-align: center; }
.certtop { align-items: start; }
.button.big { font-size: 16px; padding: 12px 18px; }
code.fp { font-size: 11px; word-break: break-all; background: var(--auto); padding: 2px 4px; border-radius: 4px; }
.qrcard { text-align: center; }
.qrcard .qr svg, .qrcard .qr img { width: 220px; height: 220px; }
details.howto { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; margin: 8px 0; }
details.howto summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.howto li { margin: 6px 0; }
.certhint { text-align: center; }

/* Auftragsdetail */
.m-block { display: none; }
ul.billing-list { list-style: none; padding: 0; margin: 8px 0; }
ul.billing-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Übersicht / Listen */
.m-only, .m-cell, label.m-sort { display: none; }
td.avail .av { display: block; white-space: nowrap; }
td.card-title .badge { margin-left: 4px; }
@media (max-width: 760px) {
  /* Auftragsdetail am Handy */
  .m-block { display: block; }
  .d-block { display: none !important; }
  ol.progress { display: none; }
  h1 .muted { display: block; font-size: 14px; font-weight: normal; }
  table.cards td.hint { max-width: none; }
  .head h1 { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
  form.order .block, section.block { padding: 8px 10px; }
  .block h2 { flex-wrap: wrap; }
  .savebar { position: sticky; bottom: 0; z-index: 5; background: var(--panel); margin: 10px -10px -8px;
             padding: 8px 10px; border-top: 2px solid var(--brand); box-shadow: 0 -4px 12px rgba(0,0,0,.12);
             display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
  .savebar fieldset.reason { margin: 0; padding: 0; border: 0; display: block; }
  .savebar fieldset.reason legend { display: none; }
  .savebar fieldset.reason input[name=reason_text] { display: none; }
  .savebar fieldset.reason select { width: 100%; }
  .savebar .actions { margin: 0; }
  .gate form.signform > *, form.upload > *, .sign > * { flex: 1 1 100%; }
  table.cards tr { display: flex; flex-direction: column; }
  table.cards td.card-title { order: -1; }
  details.history summary { padding: 8px 0; }
  td.avail .av { display: inline; margin-right: 10px; }
  table.cards td.card-title a.ev, table.cards td a.ev.inline { font-size: 13px; padding: 3px 8px; }
}
a.taskline { color: inherit; text-decoration: none; }
a.taskline b { color: var(--accent); }
a.taskline:hover b { text-decoration: underline; }

@media (max-width: 760px) {
  .m-only { display: inline; }
  table.cards td.d-only, .d-only-inline { display: none !important; }
  table.cards td.m-cell { display: block; }
  table.cards td.m-cell:empty { display: none; }
  label.m-sort { display: flex; align-items: center; gap: 6px; margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
  label.m-sort select { flex: 1; }
  .scroll:has(> table.cards) { max-height: none; overflow: visible; border: 0; background: transparent; }
  form.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }
  form.filters input[name=q] { grid-column: 1 / -1; }
  form.filters select { min-width: 0; width: 100%; }
  table.cards tr.cancelled td.card-title { text-decoration: line-through; }
  table.cards tr.cancelled td { text-decoration: none; }
  .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { min-width: 0; padding: 8px 10px; flex-direction: row; justify-content: space-between; align-items: center; }
  .tile b { font-size: 20px; }
  .tile .badge { white-space: normal; }
  .tasks { grid-template-columns: 1fr; }
  .task ul { list-style: none; padding: 0; margin: 0; }
  .task li { border-top: 1px solid var(--line); }
  a.taskline { display: block; padding: 10px 2px; font-size: 14px; }
  table.cards tr.warnrow { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
  table.cards tr.warnrow td { background: transparent; }
  table.cards td.hinweis { display: block; color: var(--warn); font-size: 13px; padding-top: 4px; }
  table.cards td.card-title a { font-weight: 700; }
}

/* ---- Tablet-Protokolle (Voruntersuchung, Abnahme) ---------------------- */
.tablet { max-width: 1100px; margin: 0 auto; font-size: 16px; }
.tablet .button.big, .tablet button.big { font-size: 17px; padding: 14px 20px; min-height: 52px; }
.phead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.phead h1 { margin: 4px 0; font-size: 24px; }
.pmeta { margin: 2px 0; }
.pprog { min-width: 200px; text-align: right; font-size: 14px; color: var(--muted); }
.pprog .bar { height: 10px; background: var(--auto); border-radius: 5px; overflow: hidden; margin: 6px 0 4px; }
.pprog .bar span { display: block; height: 100%; background: var(--ok); }
.psecnav { position: sticky; top: 0; z-index: 6; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0;
           background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 8px; scrollbar-width: none; }
.psecnav a { white-space: nowrap; padding: 8px 12px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
             text-decoration: none; color: var(--ink); font-size: 14px; }
.psecnav a.fin { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
fieldset.psec, section.psec { border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
                              padding: 8px 16px 14px; margin: 0 0 14px; scroll-margin-top: 60px; }
fieldset.psec legend { font-size: 18px; font-weight: 700; color: var(--accent); padding: 0 6px; }
.pf { display: grid; grid-template-columns: minmax(200px, 38%) 1fr; gap: 6px 16px; align-items: center;
      padding: 10px 0; border-bottom: 1px solid var(--line); }
.pf:last-child { border-bottom: 0; }
.pf .pl { font-weight: 600; }
.pf .pl .ref { font-weight: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pf b.req { color: var(--warn); }
.pf.missing .pl::before { content: "●"; color: var(--warn); font-size: 10px; margin-right: 6px; vertical-align: middle; }
.pf input:not([type=radio]):not([type=checkbox]), .pf textarea, .pf select {
  font-size: 18px; padding: 10px 12px; min-height: 48px; width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.pf textarea { min-height: 80px; }
.pf .numrow { display: flex; gap: 8px; align-items: center; }
.pf .numrow input { max-width: 220px; }
.pf .unit { color: var(--muted); min-width: 50px; }
.pf button.now { min-height: 48px; padding: 0 16px; }
.pf .warn { grid-column: 2; color: var(--warn); font-size: 14px; }
.pf .warn:empty { display: none; }
.pf.oor input { border-color: var(--warn); background: var(--warn-bg); }
.pf .pv { font-size: 17px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-block; min-width: 92px; min-height: 48px; line-height: 48px; padding: 0 18px; text-align: center;
            border: 2px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 17px; user-select: none; }
.seg label.on span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
p.pinfo { background: var(--auto); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.pf-sig { grid-template-columns: 1fr; }
.sigpad { position: relative; border: 2px dashed var(--accent); border-radius: 10px; background: #fff; touch-action: none;
          -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* iPad/Safari: kein Doppeltipp-Zoom und keine Verzögerung auf Schaltflächen */
.tablet button, .tablet .button, .tablet .seg label, .psecnav a, .ptile a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sigpad canvas { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.sigpad .sig-old { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .35; pointer-events: none; }
.sigpad.drawing .sig-old { display: none; }
.sigpad .sig-line { position: absolute; left: 4%; right: 4%; bottom: 18%; border-top: 1px solid #9aa; color: #789;
                    font-size: 12px; padding-top: 2px; pointer-events: none; }
.sigpad .sig-clear { position: absolute; top: 6px; right: 6px; }
.sigpad.signed { border-style: solid; border-color: var(--ok); }
img.sig-ro { max-width: 360px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.pbar { position: sticky; bottom: 0; z-index: 6; display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
        background: var(--panel); border-top: 2px solid var(--brand); box-shadow: 0 -4px 12px rgba(0,0,0,.12);
        padding: 10px 12px; margin: 0 -4px 14px; border-radius: 10px 10px 0 0; }
.pbar [data-dirty-note] { margin-right: auto; }
.pbar .ok { color: var(--ok); } .pbar .err { color: var(--warn); }
.pfinal .sign input, .pfinal input[name=comment] { font-size: 17px; min-height: 48px; padding: 8px 12px; }
.pfinal form.signform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pfinal form.signform > p, .pfinal form.signform > input[name=comment] { flex: 1 1 100%; }
.flash.warnbox { background: var(--today); color: var(--ink); }
.badge.pst-entwurf { background: var(--today); } .badge.pst-abgeschlossen { background: var(--ok-bg); color: var(--ok); }
.badge.pst-ersetzt, .badge.pst-verworfen { background: var(--auto); color: var(--muted); }
ul.plist { list-style: none; padding: 0; margin: 6px 0; }
ul.plist li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
ul.plist li.pst-ersetzt a:first-child, ul.plist li.pst-verworfen a:first-child { text-decoration: line-through; color: var(--muted); }
.prot-box form.inline { display: inline-block; margin: 4px 6px 4px 0; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 12px 0; }
.ptile { background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--accent)); border-radius: 12px;
         padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.ptile.k-vu, .ptile.k-fragebogen, .ptile.k-einwilligung { --c: var(--ev-vu); } .ptile.k-abnahme { --c: var(--ev-abnahme); }
.ptile.k-packliste, .ptile.k-uebergabe { --c: var(--ev-transport); }
.ptile.st-abgeschlossen { background: var(--ok-bg); }
.ptile .pt-kind { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--c); font-weight: 700; }
.ptile .pt-who { font-size: 21px; font-weight: 700; }
.ptile .pt-meta { color: var(--muted); font-size: 14px; }
.ptile .button, .ptile button { margin-top: 6px; text-align: center; width: 100%; }
/* Spender-Modus: nur das Formular, keine Navigation */
body.donor-mode header.top, body.donor-mode footer.foot { display: none; }
body.donor-mode .tablet { font-size: 18px; }
body.donor-mode .pf .pl { font-size: 18px; }
.thanks { text-align: center; padding: 80px 20px; }
.thanks h1 { font-size: 40px; color: var(--accent); }
.thanks p { font-size: 22px; margin: 20px 0 60px; }
.thanks .button { opacity: .7; }
.forms-box.handover { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.forms-box.fbcheck ul { margin: 6px 0; }
.daynav { display: flex; gap: 6px; }
.daynav .button { min-width: 48px; min-height: 44px; text-align: center; font-size: 18px; }
@media (max-width: 760px) {
  .pf { grid-template-columns: 1fr; }
  .pf .warn { grid-column: 1; }
  .seg span { min-width: 72px; padding: 0 12px; }
  .pbar button, .pbar .button { flex: 1 1 100%; }
}

@media print {
  .top, .filters, .actions, .signform, form.inline, .foot, .calnav, .flash, p.small, dialog { display: none !important; }
  body { background: #fff; color: #000; font-size: 11px; }
  main { padding: 0; }
  .scroll { max-height: none; overflow: visible; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.cal.week td { height: auto; min-height: 0; }
  table.cal.week a.ev { font-size: 10px; break-inside: avoid; }
  a.ev.movable::before { content: ""; }
  article.daycard { break-inside: avoid; box-shadow: none !important; }
  section.dayview { border: 0; padding: 0; }
  a { color: inherit; text-decoration: none; }
  h1 { font-size: 16px; }
  @page { size: A4 landscape; margin: 10mm; }
}
