/* =========================================================
   Farben als Variablen – drei Darstellungen:
   hell (Standard), dunkel, Ansitz-Nachtmodus (Rotlicht)
   ========================================================= */
:root {
  --bg: #F4F5F0; --surface: #FFFFFF; --surface-2: #FBFBF8; --soft: #EEF2EC;
  --line: #DDE3DC; --border: #B8C2BA;
  --ink: #1C2B22; --ink-2: #4F5D53; --ink-3: #33433A;
  --head-bg: #2F5E4E; --head-ink: #FFFFFF; --head-ink-2: #CFE0D6;
  --accent: #2F5E4E; --primary-bg: #2F5E4E; --primary-ink: #FFFFFF;
  --amber: #F2B24C; --amber-ink: #2A1A05; --tab-bar: #F2B24C;
  --newdot: #F2C230; --newdot-ink: #2A1F00; --newdot-ring: #FFFFFF;
  --danger: #A33A2B; --danger-border: #E2B8B0; --warn-bg: #FBE7B5; --warn-ink: #5A3E00;
  --img-bg: #2A3326; --img-ink: #C9D6CC; --img-filter: none; --map-filter: none;
  --tile-map: #6F8048; --tile-map-ink: #FFFFFF; --tile-edit-bg: rgba(255,255,255,0.9);
  --nav-active: #2F7D5B;
  --sync-bg: rgba(255,255,255,0.92); --sync-ink: #2F5E4E; --sync-off-bg: #F6D9B8; --sync-off-ink: #5A2F05;
  --dot-ok: #2E9D5B; --dot-off: #D9822B; --dot-idle: #8A948C;
  --toast-bg: #1C2B22; --toast-ink: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.12); --shadow-lg: 0 4px 12px rgba(0,0,0,0.3);
  --backdrop: rgba(0,0,0,0.35); --focus: #F2B24C;
  --nav-h: 64px;
  color-scheme: light;
}
/* Dunkel – fest eingestellt */
:root[data-theme="dark"] {
  --bg: #111613; --surface: #1B221E; --surface-2: #161C19; --soft: #243029;
  --line: #2A332E; --border: #3D4A43;
  --ink: #E4EAE5; --ink-2: #A9B6AE; --ink-3: #C9D3CC;
  --head-bg: #1F3D33; --head-ink: #FFFFFF; --head-ink-2: #A9C4B5;
  --accent: #8FD0AE; --primary-bg: #3E7A63; --primary-ink: #FFFFFF;
  --amber: #E9A93F; --amber-ink: #2A1A05; --tab-bar: #E9A93F;
  --newdot: #F2C230; --newdot-ink: #2A1F00; --newdot-ring: #1B221E;
  --danger: #F08A7A; --danger-border: #6B3329; --warn-bg: #3A2E10; --warn-ink: #F5D58A;
  --img-bg: #0E120F; --img-ink: #8E9C93; --img-filter: none; --map-filter: brightness(0.72) saturate(0.85);
  --tile-map: #3E4A2E; --tile-map-ink: #E4EAE5; --tile-edit-bg: rgba(27,34,30,0.9);
  --nav-active: #8FD0AE;
  --sync-bg: #243029; --sync-ink: #E4EAE5; --sync-off-bg: #4A3416; --sync-off-ink: #F5D58A;
  --toast-bg: #2B3530; --toast-ink: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.5); --shadow-lg: 0 4px 12px rgba(0,0,0,0.6);
  --backdrop: rgba(0,0,0,0.55);
  color-scheme: dark;
}
/* Dunkel – automatisch nach Handy-Einstellung */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #111613; --surface: #1B221E; --surface-2: #161C19; --soft: #243029;
    --line: #2A332E; --border: #3D4A43;
    --ink: #E4EAE5; --ink-2: #A9B6AE; --ink-3: #C9D3CC;
    --head-bg: #1F3D33; --head-ink: #FFFFFF; --head-ink-2: #A9C4B5;
    --accent: #8FD0AE; --primary-bg: #3E7A63; --primary-ink: #FFFFFF;
    --amber: #E9A93F; --amber-ink: #2A1A05; --tab-bar: #E9A93F;
    --newdot: #F2C230; --newdot-ink: #2A1F00; --newdot-ring: #1B221E;
    --danger: #F08A7A; --danger-border: #6B3329; --warn-bg: #3A2E10; --warn-ink: #F5D58A;
    --img-bg: #0E120F; --img-ink: #8E9C93; --img-filter: none; --map-filter: brightness(0.72) saturate(0.85);
    --tile-map: #3E4A2E; --tile-map-ink: #E4EAE5; --tile-edit-bg: rgba(27,34,30,0.9);
    --nav-active: #8FD0AE;
    --sync-bg: #243029; --sync-ink: #E4EAE5; --sync-off-bg: #4A3416; --sync-off-ink: #F5D58A;
    --toast-bg: #2B3530; --toast-ink: #FFFFFF;
    --shadow: 0 1px 3px rgba(0,0,0,0.5); --shadow-lg: 0 4px 12px rgba(0,0,0,0.6);
    --backdrop: rgba(0,0,0,0.55);
    color-scheme: dark;
  }
}
/* Ansitz-Nachtmodus: nur Rot auf Schwarz, keine hellen Flächen, Bilder rot getönt und gedimmt */
/* Ansitz-Nachtmodus Standard: Bernstein auf Schwarz */
:root[data-night] {
  --bg: #000000; --surface: #080603; --surface-2: #040302; --soft: #1F1405;
  --line: #2B1C08; --border: #5A3C10;
  --ink: #D9962E; --ink-2: #C98A2A; --ink-3: #D9962E;
  --head-bg: #080603; --head-ink: #E8A53A; --head-ink-2: #C98A2A;
  --accent: #D9962E; --primary-bg: #2E1E07; --primary-ink: #E8A53A;
  --amber: #2E1E07; --amber-ink: #E8A53A; --tab-bar: #E8A53A;
  --newdot: #E8A53A; --newdot-ink: #000000; --newdot-ring: #000000;
  --danger: #E8A53A; --danger-border: #6B4512; --warn-bg: #2B1C08; --warn-ink: #E8A53A;
  --img-bg: #040302; --img-ink: #C98A2A;
  --img-filter: grayscale(1) sepia(1) saturate(2.2) hue-rotate(-8deg) brightness(0.45); --map-filter: grayscale(1) sepia(1) saturate(2.2) hue-rotate(-8deg) brightness(0.55);
  --tile-map: #1F1405; --tile-map-ink: #D9962E; --tile-edit-bg: #1F1405;
  --nav-active: #E8A53A;
  --sync-bg: #1F1405; --sync-ink: #D9962E; --sync-off-bg: #2B1C08; --sync-off-ink: #E8A53A;
  --dot-ok: #D9962E; --dot-off: #E8A53A; --dot-idle: #6B4512;
  --toast-bg: #1F1405; --toast-ink: #E8A53A;
  --shadow: none; --shadow-lg: none;
  --backdrop: rgba(0,0,0,0.7); --focus: #E8A53A;
  color-scheme: dark;
}
/* Ansitz-Nachtmodus streng: Rot auf Schwarz (beste Nachtsicht) */
:root[data-night="red"] {
  --bg: #000000; --surface: #0A0000; --surface-2: #050000; --soft: #1A0503;
  --line: #2A0A06; --border: #5A1A12;
  --ink: #E04436; --ink-2: #D9402F; --ink-3: #E04436;
  --head-bg: #0A0000; --head-ink: #E04436; --head-ink-2: #D9402F;
  --accent: #E04436; --primary-bg: #3A0D08; --primary-ink: #E04436;
  --amber: #3A0D08; --amber-ink: #E04436; --tab-bar: #E04436;
  --newdot: #E04436; --newdot-ink: #000000; --newdot-ring: #000000;
  --danger: #E04436; --danger-border: #7A1E14; --warn-bg: #2A0A06; --warn-ink: #E04436;
  --img-bg: #050000; --img-ink: #D9402F;
  --img-filter: grayscale(1) sepia(1) saturate(5) hue-rotate(-35deg) brightness(0.45); --map-filter: grayscale(1) sepia(1) saturate(5) hue-rotate(-35deg) brightness(0.5);
  --tile-map: #1A0503; --tile-map-ink: #E04436; --tile-edit-bg: #1A0503;
  --nav-active: #E04436;
  --sync-bg: #1A0503; --sync-ink: #E04436; --sync-off-bg: #2A0A06; --sync-off-ink: #E04436;
  --dot-ok: #E04436; --dot-off: #E04436; --dot-idle: #7A1E14;
  --toast-bg: #1A0503; --toast-ink: #E04436;
  --shadow: none; --shadow-lg: none;
  --backdrop: rgba(0,0,0,0.7); --focus: #E04436;
  color-scheme: dark;
}

