/* Sortierbare Routen-Spaltenköpfe (Listenansicht) */
.route-th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.route-th-sort:hover { color: var(--primary); }
.route-th-sort-active { color: var(--primary); }
.route-sort-arrow { font-size: .8em; }

/* ── Toast (einheitliches, selbstverschwindendes Aktions-Feedback) ──── */
.toast-host { position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 500;
  background: var(--ink); color: var(--surface); box-shadow: 0 6px 20px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 320px; }
.toast--in { opacity: 1; transform: translateY(0); }
.toast--ok  { background: var(--green); color: #fff; }
.toast--err { background: var(--red); color: #fff; }
.toast--warn { background: var(--amber, #d98a00); color: #fff; }

/* ── Design Tokens ─────────────────────────────────────────────────── */
:root {
  /* ── Neutrals „Mauve" (Light) ─────────────────────────────── */
  --bg:        oklch(98.8% 0.003 300);
  --surface:   oklch(100%  0     0);
  --surface-2: oklch(97.2% 0.004 300);
  --surface-3: oklch(95.0% 0.005 300);

  --ink:   oklch(22% 0.012 300);
  --ink-2: oklch(38% 0.011 300);
  --muted: oklch(52% 0.010 300);
  --faint: oklch(64% 0.009 300);

  --border:        oklch(91% 0.005 300);
  --border-strong: oklch(85% 0.007 300);

  /* ── Akzent Marine/Navy ───────────────────────────────────── */
  --primary:        oklch(45% 0.10 255);
  --primary-hover:  oklch(40% 0.10 255);
  --primary-active: oklch(35% 0.10 255);
  --primary-fg:     oklch(99% 0 0);
  --primary-tint:   oklch(95% 0.03 255);

  /* ── Status ───────────────────────────────────────────────── */
  --success:      oklch(58% 0.13 155);  --success-tint: oklch(95% 0.03 155);
  --danger:       oklch(58% 0.17 27);   --danger-tint:  oklch(95% 0.035 27);
  --warning:      oklch(70% 0.14 70);   --warning-tint: oklch(95% 0.04 80);

  /* ── Wellenfarben A–D (auf neue Sättigung abgestimmt) ─────── */
  --wave-a: oklch(60% 0.12 35);
  --wave-b: oklch(60% 0.12 155);
  --wave-c: oklch(58% 0.12 255);
  --wave-d: oklch(58% 0.12 305);

  /* ── Radien / Schatten / Ring ─────────────────────────────── */
  --radius:    8px;
  --radius-sm:  6px;
  --radius-lg: 12px;
  --shadow-sm:  0 1px 2px oklch(25% 0.02 300 / .06), 0 1px 1px oklch(25% 0.02 300 / .04);
  --shadow-pop: 0 8px 24px oklch(25% 0.02 300 / .12), 0 2px 6px oklch(25% 0.02 300 / .08);
  --ring:        oklch(45% 0.10 255);
  --ring-offset: var(--surface);

  /* ── Spacing-Skala (4px-Basis) ────────────────────────────── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* ── Typografie ───────────────────────────────────────────── */
  --font-sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-size-base: 14px; /* overridden by applyAppearance() */
  --app-zoom: 1;

  /* ── Motion ───────────────────────────────────────────────── */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur-fast: 120ms;
  --dur-base: 180ms;

  --slot-blocked-bg: oklch(35% 0.02 300);   /* dunkle "gesperrt"-Zelle, theme-unabhängig */

  /* ── Aliase auf Alt-Namen (nicht-brechend) ────────────────── */
  --accent:        var(--primary);
  --accent-strong: var(--primary-active);
  --blue:          var(--primary);
  --secondary:      var(--warning);
  --secondary-ink:  var(--warning);
  --secondary-tint: var(--warning-tint);
  --green:      var(--success);   --green-tint: var(--success-tint);
  --red:        var(--danger);    --red-tint:   var(--danger-tint);
  --primary-ink:  var(--primary-active);
  --sidebar-bg:    var(--surface); /* was dark — now resolves to surface */
  --surface-soft:  var(--surface-2);
  --text-muted:    var(--muted);

  /* Slots/Chancen legacy tokens → Tower tokens (theme-aware).
     Diese wurden bisher nur mit hartkodierten Hex-Fallbacks referenziert und
     ignorierten daher ALLE Themes (im Slate-Dark sichtbar kaputt). Einmal hier
     definiert greifen sie überall in slots.js/opportunities.js theme-korrekt. */
  --nav:            var(--primary);
  --action:         var(--primary);
  --action-bright:  var(--secondary);
  --card:           var(--surface);
  --line:   var(--border);
  --line-2: var(--border-strong);
  --ink-soft:       var(--muted);
  --ok:             var(--green);
  --slot-own-border: var(--primary);

  /* Shadow */
  --shadow: var(--shadow-sm);
}

/* ── Themes ─────────────────────────────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:        oklch(17% 0.008 300);
  --surface:   oklch(20% 0.009 300);
  --surface-2: oklch(23% 0.010 300);
  --surface-3: oklch(26% 0.011 300);

  --ink:   oklch(96% 0.004 300);
  --ink-2: oklch(82% 0.006 300);
  --muted: oklch(66% 0.008 300);
  --faint: oklch(54% 0.008 300);

  --border:        oklch(30% 0.010 300);
  --border-strong: oklch(38% 0.012 300);

  --primary:        oklch(64% 0.11 255);
  --primary-hover:  oklch(70% 0.11 255);
  --primary-active: oklch(58% 0.11 255);
  --primary-fg:     oklch(16% 0.02 260);
  --primary-tint:   oklch(30% 0.05 255);

  --success: oklch(66% 0.13 155); --success-tint: oklch(28% 0.05 155);
  --danger:  oklch(66% 0.16 27);  --danger-tint:  oklch(28% 0.06 27);
  --warning: oklch(76% 0.14 70);  --warning-tint: oklch(30% 0.06 80);

  --shadow-sm:  0 1px 2px oklch(0% 0 0 / .30), 0 1px 1px oklch(0% 0 0 / .24);
  --shadow-pop: 0 10px 28px oklch(0% 0 0 / .45), 0 2px 8px oklch(0% 0 0 / .35);
  --ring: oklch(64% 0.11 255);
  --ring-offset: var(--surface);
  --slot-blocked-bg: oklch(28% 0.02 300);
}

/* „System": folgt der OS-Einstellung, wenn kein data-theme gesetzt ist. */
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg:        oklch(17% 0.008 300);
    --surface:   oklch(20% 0.009 300);
    --surface-2: oklch(23% 0.010 300);
    --surface-3: oklch(26% 0.011 300);
    --ink:   oklch(96% 0.004 300);  --ink-2: oklch(82% 0.006 300);
    --muted: oklch(66% 0.008 300);  --faint: oklch(54% 0.008 300);
    --border: oklch(30% 0.010 300); --border-strong: oklch(38% 0.012 300);
    --primary: oklch(64% 0.11 255); --primary-hover: oklch(70% 0.11 255);
    --primary-active: oklch(58% 0.11 255); --primary-fg: oklch(16% 0.02 260);
    --primary-tint: oklch(30% 0.05 255);
    --success: oklch(66% 0.13 155); --success-tint: oklch(28% 0.05 155);
    --danger: oklch(66% 0.16 27);   --danger-tint: oklch(28% 0.06 27);
    --warning: oklch(76% 0.14 70);  --warning-tint: oklch(30% 0.06 80);
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / .30), 0 1px 1px oklch(0% 0 0 / .24);
    --shadow-pop: 0 10px 28px oklch(0% 0 0 / .45), 0 2px 8px oklch(0% 0 0 / .35);
    --ring: oklch(64% 0.11 255); --slot-blocked-bg: oklch(28% 0.02 300);
  }
}

/* ── Reset & Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--font-size-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0; }
dl, dd { margin: 0; }

/* ── Global form element baseline ─────────────────────────────────────────
   The HTML form uses <label><span>Text</span><input></label> without .field
   wrappers. These rules ensure all inputs/selects look polished everywhere. */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
select,
textarea {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 11px;
  min-height: 36px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  font-family: var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
textarea { min-height: 76px; }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"])::placeholder,
textarea::placeholder { color: var(--faint); }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):hover,
select:hover,
textarea:hover { border-color: var(--border-strong); }
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / .18);
}
input[aria-invalid="true"], .is-invalid { border-color: var(--danger) !important; }
/* Width:100% only where inputs live inside a flex/grid container (not inline) */
.form-grid input, .form-grid select, .form-grid textarea,
.tool-panel > label input, .tool-panel > label select,
form > label input, form > label select {
  width: 100%;
  box-sizing: border-box;
}

/* Labels that stack a <span> label-text above a form control */
.form-grid label,
form > label,
.tool-panel > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
/* Uppercase label text (the <span> inside a form label) */
.form-grid label > span:not(.input-hint):not(.badge):not(.reg-badge),
form > label > span:not(.input-hint):not(.badge),
.tool-panel > label > span:not(.input-hint):not(.badge) {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 500;
  line-height: 1;
}
/* Gap between form grid rows */
.form-grid { gap: 14px; }
/* Standalone label below form-grid (e.g. Registration select) */
form > label { margin-top: 10px; }

/* ── App Shell ───────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Brand */
.brand {
  padding: 14px 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand h1   { font-size: 13.5px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.2; }
.brand p    { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* Nav section labels */
.nav-section-label {
  padding: 12px 14px 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-weight: 500;
  margin: 0;
}
.nav-section-label--gap { margin-top: 4px; }

/* Nav buttons */
.main-nav { padding: 0 6px; display: flex; flex-direction: column; gap: 1px; }
.admin-nav-section { padding: 0 6px; display: flex; flex-direction: column; gap: 1px; }

.nav-button {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  transition: background .1s, color .1s;
  min-height: 34px;
}
.nav-ico { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.nav-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-button:hover             { background: var(--surface-2); color: var(--ink); }
.nav-button:hover .nav-ico   { color: var(--ink-2); }
.nav-button.active            { background: var(--ink); color: var(--surface); }
.nav-button.active .nav-ico  { color: var(--surface); }
/* Tastatur-Fokus sichtbar machen (fehlte → Sidebar-Navigation per Tab unsichtbar) */
.nav-button:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* Einklappbare Nav-Gruppen: Gruppenkopf ersetzt die alten flachen .nav-section-label */
.nav-group { display: flex; flex-direction: column; }
.nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%;
  padding: 12px 8px 5px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  font-weight: 500;
  cursor: pointer;
  transition: color .1s;
}
.nav-group-toggle:hover { color: var(--ink-2); }
.nav-group-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: var(--radius-sm); }
.nav-chev { flex-shrink: 0; transition: transform .15s; }
.nav-group.open .nav-chev { transform: rotate(180deg); }
.nav-group-items { display: none; flex-direction: column; gap: 1px; }
.nav-group.open .nav-group-items { display: flex; }
/* Globaler Fokus-Fallback für interaktive Elemente ohne eigenen Fokus-Stil.
   :where() hat Spezifität 0 → jede komponenteneigene :focus-visible-Regel gewinnt. */
:where(button, a, [role="tab"], summary, [tabindex]):focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm);
}

/* Sidebar footer (airline selector button, status) */
.sidebar > .panel { margin: 8px; border-radius: var(--radius-sm); font-size: 12.5px; }
.sidebar > .panel h2 { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.full-width { width: 100%; }

/* ── Workspace ───────────────────────────────────────────────────────── */
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
/* flex-basis 240px: reicht der Platz für die Status-Pille rechts nicht, bricht sie
   in die nächste Zeile um, statt den Titel zu überlappen/abzuschneiden (Mobile). */
.topbar-left { flex: 1 1 240px; min-width: 0; }
.eyebrow {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); font-weight: 500; margin: 0;
}
.topbar h2 {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  margin: 2px 0 0; line-height: 1.2;
}
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-item  { display: flex; align-items: center; gap: 6px; }

/* Status badges */
.db-badge, .topbar-db {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--line-2); background: var(--surface);
}
.db-badge--ok,    .db-badge.ok    { background: var(--green-tint); color: oklch(35% 0.080 155); border-color: transparent; }
.db-badge--err,   .db-badge.err   { background: var(--red-tint);   color: var(--red);           border-color: transparent; }
.db-badge--warn,  .db-badge.warn  { background: var(--warning-tint); color: var(--secondary-ink); border-color: transparent; }
.db-badge--cache, .db-badge.cache { background: var(--primary-tint); color: var(--primary);       border-color: transparent; }
.db-badge--unknown { color: var(--muted); }

.topbar-save-state, #saveState {
  font-size: 11.5px; color: var(--muted);
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}

/* Icon buttons (notifications, logout) */
.topbar-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  transition: border-color .12s, color .12s; position: relative;
}
.topbar-icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.topbar-icon-btn.active { background: var(--primary); color: var(--surface); border-color: var(--primary); }
.topbar-logout-btn { border-color: transparent; background: transparent; }
.topbar-logout-btn:hover { color: var(--red); }

/* Notification badge */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 3px;
  background: var(--red); color: var(--surface);
  border-radius: 8px; font-size: 10px; font-weight: 600;
  display: grid; place-items: center; border: 1.5px solid var(--surface);
}
.notif-btn { position: relative; }

/* Session countdown */
.session-countdown {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--secondary-ink);
  padding: 3px 8px; background: var(--secondary-tint);
  border-radius: 999px; border: 1px solid var(--secondary-ink);
}

/* Auth zone */
.topbar-auth { display: flex; align-items: center; gap: 8px; }
.topbar-user-info { font-size: 12px; color: var(--muted); }
.nav-user-name { font-weight: 500; color: var(--ink); }

/* Language switcher */
.lang-switcher {
  font-size: 12px; padding: 4px 7px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); outline: none;
}

/* Content area */
.content { padding: 20px 24px 60px; }
.view { display: none; }
.view.active { display: block; padding: 20px 24px 60px; }
/* Stats grid lives above views, needs same side padding */
.workspace > .stats-grid { padding: 20px 24px 0; }

/* ── Section Heading ─────────────────────────────────────────────────── */
.section-heading {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.section-heading h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.section-heading p  { font-size: 12.5px; color: var(--muted); }

/* ── Tool Panel / Panel ───────────────────────────────────────────────── */
.tool-panel, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel-title, .panel-head h2 {
  font-size: 13.5px; font-weight: 600;
  letter-spacing: -0.005em; margin: 0 0 14px;
}
.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  margin: -16px -16px 14px;
}
.panel-head h2 { margin: 0; }
.panel-head .sub { font-size: 12px; color: var(--muted); }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }
.panel-body { padding: 14px 16px; }
.panel-body.tight { padding: 0; }

/* ── KPI Strip ───────────────────────────────────────────────────────── */
.kpi-strip, .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi, .metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi .label, .metric .label,
.metric > p { /* HTML: <div class="metric"><span>0</span><p>Label</p></div> */
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0;
}
.kpi .value, .metric .value,
.metric > span { /* the number */
  font-family: var(--font-mono); font-size: 24px; font-weight: 500;
  margin-top: 4px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  display: block;
}
.kpi .delta { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }
.kpi .delta.up   { color: var(--green); }
.kpi .delta.down { color: var(--red); }

/* ── Buttons ─────────────────────────────────────────────────────────────
   EIN Button-System. .btn-primary/.btn-secondary/.btn-ghost (Auth/Admin) sind
   Aliase auf das Tower-System (.primary-action/.secondary-action/.btn.ghost),
   damit es nicht mehr vier divergierende Button-Vokabulare gibt. */
.btn,
.primary-action,
.secondary-action,
.danger-action,
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  transition: border-color .12s, background .12s, color .12s;
  white-space: nowrap; cursor: pointer; text-decoration: none;
}
.btn:hover, .secondary-action:hover, .btn-secondary:hover { border-color: var(--ink-2); }

/* Primary */
.btn.primary, .primary-action, .btn-primary {
  background: var(--primary); color: var(--surface); border-color: var(--primary);
}
.btn.primary:hover, .primary-action:hover, .btn-primary:hover { background: var(--primary-ink); border-color: var(--primary-ink); }

/* Ghost */
.btn.ghost, .btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover, .btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }

/* Danger */
.btn.danger, .danger-action { color: var(--red); border-color: var(--line-2); background: var(--surface); }
.btn.danger:hover, .danger-action:hover { background: var(--red-tint); border-color: var(--red); }

/* Table actions (ghost small) */
.table-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; font-size: 11.5px; font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; transition: background .1s, color .1s, border-color .1s;
}
.table-action:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.table-action.danger:hover { background: var(--red-tint); color: var(--red); border-color: var(--red); }

