/* Flugbuch – schlankes, mobilfreundliches Stylesheet (kein Framework, kein Build-Schritt) */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6b7a;
  --border: #d9e0e7;
  --primary: #1f5fa8;
  --primary-text: #ffffff;
  --primary-soft: #e3edf9;
  --danger: #b42318;
  --ok: #1a7f4b;
  --ok-soft: #e1f4ea;
  --warn: #9a5b00;
  --warn-soft: #fdf0d9;
  --info-soft: #e3edf9;
  --error-soft: #fbe5e3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

/* Dunkles Design: per Umschalter (data-theme="dark", Cookie „theme“) oder nach Systemeinstellung,
   sofern nicht ausdrücklich hell gewählt wurde. Die Werte stehen deshalb zweimal. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11161c;
  --surface: #1a2129;
  --text: #e6ebf0;
  --muted: #9aa8b6;
  --border: #2d3742;
  --primary: #5b9be6;
  --primary-text: #0b1520;
  --primary-soft: #1d2f45;
  --danger: #f0776b;
  --ok: #5cc98d;
  --ok-soft: #173326;
  --warn: #f0b54a;
  --warn-soft: #3a2c12;
  --info-soft: #1d2f45;
  --error-soft: #3d1c19;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11161c;
    --surface: #1a2129;
    --text: #e6ebf0;
    --muted: #9aa8b6;
    --border: #2d3742;
    --primary: #5b9be6;
    --primary-text: #0b1520;
    --primary-soft: #1d2f45;
    --danger: #f0776b;
    --ok: #5cc98d;
    --ok-soft: #173326;
    --warn: #f0b54a;
    --warn-soft: #3a2c12;
    --info-soft: #1d2f45;
    --error-soft: #3d1c19;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.pre { white-space: pre-line; }
small { font-size: .8em; }

/* Kopfzeile in den Farben der DLRG (Rot #e30613, Gelb #ffed00) */
:root { --dlrg-red: #e30613; --dlrg-red-dark: #b5040f; --dlrg-yellow: #ffed00; }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--dlrg-red); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.topbar-inner, .mainnav-inner { max-width: 1100px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; }
.topbar-inner { min-height: 60px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; }
.brand .logo { height: 40px; width: auto; display: block; }
.brand-divider { width: 2px; height: 34px; background: var(--dlrg-yellow); border-radius: 1px; opacity: .9; }
.drone-icon { width: 30px; height: 30px; color: var(--dlrg-yellow); flex: none; }
.brand-text { display: flex; flex-direction: column; gap: .3rem; font-weight: 800; font-size: 1.25rem; line-height: 1; letter-spacing: .01em; }
.brand-text small { font-size: .68rem; font-weight: 700; color: var(--dlrg-yellow); text-transform: uppercase; letter-spacing: .14em; line-height: 1; }
/* Benutzer-Kapsel: Avatar + Name/Rolle (Link zum Profil) | Abmelden */
.usermenu {
  display: flex; align-items: center; height: 42px; padding: 3px; border-radius: 999px;
  background: rgba(0, 0, 0, .16); border: 1px solid rgba(255, 255, 255, .22);
}
.usermenu form { margin: 0; display: flex; height: 100%; }
.user-chip {
  display: flex; align-items: center; gap: .55rem; height: 100%; padding: 0 .8rem 0 0; border-radius: 999px;
  color: #fff; text-decoration: none;
}
.user-chip:hover, .user-chip[aria-current="page"] { background: rgba(255, 255, 255, .14); }
.avatar {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%; background: var(--dlrg-yellow); color: var(--dlrg-red-dark);
}
.avatar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.who { display: flex; flex-direction: column; color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.15; white-space: nowrap; }
.who small { color: rgba(255, 255, 255, .72); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.btn-logout {
  display: inline-flex; align-items: center; gap: .4rem; height: 100%; margin-left: 3px; padding: 0 .8rem 0 .75rem;
  background: transparent; color: #fff; border: 0; border-left: 1px solid rgba(255, 255, 255, .25);
  border-radius: 0 999px 999px 0; font: inherit; font-size: .85rem; cursor: pointer;
}
.btn-logout:hover { background: rgba(255, 255, 255, .14); }
.btn-logout svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-chip:focus-visible, .btn-logout:focus-visible, .head-icon:focus-visible { outline: 2px solid var(--dlrg-yellow); outline-offset: 2px; }
/* Runder Symbolknopf (Hell/Dunkel), im Stil der Benutzer-Kapsel */
.head-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: rgba(0, 0, 0, .16); color: #fff; cursor: pointer; padding: 0;
}
.head-icon:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); }
.head-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.head-icon[aria-current="page"] { background: rgba(255, 255, 255, .14); }
.head-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--dlrg-yellow); color: var(--dlrg-red-dark); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.head-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
/* Navigation der App: ruhige Leiste in Kartenfarbe unter dem roten Kopf; aktiver Punkt in der Auswahlfarbe
   (wie Auswahlknöpfe, Phasen und Seitenzahlen) mit Unterstrich */
.mainnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.mainnav-inner { gap: .25rem; overflow-x: auto; scrollbar-width: none; align-items: stretch; }
.mainnav a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem .9rem .6rem; color: var(--muted); text-decoration: none; white-space: nowrap;
  font-weight: 600; font-size: .92rem; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.mainnav a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mainnav a:hover { color: var(--text); background: var(--bg); }
.mainnav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.mainnav a[aria-current="page"]:hover { background: transparent; }
.topbar a:focus-visible, .topbar button:focus-visible { outline: 2px solid var(--dlrg-yellow); outline-offset: 2px; }
.mainnav a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
/* „Menü“: zurück zur Kachel-Übersicht – als Pille abgesetzt von den Seiten der App */
.mainnav a.nav-home {
  align-self: center; margin: .35rem 0; padding: .35rem .8rem; border: 1px solid var(--primary); border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
}
.mainnav a.nav-home:hover { background: var(--primary); color: var(--primary-text); }
.nav-sep { flex: none; width: 1px; margin: .6rem .4rem; background: var(--border); }

.container { max-width: 1100px; margin: 0 auto; padding: 1rem; padding-bottom: 6rem; }
.narrow { max-width: 640px; margin: 0 auto; }
.narrow.wide { max-width: 860px; }
.page { width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.page-head h1 { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.empty { text-align: center; padding: 2rem 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-height: 44px; padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--primary); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: .25rem .7rem; font-size: .9rem; }
.btn-link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }

.fab {
  position: fixed; right: 1rem; bottom: 1rem; width: 58px; height: 58px; border-radius: 50%;
  background: var(--dlrg-red); color: #fff; font-size: 2rem; line-height: 58px; text-align: center;
  text-decoration: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); display: none;
}

