/* Design-Tokens und Basis-Komponenten aus docs/spec-design.md ("Modernist"-Guide, wörtlich übernommen). */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/archivo-variable.woff2") format("woff2");
}

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #ec3013;
  --color-accent-2: #e15b47;
  --color-divider: color-mix(in srgb, #201e1d 40%, transparent);

  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #fff2ef;
  --color-accent-200: #ffe0d9;
  --color-accent-300: #ffc4b8;
  --color-accent-400: #ff9783;
  --color-accent-500: #ff563c;
  --color-accent-600: #dd2b0f;
  --color-accent-700: #ae1800;
  --color-accent-800: #7c1405;
  --color-accent-900: #4d170e;

  --color-accent-2-100: #fff2ef;
  --color-accent-2-200: #ffe0da;
  --color-accent-2-300: #ffc4b9;
  --color-accent-2-400: #ff9784;
  --color-accent-2-500: #ef6853;
  --color-accent-2-600: #c94b39;
  --color-accent-2-700: #9e3526;
  --color-accent-2-800: #71261b;
  --color-accent-2-900: #471d16;

  /* Eigene Variablen statt --color-accent-700 direkt in .flash-error/.btn-danger, weil dieselbe
     feste Farbe im Dark Mode zu dunkel/kontrastarm waere (s. Dark-Mode-Override unten, Issue #31). */
  --color-danger-text: var(--color-accent-700);
  --color-danger-border: var(--color-accent-700);

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: "Archivo", system-ui, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

  --sidebar-width: 220px;
}

/* Darkmode: exakte Werte im gelieferten Guide nicht enthalten (s. docs/spec-design.md) — hier
   pragmatisch aus den Neutral-/Accent-Ramps abgeleitet, Akzentton bleibt bewusst identisch.
   --color-danger-text/--color-danger-border: accent-700 (#ae1800) ist auf hellem --color-surface
   gut lesbar, auf dunklem Untergrund (Dark Mode) aber zu dunkel/kontrastarm -- .flash-error und
   .btn-danger nutzen daher hier eine hellere Stufe der Accent-Ramp statt derselben festen Farbe wie
   im Light Mode (s. Issue #31). */
