/* Orchidee-App – Aussehen nach dem Orchidee-Brandguide (Chat 5, 26.09.2026)
   Farben: main blue 3C6EB4, clean blue 40B4EE, green 3AAE6D, sky E1F2FE, black 0E131F, warning D7263D.
   Schriften: Bariol Bold (Titel), Rubik Regular (Text). Dunkler Modus folgt der Geräteeinstellung. */

@font-face { font-family: "Bariol"; src: url("/static/fonts/Bariol-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("/static/fonts/Rubik-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  --brand-blue: #3C6EB4;
  --brand-clean: #40B4EE;
  --brand-green: #3AAE6D;
  --brand-sky: #E1F2FE;
  --brand-black: #0E131F;
  --brand-red: #D7263D;
  --brand-gradient: linear-gradient(160deg, #3AAE6D 0%, #3A9B82 9%, #3A829D 23%, #3A73AD 35%, #3A6EB3 45%, #3A74B7 58%, #3884C4 75%, #369FD9 95%, #35A8E0 100%);

  --primary: var(--brand-green);
  --primary-dark: #2B8150;
  --primary-soft: #E5F6EC;
  --accent: var(--brand-blue);
  --accent-soft: #E6EDF7;
  --bg: #F2F5F8;
  --card-bg: #FFFFFF;
  --input-bg: #FFFFFF;
  --text: #0E131F;
  --muted: #5E6B7B;
  --border: #E0E6EE;
  --nav-bg: #FFFFFF;
  --nav-text: #5E6B7B;
  --bubble-mine: #E1F2FE;
  --bubble-mine-border: #BFE0F7;
  --bubble-theirs: #FFFFFF;
  --hover: #F3F6FA;
  --best: #3AAE6D;
  --good: #D8C332;
  --mid: #EF9A36;
  --bad: #D7263D;
  --na: #9FB2CC;
  --shadow: 0 1px 3px rgba(14, 19, 31, 0.06);
  --radius: 14px;
  --font-body: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: "Bariol", "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --header-h: 56px;
  --bottom-h: 62px;
  --sidebar-w: 236px;
  --logo-light: block;
  --logo-dark: none;
  color-scheme: light;
}
.logo-light { display: var(--logo-light); }
.logo-dark { display: var(--logo-dark); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-soft: #1D3A2A;
    --accent-soft: #1E2D4A;
    --bg: #0E131F;
    --card-bg: #182033;
    --input-bg: #111827;
    --text: #EEF2F7;
    --muted: #9AA7B8;
    --border: #2A3549;
    --nav-bg: #131A2A;
    --nav-text: #9AA7B8;
    --bubble-mine: #1E3A5A;
    --bubble-mine-border: #2A4E78;
    --bubble-theirs: #1E273A;
    --hover: #1F2A3F;
    --na: #6B7A93;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    --logo-light: none;
    --logo-dark: block;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary-soft: #1D3A2A;
  --accent-soft: #1E2D4A;
  --bg: #0E131F;
  --card-bg: #182033;
  --input-bg: #111827;
  --text: #EEF2F7;
  --muted: #9AA7B8;
  --border: #2A3549;
  --nav-bg: #131A2A;
  --nav-text: #9AA7B8;
  --bubble-mine: #1E3A5A;
  --bubble-mine-border: #2A4E78;
  --bubble-theirs: #1E273A;
  --hover: #1F2A3F;
  --na: #6B7A93;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --logo-light: none;
  --logo-dark: block;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  line-height: 1.45;
}
h1, h2, h3, .login-logo, .kpi-num, .tile-num { font-family: var(--font-title); font-weight: 700; letter-spacing: 0.01em; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* ---------- Kopfzeile ---------- */

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--brand-gradient);
  color: #fff;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  padding-right: 12px;
  box-shadow: 0 2px 8px rgba(14, 19, 31, 0.18);
}
.header-logo { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.header-title { flex: 1; min-width: 0; }
.header-title h1 { margin: 0; font-size: 1.2rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-title .header-sub { font-size: 0.72rem; opacity: 0.9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  position: relative;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: rgba(255, 255, 255, 0.3); }
.user-chip {
  border: none;
  background: #fff;
  color: var(--brand-blue);
  width: 38px; height: 38px;
  border-radius: 50%;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.badge {
  display: inline-block;
  min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  font-family: var(--font-body);
}
.icon-btn .badge, .nav-item .badge { position: absolute; top: -2px; right: -4px; border: 2px solid var(--nav-bg); }
.icon-btn .badge { border-color: transparent; top: 0; right: 0; }

/* ---------- Seitenleiste (Desktop) und Leiste unten (Handy) ---------- */

.sidebar {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top)); bottom: 0; left: 0;
  width: var(--sidebar-w);
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  overflow-y: auto;
  z-index: 20;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.sidebar-logo { width: 180px; max-width: 90%; margin: 4px auto 10px; }
.sidebar .nav-group { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 12px 12px 4px; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none; background: none;
  color: var(--nav-text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  width: 100%;
  position: relative;
}
.sidebar .nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.sidebar .nav-item:hover { background: var(--hover); }
.sidebar .nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.sidebar .nav-item .badge { position: static; margin-left: auto; border: none; }
.sidebar .sidebar-foot { margin-top: auto; padding: 10px 12px; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--border); }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 30;
}
.bottom-nav .nav-item {
  flex: 1;
  border: none; background: none;
  color: var(--nav-text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 0.68rem;
  font-family: var(--font-body);
  cursor: pointer;
  position: relative;
  padding: 6px 2px;
}
.bottom-nav .nav-item svg { width: 24px; height: 24px; }
.bottom-nav .nav-item.active { color: var(--primary-dark); font-weight: 600; }
.bottom-nav .nav-item.active svg { stroke-width: 2.4; }
.bottom-nav .nav-item .badge { position: absolute; top: 4px; left: calc(50% + 6px); right: auto; }
.bottom-nav .nav-item.nav-plus svg { width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: var(--primary); color: #fff; stroke-width: 2.6; margin-top: -2px; }
/* Menüleiste unten bleibt immer sichtbar – auch im offenen Gespräch (Reza 26.09.) */

#app { padding: calc(var(--header-h) + env(safe-area-inset-top) + 14px) 16px calc(var(--bottom-h) + env(safe-area-inset-bottom) + 16px); max-width: 1040px; margin: 0 auto; }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  #app { margin-left: var(--sidebar-w); padding-bottom: 24px; max-width: none; }
  #app > .tab-panel { max-width: 1040px; margin: 0 auto; }
  .header-logo { display: none; }
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* „Mehr“-Menü auf dem Handy */
.sheet { position: fixed; inset: 0; background: rgba(14, 19, 31, 0.45); z-index: 40; display: flex; align-items: flex-end; }
.sheet-card { background: var(--card-bg); width: 100%; border-radius: 18px 18px 0 0; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); max-height: 80vh; overflow: auto; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 2px auto 10px; }
.sheet-head { display: flex; justify-content: flex-end; margin: -6px 0 2px; }
.sheet .nav-item { display: flex; align-items: center; gap: 14px; width: 100%; border: none; background: none; color: var(--text); font-size: 1rem; font-family: var(--font-body); padding: 13px 10px; border-radius: 10px; cursor: pointer; text-align: left; position: relative; }
.sheet .nav-item svg { width: 22px; height: 22px; color: var(--muted); }
.sheet .nav-item:active { background: var(--hover); }
.sheet .nav-item .badge { position: static; margin-left: auto; border: none; }

/* ---------- Karten, Formulare, Knöpfe ---------- */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-title-row h2 { margin: 0; }

.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.form-row label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); gap: 4px; flex: 1 1 180px; }
.block-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }

