/* MBG Protokoll-App: Oberfläche */

/* Layout: Anwendungsrahmen mit fester Kopfleiste, Inhalt in Karten auf ruhigem Grund, max. 960px breit; Formulare einspaltig bis 720px. */
:root {
  --bg: #F4F3F4;
  --surface: #FFFFFF;
  --surface-2: #FAF9FA;
  --border: #DDDADC;
  --border-strong: #BFBABD;
  --fg: #1D1D1B;
  --muted: #5F5B5D;
  --accent: #9C1561;
  --accent-hover: #82104F;
  --accent-text: #9C1561;
  --accent-soft: #F7E8F1;
  --on-accent: #FFFFFF;
  --ok: #17703F;
  --ok-soft: #E4F3EA;
  --warn: #A85400;
  --warn-soft: #FCEFDD;
  --crit: #B3261E;
  --crit-soft: #FBE7E5;
  --focus: #9C1561;
  --overlay: rgba(29, 29, 27, 0.55);
  --font-head: "Raleway", "Segoe UI", system-ui, sans-serif;
  --font-body: "Open Sans", "Segoe UI", system-ui, sans-serif;
  --r: 6px;
  --r-lg: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161415; --surface: #1F1D1E; --surface-2: #262425; --border: #353234; --border-strong: #4A4648;
    --fg: #F0EEEF; --muted: #A8A3A6; --accent: #B02A78; --accent-hover: #C23587; --accent-text: #F08CC6;
    --accent-soft: #3A1F30; --on-accent: #FFFFFF; --ok: #5CC58A; --ok-soft: #17301F; --warn: #F0A24F;
    --warn-soft: #3A2A15; --crit: #F28B82; --crit-soft: #3B1F1D; --focus: #F08CC6; --overlay: rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161415; --surface: #1F1D1E; --surface-2: #262425; --border: #353234; --border-strong: #4A4648;
  --fg: #F0EEEF; --muted: #A8A3A6; --accent: #B02A78; --accent-hover: #C23587; --accent-text: #F08CC6;
  --accent-soft: #3A1F30; --on-accent: #FFFFFF; --ok: #5CC58A; --ok-soft: #17301F; --warn: #F0A24F;
  --warn-soft: #3A2A15; --crit: #F28B82; --crit-soft: #3B1F1D; --focus: #F08CC6; --overlay: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  min-height: 100%;
}
h1, h2, h3, h4, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopfleiste */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-in {
  max-width: 960px; margin-inline: auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; border-radius: var(--r); }
.brand-mark {
  display: inline-grid; place-items: center; height: 32px; padding: 0 8px; border-radius: 4px;
  background: var(--accent); color: var(--on-accent); font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: .06em;
}
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--fg); }
.spacer { flex: 1; }
.user { font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Seiten */
.wrap { max-width: 960px; margin-inline: auto; padding: 24px 16px 56px; }
.wrap-form { max-width: 720px; }
.wrap-narrow { max-width: 440px; }
.page-head { display: grid; gap: 4px; margin-bottom: 20px; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 2px; background: none; border: 0; padding: 6px 8px 6px 0; min-height: 36px; color: var(--accent-text); font-weight: 600; font-size: 14px; }
.page-head h2 { font-family: var(--font-head); font-size: 22px; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.sub { color: var(--muted); font-size: 14px; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 24px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.sec { padding: 20px; display: grid; gap: 16px; }
.sec-head h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-align: center; transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--accent-text); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--crit); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.actions { display: grid; gap: 10px; margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent-text); font-weight: 600; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }

/* Felder */
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .lbl-text { font-size: 13px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; background: var(--surface); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--r); font-size: 16px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[aria-invalid=true] { border-color: var(--crit); }
.err { color: var(--crit); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.dauer { display: flex; align-items: center; gap: 10px; }
.dauer input { width: 96px; text-align: right; }
.check-inline { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 600; color: var(--fg); }
.check-inline input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }

/* Kacheln und Listen */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tile {
  display: grid; gap: 12px; text-align: left; padding: 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); transition: border-color .15s, background-color .15s;
}
.tile:hover { border-color: var(--accent); background: var(--surface-2); }
.tile-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); }
.tile h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--fg); }
.tile p { font-size: 13px; color: var(--muted); }
.rows { overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; text-align: left; background: none;
  border: 0; border-bottom: 1px solid var(--border);
}
.rows > :last-child, .row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row .ic { color: var(--muted); }
.row-lead { color: var(--accent-text) !important; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.obj { display: grid; gap: 6px; text-align: left; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.obj:hover { border-color: var(--accent); }
.obj h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.b-accent { background: var(--accent-soft); color: var(--accent-text); }
.contact { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; overflow-wrap: anywhere; }

.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid; font-size: 14px; }
.notice .ic { margin-top: 2px; }
.n-warn { background: var(--warn-soft); border-color: var(--warn); color: var(--fg); }
.n-warn .ic { color: var(--warn); }
.n-info { background: var(--surface-2); border-color: var(--border-strong); }
.n-info .ic { color: var(--muted); }
.n-ok { background: var(--ok-soft); border-color: var(--ok); }
.n-ok .ic { color: var(--ok); }

/* Checklisten */
.check-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; font-size: 13px; color: var(--muted); }
.grp { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 0 6px; border-bottom: 1px solid var(--border-strong); }
.grp:first-child { padding-top: 0; }
.check-row { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.check-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.check-label { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.turnus { font-size: 12px; color: var(--muted); margin-left: 6px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; }
.seg-btn { min-height: 40px; padding: 0 14px; background: var(--surface); border: 0; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-strong); }
.seg-btn .ic { width: 16px; height: 16px; }
.seg-btn.ok[aria-pressed=true] { background: var(--ok-soft); color: var(--ok); }
.seg-btn.mangel[aria-pressed=true] { background: var(--warn-soft); color: var(--warn); }
.check-note { min-height: 40px; font-size: 14px; }

/* Diktat / Fotos / Unterschrift */
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tools .btn { border-color: var(--border-strong); color: var(--fg); background: var(--surface); }
.tools .btn:hover { background: var(--surface-2); }
.tools .btn[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.status { font-size: 13px; min-height: 18px; color: var(--muted); }
.status.warn { color: var(--warn); }
.status.ok { color: var(--ok); }
.drop {
  display: grid; justify-items: center; gap: 6px; padding: 24px 16px; width: 100%; background: var(--surface-2);
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--muted); font-size: 14px;
}
.drop:hover { border-color: var(--accent); color: var(--fg); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(29,29,27,.75); color: #fff; }
.thumb button .ic { width: 14px; height: 14px; }
.sig { display: grid; gap: 6px; }
.sig-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sig-box { position: relative; }
.sig-canvas { display: block; width: 100%; height: 160px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r); touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #8a8588; font-size: 14px; pointer-events: none; }
.sig-line { position: absolute; left: 16px; right: 16px; bottom: 34px; border-bottom: 1px solid #cfcbcd; pointer-events: none; }
.schluessel { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 16px; }
.quittung { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; font-size: 14px; }
details.sec > summary { cursor: pointer; font-family: var(--font-head); font-weight: 700; font-size: 16px; }
details.sec[open] > summary { margin-bottom: 4px; }
.kontakt-liste { display: grid; gap: 10px; }
.kontakt-liste li { display: grid; gap: 2px; font-size: 14px; }

/* Einstellungen */
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toggle-row .tr-label { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.toggle-row select { width: auto; min-height: 36px; font-size: 14px; }
.toggle-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.erin { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; }
.erin-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.erin-grid select { width: auto; min-width: 120px; min-height: 40px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; }
.filterbar { display: flex; flex-wrap: wrap; gap: 6px; }
.fbtn { min-height: 36px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.fbtn[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.archiv-gruppe > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 700; font-family: var(--font-head); }
.archiv-gruppe > summary span { font-family: var(--font-body); font-weight: 400; font-size: 13px; color: var(--muted); }
.archiv-einheit { padding: 8px 18px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--border); background: var(--surface-2); }
.dateiname { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.raum-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.raum-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface-2); font-size: 14px; }
.raum-tag button { display: grid; place-items: center; width: 28px; height: 28px; background: none; border: 0; border-radius: 4px; color: var(--muted); }
.raum-tag button:hover { color: var(--crit); background: var(--crit-soft); }
.raum-tag .ic { width: 14px; height: 14px; }
.einheit-block { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; }
.einheit-block h4 { font-size: 14px; font-weight: 700; }
.ergebnis { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 8px 0; }
.ergebnis .big { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); margin-bottom: 8px; }
.ergebnis .big .ic { width: 28px; height: 28px; }
.ergebnis h2 { font-family: var(--font-head); font-size: 22px; }
.empf { display: grid; gap: 6px; width: 100%; text-align: left; }
.empf li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.empf li span:last-child { color: var(--muted); overflow-wrap: anywhere; }
.filename-box { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); overflow-wrap: anywhere; }

/* Dialoge */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--overlay); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; display: grid; gap: 12px; }
.modal h2 { font-family: var(--font-head); font-size: 18px; }
.modal ul { display: grid; gap: 6px; padding-left: 18px; list-style: disc; font-size: 14px; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.sperre { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.preview { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: grid; grid-template-rows: auto 1fr; padding-top: env(safe-area-inset-top, 0px); }
.preview-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.preview-bar .t { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.preview-bar .t strong { display: block; color: var(--fg); font-size: 15px; }
.preview-body { overflow: auto; padding: 20px 16px 48px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 120; max-width: calc(100% - 32px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: var(--r); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* Berichtsvorschau: bewusst immer helles Papier */
.sheet { max-width: 794px; margin: 0 auto; background: #fff; color: #1D1D1B; padding: 32px 28px; border: 1px solid #DDDADC; border-radius: 4px; font-size: 13px; line-height: 1.5; }
.sheet-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #9C1561; padding-bottom: 12px; margin-bottom: 16px; }
.sheet-org { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5F5B5D; }
.sheet h2 { font-family: var(--font-head); font-size: 22px; color: #1D1D1B; margin-top: 2px; }
.sheet-date { font-size: 13px; color: #5F5B5D; white-space: nowrap; }
.sheet-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 20px; margin: 0 0 8px; padding: 12px 14px; background: #F4F3F4; border-radius: 4px; }
.sheet-meta dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5F5B5D; }
.sheet-meta dd { margin: 0; overflow-wrap: anywhere; }
.sheet h3 { font-size: 13px; font-weight: 700; margin: 20px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #DDDADC; color: #1D1D1B; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet td { padding: 5px 6px; border-bottom: 1px solid #EEECED; vertical-align: top; overflow-wrap: anywhere; }
.sheet td:last-child { white-space: nowrap; font-weight: 600; text-align: right; }
.sheet .st-ok { color: #17703F; }
.sheet .st-mangel { color: #A85400; }
.sheet .st-offen { color: #8a8588; font-weight: 400; }
.sheet .note { display: block; font-weight: 400; color: #5F5B5D; font-size: 12px; }
.sheet .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet .fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet .fotos img { width: 120px; height: 120px; object-fit: cover; border-radius: 3px; }
.sheet .sigs { display: flex; flex-wrap: wrap; gap: 20px; }
.sheet .sigs div { flex: 1 1 220px; }
.sheet .sigs img { display: block; height: 70px; max-width: 100%; border-bottom: 1px solid #1D1D1B; }
.sheet .sigs .leer { height: 70px; border-bottom: 1px solid #1D1D1B; }
.sheet .sigs p { font-size: 11px; color: #5F5B5D; margin-top: 4px; }
.sheet .demo { margin-top: 20px; padding: 10px 12px; background: #FCEFDD; border-left: 3px solid #A85400; font-size: 12px; }

.dateien { display: grid; gap: 8px; font-size: 14px; }
.dateien li { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.dateien .ic { margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 0; }
.stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { font-family: var(--font-head); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.liste { display: grid; gap: 4px; padding-left: 18px; list-style: disc; font-size: 14px; margin-top: 6px; overflow-wrap: anywhere; }
.zaehler-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.zaehler-row:last-child { border-bottom: 0; }
.z-info { min-width: 0; display: grid; gap: 2px; font-size: 14px; }
.z-in { display: flex; align-items: center; gap: 8px; }
.z-in .z-wert { width: 150px; text-align: right; }
.sheet table.z td:last-child { font-weight: 400; color: #5F5B5D; }
.sheet table.z td:nth-child(2) { text-align: right; font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) {
  .zaehler-row { grid-template-columns: 1fr; }
  .z-in .z-wert { flex: 1; width: auto; }
  .brand-name, .user, .btn .lbl-hide { display: none; }
  .sec { padding: 16px; }
  .sheet { padding: 20px 16px; }
}
@media (min-width: 640px) {
  .actions { grid-template-columns: 1fr 1fr; }
  .actions.single { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.qr { background: #fff; padding: 12px; border-radius: var(--r); display: inline-block; line-height: 0; border: 1px solid var(--border); }
.geheim { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; letter-spacing: .06em; overflow-wrap: anywhere; }
.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 15px; }
.codes span { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 6px 10px; text-align: center; }
.row-split { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.row-split:last-child { border-bottom: 0; }
.row-split .row { flex: 1; border-bottom: 0; min-width: 0; }
.row-split .link-btn { margin-right: 16px; white-space: nowrap; }
.benutzer-zeile { padding: 14px 18px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.benutzer-zeile:last-child { border-bottom: 0; }
.benutzer-zeile .tools { align-items: center; }

table.ereignisse { width: 100%; border-collapse: collapse; font-size: 13px; }
.ereignisse td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.tabelle-scroll { overflow-x: auto; }

.zaehler-row.rot { background: var(--crit-soft); border-left: 3px solid var(--crit); padding-left: 10px; }
.chip-rot { background: var(--crit); color: #fff; border-color: var(--crit); }
.zaehler-row.aus-foto .z-wert { border-color: var(--ok); }
.zuordnung { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; background: var(--surface-2); }
.zuordnung .zeile { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.zuordnung .zeile input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.foto-ergebnis { display: grid; grid-template-columns: 140px 1fr; gap: 16px; border: 1px solid var(--border); border-radius: var(--r); padding: 14px; background: var(--surface-2); margin-top: 8px; }
.foto-ergebnis img { width: 140px; height: 140px; object-fit: cover; border-radius: var(--r); }
.sheet table.rot td { background: #FBE7E5; color: #7a1a14; }
@media (max-width: 560px) { .foto-ergebnis { grid-template-columns: 1fr; } .foto-ergebnis img { width: 100%; height: 180px; } }

.ki-hinweis { border-left: 3px solid var(--warn); padding-left: 10px; color: var(--fg); }
