:root {
  --bg: #f5f2ed;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --ink: #1d232b;
  --ink-2: #5b6470;
  --ink-3: #8a929c;
  --line: #e6e1d9;
  --accent: #e2611b;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee4;
  --ok: #2f8a57;
  --ok-soft: #e4f3ea;
  --warn: #b7791f;
  --warn-soft: #fbf1dc;
  --danger: #c2372d;
  --danger-soft: #fbe7e5;
  --shadow: 0 1px 2px rgba(29, 35, 43, .06), 0 4px 16px rgba(29, 35, 43, .06);
  --radius: 16px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --bg: #14171b;
    --surface: #1d2127;
    --surface-2: #232830;
    --ink: #eef0f2;
    --ink-2: #aab1ba;
    --ink-3: #7c848e;
    --line: #2e343c;
    --accent: #f07a35;
    --accent-ink: #1a0d05;
    --accent-soft: #3a2518;
    --ok: #5cc48a;
    --ok-soft: #1b3326;
    --warn: #e0a84a;
    --warn-soft: #3a2f1a;
    --danger: #ef6b61;
    --danger-soft: #3d1f1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
/* Ansicht in den Einstellungen fest gewählt */
:root[data-theme="dunkel"] {
  --bg: #14171b;
  --surface: #1d2127;
  --surface-2: #232830;
  --ink: #eef0f2;
  --ink-2: #aab1ba;
  --ink-3: #7c848e;
  --line: #2e343c;
  --accent: #f07a35;
  --accent-ink: #1a0d05;
  --accent-soft: #3a2518;
  --ok: #5cc48a;
  --ok-soft: #1b3326;
  --warn: #e0a84a;
  --warn-soft: #3a2f1a;
  --danger: #ef6b61;
  --danger-soft: #3d1f1d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
:root[data-theme="hell"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: clip; }
/* Die App selbst lässt sich nicht zoomen und nicht seitlich schieben, nur hoch und runter
   (Fotos, Pläne, PDFs und breite Tabellen haben eigene Bereiche, siehe dort) */
html { touch-action: pan-y; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

.app { max-width: 720px; margin: 0 auto; min-height: 100%; overflow-x: clip; }

/* Kopfzeile */
.appbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.appbar h1 { flex: 1; margin: 0; font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; }
.appbar h1.small { font-size: 1.1rem; font-weight: 650; }
.appbar .sub { display: block; font-size: .8rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  border: 0; background: transparent; cursor: pointer; position: relative;
  color: var(--ink);
}
.icon-btn:active { background: var(--line); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn .badge {
  position: absolute; top: 4px; right: 3px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.view { padding: 4px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); outline: none; }

/* Untere Leiste */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--ink-3); font-size: .72rem; font-weight: 600;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--accent); }
.tabbar .tab-new {
  flex: 0 0 auto; width: 58px; height: 58px; margin-top: -26px; border-radius: 20px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent);
}
.tabbar .tab-new svg { width: 28px; height: 28px; }
.tabbar .tab-new:active { transform: scale(.96); }
body.editing .tabbar { display: none; }
body.editing .fab { display: none; }
body.editing .view { padding-bottom: calc(110px + var(--safe-b)); }

/* Übersicht */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 14px;
}
.stat {
  background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; }
.stat span { font-size: .75rem; color: var(--ink-2); font-weight: 550; }
.stat.attention b { color: var(--accent); }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 12px; padding: 0 12px; margin-bottom: 8px;
  border: 1px solid var(--line);
}
.search svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.search input { flex: 1; border: 0; background: transparent; padding: 11px 0; outline: none; min-width: 0; }

.month { margin: 20px 4px 8px; font-size: .8rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; }

