/* FliegRes – Layout und Farben wie rstcal */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1b1f24; --muted: #5f6b7a; --line: #e3e6ea;
  --primary: #1f6feb; --primary-ink: #ffffff; --danger: #cf222e; --ok: #1a7f37; --warn: #9a6700;
  --radius: 10px; --shadow: 0 8px 30px rgba(15, 23, 42, .12);
  --input-bg: #ffffff; --hover: #f0f2f5; --subtle: #fafbfc; --chip: #eef0f3;
  --sat-bg: #fffbea; --sun-bg: #f1f8fd; --today-bg: #eef4ff; --sel-bg: rgba(31, 111, 235, .12);
  --wait-bg: #fff8e6; --wait-line: #d4a72c; --block-bg: #fde8e8;
  --side-w: 240px; --top-h: 56px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117; --panel: #161b22; --text: #e6edf3; --muted: #8d96a0; --line: #30363d;
  --primary: #4493f8; --danger: #f85149; --ok: #3fb950; --warn: #d29922;
  --input-bg: #0d1117; --hover: #21262d; --subtle: #1c2128; --chip: #21262d;
  --sat-bg: rgba(210, 153, 34, .07); --sun-bg: rgba(68, 147, 248, .06); --today-bg: rgba(68, 147, 248, .12); --sel-bg: rgba(68, 147, 248, .2);
  --wait-bg: rgba(210, 153, 34, .14); --wait-line: #d29922; --block-bg: rgba(248, 81, 73, .16);
  --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --panel: #161b22; --text: #e6edf3; --muted: #8d96a0; --line: #30363d;
    --primary: #4493f8; --danger: #f85149; --ok: #3fb950; --warn: #d29922;
    --input-bg: #0d1117; --hover: #21262d; --subtle: #1c2128; --chip: #21262d;
    --sat-bg: rgba(210, 153, 34, .07); --sun-bg: rgba(68, 147, 248, .06); --today-bg: rgba(68, 147, 248, .12); --sel-bg: rgba(68, 147, 248, .2);
    --wait-bg: rgba(210, 153, 34, .14); --wait-line: #d29922; --block-bg: rgba(248, 81, 73, .16);
    --shadow: 0 8px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 17px; }

.loading { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons & Formulare ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: #1a5fd0; }
.btn-danger { color: var(--danger); border-color: #f1c0c4; }
.btn-danger:hover { background: rgba(207,34,46,.08); }
.btn-warn { color: var(--warn); border-color: var(--wait-line); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); font-size: 18px; }
.icon-btn:hover { background: var(--chip); color: var(--text); }

input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 111, 235, .35); outline-offset: 0; border-color: var(--primary); }
input[type=color] { width: 42px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--primary); margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > span:first-child { font-weight: 600; font-size: 13px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dt { display: flex; gap: 6px; }
.dt input[type=time] { max-width: 120px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 14px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.spacer { flex: 1; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; white-space: nowrap; }
.badge.ok { background: rgba(26,127,55,.14); color: var(--ok); }
.badge.err { background: rgba(207,34,46,.12); color: var(--danger); }
.badge.warn { background: var(--wait-bg); color: var(--warn); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; vertical-align: -1px; }
.msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }
.msg.err { background: rgba(207,34,46,.1); color: var(--danger); }
.msg.ok { background: rgba(26,127,55,.12); color: var(--ok); }
.msg.warn { background: var(--wait-bg); color: var(--warn); border: 1px solid var(--wait-line); }
.msg ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Layout ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar { flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; width: calc(var(--side-w) - 24px); text-decoration: none; color: var(--text); }
.brand-name { font-weight: 700; font-size: 16px; }
.club-select { max-width: 320px; }
.club-select select { font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }

.layout { flex: 1; display: flex; min-height: 0; }
.sidebar { width: var(--side-w); flex: none; display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 8px 4px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--sel-bg); color: var(--primary); font-weight: 600; }
.nav a .ico { width: 20px; text-align: center; }
.side-footer { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); }
.side-prefs { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.main { flex: 1; min-width: 0; padding: 16px; overflow: auto; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; }
.empty { color: var(--muted); font-style: italic; padding: 16px 0; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--subtle); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive { opacity: .55; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--hover); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--subtle); }
.table.compact th, .table.compact td { padding: 6px 7px; font-size: 13px; }
td.actions { text-align: right; white-space: nowrap; }

