:root {
  --bg: #f4f6f5; --card: #fff; --text: #1c2523; --muted: #5d6b67; --line: #d9e0dd;
  --accent: #0f766e; --accent-d: #0b5c56; --warn-bg: #fff4e5; --warn: #9a4b00;
  --err-bg: #fdecec; --err: #a11d1d; --ok-bg: #e8f6f1; --ok: #0b5c43; --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
body.patient main { max-width: 640px; }
h1 { font-size: 1.45rem; margin: 0 0 8px; } h2 { font-size: 1.1rem; margin: 0 0 12px; } h3 { font-size: 1rem; margin: 16px 0 8px; }
a { color: var(--accent-d); }
.muted { color: var(--muted); } .small { font-size: .85rem; } small { color: var(--muted); font-weight: normal; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--accent); color: #fff; }
.topbar a { color: #fff; } .brand { font-weight: 700; text-decoration: none; } .who { font-size: .9rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.head .apo { color: var(--accent-d); font-weight: 600; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.center { text-align: center; } .stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; } .row.between { justify-content: space-between; } .row.center { justify-content: center; } .row.end { justify-content: flex-end; }
.grid2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; } .grid2.top { align-items: start; gap: 16px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid2.plz { grid-template-columns: 120px 1fr; } }

label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: normal; color: inherit; background: #fff; border: 1px solid #b9c4c0; border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.row input { width: auto; flex: 1; min-width: 200px; margin: 0; }
label.check, label.opt { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; }
label.check input, label.opt input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
fieldset.frage { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 12px 0; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
fieldset.frage legend { float: left; width: 100%; padding: 0 0 6px; }
fieldset.frage label.opt { margin: 0; padding: 8px 14px; border: 1px solid #b9c4c0; border-radius: 999px; align-items: center; }
fieldset.frage label.opt:has(input:checked) { border-color: var(--accent); background: var(--ok-bg); }
.quote { background: var(--bg); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: 6px; }

.btn { display: inline-block; padding: 11px 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-d); } .btn:disabled { opacity: .6; cursor: wait; }
.btn.big { width: 100%; padding: 15px; font-size: 1.05rem; }
.btn.secondary { background: #fff; color: var(--accent-d); border: 1px solid var(--accent); }
.btn.danger { background: #fff; color: var(--err); border: 1px solid var(--err); }
.link { background: none; border: 0; color: var(--accent-d); text-decoration: underline; cursor: pointer; font: inherit; padding: 4px 0; }

.sigwrap { position: relative; }
canvas.sig { display: block; width: 100%; height: 180px; background: #fff; border: 2px dashed #9fb0aa; border-radius: 10px; touch-action: none; cursor: crosshair; }
canvas.sig.inked { border-style: solid; border-color: var(--accent); }
.sigwrap .link { position: absolute; right: 10px; top: 6px; }
img.sigimg { max-width: 100%; max-height: 140px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.error { background: var(--err-bg); color: var(--err); padding: 10px 12px; border-radius: 8px; }
.alert { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0c48a; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.ok { background: var(--ok-bg); color: var(--ok); padding: 10px 12px; border-radius: 8px; }
.notice { background: #eef4ff; color: #1e3a8a; padding: 10px 12px; border-radius: 8px; }
.done { text-align: center; padding: 40px 18px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.kv span { color: var(--muted); } .kv strong { text-align: right; font-weight: 600; }
.kv.warn strong { color: var(--err); }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { background: #eef2f0; font-size: .85rem; color: var(--muted); }
@media (max-width: 640px) { table.list thead { display: none; } table.list td { display: block; border: 0; padding: 4px 12px; } table.list tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; } }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eee; }
.badge.s-offen { background: #eef4ff; color: #1e3a8a; } .badge.s-ausgefuellt { background: var(--warn-bg); color: var(--warn); }
.badge.s-abgeschlossen { background: var(--ok-bg); color: var(--ok); } .badge.s-abgeholt { background: #eceff1; color: #455a64; }

.qr svg { width: min(320px, 80vw); height: auto; } .qr.small svg { width: 200px; }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