/* Formulare */
.form .field, .filter-grid .field { margin-bottom: .85rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
label.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: normal; margin: .25rem 0 1rem; }
label.checkbox input { width: auto; min-height: 0; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
input:disabled, select:disabled { opacity: .7; }
.error { color: var(--danger); font-size: .9rem; margin: .25rem 0 0; }
.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.form-actions form { margin: 0; }
/* Schnellstart: zwei gleich große Start-Knöpfe (Hauptaktion, gut zu treffen) */
/* Sprungziel „ergänzen“ nicht unter der festen Kopfzeile verstecken */
.op-info { scroll-margin-top: 5.5rem; }
.start-actions .btn-primary { flex: 1 1 10rem; min-height: 48px; font-size: 1.05rem; }
.duration-preview { margin: -.4rem 0 .8rem; min-height: 1.5em; }
details.more { margin: .25rem 0 1rem; }
details.more summary { cursor: pointer; color: var(--primary); margin-bottom: .75rem; }
/* Flugformular: weitere Angaben immer offen, durch eine Linie von den Bemerkungen getrennt (18.11.2026) */
.more-fields { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.more-title { margin: 0 0 .6rem; font-weight: 600; }
.field-height input { max-width: 12rem; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.inline select { width: auto; min-width: 12rem; flex: 1; }

/* Filter */
.filters summary { cursor: pointer; font-weight: 600; }
.filters[open] summary { margin-bottom: .75rem; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: .5rem; }

/* HTMX: laufende Anfragen dezent kennzeichnen */
.htmx-request#flight-results, .htmx-request#stats-results { opacity: .6; transition: opacity .2s; }

/* Kennzahlen */
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; flex: 1; }
.results-head { display: flex; gap: 1rem; align-items: flex-start; }
.results-head .dropdown { margin-top: .2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; }
.stat-label { display: block; color: var(--muted); font-size: .85rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.card .table { background: transparent; }
.table th, .table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.table th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.responsive { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table.responsive tbody tr { position: relative; }
.table.responsive tbody tr:hover td { background: var(--bg); }
.row-link { color: var(--text); font-weight: 600; text-decoration: none; }
/* Ganze Zeile klickbar, ohne JavaScript */
.row-link::after { content: ""; position: absolute; inset: 0; }

/* Badges */
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--danger); color: var(--surface); font-size: .75rem; font-weight: 700; text-align: center; }
.badge-muted { background: var(--primary-soft); color: var(--primary); }

/* Meldungen */
.msg { padding: .65rem .9rem; border-radius: 8px; margin: 0 0 1rem; background: var(--info-soft); }
.msg-success { background: var(--ok-soft); }
.msg-warning { background: var(--warn-soft); }
.msg-error { background: var(--error-soft); }

/* Details */
.details { display: grid; grid-template-columns: 14.5rem 1fr; gap: .45rem 1rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.login-card { text-align: center; margin-top: 2rem; }
.login-card .btn { margin-top: .5rem; }
.dev-card { border-style: dashed; }

/* Handy */
@media (max-width: 720px) {
  .container { padding: .75rem; padding-bottom: 6rem; }
  .topbar-inner { min-height: 54px; padding: 0 .75rem; gap: .6rem; }
  .mainnav-inner { padding: 0 .4rem; }
  .mainnav a { padding: .6rem .65rem .5rem; font-size: .85rem; gap: .35rem; }
  .mainnav a svg { width: 16px; height: 16px; }
  .mainnav a.nav-home { padding: .3rem .65rem; }
  .nav-sep { margin: .55rem .2rem; }
}
/* schmale Handys: Unterpunkte ohne Symbol, damit „Menü“ und alle Seiten der App in eine Zeile passen */
@media (max-width: 480px) {
  .mainnav-inner { gap: .1rem; }
  .mainnav a:not(.nav-home) svg { display: none; }
  .who { display: none; }
  /* Kopfzeile bis 375 px: „Alle Apps“ entfällt (Logo und „Menü“ führen zur Startseite); Markenname darf schrumpfen */
  .app-switch { display: none; }
  .brand { min-width: 0; }
  .brand-text, .brand-text small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hide-mobile { display: none; }
  .fab { display: block; }
  .grid-2, .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :first-child { grid-column: 1 / -1; }
  .details { grid-template-columns: 1fr; gap: 0; }
  .details dd { margin-bottom: .6rem; }

  /* Tabelle wird zu Karten */
  .table.responsive, .table.responsive tbody { display: block; border: 0; background: transparent; }
  .table.responsive thead { display: none; }
  .table.responsive tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: .1rem .75rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .7rem .9rem; margin-bottom: .6rem;
  }
  .table.responsive td { border: 0; padding: 0; text-align: left; background: transparent !important; }
  .table.responsive td[data-label="Dauer"]::before { content: "Dauer "; color: var(--muted); }
}

/* Einsatzgrund, Teilflug-Hinweis, Gegebenheiten */
.reason { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--primary-soft); color: var(--primary); }
.reason-einsatz { background: var(--error-soft); color: var(--danger); }
.reason-ausbildung { background: var(--ok-soft); color: var(--ok); }
.part { display: inline-block; margin-left: .3rem; padding: 0 .4rem; border-radius: 6px; font-size: .75rem; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.conditions { display: inline-flex; align-items: flex-start; gap: .35rem; font-size: 1.1rem; white-space: nowrap; letter-spacing: .1rem; }
.cond-day { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; }
.cond-label { font-size: .7rem; letter-spacing: 0; color: var(--muted); }
.cond-sep { color: var(--muted); font-weight: 300; }
.entries td { vertical-align: top; }
/* PC: elf Spalten passen nur mit schmalerem Zellabstand in die Seitenbreite */
.entries th, .entries td { padding-left: .5rem; padding-right: .5rem; }
.entries td[data-label="Zeit"], .entries td[data-label="Datum"] { white-space: nowrap; }
/* PC/Tablet: „Teil x/y“ unter dem Datum statt daneben (schmalere Datumsspalte) */
@media (min-width: 721px) {
  .entries td[data-label="Datum"] .part { display: table; margin: .25rem 0 0; }
}
.actions-cell { text-align: right; width: 1%; }
/* Bearbeiten-Link liegt über dem Zeilen-Link (.row-link::after) und bleibt klickbar */
.edit-link { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; color: var(--primary); }
.edit-link:hover { background: var(--primary-soft); }
.edit-link svg { width: 18px; height: 18px; }
.edit-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Export-Menü */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { border-color: var(--primary); color: var(--primary); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 20; width: min(20rem, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .08);
  padding: 1rem; animation: pop-in .12s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.export-panel .field { margin-bottom: .7rem; }
.export-panel .grid-2 { gap: 0 .6rem; }
.export-title { margin: 0 0 .75rem; font-weight: 700; }
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .25rem; }
.export-actions small { font-weight: normal; opacity: .75; }
.small { font-size: .85rem; margin: -.2rem 0 .7rem; }

/* Vorschlagsliste (static/app.js) */
.combo { position: relative; display: block; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: .3rem;
  list-style: none; max-height: 18rem; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .08);
}
.combo-list li[role=option] { padding: .5rem .65rem; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; gap: .05rem; }
.combo-list li[role=option]:hover, .combo-list li.active { background: var(--primary-soft); }
.combo-label { font-weight: 600; }
.combo-label .person-icon { width: 1em; height: 1em; margin-right: .35rem; vertical-align: -.12em; }
.person-icon, .combo-account svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* gewähltes Konto: Personensymbol im Feld (Freitext ohne Symbol) */
.combo-account { display: none; position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); color: var(--primary); pointer-events: none; line-height: 0; }
.combo-account svg { width: 1.1rem; height: 1.1rem; }
.combo.is-account .combo-account { display: block; }
.combo.is-account > input:not([type=hidden]) { padding-left: 2.1rem; }
.combo-detail { font-size: .85rem; color: var(--muted); }
.combo-group { padding: .45rem .65rem .2rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.combo-group:not(:first-child) { border-top: 1px solid var(--border); margin-top: .25rem; }
.combo.loading input { background-image: linear-gradient(90deg, transparent, var(--primary-soft), transparent); background-size: 200% 100%; animation: combo-loading 1s linear infinite; }
@keyframes combo-loading { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.input-with-button { display: flex; gap: .5rem; align-items: stretch; }
.input-with-button .combo { flex: 1; min-width: 0; }
.btn-icon { padding: 0; width: 44px; flex: none; color: var(--primary); }
.btn-icon svg { width: 22px; height: 22px; }
.btn-icon:disabled { opacity: .6; cursor: progress; }
.btn:disabled:not(.btn-icon) { opacity: .45; cursor: not-allowed; }
.locate-status { margin: .3rem 0 0; font-size: .85rem; min-height: 0; }
.locate-status:empty { display: none; }
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }

/* Formular: Abschnitte, Auswahl-Chips, Teilflüge */
.form .card h2 { margin-bottom: .9rem; }
.hint { margin: -.4rem 0 .9rem; font-size: .9rem; }
:is(input, select, textarea, .combo) + .hint { margin-top: .4rem; } /* Hinweis direkt unter einem Feld */
.chips + .hint { margin: .5rem 0 0; } /* Hinweis unter Auswahlknöpfen (z. B. zulässige Flugarten) */
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.field > legend { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; margin: 0; font-weight: normal; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.chip > span {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .45rem .95rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); user-select: none;
}
.chip input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip .emoji { font-size: 1.15rem; line-height: 1; }
.chip input:disabled + span { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: normal; margin-top: .5rem; }
.check input { width: 1.15rem; height: 1.15rem; min-height: 0; }
input[data-observer]:disabled { background: var(--bg); cursor: not-allowed; }
/* Uhrzeit: kein eigener Tabstopp auf dem Uhrensymbol – Tab springt direkt zum nächsten Feld.
   Eingabe per Tastatur; am Handy öffnet ein Tippen ins Feld weiterhin die Zeitauswahl. */
input[type=time]::-webkit-calendar-picker-indicator { display: none; }

#segments { counter-reset: segment; }
.segment {
  counter-increment: segment; position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem .25rem; margin: 0 0 .9rem; min-width: 0; background: var(--bg);
}
.segment > legend { font-weight: 700; padding: 0 .35rem; }
.segment > legend::after { content: " " counter(segment); }
.seg-remove { position: absolute; top: .45rem; right: .9rem; color: var(--danger); font-size: .9rem; }
.segment:only-child .seg-remove { display: none; }
.segment-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1.4fr; gap: 0 .9rem; }
.segment-grid label.field { font-size: .9rem; }
.segment-grid label.field input, .segment-grid label.field select { margin-top: .25rem; font-weight: normal; }
.seg-duration { margin: -.3rem 0 .5rem; min-height: 1.4em; font-size: .9rem; }
.segments-table { padding: 0; overflow: hidden; }