.card-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.rcard {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.rcard:active { transform: scale(.99); }
.rcard .date {
  flex: none; width: 52px; text-align: center; padding: 6px 0; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.rcard .date b { display: block; font-size: 1.35rem; line-height: 1.1; font-weight: 780; }
.rcard .date span { font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.rcard .body { flex: 1; min-width: 0; }
.rcard .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard .title.muted { color: var(--ink-3); font-style: italic; font-weight: 500; }
.rcard .preview { font-size: .87rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcard .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 3px; font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.rcard .meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.rcard .hours { flex: none; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.pending { color: var(--warn); background: var(--warn-soft); }
.pill.error { color: var(--danger); background: var(--danger-soft); }
.pill.local { color: var(--ink-2); background: var(--surface-2); }

.empty { text-align: center; padding: 48px 24px; color: var(--ink-2); }
.empty svg { width: 120px; height: 120px; margin-bottom: 12px; }
.empty h2 { color: var(--ink); margin: 0 0 6px; font-size: 1.2rem; }
.empty p { margin: 0 0 20px; }

/* Formular */
.section {
  background: var(--surface); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.section > h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; font-size: .82rem; font-weight: 750; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .06em;
}
.section > h2 .h-right { margin-left: auto; text-transform: none; letter-spacing: 0; }
.field { display: block; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field > span { display: block; font-size: .82rem; font-weight: 650; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 12px; padding: 11px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  background: var(--surface);
}
.field textarea { min-height: 96px; resize: none; line-height: 1.5; }
.field input[type="date"], .field input[type="time"] { min-height: 46px; }
input[type="date"], input[type="time"], input[type="month"] { display: block; min-width: 0; max-width: 100%; }
/* iPhone: Datumsfelder sonst breiter als der Bildschirm und mittig */
input::-webkit-date-and-time-value { text-align: left; }
.row { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .7fr); }
.row .field > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field input { min-width: 0; }
.hint { font-size: .8rem; color: var(--ink-3); margin: 6px 0 0; }

.hours-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 650;
}
.hours-total b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 8px 12px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.attach-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer;
  font-weight: 700; text-decoration: none; min-height: 46px;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px 8px; margin-top: 12px; align-items: start; }
.thumbs:empty { display: none; }
.thumb {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.thumb button.open { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .doc { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center; }
.thumb .doc svg { width: 30px; height: 30px; color: var(--accent); }
.thumb .doc span { font-size: .7rem; font-weight: 600; color: var(--ink-2); word-break: break-all; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.thumb .doc.defekt svg, .thumb .doc.defekt span { color: var(--danger); }
.thumb .doc.defekt span { word-break: normal; max-height: none; }
.thumb .remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.thumb .remove svg { width: 14px; height: 14px; }
.thumb .size { position: absolute; left: 4px; bottom: 4px; font-size: .65rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .5); padding: 1px 6px; border-radius: 6px; }

/* Speicherleiste im Bericht */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tastatur-offen .savebar, .tastatur-offen .tabbar { visibility: hidden; }
.savebar-inner { max-width: 688px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.savebar .state { flex: 1; min-width: 0; font-size: .82rem; color: var(--ink-2); line-height: 1.3; }
.savebar .state b { display: block; color: var(--ink); font-size: .9rem; }
.savebar .state .err { color: var(--danger); }

/* Einstellungen */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.toggle span b { display: block; font-weight: 650; }
.toggle span small { color: var(--ink-3); font-size: .8rem; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: .9rem; }
.steps li { margin-bottom: 6px; }
.steps code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .85em; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.kv { display: flex; justify-content: space-between; font-size: .9rem; padding: 4px 0; color: var(--ink-2); }
.kv b { color: var(--ink); font-weight: 650; }
.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px;
  background: var(--warn-soft); color: var(--ink); font-size: .9rem;
}
.banner a { color: var(--accent); font-weight: 700; }
.banner svg { width: 20px; height: 20px; flex: none; color: var(--warn); margin-top: 1px; }

/* Menü, Toast, Lightbox */
.menu {
  position: absolute; right: 12px; top: calc(var(--safe-t) + 56px); z-index: 30; min-width: 220px;
  background: var(--surface); border-radius: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  padding: 6px; border: 1px solid var(--line);
}
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; padding: 11px 12px; border-radius: 10px; cursor: pointer; text-align: left; font-weight: 600; }
.menu button:active { background: var(--surface-2); }
.menu button svg { width: 20px; height: 20px; }
.menu button.danger { color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px;
  font-weight: 600; font-size: .9rem; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.editing .toast { bottom: calc(96px + var(--safe-b)); }

.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; top: calc(var(--safe-t) + 12px); right: 12px; color: #fff; background: rgba(255, 255, 255, .15); }

@media (min-width: 560px) {
  .view { padding-left: 24px; padding-right: 24px; }
  .appbar { padding-left: 24px; padding-right: 24px; }
}

/* Neuer-Bericht-Knopf */
.fab {
  position: fixed; z-index: 15; right: max(16px, calc(50% - 344px));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  display: inline-flex; align-items: center; gap: 8px; padding: 0 20px 0 16px; height: 56px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 750;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent);
}
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.97); }
.view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }

/* Baustelle im Bericht */
.site-pick {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 11px 12px; min-height: 56px;
}
.site-pick > svg, .pick > svg, .scard .sicon svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.site-pick span, .pick span { flex: 1; min-width: 0; }
.site-pick b, .pick b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-pick b.muted { color: var(--ink-2); }
.site-pick small, .pick small { display: block; color: var(--ink-3); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-pick em { font-style: normal; font-size: .82rem; font-weight: 700; color: var(--accent); }

/* Baustellen-Liste */
.scard {
  display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.scard.archived { opacity: .6; }
.scard .sicon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; flex: none; }
.scard .body { flex: 1; min-width: 0; }
.scard .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard .preview { font-size: .87rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard .meta { font-size: .78rem; color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.scard > svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }

/* Auswahl-Blatt */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0); transition: background .2s;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop.open { background: rgba(0, 0, 0, .45); }
.sheet {
  width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + var(--safe-b));
  transform: translateY(100%); transition: transform .22s ease-out;
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h2 { margin: 0 0 12px; font-size: 1.2rem; }
.sheet .section { box-shadow: none; border: 1px solid var(--line); }
.pick-list { display: grid; gap: 8px; }
.pick {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 58px;
}
.pick.current { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.pick[hidden] { display: none; }

/* Speichern / Abbrechen */
.savebar-inner .btn { flex: 1; }
.savebar-inner .btn.primary { flex: 1.6; }
#delete-btn { margin-top: 4px; }
.sync-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 2px 10px; font-size: .82rem; color: var(--ink-2); }
.sync-line:empty { display: none; }
.sheet-or { display: flex; align-items: center; gap: 12px; margin: 16px 4px 12px; color: var(--ink-3); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.sheet-or::before, .sheet-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#sheet-form { margin-top: 0; }
.sheet .search { margin-bottom: 10px; }
[hidden] { display: none !important; }
.sheet .section > h2 { font-size: .82rem; margin: 0 0 12px; }

/* Personal */
.crew-list { display: grid; gap: 10px; margin-bottom: 12px; }
.crew { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 12px; background: var(--surface-2); }
.crew-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.crew-head > span { flex: 1; min-width: 0; }
.crew-head b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-head small { display: block; color: var(--ink-3); font-size: .8rem; }
.crew-head .crew-hours { display: inline; flex: none; color: var(--accent); font-variant-numeric: tabular-nums; }
.crew-head .icon-btn { width: 34px; height: 34px; margin-right: -6px; }
.crew-head .icon-btn svg { width: 16px; height: 16px; }
.crew .field { margin-bottom: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: .8rem;
}
.scard .sicon.avatar { border-radius: 50%; font-size: .95rem; }
.scard.person { width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; }
.link-btn { all: unset; cursor: pointer; color: var(--accent); font-weight: 650; font-size: .88rem; padding: 2px 2px 6px; }
.pick.check .box {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex: none; display: grid; place-items: center;
}
.pick.check[aria-pressed="true"] { border-color: var(--accent); }
.pick.check[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.pick.check[aria-pressed="true"] .box::after { content: ""; width: 10px; height: 6px; border: solid var(--accent-ink); border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.crew-sum { border-radius: 12px; background: var(--accent-soft); padding: 8px 12px; margin-bottom: 12px; }
.crew-sum:empty { display: none; }
.crew-sum .kv { color: var(--ink); }
.crew-sum .kv small { color: var(--ink-3); }
.crew-sum .kv.total { border-top: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); margin-top: 4px; padding-top: 8px; color: var(--accent); font-weight: 700; }
.crew-sum .kv.total b { color: var(--accent); font-size: 1.05rem; }
.kat-chips .chip { padding: 7px 12px; }

/* Tagesbericht / Rapport */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 8px; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.pill.art { color: var(--accent); background: var(--accent-soft); }
.pill.art::before { display: none; }
.art-choice { display: grid; gap: 10px; margin-bottom: 8px; }
.art-choice .pick { min-height: 72px; }
.art-choice .pick > svg { width: 26px; height: 26px; color: var(--accent); }
.art-choice .pick b { font-size: 1.05rem; }

/* Rapport: Maschinen und Unterschrift */
.masch { display: grid; grid-template-columns: minmax(0, 1fr) 84px 40px; gap: 8px; align-items: end; margin-bottom: 10px; }
.masch .field { margin: 0; }
.masch .icon-btn { margin-bottom: 4px; }
#masch-quick { margin-top: 4px; }
.sign-pad { position: relative; height: 180px; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; margin: 8px 0 14px; overflow: hidden; }
.sign-pad canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.sign-line { position: absolute; left: 16px; right: 16px; bottom: 34px; border-top: 1px solid #ccc; font-size: 12px; color: #999; padding-top: 4px; pointer-events: none; }
.sign-actions { grid-template-columns: 1fr 1fr 1.3fr; }
.sign-done { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 12px; text-align: center; }
.sign-done img { max-width: 100%; max-height: 140px; display: block; margin: 0 auto; }
.sign-done small { color: #555; }
#masch-quick .chip { display: inline-flex; align-items: center; gap: 4px; }
#masch-quick .chip svg { width: 16px; height: 16px; flex: none; }
#abr-seg { margin-bottom: 0; }
#pdf-btn { margin-bottom: 12px; }

/* Stundennachweis */
.site-pick.who { margin: 6px 0 4px; }
.site-pick.who .avatar { flex: none; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 12px; }
.month-nav b { font-size: 1.05rem; }
.month-nav .flip { display: inline-flex; transform: scaleX(-1); }
.rcard.stunde { width: 100%; text-align: left; font: inherit; color: inherit; border: 1px solid var(--line); cursor: pointer; }
.rcard.stunde.frei .date { opacity: .7; }
.sheet-actions { margin-top: 6px; }
.sheet-actions .btn { width: 100%; }
button.fab { border: 0; font: inherit; font-weight: 750; cursor: pointer; }
.stat b small { font-size: .7em; color: var(--ink-2); font-weight: 650; }
.missing { outline: 2px solid #d64545; outline-offset: 3px; border-radius: 12px; transition: outline-color .3s; }

/* Zusammenfassung */
.seg.three { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 0; }
.seg.three button { padding: 9px 4px; font-size: .9rem; }
select { width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px; -webkit-appearance: none; appearance: none; }
.pill.von { color: var(--ink-2); background: var(--surface-2); }
.pill.von::before { display: none; }

/* PDF-Vorschau */
body.no-scroll { overflow: hidden; }
.pdf-view { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #3a3d42; }
.pdf-view header { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 8px) 12px 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.pdf-view header div { flex: 1; min-width: 0; }
.pdf-view header b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-view header small { color: var(--ink-3); font-size: .8rem; }
.pdf-pages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pdf-pages canvas { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); max-width: 100%; height: auto; flex: none; }
.pdf-pages.gezoomt { overflow: auto; align-items: flex-start; touch-action: pan-x pan-y; }
.pdf-pages.gezoomt canvas { max-width: none; }
.pdfv-zoom { display: flex; gap: 6px; flex: none; }
.pdfv-zoom button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface, transparent); color: var(--ink); font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; }
.pdf-pages .hint { color: #e5e7eb; }
.pdf-view footer { padding: 10px 16px calc(10px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.lang-pick .flag { font-size: 1.6rem; line-height: 1; }

/* gesperrte Sync-Einstellungen */
.sync-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.sync-fields:disabled input { opacity: .6; background: var(--surface-2); }
#sync-unlock svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }

/* Löschen: klein, links */
.btn.del { display: flex; width: max-content; margin-right: auto; padding: 7px 12px; min-height: 36px; font-size: .85rem; font-weight: 650; gap: 6px; }
.btn.del svg { width: 16px; height: 16px; }

/* Baustelle als Freitext, Art der Arbeit */
.frei-site { display: flex; gap: 8px; align-items: flex-end; }
.frei-site .field { flex: 1; min-width: 0; margin-bottom: 14px; }
.frei-site .btn { margin-bottom: 14px; }
.site-vorschlag { margin: -6px 0 14px; }
.site-vorschlag .hint { margin: 0 0 6px; }
.gewerke { margin-bottom: 12px; }
.gewerke .chips { margin-bottom: 8px; }
.gewerke .gw-frei {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; outline: none;
}
.gewerke .gw-frei:focus { border-color: var(--accent); }

.geraete-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 14px 0 6px; }
.geraet { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface); }
.geraet b { display: block; font-weight: 650; }
.geraet small { display: block; color: var(--ink-3); font-size: .82rem; }
.geraet.fehlt { opacity: .75; }
.geraet-admin { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }

.thumb .markieren {
  position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.thumb .markieren svg { width: 17px; height: 17px; }
.thumb-item .bildtext {
  all: unset; display: block; box-sizing: border-box; width: 100%; margin-top: 4px; padding: 2px 2px; cursor: pointer;
  font-size: .74rem; line-height: 1.25; color: var(--accent); font-weight: 600;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.thumb-item .bildtext.voll { color: var(--ink-2); font-weight: 500; }
/* Foto markieren */
html.mk-offen, html.mk-offen body { overflow: hidden; }
.mk-view { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: #16191d; color: #fff; touch-action: none; }
.mk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(var(--safe-t, 0px) + 8px) 12px 8px; }
.mk-top b { font-size: 1rem; }
.mk-top .btn { min-height: 40px; padding: 0 16px; }
.mk-top .btn.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.mk-flaeche { flex: 1; min-height: 0; display: grid; place-items: center; padding: 4px; }
.mk-markup .mk-flaeche { display: block; padding: 0; }
.mk-flaeche canvas { touch-action: none; border-radius: 4px; background: #000; }
.mk-markup .mk-flaeche canvas { display: block; width: 100%; height: 100%; border-radius: 0; background: none; }
.mk-text { display: flex; gap: 8px; padding: 8px 12px; background: #23272c; }
.mk-text[hidden] { display: none; }
.mk-text input { flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 0; }
.mk-leiste { padding: 8px 10px calc(var(--safe-b, 0px) + 10px); background: #1f2327; display: grid; gap: 10px; }
.mk-werkzeuge { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mk-markup .mk-werkzeuge { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 2px; }
.mk-wz { all: unset; display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 10px; color: #cfd4da; cursor: pointer; font-size: .7rem; }
.mk-wz svg { width: 24px; height: 24px; }
.mk-wz[aria-pressed="true"] { background: rgba(255,255,255,.14); color: #fff; }
.mk-farben { display: flex; align-items: center; gap: 8px; }
.mk-farbe { all: unset; width: 30px; height: 30px; border-radius: 50%; background: var(--f); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); cursor: pointer; flex: none; }
.mk-farbe[aria-pressed="true"] { box-shadow: 0 0 0 3px #16191d, 0 0 0 5px #fff; }
.mk-dicke, .mk-rueck { all: unset; display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 10px; color: #cfd4da; font-size: .78rem; cursor: pointer; background: rgba(255,255,255,.08); }
.mk-dicke { margin-left: auto; }
.mk-dicke[aria-pressed="true"] { background: #fff; color: #16191d; font-weight: 700; }
.mk-rueck svg { width: 18px; height: 18px; }
.mk-rueck:disabled { opacity: .35; }
@media (max-width: 420px) {
  .mk-farben { gap: 6px; }
  .mk-farbe { width: 27px; height: 27px; }
  .mk-rueck span { display: none; }
}

/* Einheitlicher Zurück-Knopf: weißer Pfeil im halbdurchsichtigen Kreis */
.appbar #back, #pdfv-close, .sheet-zurueck {
  width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; flex: none; cursor: pointer;
  display: inline-grid; place-items: center; color: #fff; background: rgba(29, 35, 43, .38);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.appbar #back svg, #pdfv-close svg, .sheet-zurueck svg { width: 20px; height: 20px; margin-left: -2px; }
.appbar #back:active, #pdfv-close:active, .sheet-zurueck:active { background: rgba(29, 35, 43, .55); }
.appbar #back { margin-right: 8px; }
#pdfv-close { background: rgba(255, 255, 255, .18); }
.sheet { position: relative; }
.sheet-zurueck { position: absolute; top: 14px; left: 14px; z-index: 1; }
.sheet > h2:first-of-type { padding-left: 46px; min-height: 36px; display: flex; align-items: center; }

/* Aufmaß */
.am-list { display: grid; gap: 12px; margin-bottom: 12px; }
.am-pos { border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 12px; background: var(--surface-2); }
.am-pos .field { margin-bottom: 8px; }
.am-row1 { display: grid; grid-template-columns: 62px 1fr 34px; gap: 8px; align-items: end; }
.am-row1 .am-del { margin-bottom: 14px; }
.am-einheit { grid-template-columns: repeat(4, 1fr); margin: 0 0 10px; }
.am-einheit button { padding: 6px 4px; }
.am-kopf, .am-zeile { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.am-kopf span { font-size: .72rem; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; padding-left: 4px; }
.am-zeile { padding: 6px 0 8px; border-bottom: 1px dashed var(--line); }
.am-zeile input { width: 100%; min-width: 0; padding: 8px 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font: inherit; font-size: 16px; text-align: right; color: var(--ink); }
.am-zfuss { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.am-zfuss .chip { min-height: 30px; padding: 4px 10px; font-size: .82rem; }
.am-gleich { margin-left: auto; color: var(--ink-3); }
.am-zfuss .am-wert { width: 96px; font-weight: 700; }
.am-zfuss .am-wert[readonly] { border-color: transparent; background: transparent; }
.am-eh { min-width: 26px; font-weight: 650; color: var(--ink-2); }
.am-zeile.abzug input { color: var(--danger); }
.am-zeile.abzug .am-wert { background: var(--danger-soft); }
.am-zdel, .am-del { width: 30px; height: 30px; color: var(--ink-3); }
.am-del { color: var(--danger); }
.am-zdel svg, .am-del svg { width: 16px; height: 16px; }
.am-pfuss { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.am-pfuss .btn { min-height: 36px; padding: 6px 12px; }
.am-netto { margin-left: auto; text-align: right; color: var(--ink-2); }
.am-netto b { color: var(--ink); font-size: 1.05rem; white-space: nowrap; }
.rcard .hours { white-space: nowrap; text-align: right; }

/* Foto-Aufmaß */
.fa-start { margin-top: 10px; }
.fa-karten { display: grid; gap: 8px; margin-top: 12px; }
.fa-karten:empty { display: none; }
.fa-karte { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.fa-karte-bild { width: 64px; height: 48px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--line); display: grid; place-items: center; cursor: pointer; color: var(--ink-3); }
.fa-karte-bild img { width: 100%; height: 100%; object-fit: cover; }
.fa-karte-bild svg { width: 22px; height: 22px; }
.fa-karte-text { display: grid; min-width: 0; }
.fa-karte-text small { color: var(--ink-2); }
.fa-karte .btn { min-height: 36px; padding: 6px 10px; }
.fa-karte .btn svg { width: 18px; height: 18px; }
.fa-karte .fa-weg { color: var(--danger); width: 32px; height: 32px; }
.fa-karte .fa-weg svg { width: 18px; height: 18px; }

.fa-hinweis { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: .82rem; line-height: 1.3; color: #e6e9ec; background: #23272c; height: 62px; box-sizing: border-box; overflow: hidden; flex: none; }
.fa-text { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fa-knoepfe { display: flex; gap: 6px; }
.fa-knoepfe .chip { min-height: 32px; padding: 4px 12px; font-size: .82rem; background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.fa-knoepfe .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.fa-flaeche { position: relative; }
.fa-fk { position: absolute; top: 8px; left: 8px; z-index: 1; border-radius: 14px; overflow: hidden; background: #111; box-shadow: 0 6px 20px rgba(0,0,0,.55); border: 2px solid #fff; }
.fa-fk[hidden] { display: none; }
.fa-fk canvas { display: block; touch-action: none; cursor: move; }
.fa-fk-leiste { display: grid; grid-template-columns: repeat(6, 1fr); background: #1f2327; }
.fa-fk-leiste button { all: unset; text-align: center; padding: 9px 0; color: #fff; font-size: .85rem; cursor: pointer; }
.fa-fk-leiste button:active { background: rgba(255,255,255,.15); }
.fa-fk-ok { background: var(--accent) !important; color: var(--accent-ink) !important; font-weight: 700; }
.fa-fk.nur-lupe { pointer-events: none; }
.fa-fk.nur-lupe .fa-fk-leiste { display: none; }
.fa-raster[aria-pressed="true"], .fa-magnet[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,.18); }
.fa-magnet[aria-pressed="false"] { opacity: .55; }
.fa-view .mk-leiste { grid-template-columns: minmax(0, 1fr); }
.fa-view .mk-werkzeuge { grid-template-columns: repeat(6, 1fr); gap: 4px; }
.fa-view .mk-werkzeuge .mk-wz span { font-size: .64rem; white-space: nowrap; }
.fa-zwei { grid-template-columns: 1fr 1fr; }
.fa-regel { flex: 1; min-width: 0; font-size: .74rem; color: #aeb5bd; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 72%; overflow-y: auto; z-index: 2; padding: 14px 14px calc(var(--safe-b, 0px) + 14px); background: #1f2327; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.45); display: grid; gap: 10px; touch-action: pan-y; }
.fa-panel[hidden] { display: none; }
.fa-panel-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fa-panel-knoepfe { display: flex; justify-content: flex-end; gap: 8px; }
.fa-panel .btn.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.fa-feld { display: grid; gap: 4px; font-size: .82rem; color: #cfd4da; }
.fa-feld input, .fa-feld select { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 0; background: #fff; color: #111; width: 100%; box-sizing: border-box; }
.fa-feld .seg { margin: 0; background: rgba(255,255,255,.08); border-color: transparent; }
.fa-feld .seg button { color: #cfd4da; }
.fa-zeile { display: grid; gap: 8px; }
.fa-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #e6e9ec; }
.fa-check input { width: 20px; height: 20px; }
.fa-vorschlaege { display: flex; flex-wrap: wrap; gap: 6px; }
.fa-vorschlaege .chip, .fa-li .chip { min-height: 30px; padding: 4px 10px; font-size: .8rem; background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.fa-klein { margin: 0; font-size: .76rem; color: #aeb5bd; }
.fa-warn { color: #ffab91; }
.fa-li { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.fa-li > div { display: grid; min-width: 0; }
.fa-li small { color: #aeb5bd; }
.fa-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.fa-view .fa-raster span { display: inline; }
.fa-flaeche { overflow: hidden; }
.fa-zoomknoepfe { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.fa-zoomknoepfe button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(20,22,25,.78); color: #fff; font-size: 1.4rem; line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.fa-zoomknoepfe button:active { background: var(--accent); color: var(--accent-ink); }
.fa-view .fa-bild { touch-action: none; will-change: transform; }
.fa-view .mk-wz.fa-unnoetig { opacity: .35; }
.am-ztext { grid-column: 1 / -1; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.am-zeile.am-info { display: block; padding: 8px 0 2px; border-bottom: 0; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }

/* Pläne markieren */
.mk-markup .mk-flaeche { position: relative; overflow: hidden; }
.mk-hinweis { position: absolute; left: 10px; right: 64px; top: 8px; z-index: 3; padding: 8px 12px; border-radius: 10px; background: rgba(20,22,25,.82); color: #fff; font-size: .85rem; pointer-events: none; }
.mk-hinweis[hidden] { display: none; }
.mk-markup .mk-wz span { font-size: .62rem; white-space: nowrap; }
.mk-markup .mk-wz svg { width: 22px; height: 22px; }
.mk-fotowahl { position: absolute; inset: auto 0 0 0; z-index: 5; max-height: 60%; display: flex; flex-direction: column; background: #23272c; border-radius: 16px 16px 0 0; padding: 12px 12px calc(var(--safe-b, 0px) + 12px); box-shadow: 0 -6px 20px rgba(0,0,0,.4); }
.mk-fotowahl[hidden] { display: none; }
.mk-fw-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.mk-fw-kopf .btn { min-height: 36px; background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.mk-fw-neu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.mk-fw-neu .btn { min-height: 48px; gap: 6px; justify-content: center; }
.mk-fw-neu .btn.soft { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.mk-fw-neu svg { width: 22px; height: 22px; flex: none; }
.mk-fw-liste { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.mk-fw-liste button { all: unset; display: grid; gap: 4px; justify-items: center; cursor: pointer; color: #fff; font-size: .8rem; font-weight: 700; }
.mk-fw-liste img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
/* Pläne an der Baustelle und im Bericht */
.plan-liste { display: grid; gap: 8px; margin-bottom: 12px; }
.plan-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 4px 6px 4px 4px; }
.plan-oeffnen { all: unset; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; cursor: pointer; color: var(--accent); }
.plan-oeffnen svg { width: 24px; height: 24px; flex: none; }
.plan-oeffnen span { min-width: 0; display: grid; color: var(--ink); }
.plan-oeffnen b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-oeffnen small { color: var(--ink-3); font-size: .78rem; }
.plan-weg { color: var(--danger); }
.plan-weg svg { width: 18px; height: 18px; }
.pm-liste { display: grid; gap: 10px; margin-bottom: 12px; }
.pm-item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 8px; }
.pm-bild { all: unset; cursor: pointer; }
.pm-bild img { width: 112px; height: 84px; object-fit: contain; background: #fff; border-radius: 8px; display: block; }
.pm-text { display: grid; gap: 2px; min-width: 0; }
.pm-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-text small { color: var(--ink-2); }
.pm-knoepfe { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pm-knoepfe .btn { min-height: 34px; padding: 4px 12px; }
.pm-weg { color: var(--danger); }
.pm-weg svg { width: 18px; height: 18px; }
.thumb .foto-nr { position: absolute; right: 4px; bottom: 4px; font-size: .68rem; font-weight: 800; color: #fff; background: var(--accent); padding: 1px 7px; border-radius: 6px; }
.thumb .auf-plan {
  position: absolute; top: 40px; left: 4px; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.thumb .auf-plan svg { width: 17px; height: 17px; }

/* Strichstärke im Markier-Editor */
.mk-markup .mk-farben .mk-rueck { margin-left: auto; }
.mk-staerke { display: flex; align-items: center; gap: 6px; }
.mk-st { all: unset; display: flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 10px; color: #cfd4da; font-size: .74rem; cursor: pointer; background: rgba(255,255,255,.08); flex: none; }
.mk-st i { display: block; width: 14px; height: var(--h); border-radius: 4px; background: currentColor; }
.mk-st[aria-pressed="true"] { background: #fff; color: #16191d; font-weight: 700; }
.mk-regler { flex: 1; min-width: 60px; accent-color: #e2611b; }
.mk-markup .fa-zoomknoepfe { bottom: 10px; }
.mk-ansehen .mk-leiste, .mk-ansehen .mk-fertig { visibility: hidden; }
.mk-ansehen .mk-leiste { display: none; }

/* Handbuch */
.handbuch { line-height: 1.55; }
.handbuch h2 { margin: 18px 0 8px; font-size: 1.1rem; }
.handbuch h2:first-child, .handbuch h3:first-child { margin-top: 0; }
.handbuch h3 { margin: 22px 0 8px; font-size: 1.05rem; color: var(--accent); }
.handbuch p, .handbuch ul, .handbuch ol { margin: 0 0 10px; }
.handbuch ul, .handbuch ol { padding-left: 1.3em; }
.handbuch li { margin-bottom: 4px; }
.handbuch a { color: var(--accent); word-break: break-word; }
.handbuch code { font-size: .9em; }
.hb-tabelle { overflow-x: auto; margin: 0 0 12px; touch-action: pan-x pan-y; }
.hb-tabelle table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.hb-tabelle th, .hb-tabelle td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line, rgba(127,127,127,.25)); }
.hb-tabelle th { font-weight: 700; }

/* Raumaufmaß (Freihand-Grundriss) */
.ra-karten { display: grid; gap: 8px; margin-top: 12px; }
.ra-karten:empty { display: none; }
.ra-karte-bild { background: #fff; }
.ra-karte-bild img { object-fit: contain; }
.ra-view .ra-flaeche { position: relative; display: block; padding: 0; overflow: hidden; background: #fbfcfd; }
.ra-svg { display: block; width: 100%; height: 100%; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.ra-view .mk-werkzeuge { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.ra-view .mk-wz { min-height: 44px; }
.ra-leiste2 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.ra-leiste2 .mk-rueck { flex-direction: column; justify-content: center; gap: 2px; min-height: 40px; padding: 4px 2px; min-width: 0; }
.ra-leiste2 .mk-rueck span { display: block; max-width: 100%; font-size: .64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-werte { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: grid; gap: 1px; text-align: left; padding: 7px 11px; border: 0; border-radius: 12px; background: rgba(20,22,25,.82); color: #fff; font: inherit; font-size: .76rem; line-height: 1.3; cursor: pointer; max-width: calc(100% - 76px); }
.ra-werte[hidden] { display: none; }
.ra-werte b { font-size: .95rem; }
.ra-view .fa-panel { max-height: 64%; z-index: 5; }
.ra-wandzeile .chip { min-height: 32px; padding: 4px 10px; background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.ra-view .seg { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.ra-view .seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ra-view .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.ra-reihe { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.ra-reihe .btn { min-height: 44px; }
.ra-raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ra-gefahr { color: #ffab91 !important; }
.ra-wandzeile { display: grid; grid-template-columns: 34px 1fr 96px 40px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .9rem; }
.ra-wandzeile input { font: inherit; font-size: 16px; padding: 8px 10px; border-radius: 10px; border: 0; background: #fff; color: #111; width: 100%; box-sizing: border-box; text-align: right; }
.ra-wandzeile input.gemessen { color: #0b57d0; font-weight: 700; }
.ra-werteliste { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); }
.ra-wert { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; color: #cfd4da; }
.ra-wert b { color: #fff; }
.ra-dialog { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.55); }
.ra-dialog[hidden] { display: none; }
.ra-dialog-box { width: min(420px, 100%); max-height: 86%; overflow-y: auto; display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: #23272c; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.ra-dialog-box .btn.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.ra-wahl { display: grid; gap: 8px; }
.ra-wahl .btn { display: grid; justify-items: start; gap: 2px; text-align: left; min-height: 52px; padding: 8px 12px; background: rgba(255,255,255,.1); color: #fff; border-color: transparent; }
.ra-wahl .btn small { color: #cfd4da; font-weight: 400; }
.ra-wahl .btn:disabled { opacity: .45; }
.ra-liste { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .88rem; }

/* Urlaubskalender */
.st-zahl, .tab-zahl {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 750;
}
.tabbar a { position: relative; }
.tab-zahl { position: absolute; top: 2px; left: calc(50% + 6px); }
.uk { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 6px; }
.uk-kopf, .uk-woche { display: grid; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); gap: 3px; }
.uk-kopf span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--ink-3); padding: 2px 0 6px; }
.uk-woche { margin-bottom: 3px; }
.uk-kw { display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--ink-3); }
.uk-tag {
  border: 0; background: var(--surface-2); color: var(--ink); border-radius: 9px; min-height: 44px; padding: 3px 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.uk-tag b { font-size: .95rem; font-weight: 650; }
.uk-tag small { font-size: .58rem; font-weight: 700; line-height: 1; max-width: 100%; overflow: hidden; white-space: nowrap; }
.uk-tag.we { background: transparent; color: var(--ink-3); }
.uk-tag.fremd { opacity: .35; }
.uk-tag.ft { color: var(--danger); background: var(--danger-soft); }
.uk-tag.u-beantragt { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); }
.uk-tag.u-genehmigt { background: var(--ok); color: #fff; }
.uk-tag.u-betrieb { background: #2f6fb3; color: #fff; }
.uk-tag.u-abgelehnt { text-decoration: line-through; color: var(--ink-3); }
.uk-tag.heute b { text-decoration: underline; text-underline-offset: 3px; }
.uk-tag.auswahl { box-shadow: inset 0 0 0 3px var(--accent); }
.uk-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 4px 0; font-size: .78rem; color: var(--ink-2); font-weight: 600; }
.uk-legende i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.uk-legende i.u-beantragt { background: var(--warn-soft); box-shadow: inset 0 0 0 2px var(--warn); }
.uk-legende i.u-genehmigt { background: var(--ok); }
.uk-legende i.u-betrieb { background: #2f6fb3; }
.uk-legende i.ft { background: var(--danger-soft); box-shadow: inset 0 0 0 2px var(--danger); }
.uk-feiertage { margin: 4px 4px 0; font-size: .85rem; color: var(--danger); }
.uk-feiertage b { display: inline-block; min-width: 46px; }
.urlaub-karte { text-align: left; border: 0; width: 100%; }
.uk-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }

/* Schieber „Abgerechnet“ auf Rapport-Karten (nur Administrator) */
.abg { display: inline-flex; align-items: center; gap: 6px; margin: -6px -6px -6px auto; padding: 6px; color: var(--ink-3); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.abg i { position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--line); transition: background .2s; }
.abg i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.abg[aria-checked="true"] { color: var(--ok); }
.abg[aria-checked="true"] i { background: var(--ok); }
.abg[aria-checked="true"] i::after { transform: translateX(14px); }
.pdfv-abg { margin-bottom: 8px; }