/* Sizes */
.btn.sm { padding: 4px 8px; font-size: 11.5px; }
.btn.lg { padding: 9px 16px; font-size: 13.5px; }
.btn.icon { padding: 6px; }

/* Button rows */
.button-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* ── Forms & Inputs ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 500;
}
.field input, .field select, .field textarea, .input {
  border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 13px; color: var(--ink); outline: none; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / .12);
}
.field input.mono, .input.mono { font-family: var(--font-mono); }
.hint-text  { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.span-2     { grid-column: span 2; }
.form-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.four  { grid-template-columns: repeat(4, 1fr); }

/* Inline inputs (airline editor) */
.lg-inline-input {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12px; color: var(--ink); outline: none;
}
.lg-inline-input:focus { border-color: var(--primary); }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table-wrap.tall-table { max-height: 60vh; overflow-y: auto; }

table, .tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }

thead th {
  text-align: left; font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); position: sticky; top: 0; white-space: nowrap;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.sel td  { background: var(--primary-tint); }

.tbl .mono, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl .num, .num   { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl .actions     { text-align: right; opacity: 0; transition: opacity .15s; }
.tbl tr:hover .actions { opacity: 1; }

/* Grouped tables (family sections in Flotte / Flugzeugtypen) */
tbody tr.family-header-row td,
.tbl-grouped tbody tr.group-row > td {
  padding: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
tbody tr.family-header-row:first-child td,
.tbl-grouped tbody tr.group-row:first-child > td { border-top: none; }
tbody tr.family-header-row:hover td,
.tbl-grouped tbody tr.group-row:hover { background: var(--surface-2); }
.family-header-cell,
.tbl-grouped .group-row-inner {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 12px 10px;
}
.family-badge,
.tbl-grouped .group-name {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap;
}
.family-count,
.tbl-grouped .group-meta { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
/* Gruppenkopf-Zelle muss die volle Tabellenbreite einnehmen (sonst schrumpft der
   Flex-Container auf Inhaltsbreite und Badge/Count brechen um). */
tbody tr.family-header-row td { width: 100%; }
.tbl-grouped .group-label {
  font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 500;
}
.tbl-grouped tbody tr.group-child > td:first-child { position: relative; padding-left: 28px; }
.tbl-grouped tbody tr.group-child > td:first-child::before {
  content: ""; position: absolute; left: 18px; top: 0; bottom: 0; width: 1px; background: var(--line);
}

/* ── Pills & Badges ──────────────────────────────────────────────────── */
.pill, .badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; font-size: 10.5px; font-weight: 500;
  border-radius: 4px; font-family: var(--font-mono); letter-spacing: 0.02em;
  background: var(--surface-3); color: var(--ink-2);
}
/* Wave pills */
.wave-a-pill, .pill.wave-a { background: oklch(94% 0.040 35);  color: oklch(40% 0.130 35); }
.wave-b-pill, .pill.wave-b { background: oklch(94% 0.030 155); color: oklch(40% 0.130 155); }
.wave-c-pill, .pill.wave-c { background: oklch(94% 0.030 250); color: oklch(40% 0.130 250); }
.wave-d-pill, .pill.wave-d { background: oklch(94% 0.030 305); color: oklch(40% 0.130 305); }
/* Direction */
.pill.out { background: var(--secondary-tint); color: var(--secondary-ink); }
.pill.in  { background: var(--primary-tint);   color: var(--primary); }
/* Semantic */
.badge.ok   { background: var(--green-tint); color: oklch(35% 0.080 155); }
.badge.err  { background: var(--red-tint);   color: var(--red); }
.badge.warn { background: var(--warning-tint); color: var(--secondary-ink); }
/* Flight number pill (dark) */
.pill.flight { background: var(--ink); color: var(--surface); }
/* Registration badge */
.reg-badge { font-family: var(--font-mono); font-size: 11px; }
/* Fleet count */
.fleet-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--primary-tint); color: var(--primary);
  border-radius: 10px; font-size: 11px; font-weight: 600; font-family: var(--font-mono);
}
/* TZ warn */
.tz-warn {
  display: inline-flex; align-items: center;
  padding: 1px 5px; font-size: 10px; font-weight: 500;
  border-radius: 3px; font-family: var(--font-mono);
  background: var(--warning-tint); color: var(--secondary-ink); margin-left: 4px;
}
.warn-icon { color: var(--warning); }
/* Day dots */
.dot-row { display: inline-flex; gap: 3px; }
.dot-row .d {
  width: 14px; height: 14px; display: inline-grid; place-items: center;
  font-size: 9.5px; font-family: var(--font-mono); border-radius: 3px;
  background: var(--surface-3); color: var(--faint); font-weight: 500;
}
.dot-row .d.on { background: var(--ink); color: var(--surface); }
/* Draft badge */
.draft-badge {
  display: inline-block; font-size: 0.68rem;
  background: var(--red); color: var(--surface);
  border-radius: 3px; padding: 0 4px; margin-left: 4px;
  vertical-align: middle; font-weight: 600;
}

/* ── Filter Bar ──────────────────────────────────────────────────────── */
.filter-bar, .route-filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.filter-bar input, .filter-bar select,
.route-filter-bar input, .route-filter-bar select {
  font-size: 12px; padding: 5px 8px;
  border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--radius-sm); color: var(--ink); outline: none;
}
.filter-inline     { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.filter-label-text { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }

/* Multi-select dropdown */
.ms-dropdown-wrap { position: relative; }
.ms-trigger {
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
  padding: 5px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer;
  min-width: 100px; white-space: nowrap;
}
.ms-trigger:hover { border-color: var(--primary); }
.ms-chevron { flex-shrink: 0; color: var(--muted); }
.ms-dropdown {
  position: absolute; z-index: 200; top: calc(100% + 2px); left: 0;
  min-width: 160px; max-width: 240px;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden;
}
.ms-search-input {
  width: 100%; padding: 7px 10px; border: none; border-bottom: 1px solid var(--line);
  font-size: 13px; background: var(--surface-2); color: var(--ink); outline: none;
}
.ms-options { max-height: 200px; overflow-y: auto; padding: 4px 0; }
.ms-option-label { display: flex; align-items: center; gap: 6px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.ms-option-label:hover { background: var(--surface-2); }
.ms-option-label input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; accent-color: var(--primary); }
.ms-no-results { padding: 8px 10px; font-size: 13px; color: var(--muted); }

/* Searchable single-select */
.searchable-select-wrap { position: relative; }
.searchable-select-input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); color: var(--ink); outline: none;
}
.searchable-select-input:focus { border-color: var(--primary); }
.searchable-select-dropdown {
  position: absolute; z-index: 200; top: calc(100% + 2px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  max-height: 240px; overflow-y: auto;
}
.ss-option { padding: 6px 10px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.ss-option:hover { background: var(--surface-2); }
.ss-group-label {
  padding: 4px 10px 2px; font-size: 11px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  border-top: 1px solid var(--line); margin-top: 2px;
}
.ss-no-results { padding: 8px 10px; font-size: 13px; color: var(--muted); }

/* ── Layout Helpers ──────────────────────────────────────────────────── */
.split-layout, .split   { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.split-7-5              { display: grid; gap: 16px; grid-template-columns: 7fr 5fr; }
.split-5-7              { display: grid; gap: 16px; grid-template-columns: 5fr 7fr; }
.split-2                { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.split-3                { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.aircraft-layout        { display: grid; gap: 16px; grid-template-columns: 340px 1fr; align-items: start; }
.aircraft-content       { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hubwellen-layout       { display: grid; gap: 16px; grid-template-columns: 320px 1fr; align-items: start; }
.analysis-grid          { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.db-section-grid        { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.crawl-grid             { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.import-export-grid     { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.analysis-controls      { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.hr          { height: 1px; background: var(--line); margin: 16px 0; }
.empty       { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }
.sec-label   { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; margin: 18px 0 10px; }
.tag-row     { display: flex; gap: 6px; flex-wrap: wrap; }
.tag         { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); }
.kv          { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.kv .k       { color: var(--muted); }
.kv .v       { font-family: var(--font-mono); }
.progress-bar      { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }

/* ── Modals & Overlays ───────────────────────────────────────────────── */
.modal-overlay {
  display: none; /* shown via .open class or inline style */
  position: fixed; inset: 0; z-index: 500;
  background: oklch(20% 0.012 260 / .5);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] { display: flex !important; }
.modal-card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px oklch(20% 0.012 260 / .25);
  width: min(520px, 100%); max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal-header h2, .modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  transition: color .12s, border-color .12s;
}
.modal-close:hover { color: var(--red); border-color: var(--red); }
.modal-body   { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }

/* Login / session-expired overlays */
.login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; width: min(400px, 90vw); box-shadow: var(--shadow);
}
.session-expired-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: oklch(20% 0.012 260 / .5);
  display: flex; align-items: center; justify-content: center;
}

/* Airline selector modal */
.as-airline-row       { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); }
.as-airline-row--active { background: var(--primary-tint); }
.as-airline-btn       { flex: 1; text-align: left; background: none; border: none; font-size: 13px; color: var(--ink); padding: 4px 0; }
.as-airline-btn--active { font-weight: 600; color: var(--primary); }
.as-edit-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; align-self: stretch; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  transition: color .12s, border-color .12s;
}
.as-edit-btn:hover { color: var(--primary); border-color: var(--primary); }
.as-new-airline-section { margin-bottom: 12px; }
.as-new-airline-toggle {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
  padding: 7px 12px; font-size: 13px; color: var(--primary); width: 100%; transition: border-color .15s;
}
.as-new-airline-toggle:hover { border-color: var(--primary); }

/* Competitor manage */
.competitor-manage-list { overflow-y: auto; padding: 8px 0; flex: 1; }
.comp-manage-row { display: flex; align-items: center; gap: 10px; padding: 8px 20px; cursor: pointer; font-size: 14px; }
.comp-manage-row:hover { background: var(--surface-2); }
.comp-manage-row input[type="checkbox"] { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--red); }
.comp-manage-name { flex: 1; }

/* ── Import / Export Tabs ────────────────────────────────────────────── */
.ie-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.ie-tab {
  padding: 8px 14px; font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent; border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent; color: var(--muted); cursor: pointer; transition: color .12s;
}
.ie-tab.active { background: var(--surface); border-color: var(--line); color: var(--ink); margin-bottom: -1px; }
.ie-tab:hover:not(.active) { color: var(--ink-2); }
.ie-tab-content { display: none; }
.ie-tab-content.active { display: block; }
.ie-full { grid-column: 1 / -1; }

/* ── Hubwellen ───────────────────────────────────────────────────────── */
/* Wave colour vars E–Z injected dynamically by applyWaveColorVars() via <style> tag — no static CSS needed */
/* Static fallbacks A–D: */
.wave-header { padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12px; }
[data-wave="A"] .wave-header, .wave-header-a { background: oklch(94% 0.040 35);  color: oklch(40% 0.130 35); }
[data-wave="B"] .wave-header, .wave-header-b { background: oklch(94% 0.030 155); color: oklch(40% 0.130 155); }
[data-wave="C"] .wave-header, .wave-header-c { background: oklch(94% 0.030 250); color: oklch(40% 0.130 250); }
[data-wave="D"] .wave-header, .wave-header-d { background: oklch(94% 0.030 305); color: oklch(40% 0.130 305); }
.comp-table-wrap { overflow-x: auto; }

/* Wave timeline */
.wave-timeline {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 28px;
}
.wave-axis { position: relative; height: 6px; background: var(--surface-3); border-radius: 3px; margin: 60px 0 16px; }
.wave-tick { position: absolute; top: -6px; height: 18px; width: 1px; background: var(--line-2); }
.wave-tick .lbl { position: absolute; top: 22px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.wave-band { position: absolute; top: -52px; height: 110px; border-radius: 8px; border: 1px dashed transparent; }
.wave-band.a { background: oklch(94% 0.035 35 / .6);  border-color: oklch(70% 0.13 35 / .4); }
.wave-band.b { background: oklch(94% 0.035 155 / .55); border-color: oklch(70% 0.13 155 / .4); }
.wave-band.c { background: oklch(94% 0.035 250 / .55); border-color: oklch(70% 0.13 250 / .4); }
.wave-band.d { background: oklch(94% 0.035 305 / .55); border-color: oklch(70% 0.13 305 / .4); }
.wave-band .blbl { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.wave-band .barr { position: absolute; top: 24px; left: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.wave-band .bdep { position: absolute; bottom: 4px; right: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.wave-flight-dot { position: absolute; top: 0; transform: translate(-50%, -50%); width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--surface); }
.wave-flight-dot.arr { background: var(--primary); }
.wave-flight-dot.dep { background: var(--secondary); }

/* ── Routes ──────────────────────────────────────────────────────────── */
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.route-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color .12s, box-shadow .12s; cursor: pointer;
}
.route-card:hover { border-color: var(--ink-2); box-shadow: var(--shadow-sm); }
.route-card .head { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 14px; font-weight: 500; }
.route-card .head .arrow { color: var(--faint); }
.route-card .group { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 4px; }
.route-card .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.route-card .stat .v { font-family: var(--font-mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.route-card .stat .k { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1px; }

/* ── Map ─────────────────────────────────────────────────────────────── */
.map-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-card .map-wrap { aspect-ratio: 16/9; background: var(--surface-2); position: relative; overflow: hidden; }
.map-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .5;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
}
.map-node { position: absolute; transform: translate(-50%, -50%); }
.map-node .pin { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--ink-2); }
.map-node.hub .pin { width: 14px; height: 14px; background: var(--secondary); box-shadow: 0 0 0 1px var(--secondary-ink), 0 0 20px oklch(from var(--secondary) l c h / .5); }
.map-node .lbl { position: absolute; left: 12px; top: -3px; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-2); background: var(--surface); padding: 1px 4px; border-radius: 3px; white-space: nowrap; border: 1px solid var(--line); }
.map-node.hub .lbl { font-weight: 600; font-size: 10.5px; color: var(--secondary-ink); border-color: var(--secondary); }

/* ── Flight Draft ────────────────────────────────────────────────────── */
.flight-draft { background: oklch(94% 0.025 28 / .5) !important; }
.flight-draft td:first-child { border-left: 3px solid var(--red); }

/* ── Seat grid (cabin config form) ──────────────────────────────────── */
.seat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ── Analysis bar chart ──────────────────────────────────────────────── */
.bar-chart-wrap { overflow-x: auto; }

/* ── Appearance Settings Panel ───────────────────────────────────────── */
.theme-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.theme-swatch {
  border: 2px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; background: none; padding: 0; text-align: left;
  transition: border-color .15s, transform .1s; display: flex; flex-direction: column;
}
.theme-swatch:hover { border-color: var(--ink-2); transform: translateY(-1px); }
.theme-swatch.active { border-color: var(--ink); }
.theme-swatch-preview {
  height: 52px; display: grid; grid-template-columns: 30% 70%;
}
/* Swatch mini-previews — sidebar colour :: before, content :: after */
.ts-tower   { background: oklch(98.5% 0.004 75); }
.ts-tower::before   { content: ""; display: block; background: oklch(99.5% 0.002 75); border-right: 1px solid oklch(91% 0.006 260); }
.ts-tower::after    { content: ""; display: block; background: oklch(98.5% 0.004 75); }
.ts-teal    { background: oklch(98.5% 0.004 75); }
.ts-teal::before    { content: ""; display: block; background: oklch(99.5% 0.002 75); border-right: 1px solid oklch(91% 0.006 260); border-bottom: 3px solid #087f70; }
.ts-teal::after     { content: ""; display: block; background: oklch(98.5% 0.004 75); }
.ts-crimson { background: oklch(98.5% 0.004 75); }
.ts-crimson::before { content: ""; display: block; background: oklch(99.5% 0.002 75); border-right: 1px solid oklch(91% 0.006 260); border-bottom: 3px solid oklch(45% 0.18 15); }
.ts-crimson::after  { content: ""; display: block; background: oklch(98.5% 0.004 75); }
.ts-slate   { background: oklch(17% 0.010 255); }
.ts-slate::before   { content: ""; display: block; background: oklch(22% 0.015 255); border-right: 1px solid oklch(32% 0.010 260); }
.ts-slate::after    { content: ""; display: block; background: oklch(17% 0.010 255); }

.theme-swatch-label {
  display: block; padding: 7px 10px; font-size: 12px; font-weight: 500; color: var(--ink);
  border-top: 1px solid var(--line); flex: 1;
}
.ts-slate + .theme-swatch-label, [data-theme-value="slate"] .theme-swatch-label { color: oklch(93% 0.005 260); background: oklch(22% 0.015 255); }
.theme-check { display: none; float: right; padding-right: 10px; line-height: 2; font-size: 12px; }
.theme-swatch.active .theme-check { display: block; }

.font-size-toggle {
  display: flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  overflow: hidden; width: fit-content;
}
.font-size-btn {
  padding: 7px 20px; font-size: 13px; border: none; border-right: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); cursor: pointer; font-family: var(--font-sans);
  transition: background .1s, color .1s;
}
.font-size-btn:last-child { border-right: none; }
.font-size-btn.active { background: var(--ink); color: var(--surface); font-weight: 500; }
.font-size-btn:hover:not(.active) { background: var(--surface-2); color: var(--ink); }

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ── Ported Legacy Classes ── */

/* Session-expired modal content */
.session-expired-modal {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px oklch(20% 0.012 260 / .25);
  width: min(440px, 92vw); padding: 32px;
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; text-align: center;
}
.session-expired-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--red-tint); color: var(--red);
  display: grid; place-items: center; font-size: 22px; flex-shrink: 0;
}
.session-expired-title  { font-size: 17px; font-weight: 600; color: var(--ink); }
.session-expired-body   { font-size: 13px; color: var(--muted); line-height: 1.6; }
.session-expired-countdown {
  font-family: var(--font-mono); font-size: 28px; font-weight: 500;
  color: var(--red); letter-spacing: -0.01em;
}
.session-expired-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; }

/* Day dots (flight table) */
.day-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  font-size: 9.5px; font-family: var(--font-mono); border-radius: 3px;
  background: var(--surface-3); color: var(--faint); font-weight: 500;
}
.day-dot.active { background: var(--ink); color: var(--surface); }
.days-cell { white-space: nowrap; vertical-align: middle; }
.days-cell .day-dot { margin-right: 2px; vertical-align: middle; }
.days-cell .day-dot:last-child { margin-right: 0; }

/* Route detail */
.rd-summary-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.rd-summary-value {
  font-family: var(--font-mono); font-size: 18px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.rd-summary-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-top: 2px;
}
.rd-chart-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; overflow-x: auto;
}
.rd-chart-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.rd-own-type { background: var(--primary-tint) !important; }
.route-link {
  color: var(--primary); text-decoration: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 13px;
}
.route-link:hover { text-decoration: underline; }
.route-group-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; font-size: 10.5px; font-weight: 500;
  border-radius: 4px; background: var(--primary-tint); color: var(--primary);
}