:root[data-theme="dark"] {
  --color-bg: var(--color-neutral-900);
  --color-surface: #383535;
  --color-text: var(--color-neutral-100);
  --color-divider: color-mix(in srgb, var(--color-neutral-100) 24%, transparent);
  --color-danger-text: var(--color-accent-400);
  --color-danger-border: var(--color-accent-500);
  --shadow-sm: 0 1px 2px color-mix(in srgb, #000 45%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #000 50%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #000 60%, transparent);
  /* Issue #68: helle Akzent-Hintergründe (aktiver Menüpunkt, markierte Zeilen, Akzent-Tags) im
     Dunkeln als dunkle Tönung mit hellem Text statt greller Flächen */
  --color-accent-100: #3a1912;
  --color-accent-800: #ffb3a3;
}
:root[data-theme="dark"] .tag-neutral,
:root[data-theme="dark"] .status-active { background: #4a4646; color: #ece8e8; }
:root[data-theme="dark"] .tag-warning,
:root[data-theme="dark"] .status-waiting { background: #4a3a12; color: #f4d27a; }
:root[data-theme="dark"] .tag-success,
:root[data-theme="dark"] .status-done { background: #173d22; color: #9be0ae; }
:root[data-theme="dark"] .status-inactive { color: #bab6b6; }

/* Ältere WebViews (DJI RC Plus: Chrome 95) kennen color-mix() nicht -- dort wären Trennlinien,
   Rahmen und Schatten auf Basis der Variablen oben ungültig und fielen komplett weg (live gesehen:
   PIN-Feld ohne Rahmen). Gleichwertige rgba()-Werte als Ersatz. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --color-divider: rgba(32, 30, 29, 0.4);
    --shadow-sm: 0 1px 2px rgba(45, 43, 43, 0.14);
    --shadow-md: 0 3px 10px rgba(45, 43, 43, 0.16);
    --shadow-lg: 0 12px 32px rgba(45, 43, 43, 0.22);
  }
  :root[data-theme="dark"] {
    --color-divider: rgba(248, 244, 244, 0.24);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 3px 10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  }
  :root.rc-night { --color-divider: rgba(140, 133, 133, 0.25); }
  .field > label { color: rgba(32, 30, 29, 0.7); }
  .rc-night .field > label { color: var(--color-text); }
}

* , *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
}

/* Jede Klasse, die selbst "display" setzt (z. B. .btn: inline-flex, .notif-badge: flex), ist eine
   normale Autoren-Regel und schlaegt damit IMMER die normale User-Agent-Regel "[hidden] { display:
   none }", unabhaengig von Spezifitaet -- das HTML-Attribut hidden wuerde sonst stillschweigend
   wirkungslos bleiben (am RC-Ueberspringen-Button und beim Notification-Badge real beobachtet). */
[hidden] { display: none !important; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
.tabular-nums { font-variant-numeric: tabular-nums; }

.hr { height: 2px; border: 0; margin: var(--space-4) 0; background: var(--color-divider); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-danger { border-color: var(--color-danger-border); color: var(--color-danger-text); }
.btn-danger:hover { background: color-mix(in srgb, var(--color-danger-text) 12%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); border: none; }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-block { width: 100%; margin-top: var(--space-2); justify-content: center; }

/* RC-Kiosk: Bediener-Auswahl (Pilot/Kamera) wird auf dem RC-Touchscreen bedient, deshalb deutlich
   groessere Tipp-Flaeche als normale Buttons; Name links, Qualifikations-Tags rechtsbuendig. */
.rc-select-btn {
  min-height: 88px; padding: var(--space-4) var(--space-6);
  font-size: 24px; justify-content: space-between; text-align: left;
}
.rc-select-btn { gap: var(--space-3); }
.rc-select-btn .rc-select-btn-tags { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: none; max-width: 50%; }
.rc-select-btn .tag { font-size: 15px; padding: 6px 14px; }

/* DJI RC Plus: Landscape mit nur ~440 CSS-px Hoehe (1920x1200 bei Dichte 2,5) -- das 160-px-Logo
   schob Bedienerauswahl und PIN-Eingabe unter den Bildschirmrand (live am Controller gesehen). */
@media (max-height: 560px) {
  .rc-shell { padding-block: var(--space-2); }
  .rc-shell .auth-card { gap: var(--space-2); }
  .rc-shell .auth-logo { width: 84px; height: 84px; }
  .rc-shell .rc-select-btn { min-height: 64px; padding: var(--space-2) var(--space-4); font-size: 20px; }
}

/* RC: Notfallverfahren (Issue #42) und Schnellzugriffe auf der Startseite. */
.rc-guide { border: 1px solid var(--color-divider); padding: var(--space-2) var(--space-3); }
.rc-guide summary { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 20px; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.rc-guide ol { margin: var(--space-2) 0 0; padding-left: 1.4em; font-size: 19px; line-height: 1.45; }
.rc-guide li + li { margin-top: var(--space-2); }
.rc-quick { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.rc-quick .btn { flex: 1 1 0; min-height: 52px; font-size: 16px; }
.rc-quick .rc-icon-btn { flex: 0 0 56px; font-size: 22px; padding: 0; }
/* Änderungs-Hinweis oben rechts am Button "Taschenkarte" (Issue #42). */
.rc-badge-host { position: relative; }
.rc-badge { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--color-accent); border: 2px solid var(--color-surface); }
.rc-reminder { border: 2px solid var(--color-accent); padding: var(--space-2) var(--space-3); background: var(--color-accent-100); color: var(--color-accent-800); }
.rc-reminder strong { display: block; font-size: 18px; }
/* RC: Störungsmeldung (Issue #38) -- große Antipp-Flächen statt Auswahlliste. */
.rc-fault-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.rc-fault-area { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-divider); cursor: pointer; font-size: 16px; }
/* .is-checked setzt rc_fault_report.js -- :has() kennt die WebView des RC Plus (Chrome 95) noch nicht. */
.rc-fault-area.is-checked { border: 2px solid var(--color-accent); background: var(--color-accent-100); color: var(--color-accent-800); }
.rc-fault-area input { width: 22px; height: 22px; flex: none; }
.rc-fault-area span { min-width: 0; overflow-wrap: break-word; }
.rc-file-btn { cursor: pointer; }
.rc-pending { font-size: 14px; color: var(--color-accent-800); background: var(--color-accent-100); padding: var(--space-1) var(--space-2); }

/* RC: Nachtmodus (Issue #40) -- stark gedimmt, keine hellen Flächen. Bewusst dasselbe Layout wie am
   Tag (größere Elemente schoben auf dem ~440 px hohen RC-Display alles aus dem Bild); die RC-Seiten
   haben ohnehin große Bedienelemente. Wird von rc_night.js an <html> gesetzt; in der App dimmt die
   App zusätzlich die Fensterhelligkeit. */
:root.rc-night {
  --color-bg: #000;
  --color-surface: #0b0a0a;
  --color-text: #8c8585;
  --color-accent: #7d1d0e;
  --color-accent-600: #8e2412;
  --color-accent-700: #6a1609;
  --color-accent-100: #1a0a07;
  --color-accent-800: #b4513f;
  --color-neutral-100: #141212;
  --color-neutral-800: #8c8585;
  --color-divider: color-mix(in srgb, #8c8585 25%, transparent);
  --color-danger-text: #b4513f;
  --color-danger-border: #7d1d0e;
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  color-scheme: dark;
}
.rc-night .btn-primary { color: #d0b8b3; }
.rc-night .btn-ghost { color: #b4513f; }
.rc-night .auth-logo-light { display: none; }
.rc-night .auth-logo-dark { display: block; filter: brightness(0.5); }
.rc-night .input { background: #000; color: var(--color-text); }
.rc-night .flight-timer { color: #b4513f; }

/* Formulare */
.field { margin-bottom: var(--space-3); }
.field > label { display: block; font-size: 12px; margin-bottom: 5px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.input, select.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.checkbox-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--color-divider); padding: var(--space-2); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }

.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.radio .dot { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--color-divider); }
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot { border-color: var(--color-accent); background: var(--color-accent); box-shadow: inset 0 0 0 4px var(--color-bg); }

/* Karten */
.card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface); }
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 17px; line-height: 1.2; }
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* RC-Kiosk: Flugdauer-Anzeige ab Freigabe bis "Flug beenden" */
.flight-timer {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 36px; text-align: center; margin: var(--space-2) 0;
}

/* Tags */
.tag { display: inline-flex; align-items: center; font-size: 11px; letter-spacing: 0.02em; padding: 3px 10px; border-radius: calc(var(--radius-md) * 0.75); }
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
/* Zusätzliche Statusfarben nur für die 6-wertige Verbesserungsvorschläge-Statuspalette
   (app/modules/suggestions/models.py) -- die übrigen .tag-* decken nur 3 Zustände ab. */
/* Feste helle Chip-Hintergruende statt eines transparenten color-mix() -- ein mit "transparent"
   gemischter Farbton haengt vom jeweils dahinterliegenden Element ab (im Dark Mode dessen dunkler
   --color-surface), wodurch die dunkle Textfarbe zu kontrastarm wuerde. Gleiches Muster wie
   .tag-accent/.tag-neutral: fester heller Chip unabhaengig vom Seitentheme (s. Issue #31). */
.tag-warning { background: #fdf0d1; color: #8a6400; }
.tag-success { background: #dff3e3; color: #136128; }

/* Tabellen */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 60%, transparent); padding: var(--space-2); border-bottom: 2px solid var(--color-divider); }
.table td { padding: var(--space-2); border-bottom: 1px solid var(--color-divider); vertical-align: middle; }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* Flash-Meldungen */
/* Sprunglink (Issue #58): nur bei Tastaturfokus sichtbar */
.skip-link { position: absolute; left: var(--space-2); top: -100px; z-index: 1000; padding: var(--space-2) var(--space-3);
  background: var(--color-accent); color: #fff; font-weight: 600; }
.skip-link:focus { top: var(--space-2); }
.app-content:focus { outline: none; }

/* Geheimnisse erst beim Fokus (Klick oder Tab) zeigen -- ohne Inline-Handler, die CSP blockiert sie */
.input-secret { filter: blur(4px); }
.input-secret:focus { filter: none; }

/* Bestätigungsdialog (Issues #58/#62), siehe js/confirm_dialog.js */
.confirm-dialog { border: 1px solid var(--color-divider); background: var(--color-bg); color: var(--color-text);
  padding: 0; max-width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.confirm-dialog-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.confirm-dialog-title { font-size: 18px; margin: 0; }
.confirm-dialog-text { margin: 0; }
.confirm-dialog-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }

/* Anhänge (Issue #59): Name, Typ und Größe vor dem Öffnen, Bildvorschau */
.attachment-list { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.attachment { margin: 0; width: 140px; display: flex; flex-direction: column; gap: var(--space-1); }
.attachment-thumb img { display: block; width: 120px; height: 120px; object-fit: cover; border: 1px solid var(--color-divider); }
.attachment-icon { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px;
  border: 1px solid var(--color-divider); background: var(--color-surface); font-weight: 600; letter-spacing: 0.04em; }
.attachment audio { width: 140px; }
.attachment figcaption { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attachment-name { overflow-wrap: anywhere; }
.attachment-meta { font-size: 13px; color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.attachment-compact { width: auto; flex-direction: row; align-items: flex-start; gap: var(--space-2); margin-bottom: var(--space-2); }
.attachment-compact .attachment-thumb img { width: 48px; height: 48px; }
.attachment-compact .attachment-icon { width: 48px; height: 48px; font-size: 11px; }

/* Leere Zustände (Issue #57): "noch nichts vorhanden" vs. "Filter ohne Treffer" */
.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-4) 0; }
.empty-state p { margin: 0; }
.empty-state-title { font-weight: 600; }
.table .empty-row td, .table .empty-row:hover td { background: transparent; }

.flash-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.flash { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: 14px; border: 1px solid var(--color-divider); background: var(--color-surface); }
.flash-error { border-color: var(--color-danger-border); color: var(--color-danger-text); }
.flash-warning { border-left: 4px solid #b07c00; }

/* ---- App-Shell / Layout (nicht im Guide enthalten, ergänzt passend zu Navigation & Layout) ---- */

.logo-badge { width: 36px; height: 36px; background: #181514; display: flex; align-items: center; justify-content: center; flex: none; }

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.auth-card { width: min(360px, 100%); display: flex; flex-direction: column; gap: var(--space-4); }
.auth-brand { display: flex; align-items: center; justify-content: center; }
.auth-logo { width: 160px; height: 160px; display: block; }
.auth-logo-dark { display: none; }
:root[data-theme="dark"] .auth-logo-light { display: none; }
:root[data-theme="dark"] .auth-logo-dark { display: block; }

/* Profilbild (app/profile/) -- quadratisch statt rund, konsistent mit dem scharfkantigen
   Design-System (--radius-* ist überall 0px, s. o.). */
.avatar { width: 96px; height: 96px; object-fit: cover; border: 1px solid var(--color-divider); background: var(--color-neutral-200); display: block; flex: none; }
.avatar-placeholder {
  width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid var(--color-divider); background: var(--color-neutral-200); color: var(--color-neutral-700);
  font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 30px;
}
.profile-header { display: flex; align-items: center; gap: var(--space-4); }

/* height (nicht min-height) + overflow:hidden hält die Sidebar auf Viewport-Höhe fixiert -- sonst
   dehnt sie sich als Flex-Kind gleich hoch wie .app-main (Standard-Flexbox-Stretch) und scrollt beim
   Scrollen langer Dashboard-Inhalte mit der ganzen Seite mit, statt stehen zu bleiben. Nur .app-content
   scrollt intern (s. u.). Für Mobile wird das im Media-Query unten bewusst wieder aufgehoben, weil der
   dortige sticky-bottom-Tab-Balken (.sidebar) einen echten Dokument-Scroll braucht, um zu funktionieren. */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-width); flex: none; display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-4); border-right: 2px solid var(--color-divider); background: var(--color-surface);
  overflow-y: auto;
  /* overflow-y:auto macht die Leiste sonst auch seitlich scrollbar, sobald ein Eintrag minimal zu
     breit ist -- dann rutschen alle Icons aus dem Bild (live beobachtet bei "Verbesserungsvorschläge").
     Die mobile Tab-Leiste unten setzt overflow-x wieder auf auto. */
  overflow-x: hidden;
}
.sidebar-brand { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.sidebar-brand-text { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 18px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link { display: flex; align-items: center; gap: 8px; padding: 8px var(--space-2); border-radius: var(--radius-md); color: var(--color-text); text-decoration: none; font-size: 14px; }
.sidebar-link svg { flex-shrink: 0; }
/* Lange einzelne Wörter ("Verbesserungsvorschläge") deutsch trennen (html lang="de") statt die
   Leiste zu sprengen; overflow-wrap als Rückfall für Browser ohne Trennregeln. */
@media (min-width: 761px) {
  .sidebar-link { min-width: 0; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
}
.sidebar-link:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.sidebar-link.is-active { background: var(--color-accent-100); color: var(--color-accent-800); }

/* min-height:0 ist hier nötig, nicht nur Deko: ohne das würde dieses Flex-Kind sich nie unter die
   Höhe seines Inhalts (.app-content) zusammendrücken lassen, wodurch dessen overflow-y:auto nie
   greifen und stattdessen wieder das ganze .app-shell aufblähen würde -- derselbe Grund, warum die
   Sidebar bisher mitgewachsen ist. */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-6); border-bottom: 2px solid var(--color-divider); }
.topbar-title { margin: 0; font-size: 20px; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-3); }
.role-switch-form { margin: 0; }

.topbar-user { font-weight: 700; color: var(--color-text); text-decoration: none; white-space: nowrap; }
.topbar-user:hover { color: var(--color-accent); }

/* Topbar-Glocke: Verlauf-Sprechblase + Live-Badge (app/static/js/notifications.js: initNotificationBell) */
.notif-center { position: relative; }
.notif-bell {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; background: none; border: none; border-radius: var(--radius-md);
  color: var(--color-text); cursor: pointer;
}
.notif-bell:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 50%; background: var(--color-accent); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.notif-popover {
  position: absolute; top: calc(100% + var(--space-2)); right: 0; width: 320px;
  max-width: calc(100vw - var(--space-4)); background: var(--color-surface); border: 1px solid var(--color-divider);
  box-shadow: var(--shadow-lg); z-index: 20;
}
.notif-popover-header {
  padding: var(--space-3); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--color-text) 65%, transparent); border-bottom: 1px solid var(--color-divider);
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-list p.text-muted { padding: var(--space-3); margin: 0; }
.notif-item { display: block; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-divider); }
.notif-item:last-child { border-bottom: none; }
a.notif-item { color: inherit; text-decoration: none; cursor: pointer; }
a.notif-item:hover { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.notif-item-unread { background: var(--color-accent-100); }
.notif-item-title { font-size: 13px; font-weight: 700; }
.notif-item-count { margin-left: var(--space-2); padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--color-text) 10%, transparent); }
.notif-item-body { font-size: 12px; color: color-mix(in srgb, var(--color-text) 70%, transparent); margin-top: 2px; }
.notif-popover-footer {
  display: block; padding: var(--space-2) var(--space-3); font-size: 12px; text-align: center;
  color: color-mix(in srgb, var(--color-text) 65%, transparent); text-decoration: none;
  border-top: 1px solid var(--color-divider);
}
.notif-popover-footer:hover { color: var(--color-accent); }

/* Live-Toast bei eingehendem Push, während die Seite offen ist (sw.js: postMessage) -- oben mittig
   statt in einer Ecke (Nutzervorgabe), damit er unabhängig von der Sprechblasen-Position auffällt. */
.toast-container {
  position: fixed; top: var(--space-4); left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; flex-direction: column; gap: var(--space-2);
  width: min(320px, calc(100vw - var(--space-4) * 2));
}
.toast {
  background: var(--color-surface); border: 1px solid var(--color-divider); border-left: 3px solid var(--color-accent);
  box-shadow: var(--shadow-lg); padding: var(--space-3);
}
.toast-title { font-size: 13px; font-weight: 700; }
.toast-body { font-size: 12px; color: color-mix(in srgb, var(--color-text) 70%, transparent); margin-top: 2px; }

/* OpenSky-Luftraum-Widget: Flugzeug-Icons statt Standard-Leaflet-Pins (opensky_widget_map.js:
   aircraftIcon). Selektor mit zwei Klassen nötig, um Leaflets eigene `.leaflet-div-icon`-Regel
   (weißer Kasten+Rand) zu schlagen, ohne auf !important angewiesen zu sein -- leaflet.css wird erst
   innerhalb des Widget-Partials geladen, also nach app.css im Dokument, und würde bei gleicher
   Spezifität sonst gewinnen. */
.leaflet-marker-icon.aircraft-marker { background: none; border: none; color: var(--color-accent-700); }

/* Flugbuch-Karte: pulsierendes "Blaulicht" für Einsätze, schlichter grüner Punkt für Übungen
   (incidents_map.js/incidents_widget_map.js: incidentMarker). Zwei-Klassen-Selektor aus demselben
   Grund wie .aircraft-marker oben (schlägt Leaflets `.leaflet-div-icon`-Box ohne !important). */
.leaflet-marker-icon.bluelight-marker-wrap { background: none; border: none; }
.bluelight-marker {
  display: block; width: 14px; height: 14px; margin: 1px; box-sizing: border-box;
  border-radius: 50%; background: #1a56db; border: 2px solid #fff;
  animation: bluelight-pulse 1.2s ease-out infinite;
}
@keyframes bluelight-pulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 86, 219, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(26, 86, 219, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 86, 219, 0); }
}

.app-content { padding: var(--space-6); flex: 1; overflow-y: auto; }

/* Unterseiten-Navigation für Bereiche mit eigenen Unterseiten (administration/_base.html,
   profile/_base.html) */
.subnav { display: flex; flex-wrap: wrap; column-gap: var(--space-4); row-gap: 4px; margin-bottom: var(--space-4); border-bottom: 2px solid var(--color-divider); }
.subnav-link { padding: var(--space-2) 0; font-size: 13px; color: color-mix(in srgb, var(--color-text) 65%, transparent); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.subnav-link:hover { color: var(--color-text); }
.subnav-link.is-active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

/* Sidebar-Fußzeile (Mein Profil/Abmelden), unten fixiert wie zuvor der Administration-Block */
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.perm-key { font-size: 11px; color: color-mix(in srgb, var(--color-text) 55%, transparent); margin-left: 4px; }
.sidebar-nav-footer { margin-top: auto; }
.sidebar-link-button {
  width: 100%; text-align: left; background: none; border: none; font: inherit; cursor: pointer;
}
/* Issue #65: „Rolle wechseln“ + Abmelde-Knopf in einer Zeile */
.sidebar-footer-row { display: flex; align-items: stretch; gap: 4px; }
.sidebar-footer-row form { display: flex; margin: 0; }
.sidebar-role-switch { flex: 1; min-width: 0; }
.sidebar-role-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-role-current { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout { width: auto; justify-content: center; padding-left: 10px; padding-right: 10px; }
.sidebar-logout-label { display: none; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-4); }
.dashboard-widget { grid-column: span 12; }
.widget-actions { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }

/* Dashboard-Editor: Drag & Drop (SortableJS) + Breiten-Control, app/static/js/dashboard-editor.js */
.dashboard-widget-hidden { opacity: .45; }
.dashboard-add-widget { display: flex; flex-direction: row; align-items: flex-end; gap: var(--space-3); max-width: 560px; margin-bottom: var(--space-4); }
.widget-drag-handle, .widget-width-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface);
  color: var(--color-text); padding: 4px 8px; font-size: 12px; cursor: pointer;
}
.widget-drag-handle { cursor: grab; touch-action: none; padding: 4px 6px; }
.widget-drag-handle:active { cursor: grabbing; }
.dash-sortable-ghost { opacity: .35; }
.dash-sortable-chosen { box-shadow: var(--shadow-md); }
.dash-sortable-drag { opacity: .9; }

.role-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.role-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); text-align: left; cursor: pointer; border: 2px solid transparent;
  color: var(--color-text); /* Issue #74: <button> erbt die Textfarbe nicht -- im Darkmode sonst schwarz */ }