/* Ansitz-Nachtmodus schlicht: gedimmtes Grau auf Schwarz */
:root[data-night="grey"] {
  --bg: #000000; --surface: #070707; --surface-2: #040404; --soft: #161616;
  --line: #222222; --border: #3A3A3A;
  --ink: #9A9A94; --ink-2: #8C8C86; --ink-3: #9A9A94;
  --head-bg: #070707; --head-ink: #B4B4AE; --head-ink-2: #8C8C86;
  --accent: #9A9A94; --primary-bg: #1E1E1E; --primary-ink: #B4B4AE;
  --amber: #1E1E1E; --amber-ink: #B4B4AE; --tab-bar: #B4B4AE;
  --newdot: #B4B4AE; --newdot-ink: #000000; --newdot-ring: #000000;
  --danger: #B4B4AE; --danger-border: #4A4A4A; --warn-bg: #222222; --warn-ink: #B4B4AE;
  --img-bg: #040404; --img-ink: #8C8C86;
  --img-filter: grayscale(1) brightness(0.45); --map-filter: grayscale(1) brightness(0.5);
  --tile-map: #161616; --tile-map-ink: #9A9A94; --tile-edit-bg: #161616;
  --nav-active: #B4B4AE;
  --sync-bg: #161616; --sync-ink: #9A9A94; --sync-off-bg: #222222; --sync-off-ink: #B4B4AE;
  --dot-ok: #9A9A94; --dot-off: #B4B4AE; --dot-idle: #4A4A4A;
  --toast-bg: #161616; --toast-ink: #B4B4AE;
  --focus: #B4B4AE;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { filter: var(--img-filter); }

#app { min-height: 100%; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.view[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; background: var(--head-bg); color: var(--head-ink);
  padding: calc(14px + env(safe-area-inset-top)) 16px 4px; display: flex; align-items: center; gap: 8px; }
