/* NOTAM-Lage · LSC Erftland e.V.
   Stil wie die Vereins-Apps (Flottenmanagement, Wartung): Navy-Kopf, helle Fläche, weiße Karten. */
:root {
  --navy: #112b63;
  --navy-700: #0c2150;
  --bg: #f8f9fa;
  --card: #ffffff;
  --ink: #212529;
  --muted: #6c757d;
  --rule: #dee2e6;
  --green: #408558;
  --yellow: #ffc107;
  --red: #dc3545;
  --logo-green: #67dd42;

  --c-aktiv: #dc3545;
  --c-uas: #e8590c;
  --c-hindernis: #112b63;
  --c-flugplatz: #0b7285;
  --c-befeuerung: #6c757d;
  --c-hinweis: #1c7ed6;
  --c-sonstige: #7048e8;

  --radius: 12px;
  --shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
}
svg.i { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }
button { font: inherit; }
:focus-visible { outline: 3px solid rgba(17, 43, 99, .45); outline-offset: 2px; }

/* ─── Kopfzeile ─────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(24px, env(safe-area-inset-right)) 12px max(24px, env(safe-area-inset-left));
  padding-top: max(12px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { height: 44px; width: auto; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand h1 span { font-weight: 400; }
.clock { display: flex; gap: 22px; align-items: center; text-align: right; font-variant-numeric: tabular-nums; }
.clock .t { font-size: 22px; font-weight: 600; line-height: 1.1; }
.clock .l { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }

/* ─── Inhalt ────────────────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px max(24px, env(safe-area-inset-right)) 20px max(24px, env(safe-area-inset-left));
  min-height: 0;
}

.banner {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 8px; padding: 10px 14px; font-size: 15px;
  background: #fff3cd; color: #664d03; border: 1px solid #ffe69c;
}
.banner.error { background: #f8d7da; color: #58151c; border-color: #f1aeb5; }
.banner svg.i { font-size: 18px; margin-top: 1px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat {
  all: unset; box-sizing: border-box; cursor: pointer;
  background: var(--card); border-radius: 8px; box-shadow: var(--shadow);
  padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border-left: 4px solid var(--c, var(--rule));
}
.stat:hover { box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .1); }
.stat:focus-visible { outline: 3px solid rgba(17, 43, 99, .45); }
.stat .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #495057; }
.stat .num { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat svg.i { font-size: 30px; color: var(--c, var(--muted)); }

.grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; min-height: 0; flex: 1; }

.card { background: var(--card); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--rule); font-size: 19px; font-weight: 500; }
.card-h .note { margin-left: auto; font-size: 14px; color: var(--muted); font-weight: 400; }

#map { flex: 1; min-height: 420px; border-radius: 0 0 8px 8px; background: #e9ecef; }
.leaflet-container { font-family: var(--font); }
.base-tiles { filter: saturate(.55) brightness(1.04); }
.ring-label { background: transparent; border: 0; box-shadow: none; color: var(--navy); font-weight: 600; font-size: 12px; padding: 0; }
.ring-label::before { display: none; }
.site-label { background: var(--navy); color: #fff; border: 0; font-weight: 600; font-size: 13px; padding: 2px 8px; border-radius: 4px; }
.site-label::before { border-right-color: var(--navy) !important; }
.mk-obst svg { display: block; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 18px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--rule); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

.scroll { overflow-y: auto; min-height: 0; flex: 1; }

.sec { border-bottom: 1px solid var(--rule); }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px 6px; position: sticky; top: 0; background: var(--card); z-index: 1; }
.sec-h h2 { margin: 0; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sec-h h2 svg.i { color: var(--c); font-size: 18px; }
.sec-h .cnt { color: var(--muted); font-weight: 400; }
.sec-h .note { color: var(--muted); font-size: 14px; }

.row {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 10px 18px; min-height: 56px;
}
.row:hover { background: #f1f3f5; }
.row:focus-visible { outline: 3px solid rgba(17, 43, 99, .45); outline-offset: -3px; }
.row.sel { background: #e7ecf6; }
.ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); font-size: 18px; }
.ico.hollow { background: transparent; color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.ttl { font-weight: 600; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.meta b { color: var(--ink); font-weight: 500; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.when { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.badge.jetzt { background: var(--red); color: #fff; }
.badge.heute { background: var(--yellow); color: #212529; }
.badge.morgen { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.badge.endet { background: #e9ecef; color: #495057; }
.badge.plan { background: #e7ecf6; color: var(--navy); }

details.hid { border-top: 1px solid var(--rule); }
details.hid > summary { cursor: pointer; padding: 12px 18px; display: flex; gap: 8px; align-items: center; list-style: none; font-weight: 500; min-height: 48px; }
details.hid > summary::-webkit-details-marker { display: none; }
details.hid > summary .chev { margin-left: auto; transition: transform .15s; color: var(--muted); }
details.hid[open] > summary .chev { transform: rotate(180deg); }
details.hid > summary .cnt { color: var(--muted); font-weight: 400; }
details.hid .row { padding-left: 30px; min-height: 44px; }
details.hid .ttl { font-weight: 500; font-size: 15px; }

footer.note { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; padding: 0 2px; }
footer.note b { color: var(--ink); }

/* ─── Modal ─────────────────────────────────────────────────── */
dialog {
  border: 0; padding: 0; border-radius: var(--radius); width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px); box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25); color: var(--ink);
}
dialog::backdrop { background: rgba(17, 43, 99, .45); }
.m-h { background: var(--navy); color: #fff; padding: 18px 22px; display: flex; gap: 14px; align-items: flex-start; }
.m-h .ico { width: 44px; height: 44px; font-size: 21px; box-shadow: 0 0 0 2px #fff; }
.m-h .ico.hollow { background: #fff; }
.m-h h3 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.m-h .sub { opacity: .85; font-size: 14px; margin-top: 3px; font-family: var(--mono); }
.m-x { all: unset; cursor: pointer; margin-left: auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; font-size: 22px; flex: none; }
.m-x:hover { background: rgba(255, 255, 255, .12); }
.m-x:focus-visible { outline: 3px solid #fff; }
.m-b { padding: 18px 22px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
pre.raw { margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; font-family: var(--mono); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.m-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; padding: 10px 16px; font-weight: 500; min-height: 44px; border: 1px solid var(--navy); background: #fff; color: var(--navy); }
.btn:hover { background: var(--navy); color: #fff; }

/* ─── Größen ────────────────────────────────────────────────── */
@media (min-width: 1200px) and (min-height: 760px) {
  /* Display im Clubheim: alles auf einer Seite, Listen scrollen in ihrer Karte */
  body { height: 100dvh; overflow: hidden; }
  main { overflow: hidden; }
}
@media (max-width: 1199px), (max-height: 759px) {
  .grid { grid-template-columns: 1fr; flex: none; }
  .card { min-height: auto; }
  #map { min-height: 380px; height: 52vh; }
  .scroll { overflow: visible; }
  .sec-h { position: static; }
}
@media (max-width: 640px) {
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-top: 16px; }
  .brand img { height: 36px; }
  .brand h1 { font-size: 18px; }
  .brand h1 span { display: none; }
  .clock .lokal { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 10px 12px; }
  .stat .num { font-size: 22px; }
  .stat svg.i { font-size: 24px; }
  .row { grid-template-columns: 32px minmax(0, 1fr); padding: 10px 14px; }
  .ico { width: 32px; height: 32px; font-size: 15px; }
  .row .right { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; text-align: left; }
  .sec-h, details.hid > summary, .card-h, .legend { padding-left: 14px; padding-right: 14px; }
  details.hid .row { padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