input[type="text"], input[type="date"], input[type="datetime-local"], input[type="email"], input[type="password"], select, textarea {
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  width: 100%;
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-clean); outline-offset: 0; border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  color: var(--text);
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-dark); }
.btn.primary:disabled { opacity: 0.6; }
.btn:disabled[data-act] { opacity: 0.45; cursor: not-allowed; }   /* Zeiten: zweites Fenster nur ansehen (F67) */
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: rgba(215, 38, 61, 0.12); color: var(--bad); }
.btn.small { padding: 7px 11px; font-size: 0.85rem; white-space: nowrap; }
.btn.wide { width: 100%; }

.hint { color: var(--muted); font-size: 0.9rem; }
.meta { color: var(--muted); font-size: 0.85rem; }

.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 0.95rem; color: var(--text); }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

.password-row { display: flex; gap: 8px; align-items: center; }
.password-row input { flex: 1; }

.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

.status-msg { font-size: 0.85rem; margin-left: 8px; }
.status-msg.ok { color: var(--primary-dark); }
.status-msg.error { color: var(--bad); }

.simple-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--hover); }

/* ---------- Startseite / Dashboard ---------- */

.greeting { margin: 2px 0 14px; }
.greeting h2 { margin: 0; font-size: 1.5rem; }
.greeting .meta { margin-top: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card-bg); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; border: none; text-align: left; color: var(--text); font-family: var(--font-body); display: flex; flex-direction: column; gap: 2px; position: relative; }
.tile:active { background: var(--hover); }
.tile-label { font-size: 0.8rem; color: var(--muted); }
.tile-num { font-size: 1.9rem; line-height: 1.1; }
.tile-sub { font-size: 0.78rem; color: var(--muted); }
.tile.warn .tile-num { color: var(--mid); }
.tile.bad .tile-num { color: var(--bad); }
.tile.good .tile-num { color: var(--primary-dark); }
.tile .badge { position: absolute; top: 10px; right: 10px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.dash-grid .card { margin: 0; }
.dash-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.93rem; }
.dash-row:first-of-type { border-top: none; }
.dash-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row.clickable { cursor: pointer; }
.dash-row.clickable:hover { background: var(--hover); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.dash-compare { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.dash-compare .big { font-family: var(--font-title); font-size: 2.2rem; line-height: 1; }
.dash-delta { font-weight: 600; font-size: 0.9rem; }
.dash-delta.up { color: var(--primary-dark); }
.dash-delta.down { color: var(--bad); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--primary-soft); color: var(--primary-dark); }
.pill.bad { background: rgba(215, 38, 61, 0.12); color: var(--bad); }
.pill.warn { background: rgba(239, 154, 54, 0.15); color: #b45f0b; }
.empty-note { color: var(--muted); font-size: 0.9rem; padding: 6px 0; }
.soon { opacity: 0.75; }

/* ---------- Meldungen ---------- */
.notif-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); cursor: pointer; }
.notif-row:first-child { border-top: none; }
.notif-icon { font-size: 1.3rem; width: 30px; text-align: center; flex-shrink: 0; }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; }
.notif-row.unread .notif-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 8px; vertical-align: middle; }
.notif-row.read { opacity: 0.65; }

/* ---------- Prozent-Anzeigen ---------- */

.pct-badge { padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; color: white; white-space: nowrap; }
.pct-good { --c: var(--best); }
.pct-ok { --c: var(--good); }
.pct-mid { --c: var(--mid); }
.pct-bad { --c: var(--bad); }
.pct-none { --c: var(--na); }
.pct-badge { background: var(--c); }
.pct-ok.pct-badge { color: #3b3200; }

.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; background: conic-gradient(var(--c, var(--na)) calc(var(--p) * 1%), var(--border) 0); display: grid; place-items: center; flex-shrink: 0; }
.ring span { width: 64px; height: 64px; border-radius: 50%; background: var(--card-bg); display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; font-family: var(--font-title); }
.ring.big { width: 120px; height: 120px; margin: 8px 0; }
.ring.big span { width: 94px; height: 94px; font-size: 1.4rem; }

/* ---------- Berichtsliste ---------- */