.top-title { font-size: 26px; font-weight: 700; letter-spacing: 0.2px; margin-right: auto; }
.nightbtn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid transparent; background: transparent; color: var(--head-ink);
  display: flex; align-items: center; justify-content: center; }
.nightbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nightbtn[aria-pressed="true"] { border-color: var(--head-ink); background: var(--soft); }
.sync { border: 0; border-radius: 16px; min-height: 32px; padding: 4px 12px; display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; background: var(--sync-bg); color: var(--sync-ink); }
.sync .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--dot-idle); }
.sync.ok .dot { background: var(--dot-ok); } .sync.off { background: var(--sync-off-bg); color: var(--sync-off-ink); } .sync.off .dot { background: var(--dot-off); }

.subtabs { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 4; background: var(--head-bg);
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 8px; }
.subtabs button { min-height: 46px; border: 0; background: transparent; color: var(--head-ink-2); font-weight: 700; font-size: 15px;
  border-bottom: 3px solid transparent; }
.subtabs button.on { color: var(--head-ink); border-bottom-color: var(--tab-bar); }

main { padding: 4px 16px 16px; outline: none; }
.day { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 16px 0 8px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } main { max-width: 1100px; margin: 0 auto; } }
main > .grid:first-child { margin-top: 14px; }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.spacer { height: 90px; }