/* Logo des Vereins, Profilbilder */
.brand img#brandLogo.club { width: auto; max-width: 140px; height: 36px; object-fit: contain; border-radius: 4px; }
.avatar { overflow: hidden; }
.avatar img, .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic { width: 32px; height: 32px; border-radius: 50%; background: var(--chip); color: var(--muted); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; overflow: hidden; vertical-align: middle; flex: none; }
.pic.big { width: 96px; height: 96px; font-size: 30px; }
.name-cell { display: flex; align-items: center; gap: 10px; }
.contacts { display: flex; gap: 8px; flex-wrap: wrap; }
.contacts a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 13px; }
.contacts a:hover { background: var(--hover); }

/* Notfall / Alarmplan */
.btn-sos { background: #d1242f; border-color: #d1242f; color: #fff; font-weight: 700; }
.btn-sos:hover { background: #a40e26; }
.sos-head { background: #d1242f; color: #fff; margin: -18px -18px 16px; padding: 14px 18px; }
.sos-head h3 { margin: 0; font-size: 20px; letter-spacing: .04em; }
.sos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 14px; }
.sos-call { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); background: var(--panel); }
.sos-call.em { border-color: #d1242f; background: rgba(209,36,47,.08); }
.sos-call b { display: block; font-size: 18px; color: #d1242f; font-variant-numeric: tabular-nums; }
.sos-call small { color: var(--muted); display: block; }
.sos-sec { border-left: 4px solid #d1242f; padding: 6px 12px; margin-bottom: 12px; background: var(--subtle); border-radius: 0 8px 8px 0; }
.sos-sec h4 { margin: 0 0 4px; }
.sos-sec p { margin: 0; white-space: pre-line; }
.ed-row { display: grid; grid-template-columns: 140px 1fr 1fr 1fr 32px; gap: 6px; margin-bottom: 6px; align-items: center; }
.ed-row.l3 { grid-template-columns: 1fr 1fr 1fr 32px; }
.ed-row.l2 { grid-template-columns: 1fr 2fr 32px; }
@media (max-width: 767px) { .ed-row, .ed-row.l3, .ed-row.l2 { grid-template-columns: 1fr; } }
@media print { .sos-call b { color: #000; } }

/* Nachrichten */
.nav .count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.chat { display: grid; grid-template-columns: 300px 1fr; gap: 0; height: calc(100vh - var(--top-h) - 110px); min-height: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chat-item:hover, .chat-item.active { background: var(--sel-bg); }
.chat-item .txt { flex: 1; min-width: 0; }
.chat-item .txt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .unread { background: var(--primary); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.bubble { max-width: 72%; padding: 8px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--primary); color: #fff; border-color: var(--primary); }
.bubble small { display: block; font-size: 10px; opacity: .7; margin-top: 2px; }
.bubble .who { font-size: 11px; font-weight: 700; opacity: .8; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 40px; height: 40px; resize: none; }
.msg-pop { position: fixed; right: 18px; bottom: 18px; z-index: 1000; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer; animation: pop .25s ease; }
@keyframes pop { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 767px) { .chat { grid-template-columns: 1fr; height: calc(100vh - var(--top-h) - 90px); } .chat.open .chat-list { display: none; } .chat:not(.open) .chat-thread { display: none; } }

/* Uhr in der Kopfzeile: Lokalzeit (Verein), UTC, Sonnenauf-/-untergang */
.clock { display: flex; align-items: center; gap: 14px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; margin-right: 8px; white-space: nowrap; }
.clock b { color: var(--text); font-size: 15px; }
.clock .lbl { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; margin-left: 3px; }
.clock .sun { display: flex; gap: 8px; padding-left: 12px; border-left: 1px solid var(--line); cursor: help; }
.plan thead .sun { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.plan thead .sun.closed { color: var(--danger); }
@media (max-width: 1100px) { .clock .sun { display: none; } }
@media (max-width: 767px) { .clock { gap: 8px; margin-right: 2px; } .clock .utc { display: none; } }

/* ---------- Belegungsplan ---------- */
.cal-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.cal-toolbar .title { font-size: 18px; font-weight: 700; margin: 0 8px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.plan-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.plan { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; width: 100%; }
.plan th, .plan td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.plan thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); padding: 6px 2px; font-weight: 500; color: var(--muted); text-align: center; white-space: nowrap; }
.plan thead th b { color: var(--text); font-size: 13px; }
.plan thead th.today b { color: #fff; background: var(--primary); border-radius: 6px; padding: 1px 6px; }
.plan .corner { left: 0; z-index: 3; width: 150px; text-align: left; padding-left: 10px; }
.plan .ac { position: sticky; left: 0; z-index: 1; background: var(--panel); padding: 8px 10px; width: 150px; }
.plan .ac b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.plan .ac small { display: block; color: var(--muted); }
.plan .ac .no { color: var(--danger); font-size: 11px; }
.plan .lane-label { position: sticky; left: 0; z-index: 1; background: var(--wait-bg); padding: 3px 10px; color: var(--warn); font-size: 11px; font-weight: 600; }
.plan td.cell { padding: 3px; height: 58px; }
.plan td.wcell { padding: 2px 3px; background: var(--wait-bg); height: 26px; }
.plan tr.ac-end td, .plan tr.ac-end th { border-bottom: 2px solid var(--line); }
.plan td.sat { background: var(--sat-bg); }
.plan td.sun { background: var(--sun-bg); }
.plan td.today { background: var(--today-bg); }
.plan td.can-add { cursor: copy; }
.plan td.can-add:hover { box-shadow: inset 0 0 0 2px var(--sel-bg); }
.ev { border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; color: #fff; background: var(--c, var(--primary)); }
.ev small { opacity: .9; }
.ev.mine { box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.ev.block { background: repeating-linear-gradient(135deg, var(--block-bg) 0 6px, transparent 6px 12px); color: var(--danger); border: 1px solid var(--danger); }
.ev.wait { background: transparent; color: var(--warn); border: 1px dashed var(--wait-line); }
.ev.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ev.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.legend { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.legend .ev { display: inline-block; cursor: default; margin: 0 4px 0 0; padding: 0 10px; }

/* ---------- Dialoge ---------- */
.dlg { border: 0; padding: 0; border-radius: 14px; width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow); background: var(--panel); color: var(--text); }
.dlg-wide { width: min(900px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(15, 23, 42, .45); }
.dlg-body { display: flex; flex-direction: column; max-height: calc(100vh - 40px); margin: 0; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-content { padding: 18px; overflow-y: auto; flex: 1; }
.dlg-foot { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--subtle); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
fieldset.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 2px; margin: 0 0 14px; }
fieldset.box legend { padding: 0 6px; font-weight: 600; color: var(--muted); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000; padding: 10px 16px; border-radius: 10px; background: #1b1f24; color: #fff; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast-err { background: var(--danger); }

.theme-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.theme-toggle button { border: 0; background: transparent; padding: 4px 9px; cursor: pointer; color: var(--muted); font-size: 13px; }
.theme-toggle button.active { background: var(--primary); color: #fff; }
.lang-flags { display: inline-flex; gap: 4px; }
.lang-flags button { border: 1px solid transparent; background: none; padding: 2px; border-radius: 4px; cursor: pointer; opacity: .55; line-height: 0; }
.lang-flags button.active { opacity: 1; border-color: var(--primary); }

/* Druck (Flugauswertung u. a.) */
.print-only { display: none; }
@media print {
  .topbar, .sidebar, .no-print, .toast, .backdrop { display: none !important; }
  .print-only { display: block; }
  html, body, .app, .layout, .main { height: auto; overflow: visible; background: #fff; color: #000; }
  .main { padding: 0; }
  .panel, .table-wrap { border: 0; padding: 0; box-shadow: none; background: #fff; }
  .rep-group { break-inside: avoid-page; margin-bottom: 12px; }
  .table th, .table td { padding: 3px 5px; font-size: 10px; color: #000; background: #fff; }
  .table tfoot td { background: #f3f3f3; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* Anmeldung */
.auth-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.auth-card .logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

.only-mobile { display: none !important; }
.backdrop { display: none; }
@media (max-width: 767px) {
  :root { --top-h: 52px; }
  .only-mobile { display: revert !important; }
  .hide-mobile { display: none !important; }
  .brand { width: auto; }
  .brand-name { display: none; }
  .topbar { gap: 6px; padding: 0 6px; }
  .club-select { flex: 1; max-width: none; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(280px, 84vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); padding-top: calc(16px + env(safe-area-inset-top)); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .4); }
  .main { padding: 10px; }
  .row2, .row3, .row4 { grid-template-columns: 1fr; gap: 0; }
  .row4.keep, .row2.keep { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dlg, .dlg-wide { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; margin: 0; border-radius: 0; }
  .dlg-body { height: 100%; max-height: 100%; }
  .plan .ac, .plan .corner { width: 96px; }
  .plan .ac small { display: none; }
}

/* Mängelbuch */
.df-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.df-desc { white-space: pre-wrap; background: var(--subtle); border-radius: 8px; padding: 10px 12px; }
.df-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.df-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.df-events { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.df-events li { border-left: 3px solid var(--line); padding-left: 10px; }
.df-note { white-space: pre-wrap; }
.df-inline summary { cursor: pointer; font-weight: 600; }
.df-inline[open] summary { margin-bottom: 8px; }
a.df-link { display: block; text-decoration: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--subtle); }

.cal-toolbar select { width: auto; min-width: 160px; }
.fee-offer { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }

/* Flugplanung */
.main:has(.fp-wrap) { padding: 0; overflow: hidden; }
.fp-wrap { display: grid; grid-template-columns: 1fr 430px; height: calc(100vh - var(--top-h)); }
.fp-map-col { position: relative; min-height: 0; }
.fp-map, .fp-map.maplibregl-map { position: absolute; inset: 0; }
.fp-side { overflow: auto; padding: 12px; border-left: 1px solid var(--line); background: var(--bg); }
.fp-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.fp-box h3 { margin: 0 0 8px; font-size: 14px; }
.fp-row { display: flex; gap: 6px; margin-bottom: 6px; }
.fp-row > select, .fp-row > input { flex: 1; min-width: 0; }
.fp-pts { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.fp-pts li, .fp-alt { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; background: var(--subtle); }
.fp-role { font-size: 11px; color: var(--muted); min-width: 64px; }
.fp-pt-btns { margin-left: auto; display: flex; gap: 2px; }
.fp-pt-btns button, .fp-alt button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 4px; padding: 0 6px; cursor: pointer; }
.fp-alt button { margin-left: auto; }
.fp-layers { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.94); color: #1b1f24; border-radius: 8px; padding: 6px 8px; font-size: 12px; display: grid; gap: 2px; box-shadow: var(--shadow); max-height: 60%; overflow: auto; }
.fp-layers label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.sw { display: inline-block; width: 12px; height: 4px; border-radius: 2px; background: var(--c); margin-right: 4px; vertical-align: middle; }
.fp-search { position: absolute; top: 10px; left: 56px; width: min(320px, 50%); }
.fp-search input { width: 100%; box-shadow: var(--shadow); }
.fp-sres { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; box-shadow: var(--shadow); max-height: 300px; overflow: auto; }
.fp-sres button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); padding: 6px 10px; cursor: pointer; }
.fp-sres button:hover { background: var(--hover); }
.fp-note { position: absolute; bottom: 4px; left: 110px; background: rgba(255,255,255,.85); color: #333; padding: 1px 6px; border-radius: 4px; }
.fp-pop { font-size: 13px; color: #1b1f24; }
.fp-pop-btns { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.fp-pop-as { border-top: 1px solid #e3e6ea; padding-top: 6px; display: grid; gap: 4px; font-size: 12px; max-height: 220px; overflow: auto; }
.fp-log td, .fp-log th { white-space: nowrap; }
.fp-altrow td { font-style: italic; color: var(--muted); }
.fp-rwy { margin-bottom: 6px; }
.fp-wx { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.fp-wx:first-of-type { border-top: 0; margin-top: 0; }
.fp-wx-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.fp-links { margin-left: auto; display: flex; gap: 8px; font-size: 12px; }
.fp-raw { white-space: pre-wrap; font-size: 12px; background: var(--subtle); border-radius: 6px; padding: 6px 8px; margin: 6px 0; }
.linklike { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; font: inherit; }
.ok-txt { color: var(--ok); }
.badge.ok, .badge.warn, .badge.err { font-weight: 600; }
@media (max-width: 900px) {
  .main:has(.fp-wrap) { overflow: auto; }
  .fp-wrap { grid-template-columns: 1fr; height: auto; }
  .fp-map-col { height: 60vh; }
  .fp-side { border-left: 0; }
  .fp-layers { max-height: 45%; }
}
@media print {
  .fp-wrap { display: block; height: auto; }
  .fp-map-col { display: none; }
  .fp-side { border: 0; padding: 0; overflow: visible; }
  .fp-box { break-inside: avoid; border: 1px solid #ccc; }
}
.fp-layers select { margin-bottom: 4px; font-size: 12px; padding: 2px 4px; min-height: 0; }
.fp-below td { color: var(--muted); }
.fp-side .table { width: 100%; }
.fp-side .table td, .fp-side .table th { white-space: normal; }
.fp-side .fp-log td, .fp-side .fp-log th { white-space: nowrap; padding-left: 4px; padding-right: 4px; }

/* Dokumente und Gruppen */
.doc-vis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; max-height: 320px; overflow: auto; }
.doc-vis-group { display: grid; gap: 2px; align-content: start; }
.progress { height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.plain-list { margin: 0; padding-left: 18px; columns: 2; }

/* Diagramme (Statistik) – geprüfte Kategorienpalette, hell und dunkel */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #8b8a85; }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #77766f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #77766f; } }
.s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); } .s4 { background: var(--s4); }
.s5 { background: var(--s5); } .s6 { background: var(--s6); } .s7 { background: var(--s7); } .s8 { background: var(--s8); }
.viz-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.viz-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; }
.viz-tile span { color: var(--muted); font-size: 12px; } .viz-tile b { font-size: 24px; font-variant-numeric: tabular-nums; }
.viz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.viz-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.viz-col { display: grid; grid-template-columns: auto 1fr; gap: 6px; height: 240px; margin: 8px 0 26px; }
.viz-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; transform: translateY(-6px); padding-bottom: 0; }
.viz-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); }
.viz-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); opacity: .7; pointer-events: none; }
.viz-slot { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.viz-slot:hover { background: var(--hover); }
.viz-stack { width: min(60%, 34px); display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.viz-stack > .viz-seg:first-child { border-radius: 4px 4px 0 0; }
.viz-seg { min-height: 1px; }
.viz-x { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.viz-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.viz-h { display: grid; gap: 6px; }
.viz-hrow { display: grid; grid-template-columns: minmax(90px, 30%) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.viz-hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-hbars { display: grid; gap: 2px; }
.viz-hb-line { display: flex; align-items: center; gap: 6px; height: 12px; }
.viz-hb-line:hover { background: var(--hover); }
.viz-hb { height: 10px; border-radius: 0 4px 4px 0; min-width: 1px; }
.viz-hv { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.viz-tip { position: fixed; z-index: 100; background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px; padding: 6px 10px; font-size: 12px; pointer-events: none; max-width: 260px; }

/* Support-Zugang des Betreibers */
.support-banner { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 16px;
  background: #b42318; color: #fff; font-size: 14px; }
.support-banner .btn { margin-left: auto; background: #fff; color: #b42318; border-color: #fff; }