@media (max-width: 720px) {
  .brand .logo { height: 32px; }
  .brand { gap: .5rem; }
  .brand-divider { height: 28px; }
  .drone-icon { width: 24px; height: 24px; }
  .brand-text { font-size: 1.05rem; }
  .results-head { flex-direction: column-reverse; gap: .5rem; }
  .results-head .dropdown, .results-head > .btn { align-self: flex-end; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .stat { padding: .5rem .7rem; }
  .stat-value { font-size: 1.25rem; }
  .segment-grid { grid-template-columns: 1fr 1fr; }
  /* Karte: links Datum, Dauer, Luftraumbeobachter, Ort, Grund – rechts Zeit, Pilot, Drohne, Flugart, Gegebenheiten */
  .table.responsive td:nth-child(even) { text-align: right; }
  .table.responsive td[data-label="Pilot"] { font-weight: 600; }
  .table.responsive td[data-label="Ort"], .table.responsive td[data-label="Flugart"] { color: var(--muted); }
  .table.responsive td[data-label="Luftraumbeobachter"]::before { content: "Luftraumbeobachter "; color: var(--muted); }
  .table.responsive td[data-label="Grund"] { grid-column: auto; margin-top: .25rem; }
  .table.responsive td[data-label="Gegebenheiten"] { margin-top: .25rem; }
  .table.responsive td[data-label="Aktionen"] { grid-column: 1 / -1; text-align: right; width: auto; }
  .table.responsive td[data-label="Aktionen"]:empty { display: none; }
  .edit-link { width: auto; height: auto; gap: .35rem; padding: .35rem .6rem; border: 1px solid var(--border); font-weight: 600; text-decoration: none; }
  .edit-link span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* Fußzeile mit Impressum und Datenschutz (auf allen Seiten, auch beim Login) */
.sitefooter { border-top: 3px solid var(--dlrg-yellow); background: var(--surface); margin-top: 2rem; }
.sitefooter-inner { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 5.5rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.sitefooter nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.sitefooter a { color: var(--muted); }
.sitefooter a:hover { color: var(--primary); }
.container { padding-bottom: 1rem; }
.small-note { font-size: .85rem; }
.app-version { white-space: nowrap; }

/* Rechtstexte */
.legal h2 { font-size: 1.1rem; }
.legal h3 { font-size: .95rem; margin: 1rem 0 .3rem; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 1.2rem; margin: .4rem 0; }
.legal li + li { margin-top: .35rem; }

/* Drohnen: Status und Ausmusterung */
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.drones-table td { vertical-align: middle; }
.drones-table tbody tr { position: relative; }
.drones-table tbody tr:hover td { background: var(--bg); }
.drones-table tr.is-retired td { color: var(--muted); }
.active-badge, .retired-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.active-badge { background: var(--ok-soft); color: var(--ok); }
.retired-badge { background: var(--warn-soft); color: var(--warn); }
.retired-note { font-size: .8rem; color: var(--warn); white-space: nowrap; }
.drone-hint { grid-column: 1 / -1; }
.drone-hint .msg { margin: .2rem 0 .8rem; }
.retire-section { border-left: 4px solid var(--warn); }

/* Änderungsverlauf */
.history { list-style: none; padding: 0; overflow: hidden; }
.history li { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.history li:last-child { border-bottom: 0; }
.history-action { font-weight: 600; }
.history-create { color: var(--ok); }
.history-update { color: var(--primary); }
.history-delete { color: var(--danger); }
.history-details { display: grid; grid-template-columns: 12rem 1fr; gap: .2rem 1rem; margin: .5rem 0 0; font-size: .9rem; }
.history-details dt { color: var(--muted); }
.history-details dd { margin: 0; }
.history-details del { color: var(--danger); text-decoration: line-through; opacity: .85; }
.history-details ins { color: var(--ok); text-decoration: none; }
@media (max-width: 720px) {
  .history-details { grid-template-columns: 1fr; }
  .history-details dd { margin-bottom: .35rem; }
}

/* Mittlere Breiten: Tabelle der Einträge kompakter, damit die Bearbeiten-Spalte sichtbar bleibt */
@media (min-width: 721px) and (max-width: 1180px) {
  .entries th, .entries td { padding: .5rem .4rem; font-size: .88rem; }
  .entries .conditions { font-size: 1rem; letter-spacing: 0; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .entries th, .entries td { padding: .45rem .18rem; font-size: .82rem; }
  .entries .cat-note, .entries .reason { white-space: normal; }
  .entries td[data-label="Ort"] { hyphens: auto; overflow-wrap: anywhere; }
}

/* Fußzeile der Liste: Bereich, Seitenzahlen, Einträge pro Seite */
.list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 1rem 0; }
.list-range { margin: 0; font-size: .9rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; justify-content: center; margin: 0; }
.page-num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 .5rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600;
}
a.page-num:hover { border-color: var(--primary); color: var(--primary); }
.page-num.current { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.page-gap { padding: 0 .25rem; color: var(--muted); }
.per-page { display: flex; align-items: center; gap: .5rem; margin: 0; }
.per-page label { font-weight: normal; color: var(--muted); font-size: .9rem; white-space: nowrap; margin: 0; }
.per-page select { width: auto; min-height: 40px; }
@media (max-width: 720px) {
  .list-footer { justify-content: center; }
  .list-range { width: 100%; text-align: center; }
}

/* Betriebskategorie unter der Flugart (Übersicht) */
.cat-note { display: block; margin-top: .15rem; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.table.responsive td[data-label="Flugart"] .cat-note { display: block; }

/* Punkt am Avatar: Nachweis abgelaufen oder läuft bald ab */
.head-dot { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--dlrg-red-dark); box-sizing: content-box; }

/* Profil: Kompetenznachweise */
.hint-below { margin: .35rem 0 0; font-size: .85rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.cert-list { list-style: none; margin: 0; padding: 0; }
.cert-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .4rem 1rem; padding: .65rem 0; border-top: 1px solid var(--border); }
.cert-item:first-child { border-top: 0; }
.cert-main { flex: 1 1 14rem; min-width: 0; }
.cert-main p { margin: .2rem 0 0; }
.cert-actions { display: flex; gap: .5rem; align-items: center; }
.cert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .9rem; align-items: start; }
.cert-scan { margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; }
@media (max-width: 720px) { .cert-grid { grid-template-columns: 1fr; } }
.cert-badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.cert-ok { background: var(--ok-soft); color: var(--ok); }
.cert-soon { background: var(--warn-soft); color: var(--warn); }
.cert-expired { background: var(--error-soft); color: var(--danger); }
.pilots-table td { vertical-align: top; }

/* Drohnen: Wartungshinweise */
.maint { display: inline-block; margin: 0 .25rem .25rem 0; padding: .1rem .55rem; border-radius: 8px; font-size: .8rem; font-weight: 600; }
.maint-block { display: block; margin: 0 0 .5rem; padding: .4rem .7rem; font-size: .9rem; }
.maint-due { background: var(--error-soft); color: var(--danger); }
.maint-warn { background: var(--warn-soft); color: var(--warn); }
.maint-info { background: var(--info-soft); color: var(--primary); }
.maint-ok { background: var(--ok-soft); color: var(--ok); font-weight: normal; }
.maint-form { display: grid; grid-template-columns: 180px 1fr auto; gap: 0 .9rem; align-items: end; margin: .75rem 0; }
.maint-form .field { margin: 0; }
.maint-log form { margin: 0; }
@media (max-width: 720px) { .maint-form { grid-template-columns: 1fr; gap: .8rem; } }

/* Flugformular: Wetterwerte und Abruf */
.weather-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .9rem; margin-top: .5rem; }
.weather-fetch { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; margin: 0 0 1rem; }
.weather-status { flex: 1 1 14rem; margin: 0; }
.weather-fetch .small-note { width: 100%; margin: 0; }
@media (max-width: 720px) { .weather-values { grid-template-columns: 1fr 1fr 1fr; gap: 0 .5rem; } }

/* Export-Menü: Jahresbericht */
.annual-report { border-top: 1px solid var(--border); margin-top: .9rem; padding-top: .75rem; }
.annual-report .small { margin: 0 0 .5rem; }

/* Statistik: Säulendiagramm je Monat und Balken in den Tabellen (SVG, Farben über CSS-Variablen) */
.month-chart .columns { display: flex; align-items: stretch; gap: .35rem; height: 220px; padding-top: .5rem; overflow-x: auto; overflow-y: hidden; }
.month-chart .column { flex: 1 1 0; min-width: 28px; height: 100%; display: flex; flex-direction: column; align-items: stretch; }
.column-value { font-size: .72rem; color: var(--muted); text-align: center; min-height: 1.1rem; white-space: nowrap; }
.column-bar { flex: 1 1 auto; min-height: 0; width: 100%; display: block; }
.column-fill { fill: var(--primary); }
.column:hover .column-fill { fill: var(--dlrg-red); }
.column-label { font-size: .75rem; text-align: center; line-height: 1.2; padding-top: .3rem; border-top: 1px solid var(--border); }
.column-label small { display: block; color: var(--muted); font-size: .68rem; }
.stat-table td:first-child { width: 60%; }
.hbar { display: block; width: 100%; height: 6px; margin-top: .3rem; }
.hbar-track { fill: var(--border); }
.hbar-fill { fill: var(--primary); }
@media (max-width: 720px) { .month-chart .columns { height: 180px; gap: .2rem; } .column-value { font-size: .6rem; } }

/* Schmale Bildschirme: Kopfzeile kompakter, damit Farbschema, Profil und Abmelden neben das Logo passen */
@media (max-width: 720px) {
  .head-actions { gap: .4rem; }
  .usermenu { height: 38px; }
  .who, .logout-text { display: none; }
  .user-chip { padding: 0; }
  .avatar { width: 30px; height: 30px; }
  .avatar svg { width: 18px; height: 18px; }
  .btn-logout { padding: 0 .65rem 0 .55rem; }
  .head-icon { width: 38px; height: 38px; }
  .head-icon svg { width: 17px; height: 17px; }
}
@media (max-width: 440px) {
  .brand .drone-icon, .brand-divider { display: none; }
  .brand { gap: .5rem; }
  .brand-text { font-size: .95rem; }
}

/* ===== Eagle Hub: Startseite, Kacheln, Einsatz ===== */
svg[viewBox="0 0 24 24"] { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-head h1 { margin-bottom: .2rem; }
.quickstart { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; margin: 1rem 0 1.25rem; }
.qs { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius); text-decoration: none; color: #fff; box-shadow: var(--shadow); }
.qs svg { width: 34px; height: 34px; flex: none; stroke-width: 2.4; }
.qs span { display: flex; flex-direction: column; gap: .15rem; }
.qs strong { font-size: 1.15rem; }
.qs small { opacity: .9; }
.qs-einsatz { background: var(--dlrg-red); }
.qs-uebung { background: var(--primary); color: var(--primary-text); }
.qs:hover { filter: brightness(1.07); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.tile { position: relative; display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1rem 1.8rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow); min-height: 92px; }
.tile:hover { border-color: var(--primary); }
.tile-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.tile-icon svg { width: 24px; height: 24px; }
.tile-text { display: flex; flex-direction: column; gap: .2rem; }
.tile-text small { color: var(--muted); }
.tile-hint { position: absolute; right: .6rem; bottom: .5rem; max-width: calc(100% - 1.2rem); text-align: center; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.tile-hint-warn { background: var(--warn-soft); color: var(--warn); }
.tile-hint-danger { background: var(--error-soft); color: var(--danger); }
.tile-hint-muted { background: var(--bg); color: var(--muted); }
/* Dauerhaftes „!“ (Nachweis läuft ab, Flugstunde steht bevor) an Kachel und Navigationspunkt */
.alert-mark { display: inline-grid; place-items: center; flex: none; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--danger); color: var(--surface); font-size: .75rem; font-weight: 700; line-height: 1; }
.tile > .alert-mark { position: absolute; top: .5rem; right: .5rem; width: 1.4rem; height: 1.4rem; font-size: .85rem; }
.mainnav a .alert-mark { margin-left: .1rem; }
.lesson-summary h2 { margin-bottom: .4rem; }
.summary-list { list-style: none; margin: 0; padding: 0; }
.summary-list li { padding: .4rem 0; border-top: 1px solid var(--border); }
.summary-list li:first-child { border-top: 0; }
.summary-list li.is-soon { border-left: 3px solid var(--danger); padding-left: .5rem; }

.op-banner { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; background: var(--warn-soft); color: var(--text);
  border-bottom: 1px solid var(--border); text-decoration: none; font-size: .95rem; }
.op-banner-stale { background: var(--error-soft); }
.op-banner-go { margin-left: auto; color: var(--primary); font-weight: 600; white-space: nowrap; }
.op-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dlrg-red); flex: none; animation: op-pulse 1.4s ease-in-out infinite; }
@keyframes op-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .op-dot { animation: none; } }