.card { background: var(--surface); border: 0; border-radius: 12px; box-shadow: var(--shadow); padding: 0; text-align: left; position: relative; color: var(--ink); overflow: hidden; }
:root[data-night] .card { border: 1px solid var(--line); }
.pic { display: flex; flex-direction: column; width: 100%; }
.pic-img { display: block; aspect-ratio: 4 / 3; background: var(--img-bg); }
.pic-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-img.missing::after { content: 'Bild wird geladen'; display: flex; height: 100%; align-items: center; justify-content: center; color: var(--img-ink); font-size: 12px; }
.cap { display: flex; flex-direction: column; padding: 8px 10px; gap: 1px; }
.cap b { font-size: 14px; } .cap small { font-size: 12px; color: var(--ink-2); }
.cap small.coord { font-size: 11px; }
.newdot { position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; border-radius: 7px; background: var(--newdot); border: 2px solid var(--newdot-ring); }
.newcount { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--newdot); color: var(--newdot-ink);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--newdot-ring); }

.tile { display: flex; flex-direction: column; }
.tile-main { border: 0; background: transparent; padding: 0; text-align: left; display: flex; flex-direction: column; width: 100%; color: inherit; }
.tile-map { height: 84px; background: var(--tile-map); display: flex; align-items: center; justify-content: center; }
.tile-map svg { width: 28px; height: 28px; fill: none; stroke: var(--tile-map-ink); stroke-width: 2; }
.tile-edit { position: absolute; left: 8px; top: 8px; width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--tile-edit-bg); display: flex; align-items: center; justify-content: center; }
.tile-edit svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.tile-add { border: 2px dashed var(--border); background: transparent; box-shadow: none; min-height: 150px; color: var(--accent); font-weight: 700; font-size: 15px; text-align: center; }
.tile-add.wide { min-height: 52px; }

.cam { padding: 12px 14px; }
.cam-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cam-head h3 { margin: 0; font-size: 17px; } .cam-head span { font-size: 13px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 8px 0 0; font-size: 13px; }
.facts dt { color: var(--ink-2); } .facts dd { margin: 0; font-weight: 600; word-break: break-word; }
.warn { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.btn { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--accent); font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 12px; }
.btn.primary { background: var(--primary-bg); color: var(--primary-ink); border-color: var(--primary-bg); }
.btn.danger { color: var(--danger); border-color: var(--danger-border); }
.btn:disabled { opacity: 0.6; }
.chip { min-height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: 18px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--accent); }
.filterbar { margin-top: 12px; }
.empty { text-align: center; padding: 48px 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 10px; align-items: center; }

.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); width: 64px; height: 64px; border-radius: 32px; border: 0;
  background: var(--amber); color: var(--amber-ink); box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center; z-index: 6; }
:root[data-night] .fab { border: 2px solid var(--amber-ink); }

nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface-2); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
nav.bottom button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); border-top: 3px solid transparent; position: relative; }
nav.bottom button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
nav.bottom button.on { color: var(--nav-active); border-top-color: var(--nav-active); }
.badge { position: absolute; top: 6px; left: 50%; margin-left: 8px; background: var(--newdot); color: var(--newdot-ink); font-size: 10px; font-weight: 700; border-radius: 8px; padding: 0 5px; line-height: 16px; }

.sheet-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 8; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; max-height: 88vh; overflow: auto; background: var(--surface-2); color: var(--ink); border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,0.3); max-width: 720px; margin: 0 auto; }
:root[data-night] .sheet { border-top: 1px solid var(--border); box-shadow: none; }
.sheet-close { position: absolute; z-index: 2; top: 8px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.sheet-close svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.sheet .sheet-title { padding-right: 48px; }
.grip { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto 12px; }
.sheet-title { font-size: 22px; margin: 4px 0 6px; }
.sub { font-size: 15px; margin: 18px 0 4px; }
.meta { margin: 0; color: var(--ink-3); font-size: 14px; }
.hint { margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.viewer img { width: 100%; border-radius: 12px; display: block; background: var(--img-bg); }
.missing.big { height: 200px; border-radius: 12px; background: var(--img-bg); color: var(--img-ink); display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; font-size: 13px; }
.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; margin-top: 8px; }
.form .field { margin-top: 0; }
.field input, .field select, .field textarea { min-height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 16px; font-weight: 400; background: var(--surface); color: var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-2); opacity: 0.8; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Darstellung wählen (Profil) */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.seg button { min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-ink); border-color: var(--primary-bg); }
.seg.two-seg { grid-template-columns: repeat(3, 1fr); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-top: 8px; font-weight: 600; font-size: 15px; }
.switch input { width: 24px; height: 24px; accent-color: var(--primary-bg); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); z-index: 10;
  background: var(--toast-bg); color: var(--toast-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); text-align: center; }
