@font-face {
  font-family: 'Archivo';
  src: url('archivo.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #F1F4F2;
  --panel: #FFFFFF;
  --sunk: #E7ECE9;
  --ink: #101917;
  --ink-2: #3B4844;
  --muted: #6B7873;
  --line: #D5DCD8;
  --line-2: #C0CAC5;
  --accent: #146B5B;
  --accent-ink: #FFFFFF;
  --accent-soft: #DFEDE8;
  --ok: #1F7A54;
  --ok-soft: #DFEEE5;
  --warn: #9C6410;
  --warn-soft: #F6EBD8;
  --bad: #A83A1C;
  --bad-soft: #F7E3DC;
  --shadow: 0 1px 3px rgba(16, 25, 23, .07), 0 1px 2px rgba(16, 25, 23, .04);
  --shadow-lift: 0 8px 28px rgba(16, 25, 23, .16);

  --ui: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  --hdr: 54px;
  --nav: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0D1312;
    --panel: #161E1C;
    --sunk: #1C2523;
    --ink: #E6EDEA;
    --ink-2: #B2BDB9;
    --muted: #82908B;
    --line: #28322F;
    --line-2: #37423E;
    --accent: #4FC0A5;
    --accent-ink: #06211B;
    --accent-soft: #14312A;
    --ok: #4FB584;
    --ok-soft: #14301F;
    --warn: #D69A45;
    --warn-soft: #322313;
    --bad: #E07A57;
    --bad-soft: #351B12;
    --shadow: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-lift: 0 8px 28px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Autoren-CSS schlaegt das Browser-Standardverhalten von [hidden].
   Jede Regel mit display: grid oder flex macht ein als versteckt
   markiertes Element wieder sichtbar. Deshalb hier einmal hart. */
[hidden] { display: none !important; }

html { background: var(--ground); }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--hdr);
  padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom, 0px));
  overscroll-behavior-y: none;
}

/* ============ Kopfleiste ============ */
.hdr {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--hdr);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  z-index: 40;
}
.hdr .mark {
  width: 26px; height: 26px;
  flex: none;
  border-radius: 5px;
  background: var(--accent);
  display: grid;
  place-items: center;
}
.hdr .mark svg { width: 15px; height: 15px; display: block; }
.hdr .titles { min-width: 0; flex: 1; }
.hdr b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr .demo {
  flex: none;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: 3px;
  padding: 3px 6px;
}

/* ============ Fussnavigation ============ */
.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
}
.nav button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.nav button svg { width: 21px; height: 21px; display: block; }
.nav button[aria-current="page"] { color: var(--accent); }
.nav button[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 2px;
  background: var(--accent);
}
.nav .badge {
  position: absolute;
  top: 6px;
  margin-left: 22px;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  background: var(--bad);
  color: #fff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  display: grid;
  place-items: center;
  padding: 0 3px;
}

/* ============ Seitengeruest ============ */
.view { display: none; }
.view.on { display: block; }
.wrap { max-width: 680px; margin: 0 auto; padding: 16px 14px 28px; }

.pagehead { margin-bottom: 16px; }
.pagehead h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 3px;
}
.pagehead p { margin: 0; color: var(--muted); font-size: 13.5px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 26px 0 9px;
}
.eyebrow:first-child { margin-top: 0; }