.role-card:hover { border-color: var(--color-accent); }
.role-card-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--color-accent-100); color: var(--color-accent-800); display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-weight: 800; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.form-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }

@media (max-width: 760px) {
  /* Hebt den Desktop-Fixed-Viewport-Umbau oben bewusst wieder auf: die sticky-bottom-Tableiste
     unten (.sidebar) braucht echten Dokument-Scroll, um an der Stelle "stecken" zu bleiben --
     mit height:100vh+overflow:hidden auf .app-shell gäbe es keinen Scroll-Kontext dafür mehr. */
  .app-shell { flex-direction: column; height: auto; min-height: 100vh; overflow: visible; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; overflow-y: visible; position: sticky; bottom: 0; order: 2;
    border-right: none; border-top: 2px solid var(--color-divider); }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; }
  .app-content { padding: var(--space-4); overflow-y: visible; }
  .dashboard-widget { grid-column: span 12 !important; }
}

/* Flugaufzeichnungen (app/templates/flight_logs/detail.html) */
.flight-log-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--space-4); align-items: start; }
.flight-log-map { height: 60vh; min-height: 360px; border: 1px solid var(--color-divider); }
.flight-log-profile-svg { width: 100%; height: 140px; display: block; touch-action: none; }
.flight-log-profile-svg .axis { fill: none; stroke: var(--color-divider); stroke-width: 1; }
.flight-log-profile-svg text { font-size: 11px; fill: currentColor; opacity: 0.7; }
.flight-log-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 var(--space-4); }
.flight-log-facts dt { font-weight: 700; }
.flight-log-facts dd { margin: 0; }
.flight-log-warnings { margin: 0; padding-left: 1.2em; }
@media (max-width: 1000px) {
  .flight-log-layout { grid-template-columns: 1fr; }
  .flight-log-map { height: 50vh; }
}

/* Fach-Widgets des Dashboards (Templates unter modules/<modul>/ und dashboards/widgets/) */
.widget-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.widget-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.widget-list-unread { font-weight: 700; }
.widget-figure { display: block; font-family: var(--font-heading); font-weight: 800; font-size: 28px; line-height: 1.1; }
.widget-figure-alert { color: var(--color-accent); }
.widget-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.widget-stats > * { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.flight-log-widget-map { height: 220px; border: 1px solid var(--color-divider); margin-bottom: var(--space-2); }
/* Einzelne Links/Buttons am Ende eines Widgets: nicht über die ganze Breite ziehen (.card ist eine Flex-Spalte). */
.dashboard-widget > .btn { align-self: flex-start; }
/* Besatzung einer Flugaufzeichnung (flight_logs/_crew_form.html) */
.crew-rows { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.crew-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: center;
  padding-left: var(--space-2); border-left: 2px solid var(--color-divider); }
/* Funktion über die volle Breite, darunter Person + Entfernen -- passt auch in die schmale rechte Spalte. */
.crew-row input[name=crew_label] { grid-column: 1 / -1; }
.crew-form [data-crew-add] { align-self: flex-start; }

/* Mein Profil -> FireFlight-App (profile/app.html): zwei klar getrennte Anwendungen */
.app-intro { max-width: 760px; }
.app-choice-summary { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-bottom: var(--space-4); }
.app-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-4); align-items: start; }
.app-card { gap: var(--space-2); }
.app-card > .btn { align-self: flex-start; }
.app-link-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--color-divider); }
.app-link-box code { font-size: 14px; word-break: break-all; flex: 1 1 200px; }
.app-steps-title { font-size: 15px; margin: var(--space-3) 0 0; }
.app-steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.app-platform { border: 1px solid var(--color-divider); padding: var(--space-2) var(--space-3); }
.app-platform summary { cursor: pointer; font-weight: 700; }
.app-platform[open] summary { margin-bottom: var(--space-2); }
.app-platform.is-current-platform { border-color: var(--color-accent); }