:root[data-night] .toast { border: 1px solid var(--border); }
[hidden] { display: none !important; }
:root[data-night] .switch input { accent-color: var(--ink); }

/* ===================== KARTE ===================== */
#view-karte { position: fixed; left: 0; right: 0; top: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); overflow: hidden; background: var(--img-bg); }
#map { position: absolute; inset: 0; }
#map .maplibregl-canvas { filter: var(--map-filter); }
.maplibregl-ctrl-attrib { font-size: 10px; }
:root[data-night] .maplibregl-ctrl-attrib, :root[data-theme="dark"] .maplibregl-ctrl-attrib { background: rgba(0,0,0,0.5); color: var(--ink-2); }
:root[data-night] .maplibregl-ctrl-attrib a, :root[data-theme="dark"] .maplibregl-ctrl-attrib a { color: var(--ink-2); }
.map-msg { position: absolute; left: 16px; right: 16px; top: 45%; z-index: 3; background: var(--surface); color: var(--ink); padding: 14px; border-radius: 12px; text-align: center; box-shadow: var(--shadow-lg); }
.map-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: color-mix(in srgb, var(--head-bg) 72%, transparent); color: var(--head-ink); }
.revier-btn { border: 0; background: transparent; color: var(--head-ink); text-align: left; display: flex; flex-direction: column; margin-right: auto; min-height: 44px; padding: 0 4px; }
.revier-btn small { font-size: 12px; color: var(--head-ink-2); font-weight: 600; }
.revier-btn span { font-size: 24px; font-weight: 700; line-height: 1.1; }
.tool { width: 52px; height: 52px; border-radius: 14px; border: 0; background: var(--surface); color: var(--accent); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
:root[data-night] .tool { border: 1px solid var(--border); }
.tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s; }
.tool.big { width: 64px; height: 64px; }
.tool.big span { font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tool[aria-pressed="true"] { background: var(--primary-bg); color: var(--primary-ink); }
#needle .n { fill: #D2412B; stroke: none; } #needle .s { fill: #8A948C; stroke: none; }
:root[data-night] #needle .n { fill: var(--ink); } :root[data-night] #needle .s { fill: var(--border); }
.map-left { position: absolute; left: 12px; top: calc(84px + env(safe-area-inset-top)); z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.map-right { position: absolute; right: 12px; top: calc(84px + env(safe-area-inset-top)); z-index: 2; display: flex; flex-direction: column; gap: 10px; }
.map-right.low { top: auto; bottom: 100px; }
#mapFab { position: absolute; bottom: 20px; }
.rose { position: absolute; left: 50%; bottom: 0; width: 220px; height: 74px; margin-left: -110px; overflow: hidden; z-index: 2; pointer-events: none; }
.rose-ring { position: absolute; left: 0; top: 20px; width: 220px; height: 220px; border-radius: 110px; background: rgba(10,14,12,0.55); transition: transform .3s; }
:root[data-night] .rose-ring { background: rgba(0,0,0,0.75); border: 1px solid var(--border); }
.rose-ring .t { position: absolute; left: 109px; top: 0; width: 2px; background: #fff; transform-origin: 1px 110px; }
.rose-ring .l { position: absolute; left: 100px; top: 15px; width: 20px; text-align: center; color: #fff; font-weight: 700; font-size: 14px; transform-origin: 10px 95px; }
.rose-ring .l.north { color: #FF8A73; }
:root[data-night] .rose-ring .t, :root[data-night] .rose-ring .l { background: none; color: var(--ink); }
:root[data-night] .rose-ring .t { background: var(--ink); }
.rose-label { position: absolute; left: 0; right: 0; top: 0; text-align: center; color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
:root[data-night] .rose-label { color: var(--ink); text-shadow: none; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; z-index: 2; pointer-events: none; }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: var(--amber); box-shadow: 0 0 0 1px rgba(0,0,0,0.5); }
.crosshair::before { left: 21px; top: 0; width: 2px; height: 44px; } .crosshair::after { top: 21px; left: 0; height: 2px; width: 44px; }
:root[data-night] .crosshair::before, :root[data-night] .crosshair::after { background: var(--ink); }
.drawbar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-lg); }
:root[data-night] .drawbar { border: 1px solid var(--border); }
.drawinfo { font-size: 14px; font-weight: 600; }
.drawbar .row { margin-top: 8px; } .drawbar .btn { flex: 1; }
.placebar { bottom: 12px; }

/* Marker */
.mk { width: 40px; height: 48px; padding: 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.mk .pin { width: 38px; height: 38px; border-radius: 19px; background: var(--mk, #34518C); border: 3px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.45); }
.mk .pin svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mk .tip { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid #fff; margin-top: -1px; }
.mk.sel .pin { border-color: var(--amber); } .mk.sel .tip { border-top-color: var(--amber); }
.mk .lbl { position: absolute; top: 50px; white-space: nowrap; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.mk-sitz { --mk: #34518C; } .mk-futter { --mk: #8C6A43; } .mk-flaeche { --mk: #5E7A3A; } .mk-cam { --mk: #4A6378; } .mk-sonst { --mk: #6B6B6B; }
:root[data-night] .mk .pin { background: #000; border-color: var(--ink); box-shadow: none; }
:root[data-night] .mk .pin svg { stroke: var(--ink); } :root[data-night] .mk .tip { border-top-color: var(--ink); }
:root[data-night] .mk .lbl { color: var(--ink); text-shadow: 0 0 3px #000; }

/* Licht-Zeitleiste */
.timeline { position: relative; height: 22px; border-radius: 6px; overflow: hidden; display: flex; margin-top: 6px; }
.timeline > span { height: 100%; }
.tl-night { background: #23303F; } .tl-dusk { background: #5B6B82; } .tl-buechs { background: #E0A33A; } .tl-day { background: #F3E3A6; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #D2412B; }
:root[data-night] .tl-night { background: #000; } :root[data-night] .tl-dusk { background: var(--line); } :root[data-night] .tl-buechs { background: var(--border); } :root[data-night] .tl-day { background: var(--soft); } :root[data-night] .tl-now { background: var(--ink); }
:root[data-night] .timeline { border: 1px solid var(--border); }
.tl-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 10px; font-size: 14px; }
.tiles3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.stat { background: var(--soft); border-radius: 12px; padding: 10px; }
.stat small { display: block; font-size: 12px; color: var(--ink-2); } .stat b { font-size: 17px; }
table.week { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.week th, table.week td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.week th { color: var(--ink-2); font-weight: 600; }
.stars { letter-spacing: 1px; color: var(--amber); } :root[data-night] .stars { color: var(--ink); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.choice { min-height: 72px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--accent); font-weight: 700; font-size: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; }
.choice svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.progress { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; background: var(--primary-bg); width: 0; transition: width .2s; }

#map .maplibregl-ctrl-bottom-left { bottom: 78px; }
:root[data-night] .maplibregl-ctrl-scale, :root[data-theme="dark"] .maplibregl-ctrl-scale { background: rgba(0,0,0,0.55); color: var(--ink-2); border-color: var(--ink-2); }
.editing .mk { opacity: 0.45; pointer-events: none; }
.drawbar .btn:disabled { opacity: 0.45; }
.mk-anschuss { --mk: #C2410C; } .mk-pers { --mk: #2F6FE0; }
.viewer img { max-height: 260px; object-fit: cover; }

/* Jagdzeiten */
.jz-head { display: grid; grid-template-columns: 1fr 132px; gap: 10px; margin: 12px 0 4px; }
.jz-months { display: grid; grid-template-columns: repeat(12, 1fr); font-size: 10px; color: var(--ink-2); text-align: center; }
.jz-months i { font-style: normal; }
.jz-list { display: flex; flex-direction: column; }
.jz-row { display: grid; grid-template-columns: 1fr 132px; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.jz-art { font-weight: 700; font-size: 15px; } .jz-zeit { font-size: 14px; color: var(--ink-3); }
.jz-hint { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.jz-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.jz-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }
.jz-chip.auf { background: #DCEFE2; color: #1E5A37; } .jz-chip.zu { background: #F4DCD7; color: #7A2318; }
:root[data-theme="dark"] .jz-chip.auf { background: #1F4030; color: #A8E0BE; } :root[data-theme="dark"] .jz-chip.zu { background: #4A2420; color: #F5B8AE; }
:root[data-night] .jz-chip.auf { background: var(--soft); color: var(--ink); border: 1px solid var(--ink); } :root[data-night] .jz-chip.zu { background: transparent; color: var(--ink-2); border: 1px dashed var(--border); }
.jz-info { font-size: 11px; color: var(--ink-2); }
.jz-bar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; width: 132px; height: 8px; }
.jz-bar i { background: var(--line); border-radius: 1px; } .jz-bar i.voll { background: var(--primary-bg); } .jz-bar i.teil { background: color-mix(in srgb, var(--primary-bg) 50%, var(--line)); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .jz-chip.auf { background: #1F4030; color: #A8E0BE; } :root[data-theme="auto"] .jz-chip.zu { background: #4A2420; color: #F5B8AE; } }
:root[data-night] .jz-bar i.voll { background: var(--ink); } :root[data-night] .jz-bar i.teil { background: var(--border); }

/* Zugang / Einladung */
.gate { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: calc(40px + env(safe-area-inset-top)) 18px 40px; }
.gate-box { width: 100%; max-width: 420px; }
.gate-logo { font-size: 28px; font-weight: 800; color: var(--accent); margin-bottom: 18px; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: min(280px, 80vw); margin: 10px auto 4px; }
.qr svg { width: 100%; height: auto; display: block; }
nav.bottom button[hidden] { display: none !important; }

/* ---------- Videos, Behalten, Teilen, Kamera-Adresse (v0.6) ---------- */
.pic-img.vid { display: flex; align-items: center; justify-content: center; }
.pic-img.vid::after { content: '▶  Zum Ansehen tippen'; color: var(--img-ink); font-size: 12px; font-weight: 600; }
.pic-img.vid img { display: none; }
.vbadge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 4px; border-radius: 10px;
  background: rgba(0,0,0,.62); color: #fff; font-size: 11px; font-weight: 700; }
.vbadge svg { width: 14px; height: 14px; fill: #fff; }
.keepmark { position: absolute; right: 8px; bottom: 52px; width: 24px; height: 24px; border-radius: 12px; background: rgba(0,0,0,.6); color: #F2C230;
  display: flex; align-items: center; justify-content: center; font-size: 14px; }
:root[data-night] .keepmark, :root[data-night] .vbadge { background: #000; color: var(--ink); }
:root[data-night] .vbadge svg { fill: var(--ink); }
.keep-title { color: var(--newdot); }
.viewer video { width: 100%; max-height: 60vh; border-radius: 12px; display: block; background: #000; }
:root[data-night] .viewer video { filter: var(--img-filter); }
.share-ask { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); }
.share-ask p { margin: 0; font-size: 14px; }
.btn.danger.small, .btn.small.danger { font-size: 14px; }
.addr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; word-break: break-all; margin-top: 4px; }
.addr span { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.facts .wide { grid-column: 1 / -1; }
.muted { color: var(--ink-2); font-weight: 400; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 14px; margin: 6px 0; }
.meter { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter.warn80 > span { background: var(--danger, #C0392B); }