/* ============ Scanner ============ */
.scanbox {
  position: relative;
  background: #0A0E0D;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.scanbox video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.scanbox .idle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 26px;
  text-align: center;
  color: #90A09B;
  font-size: 13.5px;
  line-height: 1.55;
}
.scanbox .idle svg { width: 40px; height: 40px; margin: 0 auto 12px; display: block; opacity: .55; }
.reticle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.scanbox.live .reticle { opacity: 1; }
.reticle i {
  position: absolute;
  width: 26px; height: 26px;
  border: 2.5px solid rgba(255, 255, 255, .92);
}
.reticle i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 3px 0 0 0; }
.reticle i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 3px 0 0; }
.reticle i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 3px; }
.reticle i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 3px 0; }
.scanbox.hit .reticle i { border-color: var(--ok); }
.scanstatus {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  background: rgba(10, 14, 13, .82);
  backdrop-filter: blur(8px);
  color: #E9EFEC;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.scanstatus .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn);
  flex: none;
}
.scanbox.live .scanstatus .dot { background: var(--ok); }
.torch {
  position: absolute;
  top: 10px; right: 10px;
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 0;
  background: rgba(10, 14, 13, .72);
  backdrop-filter: blur(8px);
  color: #E9EFEC;
  display: none;
  place-items: center;
  cursor: pointer;
}
.torch.avail { display: grid; }
.torch[aria-pressed="true"] { background: #F2C14E; color: #221A05; }
.torch svg { width: 19px; height: 19px; }

/* ============ Knoepfe ============ */
.btn {
  appearance: none;
  font-family: var(--ui);
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  transition: background .12s ease, border-color .12s ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:active { background: var(--sunk); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:active { filter: brightness(.92); }
.btn.ghost { background: none; border-color: var(--line); color: var(--ink-2); }
.btnrow { display: grid; gap: 9px; margin-top: 14px; }
@media (min-width: 460px) { .btnrow.two { grid-template-columns: 1fr 1fr; } }

/* ============ Manuelle Eingabe ============ */
.manual {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.manual input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  min-height: 48px;
}
.manual input::placeholder { letter-spacing: .1em; color: var(--muted); font-weight: 400; }
.manual input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.manual .btn { width: auto; padding: 0 18px; }

/* ============ Karten und Listen ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.list { display: grid; gap: 8px; }

.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  cursor: pointer;
  font-family: var(--ui);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.row:active { background: var(--sunk); }
.row .glyph {
  width: 34px; height: 34px;
  border-radius: 7px;
  background: var(--sunk);
  display: grid;
  place-items: center;
  flex: none;
}
.row .glyph svg { width: 19px; height: 19px; color: var(--ink-2); }
.row .txt { min-width: 0; }
.row .txt b {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .txt span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .txt code {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
}

/* ============ Statusanzeigen ============ */
.pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex: none;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--sunk); color: var(--muted); }

.stripe { width: 3px; align-self: stretch; border-radius: 2px; flex: none; }
.stripe.ok { background: var(--ok); }
.stripe.warn { background: var(--warn); }
.stripe.bad { background: var(--bad); }

/* ============ Detailkopf ============ */
.detailhead {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.detailhead .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.detailhead h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 2px;
  text-wrap: balance;
}
.detailhead .sub { color: var(--muted); font-size: 13px; margin: 0; }
.detailhead .code {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--accent);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.detailhead .code svg { width: 14px; height: 14px; }

.duebar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.duebar .lbl { color: var(--muted); }
.duebar .val { font-family: var(--mono); font-weight: 600; margin-left: auto; }
.duebar svg { width: 15px; height: 15px; display: block; }
.duebar > span:first-child { display: flex; flex: none; }

/* ============ Datenblatt ============ */
.spec { margin: 0; }
.spec > div {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 14px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.spec > div:last-child { border-bottom: 0; }
.spec dt { font-size: 12.5px; color: var(--muted); margin: 0; }
.spec dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ============ Historie ============ */
.visit {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px 11px 10px;
  box-shadow: var(--shadow);
}
.visit .meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.visit .date {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.visit .who { font-size: 12px; color: var(--muted); }
.visit .note { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.visit .dur {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.defect {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px 11px 10px;
  box-shadow: var(--shadow);
}
.defect .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.defect .txt { font-size: 13.5px; margin: 6px 0 0; }
.defect .since { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: auto; }
.defect.done .txt { color: var(--muted); text-decoration: line-through; }

.empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--panel);
  border: 1px dashed var(--line-2);
  border-radius: 9px;
}

.hint {
  background: var(--warn-soft);
  border-left: 3px solid var(--warn);
  border-radius: 0 7px 7px 0;
  padding: 10px 13px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.hint b { color: var(--warn); }

/* ============ Objektuebersicht ============ */
.floor { margin-bottom: 20px; }
.floorhd {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-2);
}
.floorhd b { font-size: 15px; font-weight: 600; }
.floorhd span { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 13px;
  box-shadow: var(--shadow);
}
.stat .n {
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat .l {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.3;
}
.stat.ok .n { color: var(--ok); }
.stat.warn .n { color: var(--warn); }
.stat.bad .n { color: var(--bad); }

/* ============ Etikettenbogen ============ */
.sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 10px;
}
.label {
  background: #FFFFFF;
  color: #000000;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 7px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 106px;
}
.label .qr { width: 92px; height: 92px; }
.label .qr svg { width: 100%; height: 100%; display: block; }
.label .t { min-width: 0; }
.label .adr {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.label .key {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.15;
  margin-top: 3px;
  color: #000;
  white-space: nowrap;
}
.label .rm {
  font-family: var(--ui);
  font-size: 10px;
  color: #4a4a4a;
  margin-top: 5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.scalehint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.6;
}

/* ============ Erfassungs-Sheet ============ */
.sheetwrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}
.sheetwrap.on { display: block; }
.sheetwrap .veil {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 14, .5);
}
.sheetwrap .panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--ground);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow-lift);
  padding: 8px 14px calc(20px + env(safe-area-inset-bottom, 0px));
}
.grabber {
  width: 34px; height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  margin: 6px auto 12px;
}
.sheetwrap h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -.01em;
}
.sheetwrap .who { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

.check {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 7px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.check .lb { font-size: 13.5px; }
.tri { display: flex; gap: 4px; flex: none; }
.tri button {
  width: 38px; height: 38px;
  border-radius: 7px;
  border: 1.5px solid var(--line-2);
  background: var(--panel);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.tri button i {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--line-2);
  display: block;
}
.tri button[data-v="ok"][aria-pressed="true"] { background: var(--ok-soft); border-color: var(--ok); }
.tri button[data-v="ok"][aria-pressed="true"] i { background: var(--ok); }
.tri button[data-v="warn"][aria-pressed="true"] { background: var(--warn-soft); border-color: var(--warn); }
.tri button[data-v="warn"][aria-pressed="true"] i { background: var(--warn); }
.tri button[data-v="bad"][aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad); }
.tri button[data-v="bad"][aria-pressed="true"] i { background: var(--bad); }

.allok {
  border-style: dashed;
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(14px);
  background: var(--ink);
  color: var(--ground);
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 17px;
  border-radius: 8px;
  box-shadow: var(--shadow-lift);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  .hdr, .nav, .pagehead, .btnrow, .toast { display: none !important; }
  body { padding: 0; background: #fff; }
  .view { display: none !important; }
  .view.on { display: block !important; }
  .sheet { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .label { break-inside: avoid; border: 1px solid #999; box-shadow: none; }
}

/* ============ Anmeldung ============ */
.anmeldung {
  position: fixed;
  inset: 0;
  background: var(--ground);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 80;
  overflow-y: auto;
}
.anmeldebox {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.mark.gross {
  width: 52px; height: 52px;
  border-radius: 12px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  background: var(--accent);
}
.mark.gross svg { width: 28px; height: 28px; }
.anmeldebox h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 4px;
}
.anmeldebox .unter { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.anmeldebox label {
  display: block;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 5px;
}
.anmeldebox input {
  width: 100%;
  font-family: var(--ui);
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  margin-bottom: 14px;
  min-height: 48px;
}
.anmeldebox input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.anmeldebox .fehler {
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13.5px;
  text-align: left;
  margin-bottom: 14px;
}
.anmeldebox .fuss {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 20px 0 0;
}

/* ============ Kopfleiste: Abmelden ============ */
.abmelden {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 11.5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  max-width: 120px;
}
.abmelden span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.abmelden svg { width: 16px; height: 16px; flex: none; }
.abmelden:active { background: var(--sunk); }

/* ============ Warteschlange ============ */
.queue {
  position: fixed;
  top: var(--hdr);
  left: 0; right: 0;
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid var(--warn);
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 35;
}
.queue svg { width: 16px; height: 16px; flex: none; }
body:has(.queue:not([hidden])) { padding-top: calc(var(--hdr) + 35px); }

/* ============ Sicherheitshinweis ============ */
.stopcard {
  background: var(--bad-soft);
  border: 1px solid var(--bad);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.stopcard .hd {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bad);
  font-size: 14px;
  margin-bottom: 6px;
}
.stopcard .hd svg { width: 18px; height: 18px; flex: none; }
.stopcard p { margin: 0; font-size: 13px; color: var(--ink-2); }
.stopcard.klein {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  margin-bottom: 14px;
}
.stopcard.klein svg { width: 18px; height: 18px; flex: none; color: var(--bad); margin-top: 1px; }
.stopcard.klein b { color: var(--bad); }

/* ============ Prüfpunkt-Hilfetext ============ */
.check .lb { display: block; }
.check .hilfe {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 3px;
}
.row .mini {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bad);
  background: var(--bad-soft);
  padding: 2px 5px;
  border-radius: 3px;
  vertical-align: middle;
}
.row[disabled] { opacity: .55; }

.pill.neutral { background: var(--sunk); color: var(--muted); }
.stat .n { font-variant-numeric: tabular-nums; }


/* ============ Formulare in der Verwaltung ============ */
.formcard {
  padding: 15px 16px;
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
}
.formcard label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.formcard input,
.formcard select {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-family: var(--ui);
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
}
.formcard input:focus-visible,
.formcard select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.formcard .zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.formcard fieldset.schutz {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px 12px;
  margin: 0;
}
.formcard fieldset.schutz legend {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 0 5px;
}
.formcard label.klein {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink);
  padding: 4px 0;
}
.formcard label.klein input {
  width: 20px; height: 20px;
  min-height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

/* ============ Erweiterungen 09/2026: Besuch, Erfassung, Buero ============ */
.queue.bad { background: var(--bad-soft); color: var(--bad); }
.queue button { margin-left: auto; background: none; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 12px; }
.besuchleiste { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.besuchleiste > div { min-width: 0; flex: 1; display: grid; }
.besuchleiste b { font-size: 13.5px; }
.besuchleiste span { font-size: 12px; color: var(--muted); }
.besuchleiste .btn { width: auto; min-height: 38px; padding: 6px 12px; font-size: 13px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: var(--panel); }
.seg button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 10px 4px; border: 0; background: none; color: var(--ink-2); border-right: 1px solid var(--line); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg.klein button { padding: 7px 4px; font-size: 12px; }
.check { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.check.rot .lb { color: var(--bad); }
.check.gelb .lb { color: var(--warn); }
.check .ctl { display: flex; align-items: center; gap: 6px; }
.check .nv { display: flex; gap: 4px; }
.check .nv button { font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 5px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); }
.check .nv button[aria-pressed="true"] { background: var(--sunk); color: var(--ink); border-color: var(--ink-2); }
.check .mess { width: 84px; font: inherit; font-size: 14px; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); }
.check .befund { grid-column: 1 / -1; display: grid; gap: 8px; padding: 4px 0 8px; }
.check .befund input, .check .befund select { font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); width: 100%; }
.legende { font-size: 11.5px; color: var(--muted); margin: 6px 0 10px; line-height: 1.5; }
.link { background: none; border: 0; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }
.fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 82px; height: 82px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--sunk); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 15px; line-height: 22px; padding: 0; cursor: pointer; }
.thumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent); border: 1px dashed var(--line-2); cursor: pointer; font-size: 10.5px; font-weight: 600; text-align: center; padding: 4px; }
.thumb.add svg { width: 22px; height: 22px; }
.stammfoto { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; display: block; }
.pad { width: 100%; height: 150px; border: 1px dashed var(--line-2); border-radius: 8px; background: #fff; touch-action: none; display: block; }
.btn.klein { width: auto; min-height: 32px; padding: 5px 10px; font-size: 12.5px; gap: 5px; }
.btn.klein svg { width: 14px; height: 14px; }
.visit.storno { opacity: .55; }
.formcard textarea { display: block; width: 100%; margin-top: 5px; font-family: var(--ui); font-size: 15px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); resize: vertical; }
.formcard textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
#sheet textarea { width: 100%; font-family: var(--ui); font-size: 14px; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); resize: vertical; }
.hint a { color: inherit; }
details.card summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
/* Buero */
.wrap.breit { max-width: 1040px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.subnav button { flex: none; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.subnav button[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.tabelle { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); margin: 8px 0; }
.tabelle table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabelle th, .tabelle td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tabelle th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--sunk); }
.tabelle td.r, .tabelle th.r { text-align: right; white-space: nowrap; }
.tabelle small { color: var(--muted); font-size: 11.5px; }
.tabelle tr:last-child td { border-bottom: 0; }
.mini { font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: var(--sunk); color: var(--muted); padding: 2px 5px; border-radius: 4px; vertical-align: middle; }
@media (min-width: 720px) {
  .wrap.breit .formcard .zwei { grid-template-columns: 1fr 1fr; }
}
.row .txt b .mini { display: inline-block; width: auto; margin-left: 6px; background: var(--bad-soft); color: var(--bad); padding: 1px 5px; }
.tri button[data-v="o_b"][aria-pressed="true"], .tri button[data-v="erledigt"][aria-pressed="true"], .tri button[data-v="nein"][aria-pressed="true"] { background: var(--ok-soft); border-color: var(--ok); }
.tri button[data-v="o_b"][aria-pressed="true"] i, .tri button[data-v="erledigt"][aria-pressed="true"] i, .tri button[data-v="nein"][aria-pressed="true"] i { background: var(--ok); }
.tri button[data-v="b_gering"][aria-pressed="true"], .tri button[data-v="nicht_erledigt"][aria-pressed="true"], .tri button[data-v="gesetzt"][aria-pressed="true"] { background: var(--warn-soft); border-color: var(--warn); }
.tri button[data-v="b_gering"][aria-pressed="true"] i, .tri button[data-v="nicht_erledigt"][aria-pressed="true"] i, .tri button[data-v="gesetzt"][aria-pressed="true"] i { background: var(--warn); }
.tri button[data-v="b_erheblich"][aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad); }
.tri button[data-v="b_erheblich"][aria-pressed="true"] i { background: var(--bad); }
.tri button[data-v="o_b"] i, .tri button[data-v="erledigt"] i, .tri button[data-v="nein"] i { background: var(--ok-soft); border: 1.5px solid var(--ok); box-sizing: border-box; }
.tri button[data-v="b_gering"] i, .tri button[data-v="nicht_erledigt"] i, .tri button[data-v="gesetzt"] i { background: var(--warn-soft); border: 1.5px solid var(--warn); box-sizing: border-box; }
.tri button[data-v="b_erheblich"] i { background: var(--bad-soft); border: 1.5px solid var(--bad); box-sizing: border-box; }
@media (min-width: 760px) { .sheetwrap .panel { max-width: 760px; left: 50%; right: auto; width: 100%; transform: translateX(-50%); } }