/* W85 (Chat 113c): Zeile wie die Bericht-Seite – Objekt groß, Ergebnis als Zahl in Ampelfarbe, seltene Knöpfe unter „Mehr …“ */
:root { --tone-gut: #227C4A; --tone-leicht: #8A6200; --tone-deutlich: #AA5000; --tone-schwer: #D7263D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tone-gut: #6FD39A; --tone-leicht: #F0C84B; --tone-deutlich: #F5A25C; --tone-schwer: #FF6B7D; } }
:root[data-theme="dark"] { --tone-gut: #6FD39A; --tone-leicht: #F0C84B; --tone-deutlich: #F5A25C; --tone-schwer: #FF6B7D; }
.report-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; padding: 16px 18px; }
.report-row .report-actions-box, .report-row > .report-actions { grid-column: 1 / -1; }
.report-main { min-width: 0; }
.report-main .meta { margin-top: 2px; }
.report-eyebrow { font-family: var(--font-title); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.report-title { display: block; font-family: var(--font-title); font-size: 1.12rem; line-height: 1.25; margin: 1px 0 2px; letter-spacing: -0.01em; }
.report-pct { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.report-num { font-family: var(--font-title); font-size: 1.7rem; line-height: 1; color: var(--muted); white-space: nowrap; }
.report-num.pct-good { color: var(--tone-gut); }
.report-num.pct-ok { color: var(--tone-leicht); }
.report-num.pct-mid { color: var(--tone-deutlich); }
.report-num.pct-bad { color: var(--tone-schwer); }
.report-actions-box { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.report-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.report-more[hidden] { display: none; }
.report-staff { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* volle Liste auf der Bericht-Seite */
.report-sum .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; }
@media (max-width: 700px) { .report-sum .kpis { grid-template-columns: 1fr 1fr; } .report-sum .kpi-num { font-size: 1.9rem; } }

/* ---------- Bericht ausfüllen ---------- */

.fill-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top) + 8px); z-index: 5; }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.group-head h2 { margin: 0; }
.group-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.hidden-file { display: none; }

.param-row { border-top: 1px solid var(--border); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.param-title { font-weight: 600; }
.rating-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.rate-btn { border: 2px solid var(--border); background: var(--input-bg); border-left: 6px solid var(--rc); border-radius: 10px; padding: 10px 12px; font-size: 0.92rem; cursor: pointer; color: var(--text); flex: 1 1 auto; min-height: 44px; font-family: var(--font-body); }
.rate-btn.r-na { --rc: var(--na); }
.rate-btn.r-bad { --rc: var(--bad); }
.rate-btn.r-mid { --rc: var(--mid); }
.rate-btn.r-good { --rc: var(--good); }
.rate-btn.r-best { --rc: var(--best); }
.rate-btn.yn { --rc: var(--accent); flex: 0 1 120px; }
.rate-btn.active { background: var(--rc); border-color: var(--rc); color: white; font-weight: 700; }
.rate-btn.r-good.active { color: #3b3200; }
.note-input { font-size: 0.9rem !important; padding: 8px 10px !important; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.photo-item { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.photo-item img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; }
.photo-item input { font-size: 0.85rem; padding: 7px; }

.sig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sig-box { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
/* „Unterschrift löschen“ rechts und mit Abstand zum Bestätigen-Knopf, sonst Fehlgriff (Chat 44, W32) */
.sig-box { margin-bottom: 20px; }
.sig-box > button { align-self: flex-end; }
.sig-canvas { width: 100%; aspect-ratio: 600 / 220; border: 1px dashed var(--na); border-radius: 10px; background: #fff; touch-action: none; }

/* ---------- Vorlagen-Editor ---------- */

.flag-grid { display: grid; grid-template-columns: auto repeat(3, auto); gap: 8px 18px; align-items: center; margin: 6px 0 4px; }
.group-title-input { font-weight: 700; font-size: 1.05rem !important; flex: 1 1 240px; }
.editor-param { display: grid; grid-template-columns: 1fr 140px auto auto auto; gap: 6px; margin-top: 6px; align-items: center; }
.bulk { margin-top: 10px; }
.bulk summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
.bulk textarea { margin: 8px 0; min-height: 110px; }

/* ---------- Statistik ---------- */

.kpis { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.kpi-num { font-size: 2.4rem; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 110px; gap: 10px; align-items: center; margin: 6px 0; }
.bar-track { background: var(--border); border-radius: 6px; height: 16px; overflow: hidden; }
.bar { height: 100%; background: var(--c); border-radius: 6px; }
.bar-value { font-size: 0.85rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.stat-table th, .stat-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.stat-table th { color: var(--muted); font-weight: 600; }

.logo-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.logo-preview img { max-height: 60px; max-width: 220px; }

/* ---------- Brücken ---------- */
.bridge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 10px; }
.bridge-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.bridge-box .dot, .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--na); }
.dot.ok { background: var(--best); } .dot.bad { background: var(--bad); } .dot.dry { background: var(--good); }
.bridge-log { font-size: 0.82rem; max-height: 260px; overflow: auto; }
.bridge-log div { padding: 3px 0; border-bottom: 1px dashed var(--border); }
.warn-row { background: rgba(239, 154, 54, 0.14); border-left: 4px solid var(--mid); padding: 8px 10px; margin: 6px 0; font-size: 0.9rem; border-radius: 6px; }
.warn-row.error { background: rgba(215, 38, 61, 0.12); border-left-color: var(--bad); }

/* ---------- Anmeldeseite ---------- */
.login-body { min-height: 100vh; min-height: 100dvh; background: var(--brand-gradient); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-wrap { width: 100%; max-width: 420px; }
.login-card { padding: 26px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 16px; }
.login-brand img { width: 220px; max-width: 80%; height: auto; }
.login-logo { font-size: 1.7rem; text-align: center; margin: 0; }
.login-logo .brand { color: var(--primary); }
.login-sub { text-align: center; margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.login-form h2 { margin: 0; font-size: 1.1rem; }

/* ---------- Reiter-Auswahl und Auswahllisten ---------- */
.segment { display: flex; gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; margin: 10px 0; }
.seg-btn { flex: 1; border: none; background: none; color: var(--muted); padding: 9px 6px; border-radius: 9px; font-family: var(--font-body); font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.seg-btn.active { background: var(--card-bg); color: var(--text); box-shadow: var(--shadow); }
.seg-count { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.picker-list { max-height: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; margin-top: 8px; }
.picker-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.picker-row:first-child { border-top: none; }
.picker-row:hover { background: var(--hover); }
.picker-row.selected { background: var(--primary-soft); }
.picker-row .meta { white-space: nowrap; }
.picker-chosen { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.invite-link { word-break: break-all; font-size: 0.9rem; background: var(--hover); border-radius: 8px; padding: 8px 10px; }

/* ---------- Dialoge ---------- */
.chat-dialog { position: fixed; inset: 0; background: rgba(14, 19, 31, 0.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: calc(var(--header-h) + env(safe-area-inset-top) + 12px) 12px calc(var(--bottom-h) + env(safe-area-inset-bottom) + 12px); overflow: auto; }
.dialog-card { width: 100%; max-width: 560px; max-height: calc(100dvh - var(--header-h) - var(--bottom-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px); overflow: auto; }
.start-password { background: var(--hover); border-radius: 10px; padding: 12px; margin: 10px 0; font-size: 1.05rem; display: flex; flex-direction: column; gap: 6px; }
.start-password code { font-size: 1.3rem; font-weight: 700; letter-spacing: 1px; color: var(--accent); }
.user-picker input[type="text"] { margin-bottom: 8px; }
.user-picker-list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; height: calc(100dvh - var(--header-h) - env(safe-area-inset-top) - 40px); min-height: 420px; }
.chat-rooms, .chat-conv { margin: 0; display: flex; flex-direction: column; min-height: 0; min-width: 0; max-width: 100%; padding: 12px; }
.chat-room-list, .chat-room, .chat-room-main, .chat-room-preview { min-width: 0; }
.profile-section { margin-top: 12px; }
.profile-section h3 { margin: 0 0 4px; }
.profile-lines { display: flex; flex-direction: column; gap: 4px; }
.list-row .clickable { cursor: pointer; }
.chat-rooms-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.chat-room-list { overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.chat-room { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; }
.chat-room:hover { background: var(--hover); }
.chat-room.active { background: var(--primary-soft); }
.chat-room-icon { font-size: 1.4rem; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; }
.chat-room-main { flex: 1; min-width: 0; }
.chat-room-name { display: flex; justify-content: space-between; gap: 8px; }
.chat-room-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-head { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 8px; }
.chat-conv-title { flex: 1; min-width: 0; }
.chat-conv-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { display: none; }
.chat-messages { flex: 1; overflow: auto; padding: 4px 2px; overflow-anchor: none; }
.chat-inner { display: flex; flex-direction: column; gap: 6px; }
.chat-empty { text-align: center; margin-top: 40px; }
.chat-day { align-self: center; font-size: 0.75rem; color: var(--muted); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin: 8px 0 4px; }
.chat-older { align-self: center; margin-bottom: 8px; }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: 78%; background: var(--bubble-theirs); border: 1px solid var(--border); border-radius: 16px; border-bottom-left-radius: 4px; padding: 8px 12px; font-size: 0.98rem; line-height: 1.4; box-shadow: var(--shadow); }
.chat-row.mine .chat-bubble { background: var(--bubble-mine); border-color: var(--bubble-mine-border); border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.chat-bubble.deleted { opacity: 0.7; }
.chat-sender { font-size: 0.78rem; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-original { white-space: pre-wrap; word-break: break-word; color: var(--muted); font-size: 0.9rem; border-left: 3px solid var(--border); padding-left: 8px; margin-top: 4px; }
.chat-orig-toggle { border: none; background: none; color: var(--accent); font-size: 0.78rem; padding: 2px 0; cursor: pointer; font-family: var(--font-body); }
.chat-img { max-width: 100%; height: auto; border-radius: 8px; display: block; background: var(--hover); object-fit: contain; }
.chat-img.chat-img-free { max-height: 320px; min-height: 60px; }
.chat-video { width: 100%; max-height: 320px; border-radius: 8px; display: block; background: #000; margin-top: 4px; }   /* F40 */
.chat-audio audio { width: 240px; max-width: 100%; }
.chat-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.chat-read { color: var(--primary-dark); }
.chat-del { border: none; background: none; color: var(--muted); font-size: 0.72rem; cursor: pointer; padding: 0; font-family: var(--font-body); }
.chat-composer { display: flex; gap: 6px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 6px; }
.chat-composer textarea { flex: 1; min-height: 42px; max-height: 140px; resize: none; border-radius: 21px; padding: 10px 14px; }
.chat-composer .btn { flex-shrink: 0; min-height: 42px; border-radius: 21px; }
.chat-recording { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 6px; font-weight: 600; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

@media (max-width: 899px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--header-h) - env(safe-area-inset-top) - var(--bottom-h) - env(safe-area-inset-bottom) - 30px); }
  body.conv-open { overflow: hidden; }
  body.conv-open .chat-layout { position: fixed; top: calc(var(--header-h) + env(safe-area-inset-top)); left: 0; right: 0; bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); height: auto; min-height: 0; padding: 8px 8px 0; z-index: 10; background: var(--bg); }
  body.conv-open .chat-conv { border-radius: var(--radius) var(--radius) 0 0; }
  .chat-composer { padding-bottom: 4px; }
  .chat-conv { display: none; }
  .chat-layout.show-conv .chat-rooms { display: none; }
  .chat-layout.show-conv .chat-conv { display: flex; }
  .chat-back { display: inline-block; }
  .chat-bubble { max-width: 88%; }
}

@media (max-width: 700px) {
  .form-row label { flex: 1 1 100%; }
  .flag-grid { grid-template-columns: 1fr 1fr; }
  .flag-grid strong { grid-column: 1 / -1; }
  .editor-param { grid-template-columns: 1fr auto auto auto; }
  .editor-param input { grid-column: 1 / -1; }
  .bar-row { grid-template-columns: 56px 1fr 90px; }
  .card { padding: 14px; }
  .tiles { grid-template-columns: 1fr 1fr; }
}

/* ---------- Rundgang (Chat 6) ---------- */

.fill-head-main { min-width: 0; flex: 1; }
.fill-head-main strong { font-size: 1.1rem; display: block; }
.save-bad { color: var(--bad); }
/* W50 (Chat 48): deutliches Band, wenn der Rundgang noch nicht gespeichert ist */
#w-form .fill-head { flex-wrap: wrap; }
.save-band { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px;
  border-radius: 10px; background: rgba(215, 38, 61, 0.10); border: 2px solid var(--bad); color: var(--text); }
.save-band[hidden] { display: none; }
.save-band strong { color: var(--bad); display: block; }
.save-band-text { min-width: 0; flex: 1 1 220px; font-size: 0.9rem; }
#w-form .save-band { flex-wrap: wrap; }
.save-band.soft { background: var(--hover); border-color: var(--border); }
/* F18-II (Chat 67): Zustandszeile ✓ auf dem Server · ⏳ auf dem Gerät · ⚠ Senden fehlgeschlagen */
.sync-line { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 0.85rem; }
.sync-line.ok { background: var(--primary-soft); color: var(--primary-dark); }
.sync-line.wait { background: rgba(239, 154, 54, 0.15); color: #9a5a0c; }
.sync-line.bad { background: rgba(215, 38, 61, 0.12); color: var(--bad); }
.sync-mini.ok { color: var(--primary-dark); }
.sync-mini.wait { color: #9a5a0c; }
.sync-mini.bad { color: var(--bad); }
.thumb-state { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.92); color: #9a5a0c; }
.thumb-state.bad { color: var(--bad); }
.thumb-missing { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 60px; font-size: 0.8rem; color: var(--na); }
/* F20 (Chat 48): Raumsuche im Rundgang */
.room-search { flex-basis: 100%; }
.room-search[hidden] { display: none; }
.room-search-row { display: flex; gap: 8px; align-items: center; }
.room-search-row input { flex: 1; min-width: 0; }
.open-walks { margin-bottom: 12px; }
.open-walks h3 { margin: 0 0 6px; font-size: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.9rem; border: none; font-family: var(--font-body); cursor: pointer; }
.chips.suggest .chip { background: var(--hover); color: var(--text); border: 1px solid var(--border); }
.chip-x { border: none; background: none; color: var(--accent); cursor: pointer; font-size: 0.85rem; padding: 0 2px; }
.floor-card { border-left: 5px solid var(--border); }
.floor-card.seen { border-left-color: var(--primary); }
.seen-toggle { border: 2px solid var(--primary); background: var(--card-bg); color: var(--primary-dark); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-family: var(--font-body); cursor: pointer; min-height: 44px; white-space: nowrap; }
.seen-toggle.active { background: var(--primary); color: #fff; }
.room-list { display: flex; flex-direction: column; margin-top: 4px; }
.room-row { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-top: 1px solid var(--border); cursor: pointer; min-height: 52px; }
.room-row:hover { background: var(--hover); }
.room-row.has-defect .room-name { color: var(--bad); }
.room-main { flex: 1; min-width: 0; }
.room-name { font-weight: 600; }
.room-ok { color: var(--primary-dark); font-size: 0.85rem; white-space: nowrap; }
.room-chev { color: var(--muted); font-size: 1.4rem; line-height: 1; }
.skeleton-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.skel-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.skel-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
.skel-row .skel-name { padding: 8px 10px; }

body.sheet-open { overflow: hidden; }
.walk-sheet { max-height: 92vh; max-height: 92dvh; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.walk-sheet h3 { margin: 14px 0 6px; font-size: 0.95rem; color: var(--muted); }
.sev-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sev-btn { border: 2px solid var(--border); background: var(--input-bg); border-radius: 12px; padding: 10px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text); font-family: var(--font-body); min-height: 74px; }
.sev-btn strong { font-size: 1rem; }
.sev-btn span { font-size: 0.85rem; color: var(--muted); }
.sev-btn small { font-size: 0.68rem; color: var(--muted); text-align: center; line-height: 1.2; }
.sev-btn.sev-leicht { --rc: var(--good); }
.sev-btn.sev-deutlich { --rc: var(--mid); }
.sev-btn.sev-schwer { --rc: var(--bad); }
.sev-btn.active { background: var(--rc); border-color: var(--rc); color: #fff; }
.sev-btn.active span, .sev-btn.active small { color: rgba(255, 255, 255, 0.9); }
.sev-btn.sev-leicht.active { color: #3b3200; }
.sev-btn.sev-leicht.active span, .sev-btn.sev-leicht.active small { color: #3b3200; }
.sev-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: #fff; }
.sev-badge.sev-leicht { background: var(--good); color: #3b3200; }
.sev-badge.sev-deutlich { background: var(--mid); }
.sev-badge.sev-schwer { background: var(--bad); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { position: relative; width: 110px; height: 110px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #000; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 4px; right: 4px; border: none; background: rgba(14, 19, 31, 0.7); color: #fff; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }
.cam-box video { width: 100%; max-height: 320px; border-radius: 10px; background: #000; margin-top: 8px; }
.defect-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.defect-row { display: flex; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; flex-wrap: wrap; }
.defect-main { flex: 1; min-width: 200px; }
.defect-text { margin-top: 4px; }
.defect-actions { display: flex; gap: 6px; align-items: flex-start; }
.report-row.draft { border-left: 4px solid var(--mid); }
.pill.warn { background: rgba(239, 154, 54, 0.18); color: #9a5a0c; }
.pill.bad { background: rgba(215, 38, 61, 0.14); color: var(--bad); }
.pill.ok { background: var(--primary-soft); color: var(--primary-dark); }

@media (max-width: 700px) {
  .sev-btn small { display: none; }
  .thumb { width: 92px; height: 92px; }
}

/* Mangel-Nachrichten im Chat (F6) */
/* Mangel = rot, behoben = grün – auf einen Blick erkennbar */
.chat-bubble.defect { background: rgba(215, 38, 61, 0.12); border: 2px solid var(--bad); border-left-width: 7px; max-width: 92%; }
.chat-bubble.defect.done { background: rgba(58, 174, 109, 0.14); border-color: var(--best); }
.chat-bubble.resolved { background: rgba(58, 174, 109, 0.14); border: 2px solid var(--best); border-left-width: 7px; max-width: 92%; }
.defect-tag { display: inline-block; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.03em; padding: 5px 12px; border-radius: 999px; margin-bottom: 8px; color: #fff; }
.defect-tag.open { background: var(--bad); }
.defect-tag.done { background: var(--best); }
.defect-done { margin-top: 4px; }
.chat-bubble .defect-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.chat-sender-fn { font-weight: 400; color: var(--muted); }
.chips.suggest .chip.selected { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); font-weight: 600; }
.cat-tabs { flex-wrap: wrap; }
.cat-tabs .seg-btn { flex: 1 1 auto; font-size: 0.85rem; padding: 8px 6px; }
.chosen-line { margin: 4px 0 8px; }
.defect-object { font-weight: 700; font-size: 1.02rem; margin-bottom: 4px; }
/* auch die eigene (gesendete) Mangel-Nachricht bleibt rot, bis sie behoben ist */
.chat-row .chat-bubble.defect:not(.done) { background: rgba(215, 38, 61, 0.12); border-color: var(--bad); }
.chat-row .chat-bubble.defect.done, .chat-row .chat-bubble.resolved { background: rgba(58, 174, 109, 0.16); border-color: var(--best); }
.picker-chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.picker-chosen-main { min-width: 0; }
.picker-chosen-main .meta { color: var(--primary-dark); opacity: 0.85; font-weight: 400; }
.open-defects-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(215, 38, 61, 0.12); border: 1px solid var(--bad); color: var(--bad); font-weight: 700; border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.open-defects-bar .btn { background: var(--bad); color: #fff; }
.chat-row.flash .chat-bubble { outline: 3px solid var(--brand-clean); }
.defect-address { display: block; font-size: 0.85rem; margin: -2px 0 6px; }
.desc-box { min-height: 56px; }

.btn.fix-btn { width: 100%; font-size: 1.05rem; padding: 14px 16px; background: var(--bad); color: #fff; margin-top: 8px; }
.chat-search { margin-bottom: 6px; padding: 9px 11px !important; font-size: 0.95rem !important; }
.chat-archived-toggle { font-size: 0.82rem !important; margin-bottom: 6px; color: var(--muted) !important; }
.chat-room-name .meta { flex-shrink: 0; white-space: nowrap; }
/* Profilfotos */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; overflow: hidden; flex-shrink: 0; }
.avatar img, .user-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-chip { overflow: hidden; padding: 0; }
.avatar.big { width: 84px; height: 84px; font-size: 1.6rem; }
.avatar.tiny { width: 20px; height: 20px; font-size: 0.6rem; display: inline-grid; vertical-align: middle; margin-right: 6px; }
.profile-head { display: flex; gap: 16px; align-items: center; }
.chat-sender { display: flex; align-items: center; }
.search-picker { width: 100%; }
.search-picker .picker-list { max-height: 240px; }
.chips.picked { margin: 0 0 6px; }
.chips.picked .chip { background: var(--brand-blue); color: #fff; }
.chips.picked .chip-x { color: #fff; }
.pct-badge.big { font-size: 1.3rem; padding: 6px 14px; }
.picker-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; min-width: 0; }
.field-label { font-size: 0.85rem; color: var(--muted); }

/* ---------- Dokumente mit Lesebestätigung (Chat 8) ---------- */
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--border); cursor: pointer; }
.doc-row:first-of-type { border-top: none; }
.doc-row:hover { background: var(--hover); }
.doc-row.open .doc-title { font-weight: 700; }
.doc-icon { font-size: 1.5rem; width: 36px; text-align: center; flex-shrink: 0; }
.doc-main { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; }
.doc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill.info { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.doc-head h2 { margin: 8px 0 2px; }
.doc-body { padding: 18px; }
.doc-text { font-size: 1.02rem; line-height: 1.55; }
.doc-text h2 { font-size: 1.3rem; margin: 6px 0 10px; }
.doc-text h3 { font-size: 1.08rem; margin: 18px 0 6px; }
.doc-text h4 { font-size: 0.98rem; margin: 14px 0 4px; color: var(--muted); }
.doc-text p { margin: 0 0 10px; }
.doc-text ul, .doc-text ol { margin: 0 0 10px; padding-left: 22px; }
.doc-text li { margin-bottom: 4px; }
.doc-summary { border-left: 5px solid var(--brand-clean); }
.doc-summary h3 { margin: 0 0 6px; }
.doc-summary p { margin: 0; }
.doc-image { max-width: 100%; border-radius: 8px; display: block; }
.pdf-pages { display: flex; flex-direction: column; gap: 10px; }
.pdf-page { width: 100%; height: auto; display: block; background: #fff; box-shadow: 0 1px 4px rgba(14, 19, 31, 0.18); border-radius: 4px; }
/* F49 (Chat 72b): PDF-Ansicht in der App (Home-Bildschirm) mit „Schließen“ */
.pdf-overlay { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.pdf-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid rgba(127, 127, 127, 0.25); }
.pdf-overlay-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-overlay-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.doc-pdf-status { margin: 0 0 8px; }
.confirm-card { border: 2px solid var(--primary); }
.confirm-card .checkbox-label { font-size: 1.02rem; margin: 8px 0; }
.confirm-card input[type="checkbox"]:disabled + * { opacity: 0.6; }
.doc-manage-row { flex-direction: column; align-items: stretch; gap: 8px; }
.doc-manage-row .doc-main { width: 100%; }
.doc-manage-row .bar-row { margin: 4px 0 0; }
#global-dialog .dialog-card { max-width: 640px; }
#tab-personal .profile-head .card-title-row { margin-bottom: 2px; }
#tab-personal .profile-head h2 { margin: 0; }
@media (max-width: 700px) {
  .doc-row .btn { display: none; }   /* die ganze Zeile ist antippbar – Platz für den Titel */
  .doc-row { gap: 10px; }
}

/* Regeln fürs Büro in der Dokumente-Verwaltung */
.doc-rules-card summary { cursor: pointer; font-size: 0.98rem; }
.doc-rules-card h3 { font-size: 0.95rem; margin: 12px 0 4px; }
.doc-rules { margin: 0; padding-left: 4px; list-style: none; }
.doc-rules li { padding: 4px 0; border-top: 1px solid var(--border); font-size: 0.92rem; }
.doc-rules li:first-child { border-top: none; }
.doc-rules-mark { margin-right: 4px; }
.doc-rules-short { display: block; margin: 0 0 10px; font-size: 0.9rem; }

/* Abwesenheiten (Chat 9) */
.abs-row .abs-main { flex: 1; min-width: 0; }
.abs-row .abs-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.abs-balance { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; margin: 6px 0 8px; }
.abs-balance .big { font-family: var(--font-title); font-size: 2.2rem; line-height: 1; color: var(--primary-dark); }
.abs-balance .num { font-family: var(--font-title); font-size: 1.4rem; line-height: 1.1; }
.abs-notice { border-left: 4px solid var(--mid); }
.abs-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 0.95rem; }
.abs-check input[type="checkbox"] { width: 20px; height: 20px; }
.abs-halves { display: flex; gap: 16px; flex-wrap: wrap; }
.abs-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.dialog-card > label, .card > label.abs-field { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); gap: 4px; margin-bottom: 10px; }
.dialog-card > label input, .dialog-card > label select, .dialog-card > label textarea { font-size: 1rem; color: var(--text); }

/* ---------- Nachweise: Fotos und Videos mit Stempel (Chat 10) ---------- */
.proof-card { margin-bottom: 14px; position: relative; }
.proof-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.proof-medium { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; background: #0E131F; display: block; }
.proof-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 13px; }
.proof-pending { padding: 22px; text-align: center; border-radius: 10px; background: rgba(0, 0, 0, .05); color: var(--muted); }
.proof-preview { margin: 10px 0; }
.proof-preview .proof-medium { max-height: 46vh; }
.proof-pick { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
/* Die drei festen Regeln – müssen auffallen, deshalb abgesetzt (Rechtsprüfung Teil G) */
.proof-rules { border-left: 4px solid var(--warning, #D7263D); background: rgba(215, 38, 61, .07);
  padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.proof-rules h3 { margin: 0 0 6px; font-size: 14px; }
.proof-rules p { margin: 4px 0; font-size: 13px; line-height: 1.4; }
/* Tagesnachweis je Anlage (D4) */
.day-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 10px 0; }
.day-cell { text-align: center; padding: 6px 2px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.day-ok { background: rgba(58, 174, 109, .18); color: #2a7f50; }
.day-miss { background: rgba(215, 38, 61, .15); color: #a51d31; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .day-ok { background: rgba(58, 174, 109, .28); color: #8fe0b4; }
  :root:not([data-theme="light"]) .day-miss { background: rgba(215, 38, 61, .28); color: #ffa8b4; }
  :root:not([data-theme="light"]) .proof-pending { background: rgba(255, 255, 255, .06); }
}
:root[data-theme="dark"] .day-ok { background: rgba(58, 174, 109, .28); color: #8fe0b4; }
:root[data-theme="dark"] .day-miss { background: rgba(215, 38, 61, .28); color: #ffa8b4; }
:root[data-theme="dark"] .proof-pending { background: rgba(255, 255, 255, .06); }

/* Nachweis-Liste: Objekt → Tag → Kacheln (28.09., nach Rezas iPhone-Test) */
.proof-group { padding: 8px 12px; margin-bottom: 10px; }
.proof-group summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 0; }
.proof-group summary::-webkit-details-marker { display: none; }
.proof-group summary::before { content: "▸"; color: var(--muted); }
.proof-group[open] summary::before { content: "▾"; }
.proof-day { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 6px; }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-bottom: 6px; }
.proof-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .08); cursor: pointer; }
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proof-thumb-time { position: absolute; left: 4px; bottom: 4px; font-size: 11px; background: rgba(0, 0, 0, .6); color: #fff; padding: 1px 5px; border-radius: 4px; }
.proof-thumb-site { position: absolute; left: 4px; top: 4px; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; background: rgba(0, 0, 0, .6); color: #fff; padding: 1px 5px; border-radius: 4px; }   /* Anlage, Chat 52 */
.proof-thumb-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 0 6px rgba(0, 0, 0, .7); pointer-events: none; }
.proof-thumb-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 22px; }
.proof-thumb.picked { outline: 3px solid var(--brand-green); outline-offset: -3px; }

/* Objektvorschlag im Aufnahmedialog (D6) */
.proof-suggest { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.proof-suggest-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; }
.proof-suggest-btn .meta { font-weight: 400; }
.proof-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: 10px; background: rgba(58, 174, 109, .12); margin-bottom: 8px; }
.proof-chosen .meta { flex-basis: 100%; }

/* Frage mit Ja/Nein (Chat 14): zwei gleich große Knöpfe, gewählte Antwort hervorgehoben */
.answer-choice { display: flex; gap: 10px; margin: 10px 0; }
.answer-btn { flex: 1; padding: 14px 10px; font-size: 1.1rem; font-weight: 700; border: 2px solid var(--border, #d0d5dd); background: var(--card-bg, #fff); color: var(--text, #1f2937); border-radius: 12px; }
.answer-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }

/* Zustandsaufnahme (Chat 17): vier neutrale Zustände, keine Schuldfarben */
.cond-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cond-btn { border: 2px solid var(--border); background: var(--input-bg); border-radius: 12px; padding: 12px 6px; cursor: pointer; color: var(--text); font-family: var(--font-body); font-weight: 700; min-height: 48px; }
.cond-btn.cond-ok { --rc: #3AAE6D; }
.cond-btn.cond-verschmutzt { --rc: #D8A028; }
.cond-btn.cond-beschaedigt { --rc: #D7263D; }
.cond-btn.cond-defekt { --rc: #785AC8; }
.cond-btn.active { background: var(--rc); border-color: var(--rc); color: #fff; }
.cond-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: #fff; background: #5E6B7B; }
.cond-badge.cond-ok { background: #3AAE6D; }
.cond-badge.cond-verschmutzt { background: #D8A028; }
.cond-badge.cond-beschaedigt { background: #D7263D; }
.cond-badge.cond-defekt { background: #785AC8; }
.z-people { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
.z-person { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }
.z-person strong { flex: 1 1 140px; }
.z-person .z-fn { flex: 1 1 140px; max-width: 240px; padding: 6px 8px; }
.z-item { font-weight: 700; font-size: 1.05rem; }
.z-failed { opacity: 0.6; }
.z-failed-label { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(215, 38, 61, 0.85); color: #fff; font-size: 0.68rem; text-align: center; padding: 2px; }
.z-mail-preview { white-space: pre-wrap; font-family: var(--font-body); font-size: 0.85rem; background: var(--hover); border-radius: 10px; padding: 10px 12px; max-height: 320px; overflow: auto; }
/* Zustandsaufnahme (Chat 35): Kennzeichen je Raum, „Mehrere auf einmal“ im Raum-Editor */
.z-pill { margin-left: 8px; vertical-align: 2px; font-size: 0.7rem; }
.pill.z-flag { background: rgba(108, 116, 128, 0.14); color: #4b5563; }
.z-many { min-height: 110px; }
.z-many-box { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 10px; }
.z-many-box summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
/* Zustandsaufnahme (Chat 36): Übertragen ins Mendato-Raumbuch – Vorschau mit Haken, Ergebnis je Raum */
.z-transfer-row { cursor: pointer; align-items: flex-start; }
.z-transfer-row.off { cursor: default; opacity: 0.75; }
.z-transfer-row .z-check { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--primary); }
.z-result { cursor: default; align-items: flex-start; }
.z-result:hover { background: none; }
.z-result-sign { flex: 0 0 22px; font-weight: 700; text-align: center; }
.z-result-angelegt .z-result-sign { color: var(--primary-dark); }
.z-result-doppelt .z-result-sign { color: #b45f0b; }
.z-result-fehler .z-result-sign { color: var(--bad); }

/* Sprachwechsel: Seite ruhig abdecken, bis sie neu geladen ist (Chat 44) */
.lang-cover { position: fixed; inset: 0; z-index: 10000; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.lang-cover-box { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--na, #ccc); border-top-color: transparent; animation: lang-spin .8s linear infinite; }
@keyframes lang-spin { to { transform: rotate(360deg); } }

/* F18-III (Chat 68): Rundgang-Start mit drei Reitern (W14), Ohne-Internet-Hinweise, Startseiten-Karte, Abschluss (W43), Unterschrift (W44) */
.walk-tabs { margin-top: 0; }
.walk-tabs .seg-btn { border: 1px solid var(--border); }
.walk-tabs .seg-btn.active { border-color: var(--primary); color: var(--primary-dark); }
#n-start > [data-pane][hidden] { display: none; }
.ready-line { margin: 4px 0 8px; min-height: 0; }
.ready-line:empty { display: none; }
#w-device-notes { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
#w-device-notes:empty { display: none; }
.device-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px;
  border-radius: 10px; background: var(--hover); }
.device-tip { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); margin: 0; }
.off-card { border-left: 4px solid #ef9a36; }
.off-card.bad { border-left-color: var(--bad); }
.off-card h2 { font-size: 1.05rem; margin: 0; }
.off-card .meta { margin: 6px 0 10px; }
/* W43: Abschließen groß oben, „Später weitermachen“ darunter, Verwerfen klein und abgesetzt */
.walk-finish { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.walk-finish-main { width: 100%; padding: 14px 16px; font-size: 1.05rem; }
.walk-finish-later { width: 100%; }
.walk-finish-danger { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.walk-finish [hidden] { display: none; }
/* W44: Vorschau der Unterschrift; das Zeichenfeld öffnet erst im Blatt */
.sig-preview { width: 100%; max-width: 360px; aspect-ratio: 600 / 220; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.sig-empty { width: 100%; max-width: 360px; padding: 18px 12px; border: 1px dashed var(--na); border-radius: 10px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.sig-sheet .sheet-card { max-height: 95vh; }
.sig-canvas.big { aspect-ratio: 900 / 330; margin: 4px 0 10px; border: 2px solid var(--primary); }
.sig-actions { justify-content: flex-start; }
#w-comments .entry-actions { margin-top: 4px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sync-line.wait { background: rgba(239, 154, 54, 0.18); color: #f3b36b; }
  :root:not([data-theme="light"]) .sync-mini.wait { color: #f3b36b; }
  :root:not([data-theme="light"]) .sync-line.ok { background: rgba(58, 174, 109, .22); color: #8fe0b4; }
  :root:not([data-theme="light"]) .sync-mini.ok { color: #8fe0b4; }
}
:root[data-theme="dark"] .sync-line.ok { background: rgba(58, 174, 109, .22); color: #8fe0b4; }
:root[data-theme="dark"] .sync-mini.ok { color: #8fe0b4; }
:root[data-theme="dark"] .sync-line.wait { background: rgba(239, 154, 54, 0.18); color: #f3b36b; }
:root[data-theme="dark"] .sync-mini.wait { color: #f3b36b; }
.walk-finish-danger:has(> [hidden]) { display: none; }

/* ---------- Heute: Einsätze + Stempeln (W74-II, Chat 78) ---------- */
.zt-stats { display: flex; gap: 6px; margin: 8px 0 12px; }
.zt-stat { flex: 1; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 7px 4px; text-align: center; min-width: 0; }
.zt-stat small { display: block; color: var(--muted); font-size: 0.7rem; }
.zt-stat span { font-weight: 700; font-size: 0.95rem; }
.zt-next { background: var(--primary-soft); border-color: #BFE6CF; }
.zt-kicker { font-size: 0.75rem; font-weight: 700; color: var(--primary-dark); letter-spacing: 0.02em; }
.zt-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.zt-buttons.two { flex-direction: row; }
.zt-buttons.two .btn { flex: 1; }
.btn.zt-big { padding: 13px 14px; font-size: 1.02rem; font-weight: 700; text-align: center; justify-content: center; }
a.btn.zt-big, a.btn.secondary { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
/* W109 Notfall-Knopf: deutlich, aber unter den Stempel-Knöpfen (kein versehentliches Tippen beim Beenden) */
.btn.zt-sos { margin-top: 14px; width: 100%; justify-content: center; font-weight: 700; }
a.btn.danger { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.zt-aushang-text { white-space: pre-line; line-height: 1.45; }
.zt-hint { background: #FFF6DA; color: var(--text); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 0.92rem; }
/* Meine Stunden + Monat bestätigen (W74-IIIc, Chat 82) */
.st-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.st-nav h2 { margin: 0; font-size: 1.15rem; text-align: center; flex: 1; }
.btn.st-arrow { min-width: 48px; font-size: 1.4rem; font-weight: 700; padding: 6px 12px; justify-content: center; }
.st-done { border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.st-done.ok { background: var(--primary-soft); }
.st-done.no { background: #FDECEE; }
.st-done .btn { margin-top: 6px; }
.btn.st-no { color: #B4233C; border-color: #B4233C; }
.st-day { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.st-paid { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
:root[data-theme="dark"] .st-done.no { background: rgba(180, 35, 60, 0.22); }
:root[data-theme="dark"] .btn.st-no { color: #f19aa8; border-color: #f19aa8; }
.zt-clock { font-size: 2.8rem; font-weight: 700; text-align: center; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.zt-clock.paused { color: var(--muted); }
.zt-bar { height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; margin: 6px 0; }
.zt-bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.4s; }
.zt-bar i.over { background: var(--mid); }
.zt-left { text-align: center; }
.zt-tasks { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.95rem; }
.zt-row { margin-top: 8px; }
.zt-off { opacity: 0.6; }
.pill.gray { background: var(--hover); color: var(--muted); }
.zt-day { margin: 14px 0 2px; }
.zt-day.today strong { color: var(--primary-dark); }
.zt-free { padding: 4px 2px; }
.zt-search-input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 1rem; background: var(--input-bg); color: var(--text); }
.zt-sheet h2 { margin: 4px 0 6px; }
.zt-text { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-family: var(--font-body); font-size: 1rem; background: var(--input-bg); color: var(--text); margin-top: 6px; }
.zt-text.invalid { border-color: var(--bad); }
.zt-chips .chip { padding: 10px 14px; font-weight: 600; font-size: 0.98rem; border: 2px solid var(--accent); background: var(--card-bg); }
/* Leistungsbeleg (W74-VIII, Chat 110c) */
.lb-item { padding: 10px 12px; margin: 8px 0; }
.lb-person { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.lb-person .lb-qty { max-width: 160px; margin-top: 0; }
.lb-hm { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lb-hm input { width: 58px; text-align: center; }
.lb-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-weight: 600; }
.lb-sig { display: block; max-width: 100%; height: 90px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-top: 8px; }
#lb-sign { width: 100%; margin-top: 8px; }
.zt-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.zt-break-row { grid-template-columns: 1fr 1fr auto; align-items: end; margin: 4px 0; }
.zt-break-del { min-width: 44px; min-height: 44px; }
.zt-form label, .zt-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--muted); }
.zt-time { padding: 9px; border: 1px solid var(--border); border-radius: 10px; font-size: 1rem; background: var(--input-bg); color: var(--text); }
.bad-text { color: var(--bad); }
.zt-toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--brand-black); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; font-size: 0.95rem; max-width: 90vw; }

/* Tour-Gerüst (W74-II, K4) */
.tour-layer { position: fixed; inset: 0; z-index: 70; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(14, 19, 31, 0.55); pointer-events: none; transition: all 0.2s; }
.tour-card { position: fixed; left: 16px; right: 16px; max-width: 420px; margin: 0 auto; background: var(--card-bg); color: var(--text); border-radius: 16px; padding: 14px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
.tour-card h3 { margin: 4px 0 6px; }
.tour-card p { margin: 0 0 6px; }

/* ---------- Zeiten im Büro (W74-V, Chat 103) ---------- */
.zb-person { border-top: 1px solid var(--border); padding: 10px 0 4px; }
.zb-person:first-of-type { border-top: none; }
.zb-person-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.zb-lines { display: flex; flex-direction: column; gap: 6px; }
.zb-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.zb-card { align-items: flex-start; }
.zb-card .entry-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.zb-filter { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.zb-scroll { overflow-x: auto; }
.zb-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 0.88rem; }
.zb-table th, .zb-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.zb-table th:first-child, .zb-table td:first-child { text-align: left; white-space: normal; min-width: 130px; }
.zb-table tr.zb-out td { color: var(--muted); }
.zb-proto { padding: 4px 0; border-bottom: 1px dashed var(--border); }

/* ===== W74-IXa (Chat 110e): Neuigkeiten, Umfragen, Anliegen – Handy-Karte und Büro-Seite „Mitteilungen“ ===== */
.nw-card h2 { margin: 4px 0 8px; font-size: 1.05rem; }
.nw-card h2 + .nw-list, .nw-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.nw-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.nw-item.unread { border-color: var(--accent); background: var(--accent-soft); }
.nw-item p { margin: 0; white-space: pre-wrap; }
.nw-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; padding: 2px 0; text-align: start; font: inherit; color: inherit; cursor: pointer; flex-wrap: wrap; }
.nw-head strong { flex: 1 1 auto; }
.nw-chev { color: var(--accent); font-size: 1rem; width: 1em; }
[dir="rtl"] .nw-chev { transform: scaleX(-1); }
.nw-date { margin-inline-start: auto; }
.nw-body { white-space: pre-wrap; line-height: 1.45; }
.nw-question { font-weight: 600; font-size: 1.05rem; margin: 4px 0 8px; }
.nw-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.nw-kinds .btn.active, .nw-scale .btn.active { background: var(--primary); color: #fff; }
.nw-scale { display: flex; gap: 6px; margin: 8px 0 4px; }
.nw-scale .btn { flex: 1; font-size: 1.1rem; padding: 12px 0; }
.nw-opt { font-weight: 500; }
.nw-photo { max-width: 100%; max-height: 260px; border-radius: 10px; margin: 6px 0; display: block; }
.nw-photo[hidden] { display: none; }
.nw-answer { border-inline-start: 3px solid var(--primary); padding: 4px 10px; background: var(--primary-soft); border-start-end-radius: 8px; border-end-end-radius: 8px; width: 100%; box-sizing: border-box; }
.nw-answer p { margin: 4px 0 0; white-space: pre-wrap; }
.mt-form { display: flex; flex-direction: column; gap: 6px; }
.mt-form label { font-weight: 600; margin-top: 6px; }
.mt-form .lb-check { font-weight: 600; }
.mt-pick { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px 10px; }
.mt-pick .lb-check { font-weight: 400; margin: 6px 0; }
.mt-issue .mt-text { white-space: pre-wrap; margin: 8px 0 4px; font-size: 1rem; }
.mt-log { margin-top: 6px; }
.mt-news, .mt-survey { margin-top: 8px; }
.mt-survey .mt-chev { font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform .2s; }
.mt-survey.open .mt-chev { transform: rotate(90deg); }
.mt-survey:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mt-edit { padding: 8px 12px 12px; }
.mt-opts { display: flex; flex-direction: column; gap: 6px; }
.mt-opt-row { display: flex; gap: 6px; align-items: center; }
.mt-opt-row input { flex: 1; min-width: 0; }
.mt-opt-box > .btn { align-self: flex-start; margin-top: 6px; }
.mt-opt-box { display: flex; flex-direction: column; }
.mt-result { padding: 8px 12px 12px; }
.mt-bars { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.mt-bar-row { display: grid; grid-template-columns: minmax(80px, 35%) 1fr auto; gap: 8px; align-items: center; }
.mt-bar { height: 14px; background: var(--accent-soft); border-radius: 7px; overflow: hidden; }
.mt-bar i { display: block; height: 100%; background: var(--primary); border-radius: 7px; }
.mt-bar-n { font-variant-numeric: tabular-nums; font-size: 0.88rem; }
.mt-texts { margin: 4px 0; padding-inline-start: 20px; }
.mt-texts li { margin: 3px 0; white-space: pre-wrap; }
.mt-table { min-width: 0; }
.mt-table td, .mt-table th { text-align: left !important; white-space: normal; }

/* Hilfe-Bild „Standort wieder einschalten“ (W80, Chat 116c; nach „Nicht erlauben“ beim Aufnehmen und im Profil, V121), Verfügbarkeit */
.erkl-help { border: 1px solid rgba(127, 127, 127, .3); border-radius: 12px; padding: 12px; }
.erkl-steps { list-style: none; padding: 0; margin: 10px 0; border-radius: 10px; overflow: hidden; background: var(--card-bg); }
.erkl-steps li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid rgba(127, 127, 127, .2); }
.erkl-steps li:last-child { border-bottom: 0; }
.erkl-num { flex: 0 0 26px; height: 26px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--card-bg); font-weight: 600; font-size: 14px; }
.vf-days { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.vf-day { display: inline-flex; align-items: center; gap: 6px; }

/* Hilfe-Seite (W74-X-2b, Chat 120e): aufklappbare Einträge je Seite und häufige Fragen */
#hilfe-search { margin-top: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; font-size: 1rem; width: 100%; background: var(--input-bg); color: var(--text); font-family: inherit; }
.hilfe-group h2 { margin: 18px 4px 8px; font-size: 1.05rem; }
.hilfe-item { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; }
.hilfe-sum { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.hilfe-sum::-webkit-details-marker { display: none; }
.hilfe-sum::after { content: "›"; margin-left: auto; transition: transform .15s; color: var(--muted); }
.hilfe-item[open] > .hilfe-sum::after { transform: rotate(90deg); }
.hilfe-sum svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.hilfe-sum:focus-visible { outline: 2px solid var(--brand-clean); outline-offset: -2px; border-radius: var(--radius); }
.hilfe-body { padding: 0 16px 14px; }
.hilfe-steps { margin: 0 0 10px; padding-left: 1.2em; }
.hilfe-steps li { margin-bottom: 6px; }

/* W128 (Chat 128): Aufbewahrung und Löschen (Einstellungen, nur Leitung) */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.lf-eintrag { border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08)); padding: 6px 0 10px; }
.lf-frist { margin: 10px 0; }
.lf-frist h4 { margin: 0 0 4px; }
.lf-zahl { max-width: 110px; }
.lf-grundlage { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); gap: 4px; }
.lf-grundlage textarea { width: 100%; box-sizing: border-box; }
.warn-row.lf-row { background: var(--accent-soft); border-left-color: var(--accent); }

/* W65-II (Chat 144): Bestätigungs-Blatt über allem (auch über Dialogen und der Tour), leere Seite nach Erkennung, KI-Zugriff */
#ki-blatt { z-index: 90; }
#ki-blatt .sheet-card { max-width: 560px; margin: 0 auto; }
#ki-blatt h2 { margin: 0 0 6px; font-size: 1.15rem; }
#ki-blatt input[type=password] { width: 100%; box-sizing: border-box; }
.ki-leer { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; background: var(--bg); }
.ki-leer .card { max-width: 460px; }
.ki-row .meta { word-break: break-word; }