/* --- Handy-Optimierung (Nutzerwunsch 2026-10-18), ergänzt den Media-Query weiter oben ------------- */
.mobile-only-icon, .sidebar-label-short { display: none; }
@media (max-width: 760px) {
  /* Untere Tab-Leiste: kompakte Tabs (Icon + kurzer Text), über Leaflet-Karten (deren Panes nutzen
     z-index bis 1000 und lagen sonst beim Scrollen über der Leiste). */
  .sidebar { z-index: 1100; padding: 4px; gap: 0; align-items: stretch; }
  .sidebar-nav { gap: 0; flex-wrap: nowrap; }
  .sidebar-nav-footer { margin-top: 0; border-left: 1px solid var(--color-divider); }
  .sidebar-nav-footer form { display: flex; }
  .sidebar-link, .sidebar-link-button { flex-direction: column; justify-content: center; gap: 2px; min-width: 66px;
    padding: 6px 8px; font-size: 11px; line-height: 1.2; text-align: center; white-space: nowrap; }
  .sidebar-link svg { width: 20px; height: 20px; }
  .mobile-only-icon { display: inline-flex; }
  .sidebar-label-long { display: none; }
  .sidebar-label-short { display: inline; }

  /* Kopfzeile: Titel darf umbrechen, Name wird gekürzt statt die Zeile zu sprengen. */
  .topbar { padding: var(--space-2) var(--space-4); gap: var(--space-2); flex-wrap: wrap; }
  /* Lange Titel deutsch trennen statt mitten im Wort umzubrechen (html lang="de") */
  .topbar-title { font-size: 17px; min-width: 0; flex: 1 1 140px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
  .topbar-actions { gap: var(--space-2); min-width: 0; }
  .topbar-user { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

  /* Tabellen scrollen in sich, statt die ganze Seite breiter als das Display zu machen. */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Issue #79: Tabellen ab 4 Spalten als gestapelte Karten (responsive_tables.js setzt data-label),
     statt Spalten seitlich abzuschneiden. */
  .table.table-stack { display: block; overflow: visible; }
  .table-stack thead { display: none; }
  .table-stack tbody, .table-stack tr { display: block; }
  .table-stack tr { padding: var(--space-2) 0; border-bottom: 1px solid var(--color-divider); }
  .table-stack td { display: block; padding: 3px var(--space-2); border-bottom: none;
    text-align: left !important; white-space: normal !important; overflow-wrap: anywhere; }
  .table-stack td[data-label]:not([data-label=""]) { display: grid; grid-template-columns: 36% minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
  .table-stack td[data-label]:not([data-label=""])::before { content: attr(data-label); font-size: 11px; letter-spacing: 0.06em;
    text-transform: uppercase; line-height: 1.3; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
  .table-stack td:empty { display: none; }
  .table-stack tr.table-stack-single td { display: block; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .page-header, .form-actions { flex-wrap: wrap; }
  .card { min-width: 0; }
}

/* Handy-Navigation: 4 Tabs + "Mehr" (nav.js). Ab dem 5. Eintrag sowie Profil/Vorschläge/Abmelden
   nur im aufgeklappten Panel -- vorher war die Leiste fast doppelt so breit wie das Display. */
.sidebar-more { display: none; }
@media (max-width: 760px) {
  .sidebar { overflow-x: visible; }
  .sidebar-nav { flex: 1; }
  .sidebar-nav .sidebar-link { flex: 1 1 0; min-width: 0; }
  .sidebar-label-short { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
  .sidebar-more { display: flex; border: none; background: none; color: inherit; font: inherit; font-size: 11px; cursor: pointer; }
  .sidebar:not(.is-expanded) .sidebar-nav:not(.sidebar-nav-footer) > a:nth-of-type(n+5),
  .sidebar:not(.is-expanded) .sidebar-nav-footer { display: none; }
  /* Liegt die aktuelle Seite hinter "Mehr", wird "Mehr" markiert. */
  .sidebar:not(.is-expanded):has(.sidebar-nav > a:nth-of-type(n+5).is-active, .sidebar-nav-footer .is-active) .sidebar-more {
    background: var(--color-accent-100); color: var(--color-accent-800); }
  .sidebar.is-expanded { flex-direction: column; box-shadow: 0 -8px 24px rgba(0, 0, 0, .18); }
  .sidebar.is-expanded .sidebar-nav { flex-wrap: wrap; }
  .sidebar.is-expanded .sidebar-nav .sidebar-link { flex: 0 0 25%; padding: 10px 4px; }
  .sidebar.is-expanded .sidebar-nav-footer { display: flex; border-left: none; border-top: 1px solid var(--color-divider); }
  .sidebar.is-expanded .sidebar-nav-footer form { flex: 0 0 25%; }
  .sidebar.is-expanded .sidebar-nav-footer form .sidebar-link { width: 100%; }
  .sidebar.is-expanded .sidebar-more { order: 99; }
  .sidebar.is-expanded .sidebar-nav-footer > * { flex: 0 0 25%; }
  /* Handy: Rollenwechsel und Abmelden als zwei eigene Kacheln im aufgeklappten Menü */
  .sidebar-footer-row { display: contents; }
  .sidebar.is-expanded .sidebar-nav-footer .sidebar-footer-row > * { flex: 0 0 25%; }
  .sidebar-role-current { display: none; }
  .sidebar-logout-label { display: inline; }
  .sidebar-logout { flex-direction: column; }
}
/* Flugbuch: Flugaufzeichnung nachträglich verknüpfen (incidents/flight_edit.html) */
.flight-log-link-form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); margin-top: var(--space-3); }
.flight-log-link-form .btn { margin-top: 22px; }
/* Einsatz-/Übungsdetail: Status + Abschließen direkt über dem Inhalt statt am rechten Bildschirmrand */
.incident-detail { max-width: 860px; }
.incident-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }


/* Wizard-Editor: Live-Vorschau im Format des DJI RC Plus (Issue #37). Maße in CSS-Pixeln wie am
   Gerät (1920 × 1200 px, Dichte 2,5): Statusleiste 24, Leiste links 64, Inhalt 704 × 440,
   Navigationsleiste 16. Der Rahmen wird per JS auf die Spaltenbreite skaliert. */
.wizard-editor-grid { display: grid; grid-template-columns: minmax(0, 640px) minmax(340px, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 1150px) { .wizard-editor-grid { grid-template-columns: minmax(0, 1fr); } }
.rc-preview { position: sticky; top: var(--space-3); margin-top: var(--space-4); }
.rc-preview-toolbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rc-preview-toolbar [data-rc-preview-label] { flex: 1; text-align: center; }
.rc-device-stage { width: 100%; overflow: hidden; }
.rc-device { width: 800px; padding: 16px; background: #1b1a1a; border-radius: 18px; transform-origin: top left; }
.rc-device-statusbar { height: 24px; display: flex; justify-content: space-between; align-items: center; padding: 0 10px;
  background: #b31f0a; color: #fff; font-size: 11px; }
.rc-device.is-night .rc-device-statusbar { background: #000; }
.rc-device-body { display: flex; height: 440px; }
.rc-device-rail { width: 64px; flex: none; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: 24px; padding-bottom: 14px; background: #f3f2f2; }
.rc-device-rail svg { width: 26px; height: 26px; fill: #201e1d; opacity: 0.75; }
.rc-device.is-night .rc-device-rail { background: #000; }
.rc-device.is-night .rc-device-rail svg { fill: #8c8585; }
.rc-device.is-night iframe { background: #000; }
.rc-device-rail svg[hidden] { display: none; }
.rc-device iframe { width: 704px; height: 440px; border: 0; background: #f3f2f2; display: block; }
.rc-device-navbar { height: 16px; background: #000; display: flex; justify-content: center; align-items: center; }
.rc-device-navbar span { width: 72px; height: 3px; border-radius: 2px; background: #d7d3d3; }
/* Nachbereitung + Chronologie (Issues #76/#78) */
.debrief-tabs { margin-bottom: var(--space-4); }
.debrief-section { margin-bottom: var(--space-6); scroll-margin-top: var(--space-4); }
.debrief-section h2 { font-size: 18px; margin: 0 0 var(--space-1); }
.debrief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--space-4); align-items: start; }
@media (max-width: 640px) { .debrief-grid { grid-template-columns: minmax(0, 1fr); } }
.compact-table td, .compact-table th { padding-top: 6px; padding-bottom: 6px; }
.debrief-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--space-2); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 105px; top: 0; bottom: 0; width: 2px; background: var(--color-divider); }
.timeline-day { font-weight: 700; margin: var(--space-3) 0 var(--space-1); padding-left: 124px; }
.timeline-item { display: flex; align-items: flex-start; gap: var(--space-3); padding: 6px 0; position: relative; }
.timeline-time { width: 88px; flex: none; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 4px; background: var(--color-surface); border: 2px solid var(--color-divider); position: relative; z-index: 1; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-start .timeline-dot, .timeline-landung .timeline-dot { border-color: var(--color-accent); background: var(--color-accent); }
.timeline-freigabe .timeline-dot { border-color: #1f9d45; background: #1f9d45; }
.timeline-anfrage .timeline-dot { border-color: #1f9d45; }
.timeline-technik .timeline-dot { border-color: #c98a00; background: #c98a00; }
.timeline-besatzung .timeline-dot { border-color: #3b7bd6; background: #3b7bd6; }

/* Statistik + PDF-Export (Issues #71/#72) */
.stat-filter { display: flex; flex-direction: row; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-4); }
.stat-filter .field { margin: 0; min-width: 160px; }
.stat-filter-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.stat-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.stat-head p { margin: 0; }
.stat-title { margin: 0; font-size: 20px; }
.stat-subtitle { margin: var(--space-4) 0 var(--space-2); font-size: 16px; }
.stat-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.stat-kpi { background: var(--color-surface); border: 1px solid var(--color-divider); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: 2px; }
.stat-kpi strong { font-size: 26px; color: var(--color-accent); font-variant-numeric: tabular-nums; }
.stat-kpi span { font-size: 13px; color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.flight-export-link { float: right; }
a.stat-kpi { color: inherit; text-decoration: none; }
a.stat-kpi:hover { border-color: var(--color-accent); }
.recon-section { margin-top: var(--space-6); }
.recon-section h2 { font-size: 17px; margin: 0 0 var(--space-1); }
.recon-section > p { margin: 0 0 var(--space-2); }

/* Qualifikationen (Issue #70) */
.qual-new { display: flex; gap: var(--space-2); align-items: flex-end; flex-wrap: wrap; margin: var(--space-3) 0; }
.qual-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-divider); }
.qual-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border-bottom: 1px solid var(--color-divider); flex-wrap: wrap; }
.qual-row.is-inactive strong { opacity: 0.6; }
.qual-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qual-meta { font-size: 13px; color: color-mix(in srgb, var(--color-text) 65%, transparent); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.qual-actions { display: flex; gap: var(--space-1); }
.qual-actions form { margin: 0; }
.qual-rename { display: flex; gap: var(--space-2); flex: 1; flex-wrap: wrap; }
.qual-rename .input { flex: 1; min-width: 180px; }
.back-link-row { margin: 0 0 var(--space-2); }

/* Hilfe (Issue #69) */
.help-hero { border: 1px solid var(--color-divider); border-left: 4px solid var(--color-accent); background: var(--color-surface);
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.help-hero-title { margin: 0 0 var(--space-1); font-size: 20px; }
.help-hero p { margin: 0; }
.help-search { margin-bottom: var(--space-4); }
.help-search .input { font-size: 16px; padding: 12px 14px; }
.help-search-info { margin: var(--space-1) 0 0; font-size: 13px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.help-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.help-toc { position: sticky; top: var(--space-3); }
.help-toc nav { display: flex; flex-direction: column; gap: 2px; }
.help-toc nav a { padding: 6px 10px; border-left: 3px solid transparent; color: inherit; text-decoration: none; font-size: 14px; }
.help-toc nav a:hover, .help-toc nav a.is-active { border-left-color: var(--color-accent); background: var(--color-accent-100); color: var(--color-accent-800); }
.help-section { border: 1px solid var(--color-divider); background: var(--color-surface); margin-bottom: var(--space-4); scroll-margin-top: var(--space-4); }
.help-section-head { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-divider); }
.help-section-head h2 { margin: 0 0 2px; font-size: 18px; }
.help-section-head p { margin: 0; }
.help-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  color: var(--color-accent); background: var(--color-accent-100); }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); padding: var(--space-4); }
.help-card { border: 1px solid var(--color-divider); background: var(--color-bg); padding: var(--space-3); min-width: 0; scroll-margin-top: var(--space-4); }
.help-card-wide { grid-column: 1 / -1; }
.help-card h3 { font-size: 15px; margin: 0 0 var(--space-2); }
.help-card p { margin: 0 0 var(--space-2); }
.help-card p:last-child, .help-card ul:last-child, .help-card ol:last-child { margin-bottom: 0; }
.help-card ul, .help-card ol { padding-left: 1.2em; margin: 0 0 var(--space-2); }
.help-card li + li { margin-top: 4px; }
.help-card ol.help-steps { list-style: none; counter-reset: step; padding-left: 0; }
.help-steps > li { counter-increment: step; position: relative; padding-left: 2em; }
.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 1.45em; height: 1.45em;
  border: 2px solid var(--color-accent); color: var(--color-accent); border-radius: 50%; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.help-card .ui { display: inline-block; padding: 0 6px; border: 1px solid var(--color-divider); background: var(--color-surface);
  font-size: 0.9em; font-weight: 600; white-space: nowrap; }
.help-card kbd { border: 1px solid var(--color-divider); padding: 0 5px; font-size: 0.9em; }
.help-note, .help-warn { border-left: 4px solid var(--color-accent); background: var(--color-accent-100); padding: var(--space-2) var(--space-3); }
.help-warn { border-left-color: #c98a00; background: color-mix(in srgb, #c98a00 12%, transparent); }
.help-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--space-3); font-size: 13px; }
.help-flow span { border: 1px solid var(--color-divider); background: var(--color-surface); padding: 4px 10px; font-weight: 600; }
mark.help-hl { background: color-mix(in srgb, #f2c230 55%, transparent); color: inherit; padding: 0 1px; }
.help-section.is-target, .help-card.is-target { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 980px) {
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-toc { position: static; }
  .help-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Profil → Darstellung (Issue #68) */
.theme-choice { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.theme-option { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-divider); cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.theme-option input { margin: 0; }
.theme-option strong { display: block; }
.theme-hint { display: block; font-size: 12px; }
.theme-swatch { flex: none; width: 36px; height: 24px; border: 1px solid var(--color-divider); }
.theme-swatch-light { background: #f3f2f2; }
.theme-swatch-dark { background: #201e1d; }
.theme-swatch-system { background: linear-gradient(135deg, #f3f2f2 50%, #201e1d 50%); }

/* Verwaltung → Dashboards (Issue #64) */
.dash-admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.dash-admin-head .field select { min-width: 240px; }
.dash-admin-note { margin: var(--space-2) 0 var(--space-4); font-size: 14px; }
.seg-tabs { display: inline-flex; border: 1px solid var(--color-divider); }
.seg-tab { padding: 8px 14px; font-size: 14px; font-weight: 600; color: inherit; text-decoration: none; }
.seg-tab + .seg-tab { border-left: 1px solid var(--color-divider); }
.seg-tab.is-active { background: var(--color-accent); color: #fff; }
.dash-preview { display: flex; flex-direction: column; gap: var(--space-2); }
.dash-preview iframe { width: 100%; height: 720px; border: 1px solid var(--color-divider); background: var(--color-bg); display: block; }

/* Verwaltung → Controller: Übersicht + Gerätekarten */
.rc-overview { align-items: center; }
.rc-overview p { margin: 0; }
.rc-overview-count { font-size: 18px; }
.rc-overview-meta { font-size: 14px; color: color-mix(in srgb, var(--color-text) 70%, transparent); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.rc-dot-online { background: #1f9d45; box-shadow: 0 0 0 3px color-mix(in srgb, #1f9d45 25%, transparent); }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.rc-card { display: flex; flex-direction: column; gap: var(--space-3); border-top: 3px solid var(--color-divider); margin: 0; }
.rc-card-online { border-top-color: #1f9d45; }
.rc-card-unpaired { border-top-color: #d9a400; }
.rc-card-disabled { opacity: 0.7; }
.rc-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.rc-card-title { font-size: 17px; margin: 0; overflow-wrap: anywhere; }
.rc-card-head .tag { white-space: nowrap; display: inline-flex; align-items: center; }
.rc-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-3); margin: 0; font-size: 14px; }
.rc-facts dt { color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.rc-facts dd { margin: 0; }
.rc-card-hint { margin: 0; font-size: 13px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.rc-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: auto; padding-top: var(--space-2);
  border-top: 1px solid var(--color-divider); }
.rc-card-actions form { margin: 0; }
.rc-card-actions .btn { padding-left: 6px; padding-right: 6px; }
.rc-bottom-grid { display: grid; grid-template-columns: minmax(0, 760px); gap: var(--space-4); margin-top: var(--space-6); }
.rc-device-form { max-width: 560px; }
.field-help { font-size: 13px; margin: 4px 0 0; }
.rc-steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: var(--space-2); }
.rc-steps code { overflow-wrap: anywhere; }
.rc-pair-fallback { margin-top: var(--space-3); }
.rc-pair-fallback summary { cursor: pointer; font-size: 14px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }

/* Taschenkarte verwalten (Issue #63): kompakte Liste + ein Editor */
.guide-help { margin: 0 0 var(--space-3); }
.guide-help summary { cursor: pointer; color: color-mix(in srgb, var(--color-text) 70%, transparent); font-size: 14px; }
.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-divider); }
.guide-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--color-divider); }
.guide-row:hover, .guide-row:focus-within { background: var(--color-surface); }
.guide-row.is-editing { background: var(--color-accent-100); box-shadow: inset 3px 0 0 var(--color-accent); }
.guide-row.is-inactive .guide-title { opacity: 0.6; }
.guide-pos { width: 2ch; text-align: right; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.guide-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.guide-title { font-weight: 600; overflow-wrap: anywhere; }
.guide-meta { font-size: 13px; color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.guide-actions { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; justify-content: flex-end; }
.guide-actions form { display: inline-flex; gap: 2px; margin: 0; }
.guide-actions .btn-icon { min-width: 36px; padding-left: 0; padding-right: 0; }
.guide-editor { scroll-margin-top: var(--space-4); }
.guide-steps { font-size: 15px; line-height: 1.6; }
@media (max-width: 640px) {
  .guide-row { flex-wrap: wrap; }
  .guide-actions { width: 100%; justify-content: flex-start; padding-left: calc(2ch + var(--space-3)); }
}

/* Taschenkarten-Vorschau (Issue #63): native PocketCardActivity nachgebildet, Vollbild 768 × 440 dp,
   Farben/Größen aus PocketCardActivity.kt (Tag: #F3F2F2/#EAE9E9/#201E1D/#EC3013, Nacht: #000/#0B0A0A/#8C8585/#B4513F) */
.pocket-screen { width: 768px; height: 440px; display: flex; flex-direction: column; background: #f3f2f2; color: #201e1d;
  font-family: Roboto, "Segoe UI", sans-serif; }
.pocket-header { display: flex; align-items: center; padding: 8px 16px 8px 12px; gap: 0; }
.pocket-back { color: #ec3013; font-size: 18px; padding: 8px 12px 8px 4px; white-space: nowrap; }
.pocket-title { font-size: 24px; font-weight: 700; padding: 0 16px 0 12px; white-space: nowrap; }
.pocket-search { flex: 1; min-width: 0; font: inherit; font-size: 18px; padding: 8px 12px; border: 0; border-bottom: 2px solid #ec3013;
  background: transparent; color: inherit; }
.pocket-stand { font-size: 14px; opacity: 0.7; padding-left: 16px; white-space: nowrap; }
.pocket-list { flex: 1; overflow-y: auto; padding: 0 16px 24px; position: relative; }
.pocket-card { background: #eae9e9; padding: 12px 16px 14px; margin-top: 12px; }
.pocket-card.is-focused { outline: 3px solid #ec3013; outline-offset: -3px; }
.pocket-card-title { font-size: 22px; font-weight: 700; color: #ec3013; }
.pocket-step { font-size: 20px; line-height: 1.2; padding-top: 6px; white-space: pre-wrap; }
.pocket-message { font-size: 18px; padding-top: 16px; margin: 0; }
.rc-device.is-night .pocket-screen { background: #000; color: #8c8585; }
.rc-device.is-night .pocket-card { background: #0b0a0a; }
.rc-device.is-night .pocket-card-title, .rc-device.is-night .pocket-back { color: #b4513f; }
.rc-device.is-night .pocket-search { border-bottom-color: #b4513f; }
.rc-device.is-night .pocket-card.is-focused { outline-color: #b4513f; }
tr[data-preview-row] { cursor: pointer; }
tr.is-previewed td { background: var(--color-accent-100); }

/* Zuletzt geöffneter Listeneintrag nach der Rückkehr (Issue #45, list_state.js): kurz hervorgehoben,
   zusätzlich als Text markiert -- nicht nur über Farbe erkennbar. */
.is-last-opened td, .is-last-opened { background: var(--color-accent-100); transition: background 0.6s; }
.is-last-opened td:first-child { box-shadow: inset 4px 0 0 var(--color-accent); }
.last-opened-marker { margin-left: 8px; font-size: 11px; padding: 1px 6px; border: 1px solid var(--color-accent); color: var(--color-accent-800); }

/* Hauptaktion direkt in der Listenzeile (Issue #46) */
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline; }

/* Formulare in benannte Abschnitte gliedern, Zusatzfelder einklappbar (Issue #47) */
.form-section { border: 0; padding: 0; margin: 0 0 var(--space-3); min-width: 0; }
.form-section > legend { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent);
  font-weight: 700; padding: 0; margin-bottom: var(--space-2); }
.form-more { margin: 0 0 var(--space-3); border-top: 1px solid var(--color-divider); padding-top: var(--space-2); }
.form-more > summary { cursor: pointer; font-weight: 700; padding: var(--space-1) 0; }
.form-more[open] > summary { margin-bottom: var(--space-2); }
.field-hint { margin: 4px 0 0; font-size: 12px; color: var(--color-accent-800); }

/* Fehler am Feld und als Zusammenfassung oben (Issue #48) -- Text + Rahmen, nicht nur Farbe. */
.field-error { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--color-danger-text); }
.field-error::before { content: "\26A0  "; }
.input[aria-invalid="true"] { border: 2px solid var(--color-danger-border); }
.error-summary ul { margin: var(--space-1) 0 0; padding-left: 1.2em; }
.error-summary a { color: inherit; }
.error-summary-note { margin: var(--space-1) 0 0; font-size: 12px; }

/* Einheitliche Statusdarstellung (Issue #49, app/core/status.py, docs/statusbegriffe.md):
   Farbe + Symbol + Text, damit die Bedeutung auch ohne Farbwahrnehmung erkennbar bleibt. */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; white-space: nowrap; }
.status-symbol { font-size: 11px; line-height: 1; }
.status-action { background: var(--color-accent-100); color: var(--color-accent-800); }
.status-active { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.status-waiting { background: #fdf0d1; color: #8a6400; }
.status-done { background: #dff3e3; color: #136128; }
.status-problem { border: 1px solid var(--color-accent); color: var(--color-accent-800); background: transparent; }
.status-inactive { border: 1px dashed var(--color-divider); color: var(--color-neutral-700); background: transparent; }
.status-next { display: inline-block; margin-left: var(--space-2); font-size: 12px; color: var(--color-text); opacity: 0.8; }

/* Detailseiten (Issue #50): Kerndaten kompakt oben, Lauftext etwas größer, Bearbeiten eingeklappt. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-3); margin: var(--space-2) 0; font-size: 14px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.detail-lead { font-size: 15px; white-space: pre-line; }
.detail-edit > summary { padding: 0; }

/* Tabellen (Issue #51): Zahlen rechtsbündig mit gleich breiten Ziffern, Spaltenköpfe bleiben beim
   Scrollen langer Listen sichtbar (.app-content ist der Scrollbereich). Auf schmalen Ansichten
   scrollt die Tabelle waagerecht (display:block) -- dort bleibt der Kopf ohnehin oben. */
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table thead th { position: sticky; top: calc(-1 * var(--space-6)); z-index: 2; background: var(--color-bg); box-shadow: inset 0 -2px 0 var(--color-divider); }

/* Einheitlicher Rückweg oben auf Detailseiten (Issue #53) */
.back-link { display: inline-block; margin-bottom: var(--space-2); font-size: 13px; font-weight: 600; color: var(--color-accent); text-decoration: none; }
.back-link:hover, .back-link:focus-visible { text-decoration: underline; }

/* Tablets (Issue #54): Nebenspalten ausblenden, damit Kerndaten, Status und Aktion ohne waagerechtes
   Scrollen sichtbar bleiben (alles steht weiter in der Detailansicht). Datum/Zahlen brechen nicht um.
   Auf Touch-Geräten mindestens 44 px große Ziele für Zeilenaktionen. */
.table .nowrap, .table td.num { white-space: nowrap; }
@media (max-width: 1100px) {
  .table .col-optional { display: none; }
}
@media (pointer: coarse) {
  .row-actions .btn, .back-link { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Gesperrte Aktionen (Issue #55): Grund + nächster Schritt direkt an der Stelle */
.lock-hint { display: block; margin: var(--space-2) 0; padding: 6px 10px; font-size: 13px; border-left: 3px solid var(--color-divider); color: var(--color-text); opacity: 0.85; }
.lock-hint::before { content: "🔒 "; }

/* Ladezustände (Issue #56): schmaler Balken oben, über dem Inhalt (verschiebt nichts); Fehlerhinweis
   als Einblendung unten, der bisherige Inhalt bleibt stehen. */
.page-loading { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; opacity: 0; background: linear-gradient(90deg, transparent 0%, var(--color-accent) 40%, var(--color-accent) 60%, transparent 100%); background-size: 50% 100%; background-repeat: no-repeat; transition: opacity 0.15s; }
.page-loading.is-active { opacity: 1; animation: page-loading-slide 1.1s linear infinite; }
@keyframes page-loading-slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (prefers-reduced-motion: reduce) { .page-loading.is-active { animation: none; background-size: 100% 100%; } }
.load-error { position: fixed; left: 50%; bottom: var(--space-4); transform: translateX(-50%); z-index: 1000; max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px; background: var(--color-text); color: var(--color-bg); font-size: 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
.processing-note { font-size: 13px; opacity: 0.8; }

/* Angemeldete Geräte im Profil (Audit #83) */
.session-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.session-list li { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-divider); }
.session-list li:last-child { border-bottom: none; }

/* Checklisten (Issue #97): Durchlauf am Controller und Nachweis am Flug */
.checklist-step-title { font-size: 20px; }
.checklist-actions { flex-direction: row-reverse; justify-content: space-between; margin-top: var(--space-4); }
.checklist-location-buttons { display: flex; gap: var(--space-2); }
.checklist-location-buttons .btn { flex: 1; padding-inline: var(--space-2); }
.checklist-location-feedback { margin: var(--space-2) 0 0; }
.checklist-location-map { height: 130px; border: 1px solid var(--color-divider); margin-top: var(--space-2); }
.checklist-run-record + .checklist-run-record { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-divider); }
.checklist-run-title { font-size: 15px; margin: 0 0 var(--space-1); }
.checklist-versions { margin-top: var(--space-2); }
.checklist-versions ul { margin: var(--space-2) 0 0; padding-left: 1.2em; }

/* --- Checklisten-Builder (Issue #98) --------------------------------------------------------------- */
.checklist-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.checklist-filter .input { width: auto; }
/* Flex nur im Inhalt -- auf der <td> selbst würde die Zelle aus dem Tabellenlayout fallen */
.checklist-row-actions { display: flex; flex-wrap: wrap; gap: 0 var(--space-2); }
.checklist-row-actions form { display: inline; }
.checklist-actions-cell { min-width: 120px; }
.checklist-status-cell .text-muted { font-size: 13px; }
@media (max-width: 1400px) { .checklist-table .col-author { display: none; } }
.builder-header { align-items: flex-start; }
.builder-header-info { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.builder-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.builder-status .is-error { color: var(--color-accent-700); }
.builder-usage { margin: 0; font-size: 13px; }
.builder-header-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.builder-header-actions form { display: inline; }
.builder { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: var(--space-4); align-items: start; }
.builder.is-readonly { grid-template-columns: minmax(0, 1fr) 320px; }
.builder-library, .builder-props { position: sticky; top: var(--space-3); max-height: calc(100vh - 140px); overflow-y: auto; }
.builder-hint { font-size: 13px; margin: 0 0 var(--space-2); }
.builder-library-list { display: flex; flex-direction: column; gap: var(--space-2); }
.builder-library-item { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2);
  border: 1px solid var(--color-divider); background: var(--color-bg); color: var(--color-text); text-align: left;
  font: inherit; cursor: grab; }
.builder-library-item:hover, .builder-library-item:focus-visible { border-color: var(--color-accent); }
.builder-library-text { display: flex; flex-direction: column; min-width: 0; }
.builder-library-text small { font-size: 12px; color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.builder-icon { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-accent-100); color: var(--color-accent-700); font-weight: 700; }
.builder-canvas { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.builder-canvas > div { display: flex; flex-direction: column; gap: var(--space-4); }
.builder-step { outline: 2px solid transparent; outline-offset: 2px; }
.builder-step.is-selected { outline-color: var(--color-accent); }
.builder-step-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; cursor: pointer; }
.builder-step-title { font-size: 18px; margin: 0; flex: 1 1 160px; min-width: 0; }
.builder-handle { cursor: grab; color: color-mix(in srgb, var(--color-text) 55%, transparent); user-select: none; }
.builder-tools { display: inline-flex; gap: 2px; margin-left: auto; }
.builder-tools .btn { min-width: 32px; }
.builder-step-body { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); min-height: 48px; }
.builder-element { border: 1px dashed var(--color-divider); padding: var(--space-2); background: var(--color-bg); cursor: pointer; }
.builder-element:hover { border-style: solid; }
.builder-element.is-selected { border: 2px solid var(--color-accent); padding: calc(var(--space-2) - 1px); }
.builder-element:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.builder-element-bar { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; margin-bottom: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.builder-element-type { font-weight: 600; }
.builder-element-preview { pointer-events: none; }
.builder-element-preview .card-body { margin: 0; }
.builder-drop-hint { margin: 0; padding: var(--space-3); border: 1px dashed var(--color-divider); text-align: center; font-size: 13px; }
.builder-drop-indicator { height: 4px; background: var(--color-accent); flex: none; }
.builder.is-dragging .builder-step-body { background: color-mix(in srgb, var(--color-accent) 5%, transparent); }
.builder-add-step { align-self: flex-start; }
.builder-empty { text-align: center; }
.builder-props-section { margin-top: var(--space-3); }
.builder-props-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0; }
.builder-bool { margin: var(--space-2) 0; }
.builder-danger { color: var(--color-accent-700); }
.builder-test-dialog { width: min(880px, 96vw); border: none; padding: var(--space-4); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); }
.builder-test-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.builder-test-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); flex-wrap: wrap; }
.builder-test-head .card-title { margin: 0; flex: 1; }
.checklist-test-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 5; width: min(480px, 100%); padding: 4px var(--space-2);
  background: #fdf0d1; color: #8a6400; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-align: center; }
@media (max-width: 1100px) {
  .builder, .builder.is-readonly { grid-template-columns: minmax(0, 1fr); }
  .builder-library, .builder-props { position: static; max-height: none; }
  .builder-library-list { flex-direction: row; flex-wrap: wrap; }
  .builder-library-item { width: auto; }
}

/* --- Checklisten-Bausteine (Issue #99) ------------------------------------------------------------ */
.checklist-element { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-2) 0; }
.checklist-element[hidden] { display: none; }
.checklist-label { margin: 0; font-weight: 600; }
.checklist-required { display: none; color: var(--color-accent); }
.checklist-element.is-required > .checklist-label .checklist-required { display: inline; }
.checklist-critical-mark { color: var(--color-accent-700); }
.checklist-element.is-critical { border-left: 3px solid var(--color-accent); padding-left: var(--space-2); }
.checklist-element.is-disabled { opacity: 0.6; }
.checklist-description { margin: 0; font-size: 13px; }
.checklist-choice-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.checklist-choice-button { flex: 1 1 96px; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-divider);
  background: var(--color-bg); color: var(--color-text); font: inherit; font-weight: 600; cursor: pointer; }
.checklist-choice-button[aria-checked="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.checklist-choice-button.tone-good[aria-checked="true"] { background: #1f7a3a; border-color: #1f7a3a; color: #fff; }
.checklist-choice-button.tone-mid[aria-checked="true"] { background: #b07c00; border-color: #b07c00; color: #fff; }
.checklist-choice-button.tone-bad[aria-checked="true"] { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.checklist-unit { display: flex; align-items: center; gap: var(--space-2); }
.checklist-unit .input { max-width: 180px; }
.checklist-slider { display: flex; align-items: center; gap: var(--space-3); }
.checklist-slider input[type=range] { flex: 1; min-height: 32px; }
.checklist-slider-value { min-width: 72px; font-weight: 600; }
.checklist-signature-box { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.checklist-signature { width: 100%; max-width: 560px; height: auto; aspect-ratio: 560 / 180; background: #fff;
  border: 1px solid var(--color-divider); touch-action: none; }
.checklist-heading { margin: var(--space-2) 0 0; }
.checklist-h3 { font-size: 17px; }
.checklist-h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.checklist-notice { display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-left: 4px solid; }
.checklist-notice p { margin: 2px 0 0; }
.checklist-notice.tone-info { background: color-mix(in srgb, #2a6bd1 10%, transparent); border-color: #2a6bd1; }
.checklist-notice.tone-hint { background: color-mix(in srgb, var(--color-text) 6%, transparent); border-color: var(--color-divider); }
.checklist-notice.tone-warning { background: #fdf0d1; border-color: #b07c00; color: #5b4100; }
.checklist-notice.tone-danger { background: var(--color-accent-100); border-color: var(--color-accent); color: var(--color-accent-800); font-weight: 600; }
.checklist-notice-icon { font-size: 18px; line-height: 1.2; }
.checklist-divider { border: none; border-top: 1px solid var(--color-divider); margin: var(--space-3) 0; width: 100%; }
.checklist-container { border: 1px solid var(--color-divider); padding: var(--space-2) var(--space-3); }
.checklist-container > summary { cursor: pointer; font-weight: 700; padding: var(--space-1) 0; }
.checklist-columns { display: grid; gap: var(--space-3); }
.checklist-columns.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checklist-columns.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checklist-progress { height: 8px; background: color-mix(in srgb, var(--color-text) 12%, transparent); }
.checklist-progress > span { display: block; height: 100%; width: 0; background: var(--color-accent); transition: width .2s; }
.checklist-progress-label { font-size: 13px; }
.checklist-result { padding: var(--space-2) var(--space-3); font-weight: 700; }
.checklist-result.is-passed { background: #dff3e3; color: #136128; }
.checklist-result.is-failed { background: var(--color-accent); color: #fff; }
.checklist-failed-banner { padding: var(--space-2) var(--space-3); background: var(--color-accent); color: #fff; font-weight: 700; margin: var(--space-2) 0; }
.checklist-element-messages:empty { display: none; }
.checklist-warning { margin: 0; color: #8a6400; font-weight: 600; }
.checklist-failure { margin: 0; color: var(--color-accent-700); font-weight: 700; }
.checklist-skip-row { display: flex; justify-content: flex-end; }
.checklist-comment-box.is-required .checklist-comment { border-color: var(--color-accent); }
.checklist-findings { margin: 0 0 var(--space-2); padding-left: 0; list-style: none; color: var(--color-accent-800); }
@media (max-width: 640px) {
  .checklist-columns.cols-2, .checklist-columns.cols-3 { grid-template-columns: minmax(0, 1fr); }
}
:root[data-theme="dark"] .checklist-notice.tone-warning { background: #3a2f12; color: #f5d98f; }

/* Checklisten-Builder Stufe 3 (Issue #99): Gruppen, Abschnitte/Spalten, Regeleditor */
.builder-library-group { margin: var(--space-2) 0 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.builder-drop-zone { display: flex; flex-direction: column; gap: var(--space-2); min-height: 40px; }
.builder.is-dragging .builder-drop-zone { background: color-mix(in srgb, var(--color-accent) 5%, transparent); }
.builder-container { border-left: 3px solid var(--color-divider); padding-left: var(--space-2); }
.builder-container-title { margin: 0 0 var(--space-2); font-weight: 600; }
.builder-columns { display: grid; gap: var(--space-2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.builder-columns.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.builder-column { border: 1px dotted var(--color-divider); padding: var(--space-1); }
.builder-props-group { border-top: 1px solid var(--color-divider); padding: var(--space-2) 0; }
.builder-props-group > summary { cursor: pointer; font-weight: 600; margin-bottom: var(--space-2); }
.builder-multichoice { display: flex; flex-direction: column; gap: 2px; }
.builder-rules { display: flex; flex-direction: column; gap: var(--space-3); }
.builder-rule { border: 1px solid var(--color-divider); padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); }
.builder-rule-title { display: flex; align-items: center; justify-content: space-between; margin: 0; }
.builder-rule-group { display: flex; flex-direction: column; gap: var(--space-2); }
.builder-rule-group.is-nested { border-left: 3px solid var(--color-accent); padding-left: var(--space-2); }
.builder-rule-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 13px; }
.builder-rule-line .input { width: auto; flex: 1 1 140px; }
.builder-rule-condition, .builder-rule-action { display: grid; gap: var(--space-1); grid-template-columns: minmax(0, 1fr) auto; }
.builder-rule-condition > .input, .builder-rule-action > .input, .builder-rule-value { grid-column: 1; }
.builder-rule-condition > .btn, .builder-rule-action > .btn { grid-column: 2; grid-row: 1; }
.builder-rule-value { display: flex; flex-direction: column; gap: var(--space-1); }
.builder-rule-value:empty { display: none; }
@media (max-width: 720px) { .builder-columns, .builder-columns.cols-3 { grid-template-columns: 1fr; } }

/* Checklisten Stufe 4 (Issue #100): Wiederholungen, Berechnungen, Variablen */
.checklist-repeat { display: flex; flex-direction: column; gap: var(--space-2); }
.checklist-repeat-item { border: 1px solid var(--color-divider); padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); }
.checklist-repeat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.checklist-repeat-add { align-self: flex-start; }
.checklist-calculated { margin: 0; font-size: 16px; }
.builder-container.is-repeat { border-left-color: var(--color-accent); }
.builder-variable { display: grid; gap: var(--space-1); grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.builder-variable > .input:nth-child(3) { grid-column: 1; }
.builder-variable > .btn { grid-column: 2; }
.builder-formula { font-family: ui-monospace, Consolas, monospace; }

/* Checklisten Stufe 5 (Issue #101): Ereignisse */
.checklist-event-notices { display: flex; flex-direction: column; gap: var(--space-2); }
.checklist-event-notices:empty { display: none; }
.builder-event-action { display: flex; flex-direction: column; gap: var(--space-1); border-left: 3px solid var(--color-divider); padding-left: var(--space-2); }
.builder-event-field { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }

/* Prüf-Checkliste (Issue #102) */
.inspection-checklist .checklist-step { box-shadow: none; }
.inspection-checklist-proof { margin-top: var(--space-1); font-size: 13px; }
.inspection-checklist-proof dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px var(--space-2); margin: var(--space-1) 0 0; }
.inspection-checklist-proof dt { font-weight: 600; }
.inspection-checklist-proof dd { margin: 0; }

/* Checklisten im Nachtmodus des Controllers (auch Builder-Testmodus und Offline-Seite der App):
   keine hellen Flächen, gedimmte Signalfarben */
.rc-night .checklist-choice-button.tone-good[aria-checked="true"] { background: #0f2e17; border-color: #1f5a2e; color: #7fa88a; }
.rc-night .checklist-choice-button.tone-mid[aria-checked="true"] { background: #2e2200; border-color: #5c4600; color: #a88a4a; }
.rc-night .checklist-choice-button.tone-bad[aria-checked="true"],
.rc-night .checklist-result.is-failed,
.rc-night .checklist-failed-banner { color: #d0b8b3; }
.rc-night .checklist-notice.tone-info { background: #070d18; border-color: #1e3a66; color: var(--color-text); }
.rc-night .checklist-notice.tone-warning { background: #1a1405; border-color: #5c4600; color: #a88a4a; }
.rc-night .checklist-result.is-passed { background: #0a1a0f; color: #6f9c7b; }
.rc-night .checklist-warning { color: #a88a4a; }
.rc-night .checklist-signature { filter: invert(0.9) brightness(0.6); }
.rc-night .checklist-test-banner { background: #1a1405; color: #a88a4a; }
.rc-night .checklist-repeat-item { background: var(--color-surface); }

/* Builder übersichtlicher: kompakte Bibliothek, einklappbare Schritte */
.builder-library-search { margin: var(--space-2) 0; }
.builder-library .builder-hint { display: none; }
.builder-library-list { gap: var(--space-1); }
.builder-library-list > details.builder-library-group { margin: 0; font-size: inherit; font-weight: inherit; text-transform: none; letter-spacing: 0; color: inherit; }
.builder-library-group > summary { cursor: pointer; padding: var(--space-1) 0; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.builder-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: var(--space-2); }
.builder-library-grid .builder-library-item { flex-direction: row; align-items: center; gap: 6px; padding: 4px 6px; min-height: 34px; }
.builder-library-grid .builder-icon { width: 22px; height: 22px; font-size: 12px; }
.builder-library-label { font-size: 12px; font-weight: 600; line-height: 1.15; min-width: 0; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; hyphens: auto; overflow-wrap: break-word; }
.builder-canvas-tools { display: flex; justify-content: flex-end; margin-bottom: calc(var(--space-2) * -1); }
.builder-collapse { min-width: 28px; padding-inline: 4px; }
.builder-step.is-collapsed .builder-step-head { margin-bottom: 0; }
.builder-step-collapsed { margin: var(--space-1) 0 0; font-size: 13px; }

/* Checklisten exportieren/importieren */
.checklist-header-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; }
.checklist-import { position: relative; }
.checklist-import > summary { list-style: none; }
.checklist-import > summary::-webkit-details-marker { display: none; }
.checklist-import-form { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; width: min(360px, 90vw);
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); }
.help-table td { vertical-align: top; }

/* DJI Cloud: Drohnen live (Issue #104) */
.dji-live { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-bottom: var(--space-4); }
.dji-live-cards { display: flex; flex-direction: column; gap: var(--space-3); }
.dji-live-map { height: 60vh; min-height: 320px; border: 1px solid var(--color-divider); }
.dji-card.is-online { border-left: 4px solid #1f7a3a; }
.dji-card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.dji-card-sub { margin: 2px 0 var(--space-2); font-size: 13px; }
.dji-values { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-3); margin: 0; }
.dji-values dt { color: color-mix(in srgb, var(--color-text) 65%, transparent); }
.dji-values dd { margin: 0; font-weight: 600; }
.dji-aircraft-marker span { display: block; width: 28px; height: 28px; line-height: 28px; text-align: center; font-size: 20px;
  color: var(--color-accent); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.dji-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-3); }
.dji-facts dd { margin: 0; }
.dji-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.dji-setup .card { display: flex; flex-direction: column; gap: var(--space-2); }
.dji-steps { padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--space-2); }
.dji-pilot-url { margin-top: var(--space-1); font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.dji-pilot-card { width: min(480px, 92vw); display: flex; flex-direction: column; gap: var(--space-2); }
.dji-pilot-title { margin: 0; font-size: 22px; }
.dji-pilot-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.dji-pilot-steps li::before { content: "○ "; }
.dji-pilot-steps li.is-done::before { content: "✓ "; color: #1f7a3a; }
.dji-pilot-steps li.is-failed::before { content: "✕ "; color: var(--color-accent-700); }
.dji-pilot-status { font-weight: 600; }
.dji-pilot-status.is-error { color: var(--color-accent-700); }
.dji-pilot-hint { font-size: 13px; }
@media (max-width: 900px) { .dji-live, .dji-setup { grid-template-columns: 1fr; } }
.dji-guide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.dji-guide-toc { position: sticky; top: var(--space-3); display: flex; flex-direction: column; gap: 4px; }
.dji-guide-toc a { padding: 4px 8px; border-left: 3px solid transparent; text-decoration: none; color: inherit; font-size: 14px; }
.dji-guide-toc a:hover { border-left-color: var(--color-accent); background: var(--color-accent-100); }
.dji-guide-state { margin-top: var(--space-2); font-size: 13px; }
.dji-guide-main { display: flex; flex-direction: column; gap: var(--space-3); }
.dji-guide-main section { scroll-margin-top: var(--space-4); }
.dji-guide-main h2 { margin: 0 0 var(--space-2); font-size: 18px; }
.dji-guide-flow, .dji-guide-code { background: color-mix(in srgb, var(--color-text) 8%, transparent); color: var(--color-text);
  border: 1px solid var(--color-divider); padding: var(--space-2) var(--space-3); overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; white-space: pre; }
.dji-guide-table td { vertical-align: top; }
@media (max-width: 900px) { .dji-guide { grid-template-columns: 1fr; } .dji-guide-toc { position: static; } }
.dji-section-title { font-size: 18px; margin: var(--space-4) 0 var(--space-2); }
.nav-badge { display: inline-block; margin-left: 6px; padding: 0 5px; font-size: 10px; font-weight: 700; line-height: 16px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--color-accent-800); background: var(--color-accent-100);
  border: 1px solid color-mix(in srgb, var(--color-accent) 40%, transparent); vertical-align: middle; }
.dji-flight { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .dji-flight { grid-template-columns: 1fr; } }
.dji-flight-logbook { grid-column: 1 / -1; }
.dji-assign { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.dji-assign .input { flex: 1 1 280px; width: auto; }
/* Livestream (Issue #107) */
.dji-live-right { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.dji-stream { display: flex; flex-direction: column; gap: var(--space-2); }
.dji-stream-video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.dji-stream-status { margin: 0; font-weight: 600; }
.dji-stream-status.is-error { color: var(--color-accent-700); }
.dji-stream-controls { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.dji-stream-controls .input { width: auto; flex: 1 1 160px; }
.dji-stream-lenses { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.dji-stream-open { margin-top: var(--space-2); }
.dji-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.dji-checks li::before { margin-right: 6px; font-weight: 700; }
.dji-checks li.is-ok::before { content: "✓"; color: #1f7a3a; }
.dji-checks li.is-warn::before { content: "!"; color: #b07c00; }
.dji-checks li.is-fail::before { content: "✕"; color: var(--color-accent-700); }
.dji-pilot-report { margin: var(--space-2) 0 0; font-size: 14px; }
/* Fotos & Videos aus Pilot 2 (Issue #108) */
.dji-media-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.dji-media-filter .input { flex: 1 1 200px; width: auto; }
.dji-media-grid { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.dji-media-item { display: flex; flex-direction: column; border: 1px solid var(--color-divider); background: var(--color-surface); min-width: 0; }
.dji-media-thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3;
  background: color-mix(in srgb, var(--color-text) 10%, transparent); overflow: hidden; text-decoration: none; color: var(--color-text); }
.dji-media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dji-media-icon { font-size: 40px; opacity: 0.6; }
.dji-media-lens { position: absolute; top: 6px; left: 6px; }
.dji-media-meta { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2); font-size: 13px; min-width: 0; }
.dji-media-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dji-media-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.dji-media-manage summary { cursor: pointer; }
.dji-media-manage form { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.dji-media-manage .input { flex: 1 1 140px; width: auto; }
.dji-flight-media { grid-column: 1 / -1; }
@media (max-width: 760px) { .dji-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); } }
/* Dashboard-Kacheln der DJI-Anbindung (Issue #109) */
.dji-widget-summary { margin: 0 0 var(--space-2); font-size: 13px; }
.dji-widget-map { height: 260px; border: 1px solid var(--color-divider); }
.dji-widget-map-state { margin: var(--space-1) 0 0; font-size: 13px; }
.dji-widget-media { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: var(--space-2);
  grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 12px; }
.dji-widget-media li { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dji-widget-media a { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3;
  background: color-mix(in srgb, var(--color-text) 10%, transparent); overflow: hidden; text-decoration: none; color: var(--color-text); font-size: 24px; }
.dji-widget-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dji-widget-media .tag { position: absolute; top: 4px; left: 4px; font-size: 10px; }
.dji-dashboard-plan { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); font-size: 14px; }
.dji-dashboard-plan li > span { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.dji-flight-filter { margin: 0 0 var(--space-2); }