/* Wave badge (emitted by JS as class="wave-badge wave-a" etc.) */
.wave-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; font-size: 10.5px; font-weight: 500;
  border-radius: 4px; font-family: var(--font-mono); letter-spacing: .02em;
  background: var(--surface-3); color: var(--ink-2);
}

/* Fleet */
.flotte-add-option {
  color: var(--primary); font-weight: 500;
  border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px;
}

/* DB admin status */
.db-status-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.db-count-row  { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 13px; }
.db-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--muted);
}
.db-status-dot.ok   { background: var(--green);   box-shadow: 0 0 0 3px var(--green-tint); }
.db-status-dot.err  { background: var(--red);     box-shadow: 0 0 0 3px var(--red-tint); }
.db-status-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-tint); }

/* Team / member panel */
.member-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.member-table td, .member-table th {
  padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.member-table th {
  font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); background: var(--surface-2);
}
.member-invite-row {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px;
}
.pending-badge {
  display: inline-flex; align-items: center; padding: 2px 7px;
  font-size: 10.5px; font-weight: 500; border-radius: 4px;
  background: var(--warning-tint); color: var(--secondary-ink);
}
.btn-danger-xs {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--red); border-radius: var(--radius-sm);
  background: transparent; color: var(--red); cursor: pointer;
}
.btn-danger-xs:hover { background: var(--red-tint); }
.btn-accept {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; font-size: 11.5px; font-weight: 500;
  background: var(--green-tint); color: oklch(35% 0.08 155);
  border: 1px solid oklch(75% 0.07 155); border-radius: var(--radius-sm); cursor: pointer;
}
.btn-accept:hover { background: oklch(90% 0.05 155); }
.btn-decline {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; font-size: 11.5px; font-weight: 500;
  background: var(--red-tint); color: var(--red);
  border: 1px solid oklch(80% 0.06 28); border-radius: var(--radius-sm); cursor: pointer;
}
.btn-decline:hover { background: oklch(90% 0.04 28); }

/* Notification popover content */
.notif-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item:last-child { border-bottom: none; }
.notif-title     { font-size: 13px; font-weight: 500; color: var(--ink); }
.notif-item-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.notif-item-sub  { font-size: 11.5px; color: var(--muted); }
.notif-empty     { padding: 20px 14px; text-align: center; font-size: 13px; color: var(--muted); }

/* ── Responsive ──────────────────────────────────────────────────────── */

/* Tablet: 768–1199px — icon-only sidebar */
@media (max-width: 1199px) {
  .app-shell { grid-template-columns: 64px minmax(0, 1fr); }

  .sidebar .brand h1,
  .sidebar .brand p,
  .sidebar .nav-section-label,
  .sidebar .nav-group-toggle,
  .sidebar .nav-lbl,
  .sidebar > .panel { display: none; }
  .sidebar .brand { justify-content: center; padding: 12px 8px; }
  .sidebar .brand-mark { margin: 0; }
  .sidebar .main-nav,
  .sidebar .admin-nav-section { padding: 0 4px; }
  .sidebar .nav-button { justify-content: center; padding: 10px 6px; gap: 0; }
  .sidebar .nav-ico { width: 20px; height: 20px; }
  /* Icon-only Rail: Gruppen-Umschalter ist unsichtbar (kein Klickziel) → Icons
     immer zeigen, unabhängig vom eingeklappten .open-Zustand. */
  .sidebar .nav-group-items { display: flex; }

  .kpi-strip, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .split-layout, .split-7-5, .split-5-7, .split-2, .split-3,
  .aircraft-layout, .hubwellen-layout, .analysis-grid,
  .db-section-grid, .crawl-grid, .import-export-grid { grid-template-columns: 1fr; }
  .form-grid.three, .form-grid.four { grid-template-columns: 1fr 1fr; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 16px 18px 60px; }
}

/* Mobile-only nav chrome is hidden on desktop (sidebar stays a normal column) */
.mobile-quicknav, .mobile-nav-backdrop { display: none; }

/* Mobile (≤767px): sidebar becomes an off-canvas drawer holding the FULL
   navigation (labels, section headers, admin, data panel). A fixed bottom
   quick-nav exposes the core screens + a ☰ button that opens the drawer. */
@media (max-width: 767px) {
  .app-shell {
    display: flex; flex-direction: column;
    min-height: 100dvh;
  }
  .workspace { flex: 1; min-height: 0; padding-bottom: 60px; }

  /* The off-canvas drawer sits at x:-272..0 when closed. On iOS Safari a
     fixed element off the left edge becomes horizontally scrollable (the
     page can be dragged sideways). Clip horizontal overflow at the root to
     prevent it. overflow-x doesn't break the vertical page scroll or the
     inner scroll containers (tables, hub-wave matrix). */
  html, body { overflow-x: hidden; overscroll-behavior-x: none; }
  html { overflow-x: clip; }

  /* Off-canvas drawer */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; right: auto;
    width: 272px; max-width: 84vw; height: 100dvh; max-height: none;
    flex-direction: column; overflow-y: auto; overflow-x: hidden;
    border-right: 1px solid var(--line); border-top: none;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 600;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 40px oklch(20% 0.012 260 / .28);
  }
  /* The ≤1199px tablet rail hides labels/brand/panel — restore them in the
     drawer so the full navigation (with section headers) is visible. */
  .sidebar .brand { justify-content: flex-start; padding: 14px 16px; }
  .sidebar .brand h1, .sidebar .brand p,
  .sidebar .nav-section-label, .sidebar .nav-lbl,
  .sidebar > .panel { display: block; }
  .sidebar .nav-group-toggle { display: flex; }
  .sidebar .main-nav, .sidebar .admin-nav-section { padding: 0 8px; }
  .sidebar .nav-button { justify-content: flex-start; padding: 9px 10px; gap: 9px; }
  /* Drawer = volle Desktop-Navigation → einklappbare Gruppen wieder normal (nur
     .open zeigt die Items), statt der Icon-Rail-Ausnahme von oben. */
  .sidebar .nav-group-items { display: none; }
  .sidebar .nav-group.open .nav-group-items { display: flex; }

  /* Backdrop behind the open drawer */
  .mobile-nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 590;
    background: oklch(20% 0.012 260 / .42);
    opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
  }
  body.nav-open .mobile-nav-backdrop { opacity: 1; visibility: visible; }

  /* Fixed bottom quick-nav */
  .mobile-quicknav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 2px env(safe-area-inset-bottom, 0);
    justify-content: space-around; align-items: stretch;
  }
  .mobile-quick-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; padding: 6px 2px; min-height: 52px;
    background: none; border: none; border-radius: var(--radius-sm);
    color: var(--muted); cursor: pointer; font: inherit;
  }
  .mobile-quick-btn .nav-ico { width: 20px; height: 20px; }
  .mobile-quick-btn .nav-lbl {
    font-size: 9.5px; line-height: 1; white-space: nowrap;
    overflow: hidden; max-width: 64px; text-overflow: ellipsis;
  }
  .mobile-quick-btn.active { color: var(--primary); }

  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar h2 { font-size: 16px; }
  .topbar-right { gap: 6px; }
  .content { padding: 12px 14px 80px; }

  .kpi-strip, .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .split-layout, .split-7-5, .split-5-7, .split-2, .split-3,
  .aircraft-layout, .hubwellen-layout, .analysis-grid,
  .db-section-grid, .crawl-grid, .import-export-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .button-row { flex-direction: column; align-items: stretch; }
  .filter-bar, .route-filter-bar { flex-direction: column; align-items: stretch; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .font-size-toggle { width: 100%; }
  .font-size-btn { flex: 1; }
  .modal-card { max-height: 90vh; }
}

/* ── Mobile card tables + refinements (≤767px) ────────────────────────
   Pure presentation. Activates only at ≤767px so desktop is untouched.
   Wide record tables with .cards-on-mobile reflow into stacked cards;
   every <td data-label> stays visible as a Label:Value pair (no info lost). */
@media (max-width: 767px) {
  .cards-on-mobile { overflow-x: visible; }
  /* tall-table caps height to 60vh with an inner scrollbar on desktop; as a
     card list that traps a huge list in a tiny nested scroll area — let it
     flow with the page instead on mobile. */
  .cards-on-mobile.tall-table { max-height: none; overflow-y: visible; }
  .cards-on-mobile table { font-size: 13px; }
  .cards-on-mobile thead { display: none; }
  .cards-on-mobile tbody,
  .cards-on-mobile tbody tr,
  .cards-on-mobile tbody td { display: block; width: auto; }

  .cards-on-mobile tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 4px 12px;
    margin-bottom: 10px;
  }
  .cards-on-mobile tbody tr:hover td,
  .cards-on-mobile tbody tr.sel td { background: transparent; }
  .cards-on-mobile tbody tr.sel { border-color: var(--primary); }

  /* Labelled value rows */
  .cards-on-mobile tbody td[data-label] {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; text-align: right;
    padding: 7px 0; border-bottom: 1px solid var(--line);
  }
  .cards-on-mobile tbody td[data-label]:last-child { border-bottom: none; }
  .cards-on-mobile tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto; text-align: left;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted);
  }

  /* Unlabelled structural cells (flight-no/toggle, group headers, spacers) */
  .cards-on-mobile tbody td:not([data-label]) { padding: 6px 0; border: none; }
  .cards-on-mobile tbody td:not([data-label]):empty { display: none; }

  /* Action cells → full-width touch buttons */
  .cards-on-mobile tbody td.action-cell {
    display: flex; gap: 8px; padding: 8px 0 4px; border-bottom: none;
  }
  .cards-on-mobile tbody td.action-cell:empty { display: none; }
  .cards-on-mobile tbody td.action-cell::before { content: none; }
  .cards-on-mobile tbody td.action-cell .table-action {
    flex: 1; justify-content: center; min-height: 40px;
    border: 1px solid var(--line);
  }

  /* Group/family section-header rows stay as dividers, not Label:Value */
  .cards-on-mobile tbody tr.family-header-row,
  .cards-on-mobile tbody tr.group-row,
  .cards-on-mobile tbody tr.apt-country-header {
    background: var(--surface-2); padding: 0;
  }
  .cards-on-mobile tbody tr.family-header-row td,
  .cards-on-mobile tbody tr.group-row td,
  .cards-on-mobile tbody tr.apt-country-header td { border-bottom: none; }

  /* Dropdowns: full width, never overflow the viewport */
  .ms-dropdown, .searchable-select-dropdown {
    left: 0; right: 0; min-width: 0; max-width: none; width: 100%;
  }

  /* Topbar: keep airline name from pushing the action icons out */
  .topbar-user-info {
    max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* Touch targets */
  .table-action { min-height: 36px; }
  .day-btn { min-height: 36px; }

  /* Tighter modal padding on small screens */
  .modal-header { padding: 14px 16px; }
  .modal-body   { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; }

  /* #plannerView .split-layout is an ID-level desktop rule (340px form col)
     that out-specifies the generic .split-layout mobile collapse, shrinking
     the table column to 0. Force a single column on mobile (raised
     specificity so it wins over the later-defined desktop rule). */
  #plannerView.view .split-layout { grid-template-columns: 1fr; }

  /* Grid items default to min-width:auto and blow the track out to their
     content width (e.g. the 1100px hub-wave matrix or wide charts escape
     their overflow:auto wrapper). Force min-width:0 so the inner
     scroll containers stay within the viewport on mobile. */
  .split-layout > *, .aircraft-layout > *, .hubwellen-layout > *,
  .analysis-grid > *, .split-2 > *, .split-3 > *,
  .split-7-5 > *, .split-5-7 > * { min-width: 0; }
}

/* ── Section 20 – Additional Classes ─────────────────────────────────── */

/* Auth overlay (login screen) */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.auth-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; width: min(380px, 90vw); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: none; width: auto; height: auto;
}
.auth-logo .brand-mark {
  width: 40px; height: 40px; border-radius: 10px; font-size: 14px;
}
.auth-logo h1 {
  font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em;
  line-height: 1.1;
}
.auth-tagline { font-size: 12px; color: var(--muted); text-align: center; margin-top: -6px; }
.auth-login-btn {
  width: 100%; min-height: 42px; padding: 0 16px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: var(--surface); border: 1px solid var(--primary);
  border-radius: var(--radius-sm); cursor: pointer; text-align: center;
  transition: background .12s;
}
.auth-login-btn:hover { background: var(--primary-ink); border-color: var(--primary-ink); }
.auth-btn-secondary {
  width: 100%; min-height: 42px; padding: 0 16px; font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
}
.auth-btn-secondary:hover { background: var(--bg); }
.auth-error { font-size: 12px; color: var(--red); text-align: center; }
.auth-hint  { font-size: 12px; color: var(--muted); text-align: center; }
.auth-link  { color: var(--primary); text-decoration: underline; cursor: pointer; font-size: 12px; text-align: center; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.auth-logout-hint { font-size: 11px; color: var(--muted); }

/* Auth tabs (login / register) */
.auth-tabs {
  display: flex; gap: 4px; width: 100%;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 3px;
}
.auth-tab {
  flex: 1; padding: 6px 12px; font-size: 13px; font-weight: 500;
  background: none; border: none; border-radius: calc(var(--radius-sm) - 2px);
  color: var(--muted); cursor: pointer; transition: background .1s, color .1s;
}
.auth-tab.is-active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 3px oklch(0% 0 0 / .08);
}

/* Auth forms */
.auth-form {
  display: flex; flex-direction: column; gap: 10px; width: 100%;
}
.auth-form input {
  width: 100%; padding: 8px 12px; font-size: 14px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  outline: none; transition: border-color .12s;
  box-sizing: border-box;
}
.auth-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / .1);
}

/* Passwort-Feld mit Anzeige-Toggle (Login/Register/Reset/Konto) */
.pw-field { position: relative; display: block; width: 100%; }
.pw-field > input { width: 100%; padding-right: 38px; box-sizing: border-box; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font-size: 15px; line-height: 1; opacity: .55; color: var(--ink);
  border-radius: var(--radius-sm); transition: opacity .12s;
}
.pw-toggle:hover { opacity: .9; }
.pw-toggle.is-on { opacity: 1; }

/* Auth message (info / ok / error) */
.auth-message {
  font-size: 12px; text-align: center; width: 100%;
  padding: 8px 10px; border-radius: var(--radius-sm); line-height: 1.4;
}
.auth-message--info  { color: var(--muted);  background: var(--bg); }
.auth-message--ok    { color: var(--green,#166534); background: oklch(97% 0.02 145); }
.auth-message--error { color: var(--red);    background: oklch(97% 0.02 25); }

/* Notification popover */
.notif-popover {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 320px; max-height: 400px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); z-index: 200;
}

/* Airline selector modal internals */
.airline-selector-card { padding: 16px; }
.airline-list { display: flex; flex-direction: column; gap: 4px; }
.selector-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px;
}

