:root {
  --bg: #f2f0eb;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --ink: #191d27;
  --ink-2: #555c6b;
  --ink-3: #8a909d;
  --line: #e4e1d9;
  --primary: #191d27;
  --on-primary: #ffffff;
  --danger: #d93c2b;
  --star: #e8a400;
  --k-schaden: #e0562b;
  --k-baumangel: #c08410;
  --k-rechtsstreit: #4a5bd4;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(25, 29, 39, .05), 0 6px 20px rgba(25, 29, 39, .06);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #181b22;
    --surface-2: #1f232b;
    --ink: #eef0f4;
    --ink-2: #a9afbc;
    --ink-3: #737a88;
    --line: #2a2f39;
    --primary: #eef0f4;
    --on-primary: #11141a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 28px; height: 28px; }
.i.fill { fill: currentColor; stroke: none; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.hidden { display: none !important; }

#app { max-width: 720px; margin: 0 auto; padding-bottom: calc(110px + var(--safe-b)); }

/* ---------- App-Leiste ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-t)) 10px 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.appbar.scrolled { border-bottom-color: var(--line); }
.appbar .title { flex: 1; font-weight: 650; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.appbar.scrolled .title, .appbar .title.always { opacity: 1; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.iconbtn:active { background: var(--line); }
.iconbtn.back { color: var(--ink); }

.page { padding: 0 16px; }
.largetitle { font-size: 32px; font-weight: 750; letter-spacing: -.025em; margin: 2px 0 2px; line-height: 1.15; }
.subtitle { color: var(--ink-2); font-size: 15px; margin-bottom: 16px; }

/* ---------- Suche (Platzhalter) ---------- */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-radius: 14px; padding: 11px 14px;
  color: var(--ink-3); box-shadow: var(--shadow); margin-bottom: 18px;
}
.searchbar input { border: 0; outline: 0; background: none; flex: 1; color: var(--ink); min-width: 0; font-size: 16px; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.section-h h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.section-h .link { color: var(--ink-2); font-size: 14px; font-weight: 550; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.stat { background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.stat span { color: var(--ink-2); font-size: 13px; }

.seg { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 2px 16px; }
.seg::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 560; color: var(--ink-2); box-shadow: var(--shadow); white-space: nowrap;
}
.chip.on { background: var(--primary); color: var(--on-primary); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* Aktenkarte */
.case-list { display: grid; gap: 12px; }
.case-card { display: flex; gap: 14px; padding: 14px; align-items: stretch; position: relative; overflow: hidden; }
.case-card:active { transform: scale(.985); }
.case-card { transition: transform .15s; }
.case-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.case-cover {
  width: 74px; height: 74px; border-radius: 14px; flex: none; background: color-mix(in srgb, var(--c) 14%, var(--surface));
  display: grid; place-items: center; color: var(--c); overflow: hidden;
}
.case-cover img { width: 100%; height: 100%; object-fit: cover; }
.case-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.case-title { font-weight: 680; font-size: 17px; line-height: 1.25; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.case-sub { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-foot { display: flex; gap: 12px; color: var(--ink-3); font-size: 13px; margin-top: auto; align-items: center; flex-wrap: wrap; }
.case-foot span { display: inline-flex; align-items: center; gap: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--c);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink-2);
}
.pill.s-offen { background: color-mix(in srgb, #e0562b 14%, transparent); color: #d0491f; }
.pill.s-in_bearbeitung { background: color-mix(in srgb, #4a5bd4 15%, transparent); color: #4a5bd4; }
.pill.s-wartet { background: color-mix(in srgb, #c08410 16%, transparent); color: #a87200; }
.pill.s-abgeschlossen { background: color-mix(in srgb, #1f9d57 15%, transparent); color: #1b8a4c; }
@media (prefers-color-scheme: dark) {
  .pill.s-offen { color: #ff8a64; } .pill.s-in_bearbeitung { color: #8f9cff; }
  .pill.s-wartet { color: #f0b440; } .pill.s-abgeschlossen { color: #54d28b; }
}

/* Fristen */
.deadlines { padding: 4px 0; }
.dl-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-date { width: 46px; text-align: center; flex: none; border-radius: 12px; padding: 4px 0; background: var(--surface-2); }
.dl-date b { display: block; font-size: 18px; line-height: 1.1; }
.dl-date small { font-size: 11px; text-transform: uppercase; color: var(--ink-2); font-weight: 650; }
.dl-row.overdue .dl-date { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.dl-row.overdue .dl-date small { color: var(--danger); }
.dl-main { flex: 1; min-width: 0; }
.dl-main div { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-main small { color: var(--ink-2); }
.dl-rel { font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.overdue .dl-rel { color: var(--danger); }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: max(18px, calc(50% - 360px + 18px)); bottom: calc(22px + var(--safe-b)); z-index: 30;
  height: 58px; min-width: 58px; padding: 0 20px; border-radius: 29px;
  background: var(--primary); color: var(--on-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 650; font-size: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .14);
  transition: transform .15s;
}
.fab:active { transform: scale(.94); }
.fab .i { width: 24px; height: 24px; stroke-width: 2.2; }

/* ---------- Akte: Kopf ---------- */
.hero { padding: 4px 16px 0; }
.hero .meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 4px; }
.fact { background: var(--surface); border-radius: 14px; padding: 10px; text-align: center; box-shadow: var(--shadow); }
.fact b { display: block; font-size: 18px; font-weight: 720; }
.fact span { font-size: 12px; color: var(--ink-2); }

.tabs {
  position: sticky; top: calc(56px + var(--safe-t)); z-index: 15;
  display: flex; gap: 4px; margin: 14px 16px 12px; padding: 4px;
  background: color-mix(in srgb, var(--line) 70%, transparent); border-radius: 13px;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.tab { flex: 1; padding: 8px 4px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-align: center; }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }

/* ---------- Chronik ---------- */
.tl { position: relative; padding: 0 16px; }
.tl-month { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 10px 52px; }
.tl-month:first-child { margin-top: 4px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 12px; }
.tl-item::before { content: ""; position: absolute; left: 19px; top: 40px; bottom: -2px; width: 2px; background: var(--line); }
.tl-item.last::before { display: none; }
.tl-dot {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); position: relative; z-index: 1;
  border: 3px solid var(--bg);
}
.tl-dot .i { width: 19px; height: 19px; }
.tl-card { flex: 1; min-width: 0; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); transition: transform .15s; }
.tl-item:active .tl-card { transform: scale(.985); }
.tl-meta { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-3); font-weight: 560; }
.tl-meta .k { color: var(--c); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; }
.tl-meta .star { color: var(--star); margin-left: auto; }
.tl-title { font-weight: 640; margin-top: 3px; line-height: 1.3; }
.tl-body { color: var(--ink-2); font-size: 14.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tl-thumbs { display: flex; gap: 6px; margin-top: 10px; }
.tl-thumbs > div { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; display: grid; place-items: center; color: var(--ink-3); }
.tl-thumbs img, .tl-thumbs video { width: 100%; height: 100%; object-fit: cover; }
.tl-thumbs .more { font-weight: 700; color: var(--ink-2); }
.tl-foot { display: flex; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.tl-foot span { display: inline-flex; gap: 4px; align-items: center; }
.due { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 650; background: var(--surface-2); color: var(--ink-2); }
.due.overdue { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.due.done { background: color-mix(in srgb, #1f9d57 14%, transparent); color: #1b8a4c; text-decoration: line-through; }
.play-badge { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.18); }
.play-badge .i { width: 22px; height: 22px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }

/* ---------- Medien ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 16px; border-radius: 14px; overflow: hidden; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.grid > button { aspect-ratio: 1; position: relative; background: var(--surface-2); overflow: hidden; display: block; width: 100%; }
.grid img, .grid video { width: 100%; height: 100%; object-fit: cover; display: block; }

.list { margin: 0 16px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--line); }
.row .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--ink-3)) 14%, var(--surface)); color: var(--c, var(--ink-2)); flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .grow div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 560; }
.row .grow small { color: var(--ink-3); font-size: 13px; }
.row .chev { color: var(--ink-3); }

.empty { text-align: center; padding: 40px 24px; color: var(--ink-2); }
.empty .bubble { width: 84px; height: 84px; border-radius: 28px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); }
.empty .bubble .i { width: 38px; height: 38px; stroke-width: 1.5; }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 19px; }
.empty p { margin: 0 auto 18px; max-width: 320px; font-size: 15px; }

/* ---------- Details ---------- */
.kv { margin: 0 16px; padding: 4px 0; }
.kv > div { display: flex; gap: 12px; padding: 11px 14px; }
.kv > div + div { border-top: 1px solid var(--line); }
.kv dt { color: var(--ink-2); width: 42%; flex: none; font-size: 14.5px; }
.kv dd { margin: 0; font-weight: 560; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.box { margin: 12px 16px; padding: 14px 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: 14px; font-weight: 650; font-size: 16px;
  background: var(--primary); color: var(--on-primary); width: 100%;
}
.btn:active { opacity: .85; }
.btn:disabled { opacity: .5; }
.btn.secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.danger { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.btn.small { height: 38px; font-size: 14.5px; border-radius: 11px; padding: 0 14px; width: auto; }
.btn-row { display: flex; gap: 10px; margin: 14px 16px; }

/* ---------- Formulare ---------- */
.form { padding: 0 16px; display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin: 0 4px 6px; text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 13px;
  padding: 12px 14px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.field input[type="datetime-local"], .field input[type="date"] { min-height: 48px; }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink-3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink-3) 18%, transparent); }
.field .hint { font-size: 13px; color: var(--ink-3); margin: 6px 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kind-opt { padding: 14px 8px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); text-align: center; border: 2px solid transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; display: grid; justify-items: center; gap: 6px; }
.kind-opt .i { color: var(--c); width: 28px; height: 28px; }
.kind-opt.on { border-color: var(--c); color: var(--ink); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.switch input { width: 46px; height: 28px; -webkit-appearance: none; appearance: none; background: var(--line); border-radius: 14px; position: relative; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked { background: #1f9d57; }
.switch input:checked::after { transform: translateX(18px); }

.picked { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.picked > div { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); font-size: 11px; text-align: center; padding: 4px; }
.picked img, .picked video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.picked .rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; z-index: 2; }
.picked .rm .i { width: 14px; height: 14px; stroke-width: 2.4; }
.picked .fname { position: relative; z-index: 1; overflow-wrap: anywhere; line-height: 1.2; }
.addfiles { border: 2px dashed var(--line) !important; background: transparent !important; color: var(--ink-2) !important; display: grid !important; place-items: center; gap: 2px; font-weight: 600; font-size: 12px; }

/* ---------- Bottom-Sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 16, .42); opacity: 0; transition: opacity .25s; }
.overlay.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; margin: 0 auto; max-width: 720px;
  background: var(--bg); border-radius: 24px 24px 0 0; max-height: calc(100vh - 40px - var(--safe-t));
  display: flex; flex-direction: column; transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .25, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
}
.sheet.show { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 6px 12px 8px 20px; flex: none; }
.sheet-h h3 { flex: 1; margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sheet-c { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(18px + var(--safe-b)); flex: 1; }
.sheet-f { padding: 10px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; background: var(--bg); }
.sheet-f + .sheet-c, .sheet-c:has(+ .sheet-f) { padding-bottom: 12px; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 16px 8px; }
.action { background: var(--surface); border-radius: 18px; padding: 16px 6px 12px; display: grid; justify-items: center; gap: 8px; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.action .ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.action:active { transform: scale(.95); }
.action { transition: transform .12s; }
.help { margin: 0 16px; padding: 14px 16px; font-size: 14.5px; color: var(--ink-2); }
.help ol { margin: 6px 0 0; padding-left: 20px; }
.help li { margin: 3px 0; }

/* Fortschritt */
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 12px 0 8px; }
.progress div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; transition: all .25s;
  background: var(--primary); color: var(--on-primary); padding: 11px 18px; border-radius: 14px;
  font-weight: 560; font-size: 15px; box-shadow: 0 8px 30px rgba(0,0,0,.25); width: max-content; max-width: calc(100% - 40px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; color: #fff; }
.lb-top, .lb-bot { display: flex; align-items: center; gap: 6px; padding: calc(6px + var(--safe-t)) 8px 6px; z-index: 2; }
.lb-bot { padding: 10px 16px calc(14px + var(--safe-b)); flex-direction: column; align-items: stretch; gap: 2px; font-size: 14px; }
.lb-top .iconbtn { color: #fff; }
.lb-top .cnt { flex: 1; text-align: center; font-weight: 600; font-size: 15px; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-bot a { color: #9db4ff; font-weight: 600; }

/* ---------- Eintrag ---------- */
.entry-h { padding: 0 16px; }
.entry-h .kindline { display: flex; align-items: center; gap: 8px; color: var(--c); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.entry-h h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 6px 0 4px; font-weight: 720; overflow-wrap: anywhere; }
.entry-h .when { color: var(--ink-2); font-size: 15px; }
.starbtn { margin-left: auto; color: var(--ink-3); }
.starbtn.on { color: var(--star); }
.media-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: 14px 16px; border-radius: 16px; overflow: hidden; }
.media-strip.one { grid-template-columns: 1fr; }
.media-strip > button { aspect-ratio: 4/3; position: relative; overflow: hidden; background: var(--surface-2); }
.media-strip.one > button { aspect-ratio: auto; max-height: 70vh; }
.media-strip img, .media-strip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-strip.one img { object-fit: contain; max-height: 70vh; background: #000; }
details.hash { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
details.hash summary { cursor: pointer; list-style: none; display: inline-flex; gap: 4px; align-items: center; }
details.hash summary::-webkit-details-marker { display: none; }

/* ---------- Chat ---------- */
.chat-tools { display: flex; gap: 8px; padding: 0 16px 10px; align-items: center; }
.chat-tools .searchbar { margin: 0; flex: 1; padding: 9px 12px; }
.chat { padding: 6px 12px 20px; display: flex; flex-direction: column; gap: 3px;
  background: color-mix(in srgb, #d9cfc1 35%, var(--bg)); margin: 0 0; min-height: 50vh; }
@media (prefers-color-scheme: dark) { .chat { background: #0b0d11; } }
.day-sep { align-self: center; margin: 12px 0 6px; padding: 4px 12px; border-radius: 10px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow); }
.sys { align-self: center; max-width: 85%; text-align: center; font-size: 12.5px; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 5px 12px; border-radius: 10px; margin: 4px 0; }
.msg { max-width: 82%; align-self: flex-start; background: var(--surface); border-radius: 4px 16px 16px 16px; padding: 6px 10px 5px; box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; user-select: text; }
.msg.me { align-self: flex-end; background: #d8f8c8; border-radius: 16px 4px 16px 16px; }
@media (prefers-color-scheme: dark) { .msg.me { background: #1f4d33; } }
.msg.cont { border-radius: 16px; margin-top: -1px; }
.msg .who { font-size: 13px; font-weight: 700; margin-bottom: 1px; }
.msg .txt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; }
.msg .t { float: right; font-size: 11px; color: var(--ink-3); margin: 6px 0 -3px 10px; display: inline-flex; gap: 3px; align-items: center; }
.msg.star { box-shadow: 0 0 0 2px var(--star); }
.msg .att { margin: 2px -6px 4px; border-radius: 10px; overflow: hidden; display: block; max-width: 260px; }
.msg .att img, .msg .att video { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.msg .att audio { width: 240px; }
.msg .doc { display: flex; gap: 8px; align-items: center; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 10px; padding: 8px 10px; margin: 2px 0 4px; font-size: 14px; }
.msg mark { background: #ffe27a; color: #000; border-radius: 3px; }
.loadmore { align-self: center; margin: 10px; }

/* ---------- Vertragsversionen ---------- */
.vt { padding: 0 16px; }
.vt-item { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.vt-item::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.vt-item:last-child::before { display: none; }
.vt-node { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 750; background: var(--surface); color: var(--ink-2); border: 2px solid var(--line); z-index: 1; }
.vt-item.current .vt-node { background: var(--k-rechtsstreit); color: #fff; border-color: var(--k-rechtsstreit); }
.vt-card { flex: 1; min-width: 0; padding: 12px 14px; }
.vt-card .top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.vt-card .now { background: var(--k-rechtsstreit); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.vt-card h4 { margin: 4px 0 4px; font-size: 16.5px; }
.vt-card ul { margin: 6px 0 4px; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; }
.vt-card li { margin: 2px 0; }
.vt-files { margin-top: 8px; display: grid; gap: 6px; }
.vt-files a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; font-weight: 560; }
.vt-files a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; padding-top: calc(24px + var(--safe-t)); }
.login .card { width: 100%; max-width: 380px; padding: 28px 22px 22px; text-align: center; }
.login .logo { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 22px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.login .logo img { width: 100%; height: 100%; display: block; }
.login h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.login p { margin: 0 0 20px; color: var(--ink-2); }
.login .field { text-align: left; margin-bottom: 14px; }

.search-res h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 20px 8px; }
mark { background: color-mix(in srgb, #ffd23f 55%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--ink-2); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fade .22s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Bilderwand ---------- */
.board-top { padding: 0 16px 14px; display: grid; gap: 10px; }
.protocol-cta { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.protocol-cta .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, #d93c2b 13%, var(--surface)); color: #d93c2b; flex: none; }
.protocol-cta .grow { flex: 1; min-width: 0; display: grid; }
.protocol-cta small { color: var(--ink-2); font-size: 13.5px; }
.board-actions { display: flex; gap: 8px; }
.board-actions .btn { flex: 1; }
.board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px; }
@media (min-width: 600px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ph { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s; }
.ph:active { transform: scale(.97); }
.ph-img { aspect-ratio: 4/3; background: #1c1f26; overflow: hidden; display: flex; align-items: center; justify-content: center; container-type: size; }
.ph-img .inner { position: relative; display: inline-block; line-height: 0; }
.ph-img .inner img { display: block; max-width: 100cqw; max-height: 100cqh; }
.ph-no { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.ph-star { position: absolute; right: 8px; top: 8px; color: var(--star); filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.ph-cap { padding: 8px 10px 2px; font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-tags { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 10px 10px; margin-top: auto; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag .i { width: 13px; height: 13px; }
.tag.red { background: color-mix(in srgb, #d93c2b 14%, transparent); color: #d93c2b; }
.tag.orange { background: color-mix(in srgb, #e8590c 14%, transparent); color: #d3540b; }
.tag.sev-erheblich { background: #d93c2b; color: #fff; }
.tag.sev-mittel { background: color-mix(in srgb, #e8a400 22%, transparent); color: #9a6a00; }
.tag.sev-gering { background: color-mix(in srgb, #1f9d57 15%, transparent); color: #1b8a4c; }
.tag.st-offen { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.tag.st-bestaetigt { background: color-mix(in srgb, #e8590c 15%, transparent); color: #c24a08; }
.tag.st-abgelehnt { background: color-mix(in srgb, #555 15%, transparent); color: var(--ink-2); text-decoration: line-through; }
.tag.st-behoben { background: color-mix(in srgb, #1f9d57 15%, transparent); color: #1b8a4c; }
.legend { display: flex; gap: 16px; justify-content: center; margin: 16px; font-size: 12.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* Pins */
.pinwrap { position: relative; }
.pin {
  position: absolute; transform: translate(-50%, -50%); z-index: 2;
  box-sizing: content-box; min-width: 14px; height: 24px; padding: 0 5px; border-radius: 15px;
  background: var(--pc); color: #fff; font-weight: 800; font-size: 13px; line-height: 24px; white-space: nowrap;
  display: flex; align-items: center; justify-content: center; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.pin::before { content: ""; position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; transform: translate(-50%, -50%); border-radius: 50%; border: 2.5px solid var(--pc); background: color-mix(in srgb, var(--pc) 14%, transparent); z-index: -1; pointer-events: none; }
.pin.sm { min-width: 8px; width: 8px; height: 8px; padding: 0; border-width: 2px; }
.pin.sm::before { width: 26px; height: 26px; border-width: 1.5px; }

/* Foto-Detail */
.photo-stage { position: relative; background: #000; }
.photo-stage { text-align: center; line-height: 0; }
.pinwrap.big { display: inline-block; max-width: 100%; line-height: normal; vertical-align: top; }
.pinwrap.big img { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; }
.markhint { display: none; position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(0,0,0,.7); color: #fff; padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; align-items: center; gap: 6px; z-index: 3; }
.marking { cursor: crosshair; outline: 3px solid #2f6fe4; outline-offset: -3px; }
.marking .markhint { display: inline-flex; }
.navbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; z-index: 4; }
.navbtn.l { left: 8px; } .navbtn.r { right: 8px; }
.photo-tools { display: flex; gap: 8px; padding: 12px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.photo-tools .btn { flex: none; }
.starbtn2.on { color: var(--star); }
.photo-meta { padding: 8px 20px 4px; }
.photo-meta .cap { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.photo-meta .cap.editable { cursor: pointer; }
.anns { display: grid; gap: 10px; padding: 12px 16px 20px; }
.ann { padding: 12px 14px; transition: box-shadow .3s; }
.ann.flash { box-shadow: 0 0 0 3px #2f6fe4; }
.ann-h { display: flex; gap: 10px; align-items: center; }
.ann-h .grow { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.3; }
.pinbadge { min-width: 32px; height: 32px; padding: 0 7px; border-radius: 16px; background: var(--pc); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex: none; }
.pinbadge .i { width: 16px; height: 16px; }
.rolebadge { font-size: 11px; font-weight: 700; color: #fff; background: #e8590c; padding: 1px 7px; border-radius: 999px; vertical-align: 1px; }
.defect-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ann-t { margin-top: 8px; font-size: 15.5px; }
.reply { margin: 10px 0 0 14px; padding: 8px 12px; border-left: 3px solid var(--line); font-size: 14.5px; }
.linkbtn { color: var(--ink-3); font-size: 13px; text-decoration: underline; margin-left: 4px; }
.replyform { display: flex; gap: 6px; align-items: center; margin-top: 10px; background: var(--surface-2); border-radius: 12px; padding: 2px 2px 2px 12px; }
.replyform input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; padding: 8px 0; min-width: 0; }
.pinwrap.mini { border-radius: 12px; overflow: hidden; display: block; width: max-content; max-width: 100%; margin: 0 auto; line-height: 0; }
.pinwrap.mini img { display: block; max-height: 180px; max-width: 100%; }
.defect-sw { border-color: color-mix(in srgb, #d93c2b 35%, var(--line)); }
.segctl { display: flex; background: color-mix(in srgb, var(--line) 70%, transparent); border-radius: 12px; padding: 3px; gap: 3px; }
.segctl button { flex: 1; padding: 9px 4px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.segctl button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

/* Mängelprotokoll */
.proto { background: #fff; color: #1b1f2a; margin: 4px 12px 30px; border-radius: 16px; padding: 22px 18px; box-shadow: var(--shadow); }
.proto-kicker { font-size: 13px; font-weight: 700; color: #d93c2b; }
.proto h1 { font-size: 26px; line-height: 1.15; margin: 4px 0 14px; letter-spacing: -.02em; }
.proto-meta { border-collapse: collapse; width: 100%; font-size: 14px; }
.proto-meta th { text-align: left; font-weight: 600; color: #5b6272; padding: 4px 12px 4px 0; width: 40%; vertical-align: top; }
.proto-meta td { padding: 4px 0; }
.proto-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 6px; padding: 10px 0; border-top: 2px solid #1b1f2a; border-bottom: 1px solid #ddd; font-size: 14px; }
.proto-sum .sev-erheblich b { color: #d93c2b; }
.dsec { border-bottom: 1px solid #e3e3e3; padding: 16px 0; break-inside: avoid; page-break-inside: avoid; }
.defect-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.defect-h .grow { flex: 1; min-width: 140px; }
.dno { background: #d93c2b; color: #fff; font-weight: 800; border-radius: 8px; padding: 3px 8px; font-size: 14px; }
.defect-b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 10px; }
@media (min-width: 560px) { .defect-b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dimg { border-radius: 10px; overflow: hidden; display: block; width: max-content; max-width: 100%; line-height: 0; }
.dimg img { display: block; max-width: 100%; max-height: 300px; }
.dimg .pin::before { width: 56px; height: 56px; }
.dcom { margin-top: 10px; padding: 8px 10px; background: #f6f5f2; border-radius: 8px; font-size: 14px; display: grid; gap: 4px; }
.dline { margin-top: 14px; font-size: 13.5px; color: #5b6272; }
.proto-sign { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 46px; font-size: 12px; color: #5b6272; }
.proto-sign span { display: block; border-top: 1px solid #1b1f2a; margin-bottom: 4px; }
.proto .tag.st-offen { background: #f2f2f2; color: #1b1f2a; }

@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .appbar, .noprint, .fab, .toast, .demo-flag { display: none !important; }
  #app { padding: 0; max-width: none; }
  .proto { box-shadow: none; margin: 0; padding: 0; border-radius: 0; }
  .defect-b { grid-template-columns: 1fr 1fr; }
  .tag, .dno, .pin { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Abschnitte */
.sel-row { display: flex; justify-content: space-between; padding: 4px 18px 8px; }
.sel-row .linkbtn { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.sec { margin-bottom: 8px; }
.sec-h { position: sticky; top: calc(56px + var(--safe-t)); z-index: 5; display: flex; align-items: center; gap: 2px; padding: 4px 8px 4px 12px; margin: 0 4px 8px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 12px; }
.sec-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 0; text-align: left; }
.sec-chev { display: grid; place-items: center; width: 22px; height: 22px; transition: transform .2s; transform: rotate(90deg); color: var(--ink-2); }
.sec.collapsed .sec-chev { transform: rotate(0deg); }
.sec-name { font-size: 18px; font-weight: 720; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-count { font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--surface); border-radius: 999px; padding: 1px 8px; box-shadow: var(--shadow); }
.sec.collapsed .sec-body { display: none; }
.sec.collapsed .sec-h { margin-bottom: 2px; }
.sec.unassigned .sec-name { color: var(--ink-2); }
.sec-hint { margin: -2px 18px 10px; font-size: 13.5px; color: var(--ink-3); }
.sec.collapsed .sec-hint { display: none; }
.sec-empty { grid-column: 1 / -1; border: 2px dashed var(--line); border-radius: 14px; padding: 18px; text-align: center; color: var(--ink-3); font-size: 14px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.ph.selected { box-shadow: 0 0 0 3px #2f6fe4; }
.ph-check { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); display: grid; place-items: center; color: #fff; }
.ph.selected .ph-check { background: #2f6fe4; }
.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 18px; background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 30px rgba(0,0,0,.3); width: max-content; max-width: calc(100% - 24px); font-weight: 650; }
.selbar .btn { background: var(--on-primary); color: var(--primary); }
.fab.hidden { display: none; }
.sec-h { top: calc(112px + var(--safe-t)); }
#tab.guest .sec-h { top: calc(56px + var(--safe-t)); }
.board-actions .btn { white-space: nowrap; padding: 0 10px; gap: 5px; font-size: 14px; }

/* ======================= Neues Layout (Galerie-Konzept) ======================= */
/* Akte-Kopf */
.chead { padding: 2px 16px 0; }
.chead h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; font-weight: 760; text-wrap: balance; }
.chead-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill.warn { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.tabs { margin: 14px 16px 10px; }
#tab.flush { margin: 0; }

/* Galerie */
.gal-bar { display: flex; align-items: center; gap: 2px; padding: 0 10px 6px 16px; }
.gal-bar .grow { flex: 1; }
.segctl.small { width: 200px; padding: 2px; }
.segctl.small button { padding: 6px 4px; font-size: 13.5px; }
.gal-filter { margin: 0 0 8px !important; padding: 2px 16px !important; }
.gal-filter .chip { padding: 5px 11px; font-size: 13.5px; box-shadow: none; background: var(--surface); }
.gal-filter .chip.on { background: var(--primary); }
.gg { margin-bottom: 4px; }
.gg-h { position: sticky; top: calc(108px + var(--safe-t)); z-index: 6; display: flex; align-items: center; gap: 2px; padding: 8px 8px 6px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.gg-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; }
.gg-name { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gg-h.sec .gg-name { font-size: 17px; }
.gg-n { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.gg-d { font-size: 12px; font-weight: 700; color: #d93c2b; }
.iconbtn.sm { width: 34px; height: 34px; }
.gg.collapsed .gg-b { display: none; }
.gg.collapsed .sec-chev { transform: rotate(0deg); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); display: block; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tile.sel img { transform: scale(.86); border-radius: 8px; }
.tile.sel { background: color-mix(in srgb, #2f6fe4 22%, var(--bg)); }
.tb { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; padding: 4px; justify-content: flex-end; pointer-events: none; background: linear-gradient(transparent, rgba(0,0,0,.35)); }
.tb:empty { display: none; }
.tb i { font-style: normal; display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.tb i .i { width: 13px; height: 13px; }
.tb .df { background: #d93c2b; border-radius: 9px; min-width: 18px; height: 18px; justify-content: center; padding: 0 5px; text-shadow: none; }
.tb .st { color: var(--star); }
.tcheck { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); display: grid; place-items: center; color: #fff; }
.tile.sel .tcheck { background: #2f6fe4; }
.selbar .iconbtn { color: var(--on-primary); }
.sec-empty { margin: 0 16px 8px; }

/* Einstieg */
.onboard { margin: 6px 16px; padding: 18px 18px 8px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); }
.onboard h2 { margin: 0 0 12px; font-size: 20px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: st; }
.steps li { position: relative; padding: 0 0 18px 46px; counter-increment: st; display: grid; gap: 4px; justify-items: start; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); color: var(--ink-2); }
.steps li.now::before { background: var(--primary); color: var(--on-primary); }
.steps li::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps b { font-size: 16px; }
.steps span { color: var(--ink-2); font-size: 14.5px; }
.steps .btn { margin-top: 6px; }

/* Vollbild-Ansicht */
body.viewer-on { background: #000; }
body.viewer-on #app { max-width: none; padding-bottom: 0; }
.viewer { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; z-index: 50; }
.v-top { display: flex; align-items: center; gap: 4px; padding: calc(6px + var(--safe-t)) 6px 6px; transition: opacity .2s; }
.v-top .iconbtn, .v-bar button { color: #fff; }
.v-top .iconbtn:active { background: rgba(255,255,255,.12); }
.v-top .iconbtn.on { color: var(--star); }
.v-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.v-title b { font-size: 15.5px; }
.v-title small { opacity: .65; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; touch-action: pan-y pinch-zoom; }
.v-img { display: inline-block; line-height: 0; max-width: 100%; max-height: 100%; }
.v-img img { display: block; max-width: 100vw; max-height: calc(100vh - 190px - var(--safe-t) - var(--safe-b)); width: auto; height: auto; }
.v-stage .markhint { display: none; }
.v-stage.marking { outline: none; cursor: crosshair; }
.v-stage.marking .markhint { display: inline-flex; top: 10px; }
.v-stage.marking .v-img { outline: 3px dashed #2f6fe4; outline-offset: 2px; }
.v-cap { padding: 8px 18px 0; font-size: 15px; font-weight: 600; min-height: 30px; transition: opacity .2s; }
.v-bar { display: flex; justify-content: space-around; padding: 6px 8px calc(10px + var(--safe-b)); transition: opacity .2s; }
.v-bar button { display: grid; justify-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 12px; min-width: 76px; }
.v-bar button:active { background: rgba(255,255,255,.12); }
.chrome-off .v-top, .chrome-off .v-bar, .chrome-off .v-cap, .chrome-off .navbtn { opacity: 0; pointer-events: none; }
.chrome-off .pin { opacity: .35; }
@media (hover: none) { .viewer .navbtn { display: none; } }
.sheet.panel { max-height: 62vh; }
.sheet.panel .anns { padding-top: 0; }
.composer { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2px 2px 2px 14px; }
.composer input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; padding: 10px 0; min-width: 0; }

/* Mängel-Übersicht */
.dstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 2px 16px 12px; }
.dstats div { background: var(--surface); border-radius: 14px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow); }
.dstats b { display: block; font-size: 22px; font-weight: 780; }
.dstats span { font-size: 12px; color: var(--ink-2); }
.dstats .o b { color: var(--danger); } .dstats .c b { color: #d3540b; } .dstats .ok b { color: #1b8a4c; }
.dlist { display: grid; gap: 10px; padding: 0 16px 20px; }
.drow { display: flex; gap: 12px; padding: 10px; align-items: stretch; }
.crop { position: relative; width: 86px; height: 86px; flex: none; border-radius: 12px; background-size: 360%; background-repeat: no-repeat; background-color: var(--surface-2); overflow: hidden; }
.crop .cpin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%); border: 2.5px solid #d93c2b; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.crop b { position: absolute; left: 5px; top: 5px; background: #d93c2b; color: #fff; font-size: 11.5px; border-radius: 6px; padding: 1px 5px; }
.drow .grow { flex: 1; min-width: 0; display: grid; align-content: start; gap: 3px; }
.dl1 { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl2 { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl3 { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 3px; font-size: 12.5px; }

/* Startseite: Akten als Alben */
.albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 600px) { .albums { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.album { display: block; transition: transform .15s; }
.album:active { transform: scale(.97); }
.album-cover { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; display: grid; gap: 2px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: var(--shadow); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.album-cover.n2 { grid-template-columns: 1fr 1fr; }
.album-cover.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.album-cover.n3 img:first-child { grid-row: 1 / 3; }
.album-cover .ph-empty { display: grid; place-items: center; color: var(--c); }
.album-def { position: absolute; left: 8px; bottom: 8px; background: #d93c2b; color: #fff; font-size: 12px; font-weight: 750; padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.album-info { padding: 8px 2px 0; }
.album-kind { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--ink-3); }
.album-kind .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.album-title { font-weight: 700; font-size: 15.5px; line-height: 1.25; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.album-sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-dl { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.album-dl.over { color: var(--danger); }
.dl-strip { padding: 2px 0; margin-top: 6px; }
.dl-mini { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.dl-mini + .dl-mini { border-top: 1px solid var(--line); }
.dl-mini .grow { flex: 1; min-width: 0; display: grid; }
.dl-mini b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-mini small { color: var(--ink-3); font-size: 12.5px; }
.dl-mini em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.dl-mini.overdue em, .dl-mini.overdue .i { color: var(--danger); }
details.more { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
details.more summary { list-style: none; cursor: pointer; font-weight: 650; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .i { transform: rotate(90deg); }
details.more .form { padding-left: 0; padding-right: 0; }

/* ======================= Schadbilder: schnell markieren ======================= */
.btn.dmg { background: #d93c2b; color: #fff; }
.qchips { display: flex; flex-wrap: wrap; gap: 7px; }
.sheet-f .qchips { margin-bottom: 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.qchip { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.qchip.on { background: color-mix(in srgb, #d93c2b 12%, var(--surface)); border-color: #d93c2b; color: #d93c2b; }
.tile.dmg::after { content: ""; position: absolute; inset: 0; border: 3px solid #d93c2b; pointer-events: none; }
.tile.sel.dmg::after { border-radius: 8px; inset: 7%; }
.tdmg { position: absolute; right: 5px; top: 5px; width: 22px; height: 22px; border-radius: 50%; background: #d93c2b; color: #fff; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.tdmg .i { width: 13px; height: 13px; stroke-width: 2.4; }
.selbtn { height: 34px; }
.selbar { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 10px 8px; width: min(440px, calc(100% - 20px)); border-radius: 20px; }
.selhead { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; font-size: 14px; }
.selhead .linkbtn { color: var(--on-primary); opacity: .8; font-size: 14px; }
.selacts { display: flex; justify-content: space-around; gap: 4px; }
.sa { display: grid; justify-items: center; gap: 3px; color: var(--on-primary); font-size: 11.5px; font-weight: 650; padding: 6px 8px; border-radius: 12px; flex: 1; }
.sa:active { background: rgba(127,127,127,.25); }
.sa.dmg { background: #d93c2b; color: #fff; }
.v-bar button.dmg-on { color: #fff; background: #d93c2b; }
.v-img.dmg { outline: 3px solid #d93c2b; outline-offset: -3px; }
.dcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 24px; }
@media (min-width: 600px) { .dcards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dcard { overflow: hidden; display: flex; flex-direction: column; }
.dc-img { position: relative; aspect-ratio: 4/3; background: #1c1f26; display: flex; align-items: center; justify-content: center; container-type: size; border-bottom: 3px solid #d93c2b; }
.dc-img .inner { position: relative; display: inline-block; line-height: 0; }
.dc-img .inner img { display: block; max-width: 100cqw; max-height: 100cqh; }
.dc-no { position: absolute; left: 8px; top: 8px; background: #d93c2b; color: #fff; font-size: 12.5px; font-weight: 800; border-radius: 8px; padding: 2px 8px; }
.dc-t { padding: 8px 10px 10px; display: grid; gap: 3px; }
.dc-cap { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-c { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-f { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.dc-f .i { width: 13px; height: 13px; }
.dpin { font-size: 14px; margin-bottom: 6px; line-height: 1.5; }

/* ======================= Zeichnen ======================= */
.dover { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.editor { position: fixed; inset: 0; z-index: 90; background: #0b0b0d; color: #fff; display: flex; flex-direction: column; }
.ed-top { display: flex; align-items: center; justify-content: space-between; padding: calc(8px + var(--safe-t)) 12px 8px; }
.ed-top b { font-size: 16px; }
.ed-txt { color: #fff; font-size: 16px; padding: 8px 6px; opacity: .85; }
.ed-txt.strong { font-weight: 750; color: #ffd60a; opacity: 1; }
.ed-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px; }
.ed-wrap { position: relative; display: inline-block; line-height: 0; }
.ed-wrap img { display: block; max-width: calc(100vw - 8px); max-height: calc(100vh - 230px - var(--safe-t) - var(--safe-b)); width: auto; height: auto; user-select: none; -webkit-user-drag: none; }
.ed-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.ed-tools { display: flex; justify-content: space-around; padding: 6px 6px 2px; }
.ed-tools button { display: grid; justify-items: center; gap: 2px; color: rgba(255,255,255,.75); font-size: 11.5px; font-weight: 600; padding: 6px 6px; border-radius: 12px; min-width: 52px; }
.ed-tools button.on { color: #111; background: #ffd60a; }
.ed-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.ed-row .iconbtn { color: #fff; }
.ed-cols { display: flex; gap: 8px; }
.ed-cols button { width: 28px; height: 28px; border-radius: 50%; background: var(--sw); border: 2px solid rgba(255,255,255,.35); }
.ed-cols button.on { border-color: #fff; box-shadow: 0 0 0 2px #ffd60a; }
.ed-sizes { display: flex; gap: 2px; margin-left: auto; }
.ed-sizes button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.ed-sizes button i { display: block; border-radius: 50%; background: #fff; }
.ed-sizes button.on { background: rgba(255,255,255,.18); }
.ed-dmg { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 2px 0 calc(10px + var(--safe-b)); font-size: 14px; font-weight: 600; }
.ed-dmg input { width: 20px; height: 20px; accent-color: #d93c2b; }
.editor:not(:has(.ed-dmg)) .ed-row { padding-bottom: calc(10px + var(--safe-b)); }
.v-bar button { min-width: 64px; padding: 6px 6px; }

/* Schadbilder-Streifen über der Galerie */
.dstrip { display: flex; align-items: center; gap: 10px; margin: 0 16px 12px; padding: 10px 12px; border-left: 4px solid #d93c2b; }
.ds-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, #d93c2b 14%, var(--surface)); color: #d93c2b; flex: none; }
.dstrip .grow { flex: 1; min-width: 0; display: grid; }
.dstrip small { color: var(--ink-2); font-size: 13px; }
.ds-th { display: flex; }
.ds-th img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; border: 2px solid var(--surface); margin-left: -10px; }
.upd-head { text-align: center; }
.upd-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.upd-notes { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14.5px; }
.upd-notes li { margin: 3px 0; }

/* NAS */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0 18px 10px; font-size: 14px; color: var(--ink-3); }
.crumbs button { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; color: var(--ink-2); padding: 4px 6px; border-radius: 8px; }
.crumbs button:last-child { color: var(--ink); }
.nas-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 8px; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.nas-tiles { padding: 0 2px; }
.nas-tiles .tile { border: 0; padding: 0; }
.nas-tiles .tile.linked img { opacity: .4; }
.nas-tiles .tile.sel img { transform: scale(.86); border-radius: 8px; }
.nas-tiles .tile.sel .tcheck, .tcheck.on { background: #2f6fe4; }
/* Auswahl ohne Neuladen der Bilder */
.gal .tile .tcheck { display: none; }
.selecting .gal .tile .tcheck { display: grid; }

/* ======================= Professionelles dunkles Design (BauDoku) ======================= */
:root {
  --bg: #0b0d10; --surface: #14171c; --surface-2: #1c2027; --ink: #e9ecf1; --ink-2: #a3acb9; --ink-3: #6c7684;
  --line: #252a33; --primary: #3d7bff; --on-primary: #ffffff; --danger: #ff5247; --star: #ffc53d;
  --radius: 14px; --shadow: none; color-scheme: dark;
  --k-schaden: #ff6a3d; --k-baumangel: #f0a020; --k-rechtsstreit: #7b8cff;
}
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; font-feature-settings: "cv11", "ss01"; letter-spacing: -.005em; }
.card, .stat, .fact, .searchbar, .dstats div, .kind-opt, .action, .ph, .dcard, .onboard, .tl-card, .album-cover, .switch, details.more, .composer, .proto-opts .chip { box-shadow: none; border: 1px solid var(--line); }
.chip, .gal-filter .chip { background: var(--surface); border: 1px solid var(--line); box-shadow: none; color: var(--ink-2); }
.chip.on, .gal-filter .chip.on { background: var(--ink); color: #0b0d10; border-color: var(--ink); }
.appbar { background: rgba(11, 13, 16, .82); }
.appbar.scrolled { border-bottom-color: var(--line); }
.largetitle { font-weight: 700; letter-spacing: -.03em; }
.tabs { background: var(--surface); border: 1px solid var(--line); }
.tab.on { background: var(--surface-2); box-shadow: none; color: var(--ink); }
.segctl { background: var(--surface); border: 1px solid var(--line); }
.segctl button.on { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: rgba(255, 82, 71, .12); }
.field input, .field select, .field textarea { background: var(--surface); border-color: var(--line); }
.fab { box-shadow: 0 8px 28px rgba(61, 123, 255, .35), 0 2px 6px rgba(0, 0, 0, .5); }
.overlay { background: rgba(0, 0, 0, .6); }
.sheet { background: #101318; border-top: 1px solid var(--line); box-shadow: 0 -12px 40px rgba(0, 0, 0, .5); }
.sheet-f { background: #101318; }
.sheet .grab { background: #2e343e; }
.toast { background: var(--surface-2); color: var(--ink); border: 1px solid #323946; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.err { background: #3a1513; border-color: #6b2420; color: #ffb4ad; }
.selbar { background: #1a1e25; color: var(--ink); border: 1px solid #2d333d; box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.sa, .selhead .linkbtn, .selbar .iconbtn { color: var(--ink); }
.sa.dmg { background: var(--danger); color: #fff; }
.pill { background: var(--surface-2); }
.pill.s-offen { background: rgba(255, 106, 61, .14); color: #ff8a64; }
.pill.s-in_bearbeitung { background: rgba(123, 140, 255, .16); color: #9fabff; }
.pill.s-wartet { background: rgba(240, 160, 32, .16); color: #f3b64a; }
.pill.s-abgeschlossen { background: rgba(52, 199, 120, .15); color: #5ad191; }
.tag { background: var(--surface-2); }
.tag.sev-mittel { color: #f3b64a; background: rgba(240, 160, 32, .16); }
.tag.sev-gering { color: #5ad191; background: rgba(52, 199, 120, .14); }
.tag.st-offen { background: transparent; color: var(--ink); border: 1px solid #39404b; }
.tag.st-bestaetigt { color: #ff9a5c; }
.tag.st-behoben { color: #5ad191; }
.msg.me { background: #1d4a33; }
.chat { background: #090b0e; }
.empty .bubble { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.dstrip { border-left-color: var(--danger); }
.ds-ico, .protocol-cta .ico { background: rgba(255, 82, 71, .14); color: var(--danger); }
.ds-th img { border-color: var(--surface); }
.gg-h { background: rgba(11, 13, 16, .88); }
.tile { background: #15181d; }
.ph-img, .dc-img { background: #090b0e; }
.album-cover { background: #15181d; }
.album-def { background: var(--danger); }
.steps li::before { background: var(--surface-2); }
.steps li.now::before { background: var(--primary); color: #fff; }
.qchip { background: var(--surface); }
.qchip.on { background: rgba(255, 82, 71, .14); border-color: var(--danger); color: #ff8a80; }
.upd-head { background: linear-gradient(180deg, #161a20, #12151a); }
.help { color: var(--ink-2); }
mark { background: rgba(255, 197, 61, .35); }
.login .card { background: #12151a; }
/* Marke auf der Startseite */
.brand { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); }
.brand b { display: block; font-size: 24px; letter-spacing: -.03em; line-height: 1.1; }
.brand span { font-size: 13.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; }

/* Gutachter-Prüfung */
.btn.review { background: #e5a50a; color: #111; }
.rstrip { border-left-color: #e5a50a !important; width: calc(100% - 32px); text-align: left; color: inherit; }
.rstrip .ds-ico { background: rgba(229, 165, 10, .16); color: #f2bc3b; }
.trev { position: absolute; left: 5px; top: 5px; width: 22px; height: 22px; border-radius: 50%; background: #e5a50a; color: #111; font-weight: 900; font-size: 13px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.trev.no { background: #4a515c; color: #fff; }
.trev .i { width: 12px; height: 12px; stroke-width: 2.6; }
.selecting .gal .tile .trev { display: none; }
.sa.rev { color: #f2bc3b; }
.album-rev { position: absolute; right: 8px; bottom: 8px; background: #e5a50a; color: #111; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.v-review { margin: 8px 12px 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; display: grid; gap: 8px; }
.v-review.pending { background: rgba(229, 165, 10, .14); border: 1px solid rgba(229, 165, 10, .45); }
.v-review.ok { background: rgba(255, 82, 71, .12); border: 1px solid rgba(255, 82, 71, .4); }
.v-review.no { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .15); }
.vr-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vr-b { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.vr-b .btn { flex: 1; }
.vr-b .linkbtn { color: #f2bc3b; }
.vr-n { color: rgba(255, 255, 255, .8); font-style: italic; }
.pconf { margin-top: 4px; font-size: 13px; color: #b3261e; font-weight: 600; }
.v-stage { container-type: size; }
.v-img img { max-width: 100cqw; max-height: 100cqh; }

/* ======================= Gutachter-Ansicht ======================= */
.preview-bar { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 8px 12px; border-radius: 12px; background: rgba(232, 89, 12, .14); color: #ff9a5c; font-size: 13.5px; font-weight: 600; border: 1px solid rgba(232, 89, 12, .35); }
.preview-bar a { margin-left: auto; color: var(--ink); text-decoration: underline; }
.gpill { background: rgba(232, 89, 12, .15) !important; color: #ff9a5c !important; }
.ghome { padding: 0 16px 30px; }
.ghello { display: grid; gap: 4px; margin: 4px 0 14px; }
.ghello b { font-size: 19px; letter-spacing: -.01em; }
.ghello span { color: var(--ink-2); font-size: 15px; }
.ghello span b { font-size: inherit; color: var(--ink); }
.gnew { color: #f2bc3b !important; font-size: 13.5px !important; font-weight: 600; }
.gstart { height: 56px; font-size: 17px; border-radius: 16px; margin-bottom: 14px; }
.gprog { margin-bottom: 14px; }
.gp-l { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); }
.gp-l b { color: var(--ink); }
.gprog .progress div { background: #34c778; }
.gtasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gtask { display: grid; gap: 2px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); position: relative; min-height: 118px; align-content: end; }
.gtask:active { transform: scale(.98); }
.gt-ico { position: absolute; left: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.gtask b { font-size: 26px; font-weight: 780; letter-spacing: -.02em; line-height: 1.1; min-height: 4px; }
.gtask span { font-weight: 650; font-size: 14.5px; }
.gtask small { color: var(--ink-3); font-size: 12.5px; }
.gtask.y .gt-ico { background: rgba(229, 165, 10, .16); color: #f2bc3b; }
.gtask.y b { color: #f2bc3b; }
.gtask.r .gt-ico { background: rgba(255, 82, 71, .14); color: var(--danger); }
.gtask.b .gt-ico { background: rgba(61, 123, 255, .15); color: #7aa5ff; }
/* Prüfmodus */
.review-mode .v-stage { min-height: 0; }
.rv-bar { height: 3px; background: rgba(255, 255, 255, .12); margin: 0 12px; border-radius: 2px; overflow: hidden; }
.rv-bar div { height: 100%; background: #f2bc3b; }
.rv-panel { padding: 10px 14px calc(12px + var(--safe-b)); display: grid; gap: 8px; background: #0f1216; border-top: 1px solid #222832; }
.rv-cap { font-weight: 650; font-size: 15px; }
.rv-notes { display: grid; gap: 4px; max-height: 92px; overflow-y: auto; }
.rv-note { font-size: 13.5px; color: #c9cfd8; background: #171b21; border-radius: 10px; padding: 6px 10px; }
.rv-note.me { border-left: 3px solid #e8590c; }
.rv-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.rv-input { background: #171b21; border-color: #262c36; }
.rv-input input { color: #fff; }
.rv-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rv-actions .btn { height: 54px; font-size: 16.5px; }
.rv-skip { justify-self: center; color: #9aa3ae; }
.rv-fin { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.rv-fin h2 { margin: 6px 0 0; font-size: 24px; }
.rv-fin p { margin: 0 0 10px; color: #9aa3ae; }
.rv-fin .btn { width: 280px; }
.rv-check { width: 76px; height: 76px; border-radius: 50%; background: rgba(52, 199, 120, .16); color: #5ad191; display: grid; place-items: center; }

/* ======================= Befund-Status (Ursprung + Entscheidung) ======================= */
.tbadge { position: absolute; right: 5px; top: 5px; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.45); font-weight: 900; font-size: 13px; }
.tbadge .i { width: 13px; height: 13px; stroke-width: 2.4; }
.tbadge.dmg { background: var(--danger); color: #fff; }
.tbadge.dmg.pend { background: #1a1d22; color: var(--danger); border: 2px solid var(--danger); }
.tbadge.unsure { background: #e5a50a; color: #111; }
.tbadge.no { background: #4a515c; color: #fff; }
.tbadge i { position: absolute; right: -5px; bottom: -5px; width: 15px; height: 15px; border-radius: 50%; background: #34c778; display: grid; place-items: center; font-style: normal; border: 1.5px solid #0b0d10; }
.tbadge i .i { width: 9px; height: 9px; stroke-width: 3.4; color: #fff; }
.tbadge i.ga { background: #e8590c; width: auto; padding: 0 3px; border-radius: 6px; font-size: 8.5px; font-weight: 900; color: #fff; right: -8px; }
.tile.dmg::after { border-width: 3px; }
.tile.pend::after { content: ""; position: absolute; inset: 0; border: 3px dashed var(--danger); pointer-events: none; }
.tile.unsure::after { content: ""; position: absolute; inset: 0; border: 3px solid #e5a50a; pointer-events: none; }
.tile.no img { opacity: .55; }
.fchip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 750; padding: 2px 8px; border-radius: 999px; width: fit-content; }
.fchip .i { width: 12px; height: 12px; }
.fchip.pend { color: #ff8a80; border: 1px dashed #ff5247; }
.fchip.unsure { color: #f2bc3b; background: rgba(229,165,10,.14); }
.fchip.ok { color: #fff; background: #c0392b; }
.fchip.ga { color: #fff; background: #d35400; }
.fchip.no { color: #b8bec8; background: #2a2f37; text-decoration: line-through; }
.dcard.pend .dc-img { border-bottom-style: dashed; }
.dcard.unsure .dc-img { border-bottom-color: #e5a50a; }
.dcard.no .dc-img { border-bottom-color: #4a515c; }
.dcard.no img { opacity: .55; }
.dstats button { background: var(--surface); border-radius: 14px; padding: 10px 6px; text-align: center; border: 1px solid var(--line); color: inherit; }
.dstats button b { display: block; font-size: 22px; font-weight: 780; }
.dstats button span { font-size: 11.5px; color: var(--ink-2); }
.dstats .y b { color: #f2bc3b; } .dstats .ok b { color: #5ad191; } .dstats .o b { color: var(--danger); }
.flegend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 18px 12px; font-size: 12px; color: var(--ink-3); }
.flegend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.lg.pend { border: 2px dashed var(--danger); } .lg.unsure { background: #e5a50a; } .lg.ga { background: #d35400; } .lg.ok { background: #c0392b; }
.fexplain { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.c-red { color: #ff6b61; } .c-yel { color: #f2bc3b; }
.two-btn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.v-bar button.fbtn.pend { color: #ff8a80; }
.v-bar button.fbtn.unsure { color: #f2bc3b; }
.v-bar button.fbtn.ok, .v-bar button.fbtn.ga { background: var(--danger); color: #fff; }
.v-bar button.fbtn.no { color: #9aa3ae; }
.v-review.pend { background: rgba(255, 82, 71, .08); border: 1px dashed rgba(255, 82, 71, .6); }
.v-review.unsure { background: rgba(229, 165, 10, .14); border: 1px solid rgba(229, 165, 10, .45); }
.v-review.ga { background: rgba(211, 84, 0, .16); border: 1px solid rgba(211, 84, 0, .5); }
.vr-m { font-size: 12.5px; color: rgba(255,255,255,.65); }
.rv-type { font-size: 13.5px; font-weight: 650; display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 10px; }
.rv-type.pend { color: #ff8a80; border: 1px dashed rgba(255,82,71,.6); }
.rv-type.unsure { color: #f2bc3b; background: rgba(229,165,10,.12); }
.pstat { margin-top: 4px; font-size: 13px; font-weight: 600; color: #444; }
.pstat.ok, .pstat.ga { color: #b3261e; } .pstat.pend { color: #8a5a00; }
.prej-h { font-size: 16px; margin: 26px 0 8px; }
.prej { width: 100%; border-collapse: collapse; font-size: 13px; }
.prej td { border-top: 1px solid #ddd; padding: 6px 8px 6px 0; vertical-align: top; }
/* Gutachter-Kacheln: Zahl nicht unter dem Symbol */
.gtask { padding-top: 58px; }