.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-air { background: var(--dlrg-red); color: #fff; }
.running-badge { display: inline-block; padding: 0 .45em; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: .75rem; font-weight: 700; }

.op-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.op-head h1 { margin-bottom: .3rem; }
.op-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; margin: 0 0 .3rem; color: var(--muted); }
.op-meta svg { width: 16px; height: 16px; vertical-align: -3px; }
.op-team { margin: 0 0 .8rem; }
.op-emergency { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; flex: none; }
.op-emergency svg { width: 20px; height: 20px; }
.emergency-title { color: var(--danger); display: flex; align-items: center; gap: .5rem; }
.emergency-title svg { width: 28px; height: 28px; }
.emergency-steps li { margin-bottom: .35rem; }
.op-info > summary { cursor: pointer; font-weight: 600; }
.op-info[open] > summary { margin-bottom: .8rem; }
.op-info .card { border: 0; padding: 0; box-shadow: none; }

.phases { display: flex; gap: .3rem; overflow-x: auto; margin: 0 0 .8rem; scrollbar-width: none; }
.phase { display: flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; white-space: nowrap; font-size: .9rem; }
.phase-no { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--bg); font-size: .75rem; font-weight: 700; }
.phase-done .phase-no { background: var(--ok-soft); color: var(--ok); }
.phase-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.phase-active .phase-no { background: var(--primary); color: var(--primary-text); }
.phase-nav { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1rem; }
.phase-nav .btn-primary { margin-left: auto; }