/* Sidebar context display */
.sidebar-airline-ctx { padding: 10px 12px; border-top: 1px solid var(--line); font-size: 12px; }
.sidebar-ctx-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sidebar-ctx-name { font-weight: 600; color: var(--ink); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-ctx-world { font-size: 11px; color: var(--muted); }
.sidebar-switch-btn { font-size: 11px; color: var(--primary); background: none; border: none; cursor: pointer; flex-shrink: 0; padding: 0; }
.sidebar-time-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--muted); }

/* Route detail view */
.rd-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.rd-meta { font-size: 12px; color: var(--muted); }
.rd-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.rd-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rd-chart-section { margin-bottom: 16px; }
.rd-flights-section { margin-bottom: 16px; }
.rd-aircraft-section { margin-bottom: 16px; }
.rd-competition-section { margin-bottom: 16px; }
.rd-selectors { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.rd-both-dirs-label { font-size: 12px; color: var(--muted); }
.rd-competitor-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.rd-wave-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.rd-ftab-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.rd-ftab {
  padding: 6px 12px; font-size: 12px; font-weight: 500;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.rd-ftab.active { color: var(--primary); border-bottom-color: var(--primary); }
.rd-ftab-panel { display: none; }
.rd-ftab-panel.active { display: block; }
.rd-th-sort { cursor: pointer; user-select: none; }
.rd-th-sort:hover { color: var(--ink); }

/* Analytics view */
.analytics-tab-bar { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.analytics-tab {
  padding: 7px 14px; font-size: 12.5px; font-weight: 500;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.analytics-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.analytics-panel { display: none; }
.analytics-panel.active { display: block; }

/* Generisches Tab-System (wiederverwendbar für Einstellungen, Import/Export, Datenbank,
   Admin). Ein einziger delegierter Handler in planner.js schaltet je [data-tabs]-Container
   .subtab[data-tab] gegen .subtab-panel[data-tab] um. */
.subtab-bar { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 20px; border-bottom: 1px solid var(--line); }
.subtab {
  padding: 8px 15px; font-size: 13px; font-weight: 500;
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0;
}
.subtab:hover { color: var(--ink); background: color-mix(in oklch, var(--nav) 7%, transparent); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); }
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }

/* Database/admin panel */
.db-status-panel { margin-bottom: 16px; }
.db-counts-panel { margin-bottom: 16px; }
.db-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.db-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.db-migrate-table { width: 100%; }
.db-aircraft-upload { margin-top: 12px; }
.db-suitability-panel { margin-top: 16px; }

/* Airport manager */
.apt-import-panel { margin-top: 16px; }
.apt-progress-bar  { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.apt-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.apt-cols-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.apt-cols-summary { font-size: 12px; color: var(--muted); }
.apt-col-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }

/* Crawl/import panel */
.crawl-panel { display: flex; flex-direction: column; gap: 12px; }
.crawl-inputs { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.crawl-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Competition view */
.competitor-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* Day-of-week toggles */
.day-btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.day-btn {
  min-width: 38px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.day-btn:hover { border-color: var(--border-strong); color: var(--ink-2); }
.day-btn.active { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.day-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Additional button classes – segmented control look */
.btn-group { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; gap: 2px; }
.btn-group .btn, .btn-group button {
  border: none; border-radius: var(--radius-sm); background: transparent; color: var(--muted); padding: 5px 12px; font-weight: 500; min-height: 0;
}
.btn-group .btn.active, .btn-group button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-back  { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12.5px; border: none; background: transparent; color: var(--ink-2); cursor: pointer; border-radius: var(--radius-sm); }
.btn-back:hover { background: var(--surface-2); color: var(--ink); }
/* .btn-ghost/.btn-primary/.btn-secondary → jetzt Aliase im kanonischen Button-Block oben. */
.btn-icon  { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); color: var(--ink-2); cursor: pointer; }
.btn-icon:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-sm  { padding: 4px 8px !important; font-size: 11.5px !important; }
.btn-xs  { padding: 2px 6px !important; font-size: 11px !important; }
.btn-danger { border-color: var(--danger, #d1435b); background: var(--danger, #d1435b); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }

/* Bulk-Editor-Leiste im Flugplan */
.flight-bulk-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.flight-bulk-bar[hidden] { display: none; }
.bulk-reg-group { display: inline-flex; align-items: center; gap: 6px; }
.bulk-reg-group select { height: 28px; padding: 2px 8px; font-size: 12px; max-width: 180px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.flight-bulk-count { font-weight: 600; margin-right: auto; }
.flight-select, .flight-select-group { margin-right: 6px; vertical-align: middle; cursor: pointer; }
.bulk-days-group { display: inline-flex; align-items: center; gap: 6px; }
.bulk-days { display: inline-flex; gap: 2px; }
.bulk-day { padding: 3px 7px; font-size: 11px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); border-radius: 5px; cursor: pointer; }
.bulk-day.active { background: var(--accent, #3b82f6); border-color: var(--accent, #3b82f6); color: #fff; }

/* Streckennetz-Karte */
.network-map { width: 100%; overflow-x: auto; }
.netmap-svg { width: 100%; height: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.netmap-label { font-size: 9px; fill: var(--ink-2); font-family: var(--font-mono, monospace); }
.netmap-hublabel { font-size: 10px; font-weight: 700; fill: var(--danger, #d1435b); }
.netmap-empty { font-size: 20px; fill: var(--ink-3, #999); }
.netmap-missing { margin-top: 6px; }

/* V4/V5: Fokus-Banner in der Chancen-View + Planen-Buttons in der Timeline */
.opp-focus-banner { display: flex; align-items: center; gap: 8px; margin: 8px 0; padding: 6px 12px;
  background: var(--accent-tint, rgba(59,130,246,0.12)); border: 1px solid var(--accent, #3b82f6);
  border-radius: 8px; font-size: 13px; }
.opp-focus-banner .btn { margin-left: auto; }
.rt-plan-btn { margin-left: 6px; }

/* Ökonomie-Proxy-Ehrlichkeit: Info-Marker + Fußnote in der Routendetail-Summary */
.rd-econ-info { cursor: help; opacity: 0.6; font-size: 0.85em; }
.rd-summary-card[title] { cursor: help; }
.rd-econ-note { flex-basis: 100%; margin: 6px 2px 0; font-size: 12px; color: var(--ink-2); opacity: 0.85; }

/* User role badge */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; font-size: 10px; font-weight: 600;
  border-radius: 4px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--primary-tint); color: var(--primary);
}

/* Save status indicator */
.save-status { font-size: 11.5px; color: var(--muted); }

/* Settings view layout */
.settings-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.settings-full-width { grid-column: 1 / -1; }

/* File input wrapper */
.file-control { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Timezone form row */
.form-tz-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Hubwellen timezone toggle */
.hw-tz-toggle { display: flex; gap: 0; }

/* Inline select */
.inline-select { font-size: 12px; padding: 3px 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); color: var(--ink); }

/* Text helpers */
.input-hint      { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.label-text      { font-size: 11px; color: var(--muted); font-weight: 500; }
.subsection-title { font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.subsection-hint  { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

/* Modifiers */
.compact { font-size: 11.5px; }
.small   { font-size: 11.5px; color: var(--muted); }

/* Panel header alias */
.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  margin: -16px -16px 14px;
}

/* Workspace file area */
.workspace-file  { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
.workspace-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }

/* IE tab active alias */
.ie-tab--active { background: var(--surface); border-color: var(--line); color: var(--ink); margin-bottom: -1px; }

/* Form-grid three modifier standalone */
.three { grid-template-columns: repeat(3, 1fr); }

/* ═══════════════════════════════════════════════════════════════════════
   POST-REDESIGN COMPONENT RESTORATION  (Tower-styled)
   Restores component CSS dropped during the styles.css rewrite.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Font-size setting → scales the whole UI (zoom) ──────────────────── */
.workspace { zoom: var(--app-zoom, 1); }
.auth-overlay { zoom: var(--app-zoom, 1); }

/* ── Flugplan: narrower form, table gets the focus ───────────────────── */
#plannerView .split-layout { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }

/* ── Generic toolbar above tables (Regionen / Hubwellen) ─────────────── */
.lg-toolbar, .hw-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 18px;
}
.button-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.button-row .primary-action,
.button-row .secondary-action { min-height: 34px; }

/* ═══ Hubwellen: Wellen-Konfiguration (left panel) ═══════════════════════ */
.wave-tz-note { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.wave-config-row {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) minmax(0,1fr) 30px;
  gap: 6px 12px; align-items: end; margin-bottom: 10px;
}
.wave-label-tag {
  display: grid; place-items: center; width: 30px; height: 34px; align-self: end;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 700;
  background: var(--surface-3); color: var(--ink);
}
.wave-label-tag.wave-a { background: var(--wave-a-bg); color: var(--wave-a); }
.wave-label-tag.wave-b { background: var(--wave-b-bg); color: var(--wave-b); }
.wave-label-tag.wave-c { background: var(--wave-c-bg); color: var(--wave-c); }
.wave-label-tag.wave-d { background: var(--wave-d-bg); color: var(--wave-d); }
.compact-label {
  display: grid; gap: 4px; margin: 0;
  font-size: 10px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.compact-label input[type="time"] { min-height: 34px; font-size: 13px; }
.wave-remove-btn {
  align-self: end; width: 30px; height: 34px; min-height: 0 !important;
  padding: 0 !important; display: grid !important; place-items: center;
  border-radius: var(--radius-sm); justify-self: center;
}
.wave-legend { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }

/* ═══ Hubwellen table ════════════════════════════════════════════════════ */
.hubwellen-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hubwellen-table { min-width: 1100px; border-collapse: collapse; width: 100%; font-size: 13px; }
.hubwellen-table th, .hubwellen-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top;
}
.hubwellen-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: center; font-size: 11px; text-transform: uppercase; }
.hw-dest-col { min-width: 150px; text-align: left !important; position: sticky; left: 0; z-index: 3; background: var(--surface-2) !important; }
.hw-dest-cell { position: sticky; left: 0; background: var(--surface) !important; z-index: 1; min-width: 150px; }
.hw-city { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.hw-country { display: block; font-size: 10px; color: var(--faint); }
.wave-sub { font-weight: 600; font-size: 10px; }
.wave-sub-a { background: color-mix(in srgb, var(--wave-a-bg) 55%, var(--surface)) !important; color: var(--wave-a); }
.wave-sub-b { background: color-mix(in srgb, var(--wave-b-bg) 55%, var(--surface)) !important; color: var(--wave-b); }
.wave-sub-c { background: color-mix(in srgb, var(--wave-c-bg) 55%, var(--surface)) !important; color: var(--wave-c); }
.wave-sub-d { background: color-mix(in srgb, var(--wave-d-bg) 55%, var(--surface)) !important; color: var(--wave-d); }
.wave-cell { min-width: 110px; vertical-align: top; padding: 0 !important; }
.wave-cell-a { background: color-mix(in srgb, var(--wave-a-bg) 18%, var(--surface)); }
.wave-cell-b { background: color-mix(in srgb, var(--wave-b-bg) 18%, var(--surface)); }
.wave-cell-c { background: color-mix(in srgb, var(--wave-c-bg) 18%, var(--surface)); }
.wave-cell-d { background: color-mix(in srgb, var(--wave-d-bg) 18%, var(--surface)); }
.cell-empty { color: var(--faint); font-size: 13px; }
/* Multiple flights from same airport: clear separation */
.wave-flight-entry {
  display: flex; flex-direction: column; gap: 1px; padding: 5px 8px;
  border-bottom: 1px solid var(--line); cursor: pointer; transition: filter .12s;
}
.wave-flight-entry:last-child { border-bottom: none; }
.wave-flight-entry:hover { filter: brightness(.95); }
.wf-no   { font-weight: 700; font-size: 12px; color: var(--ink); }
.wf-type { font-size: 11px; color: var(--muted); }
.wf-time { font-size: 11px; color: var(--primary); font-variant-numeric: tabular-nums; }
/* Empty slot "+" → looks clickable */
.cell-empty-slot { vertical-align: middle; padding: 4px !important; }
.cell-add {
  display: block; text-align: center; font-size: 15px; line-height: 1;
  color: var(--faint); cursor: pointer; padding: 6px 0; margin: 2px;
  border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px dashed var(--line-2); transition: color .12s, background .12s, border-color .12s; user-select: none;
}
.cell-add:hover, .hw-dest-row:hover .cell-add {
  color: var(--primary); background: var(--primary-tint); border-color: var(--primary);
}
/* Region & subgroup grouping rows (light, Tower) */
.hw-region-row, .hw-sg-row { cursor: pointer; user-select: none; }
.hw-region-cell {
  padding: 9px 14px !important; background: var(--primary-tint) !important;
  font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--primary-ink); border-bottom: 1px solid var(--line) !important;
}
.hw-region-row:hover .hw-region-cell { background: color-mix(in srgb, var(--primary-tint) 70%, var(--surface)) !important; }
.hw-region-id { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px; background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary-ink); font-size: 11px; font-weight: 700; margin-right: 8px; }
.hw-region-label { font-weight: 700; font-size: 13px; color: var(--primary-ink); }
.hw-sg-cell { padding: 6px 14px 6px 26px !important; background: var(--surface-2) !important; font-size: 12px; border-bottom: 1px solid var(--line) !important; }
.hw-sg-row:hover .hw-sg-cell { background: var(--surface-3) !important; }
.group-id { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 700; margin-right: 8px; }
.group-name { font-weight: 600; font-size: 13px; color: var(--ink); margin-right: 8px; }
.group-range { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

/* ── Small triangle toggle icon (region/subgroup/hubwellen) ──────────── */
.hw-toggle-icon { display: inline-block; width: 14px; font-size: 9px; color: var(--muted); flex-shrink: 0; }

/* ═══ Regionen page ══════════════════════════════════════════════════════ */
.lg-intro { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.lg-empty-state { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); }
.lg-empty-cta { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lg-empty-cta .hint-text { max-width: 46ch; }
.lg-occ { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; vertical-align: middle; border: 1px solid transparent; cursor: help; }
.lg-occ.occ-empty { color: var(--muted); background: color-mix(in oklch, var(--muted) 12%, transparent); }
.lg-occ.occ-part  { color: var(--action); background: color-mix(in oklch, var(--action) 14%, transparent); }
.lg-occ.occ-full  { color: var(--danger); background: color-mix(in oklch, var(--danger) 14%, transparent); }
.lg-region { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.lg-collapsible { cursor: pointer; user-select: none; }
.lg-region-header {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; background: var(--primary-tint); border-bottom: 1px solid var(--line);
}
.lg-region-header:hover { background: color-mix(in srgb, var(--primary-tint) 70%, var(--surface)); }
.lg-region-id { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary-ink); font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.lg-region-label { font-weight: 700; font-size: 14px; color: var(--primary-ink); }
.lg-region-range { font-size: 11.5px; color: var(--primary-ink); opacity: .75; font-family: var(--font-mono); margin-left: 2px; }
.lg-region-actions { margin-left: auto; display: flex; gap: 4px; }
.lg-region-actions .table-action { color: var(--primary-ink); }
.lg-region-actions .table-action.danger { color: var(--red); }
/* Region table */
.lg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lg-table th, .lg-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.lg-table th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.lg-table tr:last-child td { border-bottom: none; }
.lg-sg-row.is-collapsible { cursor: pointer; }
.lg-sg-row:hover > td { background: var(--surface-2); }
/* Toggle arrows: small, borderless; pointer-events off so row click toggles */
.lg-sg-toggle {
  background: none; border: none; cursor: pointer; font-size: 9px;
  color: var(--muted); padding: 0 4px 0 0; line-height: 1; vertical-align: middle;
  pointer-events: none;
}
.lg-sg-code-label { font-weight: 600; font-size: 13px; }
.lg-sg-code { font-size: 11px; font-weight: 700; font-family: var(--font-mono); color: var(--primary); margin-right: 4px; }
.lg-sg-label { margin-left: 2px; }
.lg-airport-row > td { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.lg-airport-dot { color: var(--primary); font-weight: 700; margin-right: 4px; }
.lg-code-edit { display: inline-flex; align-items: center; gap: 1px; font-family: var(--font-mono); }
.lg-code-fixed { color: var(--muted); font-weight: 700; font-family: var(--font-mono); letter-spacing: 1px; }
.lg-add-row td, .lg-add-sg-row td { padding: 10px 12px; background: var(--surface-2); }
.lg-add-row-styled { padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
/* L2 add-subgroup country picker */
.lg-l2-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.lg-field { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin: 0; }
.lg-country-search { min-height: 32px; }
.lg-country-sonstiges { display: flex; align-items: center; gap: 6px; padding: 7px 10px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; }
.lg-country-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px; background: var(--surface);
}
.lg-country-opt { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.lg-country-opt:hover { background: var(--surface-2); }
.lg-l2-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.lg-new-digit { font-family: var(--font-mono); font-weight: 700; }
.lg-inline-input { background: #fff; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.lg-apt-input { min-height: 32px; }
.lg-apt-list { list-style: none; margin: 0; padding: 0; }
.lg-apt-item { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: var(--radius-sm); }
.lg-apt-item:hover { background: var(--surface-2); }
.lg-apt-iata { font-family: var(--font-mono); font-weight: 700; font-size: 13px; min-width: 36px; color: var(--primary); }
.lg-subranges-wrap { display: flex; flex-direction: column; }
.lg-subrange { padding: 4px 0; border-top: 1px solid var(--line); }
.lg-subrange:first-child { border-top: none; }
.lg-sr-code { font-family: var(--font-mono); font-weight: 700; color: var(--primary); font-size: 11px; }
.lg-sonstiges-tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px; background: var(--secondary-tint); color: var(--secondary-ink); font-size: 11px; font-weight: 700; }

/* ═══ Routen: tile view ══════════════════════════════════════════════════ */
.route-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.route-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.route-card.route-link { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, background .12s ease; }
.route-card.route-link:hover { border-color: color-mix(in oklch, var(--action) 55%, var(--line)); box-shadow: 0 1px 0 color-mix(in oklch, var(--action) 20%, transparent); background: color-mix(in oklch, var(--action) 4%, var(--surface)); }
.route-card.route-link:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.route-card > div > strong { display: block; font-size: 15px; font-weight: 700; color: var(--ink); }
.route-card .route-group-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px; background: var(--primary-tint); color: var(--primary-ink); font-size: 11px; font-weight: 600; }
.route-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.route-card dl > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.route-card dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
.route-card dd { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.route-card dd[style] { font-weight: 600; }
.route-card dd.route-profit-pos { color: var(--ok, #2e9e5b); }
.route-card dd.route-profit-neg { color: var(--danger, #d1435b); }

/* ═══ Flughäfen: country expand toggle (small, borderless) ───────────── */
.apt-country-header > td, .apt-country-cell { background: var(--surface-2); }
.apt-country-cell { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.apt-country-cell strong { font-weight: 600; }
.apt-country-toggle {
  background: none; border: none; cursor: pointer; padding: 0; margin: 0;
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--muted); line-height: 1;
}
.apt-country-toggle:hover { color: var(--ink); }
.flight-variant-count { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 600; }

/* ═══ Kabinenkonfiguration: Y/C/F seat grid (fit inside panel) ────────── */
.seat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seat-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; min-width: 0; }
.seat-grid input { min-width: 0; width: 100%; }

/* ═══ Einstellungen: action buttons row ──────────────────────────────── */
.settings-actions, #saveSettingsBtn ~ #resetSettingsBtn { }
#saveSettingsBtn, #resetSettingsBtn { min-height: 38px; }

/* ═══ Airline selector modal ═════════════════════════════════════════════ */
/* Real popup over the app (semi-transparent backdrop) */
#airlineSelectorModal.auth-overlay { background: oklch(20% 0.012 260 / .45); backdrop-filter: blur(2px); }
.airline-selector-card { width: min(560px, 94vw) !important; align-items: stretch !important; text-align: left; max-height: 88vh; overflow-y: auto; }
.airline-list { display: flex; flex-direction: column; gap: 14px; }
/* Group: own holdings vs shared — distinct tint + heading */
.as-holding-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.as-holding-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.as-holding-title strong { font-size: 13px; color: var(--ink); }
.as-world-badge, .as-world-tag { font-size: 11px; color: var(--muted); }
.as-airline-row { display: flex; align-items: stretch; gap: 6px; margin-bottom: 6px; }
.as-airline-row:last-child { margin-bottom: 0; }
.as-airline-row--active .as-airline-btn { border-color: var(--primary); background: var(--primary-tint); }
.as-airline-btn { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; text-align: left; }
.as-airline-btn:hover { border-color: var(--primary); }
.as-airline-btn-main { display: flex; flex-direction: column; gap: 2px; }
.as-airline-name { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.as-row-actions { display: flex; flex-direction: column; gap: 3px; }
.as-edit-btn,
.as-delete-btn { display: grid; place-items: center; width: 26px; height: 18px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; }
.as-edit-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.as-delete-btn:hover { color: var(--danger, #dc2626); border-color: var(--danger, #dc2626); }

/* Delete-Bestätigungs-Overlay */
.as-delete-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); border-radius: inherit; display: flex; align-items: center; justify-content: center; z-index: 10; }
.as-delete-dialog { background: var(--surface); border-radius: var(--radius); padding: 20px; width: min(340px, 90%); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.18)); }
.as-delete-warning { font-size: 13.5px; color: var(--ink); line-height: 1.5; margin: 0; }
.as-delete-label { font-size: 12px; color: var(--muted); }
.as-delete-input { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 13px; background: var(--bg); color: var(--ink); }
.as-delete-actions { display: flex; gap: 8px; justify-content: flex-end; }
.as-delete-cancel-btn { padding: 6px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 13px; }
.as-delete-confirm-btn { padding: 6px 14px; border-radius: var(--radius-sm); background: var(--danger, #dc2626); color: #fff; border: none; cursor: pointer; font-size: 13px; font-weight: 600; }
.as-delete-confirm-btn:disabled { opacity: 0.4; cursor: default; }
/* Shared airlines group → secondary tint so it differs from own */
.as-holding-group.as-shared { background: var(--secondary-tint); border-color: color-mix(in srgb, var(--secondary) 30%, var(--line)); }
.role-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.role-badge.role-owner { background: var(--primary-tint); color: var(--primary-ink); }
.as-new-airline-section { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 10px 12px; }
.as-new-airline-toggle { display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary); padding: 0; }
.as-invite-section { border: 1px solid var(--secondary); border-radius: var(--radius); padding: 10px 12px; background: var(--secondary-tint); }
.as-section-label { font-size: 12px; font-weight: 700; color: var(--secondary-ink); margin-bottom: 8px; }
.as-invite-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.as-invite-actions { display: flex; gap: 6px; }
.selector-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.as-section-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 -4px; }

/* ═══ Airport autocomplete dropdown (Von/Nach single-choice search) ───── */
.apt-ac-dropdown {
  position: fixed; z-index: 9999; list-style: none; margin: 0; padding: 4px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-y: auto; max-height: 240px; min-width: 200px;
}
.apt-ac-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; overflow: hidden;
}
.apt-ac-item:hover, .apt-ac-item.apt-ac-active { background: var(--surface-2); }
.apt-ac-iata { font-family: var(--font-mono); font-weight: 700; font-size: 12.5px; color: var(--primary); min-width: 34px; flex-shrink: 0; }
.apt-ac-city { flex: 1; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.apt-ac-country { font-size: 11px; color: var(--muted); flex-shrink: 0; }
input.apt-ac-invalid { border-color: var(--red) !important; background: var(--red-tint) !important; }
input.apt-ac-invalid:focus { outline-color: var(--red) !important; }

/* ═══ Routendetails: Von/Nach selector layout ────────────────────────── */
.rd-selectors {
  display: grid;
  grid-template-columns: minmax(150px, 240px) auto minmax(150px, 240px) auto;
  gap: 8px 12px; align-items: end;
}
.rd-selectors > label {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; margin: 0;
  font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.rd-selectors > label > input { width: 100%; }
.rd-selectors > label:has(#rdFrom) { grid-column: 1; grid-row: 1; }
#rdSwap   { grid-column: 2; grid-row: 1; align-self: end; }
.rd-selectors > label:has(#rdTo)   { grid-column: 3; grid-row: 1; }
#rdLoad   { grid-column: 4; grid-row: 1; align-self: end; }
.rd-both-dirs-label {
  grid-column: 1; grid-row: 2; flex-direction: row !important; align-items: center !important;
  gap: 6px; text-transform: none !important; font-weight: 500 !important; color: var(--ink-2) !important;
}
.rd-both-dirs-label input { width: auto; }

/* ═══ Einstellungen: widgets only as tall as their content ────────────── */
#settingsView .split-layout { align-items: start; }

/* ═══ Airline anlegen form ───────────────────────────────────────────── */
.as-new-airline-form { display: flex; flex-direction: column; gap: 12px; }
.anf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.anf-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0;
  font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.anf-field.anf-full { grid-column: 1 / -1; }
.anf-field input, .anf-field select { width: 100%; }
.anf-actions { display: flex; justify-content: flex-end; }
.anf-error { color: var(--red); font-size: 12px; margin: 0; }

/* ── Slot-Nutzungsanalyse (Phase 26) ─────────────────────────────────────── */
.slot-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.slot-head h2 { margin: 0; }

/* Such-Dropdown Flughafenauswahl */
.slot-airport-picker { position: relative; min-width: 260px; }
.slot-airport-picker input {
  width: 100%; padding: 7px 11px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; background: var(--card, #fff); color: var(--ink); font-size: .9rem;
}
.slot-airport-picker input:focus { outline: none; border-color: var(--nav, #1e3a5f); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav, #1e3a5f) 18%, transparent); }
.slot-dd-list {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 320px; overflow-y: auto; background: var(--card, #fff);
  border: 1px solid var(--border, #e5e7eb); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18); padding: 4px;
}
.slot-dd-opt { padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: .85rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-dd-opt:hover { background: color-mix(in srgb, var(--nav, #1e3a5f) 10%, transparent); }
.slot-dd-opt.active { background: color-mix(in srgb, var(--nav, #1e3a5f) 16%, transparent); font-weight: 600; }
.slot-dd-opt.muted { color: var(--muted, #6b7280); cursor: default; }

.slot-btn {
  position: relative; overflow: hidden;
  padding: 7px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  background: var(--nav, #1e3a5f); color: #fff; font-size: .85rem; cursor: pointer;
}
.slot-btn:hover { filter: brightness(1.08); }
.slot-btn[disabled] { cursor: progress; opacity: .85; filter: none; }
/* Indeterminierter Ladebalken am Button-Unterrand während des Crawls */
.slot-btn.is-loading::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 40%;
  background: rgba(255, 255, 255, .9); border-radius: 3px;
  animation: slot-btn-bar 1.1s ease-in-out infinite;
}
@keyframes slot-btn-bar {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Nachtflugverbot-Banner */
.slot-nightban {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  padding: 9px 13px; border-radius: 9px; font-size: .85rem;
  background: color-mix(in srgb, #6366f1 12%, var(--card, #fff));
  border: 1px solid color-mix(in srgb, #6366f1 35%, transparent); color: var(--ink);
}

.slot-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .8rem; margin-bottom: 12px; color: var(--ink); }
.slot-legend .lg { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 13px; border-radius: 3px; font-size: 9px; }
.slot-legend .slot-own-key { border: 2px solid var(--slot-own-border, #2563eb); background: transparent; }
.slot-legend .slot-blocked-key { background: var(--slot-blocked-bg, #334155); color: #fff; }
.slot-legend .slot-nodata-key { background: var(--surface-3); border: 1px dashed var(--line-2); }
.slot-freshness { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 500; }
.slot-freshness::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.slot-fresh-fresh { background: var(--green-tint); color: oklch(35% 0.08 155); }
.slot-fresh-fresh::before { background: var(--green); }
.slot-fresh-stale { background: var(--warning-tint); color: var(--secondary-ink); }
.slot-fresh-stale::before { background: var(--warning); }
.slot-fresh-old { background: var(--red-tint); color: var(--red); }
.slot-fresh-old::before { background: var(--red); }
.slot-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem;
  background: color-mix(in srgb, var(--nav, #1e3a5f) 12%, transparent); color: var(--ink);
}
.slot-gran { margin-left: auto; }

.slot-grid-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .72rem; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 0 var(--border, #e5e7eb); }
.slot-grid-table th { background: color-mix(in srgb, var(--nav, #1e3a5f) 9%, var(--card, #fff)); color: var(--ink); font-weight: 600; padding: 6px 4px; }
.slot-grid-table th, .slot-grid-table td { border-bottom: 1px solid var(--border, #e5e7eb); border-right: 1px solid var(--border, #e5e7eb); padding: 3px 5px; text-align: center; }
.slot-grid-table th:first-child, .slot-grid-table td:first-child { border-left: 1px solid var(--border, #e5e7eb); }
.slot-grid-table tr:first-child th { border-top: 1px solid var(--border, #e5e7eb); }
.slot-grid-table .slot-time, .slot-grid-table .slot-time-h { text-align: right; color: var(--muted, #6b7280); white-space: nowrap; font-variant-numeric: tabular-nums; background: var(--card, #fff); position: sticky; left: 0; }
.slot-cell { position: relative; color: #1f2937; font-variant-numeric: tabular-nums; transition: filter .1s; }
.slot-cell:hover { filter: brightness(.93); }
.slot-cell.slot-own { outline: 2px solid var(--slot-own-border, #2563eb); outline-offset: -2px; }
.slot-cell.slot-clickable { cursor: pointer; }
.slot-cell.slot-clickable:hover { filter: brightness(.88); outline-width: 2px; }
/* Farbige Wellen-Punkte (eine je Welle) in der Ecke einer Zelle mit eigenen Flügen */
.slot-dots { position: absolute; top: 1px; right: 1px; display: flex; gap: 1px; pointer-events: none; }
.slot-wave-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.7); }
/* Wellen-Legende */
.slot-wave-legend { display: inline-flex; align-items: center; gap: 5px; color: var(--muted, #6b7280); }
.slot-wave-chip { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
/* Popup-Tabelle: eigene Flüge im Zeitfenster */
.slot-flights-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.slot-flights-table th { text-align: left; color: var(--muted, #6b7280); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line, #e5e7eb); white-space: nowrap; }
.slot-flights-table td { padding: 5px 8px; border-bottom: 1px solid var(--line, #e5e7eb); }
.slot-flights-table .mono { font-variant-numeric: tabular-nums; }
.slot-dir-dep { color: var(--primary); font-weight: 600; }
.slot-dir-arr { color: var(--green); font-weight: 600; }
.slot-wave-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.slot-flights-table .slot-edit-cell { text-align: right; width: 1%; white-space: nowrap; }
.slot-edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--line, #e5e7eb); background: var(--surface, #fff);
  color: var(--muted, #6b7280); cursor: pointer; font-size: 13px; transition: color .12s, border-color .12s;
}
.slot-edit-btn:hover { color: var(--primary, #2563eb); border-color: var(--primary, #2563eb); }
.slot-flights-table tbody tr:hover { background: color-mix(in srgb, var(--nav, #1e3a5f) 5%, transparent); }
.slot-cell.slot-blocked { background: var(--slot-blocked-bg, #334155); color: #cbd5e1; font-weight: 600; }
.slot-row-blocked .slot-time { color: #6366f1; font-weight: 600; }
.slot-empty { color: var(--muted, #6b7280); padding: 18px 0; }

/* Aufklappbare Stunden → 5-Min-Detail */
.slot-time--exp { cursor: pointer; user-select: none; }
.slot-time--exp:hover { background: color-mix(in srgb, var(--nav, #1e3a5f) 8%, var(--card, #fff)); color: var(--ink); }
.slot-exp-ico { display: inline-block; width: 1em; margin-right: 2px; color: var(--muted, #6b7280); }
.slot-sub-row .slot-time--sub { text-align: right; color: var(--muted, #6b7280); font-size: .66rem; padding-left: 16px; background: color-mix(in srgb, var(--nav, #1e3a5f) 6%, var(--card, #fff)); position: sticky; left: 0; }
.slot-cell--sub { font-size: .66rem; opacity: .96; }
.slot-sub-row td { padding-top: 2px; padding-bottom: 2px; }
/* Aufgeklappter 5-Min-Block deutlich vom Stunden-Raster abgesetzt (Rahmen) */
.slot-sub-row td:first-child { border-left: 3px solid var(--nav, #1e3a5f); }
.slot-sub-row td:last-child  { border-right: 3px solid var(--nav, #1e3a5f); }
.slot-sub-first td { border-top: 2px solid var(--nav, #1e3a5f); }
.slot-sub-last  td { border-bottom: 2px solid var(--nav, #1e3a5f); }
.slot-hint-5min { color: var(--muted, #6b7280); font-size: .72rem; font-style: italic; }

.slot-plan { margin-top: 22px; }
.slot-plan h3 { margin: 0 0 8px; }
.slot-plan-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.slot-plan-head select { padding: 5px 9px; border: 1px solid var(--border, #e5e7eb); border-radius: 7px; background: var(--card, #fff); color: var(--ink); }
.slot-plan-table { border-collapse: collapse; margin-top: 8px; font-size: .8rem; }
.slot-plan-table th, .slot-plan-table td { border: 1px solid var(--border, #e5e7eb); padding: 4px 10px; text-align: left; }
.slot-plan-table td:last-child { font-variant-numeric: tabular-nums; color: var(--ink); }

/* Flugvorschläge (Phase D) */
.slot-suggest-table { border-collapse: collapse; margin-top: 8px; font-size: .8rem; width: 100%; }
.slot-suggest-table th { text-align: left; color: var(--muted, #6b7280); font-weight: 600; padding: 5px 10px; border-bottom: 1px solid var(--line, #e5e7eb); white-space: nowrap; }
.slot-suggest-table td { padding: 5px 10px; border-bottom: 1px solid var(--line, #e5e7eb); }
.slot-suggest-table .mono { font-variant-numeric: tabular-nums; }
.slot-suggest-table tbody tr:hover { background: color-mix(in srgb, var(--nav, #1e3a5f) 5%, transparent); }
.slot-suggest-nodata { opacity: .85; }

/* Inline-Vorschlag im Flugformular */
.flight-suggest-hint {
  font-size: .8rem; color: var(--ink); background: color-mix(in srgb, var(--nav, #1e3a5f) 6%, var(--card, #fff));
  border: 1px solid var(--line, #e5e7eb); border-radius: var(--radius-sm, 6px);
  padding: 6px 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.flight-suggest-hint .flight-suggest-label { color: var(--muted, #6b7280); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   Chancen-View (Phase 30) – proaktive Ziel-/Zeit-Vorschläge
   ═══════════════════════════════════════════════════════════════════════ */

.opp-filters {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.opp-filters label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--ink-soft); }
.opp-filters label.opp-check { flex-direction: row; align-items: center; gap: 6px; }
.opp-filters input[type="number"], .opp-filters select {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2, #fff); color: var(--ink); min-width: 8ch;
}
.opp-filters #oppRun { margin-left: auto; }

.opp-hints { margin-bottom: 12px; }
.opp-progress { font-size: .82rem; color: var(--ink-soft); margin: 4px 0 12px; }

.opp-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

.opp-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.opp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.opp-route { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.opp-route strong { font-size: 1.02rem; }

.opp-badge {
  display: inline-block; padding: 1px 6px; border-radius: 999px;
  font-size: .68rem; letter-spacing: .02em;
  background: var(--line); color: var(--ink-soft);
}
.opp-badge--ok { background: color-mix(in oklch, var(--ok, #2e7d32) 18%, transparent); color: var(--ok, #2e7d32); }
.opp-badge--mode { background: color-mix(in oklch, var(--nav) 16%, transparent); color: var(--nav); }

/* Tri-State-Slot-Badge (grün frei / gelb eng / grau unbekannt) */
.opp-slot { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: .68rem;
  font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.opp-slot--ok { background: color-mix(in oklch, #2e7d32 16%, transparent); color: #1b5e20; }
.opp-slot--tight { background: color-mix(in oklch, #b8860b 20%, transparent); color: #8a5a00; }
.opp-slot--unknown { background: var(--surface-3, var(--line)); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .opp-slot--ok { color: #86efac; } .opp-slot--tight { color: #fcd34d; }
}
:root[data-theme="slate"] .opp-slot--ok { color: #86efac; }
:root[data-theme="slate"] .opp-slot--tight { color: #fcd34d; }

/* Slot-/Nachtflug-Ampel im Flugformular */
.flight-slot-ampel[hidden] { display: none; }
.flight-slot-ampel { display: flex; flex-direction: column; gap: 4px; margin-top: 2px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.slotchk-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.slotchk-row > strong { min-width: 96px; font-family: var(--mono, monospace); }
.slotchk { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
/* Kräftigere Füllung + dunkler Text = deutlich lesbarer (vorher kaum sichtbar,
   insbesondere „frei": das JS emittiert slotchk--free, wofür es GAR KEINE Regel gab). */
.slotchk--free, .slotchk--ok { background: color-mix(in oklch, #1b8a3f 26%, var(--surface)); color: #0f5c28; border-color: color-mix(in oklch, #1b8a3f 45%, transparent); }
.slotchk--tight { background: color-mix(in oklch, #b8860b 30%, var(--surface)); color: #6e4700; border-color: color-mix(in oklch, #b8860b 50%, transparent); }
.slotchk--full { background: color-mix(in oklch, var(--danger, #b4433a) 28%, var(--surface)); color: #8a241c; border-color: color-mix(in oklch, var(--danger, #b4433a) 50%, transparent); }
.slotchk--unknown { background: color-mix(in oklch, var(--muted) 18%, var(--surface)); color: var(--ink-2); border-color: var(--line-2); }
.slotchk--night { background: color-mix(in oklch, var(--danger, #b4433a) 26%, var(--surface)); color: #8a241c; border-color: color-mix(in oklch, var(--danger, #b4433a) 50%, transparent); }
.slotchk-plus1 { font-size: 11px; color: var(--muted); }
.slotchk-load { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--action); background: transparent; color: var(--action); cursor: pointer; }
.slotchk-load:hover { background: color-mix(in oklch, var(--action) 12%, transparent); }
.slotchk-load:disabled { opacity: .6; cursor: default; }
.subtab-count { font-size: .82em; font-weight: 500; color: var(--muted); }
.fleet-bulk { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.fleet-bulk > summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.fleet-bulk .fleet-bulk-gen { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.fleet-bulk textarea { width: 100%; font-family: var(--mono, monospace); font-size: 12.5px; resize: vertical; }
.fleet-bulk code { font-size: 12px; background: color-mix(in oklch, var(--muted) 10%, transparent); padding: 0 4px; border-radius: 4px; }
@media (prefers-color-scheme: dark) {
  .slotchk--free, .slotchk--ok { color: #9df3b6; }
  .slotchk--tight { color: #fcd34d; }
  .slotchk--full, .slotchk--night { color: #ffb4ab; }
  .slotchk--unknown { color: var(--ink); }
}
:root[data-theme="slate"] .slotchk--free, :root[data-theme="slate"] .slotchk--ok { color: #9df3b6; }
:root[data-theme="slate"] .slotchk--tight { color: #fcd34d; }
:root[data-theme="slate"] .slotchk--full, :root[data-theme="slate"] .slotchk--night { color: #ffb4ab; }

/* Wellen-Badges (Farben inline aus getWaveColor) */
.opp-waves { display: inline-flex; gap: 3px; vertical-align: middle; }
.opp-wave-badge { display: inline-block; min-width: 1.5em; text-align: center; padding: 1px 5px;
  border-radius: 5px; font-size: .66rem; font-weight: 700; letter-spacing: .02em; }

.opp-spinner { font-size: .8rem; animation: opp-pulse 1.4s ease-in-out infinite; }
@keyframes opp-pulse { 0%,100% { opacity:.35 } 50% { opacity:1 } }

/* Phase-1-Ladezustand: klar sichtbarer, animierter Block statt stummem Text,
   damit „Chancen berechnen" nicht wie ein Absturz wirkt. */
.opp-computing { display: flex; align-items: center; gap: 12px; padding: 18px 16px; margin-top: 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.opp-computing .ring { flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid color-mix(in oklch, var(--nav) 25%, transparent);
  border-top-color: var(--nav); animation: opp-spin .8s linear infinite; }
.opp-computing .opp-computing-text { font-weight: 600; }
@keyframes opp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .opp-computing .ring { animation-duration: 2s; }
}
#oppRun[disabled] { opacity: .6; cursor: progress; }

.opp-score { display: flex; align-items: center; gap: 6px; min-width: 96px; }
.opp-score-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.opp-score-bar > span { display: block; height: 100%; background: var(--action); }
.opp-score-num { font-size: .72rem; color: var(--ink-soft); min-width: 2.5ch; text-align: right; }

.opp-plan { font-size: .82rem; margin: 0; }
.opp-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.opp-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 999px; font-size: .68rem;
  background: color-mix(in oklch, var(--nav) 10%, transparent); color: var(--ink-soft);
}
.opp-chip b { color: var(--ink); font-weight: 600; }
.opp-chip--daypartGap { background: color-mix(in oklch, var(--action) 14%, transparent); }
.opp-chip--saturationPenalty, .opp-chip--blocked {
  background: color-mix(in oklch, var(--danger) 12%, transparent); color: var(--danger);
}
.opp-meta { font-size: .74rem; color: var(--ink-soft); margin: 0; }
.opp-warn { font-size: .74rem; color: var(--danger); margin: 0; }

.opp-card-foot { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
.opp-foot-spacer { flex: 1 1 auto; }
.opp-card--saved { border-color: color-mix(in oklch, var(--action) 45%, var(--line)); box-shadow: 0 0 0 1px color-mix(in oklch, var(--action) 25%, transparent); }
.opp-star { color: var(--action); }
.opp-mark-save.is-on { color: var(--action); font-weight: 600; }
.opp-dismissed-bar { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); font-size: .84rem; }
.opp-grid--dismissed { opacity: .62; }

.opp-infeasible { margin-top: 18px; }
.opp-infeasible summary { cursor: pointer; font-size: .82rem; color: var(--ink-soft); }
.opp-infeasible ul { list-style: none; padding: 10px 0 0; margin: 0; display: grid; gap: 5px; }
.opp-infeasible li { display: flex; align-items: center; gap: 6px; font-size: .76rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .opp-filters #oppRun { margin-left: 0; width: 100%; }
  .opp-card-head { flex-direction: column; align-items: flex-start; }
  .opp-score { width: 100%; }
}

/* Vorschlags-Einstellungen (Phase 30) */
.suggest-settings-grid {
  display: grid; gap: 10px 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  margin: 10px 0;
}
.suggest-settings-grid label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .8rem; color: var(--ink-soft);
}

/* Chancen-View v2: Wochentage, Optionen, Diagnose */
.opp-filter-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; width: 100%; }
.opp-filters { flex-direction: column; align-items: stretch; }
.opp-days { display: flex; flex-direction: column; gap: 4px; }
.opp-days-label { font-size: .78rem; color: var(--ink-soft); }
.opp-filter-row #oppRun { margin-left: auto; }
.opp-filter-primary { align-items: flex-end; }
/* "Erweiterte Filter" – sekundäre Controls einklappbar */
.opp-adv { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.opp-adv > summary { cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--muted);
  list-style: none; user-select: none; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; }
.opp-adv > summary::-webkit-details-marker { display: none; }
.opp-adv > summary::before { content: "▸"; font-size: .7em; transition: transform .15s; }
.opp-adv[open] > summary::before { transform: rotate(90deg); }
.opp-adv > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.opp-adv .opp-filter-row { margin-top: 10px; }

.opp-diag { margin: 4px 0 14px; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.opp-diag summary { cursor: pointer; font-size: .84rem; }
.opp-diag-body ul { margin: 4px 0 10px; padding-left: 20px; font-size: .78rem; color: var(--ink-soft); }
.opp-diag-body p { margin: 6px 0 2px; font-size: .8rem; }

.opp-badge--alt { background: color-mix(in oklch, var(--action) 18%, transparent); color: var(--action); }
.opp-badge--buy { background: color-mix(in oklch, var(--danger) 14%, transparent); color: var(--danger); }
.opp-badge--current { background: color-mix(in oklch, var(--ok, #2e9e5b) 18%, transparent); color: var(--ok, #2e9e5b); }
.opp-badge--freq { background: color-mix(in oklch, var(--ok, #2e9e5b) 14%, transparent); color: var(--ok, #2e9e5b); cursor: help; }
.opp-buy-advice { margin: 10px 0; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2); }
.opp-buy-advice summary { cursor: pointer; font-weight: 600; }
.opp-buy-advice-list { margin: 8px 0 4px 18px; display: grid; gap: 4px; }
.opp-buy-advice-list strong { margin-right: 6px; }

.opp-toggle { margin-top: 6px; padding: 3px 0; background: none; border: none;
  color: var(--nav); font-size: .78rem; cursor: pointer; text-align: left; }
.opp-toggle:hover { text-decoration: underline; }

.opp-expand { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.opp-expand h4 { margin: 8px 0 6px; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-soft); }

.opp-options { display: grid; gap: 6px; }
.opp-option { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.opp-option.is-chosen { border-color: var(--action); background: color-mix(in oklch, var(--action) 6%, transparent); }
.opp-option input { grid-row: 1 / span 3; align-self: center; }
.opp-option-main { font-size: .84rem; }
.opp-option-times { font-size: .78rem; color: var(--ink-soft); }
.opp-option-meta { font-size: .72rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.opp-perday { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 3px; font-size: .78rem; }
.opp-perday li { display: flex; gap: 10px; }
.opp-comp-detail p { margin: 2px 0; font-size: .78rem; color: var(--ink-soft); }

/* Slot-Backfill-Banner */
.opp-backfill {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; margin: 0 0 14px;
  background: color-mix(in oklch, var(--action) 7%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--action) 30%, var(--line));
  border-radius: var(--radius);
}
.opp-backfill-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; }
.opp-backfill-text strong { font-size: .84rem; }
.opp-backfill-bar { flex: 1 1 160px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.opp-backfill-bar > span { display: block; height: 100%; background: var(--action); transition: width .3s ease; }
.opp-backfill.is-running { background: color-mix(in oklch, var(--nav) 6%, var(--surface)); }

/* Slot-Verlauf */
.slot-hist { margin-top: 22px; padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.slot-hist h3 { margin: 0 0 2px; font-size: .95rem; }
.slot-hist > .hint-text { margin: 0 0 10px; }
.slot-hist-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.slot-hist-controls label { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--ink-soft); }
.slot-hist-controls select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2, #fff); color: var(--ink); }
.slot-hist-controls select:disabled { opacity: .45; }
.slot-hist svg { display: block; max-width: 100%; }

.apt-coord-warn { color: var(--danger); font-weight: 500; cursor: help; }
.opp-diag-fix { margin: 8px 0 4px; padding: 8px 10px; font-size: .78rem;
  background: color-mix(in oklch, var(--action) 8%, transparent);
  border-left: 3px solid var(--action); border-radius: 4px; }

/* Chancen-Redesign: Kontext-Kopf, Konkurrenz-Filter, Warum-Zeile, Vorschau, Toast */
.opp-context {
  display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline;
  padding: 9px 14px; margin: 0 0 12px; font-size: .8rem; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.opp-context strong { color: var(--ink); }

.opp-comp-filter { align-items: center; gap: 6px 8px; }
.opp-comp-source { flex-basis: 100%; margin-top: 2px; opacity: 0.85; }
.opp-comp-chip {
  padding: 3px 9px; border-radius: 999px; font-size: .76rem; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.opp-comp-chip small { opacity: .6; margin-left: 3px; }
.opp-comp-chip.active { background: color-mix(in oklch, var(--nav) 14%, transparent); color: var(--nav); border-color: transparent; }
.opp-comp-all.active { background: color-mix(in oklch, var(--action) 16%, transparent); color: var(--action); }

.opp-why { font-size: .9rem; font-weight: 500; color: var(--ink); margin: 0 0 4px; }

.opp-apply-card { min-width: min(560px, 92vw); }
.opp-apply-legs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 12px 0; }
.opp-apply-leg { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.opp-apply-leg legend { font-weight: 600; font-size: .85rem; padding: 0 4px; }
.opp-apply-leg label { display: flex; flex-direction: column; gap: 3px; font-size: .76rem; color: var(--ink-soft); }
.opp-apply-leg input { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2, #fff); color: var(--ink); }
.opp-apply-days { font-size: .76rem; color: var(--ink-soft); }
.opp-apply-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.opp-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  display: flex; align-items: center; gap: 14px; z-index: 1000;
  padding: 11px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  background: var(--ink, #1f2937); color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  transition: opacity .2s ease, transform .2s ease; font-size: .85rem;
}
.opp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.opp-toast button { background: none; border: none; color: var(--action-bright, #7dd3fc); font-weight: 600; cursor: pointer; }

/* Chancen-Übergabe-Banner im Flugplan-Formular */
.opp-handover {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  /* Banner wird als Kind der zweispaltigen .split-layout eingefügt – volle Breite spannen,
     sonst rutscht die Flugplan-Tabelle in die 340px-Formularspalte (Layout-Bug). */
  grid-column: 1 / -1;
  padding: 9px 13px; margin: 0 0 12px; flex-wrap: wrap;
  background: color-mix(in oklch, var(--action) 12%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--action) 35%, var(--line));
  border-radius: var(--radius); font-size: .84rem;
}
.opp-handover button { flex: none; }
.opp-handover-times { flex-basis: 100%; opacity: 0.9; font-size: 0.8rem; }

/* ── Netzwerk-Gesundheits-Dashboard (Analysen) ───────────────────────── */
.network-health:empty { display: none; }
.network-health { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px; }
.data-health:empty { display: none; }
.data-health { margin-bottom: 18px; }
.nh-section-head { display: flex; align-items: baseline; gap: 10px; font-weight: 600; font-size: 14px; margin: 2px 0 8px; color: var(--ink); }
.nh-section-head .nh-hint { font-weight: 400; font-size: 12px; color: var(--ink-2); }
.data-health .network-health { margin-bottom: 0; }
.nh-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: left; }
.nh-link { cursor: pointer; transition: border-color .12s, background .12s; }
.nh-link:hover { border-color: var(--ink-2); background: var(--surface-2); }
.nh-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.nh-val { font-size: 22px; font-weight: 650; color: var(--ink); line-height: 1.1; }
.nh-label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-top: 4px; }
.nh-bad .nh-val { color: var(--red); }
.nh-warn .nh-val { color: var(--secondary-ink); }
.nh-ok .nh-val { color: var(--green); }

/* ── Hubwellen: Anschlussqualität ────────────────────────────────────── */
.hw-connectivity:empty { display: none; }
.hw-connectivity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 14px; }
.hw-conn-kpi { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 11px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted); }
.hw-conn-kpi b { font-size: 15px; font-weight: 650; color: var(--ink); text-transform: none; letter-spacing: 0; }
.hw-conn-warn b { color: var(--red); }
.hw-conn-hint { font-size: 12px; color: var(--muted); font-style: italic; }

/* ── Routendetail: Marktanteil-Karten (V3) ───────────────────────────── */
.rd-summary-card.rd-card-good { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.rd-summary-card.rd-card-good .rd-summary-value { color: var(--green); }
.rd-summary-card.rd-card-warn { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.rd-summary-card.rd-card-warn .rd-summary-value { color: var(--red); }

/* ── Flugplan: Umlaufkonflikte (V1) ──────────────────────────────────── */
#flightConflictBanner:empty { display: none; }
.flight-conflict-warn { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 999px;
  background: var(--red-tint); color: var(--red); font-size: 12px; font-weight: 600; cursor: pointer; }
.flight-conflict-warn:hover { filter: brightness(0.97); text-decoration: underline; }
.flight-conflict-badge { color: var(--red); font-weight: 700; cursor: help; }
.flight-plan-badge { color: var(--danger, #b4433a); font-weight: 800; cursor: help; }
.ms-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; background: color-mix(in oklch, var(--muted) 14%, transparent); color: var(--ink-2); }
.ms-badge.ms-lead { color: var(--action); background: color-mix(in oklch, var(--action) 15%, transparent); }
.ms-badge.ms-weak { color: var(--danger, #b4433a); background: color-mix(in oklch, var(--danger, #b4433a) 14%, transparent); }

/* Konkurrenzanalyse: Marktanteils-Balken neben der %-Badge (Überschneidungen-Tabelle) */
.ms-share-cell { display: flex; align-items: center; gap: 8px; }
.share-bar.bar-track { width: 56px; height: 6px; flex: none; }

/* Command-Palette (Cmd/Ctrl+K) */
.cmdp-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh; background: color-mix(in oklch, #000 45%, transparent); }
.cmdp-card { width: min(620px, 92vw); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.cmdp-input { width: 100%; box-sizing: border-box; padding: 16px 18px; font-size: 16px; border: none; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); outline: none; }
.cmdp-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.cmdp-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.cmdp-item.active { background: color-mix(in oklch, var(--action) 14%, transparent); }
.cmdp-kind { flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px;
  background: color-mix(in oklch, var(--muted) 16%, transparent); color: var(--muted); }
.cmdp-kind-route { color: var(--action); background: color-mix(in oklch, var(--action) 14%, transparent); }
.cmdp-kind-tail  { color: var(--ink-2); }
.cmdp-label { flex: 1 1 auto; font-weight: 600; color: var(--ink); }
.cmdp-sub { flex: none; font-size: 12px; color: var(--muted); }
.cmdp-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.cmdp-hint { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
@media (max-width: 767px) { .cmdp-overlay { padding-top: 6vh; } }
.hub-congestion { overflow-x: auto; max-width: 100%; }
.hub-congestion .hcong-svg { min-width: 420px; }
.flight-whatif { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; margin-top: 2px; }
.flight-whatif .wi-label { color: var(--muted); font-weight: 600; }
.wi-chip { padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.wi-chip.wi-good  { color: var(--action); background: color-mix(in oklch, var(--action) 13%, transparent); }
.wi-chip.wi-warn  { color: var(--danger, #b4433a); background: color-mix(in oklch, var(--danger, #b4433a) 13%, transparent); }
.wi-chip.wi-muted { color: var(--muted); background: color-mix(in oklch, var(--muted) 12%, transparent); }
.flight-plan-warn { display: inline-block; margin-top: 4px; margin-left: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--danger, #b4433a); background: color-mix(in oklch, var(--danger, #b4433a) 12%, transparent); }
.flight-row-conflict > td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.flight-slot-badge { cursor: help; font-weight: 700; }
.flight-slot-badge.slot-b-full { color: var(--red); }
.flight-slot-badge.slot-b-tight { color: var(--warning); }
.flight-slot-badge.slot-b-unknown { color: var(--muted); }

/* ── Umlauf-Timeline (Per-Flieger-Gantt) ─────────────────────────────── */
.rt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 4px 0 12px; }
.rt-picker { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); }
.rt-picker select { min-width: 180px; }
.rt-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-kpi { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 5px 11px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); line-height: 1.35; }
.rt-kpi b { font-size: 15px; font-weight: 650; color: var(--ink); text-transform: none; letter-spacing: 0; }
.rt-kpi-bad b { color: var(--red); }
.rt-kpi-ok b { color: var(--green); }
.rt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .78rem;
  color: var(--muted); margin-bottom: 10px; }
.rt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rt-legend i { width: 15px; height: 11px; border-radius: 3px; display: inline-block; }
.rt-l-leg  { background: var(--primary); }
.rt-l-ok   { background: var(--green); height: 6px !important; }
.rt-l-maint{ background: var(--primary); opacity: .5; height: 6px !important; }
.rt-l-bad  { background: var(--red); height: 6px !important; }
.rt-hint { margin-left: auto; font-style: italic; }
.rt-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rt-svg { display: block; width: 100%; min-width: 720px; height: auto; }
.rt-row { fill: var(--surface); }
.rt-row-alt { fill: var(--surface-2); }
.rt-grid { stroke: var(--line); stroke-width: 1; }
.rt-tick { fill: var(--muted); font-size: 9px; }
.rt-daylabel { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.rt-leglabel { fill: #fff; font-size: 9.5px; font-weight: 600; pointer-events: none; }
.rt-leg { cursor: pointer; }
.rt-leg:hover rect { filter: brightness(1.08); }
.rt-leg:focus-visible rect { outline: 2px solid var(--primary); outline-offset: 1px; }
.rt-leg-conflict rect { stroke: var(--red) !important; stroke-width: 2 !important; }
.rt-gapmark rect { }
.rt-gap-ok rect   { fill: var(--green); }
.rt-gap-maint rect{ fill: var(--primary); opacity: .5; }
.rt-gap-bad rect  { fill: var(--red); }
/* Flotten-Übersichtstabelle */
.rt-assistant { margin: 6px 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); padding: 6px 12px 12px; }
.rt-assistant > summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--ink-2); padding: 6px 0; user-select: none; }
.rt-cx-list { display: flex; flex-direction: column; gap: 10px; }
.rt-cx-card { border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: var(--radius-sm, 6px); padding: 10px 12px; background: var(--surface-2, var(--surface)); }
.rt-cx-head { font-size: .85rem; margin-bottom: 5px; }
.rt-cx-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-right: 4px; }
.rt-cx-tag-overlap { color: var(--danger); background: color-mix(in oklch, var(--danger) 14%, transparent); }
.rt-cx-tag-discont { color: var(--action); background: color-mix(in oklch, var(--action) 14%, transparent); }
.rt-cx-flight { text-decoration: underline dotted; cursor: pointer; font-weight: 600; }
.rt-cx-body { font-size: .82rem; color: var(--ink-2); line-height: 1.45; }
.rt-cx-fix { margin-top: 8px; font-size: .82rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rt-cx-fix .table-action { flex: none; }
.rt-cx-fix-none, .rt-cx-fix-manual { color: var(--muted); }
/* A4: Konkurrenz-Diff-Panel */
.cdiff { margin: 4px 0 18px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); padding: 4px 14px 12px; }
.cdiff > summary { cursor: pointer; font-weight: 700; font-size: .86rem; color: var(--ink-2); padding: 8px 0; user-select: none; }
.cdiff-sum { font-weight: 500; color: var(--muted); margin-left: 6px; font-size: .8rem; }
.cdiff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 767px) { .cdiff-grid { grid-template-columns: 1fr; } }
.cdiff-col h5, .cdiff-history h5 { margin: 4px 0 8px; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cdiff-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cdiff-mkt { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: color-mix(in oklch, var(--action) 10%, transparent); border: 1px solid var(--line); }
.cdiff-mkt-drop { background: color-mix(in oklch, var(--muted) 12%, transparent); text-decoration: line-through; opacity: .8; }
.cdiff-mkt-threat { background: color-mix(in oklch, var(--danger) 14%, transparent); border-color: color-mix(in oklch, var(--danger) 40%, transparent); font-weight: 600; }
.cdiff-mkt .route-link { cursor: pointer; }
.cdiff-wk { color: var(--muted); font-variant-numeric: tabular-nums; }
.cdiff-threat { color: var(--danger); font-weight: 700; }
.cdiff-history { margin-top: 12px; }
.cdiff-history ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cdiff-history li { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.cdiff-hist-date { color: var(--ink-2); }
.cdiff-plus { color: var(--action); }
.cdiff-minus { color: var(--muted); }
.cdiff-nochange { color: var(--muted); }
.rt-overview { margin-bottom: 14px; }
.rt-idle-filter { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-2); margin: 4px 0 8px; cursor: pointer; }
.rt-ov-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 10px; }
.settings-subhead { margin: 18px 0 4px; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 10px 0; }
.mon-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mon-val { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.mon-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.mon-sub { font-size: .76rem; color: var(--ink-2); margin-top: 2px; }
.drift-warn { color: var(--danger); font-weight: 600; }
.apt-clickable { cursor: pointer; }
.apt-clickable:hover { background: color-mix(in oklch, var(--action) 6%, transparent); }
.demand-chart { width: 100%; height: auto; }
.demand-legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: .82rem; }
.demand-leg::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; }
.demand-leg-pax::before { background: var(--action); }
.demand-leg-cargo::before { background: var(--danger); }
.activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.activity-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.activity-when { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 96px; }
.activity-what { font-weight: 600; }
.activity-detail { color: var(--ink-2); }
.activity-who { margin-left: auto; color: var(--muted); }
.sdiff-panel { margin-top: 12px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.sdiff-panel h4 { margin: 0 0 6px; font-size: .9rem; }
.sdiff-summary { font-size: .84rem; margin: 0 0 8px; }
.sdiff-panel details { margin: 4px 0; }
.sdiff-panel summary { cursor: pointer; font-weight: 600; font-size: .84rem; }
.sdiff-panel ul { margin: 4px 0 8px 8px; padding-left: 12px; font-size: 13px; }
.sdiff-add { color: var(--action); }
.sdiff-rem { color: var(--danger); }
.sdiff-chg { color: var(--ink-2); }
.sdiff-field { font-family: var(--font-mono, monospace); font-size: 12px; background: color-mix(in oklch, var(--muted) 10%, transparent); padding: 0 4px; border-radius: 4px; }
.opp-buy-plan-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.opp-buy-plan-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.opp-buy-plan-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.opp-buy-plan-table .num { text-align: right; }
.opp-buy-plan-table tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); border-bottom: none; }
.rt-overview > summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink-2);
  padding: 4px 0; user-select: none; }
.rt-ov-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.rt-ov-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 5px 8px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.rt-ov-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.rt-ov-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rt-ov-row { cursor: pointer; }
.rt-ov-row:hover { background: var(--surface-2); }
.rt-ov-active { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.rt-ov-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.rt-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; }
.rt-b-ok { color: var(--green); }
.rt-b-bad { color: var(--red); font-weight: 700; }
.rt-b-ghost { color: var(--muted); }
.rt-badge.rt-b-ok { background: var(--green-tint); }
.rt-badge.rt-b-bad { background: var(--red-tint); }
.rt-badge.rt-b-ghost { background: var(--surface-3); }

/* ── Maschine bespielen ─────────────────────────────────────────────────── */
.machine-intro { margin: 0 0 14px; }
.machine-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.machine-aside-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.machine-ac-controls { display: flex; gap: 6px; margin-bottom: 8px; }
.machine-ac-controls .input-sm { min-width: 0; }
.machine-ac-controls #machineSearch { flex: 1; }
.machine-ac-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.machine-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.machine-quick { margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.machine-quick-label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.machine-quick-row { display: flex; gap: 8px; align-items: center; }
.machine-ac {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center;
  text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; color: var(--ink);
}
.machine-ac:hover { border-color: color-mix(in oklch, var(--nav) 40%, var(--line)); }
.machine-ac.active { border-color: var(--primary); background: color-mix(in oklch, var(--nav) 8%, var(--surface)); }
.machine-ac-reg { font-weight: 600; font-family: var(--mono, monospace); }
.machine-ac-meta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.machine-ac-conf { grid-row: 1; grid-column: 2; font-size: 12px; font-weight: 600; color: var(--danger, #b4433a); }

.machine-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.machine-title { margin: 0; font-size: 1.15rem; }
.machine-type-badge { font-size: .72em; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: color-mix(in oklch, var(--nav) 14%, transparent); color: var(--nav); vertical-align: middle; }
.machine-sub { margin: 2px 0 0; }
.machine-conf-badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.machine-conf-badge.ok { background: var(--green-tint, #e6f4ea); color: var(--green, #1a7f37); }
.machine-conf-badge.bad { background: var(--red-tint, #fdeceb); color: var(--danger, #b4433a); }

.machine-sec { margin: 20px 0 8px; font-size: .95rem; }
.machine-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.machine-filter { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.machine-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.machine-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); font-weight: 600; padding: 4px 10px; border-bottom: 1px solid var(--line); }
.machine-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.machine-table tr:last-child td { border-bottom: none; }
.machine-fno { white-space: nowrap; }
.machine-row-action { text-align: right; white-space: nowrap; }
.machine-cur { margin-left: 8px; font-size: 11px; color: var(--muted); font-family: var(--mono, monospace); }

@media (max-width: 767px) {
  .machine-layout { grid-template-columns: 1fr; }
  .machine-ac-list { max-height: none; flex-direction: row; flex-wrap: wrap; }
  .machine-ac { flex: 1 1 140px; }
}

/* ── Anschlüsse (Hub-Bank-Analyse) ─────────────────────────────────────────── */
.conn-config { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.conn-config label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.conn-config input { width: 110px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--ink); font-size: 14px; }
.conn-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.conn-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.conn-card-val { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.conn-card-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-top: 3px; }
.conn-card--good { border-color: color-mix(in oklch, #2e7d32 40%, var(--line)); }
.conn-card--good .conn-card-val { color: #1b5e20; }
.conn-card--bad { border-color: color-mix(in oklch, var(--danger, #b4433a) 40%, var(--line)); }
.conn-card--bad .conn-card-val { color: var(--danger, #b4433a); }
@media (prefers-color-scheme: dark) { .conn-card--good .conn-card-val { color: #86efac; } }
:root[data-theme="slate"] .conn-card--good .conn-card-val { color: #86efac; }
.conn-h { margin: 24px 0 6px; font-size: 1rem; }
.conn-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.conn-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); font-weight: 600; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.conn-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.conn-table tr:last-child td { border-bottom: none; }
.conn-bar { display: inline-block; width: 80px; height: 7px; border-radius: 4px; background: var(--surface-3, var(--line));
  overflow: hidden; vertical-align: middle; margin-right: 6px; }
.conn-bar > span { display: block; height: 100%; background: var(--primary); }
.conn-oad-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.conn-oad { padding: 3px 9px; border-radius: 6px; font-size: 12px; background: var(--surface-2);
  border: 1px solid var(--line); }
.conn-nowaves { margin-top: 14px; }

/* Chancen: Voraussetzungs-Panel (fehlende Flughafen-/Muster-DB) */
.opp-prereq { margin: 12px 0; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid color-mix(in oklch, var(--danger, #b4433a) 40%, var(--line));
  background: color-mix(in oklch, var(--danger, #b4433a) 8%, var(--surface)); }
.opp-prereq strong { display: block; margin-bottom: 4px; }
.opp-prereq p { margin: 0 0 8px; font-size: 13px; }

/* Anschlüsse: Wellen-Vorschlag */
.conn-warn { margin: 12px 0; padding: 10px 12px; border-radius: var(--radius); font-size: 13px;
  border: 1px solid color-mix(in oklch, #b8860b 40%, var(--line));
  background: color-mix(in oklch, #b8860b 10%, var(--surface)); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conn-suggest { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.conn-suggest-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Onboarding „Erste Schritte" */
.ob-panel { margin: 0 0 18px; padding: 14px 16px; border: 1px solid color-mix(in oklch, var(--nav) 30%, var(--line));
  border-radius: var(--radius); background: color-mix(in oklch, var(--nav) 6%, var(--surface)); }
.ob-head { display: flex; align-items: center; justify-content: space-between; }
.ob-dismiss { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 6px; }
.ob-dismiss:hover { color: var(--ink); }
.ob-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ob-step { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ob-step.done { color: var(--muted); }
.ob-check { width: 1.2em; text-align: center; font-weight: 700; color: var(--muted); }
.ob-step.done .ob-check { color: #1b7f37; }
.ob-lbl { flex: 1; }

/* Flugplan: +1-Tag-Marker bei Ankunft am Folgetag */
sup.plus1 { font-size: .68em; color: var(--muted); margin-left: 1px; font-weight: 600; }

/* Flotte: Bulk-Kabinen-Helfer */
.fch-panel { margin: 0 0 14px; padding: 12px 14px; border: 1px solid color-mix(in oklch, #b8860b 35%, var(--line));
  border-radius: var(--radius); background: color-mix(in oklch, #b8860b 8%, var(--surface)); }
.fch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.fch-seat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.fch-seat input { width: 60px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }

/* Flugplan: Undo-Banner nach destruktiver Bulk-Aktion */
.undo-banner { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 8px 12px;
  border-radius: 8px; font-size: 13px; border: 1px solid var(--line); background: var(--surface-2); }
.undo-banner > span { margin-right: auto; }

/* ── Druck / PDF (#45) ──────────────────────────────────────────────────────
   Blendet App-Chrome + interaktive Controls aus, druckt nur die aktive View als
   saubere Tabelle. Aktiv über den Druck-Button (window.print) oder Ctrl+P. */
@media print {
  .sidebar, .topbar, .main-nav, #adminNav, .no-print,
  #flightForm, .tool-panel, .flight-bulk-bar, #flightBulkBar, .route-filter-bar,
  #flightUndoHost, .machine-aside, .machine-quick, .rt-ov-filters, .rt-idle-filter,
  .action-cell, .table-action, .flight-select, .flight-select-group,
  .day-btn-row, .searchable-select-dropdown, .toast-host, .modal-overlay { display: none !important; }
  .view:not(.active) { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  .app-shell { display: block !important; }
  .app-main, main, .view.active { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .split-layout, .aircraft-layout, .machine-layout { display: block !important; }
  table { width: 100% !important; border-collapse: collapse; font-size: 9.5pt; }
  th, td { border: 1px solid #999 !important; padding: 3px 6px !important; background: #fff !important; color: #000 !important; }
  thead { display: table-header-group; }   /* Kopf auf jeder Seite wiederholen */
  tr { break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
  .section-heading h3 { font-size: 14pt; }
  @page { margin: 12mm; }
}

/* ═══ Button ═══ */
.btn {
  --_bg: var(--surface); --_fg: var(--ink); --_bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 36px; padding: 0 var(--sp-4); border: 1px solid var(--_bd);
  background: var(--_bg); color: var(--_fg); border-radius: var(--radius);
  font: 500 14px/1 var(--font-sans); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-primary { --_bg: var(--primary); --_fg: var(--primary-fg); --_bd: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { --_bg: var(--surface-2); --_fg: var(--ink); --_bd: var(--border); }
.btn-outline { --_bg: transparent; --_fg: var(--ink); --_bd: var(--border-strong); }
.btn-ghost { --_bg: transparent; --_bd: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-destructive { --_bg: var(--danger); --_fg: #fff; --_bd: var(--danger); }
.btn-link { --_bg: transparent; --_bd: transparent; color: var(--primary); text-decoration: underline; text-underline-offset: 3px; height: auto; padding: 0; }

/* ═══ Form controls ═══ */
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 var(--sp-3);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: 400 14px/1.4 var(--font-sans); transition: border-color var(--dur-fast) var(--ease);
}
.textarea { height: auto; min-height: 76px; padding: var(--sp-2) var(--sp-3); resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: var(--primary); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input[aria-invalid="true"], .input.is-invalid { border-color: var(--danger); }
.field-label { display:block; font: 500 13px/1 var(--font-sans); color: var(--ink-2); margin-bottom: var(--sp-2); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: var(--sp-1); }

/* Checkbox / Radio */
.checkbox, .radio { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* Switch */
.switch { position: relative; display: inline-flex; width: 40px; height: 22px; }
.switch input { position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.switch .track { position:absolute; inset:0; background: var(--border-strong); border-radius: 999px; transition: background var(--dur-fast) var(--ease); }
.switch .track::after { content:""; position:absolute; top:2px; left:2px; width:18px; height:18px; background:#fff; border-radius:999px; transition: transform var(--dur-fast) var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Segmented control */
.segmented { display:inline-flex; background: var(--surface-2); border:1px solid var(--border); border-radius: var(--radius); padding: 2px; gap: 2px; }
.segmented button { border:0; background:transparent; color: var(--muted); height:28px; padding:0 var(--sp-3); border-radius: var(--radius-sm); font:500 13px/1 var(--font-sans); cursor:pointer; }
.segmented button[aria-selected="true"], .segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ═══ Card / Tile / Empty ═══ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.card-title { font: 600 15px/1.2 var(--font-sans); margin: 0; }
.card-body { padding: var(--sp-5); }
.card-footer { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }

.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-5); }
.tile-val { font: 600 28px/1 var(--font-mono); color: var(--ink); letter-spacing: -.01em; }
.tile-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: var(--sp-2); }
.tile-warn .tile-val { color: var(--warning); }
.tile-danger .tile-val { color: var(--danger); }

.empty { text-align: center; padding: var(--sp-10) var(--sp-5); color: var(--muted); }
.empty-title { font: 600 15px/1.2 var(--font-sans); color: var(--ink-2); margin: var(--sp-2) 0; }

/* ═══ Table (dicht, Pro-Tool) ═══ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted);
  text-align: left; font: 500 12px/1 var(--font-sans); text-transform: uppercase; letter-spacing: .03em;
  padding: var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); color: var(--ink); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table th.sortable { cursor: pointer; }

/* ═══ Badge ═══ */
.badge { display:inline-flex; align-items:center; gap:4px; height:20px; padding:0 8px;
  border-radius: 999px; font: 500 12px/1 var(--font-sans); border:1px solid transparent; }
.badge-default   { background: var(--primary-tint); color: var(--primary-active); }
.badge-secondary { background: var(--surface-2); color: var(--ink-2); border-color: var(--border); }
.badge-success   { background: var(--success-tint); color: var(--success); }
.badge-warning   { background: var(--warning-tint); color: var(--warning); }
.badge-danger    { background: var(--danger-tint); color: var(--danger); }
.badge-outline   { background: transparent; color: var(--ink-2); border-color: var(--border-strong); }

/* ═══ Tabs (underline) ═══ */
.tabs { display:flex; gap: var(--sp-4); border-bottom: 1px solid var(--border); }
.tabs button { border:0; background:transparent; color: var(--muted); cursor:pointer;
  padding: var(--sp-3) 2px; font:500 14px/1 var(--font-sans); border-bottom: 2px solid transparent; margin-bottom:-1px; }
.tabs button:hover { color: var(--ink-2); }
.tabs button[aria-selected="true"], .tabs button.active { color: var(--ink); border-bottom-color: var(--primary); }

/* ═══ Overlays ═══ */
.overlay { position: fixed; inset: 0; background: oklch(20% 0.02 300 / .45); display:grid; place-items:center; z-index: 50; }
.dialog { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); width: min(480px, 92vw); }
.dialog-header { padding: var(--sp-4) var(--sp-5); border-bottom:1px solid var(--border); font:600 15px/1.2 var(--font-sans); }
.dialog-body { padding: var(--sp-5); color: var(--ink-2); }
.dialog-footer { padding: var(--sp-4) var(--sp-5); border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap: var(--sp-2); }

.menu { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: var(--sp-1); min-width: 180px; }
.menu-item { display:flex; align-items:center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm); font:400 14px/1 var(--font-sans); color: var(--ink); cursor:pointer; }
.menu-item:hover { background: var(--surface-2); }

.tooltip { background: var(--ink); color: var(--surface); font:500 12px/1.3 var(--font-sans);
  padding: 6px 8px; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); max-width: 240px; }

.toast { background: var(--surface); border:1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: var(--sp-3) var(--sp-4); font-size:13px; }
.toast-success { border-left-color: var(--success); }
.toast-warn { border-left-color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }

/* ═══ Flugplan-Redesign: Formular als Slide-over, Tabelle volle Breite ═══ */
#plannerView .split-layout { display: block; }            /* Tabelle nutzt die volle Breite */
.page-header { display:flex; justify-content:space-between; align-items:flex-start; gap:var(--sp-4); margin-bottom:var(--sp-4); flex-wrap:wrap; }
.page-title { font:600 20px/1.2 var(--font-sans); margin:0; color:var(--ink); }
.page-subtitle { color:var(--muted); font-size:13px; margin:var(--sp-1) 0 0; }
.page-actions { display:flex; gap:var(--sp-2); flex-wrap:wrap; }

.sheet-overlay { position:fixed; inset:0; background:oklch(20% .02 300 / .40); z-index:40; }
.sheet-panel {
  position:fixed; top:0; right:0; height:100dvh; width:min(440px, 94vw);
  background:var(--surface); border-left:1px solid var(--border); box-shadow:var(--shadow-pop);
  z-index:41; overflow-y:auto; padding:var(--sp-5) var(--sp-5) var(--sp-8);
  transform:translateX(100%); transition:transform var(--dur-base) var(--ease);
}
#plannerView.sheet-open .sheet-panel { transform:none; }
#plannerView:not(.sheet-open) .sheet-panel { visibility:hidden; }
#plannerView:not(.sheet-open) .sheet-overlay { display:none; }
.sheet-head { display:flex; justify-content:space-between; align-items:flex-start; gap:var(--sp-3); }
@media (prefers-reduced-motion: reduce) { .sheet-panel { transition:none; } }

/* ═══ Flottenverwaltung-Redesign: Formular als Slide-over, Tabelle volle Breite ═══ */
#fleetView .split-layout { display: block; }               /* Tabelle nutzt die volle Breite */
#fleetView.sheet-open .sheet-panel { transform:none; }
#fleetView:not(.sheet-open) .sheet-panel { visibility:hidden; }
#fleetView:not(.sheet-open) .sheet-overlay { display:none; }

/* ═══ Kabinenkonfiguration-Redesign: Formular als Slide-over, Liste volle Breite ═══ */
#cabinconfigView .split-layout { display: block; }          /* Tabelle nutzt die volle Breite */
#cabinconfigView.sheet-open .sheet-panel { transform:none; }
#cabinconfigView:not(.sheet-open) .sheet-panel { visibility:hidden; }
#cabinconfigView:not(.sheet-open) .sheet-overlay { display:none; }

/* ═══ Topbar-Suche (öffnet Command-Palette) ═══ */
.topbar-search { display:inline-flex; align-items:center; gap:var(--sp-2); height:32px; padding:0 var(--sp-2) 0 var(--sp-3);
  background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius); color:var(--muted);
  font:400 13px/1 var(--font-sans); cursor:pointer; margin-left:var(--sp-4); transition:border-color var(--dur-fast) var(--ease); }
.topbar-search:hover { border-color:var(--border-strong); color:var(--ink-2); }
.topbar-search:focus-visible { outline:2px solid var(--ring); outline-offset:2px; }
.topbar-search kbd { font:500 11px/1 var(--font-mono); background:var(--surface); border:1px solid var(--border); border-radius:4px; padding:2px 5px; color:var(--muted); }
@media (max-width: 720px) { .topbar-search span, .topbar-search kbd { display:none; } }

/* ═══ Cockpit-Übersicht (Analysen-Dashboard) ═══ */
.cockpit { display:flex; flex-direction:column; gap:var(--sp-5); margin-bottom:var(--sp-6); }
.kpi-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(155px,1fr)); gap:var(--sp-3); }
.kpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:var(--sp-4); box-shadow:var(--shadow-sm); }
.kpi-top { display:flex; align-items:center; gap:var(--sp-2); color:var(--muted); }
.kpi-ic { color:var(--primary); flex:none; }
.kpi-label { font-size:11px; text-transform:uppercase; letter-spacing:.03em; }
.kpi-val { font:600 26px/1 var(--font-mono); color:var(--ink); margin-top:var(--sp-2); letter-spacing:-.01em; }
.kpi-ok    .kpi-ic { color:var(--success); }
.kpi-warn  .kpi-ic, .kpi-warn  .kpi-val { color:var(--warning); }
.kpi-danger .kpi-ic, .kpi-danger .kpi-val { color:var(--danger); }

.cockpit-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px,1fr)); gap:var(--sp-5); }
.chart-card .card-body { padding:var(--sp-4) var(--sp-5); }
.bars { display:flex; flex-direction:column; gap:var(--sp-3); }
.bar-row { display:grid; grid-template-columns:52px 1fr 54px; align-items:center; gap:var(--sp-3); }
.bar-label { font:500 12px/1 var(--font-mono); color:var(--ink-2); text-align:right; }
.bar-track { height:10px; background:var(--surface-2); border-radius:999px; overflow:hidden; }
.bar-fill { height:100%; background:var(--primary); border-radius:999px; transition:width var(--dur-base) var(--ease); }
.bar-val { font:500 12px/1 var(--font-mono); color:var(--muted); text-align:left; font-variant-numeric:tabular-nums; }

.dq-strip { display:flex; flex-wrap:wrap; gap:var(--sp-2); }
.dq-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; border:1px solid var(--border); background:var(--surface-2); font:500 13px/1 var(--font-sans); color:var(--ink-2); }
.dq-chip svg { width:15px; height:15px; }
.dq-chip b { font-family:var(--font-mono); }
.dq-warn { background:var(--warning-tint); border-color:transparent; color:var(--warning); cursor:pointer; }
.dq-ok { background:var(--success-tint); border-color:transparent; color:var(--success); }

/* ═══ Kategoriale Chart-Farben (validiert: dataviz validate_palette) ═══ */
:root { --cat-1:#2f6fd0; --cat-2:#159f7a; --cat-3:#b5771f; --cat-4:#8a4fd6; --cat-5:#c0407a; }
:root[data-theme="dark"] { --cat-1:#4b86e0; --cat-2:#12946f; --cat-3:#b07f34; --cat-4:#9a68d8; --cat-5:#d16897; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --cat-1:#4b86e0; --cat-2:#12946f; --cat-3:#b07f34; --cat-4:#9a68d8; --cat-5:#d16897; } }

/* Donut */
.donut-wrap { display:flex; align-items:center; gap:var(--sp-5); flex-wrap:wrap; }
.donut { width:120px; height:120px; flex:none; }
.donut-num { font:600 20px var(--font-mono); fill:var(--ink); text-anchor:middle; }
.donut-cap { font:500 8px var(--font-sans); fill:var(--muted); text-anchor:middle; text-transform:uppercase; letter-spacing:.05em; }
.donut-legend { display:flex; flex-direction:column; gap:var(--sp-2); font-size:13px; color:var(--ink-2); }
.lg-item { display:flex; align-items:center; gap:var(--sp-2); }
.lg-dot { width:10px; height:10px; border-radius:3px; flex:none; }
.lg-item b { font-family:var(--font-mono); }
.lg-pct { color:var(--muted); font-family:var(--font-mono); }

/* Gauge */
.gauge-wrap { display:flex; flex-direction:column; align-items:center; gap:var(--sp-2); }
.gauge { width:160px; height:98px; }
.gauge-num { font:600 22px var(--font-mono); fill:var(--ink); text-anchor:middle; }
.gauge-label { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }

/* Danger-Buttons wirklich rot (Alias auf destructive; überschreibt Source-Order-Kollision) */
.btn.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.btn-danger:hover { background: var(--danger); filter: brightness(0.94); }