.checklist { display: flex; flex-direction: column; gap: .4rem; }
.check-item { margin: 0; }
.check-item button, .check-item a { display: flex; align-items: flex-start; gap: .7rem; width: 100%; padding: .7rem .8rem; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; min-height: 48px; }
.check-item button:hover, .check-item a:hover { border-color: var(--primary); }
.check-item a { text-decoration: none; }
.check-jump { display: inline-block; margin-top: .4rem; }
.check-go { color: var(--muted); font-size: 1.4rem; line-height: 1; align-self: center; }
.check-box { flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border: 2px solid var(--border); border-radius: 6px; font-weight: 800; }
.check-item.checked button, .check-item.checked a { background: var(--ok-soft); border-color: var(--ok); }
.check-item.checked .check-box { background: var(--ok); border-color: var(--ok); color: #fff; }
/* Offener Sprung zur Risikobewertung: farbig hinterlegt, damit er zwischen den Abhak-Punkten auffällt */
.check-auto:not(.checked) a { background: var(--warn-soft); border-color: var(--warn); border-left-width: 4px; }
.check-auto:not(.checked) .check-box { border-color: var(--warn); }
.check-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.check-text small { font-size: .8rem; }
.check-text .cond { color: var(--warn); }
.check-time { color: var(--ok); font-size: .85rem; font-variant-numeric: tabular-nums; }
.repeat { color: var(--primary); font-weight: 700; }

.scenario-result { margin: 1rem 0; padding: .8rem 1rem; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 6px; }
.scenario-result p { margin: 0 0 .4rem; }
.risk-conditions { margin: .3rem 0; padding-left: 1.2rem; }
.risk-duties { margin: .4rem 0 0; padding-left: 1.2rem; }
.risk-confirm { margin: 1rem 0; }
.deviation { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.deviation > summary { cursor: pointer; font-weight: 600; }
.deviation-item { margin: .6rem 0; padding: .6rem .8rem; background: var(--warn-soft); border-radius: 6px; font-size: .92rem; }
.deviation-fields { margin-top: .8rem; }
#deviations { counter-reset: segment; }
.deviation-block .field { margin-bottom: .6rem; }
.doc-events { margin: .3rem 0 .8rem; padding-left: 1.2rem; }
.check-summary > summary { cursor: pointer; font-weight: 600; }
.check-summary p { margin: .5rem 0; font-size: .92rem; }

.op-flight { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; margin: 0 0 .8rem; }
.op-flight legend { font-weight: 700; padding: 0 .4rem; }
.op-flight legend .badge { margin-left: .4rem; font-weight: 600; }
.op-flight.in-air { border-color: var(--dlrg-red); border-width: 2px; }
.op-flight.landed { background: var(--bg); }
.op-team-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: end; }
.op-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .6rem 0; }
.op-actions .btn svg { width: 1.15em; height: 1.15em; flex: none; } /* Symbol so groß wie die Emojis der Nachbar-Reiter */
.time-action { display: flex; gap: .4rem; align-items: center; }
.time-action input[type=time] { width: 7.5rem; }
.btn-big { min-width: 8rem; min-height: 48px; font-size: 1.1rem; font-weight: 700; }
.flight-checks > summary { cursor: pointer; color: var(--primary); margin: .3rem 0; }
.event-list { list-style: none; padding: 0; margin: .5rem 0; }
.event-list li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.inline-form { display: inline; }
.op-close { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd { margin-bottom: .5rem; }
}
/* Breite Tabellen (Verwaltung) auf dem Handy seitlich scrollen statt die Seite zu verbreitern */
.table-wrap { overflow-x: auto; }
.weather-warn { margin: .35rem 0 0; padding-left: 0; list-style: none; }
.weather-warn li + li { margin-top: .2rem; }
.weather-ok { margin: .2rem 0 0; }
.weather-ampel { display: flex; gap: .75rem; align-items: flex-start; }
.weather-ampel > div { flex: 1; min-width: 0; }
.ampel { display: inline-flex; flex-direction: column; gap: .2rem; padding: .3rem; border-radius: .5rem; background: #2b2b2b; flex: none; }
.ampel i { display: block; width: 1rem; height: 1rem; border-radius: 50%; background: #555; }
.ampel-rot i:nth-child(1) { background: #e53935; box-shadow: 0 0 .4rem #e53935; }
.ampel-gelb i:nth-child(2) { background: #fbc02d; box-shadow: 0 0 .4rem #fbc02d; }
.ampel-gruen i:nth-child(3) { background: #43a047; box-shadow: 0 0 .4rem #43a047; }
.weather-facts { margin-top: .5rem; }
.filters { margin-bottom: 1rem; }
/* Drohnenliste am Handy: jede Drohne als Karte statt seitlich scrollender Tabelle */
@media (max-width: 720px) {
  .drones-table, .drones-table tbody, .drones-table tr, .drones-table td { display: block; }
  .drones-table thead { display: none; }
  .drones-table tr { padding: .7rem .9rem; border-bottom: 1px solid var(--border); }
  .drones-table tr:last-child { border-bottom: 0; }
  .drones-table td, .drones-table td.num { border: 0; padding: .15rem 0; text-align: left; }
}
.docgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
@media (max-width: 720px) {
  .op-head { flex-direction: column; }
  .op-team-form { grid-template-columns: 1fr; }
  .quickstart { grid-template-columns: 1fr; }
}

/* Löschen mit Bestätigung auf der Seite (Partial confirm_delete) */
.confirm-delete > summary { list-style: none; }
.confirm-delete > summary::-webkit-details-marker { display: none; }
.confirm-delete[open] > summary { opacity: .6; }
.form-actions .confirm-delete[open] { flex-basis: 100%; order: 10; }
.confirm-box { margin-top: .5rem; padding: .7rem .9rem; border: 1px solid var(--danger); background: var(--error-soft); border-radius: var(--radius); }
.confirm-box p { margin: 0 0 .6rem; }
.confirm-small .confirm-box { padding: .5rem .6rem; font-size: .9rem; text-align: left; min-width: 11rem; }
.confirm-small .confirm-box .btn { padding: .35rem .7rem; min-height: 0; font-size: .9rem; }

/* Fluggebietsprüfung (18.11.2026): Ergebnis am Startpunkt, Karte, Legende, Geozonen */
.area-wrap { margin: .75rem 0 1rem; border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; background: var(--surface); }
.area-title { font-size: 1rem; margin: 0 0 .5rem; cursor: pointer; }
details.area-wrap > summary.area-title { margin: 0; }
details.area-wrap[open] > summary.area-title { margin-bottom: .5rem; }
.area-start { padding: .6rem .8rem; border-radius: 8px; margin: 0 0 .4rem; border-left: 5px solid var(--muted); background: var(--bg); }
.area-gruen { border-left-color: #2ea043; background: var(--ok-soft); }
.area-gelb { border-left-color: #e0a800; background: var(--warn-soft); }
.area-rot { border-left-color: #d7263d; background: var(--error-soft); }
.area-dunkelrot { border-left-color: #6e0019; background: var(--error-soft); }
.area-violett { border-left-color: #8232be; }
.area-note { margin: .3rem 0; }
.area-ways { margin: .4rem 0 .6rem; padding: .5rem .8rem; border-radius: 8px; border-left: 5px solid #e0a800; background: var(--warn-soft); }
.area-ways-ok { border-left-color: #2ea043; background: var(--ok-soft); }
.area-ways p { margin: .2rem 0; }
.area-ways-list { list-style: none; margin: .3rem 0; padding: 0; }
.area-ways-list li { margin: .15rem 0; }
.way-ok { color: var(--ok); }
.way-no { color: var(--text); }
.density-calc { margin: .3rem 0 .1rem; }
.density-calc summary { cursor: pointer; font-weight: 600; }
.density-steps { margin: .4rem 0 .2rem; padding-left: 1.3rem; }
.density-steps li { margin: .35rem 0; overflow-wrap: anywhere; }
.density-formula { font-variant-numeric: tabular-nums; }
.density-facts { margin: .25rem 0 .5rem; padding-left: 1.2rem; }
.density-facts li { overflow-wrap: anywhere; }
.area-recommend { margin: .6rem 0; padding: .6rem .8rem; border-radius: 8px; background: var(--info-soft); }
.area-recommend p { margin: 0 0 .5rem; }
.area-recommend form { margin: 0; }
.area-params { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin: .6rem 0; }
.area-params .field { flex: 1 1 9rem; margin: 0; }
.area-params input { width: 100%; }
.chip-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .35rem .8rem; font: inherit; cursor: pointer; min-height: 2.25rem; }
.chip-btn.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.area-map { margin: .5rem 0; }
.area-map > img { display: block; width: 100%; max-width: 640px; height: auto; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
/* Interaktive Fluggebiet-Karte (19.11.2026, Leaflet, app.js): Tippen setzt den Startpunkt, der rote Punkt lässt sich
   ziehen. Am Handy verschiebt ein Finger die Seite, zwei Finger die Karte; ⛶ zeigt sie bildschirmfüllend. */
.area-map-img { position: relative; width: 100%; max-width: 720px; aspect-ratio: 1 / 1; max-height: 72vh; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--border); background: #ebebe7; box-shadow: 0 2px 10px rgba(15, 30, 50, .12); }
.area-map-img noscript img { display: block; width: 100%; height: auto; }
/* eigene Ebene (Leaflet-Panes bis z-index 1000), damit Auswahllisten (.combo-list) darüber liegen; Vollbild 2000 */
.area-map-img:not(.area-map-full) { z-index: 0; }
.area-map-img.leaflet-container { font: inherit; font-size: .8rem; }
.area-map-img.area-map-full { position: fixed; inset: 0; z-index: 2000; width: auto; max-width: none; max-height: none;
  aspect-ratio: auto; border-radius: 0; border: 0; }
body.area-full-open { overflow: hidden; }
.area-pin { border-radius: 50%; background: #c8001e; border: 3px solid #fff; touch-action: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .45); }
.area-pin::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; } /* größere Griffläche am Handy */
.leaflet-marker-draggable.area-pin { cursor: grab; }
.area-ctl { background: #fff; padding: .3rem .1rem; color: #1b2733; }
.leaflet-bar.area-ctl { border-radius: 10px; }
.area-ctl label { display: flex; align-items: center; gap: .4rem; padding: .25rem .55rem; cursor: pointer; white-space: nowrap; font-size: .8rem; }
.area-ctl input { width: auto; min-height: 0; margin: 0; }
.area-ctl .swatch { width: .9rem; height: .7rem; }
.leaflet-bar a.area-full-btn { font-size: 1.05rem; }
@media (max-width: 480px) {
  .area-ctl { padding: .15rem 0; }
  .area-ctl label { padding: .15rem .4rem; font-size: .72rem; gap: .3rem; }
  .area-map-img { max-height: 60vh; }
}
.leaflet-control-attribution { font-size: .7rem; }
.area-pick-hint { margin: .35rem 0 0; }
.area-box.htmx-request .area-map-img, .area-box.area-pending .area-map-img { opacity: .55; transition: opacity .2s; }
.area-box.htmx-request .area-map-img::after, .area-box.area-pending .area-map-img::after { content: "Karte wird aktualisiert …";
  position: absolute; left: 50%; top: 1rem; z-index: 1000; transform: translateX(-50%); padding: .35rem .7rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: .9rem; white-space: nowrap; }
.op-place { margin: .5rem 0 1rem; }
.op-place .form-actions { margin-top: .5rem; }
.coords-toggle summary { cursor: pointer; font-size: .9rem; margin-top: .35rem; }
.coords-fields { margin-top: .5rem; }
.area-legend { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .25rem; font-size: .85rem; }
.area-legend li { display: flex; align-items: center; gap: .45rem; }
.swatch { flex: none; width: 1.1rem; height: .8rem; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .25); }
.swatch-gruen { background: rgba(46, 160, 67, .55); }
.swatch-rot { background: rgba(215, 38, 61, .6); }
.swatch-dunkelrot { background: rgba(110, 0, 25, .75); }
.swatch-gelb { background: rgba(240, 185, 0, .6); }
.swatch-violett { background: repeating-linear-gradient(45deg, rgba(130, 50, 190, .85) 0 2px, transparent 2px 6px); border-color: #8232be; }
.swatch-zone { background: transparent; border: 2px solid #282828; }
.swatch-zelle { background: transparent; border: 2px solid #6e0019; }
.swatch-dichte { background: linear-gradient(90deg, rgba(235, 110, 0, .15), rgba(235, 110, 0, .65)); }
.swatch-dipul { background: rgba(250, 240, 210, .9); border-color: #f0c850; }
.swatch-hinweis { background: repeating-linear-gradient(45deg, rgba(200, 0, 120, .8) 0 2px, rgba(200, 0, 120, .18) 2px 7px); border-color: #c80078; }
/* gruen … dichte: nur noch für archivierte Auswertungen vor dem 19.11.2026 */
.swatch-ring { background: transparent; border: 0; border-top: 3px solid #00378c; height: 0; }
.swatch-ring2 { background: transparent; border: 0; border-top: 2px dashed #00378c; height: 0; }
.swatch-scale { background: #141414; height: .3rem; }
/* dipul-Farben der Geozonen (SLD des dipul-WMS, 19.11.2026) */
.zone-dot { display: inline-block; flex: none; width: .9rem; height: .9rem; border-radius: 50%; vertical-align: -.1rem; margin-right: .35rem; border: 1px solid rgba(0, 0, 0, .3); }
.zone-c-luftfahrt { background: #cf2b2b; }
.zone-c-einrichtung { background: #e56f07; }
.zone-c-wohnen { background: #f0cb51; }
.zone-c-energie { background: #2a2869; }
.zone-c-bahn { background: #282c30; }
.zone-c-strasse { background: #969ea6; }
.zone-c-wasser { background: #3493e1; }
.zone-c-natur { background: #67a147; }
.dipul-legend { margin: .5rem 0; }
.dipul-legend summary { cursor: pointer; font-size: .9rem; }
.dipul-legend .area-legend { margin-top: .4rem; }
.area-legend .zone-dot { margin-right: 0; }
.area-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.area-h { font-size: .95rem; margin: 1rem 0 .35rem; }
.area-zones { margin: 0; padding-left: 0; list-style: none; display: grid; gap: .35rem; }
.area-zones li { padding-left: 1.6rem; text-indent: -1.6rem; }
.risk-checks { border: 2px solid var(--border); border-radius: var(--radius, 8px); padding: .75rem 1rem 1rem; }
.risk-checks legend { font-weight: 700; font-size: 1.05rem; padding: 0 .4rem; }
.risk-checks-intro { margin: 0 0 .6rem; font-weight: 600; }
.risk-team .grid-3 { align-items: end; }
.fill-picks { display: flex; flex-wrap: wrap; gap: .4rem; margin: .45rem 0 .2rem; }
.fill-picks .chip-btn { font-size: .9rem; min-height: 2rem; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.risk-checks .check { align-items: flex-start; }
.risk-checks .check input { width: auto; min-height: 0; margin-top: .25rem; }
.risk-checks .check small { display: block; }
/* Vom Piloten abzuhakende Prüfungen: offen gelb hinterlegt, abgehakt grün */
.risk-checks label.check { padding: .55rem .7rem; background: var(--warn-soft); border: 1px solid var(--warn); border-left-width: 4px; border-radius: 6px; cursor: pointer; }
.risk-checks label.check input { accent-color: var(--ok); width: 1.25rem; height: 1.25rem; }
.risk-checks label.check:has(input:checked) { background: var(--ok-soft); border-color: var(--ok); }
.flight-controls { margin-top: 1rem; }
.flight-controls .check input { width: auto; min-height: 0; }

/* Fehlende/ungültige Angaben einheitlich (20.11.2026): Feld rot umrandet und hinterlegt, Hinweis darunter,
   Seite springt zum ersten markierten Feld (app.js). */
.error { display: block; }
.field:has(> .error), fieldset:has(> .error), .check:has(> .error), .has-error {
  border-left: 4px solid var(--danger); background: var(--error-soft); border-radius: 6px; padding: .4rem .6rem;
}
.field:has(> .error) :is(input:not([type=checkbox]):not([type=radio]), select, textarea), [aria-invalid=true]:not([type=checkbox]):not([type=radio]) { border-color: var(--danger); }
#risk-box:has(.risk-confirm .msg-error) .risk-checks label.check:not(:has(input:checked)) { background: var(--error-soft); border-color: var(--danger); }

/* Flugstunden (Konzept 6.5): Monatsraster ab Tablet, auf dem Handy Liste der Tage mit Terminen */
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.cal-head h2 { margin: 0; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-wd { background: var(--bg); padding: .3rem; font-size: .8rem; font-weight: 600; color: var(--muted); text-align: center; }
.cal-day { background: var(--surface); min-height: 6.5rem; padding: .3rem; display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.cal-out { background: var(--bg); }
.cal-out .cal-date, .cal-past .cal-date { color: var(--muted); }
.cal-today .cal-date { color: var(--primary); font-weight: 700; }
.cal-date { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; }
.cal-wday, .cal-full { display: none; }
.cal-add { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; color: var(--primary); text-decoration: none; font-weight: 700; opacity: .35; }
.cal-day:hover .cal-add, .cal-add:focus { opacity: 1; background: var(--primary-soft); }
.cal-lesson { display: block; padding: .2rem .35rem; border-radius: 6px; border-left: 3px solid var(--primary); background: var(--primary-soft); color: var(--text); text-decoration: none; font-size: .78rem; line-height: 1.25; overflow-wrap: anywhere; }
.cal-lesson small { display: block; color: var(--muted); }
.cal-lesson.is-mine { border-color: var(--ok); background: var(--ok-soft); }
.cal-lesson.is-wait { border-color: var(--warn); background: var(--warn-soft); }
.cal-lesson.is-full { border-color: var(--muted); background: var(--bg); }
.cal-lesson.is-cancelled { border-color: var(--muted); background: var(--bg); text-decoration: line-through; color: var(--muted); }
.cal-none { display: none; }
@media (max-width: 720px) {
  .cal { display: block; background: none; border: 0; border-radius: 0; }
  .cal-wd, .cal-out, .cal-empty { display: none; }
  .cal-day { min-height: 0; padding: .5rem 0; border-bottom: 1px solid var(--border); }
  .cal-wday, .cal-full { display: inline; }
  .cal-date { font-weight: 600; }
  .cal-add { opacity: 1; width: 2.25rem; height: 2.25rem; }
  .cal-lesson { font-size: .9rem; padding: .45rem .6rem; }
  .cal:not(:has(.cal-day:not(.cal-empty):not(.cal-out))) + .cal-none { display: block; }
}
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list > li { border-bottom: 1px solid var(--border); }
.lesson-list > li:last-child { border-bottom: 0; }
.lesson-row { display: flex; flex-direction: column; gap: .15rem; padding: .6rem 0; color: var(--text); text-decoration: none; }
.lesson-row:hover .lesson-when { color: var(--primary); }
.lesson-row.is-cancelled .lesson-when { text-decoration: line-through; color: var(--muted); }
.lesson-state { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; }
.lesson-people { margin: -.3rem 0 .6rem; font-size: .85rem; color: var(--muted); }
.participants { list-style: none; margin: 0; padding: 0; }
.participants li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.participants li:last-child { border-bottom: 0; }
.participants small { display: block; }
.progress-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin-bottom: .4rem; }
progress { width: 100%; height: .75rem; accent-color: var(--ok); }
.progress-cell { display: flex; flex-direction: column; gap: .2rem; min-width: 8rem; }

/* Benachrichtigungen */
.notes { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.note { display: flex; align-items: stretch; }
.note + .note { border-top: 1px solid var(--border); }
.note form { margin: 0; }
.note > form:first-child { flex: 1 1 auto; min-width: 0; }
.note.is-unread { background: var(--info-soft); }
.note-x { width: 2.75rem; height: 100%; min-height: 2.75rem; border: 0; background: none; color: var(--muted); font: inherit; font-size: 1.1rem; cursor: pointer; }
.note-x:hover, .note-x:focus-visible { color: var(--danger); background: var(--bg); }
.note-del { display: flex; }
.note-btn { display: flex; flex-direction: column; gap: .2rem; width: 100%; padding: .7rem .9rem; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.note-btn:hover, .note-btn:focus-visible { background: var(--bg); }
.note.is-unread .note-btn { background: var(--info-soft); font-weight: 600; }
.note.is-unread small { font-weight: normal; }
.note-dot { display: inline-block; width: .55rem; height: .55rem; margin-right: .45rem; border-radius: 50%; background: var(--primary); vertical-align: middle; }
