@font-face {
  font-family: "The Led Display ST";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/the-led-display-st.ttf") format("truetype");
}

/* Gate management */

.gate-management-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 20px;
}

.gate-management-search,
.gate-management-results {
  min-width: 0;
  padding: 20px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.gate-management-search {
  display: grid;
  grid-row: 2;
  gap: 16px;
}

.gate-management-search__header h2,
.gate-management-search__header p,
.gate-management-results__header h2,
.gate-management-results__eyebrow,
.gate-management-map-card__header h3,
.gate-management-map-card__header p,
.gate-management-sidebar h3,
.gate-management-selection p,
.gate-management-warning,
.gate-management-status {
  margin: 0;
}

.gate-management-search__header h2,
.gate-management-results__header h2 {
  font-size: 20px;
  line-height: 1.2;
}

.gate-management-search__header p,
.gate-management-map-card__header p {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.45;
}

.gate-management-connection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gate-management-connection__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.gate-management-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.gate-management-field > span,
.gate-management-selection > span,
.gate-management-system-assignment > span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate-management-field input,
.gate-management-field select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  color: var(--color-text);
  font-weight: 800;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.gate-management-field input {
  text-transform: uppercase;
}

.gate-management-field input:hover,
.gate-management-field input:focus-visible,
.gate-management-field select:hover,
.gate-management-field select:focus-visible {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.gate-management-field input:invalid:not(:placeholder-shown) {
  border-color: var(--color-danger);
}

.gate-management-field select:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.gate-management-field small {
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.25;
}

.gate-management-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: var(--color-text);
  font-weight: 800;
  white-space: nowrap;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.gate-management-button--primary {
  color: var(--color-accent-contrast);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.gate-management-button:hover:not(:disabled),
.gate-management-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.gate-management-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.gate-management-status {
  min-height: 20px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.gate-management-status[data-tone="loading"] {
  color: var(--color-accent);
}

.gate-management-status[data-tone="success"] {
  color: var(--color-success);
}

.gate-management-status[data-tone="warning"] {
  color: #9a6700;
}

:root[data-theme="dark"] .gate-management-status[data-tone="warning"] {
  color: #f5ce44;
}

.gate-management-status[data-tone="error"] {
  color: var(--color-danger);
}

.gate-management-results {
  display: grid;
  grid-row: 3;
  gap: 16px;
}

.gate-management-results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.gate-management-results__eyebrow {
  margin-bottom: 4px;
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gate-management-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, auto));
  gap: 8px;
  margin: 0;
}

.gate-management-metrics div {
  display: grid;
  gap: 2px;
  min-width: 76px;
  padding: 8px 10px;
  text-align: center;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
}

.gate-management-metrics dt {
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gate-management-metrics dd {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.gate-management-metrics__available dd {
  color: var(--color-success);
}

.gate-management-metrics__unavailable dd {
  color: var(--color-danger);
}

.gate-management-warning {
  padding: 10px 12px;
  color: #7a4d00;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  background: rgba(245, 206, 68, 0.16);
  border: 1px solid rgba(245, 206, 68, 0.52);
  border-radius: 6px;
}

:root[data-theme="dark"] .gate-management-warning {
  color: #f8e7a4;
}

.gate-management-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
  gap: 18px;
  min-height: 0;
}

.gate-management-map-card {
  min-width: 0;
  overflow: hidden;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
}

.gate-management-map-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-soft);
}

.gate-management-map-card__header h3,
.gate-management-sidebar h3 {
  font-size: 15px;
  line-height: 1.25;
}

.gate-management-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
}

.gate-management-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.gate-management-legend__marker {
  width: 11px;
  height: 11px;
  background: var(--color-muted);
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--color-border);
}

.gate-management-legend__marker--available {
  background: var(--color-success);
}

.gate-management-legend__marker--selected {
  background: #2563eb;
}

.gate-management-legend__marker--unavailable {
  background: var(--color-danger);
}

.gate-management-map {
  width: 100%;
  height: clamp(520px, 66vh, 760px);
  min-height: 520px;
  color: var(--color-text);
  background: var(--color-map-bg);
}

.gate-management-map--unavailable {
  display: grid;
  padding: 24px;
  place-items: center;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.gate-management-map .leaflet-container {
  color: var(--color-text);
  font: inherit;
}

.gate-management-map .leaflet-control-attribution {
  font-size: 10px;
}

.gate-map-marker {
  position: absolute;
  width: 36px !important;
  height: 40px !important;
  background: transparent;
  border: 0;
}

.gate-map-marker__direction {
  position: absolute;
  top: 1px;
  left: 7px;
  display: block;
  width: 22px;
  height: 22px;
  color: #ffffff;
  background: var(--color-muted);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.34);
  transform: rotate(var(--gate-heading, 0deg));
  transition: width 120ms ease, height 120ms ease, background 120ms ease;
}

.gate-map-marker__direction::before {
  position: absolute;
  top: -7px;
  left: 5px;
  width: 0;
  height: 0;
  content: "";
  border-right: 4px solid transparent;
  border-bottom: 7px solid currentcolor;
  border-left: 4px solid transparent;
}

.gate-map-marker--heading-unknown .gate-map-marker__direction::before {
  display: none;
}

.gate-map-marker__label {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: block;
  min-width: 36px;
  max-width: 72px;
  overflow: hidden;
  padding: 2px 4px;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
  opacity: 0;
  transform: translateX(-50%);
  visibility: hidden;
  transition: opacity 120ms ease;
}

.gate-management-map--labels-visible .gate-map-marker__label,
.gate-map-marker:hover .gate-map-marker__label,
.gate-map-marker:focus-visible .gate-map-marker__label,
.gate-map-marker--selected .gate-map-marker__label,
.gate-map-marker--current .gate-map-marker__label {
  opacity: 1;
  visibility: visible;
}

.gate-map-marker--available {
  cursor: pointer;
}

.gate-map-marker--available .gate-map-marker__direction {
  background: var(--color-success);
}

.gate-map-marker--unavailable {
  cursor: help;
  opacity: 0.72;
}

.gate-map-marker--unavailable .gate-map-marker__direction {
  background: var(--color-danger);
}

.gate-map-marker--selected {
  z-index: 1000 !important;
  opacity: 1;
}

.gate-map-marker--selected .gate-map-marker__direction {
  top: -1px;
  left: 5px;
  width: 26px;
  height: 26px;
  background: #2563eb;
  box-shadow: 0 0 0 4px rgb(37 99 235 / 0.28), 0 2px 6px rgb(0 0 0 / 0.38);
}

.gate-map-marker--selected .gate-map-marker__label {
  color: #ffffff;
  background: #2563eb;
  border-color: #1d4ed8;
}

.gate-map-marker--current:not(.gate-map-marker--selected) .gate-map-marker__label {
  border-color: #9333ea;
  box-shadow: 0 0 0 2px rgb(147 51 234 / 0.24);
}

.gate-map-marker:focus-visible {
  outline: 0;
}

.gate-map-marker:focus-visible .gate-map-marker__direction {
  box-shadow: 0 0 0 4px var(--color-accent-soft), 0 2px 6px rgb(0 0 0 / 0.38);
}

.gate-management-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.gate-management-summary,
.gate-management-picker,
.gate-management-current {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 7px;
}

.gate-management-summary dl,
.gate-management-current dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.gate-management-summary dl div,
.gate-management-current dl div {
  display: grid;
  grid-template-columns: minmax(88px, 0.7fr) minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border-soft);
}

.gate-management-summary dl div:last-child,
.gate-management-current dl div:last-child {
  border-bottom: 0;
}

.gate-management-summary dt,
.gate-management-current dt {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.gate-management-summary dd,
.gate-management-current dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.gate-management-selection {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: 6px;
}

.gate-management-selection strong {
  overflow-wrap: anywhere;
  font-size: 26px;
  line-height: 1;
}

.gate-management-selection p {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

.gate-management-picker__submit {
  width: 100%;
}

.gate-management-system-assignment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  background: color-mix(in srgb, var(--color-success) 12%, var(--color-surface));
  border: 1px solid color-mix(in srgb, var(--color-success) 62%, var(--color-border));
  border-radius: 6px;
}

.gate-management-system-assignment[hidden] {
  display: none;
}

.gate-management-system-assignment strong {
  overflow-wrap: anywhere;
  color: var(--color-success);
  font-size: 24px;
  line-height: 1;
  text-align: right;
}

.gate-management-current {
  border-left: 4px solid #9333ea;
}

.gate-management-simulation {
  position: sticky;
  bottom: 12px;
  z-index: 900;
  display: grid;
  grid-row: 4;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  border: 1px solid var(--color-accent-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-tooltip);
  backdrop-filter: blur(10px);
}

.gate-management-simulation__copy {
  display: grid;
  align-self: center;
  gap: 3px;
  min-width: 0;
}

.gate-management-simulation__copy strong {
  font-size: 14px;
}

.gate-management-simulation__copy span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
}

.gate-management-simulation__field {
  min-width: 0;
}

@media (max-width: 1000px) {
  .gate-management-workspace {
    grid-template-columns: 1fr;
  }

  .gate-management-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gate-management-current {
    grid-column: 1 / -1;
  }

  .gate-management-simulation {
    grid-template-columns: minmax(180px, 0.75fr) minmax(220px, 1.25fr) auto;
  }

  .gate-management-simulation__copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .gate-management-search,
  .gate-management-results {
    padding: 16px;
  }

  .gate-management-sidebar {
    grid-template-columns: 1fr;
  }

  .gate-management-connection {
    align-items: stretch;
    flex-direction: column;
  }

  .gate-management-connection__actions .gate-management-button {
    flex: 1 1 auto;
  }

  .gate-management-results__header,
  .gate-management-map-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .gate-management-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .gate-management-metrics div {
    min-width: 0;
  }

  .gate-management-legend {
    justify-content: flex-start;
  }

  .gate-management-map {
    height: 62dvh;
    min-height: 420px;
  }

  .gate-management-current {
    grid-column: auto;
  }

  .gate-management-simulation {
    bottom: 8px;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .gate-management-simulation__copy {
    grid-column: auto;
  }

  .gate-management-simulation .gate-management-button {
    width: 100%;
  }
}

:root {
  --color-bg: #c7c7c7;
  --color-page: #ffffff;
  --color-surface: #f4f4f4;
  --color-surface-strong: #eeeeee;
  --color-border: #cfcfcf;
  --color-border-soft: rgba(31, 31, 31, 0.1);
  --color-table-border: rgba(207, 207, 207, 0.74);
  --color-text: #1f1f1f;
  --color-muted: #686868;
  --color-accent: #555555;
  --color-accent-contrast: #ffffff;
  --color-accent-soft: #dedede;
  --color-accent-border: rgba(85, 85, 85, 0.22);
  --color-success: #157347;
  --color-success-soft: #edf8f3;
  --color-danger: #b42318;
  --color-danger-soft: #fdebec;
  --color-chart-track: #e1e1e1;
  --color-chart-track-border: rgba(104, 104, 104, 0.24);
  --color-chart-empty-a: #eeeeee;
  --color-chart-empty-b: #d9d9d9;
  --color-map-bg: #c7c7c7;
  --topbar-height: 64px;
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.08);
  --shadow-tooltip: 0 14px 32px rgba(0, 0, 0, 0.16);
  --radius-card: 8px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --color-bg: #1f1f1f;
  --color-page: #242424;
  --color-surface: #292929;
  --color-surface-strong: #333333;
  --color-border: #484848;
  --color-border-soft: rgba(232, 232, 232, 0.12);
  --color-table-border: rgba(232, 232, 232, 0.14);
  --color-text: #f1f1f1;
  --color-muted: #b8b8b8;
  --color-accent: #d8d8d8;
  --color-accent-contrast: #161616;
  --color-accent-soft: rgba(216, 216, 216, 0.12);
  --color-accent-border: rgba(216, 216, 216, 0.24);
  --color-success: #64d99c;
  --color-success-soft: rgba(100, 217, 156, 0.14);
  --color-danger: #ff928a;
  --color-danger-soft: rgba(255, 146, 138, 0.14);
  --color-chart-track: #3a3a3a;
  --color-chart-track-border: rgba(232, 232, 232, 0.16);
  --color-chart-empty-a: #2e2e2e;
  --color-chart-empty-b: #383838;
  --color-map-bg: #242424;
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 16px 34px rgba(0, 0, 0, 0.28);
  --shadow-tooltip: 0 14px 32px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--color-text);
  background: var(--color-bg);
  font-family:
    Aptos,
    "Segoe UI Variable Text",
    Segoe UI,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

button,
select,
input {
  font: inherit;
}

/* Native option popups do not consistently inherit the select background. */
select,
option,
optgroup {
  color: var(--color-text);
  background-color: var(--color-surface);
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--topbar-height);
  padding: 0 24px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-subtle);
}

.topbar__brand {
  flex: 0 0 auto;
  padding: 8px 0;
  color: var(--color-text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.topbar__nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--color-muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.topbar__link:hover {
  color: var(--color-text);
  border-color: var(--color-border);
}

.topbar__link[aria-current="page"] {
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-color: transparent;
}

.topbar__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.auth-widget,
.auth-widget__session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-widget__login[hidden],
.auth-widget__session[hidden] {
  display: none;
}

.auth-widget__login,
.auth-widget__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--color-accent-contrast);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
}

.auth-widget__logout {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
}

.auth-widget__login:hover,
.auth-widget__login:focus-visible,
.auth-widget__logout:hover,
.auth-widget__logout:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.auth-widget__identity {
  max-width: 220px;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dev-menu {
  position: relative;
}

.dev-menu[hidden] {
  display: none;
}

.dev-menu > summary,
.dev-menu__panel button {
  min-height: 36px;
  padding: 7px 12px;
  color: #fff;
  font-weight: 800;
  background: #7c3aed;
  border: 1px solid #7c3aed;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}

.dev-menu > summary::-webkit-details-marker {
  display: none;
}

.dev-menu__panel {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(320px, calc(100vw - 24px));
  gap: 10px;
  padding: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.dev-menu__panel label {
  display: grid;
  gap: 5px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
}

.dev-menu__panel select {
  width: 100%;
  min-height: 36px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.dev-menu__panel .dev-menu__reset {
  color: var(--color-text);
  background: transparent;
  border-color: var(--color-border);
}

.dev-menu__status {
  color: var(--color-muted);
  font-size: 12px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 12px;
  color: var(--color-muted);
  font-weight: 700;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.theme-toggle__icon {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-toggle__icon::before {
  position: absolute;
  inset: -2px -2px auto auto;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--color-surface);
  border-radius: 50%;
}

:root[data-theme="dark"] .theme-toggle__icon::before {
  inset: 5px auto auto 5px;
  width: 2px;
  height: 2px;
  background: currentColor;
  box-shadow:
    -6px 0 0 currentColor,
    6px 0 0 currentColor,
    0 -6px 0 currentColor,
    0 6px 0 currentColor;
}

.page-host {
  min-height: calc(100vh - var(--topbar-height));
  padding: 24px;
  outline: none;
}

.page-host--fmp {
  height: calc(100vh - var(--topbar-height));
  height: calc(100dvh - var(--topbar-height));
  min-height: 0;
  padding: 8px;
  overflow: hidden;
}

.page-host--home {
  padding: 0;
  background: #ffffff;
  overflow: hidden;
}

.page {
  width: 100%;
  min-height: calc(100vh - var(--topbar-height) - 48px);
}

.home-page {
  --home-image-crop: 10px;

  display: block;
  min-height: calc(100vh - var(--topbar-height));
  min-height: calc(100dvh - var(--topbar-height));
  background: #ffffff;
  overflow: hidden;
}

.home-page__image {
  display: block;
  width: calc(100% + (var(--home-image-crop) * 2));
  max-width: none;
  height: auto;
  margin: calc(var(--home-image-crop) * -1);
}

.page__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
}

.dashboard-page {
  display: grid;
  gap: 20px;
}

.dman-page {
  align-content: start;
  gap: 10px;
}

.page-heading {
  display: grid;
  gap: 6px;
}

.page-heading__eyebrow {
  margin: 0;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-heading__title {
  font-size: 32px;
}

.documentation-page {
  display: grid;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.documentation-hero,
.documentation-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 32px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 10%, var(--color-surface)), var(--color-surface));
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.documentation-hero__lead {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--color-muted);
  font-size: 17px;
  line-height: 1.6;
}

.documentation-download {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px 20px;
  color: #fff;
  background: var(--color-accent);
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--color-accent) 28%, transparent);
}

.documentation-download small {
  color: inherit;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.86;
}

.documentation-download:hover,
.documentation-download:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.documentation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.documentation-card {
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
}

.documentation-step {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--color-accent);
  border-radius: 50%;
  font-weight: 800;
}

.documentation-card h2,
.documentation-detail h2 {
  margin: 16px 0 8px;
  font-size: 19px;
}

.documentation-card p,
.documentation-detail p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.55;
}

.documentation-command-list {
  display: grid;
  min-width: min(100%, 470px);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.documentation-command-list li {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 9px;
}

.documentation-command-list code {
  color: var(--color-accent);
  font-weight: 800;
}

.documentation-command-list span,
.documentation-note span,
.bridge-pairing-security {
  color: var(--color-muted);
  font-size: 13px;
}

.documentation-note {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: 8px;
}

.bridge-pairing-page {
  display: grid;
  min-height: calc(100dvh - var(--topbar-height) - 80px);
  place-items: center;
}

.bridge-pairing-card {
  width: min(100%, 560px);
  padding: 36px;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.bridge-pairing-card .page-heading__eyebrow {
  margin-top: 14px;
}

.bridge-pairing-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  place-items: center;
  color: #fff;
  background: var(--color-accent);
  border-radius: 16px;
  font-size: 26px;
  font-weight: 900;
}

.bridge-pairing-message {
  margin: 16px auto;
  color: var(--color-muted);
  line-height: 1.55;
}

.bridge-pairing-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.bridge-pairing-summary div {
  padding: 12px;
  background: var(--color-surface-subtle);
  border-radius: 8px;
}

.bridge-pairing-summary dt {
  color: var(--color-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.bridge-pairing-summary dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.bridge-pairing-confirm {
  width: 100%;
  align-items: center;
}

.bridge-pairing-back {
  display: inline-block;
  margin: 10px 0;
  color: var(--color-accent);
  font-weight: 700;
}

.bridge-pairing-security {
  margin: 20px 0 0;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .documentation-hero,
  .documentation-detail,
  .documentation-note {
    align-items: stretch;
    flex-direction: column;
  }

  .documentation-grid,
  .bridge-pairing-summary {
    grid-template-columns: 1fr;
  }

  .documentation-download,
  .documentation-command-list {
    width: 100%;
  }

  .bridge-pairing-card {
    padding: 24px;
  }
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
}

.metric-card__label {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card__value {
  margin: 10px 0 0;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.dashboard-card {
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.dashboard-card--wide {
  grid-column: 1 / -1;
}

.dashboard-card--chart {
  overflow: visible;
}

.dashboard-card__header {
  padding: 22px 24px 0;
}

.dashboard-card__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.dashboard-card__description {
  margin: 10px 0 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.6;
}

.dashboard-card__body {
  padding: 18px 24px 24px;
  overflow-x: auto;
}

.dashboard-card__body--chart {
  overflow: visible;
}

.dashboard-empty {
  margin: 0;
  padding: 16px 18px;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.6;
  background: var(--color-surface-strong);
  border: 1px dashed var(--color-border);
  border-radius: 8px;
}

.traffic-chart {
  min-width: 0;
}

.traffic-chart__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.traffic-chart__headline,
.traffic-chart__value,
.traffic-chart__tooltip p {
  margin: 0;
}

.traffic-chart__headline {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.traffic-chart__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.traffic-chart__scroll {
  overflow: visible;
  padding: 6px 0 4px;
}

.traffic-chart__bars {
  position: relative;
  display: grid;
  align-items: stretch;
  gap: 0;
  width: 100%;
  height: 172px;
  min-height: 172px;
}

.traffic-chart__slot {
  position: relative;
  min-width: 0;
  height: 100%;
}

.traffic-chart__bar {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  appearance: none;
  background: var(--color-chart-track);
  border: 0;
  border-top: 1px solid var(--color-chart-track-border);
  border-bottom: 1px solid var(--color-chart-track-border);
  border-radius: 0;
  cursor: pointer;
}

.traffic-chart__slot:first-child .traffic-chart__bar {
  border-left: 1px solid var(--color-chart-track-border);
  border-radius: 3px 0 0 3px;
}

.traffic-chart__slot:last-child .traffic-chart__bar {
  border-right: 1px solid var(--color-chart-track-border);
  border-radius: 0 3px 3px 0;
}

.traffic-chart__bar:hover,
.traffic-chart__bar:focus-visible {
  border-color: var(--color-accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.traffic-chart__bar--empty {
  background: var(--color-chart-empty-a);
}

.traffic-chart__bar-fill {
  display: block;
  width: 100%;
  min-height: 0;
  background: #00ccff;
  border-radius: 2px 2px 0 0;
}

.traffic-chart__bar-stack {
  display: flex;
  flex-direction: column-reverse;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 2px 2px 0 0;
}

.traffic-chart__bar-segment {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
}

.traffic-chart__bar-segment--airborne {
  background: #0000ff;
}

.traffic-chart__bar-segment--ground {
  background: #00ccff;
}

.traffic-chart__bar-segment--activated {
  background: #0066ff;
}

.traffic-chart__bar-segment--regulated-ground {
  background: #00ffff;
}

.traffic-chart__axis {
  position: relative;
  height: 20px;
  margin-top: 6px;
}

.traffic-chart__axis-label {
  position: absolute;
  top: 0;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.traffic-chart__axis-label--start {
  transform: translateX(0);
}

.traffic-chart__axis-label--end {
  transform: translateX(-100%);
}

.traffic-chart__tooltip {
  position: absolute;
  bottom: 34px;
  left: 50%;
  z-index: 3;
  display: grid;
  gap: 5px;
  width: max-content;
  min-width: 178px;
  max-width: 220px;
  padding: 10px 12px;
  color: var(--color-text);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-tooltip);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.traffic-chart__slot:hover .traffic-chart__tooltip,
.traffic-chart__slot:focus-within .traffic-chart__tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.traffic-chart__tooltip-time {
  color: var(--color-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.traffic-chart__tooltip-delta {
  color: var(--color-muted);
  font-weight: 700;
}

.traffic-chart__tooltip-delta--positive {
  color: var(--color-success);
}

.traffic-chart__tooltip-delta--negative {
  color: var(--color-danger);
}

.fmp-page,
.fmp-page > [data-refresh-fragment="fmp-chart"],
.fmp-chart {
  height: 100%;
  min-height: 0;
}

.fmp-page {
  min-height: 0;
}

.fmp-chart {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.fmp-chart__window-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
}

.fmp-window {
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  padding: 6px;
  font-size: 13px;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.fmp-window:hover,
.fmp-window:focus-within {
  z-index: 5;
}

.fmp-window--active {
  background: color-mix(in srgb, var(--color-surface-strong) 62%, #86efac);
  border-color: #72b78a;
}

.fmp-window--sustain-overload {
  background: color-mix(in srgb, var(--color-surface-strong) 70%, #ffff00);
  border-color: #ffff00;
}

.fmp-window--peak-overload {
  background: color-mix(in srgb, var(--color-surface-strong) 70%, #ffc800);
  border-color: #ffc800;
}

:root[data-theme="light"] .fmp-window--sustain-overload {
  background: color-mix(in srgb, var(--color-surface-strong) 72%, #ffc800);
  border-color: #ffc800;
}

:root[data-theme="light"] .fmp-window--peak-overload {
  background: color-mix(in srgb, var(--color-surface-strong) 78%, #ff0000);
  border-color: #ff0000;
}

.fmp-window__controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.fmp-window__controls > .fmp-window__field:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.fmp-window__toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.fmp-window__field {
  display: grid;
  gap: 0;
  min-width: 0;
}

.fmp-window__field--metric {
  width: 30px;
  flex: 0 0 30px;
}

.fmp-window__field--grid {
  width: 26px;
  flex: 0 0 26px;
}

.fmp-window__field--active {
  width: 38px;
  flex: 0 0 38px;
}

.fmp-window__chart {
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: 4px;
}

.fmp-window__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
  min-width: 0;
}

.fmp-window__actions[hidden] {
  display: none;
}

.fmp-window__button {
  min-height: 42px;
  padding: 0 10px;
  color: var(--color-text);
  font-weight: 700;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.fmp-window__button:hover,
.fmp-window__button:focus-visible {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.fmp-window__toggle[aria-pressed="true"] {
  color: var(--color-accent-contrast);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.fmp-window .fmp-window__button {
  min-height: 24px;
  padding: 0 3px;
  font-size: 10px;
}

.fmp-window .fmp-window__button--icon {
  display: inline-grid;
  width: 26px;
  min-width: 26px;
  padding: 0;
  place-items: center;
}

.fmp-window__grid-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.fmp-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(0 0 0 / 0.52);
}

.fmp-dialog[hidden] {
  display: none;
}

.fmp-dialog__panel {
  width: min(100%, 880px);
  max-height: min(760px, calc(100vh - 40px));
  padding: 18px;
  overflow: auto;
  color: var(--color-text);
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.26);
}

.fmp-dialog__header,
.fmp-dialog__footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.fmp-dialog__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.fmp-dialog__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.fmp-dialog__field {
  display: grid;
  gap: 6px;
}

.fmp-dialog__field--full {
  grid-column: 1 / -1;
}

.fmp-dialog__label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.fmp-dialog__input {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.fmp-dialog__message {
  min-height: 20px;
  margin: 0;
  color: var(--color-muted);
}

.fmp-dialog__table-wrap {
  margin-top: 14px;
  overflow: auto;
}

.fmp-dialog__table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.fmp-dialog__table th,
.fmp-dialog__table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-soft);
}

.fmp-dialog__table th {
  color: var(--color-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.fmp-dialog__row--suspended,
.fmp-dialog__row--fls,
.flight-list__row--fls {
  background: rgba(245, 206, 68, 0.16);
}

.fmp-dialog__row--ctot-exempt {
  background: rgba(147, 51, 234, 0.12);
}

.fmp-flight-state {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--color-muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.fmp-flight-state--ground {
  color: var(--color-accent);
}

.fmp-flight-state--activated {
  color: #16a34a;
}

.fmp-flight-state--airborne {
  color: #b45309;
}

.fmp-flight-state--suspended,
.fmp-flight-state--fls,
.fmp-flight-delay--suspended,
.fmp-flight-delay--fls {
  color: #facc15;
}

.fmp-flight-delay {
  font-weight: 800;
}

.fmp-ctot-exempt {
  color: #9333ea;
  font-weight: 800;
  white-space: nowrap;
}

:root[data-theme="dark"] .fmp-ctot-exempt {
  color: #c084fc;
}

.traffic-chart__bar-segment--fls {
  background: #ffff00;
}

.traffic-chart__bar-segment--ctot-exempt {
  background: #9333ea;
}

.fmp-flight-exemption {
  min-height: 28px;
  padding: 4px 8px;
  color: #6b21a8;
  font-size: 12px;
  font-weight: 800;
  background: #f3e8ff;
  border: 1px solid #c084fc;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.fmp-flight-exemption:hover,
.fmp-flight-exemption:focus-visible {
  color: #581c87;
  border-color: #9333ea;
  outline: 0;
  box-shadow: 0 0 0 3px rgb(147 51 234 / 0.18);
}

.fmp-flight-exemption--active {
  color: #fff;
  background: #9333ea;
  border-color: #7e22ce;
}

.fmp-flight-exemption:disabled {
  cursor: wait;
  opacity: 0.72;
}

:root[data-theme="dark"] .fmp-flight-exemption {
  color: #e9d5ff;
  background: rgb(88 28 135 / 0.38);
  border-color: #a855f7;
}

:root[data-theme="dark"] .fmp-flight-exemption--active {
  color: #faf5ff;
  background: #7e22ce;
  border-color: #c084fc;
}

.fmp-window .traffic-chart__value {
  font-size: 21px;
}

.fmp-window .traffic-chart,
.fmp-window .fmp-chart__series-inner {
  height: 100%;
  min-height: 0;
}

.fmp-window .traffic-chart__bars {
  height: auto;
  min-height: 0;
}

.fmp-window .traffic-chart__axis {
  height: 18px;
  margin-top: 0;
}

.fmp-window .traffic-chart__axis-label {
  min-height: 18px;
  font-size: 9px;
  line-height: 18px;
}

.fmp-window .traffic-chart__tooltip {
  gap: 3px;
  padding: 8px 10px;
  font-size: 12px;
}

.fmp-window__empty {
  padding: 8px 10px;
  font-size: 12px;
}

.fmp-chart__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 6px;
}

.fmp-chart__reset-all {
  min-height: 26px;
  margin-left: auto;
  padding: 0 8px;
  font-size: 11px;
}

.fmp-chart__field {
  display: grid;
  gap: 6px;
  width: min(100%, 280px);
}

.fmp-chart__select-label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fmp-window .fmp-chart__select-label {
  font-size: 11px;
  letter-spacing: 0.06em;
}

.fmp-chart__select,
.fmp-chart__search {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.fmp-chart__search {
  cursor: text;
}

.fmp-window .fmp-chart__search {
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
}

.fmp-chart__select:hover,
.fmp-chart__select:focus-visible,
.fmp-chart__search:hover,
.fmp-chart__search:focus-visible {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.fmp-chart__scroll {
  overflow: visible;
  padding: 6px 0 8px;
}

.fmp-chart__series[hidden] {
  display: none;
}

.fmp-chart__series-inner {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 18px;
  width: 100%;
  min-height: 0;
  padding-left: 24px;
}

.fmp-chart__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.fmp-chart__grid-line {
  position: absolute;
  display: block;
  opacity: 0.48;
}

.fmp-chart__grid-line--time {
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid var(--color-chart-track-border);
}

.fmp-chart__grid-line--value {
  right: 0;
  left: 0;
  height: 0;
  border-top: 1px solid var(--color-chart-track-border);
}

.fmp-chart__grid-label {
  position: absolute;
  display: block;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.fmp-chart__grid-label--value {
  left: -30px;
  width: 24px;
  text-align: right;
  transform: translateY(50%);
}

.fmp-capacity-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 3;
  height: 0;
  border-top: 1px dashed var(--color-muted);
  opacity: 0.9;
  pointer-events: none;
}

.fmp-capacity-line__label {
  position: absolute;
  right: 4px;
  bottom: 0;
  max-width: min(150px, 42%);
  padding: 1px 5px;
  overflow: hidden;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 4px;
  transform: translateY(50%);
}

.fmp-capacity-line--sustain {
  border-top-color: #ffff00;
}

.fmp-capacity-line--entry {
  border-top-color: #ff0000;
}

.fmp-capacity-line--peak {
  border-top-color: #ffc800;
}

:root[data-theme="light"] .fmp-capacity-line--sustain {
  border-top-color: #ffc800;
}

:root[data-theme="light"] .fmp-capacity-line--peak {
  border-top-color: #ff0000;
}

.fmp-capacity-line--regulation {
  z-index: 4;
  border-top-color: #22d3ee;
  border-top-style: solid;
  border-top-width: 2px;
  opacity: 0.95;
}

.fmp-capacity-line--regulation .fmp-capacity-line__label {
  color: #075985;
  border-color: #22d3ee;
}

.fmp-capacity-line--y-max {
  border-top-color: var(--color-muted);
  border-top-style: solid;
  opacity: 0.72;
}

.dashboard-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.dashboard-table--compact {
  min-width: 340px;
}

.dashboard-table--acc {
  min-width: 720px;
}

.dashboard-table--fmp {
  min-width: 560px;
}

.dashboard-table--nmoc-sector {
  min-width: 720px;
}

.dashboard-table--nmoc-intervals {
  min-width: 780px;
}

.dashboard-table--nmoc-route {
  min-width: 840px;
}

.dashboard-table--nmoc-ifpz {
  min-width: 460px;
}

.dashboard-table--flight-list {
  min-width: 1100px;
}

.dashboard-table--messages {
  min-width: 1180px;
}

.dashboard-table--logs {
  min-width: 820px;
}

.log-message {
  max-width: 640px;
  color: var(--color-text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.flight-list-tobt {
  font-weight: 700;
  white-space: nowrap;
}

.flight-list-tobt--eobt {
  color: var(--color-muted);
}

.flight-list-tobt--override {
  color: #0891b2;
}

:root[data-theme="dark"] .flight-list-tobt--override {
  color: #22d3ee;
}

.flight-list-rdy,
.tobt-ready-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  color: #047857;
  font-size: 12px;
  font-weight: 800;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  white-space: nowrap;
}

.flight-list-active-state {
  display: inline-grid;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  vertical-align: middle;
  background: #16a34a;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgb(22 163 74 / 0.18);
}

:root[data-theme="dark"] .flight-list-rdy,
:root[data-theme="dark"] .tobt-ready-pill {
  color: #a7f3d0;
  background: rgb(6 95 70 / 0.35);
  border-color: #10b981;
}

.tobt-ready-pill--activated {
  color: #075985;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

:root[data-theme="dark"] .tobt-ready-pill--activated {
  color: #bae6fd;
  background: rgb(3 105 161 / 0.35);
  border-color: #38bdf8;
}

.message-kind {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 800;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent-border);
  border-radius: 6px;
  white-space: nowrap;
}

.message-body {
  max-width: 520px;
  margin: 0;
  overflow-x: auto;
  color: var(--color-text);
  font-family: Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message-format-error {
  color: var(--color-danger);
  font-weight: 700;
}

.message-details {
  max-width: 280px;
  color: var(--color-muted);
}

.nmoc-panel {
  display: grid;
  gap: 16px;
}

.nmoc-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 0;
}

.nmoc-field {
  display: grid;
  gap: 6px;
  width: min(100%, 320px);
}

.nmoc-field__label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nmoc-input {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.nmoc-input:hover,
.nmoc-input:focus-visible {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.nmoc-button {
  min-height: 42px;
  padding: 0 14px;
  color: #ffffff;
  font-weight: 700;
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
}

.nmoc-button:hover,
.nmoc-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.nmoc-button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.dman-panel {
  display: grid;
  gap: 16px;
}

.pilot-cdm-page {
  max-width: 1120px;
  margin-right: auto;
  margin-left: auto;
}

.pilot-tobt-panel {
  display: grid;
  gap: 16px;
}

.pilot-tobt-board {
  display: grid;
  gap: 14px;
}

.pilot-tobt-console {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}

.pilot-tobt-console--empty {
  gap: 14px;
}

.pilot-tobt-console--display {
  gap: 12px;
  padding: 14px;
  background: #242a25;
  border: 0;
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.22);
}

.pilot-tobt-display {
  display: grid;
  min-width: 0;
  overflow: hidden;
  padding: 8px;
  font-family: "The Led Display ST", Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
  background: #20261f;
  border-radius: 5px;
}

.pilot-tobt-display__face {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pilot-tobt-display__line {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pilot-tobt-display__line--top {
  grid-template-columns: minmax(150px, 1.25fr) minmax(92px, 0.7fr) minmax(118px, 0.85fr);
}

.pilot-tobt-display__line--assignment {
  grid-template-columns: minmax(250px, 1.95fr) minmax(118px, 0.85fr);
}

.pilot-tobt-display__line--assignment strong {
  font-size: 26px;
}

.pilot-tobt-display__timing {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(92px, 0.7fr) minmax(118px, 0.85fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.pilot-tobt-display__time-lines {
  display: grid;
  grid-column: 1 / span 2;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.pilot-tobt-display__line span,
.pilot-tobt-display__delta,
.pilot-tobt-display__search-message {
  min-width: 0;
  padding: 9px 10px;
  background: #20261f;
  border-radius: 3px;
}

.pilot-tobt-display__line span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
}

.pilot-tobt-display__now {
  justify-content: flex-end !important;
}

.pilot-tobt-display__time-row span {
  gap: 12px;
  justify-content: flex-start;
}

.pilot-tobt-display strong,
.pilot-tobt-display em {
  min-width: 0;
  overflow: hidden;
  color: #e4d58a;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 1px 0 0 rgb(228 213 138 / 0.18), -1px 0 0 rgb(228 213 138 / 0.1);
}

.pilot-tobt-display em {
  flex: 0 0 auto;
  font-style: normal;
}

.pilot-tobt-display__time-row strong {
  font-size: 30px;
}

.pilot-tobt-display__search-message {
  display: flex;
  align-items: center;
  min-height: 140px;
  color: #e4d58a;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.08;
}

.pilot-tobt-display__delta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.pilot-tobt-display__delta strong {
  color: #e4d58a;
  font-size: 46px;
}

.pilot-tobt-display__value--green,
.pilot-tobt-display__value--green strong,
.pilot-tobt-display__value--green em {
  color: #73e88f !important;
  text-shadow: 1px 0 0 rgb(115 232 143 / 0.18), -1px 0 0 rgb(115 232 143 / 0.1);
}

.pilot-tobt-display__value--red,
.pilot-tobt-display__value--red strong,
.pilot-tobt-display__value--red em {
  color: #ff7f6e !important;
  text-shadow: 1px 0 0 rgb(255 127 110 / 0.18), -1px 0 0 rgb(255 127 110 / 0.1);
}

.pilot-tobt-display__value--blue,
.pilot-tobt-display__value--blue strong,
.pilot-tobt-display__value--blue em {
  color: #81adba !important;
  text-shadow: 1px 0 0 rgb(129 173 186 / 0.18), -1px 0 0 rgb(129 173 186 / 0.1);
}

.pilot-tobt-form--display {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px;
  font-family: "The Led Display ST", Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
  background: #20261f;
  border: 0;
  border-radius: 5px;
}

.pilot-tobt-form--display .tobt-field {
  gap: 0;
}

.pilot-tobt-form--display .tobt-input,
.pilot-tobt-form--display .tobt-button {
  font-family: inherit;
  color: #e4d58a;
  font-weight: 400;
  text-shadow: 1px 0 0 rgb(228 213 138 / 0.18), -1px 0 0 rgb(228 213 138 / 0.1);
  background: #20261f;
  border: 0;
  border-radius: 3px;
}

.pilot-tobt-form--display .tobt-input:hover,
.pilot-tobt-form--display .tobt-input:focus-visible,
.pilot-tobt-form--display .tobt-button:hover,
.pilot-tobt-form--display .tobt-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px rgb(228 213 138 / 0.22);
}

.pilot-tobt-console__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.pilot-tobt-console__eyebrow {
  margin: 0 0 5px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pilot-tobt-console__callsign {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 42px;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
}

.pilot-tobt-console__route {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  color: #075985;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
}

:root[data-theme="dark"] .pilot-tobt-console__route {
  color: #e0f2fe;
  background: #075985;
  border-color: #0ea5e9;
}

.pilot-tobt-console__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pilot-tobt-console__grid article {
  min-width: 0;
  padding: 12px 10px;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
}

.pilot-tobt-console__grid span {
  display: block;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.pilot-tobt-console__grid strong {
  display: block;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pilot-tobt-form {
  align-items: flex-end;
  padding-top: 4px;
}

.pilot-tobt-form__input {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.pilot-tobt-form__button {
  min-width: 132px;
}

.tobt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 0;
}

.cdm-airport-controls {
  display: grid;
  gap: 6px;
  align-content: start;
}

.cdm-airport-controls .tobt-status {
  min-height: 0;
}

.cdm-airport-strip {
  display: flex;
  flex: 1 1 420px;
  flex-wrap: wrap;
  gap: 8px;
  min-width: min(100%, 320px);
}

.cdm-airport-card {
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 10px;
  color: var(--color-text);
  text-align: left;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  cursor: pointer;
}

.cdm-airport-card[hidden] {
  display: none;
}

.cdm-airport-card:hover,
.cdm-airport-card:focus-visible {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.cdm-airport-card__icao {
  font-size: 15px;
  font-weight: 800;
}

.cdm-airport-card__meta,
.cdm-airport-card__strategy,
.cdm-airport-card__change {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.cdm-airport-card__strategy {
  color: #0891b2;
}

.cdm-airport-card__change {
  color: #b45309;
}

.tobt-field {
  display: grid;
  gap: 6px;
  width: min(100%, 320px);
}

.tobt-field--time {
  width: min(100%, 180px);
}

.tobt-field--airports {
  width: min(100%, 420px);
}

.tobt-field__label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tobt-input {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.tobt-input:hover,
.tobt-input:focus-visible {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.tobt-input--textarea {
  min-height: 64px;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.35;
  resize: vertical;
}

.tobt-input--cell {
  min-height: 36px;
  width: 112px;
}

.tobt-button {
  min-height: 42px;
  padding: 0 14px;
  color: #ffffff;
  font-weight: 700;
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  cursor: pointer;
}

.tobt-button--compact {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.tobt-button--secondary {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
}

.tobt-button--ready {
  color: #064e3b;
  background: #a7f3d0;
  border-color: #34d399;
}

.tobt-button--cld,
.tobt-button--act {
  color: #111827;
  background: #dbd9c8;
  border-color: #c7c3af;
}

:root[data-theme="dark"] .tobt-button--ready {
  color: #ecfdf5;
  background: #047857;
  border-color: #10b981;
}

:root[data-theme="dark"] .tobt-button--cld,
:root[data-theme="dark"] .tobt-button--act {
  color: #111827;
  background: #dbd9c8;
  border-color: #c7c3af;
}

.tobt-button:hover,
.tobt-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.tobt-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.tobt-status {
  min-height: 20px;
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.tobt-status--error {
  color: var(--color-danger);
}

.tobt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  color: var(--color-muted);
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
}

.tobt-summary[hidden] {
  display: none;
}

.tobt-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
}

.tobt-table-wrap {
  overflow-x: auto;
}

.cdm-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cdm-section {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.cdm-section__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.cdm-section__empty {
  margin: 0;
}

.cdm-airport-group {
  min-width: 0;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  overflow: hidden;
}

.cdm-airport-group[hidden] {
  display: none;
}

.cdm-airport-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: var(--color-surface-strong);
  border-bottom: 1px solid var(--color-border-soft);
}

.cdm-airport-group__header h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.cdm-airport-group__header span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.cdm-airport-group .tobt-table-wrap {
  overflow-x: hidden;
}

.cdm-flight-grid {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 10px;
}

.cdm-flight-grid__runway-divider {
  width: calc(75% - 6px);
  border-top: 2px solid rgb(17 24 39 / 0.35);
}

.cdm-flight-card {
  position: relative;
  display: block;
  width: calc(75% - 6px);
  min-width: 0;
  padding: 9px;
  color: #111827;
  background: #f1f1e5;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
}

.cdm-flight-card[hidden] {
  display: none;
}

.cdm-flight-card:hover,
.cdm-flight-card:focus-visible,
.cdm-flight-card:focus-within {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.cdm-flight-card__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cdm-flight-card__main,
.cdm-flight-card__hover,
.cdm-flight-card__drawer {
  display: grid;
  min-width: 0;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.cdm-flight-card__main {
  grid-template-columns: minmax(58px, 1.1fr) minmax(40px, 0.62fr) minmax(42px, 0.62fr) minmax(48px, 0.7fr);
}

.cdm-flight-card--ifps-invalid {
  border-color: #dc2626;
}

.cdm-flight-card--ifps-invalid::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 8px;
  background: #dc2626;
  border-radius: 7px 0 0 7px;
  content: "";
  pointer-events: none;
}

.cdm-flight-card__callsign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cdm-flight-card__main strong {
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.cdm-flight-card__main span,
.cdm-flight-card__hover span,
.cdm-flight-card__tobt {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cdm-flight-card__manual-runway {
  color: #0E2841;
  font-family: "Ink Free", "Segoe Print", cursive;
  font-size: 18px;
  font-weight: 900;
}

.cdm-flight-card__tsat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 5px;
  color: #111827;
  font-weight: 900;
  background: #f1f1e5;
  border: 1px solid rgb(17 24 39 / 0.15);
  border-radius: 5px;
}

.cdm-flight-card__sequence-delay {
  color: #b91c1c;
  font-weight: 500;
}

.cdm-flight-card__hover {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 120ms ease,
    opacity 120ms ease;
}

.cdm-flight-card__hover {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cdm-flight-card__hover--strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cdm-flight-card__strip-strong {
  font-weight: 900;
}

.cdm-flight-card__pdc-fail {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  background: #b91c1c;
  border-radius: 4px;
}

.cdm-flight-card__drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% - 1px);
  z-index: 2;
  width: 66px;
  align-items: center;
  justify-content: center;
  padding: 0 0 0 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-14px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.cdm-flight-card__drawer-box {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  background: #f1f1e5;
  border: 1px solid var(--color-border-soft);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  box-shadow: var(--shadow-subtle);
}

.cdm-flight-card__ifps-fail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.cdm-flight-card:hover .cdm-flight-card__hover,
.cdm-flight-card:focus-visible .cdm-flight-card__hover,
.cdm-flight-card:focus-within .cdm-flight-card__hover {
  max-height: 108px;
  opacity: 1;
  pointer-events: auto;
}

.cdm-flight-card:hover .cdm-flight-card__drawer,
.cdm-flight-card:focus-visible .cdm-flight-card__drawer,
.cdm-flight-card:focus-within .cdm-flight-card__drawer {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.cdm-flight-card__tobt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.cdm-flight-card--tobt-before-20 .cdm-flight-card__tobt-value {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 5px;
  color: #111827;
  background: #f1f1e5;
  border: 1px solid rgb(17 24 39 / 0.15);
  border-radius: 5px;
}

.cdm-flight-card__susp {
  color: #cb6964;
}

.cdm-flight-card__drawer,
.cdm-flight-card__drawer-box,
.cdm-flight-card__drawer .tobt-inline,
.cdm-flight-card__drawer .tobt-inline form {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
}

.cdm-flight-card .tobt-inline {
  flex-wrap: nowrap;
  gap: 4px;
}

.cdm-flight-card .tobt-input--cell {
  width: 58px;
  min-width: 0;
  height: 30px;
  padding: 0 5px;
  text-align: center;
}

.cdm-flight-card .tobt-time-pill {
  justify-content: center;
  min-width: 42px;
  min-height: 30px;
  padding: 0 6px;
}

.cdm-flight-card .tobt-button--compact {
  min-height: 30px;
  padding: 0 7px;
  font-size: 11px;
}

.cdm-flight-card .tobt-button--cld,
.cdm-flight-card .tobt-button--act {
  min-height: 60px;
  color: #111827;
  background: #dbd9c8;
  border-color: #c7c3af;
}

.cdm-flight-card__reminder {
  display: inline-flex;
  width: 100%;
  min-height: 60px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #111827;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-align: center;
}

.cdm-flight-card__reminder[hidden] {
  display: none;
}

.cdm-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.cdm-table thead th,
.cdm-table tbody td {
  overflow: hidden;
  padding: 7px 3px;
  font-size: 10px;
  letter-spacing: 0;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.cdm-table tbody td strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdm-table .tobt-inline {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 3px;
}

.cdm-table .tobt-input--cell {
  width: 44px;
  min-width: 0;
  height: 26px;
  padding: 0 3px;
  font-size: 10px;
  text-align: center;
}

.cdm-table .tobt-time-pill {
  justify-content: center;
  min-width: 36px;
  min-height: 24px;
  padding: 0 3px;
}

.cdm-table .tobt-button--compact {
  min-height: 24px;
  padding: 0 5px;
  font-size: 10px;
}

.cdm-table th:nth-child(1) {
  width: 10%;
}

.cdm-table th:nth-child(2),
.cdm-table th:nth-child(3),
.cdm-table th:nth-child(5),
.cdm-table th:nth-child(9),
.cdm-table th:nth-child(14),
.cdm-table th:nth-child(15) {
  width: 6%;
}

.cdm-table th:nth-child(4),
.cdm-table th:nth-child(6),
.cdm-table th:nth-child(11),
.cdm-table th:nth-child(12),
.cdm-table th:nth-child(13) {
  width: 7%;
}

.cdm-table th:nth-child(7) {
  width: 9%;
}

.cdm-table th:nth-child(8),
.cdm-table th:nth-child(10) {
  width: 5%;
}

.cdm-dialog__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cdm-dialog__meta span {
  min-height: 26px;
  padding: 4px 8px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
}

.cdm-dialog__form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cdm-runway-selector {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cdm-runway-selector > legend {
  padding: 0;
}

.cdm-runway-selector__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

.cdm-runway-selector__table-wrap {
  min-width: 0;
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
}

.cdm-runway-selector__table {
  width: 100%;
  min-width: 280px;
  table-layout: fixed;
  border-collapse: collapse;
}

.cdm-runway-selector__table th,
.cdm-runway-selector__table td {
  padding: 8px 10px;
  text-align: center;
  border-right: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
}

.cdm-runway-selector__table th:first-child {
  width: 40%;
  text-align: left;
}

.cdm-runway-selector__table th:last-child,
.cdm-runway-selector__table td:last-child {
  border-right: 0;
}

.cdm-runway-selector__table tbody tr:last-child th,
.cdm-runway-selector__table tbody tr:last-child td {
  border-bottom: 0;
}

.cdm-runway-selector__table thead th {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-surface-strong);
}

.cdm-runway-selector__table tbody th {
  color: var(--color-text);
  font-size: 14px;
  font-weight: 900;
}

.cdm-runway-selector__choice {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 8px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 900;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}

.cdm-runway-selector__choice:hover {
  color: var(--color-text);
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
}

.cdm-runway-selector__choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.cdm-runway-selector__choice input:focus-visible {
  outline: 2px solid var(--color-accent-border);
  outline-offset: 2px;
}

.cdm-runway-selector__choice input:checked + span {
  color: var(--color-text);
}

.cdm-runway-selector__empty {
  margin: 0;
  padding: 14px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: 6px;
}

.cdm-dialog__panel {
  background: #f2f1e5;
}

.cdm-dialog__panel .fmp-window__button,
.cdm-dialog__panel .tobt-button {
  background: #e1e1dd;
}

.cdm-timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.cdm-timeline__header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.cdm-timeline__header h4 {
  margin: 0;
  font-size: 14px;
}

.cdm-timeline__list {
  position: relative;
  display: grid;
  gap: 6px;
}

.cdm-timeline__list::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 11px;
  width: 2px;
  content: "";
  background: var(--color-border);
}

.cdm-timeline__item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px 8px 0;
  color: var(--color-text);
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  cursor: pointer;
}

.cdm-timeline__item:hover,
.cdm-timeline__item:focus-visible,
.cdm-timeline__item--selected {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 2px var(--color-accent-soft);
}

.cdm-timeline__item:disabled {
  cursor: default;
  opacity: 1;
}

.cdm-timeline__item--active {
  border-left: 3px solid #059669;
}

.cdm-timeline__marker {
  width: 10px;
  height: 10px;
  margin: 0 auto;
  background: var(--color-surface-strong);
  border: 2px solid var(--color-muted);
  border-radius: 50%;
}

.cdm-timeline__item--active .cdm-timeline__marker {
  background: #059669;
  border-color: #047857;
}

.cdm-timeline__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  min-width: 0;
}

.cdm-timeline__range {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.cdm-timeline__state {
  color: #047857;
  font-size: 10px;
  font-weight: 900;
}

.cdm-timeline__settings {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.cdm-ifps-check {
  min-width: 92px;
}

.cdm-ifps-check--loading {
  color: var(--color-muted);
}

.cdm-ifps-check--valid {
  color: #14532d;
  background: #bbf7d0;
  border-color: #16a34a;
}

.cdm-ifps-check--invalid {
  color: #7f1d1d;
  background: #fecaca;
  border-color: #dc2626;
}

:root[data-theme="dark"] .cdm-ifps-check--valid {
  color: #dcfce7;
  background: #047857;
  border-color: #34d399;
}

:root[data-theme="dark"] .cdm-ifps-check--invalid {
  color: #fee2e2;
  background: #991b1b;
  border-color: #f87171;
}

.cdm-flight-detail__summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 0.8fr));
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 10px;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
}

.cdm-flight-detail__summary strong {
  overflow: hidden;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.cdm-flight-detail__summary span {
  min-width: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cdm-flight-errors {
  margin-top: 12px;
  padding: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
}

.cdm-flight-errors[hidden] {
  display: none;
}

.cdm-flight-errors__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cdm-flight-errors__item {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border-soft);
  border-left: 4px solid var(--color-muted);
  border-radius: 6px;
}

.cdm-flight-errors__item--error {
  border-left-color: #dc2626;
}

.cdm-flight-errors__item--warning {
  border-left-color: #f59e0b;
}

.cdm-flight-errors__item strong {
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.cdm-flight-errors__item span {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.cdm-flight-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.cdm-flight-detail div {
  min-width: 0;
  padding: 9px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
}

.cdm-flight-detail dt {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.cdm-flight-detail dd {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cdm-fac {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.cdm-fac__row {
  display: grid;
  gap: 6px;
}

.cdm-fac__row--line1 {
  grid-template-columns: minmax(110px, 1.2fr) repeat(4, minmax(80px, 1fr));
}

.cdm-fac__row--line2 {
  grid-template-columns: minmax(110px, 1.2fr) repeat(4, minmax(80px, 1fr));
}

.cdm-fac__row--line5 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cdm-fac__row--line3,
.cdm-fac__row--line4 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cdm-fac__row--stip {
  grid-template-columns: minmax(0, 1fr);
}

.cdm-fac__row--actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-top: 2px;
}

.cdm-fac__field {
  min-width: 0;
  padding: 6px;
  text-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.cdm-fac__field--delay {
  background: #a9d0d7;
  border: 1px solid rgba(14, 40, 65, 0.24);
  border-radius: 6px;
}

.cdm-fac__field--empty {
  visibility: hidden;
  pointer-events: none;
}

.cdm-fac__field--textarea {
  min-height: 82px;
}

.cdm-fac__label {
  display: block;
  margin-bottom: 4px;
  color: #0e2841;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.cdm-fac__value,
.cdm-fac__input,
.cdm-fac__select,
.cdm-fac__textarea {
  width: 100%;
  min-width: 0;
  color: #111827;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.cdm-fac__value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cdm-fac__input {
  padding: 5px 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.cdm-fac__textarea,
.cdm-fac__select {
  padding: 5px 6px;
  background: #dbdac7;
  border: 1px solid rgba(14, 40, 65, 0.24);
  border-radius: 4px;
}

.cdm-fac__select[name="departureRunway"],
.cdm-fac__select[name="sid"] {
  width: auto;
  min-width: 52px;
  max-width: 100%;
}

.cdm-fac__textarea {
  min-height: 54px;
  resize: vertical;
  white-space: pre-wrap;
}

.cdm-fac__textarea[readonly],
.cdm-fac__input[readonly],
.cdm-fac__select:disabled {
  color: #374151;
  opacity: 1;
}

.cdm-cpdlc-log-table {
  max-height: min(58vh, 520px);
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
}

.cdm-cpdlc-log-table table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.cdm-cpdlc-log-table th,
.cdm-cpdlc-log-table td {
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border-soft);
}

.cdm-cpdlc-log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--color-surface);
}

.cdm-cpdlc-log-table td code {
  display: block;
  max-width: 420px;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-family: var(--font-mono);
  white-space: normal;
}

.cdm-cpdlc-log-table td strong {
  display: block;
  margin-top: 4px;
  color: #b91c1c;
  font-size: 11px;
}

.cdm-dialog__empty {
  margin: 14px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.tobt-row--active {
  background: #f1f1e5;
}

.tobt-row--active td {
  background: var(--color-accent-soft);
}

.tobt-row--timing-before-5 .cdm-flight-card__tsat {
  background: #81adba;
}

.tobt-row--timing-minus-5 .cdm-flight-card__tsat {
  background: #5fb84d;
}

.tobt-row--timing-plus-5 .cdm-flight-card__tsat {
  background: #ecae60;
}

.tobt-row--timing-late .cdm-flight-card__tsat {
  background: #d9706a;
}

.cdm-flight-card--tobt-before-20 .cdm-flight-card__tsat {
  background: #f1f1e5;
}

.cdm-flight-card--activated .cdm-flight-card__tsat {
  background: #5fb84d;
}

.cdm-flight-card--cpdlc-request .cdm-flight-card__callsign strong {
  padding: 2px 5px;
  background: #d1d5db;
  border: 1px solid rgb(17 24 39 / 0.14);
  border-radius: 5px;
}

.cdm-flight-card--cpdlc-request.tobt-row--timing-before-5,
.cdm-flight-card--cpdlc-request.tobt-row--timing-before-5 .cdm-flight-card__drawer-box {
  background: #81adba;
}

.cdm-flight-card--cpdlc-request.tobt-row--timing-minus-5,
.cdm-flight-card--cpdlc-request.tobt-row--timing-minus-5 .cdm-flight-card__drawer-box {
  background: #5fb84d;
}

.cdm-flight-card--cpdlc-request.tobt-row--timing-plus-5,
.cdm-flight-card--cpdlc-request.tobt-row--timing-plus-5 .cdm-flight-card__drawer-box {
  background: #ecae60;
}

.cdm-flight-card--cpdlc-request.tobt-row--timing-late,
.cdm-flight-card--cpdlc-request.tobt-row--timing-late .cdm-flight-card__drawer-box {
  background: #d9706a;
}

.cdm-flight-card--cpdlc-request:not(.tobt-row--timing-before-5):not(.tobt-row--timing-minus-5):not(.tobt-row--timing-plus-5):not(.tobt-row--timing-late),
.cdm-flight-card--cpdlc-request:not(.tobt-row--timing-before-5):not(.tobt-row--timing-minus-5):not(.tobt-row--timing-plus-5):not(.tobt-row--timing-late) .cdm-flight-card__drawer-box {
  background: #f7e6a8;
}

.cdm-flight-card .cdm-strip-alert {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  background: #ed884e;
  border: 1px solid #cf6d32;
  border-radius: 5px;
  color: #111827;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.28);
}

.tobt-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tobt-time-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  min-width: 52px;
  padding: 0 10px;
  font-weight: 700;
  background: rgb(255 255 255 / 0.55);
  border: 1px solid rgb(15 23 42 / 0.16);
  border-radius: 6px;
}

.nmoc-ifps {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
}

.nmoc-ifps[hidden] {
  display: none;
}

.nmoc-ifps__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.nmoc-ifps__status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.nmoc-ifps__status--loading::before,
.nmoc-ifps__status--valid::before,
.nmoc-ifps__status--invalid::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.nmoc-ifps__status--valid {
  color: var(--color-success);
}

.nmoc-ifps__status--valid::before {
  width: 10px;
  height: 6px;
  background: transparent;
  border: solid currentColor;
  border-width: 0 0 2px 2px;
  border-radius: 0;
  transform: rotate(-45deg) translateY(-1px);
}

.nmoc-ifps__status--invalid {
  color: var(--color-danger);
}

.nmoc-ifps__message {
  margin: 0;
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--color-danger);
  background: var(--color-danger-soft);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  font-family:
    "Cascadia Mono",
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: 12px;
  line-height: 1.5;
}

.nmoc-ifps-cell {
  width: 68px;
  text-align: center;
}

.nmoc-ifps-route-cell {
  width: 84px;
  text-align: center;
}

.nmoc-ifps-route-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  width: 66px;
  padding: 0 8px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent-border);
  border-radius: 6px;
  cursor: pointer;
}

.nmoc-ifps-route-button:hover,
.nmoc-ifps-route-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.nmoc-ifps-route-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.nmoc-ifps-dot,
.nmoc-ifps-caution {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.nmoc-ifps-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.nmoc-ifps-dot--valid {
  color: var(--color-success);
}

.nmoc-ifps-dot--pending {
  color: var(--color-muted);
}

.nmoc-ifps-caution {
  color: var(--color-danger);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.nmoc-ifps-caution--failed,
.nmoc-ifps-caution--not-checkable {
  color: var(--color-muted);
}

.nmoc-ifps-caution:hover,
.nmoc-ifps-caution:focus-visible {
  background: var(--color-surface-muted);
  outline: none;
}

.nmoc-ifps-error {
  display: grid;
  gap: 10px;
}

.nmoc-ifps-error__message {
  margin: 0;
  padding: 10px 12px;
  max-height: min(48vh, 420px);
  overflow: auto;
  white-space: pre-wrap;
  color: var(--color-text);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  font-family:
    "Cascadia Mono",
    "SFMono-Regular",
    Consolas,
    monospace;
  font-size: 13px;
  line-height: 1.5;
}

.nmoc-readout {
  min-height: 42px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.nmoc-flight-summary {
  padding: 12px 14px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
}

.nmoc-flight-results {
  display: grid;
  gap: 14px;
}

.nmoc-flight-results[hidden],
.nmoc-view-panel[hidden] {
  display: none;
}

.nmoc-tabs {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  gap: 3px;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
}

.nmoc-tab {
  min-height: 34px;
  padding: 0 14px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.nmoc-tab:hover,
.nmoc-tab:focus-visible {
  color: var(--color-text);
  outline: 0;
}

.nmoc-tab--active {
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.nmoc-view-panel {
  min-width: 0;
}

.nmoc-flight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.nmoc-result {
  min-width: 0;
}

.nmoc-result--profile {
  grid-column: 1 / -1;
}

.nmoc-result__title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 650;
}

.nmoc-profile {
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0;
}

.nmoc-profile__svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
  color: var(--color-text);
}

.nmoc-profile__gridline {
  stroke: rgba(143, 151, 144, 0.45);
  stroke-width: 0.6;
}

.nmoc-profile__axis-label,
.nmoc-profile__sector-label,
.nmoc-profile__point-label {
  fill: var(--color-muted);
  font-size: 9px;
  font-weight: 600;
}

.nmoc-profile__point-label {
  fill: var(--color-text);
  font-size: 7.5px;
}

.nmoc-profile__point-guide {
  stroke: #ffb74f;
  stroke-dasharray: 3 6;
  stroke-opacity: 0.38;
  stroke-width: 0.65;
}

.nmoc-profile__sector {
  fill-opacity: 0.32;
  stroke-opacity: 0.78;
  stroke-width: 0.8;
}

.nmoc-profile__line {
  fill: none;
  stroke: #ffb74f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.nmoc-profile__point {
  fill: #ffb74f;
  stroke: #ffb74f;
  stroke-width: 1.2;
}

.nmoc-profile__point--procedure {
  fill: #ffb74f;
  stroke: #ffb74f;
}

.nmoc-profile__point--constraint {
  fill: #4aa3ff;
  stroke: #4aa3ff;
}

.nmoc-profile__point--xfl {
  fill: #ef4444;
  stroke: #ef4444;
}

.nmoc-profile__aircraft-position {
  fill: #22c55e;
  stroke: #052e16;
  stroke-width: 1.6;
}

.dashboard-table thead th {
  padding: 0 0 12px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
}

.dashboard-table__sort-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  margin: -2px -4px;
  padding: 2px 4px;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: 1.25;
  text-align: left;
  text-transform: inherit;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.dashboard-table__sort-button:hover,
.dashboard-table__sort-button:focus-visible {
  color: var(--color-text);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.dashboard-table__sort-indicator {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.32;
}

.dashboard-table thead th[data-sort-direction="asc"] .dashboard-table__sort-indicator {
  border-top: 0;
  border-bottom: 5px solid currentColor;
  opacity: 0.9;
}

.dashboard-table thead th[data-sort-direction="desc"] .dashboard-table__sort-indicator {
  border-top: 5px solid currentColor;
  border-bottom: 0;
  opacity: 0.9;
}

.dashboard-table tbody td {
  padding: 14px 12px 14px 0;
  font-size: 14px;
  line-height: 1.45;
  vertical-align: top;
  border-bottom: 1px solid var(--color-table-border);
}

.dashboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-table__row--alert td {
  background: rgb(245 158 11 / 0.12);
}

.dashboard-table__row--ifps-invalid td {
  background: rgb(220 38 38 / 0.11);
}

.dashboard-table__row--ifps-invalid.dashboard-table__row--alert td {
  background: linear-gradient(
    90deg,
    rgb(220 38 38 / 0.14) 0%,
    rgb(220 38 38 / 0.14) 62%,
    rgb(245 158 11 / 0.14) 100%
  );
}

.nmoc-special-alert {
  appearance: none;
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid rgb(180 83 9 / 0.55);
  border-radius: 4px;
  color: #92400e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  background: rgb(245 158 11 / 0.18);
  cursor: pointer;
}

.nmoc-special-alert:hover,
.nmoc-special-alert:focus-visible {
  color: #78350f;
  background: rgb(245 158 11 / 0.28);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(245 158 11 / 0.16);
}

.nmoc-special-alert-dialog {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.nmoc-special-alert-dialog__summary {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
}

.nmoc-special-alert-dialog__table-wrap {
  overflow-x: auto;
}

.nmoc-special-alert-dialog__table {
  min-width: 620px;
}

.dashboard-table__stack {
  display: grid;
  gap: 4px;
}

.dashboard-table__stack strong {
  font-size: 14px;
  font-weight: 700;
}

.dashboard-table__stack span {
  color: var(--color-muted);
  font-size: 12px;
}

.dashboard-table__muted {
  color: var(--color-muted);
  font-size: 13px;
}

.acc-sector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.acc-sector-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent-border);
  border-radius: 6px;
}

/* Dense tower-supervisor HMI for the Sequencer. */

.app-shell--sequencer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-shell--sequencer .page-host--sequencer {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  color-scheme: dark;
  background: #171c1f;
}

.sequencer-page {
  display: block;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sequencer-page > [data-refresh-fragment] {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sequencer {
  --seq-bg: #202528;
  --seq-bg-deep: #171c1f;
  --seq-panel: #272d30;
  --seq-panel-alt: #1d2326;
  --seq-border: #4b555a;
  --seq-border-soft: #384247;
  --seq-grid: #3c474c;
  --seq-text: #e5eaec;
  --seq-muted: #aab3b7;
  --seq-departure: #3133c1;
  --seq-departure-border: #7779ff;
  --seq-arrival: #9c3d36;
  --seq-arrival-border: #df8179;
  --seq-live: #23c777;
  --sequencer-strip-width: 200px;

  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: var(--seq-text);
  font-family: Consolas, "Cascadia Mono", "SFMono-Regular", monospace;
  background: var(--seq-bg);
  border: 1px solid var(--seq-border);
  border-radius: 2px;
  box-shadow: none;
}

.sequencer__toolbar {
  display: flex;
  grid-row: 1;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 52px;
  padding: 7px 10px;
  background: #242a2d;
  border-bottom: 1px solid var(--seq-border);
}

.sequencer__brand {
  display: flex;
  flex: 1 1 330px;
  gap: 9px;
  align-items: center;
  min-width: 250px;
}

.sequencer__brand > i {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 3px solid #12a9df;
  border-radius: 50%;
  box-shadow: 0 0 8px rgb(18 169 223 / 0.28);
}

.sequencer__brand h1,
.sequencer__brand p {
  margin: 0;
}

.sequencer__brand h1 {
  color: var(--seq-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}

.sequencer__brand p {
  margin-top: 2px;
  color: var(--seq-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sequencer__airport-form {
  position: relative;
  display: flex;
  flex: 0 1 265px;
  gap: 4px;
  align-items: flex-end;
  min-width: 220px;
}

.sequencer__airport-field {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  gap: 3px;
  width: auto;
  min-width: 0;
}

.sequencer__airport-field > span:first-child {
  color: var(--seq-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sequencer__airport-input,
.sequencer__load-button,
.sequencer__config-button,
.sequencer__now-button {
  min-height: 30px;
  color: var(--seq-text);
  font: 800 11px/1 Consolas, "Cascadia Mono", monospace;
  background: #1b2023;
  border: 1px solid #657076;
  border-radius: 2px;
}

.sequencer__airport-input {
  width: 100%;
  padding: 0 8px;
  text-transform: uppercase;
}

.sequencer__airport-input:hover,
.sequencer__airport-input:focus-visible,
.sequencer__load-button:hover,
.sequencer__load-button:focus-visible,
.sequencer__config-button:not(:disabled):hover,
.sequencer__config-button:not(:disabled):focus-visible,
.sequencer__now-button:hover,
.sequencer__now-button:focus-visible {
  border-color: #28a6dc;
  outline: 1px solid #28a6dc;
  outline-offset: 0;
  box-shadow: none;
}

.sequencer__load-button,
.sequencer__config-button,
.sequencer__now-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  white-space: nowrap;
  cursor: pointer;
}

.sequencer__config-button {
  color: #dff8ff;
  background: #26363d;
  border-color: #527180;
}

.sequencer__config-button:disabled {
  color: #7f8a8f;
  background: #202629;
  border-color: #3f494e;
  cursor: not-allowed;
  opacity: 0.7;
}

.sequencer-config-dialog .fmp-dialog__message[data-error="true"],
.sequencer-arrival-dialog .fmp-dialog__message[data-error="true"] {
  color: #a62d27;
  font-weight: 700;
}

.sequencer-arrival-dialog__panel {
  width: min(560px, calc(100vw - 32px));
}

.sequencer-arrival-dialog__form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sequencer-config-dialog .cdm-runway-selector__table {
  min-width: 420px;
}

.cdm-runway-selector__capacity-cell {
  width: 24%;
}

.cdm-runway-selector__capacity {
  width: 76px;
  min-width: 0;
  padding-right: 4px;
  padding-left: 7px;
  text-align: right;
}

.cdm-runway-selector__capacity:disabled {
  color: var(--color-muted);
  cursor: not-allowed;
  opacity: 0.48;
}

.sequencer__now-button--active,
.sequencer__now-button[aria-pressed="true"] {
  color: #dff8ff;
  background: #075a77;
  border-color: #159ddd;
}

.sequencer__airport-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  right: 0;
  left: 0;
  z-index: 80;
  display: grid;
  max-height: 260px;
  overflow: auto;
  background: #14191b;
  border: 1px solid #657076;
  box-shadow: 0 8px 18px rgb(0 0 0 / 0.42);
}

.sequencer__airport-option {
  min-height: 28px;
  padding: 4px 8px;
  color: var(--seq-text);
  font: 800 11px/1 Consolas, monospace;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #30383c;
  cursor: pointer;
}

.sequencer__airport-option:hover,
.sequencer__airport-option:focus-visible,
.sequencer__airport-option--active {
  color: #ffffff;
  background: #075a77;
  outline: 0;
}

.sequencer__clock {
  display: grid;
  gap: 1px;
  min-width: 80px;
  padding: 4px 8px;
  color: var(--seq-text);
  background: #1b2023;
  border: 1px solid var(--seq-border-soft);
  border-radius: 2px;
}

.sequencer__clock span {
  color: var(--seq-muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.sequencer__clock strong {
  font: 800 12px/1.1 Consolas, monospace;
}

.sequencer__ops-line {
  display: flex;
  grid-row: 2;
  flex-wrap: wrap;
  gap: 5px 14px;
  align-items: center;
  min-height: 29px;
  padding: 4px 9px;
  color: var(--seq-muted);
  font-size: 9px;
  background: var(--seq-bg-deep);
  border-bottom: 1px solid var(--seq-border-soft);
}

.sequencer__summary {
  flex: 1 1 440px;
  min-height: 0;
  margin: 0;
  padding: 0;
  color: var(--seq-muted);
  font-size: 9px;
  font-weight: 700;
  background: transparent;
  border: 0;
}

.sequencer__legend {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
  align-items: center;
  min-height: 0;
  margin: 0;
  color: var(--seq-muted);
  font-size: 8px;
  font-weight: 800;
}

.sequencer__legend > span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.sequencer__legend-marker {
  display: inline-block;
  width: 15px;
  min-width: 15px;
  height: 8px;
  padding: 0;
  background: var(--seq-departure);
  border: 1px solid var(--seq-departure-border);
  border-radius: 1px;
}

.sequencer__legend-marker--arrival {
  color: inherit;
  background: var(--seq-arrival);
  border-color: var(--seq-arrival-border);
}

.sequencer__legend-marker--departure {
  color: inherit;
  background: var(--seq-departure);
  border-color: var(--seq-departure-border);
}

.sequencer__status {
  display: inline-flex;
  min-height: 0;
  margin: 0;
  padding: 2px 6px;
  color: #ffd16a;
  font-size: 8px;
  font-weight: 800;
  white-space: normal;
  background: #4e3515;
  border: 1px solid #966c24;
  border-radius: 2px;
}

.sequencer__status::before {
  display: none;
}

.sequencer__status--error {
  color: #ffb4ad;
  background: #4b211f;
  border-color: #9c4943;
}

.sequencer__workspace {
  display: grid;
  grid-row: 3;
  grid-template-columns: minmax(520px, 58fr) minmax(430px, 42fr);
  gap: 6px;
  min-width: 0;
  min-height: 0;
  padding: 6px;
  overflow: hidden;
}

.sequencer-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--seq-panel);
  border: 1px solid var(--seq-border);
  border-radius: 1px;
  box-shadow: none;
}

.sequencer-panel__header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 27px;
  padding: 4px 7px;
  background: #171c1f;
  border-bottom: 1px solid var(--seq-border);
}

.sequencer-panel__header > div {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.sequencer-panel__header strong {
  color: var(--seq-text);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.sequencer-panel__header span {
  overflow: hidden;
  color: var(--seq-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequencer-panel__header > span:last-child {
  flex: 0 0 auto;
  padding: 2px 5px;
  color: #bcdbe7;
  background: #26363d;
  border: 1px solid #48606a;
}

.sequencer-panel--timeline {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.sequencer__viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow-x: auto;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #788287 #252c2f;
  scrollbar-width: auto;
  background: var(--seq-bg-deep);
  outline: 0;
  isolation: isolate;
}

.sequencer__viewport::-webkit-scrollbar {
  width: 12px;
  height: 10px;
}

.sequencer__viewport::-webkit-scrollbar-track {
  background: #252c2f;
  border-left: 1px solid #3c474c;
}

.sequencer__viewport::-webkit-scrollbar-thumb {
  background: #788287;
  border: 2px solid #252c2f;
  border-radius: 6px;
}

.sequencer__viewport::-webkit-scrollbar-thumb:hover {
  background: #a4adb1;
}

.sequencer__viewport:focus-visible {
  box-shadow: inset 0 0 0 1px #22a7dc;
}

.sequencer__surface {
  --sequencer-track-height: 1680px;

  position: relative;
  display: flex;
  grid-template-columns: none;
  grid-template-rows: none;
  align-items: flex-start;
  width: max-content;
  min-width: 100%;
  min-height: calc(var(--sequencer-track-height) + 31px);
  background: #1e2427;
  isolation: isolate;
}

.sequencer-runway-group {
  --sequencer-runway-columns: 1;
  --sequencer-scale-width: 58px;

  position: relative;
  flex: 0 0 auto;
  background: #202629;
  border-right: 1px solid var(--seq-border);
}

.sequencer-runway-group:last-child {
  border-right: 0;
}

.sequencer-runway-group__header,
.sequencer-runway-group__body {
  display: grid;
  grid-template-columns:
    var(--sequencer-scale-width)
    repeat(var(--sequencer-runway-columns), minmax(0, 1fr));
}

.sequencer-runway-group__header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 31px;
  color: var(--seq-text);
  background: #171c1f;
  border-bottom: 1px solid var(--seq-border);
}

.sequencer-runway-group__title,
.sequencer-runway-column__title {
  display: grid;
  min-width: 0;
  min-height: 30px;
  padding: 4px 6px;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid var(--seq-border-soft);
}

.sequencer-runway-group__title {
  color: var(--seq-muted);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.sequencer-runway-column__title:last-child {
  border-right: 0;
}

.sequencer-runway-group--unassigned .sequencer-runway-group__header {
  background: repeating-linear-gradient(135deg, #171c1f 0 9px, #20272a 9px 18px);
  border-bottom-style: dashed;
}

.sequencer-runway-group__body {
  --sequencer-minute-height: 8px;

  position: relative;
  min-height: var(--sequencer-track-height);
  overflow: hidden;
}

.sequencer-runway-group__scale {
  position: relative;
  z-index: 3;
  min-width: 0;
  overflow: visible;
  background: #181e21;
  border-right: 1px solid #899399;
}

.sequencer-runway-group__scale::after {
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  width: 1px;
  content: "";
  background: #aeb8bd;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.28);
}

.sequencer-runway-column {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background-color: #202629;
  background-image:
    linear-gradient(to bottom, transparent 0 calc(100% - 1px), #4b555a calc(100% - 1px) 100%),
    linear-gradient(to bottom, transparent 0 calc(100% - 1px), #333d42 calc(100% - 1px) 100%);
  background-size:
    100% calc(var(--sequencer-minute-height) * 10),
    100% calc(var(--sequencer-minute-height) * 5);
  border-right: 1px solid var(--seq-border-soft);
}

.sequencer-runway-column:last-child {
  border-right: 0;
}

.sequencer-runway-group--unassigned .sequencer-runway-column {
  background-color: #1d2225;
  background-image:
    linear-gradient(to bottom, transparent 0 calc(100% - 1px), #485156 calc(100% - 1px) 100%),
    repeating-linear-gradient(135deg, transparent 0 12px, rgb(255 255 255 / 0.016) 12px 24px);
  border-right-style: dashed;
  border-left-style: dashed;
}

.sequencer-runway__flow {
  position: absolute;
  top: 0;
  right: 4px;
  bottom: 0;
  left: 31px;
  z-index: 10;
  min-width: 0;
}

.sequencer__axis-tick {
  position: absolute;
  right: -7px;
  left: auto;
  z-index: 4;
  display: block;
  width: 14px;
  height: 0;
  padding: 0;
  color: #aeb8bd;
  background: transparent;
  border: 0;
  border-top: 1px solid #899399;
  transform: translateY(-50%);
  pointer-events: none;
}

.sequencer__axis-tick--major {
  right: -12px;
  width: 24px;
  color: var(--seq-text);
  border-top-color: #d1d7da;
}

.sequencer__tick-label {
  position: absolute;
  top: 0;
  right: 16px;
  left: auto;
  display: block;
  width: auto;
  padding: 1px 4px;
  color: #dbe1e3;
  font: 800 9px/1 Consolas, monospace;
  text-align: center;
  white-space: nowrap;
  background: #202629;
  border-radius: 0;
  transform: translateY(-50%);
}

.sequencer__now-line {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 8;
  height: 0;
  color: var(--seq-live);
  border-top: 1px solid currentcolor;
  pointer-events: none;
}

.sequencer__now-line::before {
  position: absolute;
  top: -3px;
  left: calc(var(--sequencer-scale-width) - 4px);
  width: 7px;
  height: 7px;
  content: "";
  background: currentcolor;
  border-radius: 50%;
  transform: translateX(-50%);
}

.sequencer__now-label {
  position: absolute;
  top: 0;
  left: calc(var(--sequencer-scale-width) + 8px);
  padding: 1px 3px;
  color: #04150d;
  font: 900 7px/1 Consolas, monospace;
  letter-spacing: 0.04em;
  background: var(--seq-live);
  border-radius: 1px;
  transform: translateY(-50%);
}

.sequencer-flight {
  position: absolute;
  right: auto;
  z-index: 12;
  display: block;
  width: var(--sequencer-strip-width);
  min-width: 0;
  min-height: 26px;
  max-height: 26px;
  overflow: visible;
  padding: 4px 5px;
  color: #ffffff;
  font: 700 9px/1 Consolas, "Cascadia Mono", monospace;
  text-align: left;
  background: var(--seq-departure);
  border: 1px solid var(--seq-departure-border);
  border-left-width: 1px;
  border-radius: 2px;
  box-shadow: none;
  transform: translateY(-50%);
  cursor: pointer;
}

.sequencer-flight::after {
  position: absolute;
  top: 50%;
  width: var(--sequencer-connector-length, 31px);
  height: 0;
  content: "";
  border-top: 1px solid currentcolor;
  opacity: 0.9;
  transform: rotate(var(--sequencer-connector-angle, 0deg));
  pointer-events: none;
}

.sequencer-flight--departure {
  right: auto;
  left: 3px;
  color: #ffffff;
  background: var(--seq-departure);
  border-color: var(--seq-departure-border);
}

.sequencer-flight--departure::after,
.sequencer-flight--arrival::after {
  right: 100%;
  left: auto;
  transform-origin: right center;
}

.sequencer-flight--arrival {
  right: auto;
  left: 3px;
  color: #ffffff;
  background: var(--seq-arrival);
  border-color: var(--seq-arrival-border);
}

.sequencer-flight__line {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) 12px minmax(28px, 0.65fr) 20px minmax(24px, 0.55fr) 32px;
  gap: 3px;
  align-items: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  white-space: nowrap;
}

.sequencer-flight__callsign,
.sequencer-flight__value,
.sequencer-flight__time {
  overflow: hidden;
  color: #ffffff;
  font: 800 9px/1 Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequencer-flight__callsign {
  text-align: left;
}

.sequencer-flight__value {
  font-size: 8px;
  text-align: center;
}

.sequencer-flight__time {
  font-size: 8px;
  text-align: right;
}

.sequencer-flight__value--delay:not(:empty) {
  color: #ffe14f;
}

.sequencer-flight:hover,
.sequencer-flight:focus-visible,
.sequencer-flight--selected {
  z-index: 30;
  outline: 1px solid #ffffff;
  outline-offset: 1px;
  filter: brightness(1.15);
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.42);
}

.sequencer-flight[data-past="true"],
.sequencer-flight--past {
  opacity: 0.58;
}

.sequencer-flight[data-past="true"]:hover,
.sequencer-flight[data-past="true"]:focus-visible,
.sequencer-flight--past:hover,
.sequencer-flight--past:focus-visible {
  opacity: 1;
}

.sequencer__empty {
  display: grid;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 20px;
  place-items: center;
  color: var(--seq-muted);
  font-size: 11px;
  text-align: center;
  background: var(--seq-bg-deep);
  border: 0;
  border-radius: 0;
}

.sequencer__side {
  display: grid;
  grid-template-rows: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 0.55fr);
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sequencer-panel--list,
.sequencer-panel--flow,
.sequencer-panel--kpi {
  grid-template-rows: auto minmax(0, 1fr);
}

.sequencer-list {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-color: #788287 #252c2f;
  scrollbar-width: thin;
}

.sequencer-list__table {
  width: 100%;
  min-width: 1100px;
  color: var(--seq-text);
  font: 700 9px/1.05 Consolas, monospace;
  border-collapse: collapse;
}

.sequencer-list__table th,
.sequencer-list__table td {
  height: 20px;
  padding: 2px 4px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid #3d474b;
  border-bottom: 1px solid #3d474b;
}

.sequencer-list__table th {
  position: sticky;
  top: 0;
  z-index: 3;
  color: #d4dade;
  font-size: 8px;
  font-weight: 800;
  background: #343b3f;
}

.sequencer-list__row:nth-child(even) {
  background: rgb(255 255 255 / 0.025);
}

.sequencer-list__row--selected {
  background: #30444d !important;
  box-shadow: inset 3px 0 #23b7ef;
}

.sequencer-list__row--arrival .sequencer-list__kind,
.sequencer-list__row--arrival .sequencer-list__primary-time {
  color: var(--seq-arrival-border);
}

.sequencer-list__row--departure .sequencer-list__kind,
.sequencer-list__row--departure .sequencer-list__primary-time {
  color: var(--seq-departure-border);
}

.sequencer-list__delay {
  color: #ffe14f;
  font-weight: 800;
}

.sequencer-list__focus {
  padding: 0;
  color: #eaf4f7;
  font: 800 9px/1 Consolas, monospace;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sequencer-list__focus:hover,
.sequencer-list__focus:focus-visible {
  color: #68d4ff;
  text-decoration: underline;
  outline: 0;
}

.sequencer-list__empty {
  display: grid;
  min-height: 100%;
  margin: 0;
  padding: 18px;
  place-items: center;
  color: var(--seq-muted);
  font-size: 10px;
}

.sequencer-flow {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto hidden;
  background: #202629;
}

.sequencer-flow__chart {
  position: relative;
  display: flex;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  height: 100%;
  min-height: 158px;
  padding: 8px 8px 3px;
}

.sequencer-flow__chart::before {
  position: absolute;
  top: calc(50% - 6px);
  right: 8px;
  left: 8px;
  z-index: 1;
  height: 1px;
  content: "";
  background: #d3d8da;
}

.sequencer-flow__column {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(66px, 1fr) minmax(66px, 1fr) 15px;
  flex: 1 0 36px;
  min-width: 36px;
  border-left: 1px dashed #3f4a4f;
}

.sequencer-flow__bar {
  display: flex;
  width: calc(100% - 6px);
  max-width: 34px;
  align-items: center;
  justify-content: center;
  justify-self: center;
  color: #ffffff;
  font-size: 8px;
  font-weight: 900;
  border: 1px solid #c9d1d5;
}

.sequencer-flow__bar--departure {
  align-self: end;
  background: var(--seq-departure);
  border-color: var(--seq-departure-border);
}

.sequencer-flow__bar--arrival {
  align-self: start;
  background: var(--seq-arrival);
  border-color: var(--seq-arrival-border);
}

.sequencer-flow__time {
  align-self: end;
  color: var(--seq-muted);
  font-size: 7px;
  text-align: center;
  transform: translateX(-50%);
}

.sequencer-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.sequencer-kpi {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 2px;
  min-width: 0;
  padding: 7px;
  background: #23292c;
  border-right: 1px solid var(--seq-border);
  border-bottom: 1px solid var(--seq-border);
}

.sequencer-kpi__label {
  overflow: hidden;
  color: var(--seq-muted);
  font-size: 7px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequencer-kpi__value {
  align-self: center;
  color: #f0f4f5;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.sequencer-kpi__detail {
  color: #8fa0a8;
  font-size: 7px;
}

@media (max-width: 1280px) {
  .sequencer__workspace {
    grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  }
}

@media (max-width: 760px) {
  .app-shell--sequencer .page-host--sequencer {
    padding: 0;
  }

  .sequencer {
    border-right: 0;
    border-left: 0;
  }

  .sequencer__brand {
    flex-basis: 100%;
  }

  .sequencer__airport-form {
    flex: 1 1 220px;
  }

  .sequencer__config-button {
    flex: 1 1 84px;
  }

  .sequencer__workspace {
    grid-template-rows: minmax(0, 3fr) minmax(150px, 2fr);
    grid-template-columns: minmax(0, 1fr);
    padding: 4px;
  }

  .sequencer-panel--timeline {
    min-height: 0;
  }

  .sequencer__viewport {
    height: auto;
    min-height: 0;
    scroll-snap-type: x mandatory;
  }

  .sequencer-runway-group {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .sequencer__side {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(360px, 1.4fr) minmax(280px, 1fr) minmax(280px, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sequencer__side > .sequencer-panel {
    min-width: 0;
  }

  .sequencer-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sequencer * {
    scroll-behavior: auto !important;
  }
}

.map-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - var(--topbar-height) - 48px);
  min-height: calc(100dvh - var(--topbar-height) - 48px);
}

.map-hero {
  min-width: 0;
}

.map-controls {
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 160px minmax(180px, 1fr) 130px minmax(150px, 0.7fr) auto;
  gap: 14px 18px;
  align-items: center;
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
}

.map-controls__readout {
  display: grid;
  gap: 3px;
}

.map-controls__readout span,
.map-controls__meta {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-controls__readout strong {
  font-size: 26px;
  line-height: 1;
}

.map-controls__range {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 34px;
}

.map-controls__range-track {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 7px;
  overflow: hidden;
  transform: translateY(-50%);
  background: var(--color-chart-track);
  border: 1px solid var(--color-chart-track-border);
  border-radius: 999px;
}

.map-controls__range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--color-accent);
  border-radius: inherit;
}

.map-controls__slider {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 34px;
  margin: 0;
  pointer-events: none;
  appearance: none;
  background: transparent;
}

.map-controls__slider--max,
.map-controls__slider--active {
  z-index: 3;
}

.map-controls__slider:disabled {
  opacity: 0;
}

.map-controls__slider::-webkit-slider-runnable-track {
  height: 34px;
  background: transparent;
  border: 0;
}

.map-controls__slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: 8px;
  pointer-events: auto;
  appearance: none;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  cursor: pointer;
}

.map-controls__slider::-moz-range-track {
  height: 34px;
  background: transparent;
  border: 0;
}

.map-controls__slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  pointer-events: auto;
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
  cursor: pointer;
}

.map-controls__slider:focus-visible {
  outline: 0;
}

.map-controls__slider:focus-visible::-webkit-slider-thumb {
  box-shadow:
    0 1px 4px rgba(15, 23, 42, 0.28),
    0 0 0 4px var(--color-accent-soft);
}

.map-controls__slider:focus-visible::-moz-range-thumb {
  box-shadow:
    0 1px 4px rgba(15, 23, 42, 0.28),
    0 0 0 4px var(--color-accent-soft);
}

.map-controls__toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.map-controls__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.map-controls__toggle--mode {
  min-width: 120px;
}

.map-controls__toggle:hover,
.map-controls__toggle:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-controls__toggle[aria-pressed="true"] {
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
}

.map-controls__toggle--mode:not([data-overlay-mode="empty"]) {
  color: var(--color-accent);
  background: var(--color-accent-soft);
  border-color: var(--color-accent-border);
}

.map-controls__toggle:disabled {
  color: var(--color-muted);
  cursor: not-allowed;
  opacity: 0.62;
}

.map-weather-menu {
  position: relative;
  min-width: 118px;
}

.map-weather-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  list-style: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.map-weather-menu summary::-webkit-details-marker {
  display: none;
}

.map-weather-menu[open] summary,
.map-weather-menu summary:hover,
.map-weather-menu summary:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-weather-menu__panel {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  min-width: 178px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  box-shadow: var(--shadow-tooltip);
}

.map-weather-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.map-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-column: 1 / -1;
  gap: 10px;
  min-width: 0;
}

.map-filter {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.map-filter span {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.map-filter input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.map-filter input:focus {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-controls__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  grid-column: 1 / -1;
  gap: 16px;
}

.map-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 20px;
  align-items: start;
  height: 100%;
  min-height: 0;
}

.map-panel[data-legend-visible="false"] {
  grid-template-columns: minmax(0, 1fr);
}

.sector-map {
  position: relative;
  height: 100%;
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.sector-map__leaflet,
.sector-map__globe {
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.sector-map__globe {
  position: relative;
  overflow: hidden;
  background: #030711;
}

.sector-map__globe[data-loading="true"]::after {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  padding: 8px 12px;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  content: "Loading globe";
  background: rgb(3 7 17 / 0.76);
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sector-map__globe .maplibregl-canvas {
  outline: 0;
}

.sector-map__globe .maplibregl-ctrl-group {
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.22);
}

.sector-map__globe .maplibregl-ctrl-group button {
  width: 34px;
  height: 34px;
}

.sector-map__globe .maplibregl-ctrl-attrib {
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
}

.sector-map__globe .maplibregl-ctrl-attrib a {
  color: inherit;
}

.sector-map__globe .globe-aircraft-marker {
  padding: 0;
  cursor: pointer;
  outline: 0;
}

.sector-map__globe .globe-aircraft-marker[data-labels-hidden] .aircraft-marker__label {
  display: none;
}

.sector-map__globe .globe-aircraft-marker:focus-visible .aircraft-marker__shape {
  filter: drop-shadow(0 0 4px var(--color-accent));
}

.sector-map .leaflet-container {
  color: var(--color-text);
  background: var(--color-map-bg);
  font: inherit;
}

.sector-map .leaflet-control-attribution {
  font-size: 11px;
}

.sector-map .leaflet-tooltip {
  color: var(--color-text);
  font-size: 12px;
  line-height: 1.35;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  box-shadow: var(--shadow-tooltip);
}

.sector-map .map-route-point {
  overflow: visible;
  color: var(--map-route-point-color, #6b7280);
  background: transparent;
  border: 0;
}

.sector-map .map-route-point > span,
.sector-map .map-route-point svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sector-map .map-route-point svg {
  overflow: visible;
  fill: var(--color-surface);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgb(15 23 42 / 0.38));
}

.sector-map .map-route-point__fix {
  fill: currentColor;
  stroke-width: 1.4;
}

.sector-map .map-route-point__ndb-ring {
  fill: none;
  stroke-dasharray: 1 3;
  stroke-linecap: round;
  stroke-width: 3;
}

.map-route-time-label {
  pointer-events: none;
}

.map-route-time-label > span {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  gap: 2px;
  padding: 2px 5px;
  color: var(--color-text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.18);
  transform: translate(7px, -50%);
}

.map-route-point-label__name,
.map-route-point-label__details {
  display: block;
  line-height: 1;
  white-space: nowrap;
}

.map-route-point-label__name {
  font-size: 10px;
  font-weight: 900;
}

.map-route-point-label__details {
  color: var(--color-muted);
  font-size: 9px;
  font-weight: 800;
}

.map-route-time-label--passed > span {
  color: #14532d;
  background: rgb(220 252 231 / 0.96);
  border-color: rgb(22 163 74 / 0.65);
  box-shadow: 0 1px 4px rgb(22 101 52 / 0.22);
}

.map-route-time-label--passed .map-route-point-label__details {
  color: #15803d;
}

.map-aircraft-popup {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 700;
  display: grid;
  gap: 12px;
  width: min(320px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 14px;
  overflow: auto;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-tooltip);
}

.map-aircraft-popup[hidden] {
  display: none;
}

.map-aircraft-popup__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-aircraft-popup__header span {
  display: block;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.map-aircraft-popup__header strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.1;
}

.map-aircraft-popup__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--color-muted);
  font-size: 20px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.map-aircraft-popup__close:hover,
.map-aircraft-popup__close:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-aircraft-popup__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--color-border-soft);
  border-bottom: 1px solid var(--color-border-soft);
}

.map-aircraft-popup__grid div {
  min-width: 0;
}

.map-aircraft-popup__grid dt {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.map-aircraft-popup__grid dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.map-aircraft-popup__route {
  display: grid;
  gap: 5px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.map-aircraft-popup__route span {
  overflow-wrap: anywhere;
}

.map-aircraft-tooltip {
  display: grid;
  gap: 2px;
  min-width: 104px;
}

.map-aircraft-tooltip strong,
.map-aircraft-tooltip span {
  display: block;
}

.map-aircraft-tooltip strong {
  font-size: 13px;
  font-weight: 800;
}

.map-aircraft-tooltip__wind {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

.map-aircraft-tooltip__wind-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: #2563eb;
}

.sector-map .map-context-menu-popup .leaflet-popup-content-wrapper {
  overflow: hidden;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-tooltip);
}

.sector-map .map-context-menu-popup .leaflet-popup-content {
  width: auto !important;
  margin: 0;
}

.sector-map .map-context-menu-popup .leaflet-popup-tip {
  background: var(--color-surface);
}

.sector-map .map-context-menu-popup .leaflet-popup-close-button {
  color: var(--color-muted);
}

.sector-map .map-context-menu {
  display: grid;
  min-width: 236px;
  padding: 6px;
}

.sector-map .map-context-menu__title {
  padding: 8px 10px 7px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.sector-map .map-context-menu__separator {
  height: 1px;
  margin: 4px -6px;
  background: var(--color-border-soft);
}

.sector-map .map-context-menu__section {
  padding: 8px 10px 4px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.sector-map .map-context-menu__status {
  padding: 8px 10px 6px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.sector-map .map-context-menu__button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 34px;
  padding: 8px 10px;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

.sector-map .map-context-menu__button:hover,
.sector-map .map-context-menu__button:focus-visible {
  color: var(--color-text);
  background: var(--color-surface-strong);
  outline: 0;
}

.sector-map .map-context-menu__button--airep {
  text-transform: uppercase;
}

.sector-map .map-context-menu__button--airep span {
  min-width: 0;
}

.sector-map .map-context-menu__symbol,
.sector-map .map-airep-symbol {
  flex: 0 0 auto;
  width: 28px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.sector-map .map-airep-symbol__dash {
  stroke-dasharray: 3 3;
}

.sector-map .map-airep-symbol__dot {
  stroke-linecap: round;
  stroke-width: 5;
}

.sector-map .map-context-menu__symbol {
  width: 30px;
  height: 25px;
}

.sector-map .map-airep-symbol--smooth-light-turbulence {
  color: #65d64d;
}

.sector-map .map-airep-symbol--light-turbulence {
  color: #49c857;
}

.sector-map .map-airep-symbol--light-moderate-turbulence {
  color: #f1a23a;
}

.sector-map .map-airep-symbol--moderate-turbulence {
  color: #f59e32;
}

.sector-map .map-airep-symbol--moderate-severe-turbulence {
  color: #c6473e;
}

.sector-map .map-airep-symbol--severe-turbulence {
  color: #bf2636;
}

.sector-map .map-airep-symbol--extreme-turbulence {
  color: #c03bd8;
}

.sector-map .map-airep-symbol--trace-icing {
  color: #67d3ea;
}

.sector-map .map-airep-symbol--light-icing {
  color: #45c7dc;
}

.sector-map .map-airep-symbol--moderate-icing {
  color: #2f8ee8;
}

.sector-map .map-airep-symbol--severe-icing {
  color: #2563eb;
}

.sector-map .map-airep-marker {
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
  border: 0;
}

.sector-map .map-airep-marker .map-airep-symbol {
  width: 31px;
  height: 28px;
  filter:
    drop-shadow(0 1px 2px rgb(15 23 42 / 0.85))
    drop-shadow(0 0 4px rgb(15 23 42 / 0.72));
}

.sector-map .map-airep-marker span {
  position: absolute;
  top: 24px;
  left: 50%;
  color: #f8fafc;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  text-shadow:
    0 1px 2px rgb(15 23 42 / 0.85),
    0 -1px 2px rgb(15 23 42 / 0.85),
    1px 0 2px rgb(15 23 42 / 0.85),
    -1px 0 2px rgb(15 23 42 / 0.85);
  transform: translateX(-50%);
  white-space: nowrap;
}

.map-airep-tooltip {
  display: grid;
  gap: 2px;
}

.map-airep-tooltip strong,
.map-airep-tooltip span {
  display: block;
}

.map-airep-tooltip strong {
  font-size: 13px;
  font-weight: 900;
}

.sector-map .map-spot-wind {
  display: grid;
  gap: 8px;
  min-width: 184px;
  padding: 10px 12px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.sector-map .map-spot-wind__header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.sector-map .map-spot-wind__header strong {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.1;
}

.sector-map .map-spot-wind__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--color-muted);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  background: var(--color-surface-strong);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
}

.sector-map .map-spot-wind__arrow:hover,
.sector-map .map-spot-wind__arrow:focus-visible {
  color: var(--color-text);
  background: var(--color-accent-soft);
  outline: 0;
}

.sector-map .map-spot-wind__rows {
  display: grid;
  gap: 6px;
}

.sector-map .map-spot-wind__row {
  display: grid;
  grid-template-columns: 38px 42px minmax(58px, 1fr);
  gap: 7px;
  align-items: center;
}

.sector-map .map-spot-wind__level {
  color: var(--color-muted);
  text-align: right;
}

.sector-map .map-spot-wind__vector {
  position: relative;
  display: block;
  width: 34px;
  height: 12px;
  transform: rotate(var(--wind-rotation, 0deg));
  transform-origin: 50% 50%;
}

.sector-map .map-spot-wind__vector::before {
  position: absolute;
  top: 5px;
  left: 2px;
  width: 25px;
  height: 3px;
  content: "";
  background: #ef3124;
  border-radius: 999px;
  box-shadow: 0 0 7px rgb(239 49 36 / 0.72);
}

.sector-map .map-spot-wind__vector::after {
  position: absolute;
  top: 2px;
  right: 0;
  width: 0;
  height: 0;
  content: "";
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 8px solid #ef3124;
  filter: drop-shadow(0 0 4px rgb(239 49 36 / 0.72));
}

.sector-map .map-spot-wind__value {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.sector-map .map-spot-wind__status,
.sector-map .map-spot-wind__meta {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.sector-map .map-load-tooltip-shell {
  min-width: 210px;
  max-width: 280px;
  white-space: normal;
}

.map-load-tooltip {
  display: grid;
  gap: 4px;
}

.map-load-tooltip strong {
  font-size: 13px;
}

.map-load-tooltip span {
  display: block;
}

.map-load-tooltip__chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(4px, 1fr));
  align-items: end;
  height: 32px;
  gap: 2px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border-soft);
}

.map-load-tooltip__chart span {
  min-height: 2px;
  border-radius: 2px 2px 0 0;
}

.sector-map .map-airport-load-marker {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: visible;
  background: transparent;
  border: 0;
}

.sector-map .map-airport-load-marker span {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  background: var(--airport-load-bg, rgb(100 116 139 / 0.25));
  border: 2px solid var(--airport-load-color, #64748b);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.24);
}

.sector-map .map-airport-load-marker strong {
  color: var(--airport-load-color, #64748b);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    0 1px 2px var(--color-surface),
    0 -1px 2px var(--color-surface),
    1px 0 2px var(--color-surface),
    -1px 0 2px var(--color-surface);
}

.map-volume-popup {
  display: grid;
  gap: 6px;
  min-width: 420px;
  max-width: 540px;
}

.map-volume-popup strong,
.map-volume-popup span {
  display: block;
}

.map-volume-popup__entries {
  max-height: 210px;
  margin-top: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--color-border-soft);
}

.map-volume-popup__table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 12px;
}

.map-volume-popup__table th,
.map-volume-popup__table td {
  padding: 4px 6px;
  border-top: 1px solid var(--color-border-soft);
  text-align: left;
  white-space: nowrap;
}

.map-volume-popup__table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface);
}

.sector-map .map-volume-label {
  background: transparent;
  border: 0;
}

.sector-map .map-volume-label span {
  display: block;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-shadow:
    0 1px 2px var(--color-surface),
    0 -1px 2px var(--color-surface),
    1px 0 2px var(--color-surface),
    -1px 0 2px var(--color-surface);
  transform: translate(-50%, -50%);
}

.sector-map .aircraft-marker {
  width: 32px;
  height: 32px;
  overflow: visible;
  background: transparent;
  border: 0;
}

.sector-map .aircraft-marker__shape {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--aircraft-icon-size, 28px);
  height: var(--aircraft-icon-size, 28px);
  color: var(--aircraft-color, #6f6f6f);
  transform: translate(-50%, -50%) rotate(var(--aircraft-heading, 0deg));
  transform-origin: 50% 50%;
}

.sector-map .aircraft-marker__silhouette {
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  -webkit-mask-image: var(--aircraft-silhouette);
  mask-image: var(--aircraft-silhouette);
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.sector-map .aircraft-marker__label {
  position: absolute;
  left: var(--aircraft-label-offset, 33px);
  top: 50%;
  display: grid;
  gap: 2px;
  color: #d1d5db;
  font-size: var(--aircraft-label-font-size, 11px);
  font-weight: 800;
  line-height: 1.05;
  pointer-events: none;
  white-space: nowrap;
  text-shadow:
    0 1px 2px rgb(15 23 42 / 0.75),
    0 -1px 2px rgb(15 23 42 / 0.75),
    1px 0 2px rgb(15 23 42 / 0.75),
    -1px 0 2px rgb(15 23 42 / 0.75);
  transform: translateY(-50%);
}

.sector-map .aircraft-marker__label-line {
  display: block;
}

.sector-map .aircraft-marker__label-line--emergency {
  color: #ff3b30;
  font-weight: 950;
}

.sector-map__leaflet--labels-hidden .aircraft-marker__label,
.sector-map__leaflet--labels-hidden .map-route-time-label,
.sector-map__leaflet--labels-hidden .map-volume-label,
.sector-map__leaflet--labels-hidden .map-airport-load-marker strong,
.sector-map__leaflet--labels-hidden .map-airep-marker span {
  display: none;
}

.sector-map .map-cape-canvas {
  mix-blend-mode: multiply;
}

[data-theme="dark"] .sector-map .map-cape-canvas {
  mix-blend-mode: screen;
  opacity: 0.72;
}

.map-legend {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-height: 100%;
  padding: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-subtle);
}

.map-legend__section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.map-legend[hidden],
.map-legend__section[hidden] {
  display: none;
}

.map-legend__title {
  margin: 0;
  font-size: 16px;
}

.map-legend__altitude-scale {
  display: grid;
  gap: 7px;
}

.map-legend__altitude-gradient {
  display: block;
  width: 100%;
  height: 12px;
  background: linear-gradient(
    90deg,
    #440154 0%,
    #472d7b 12.5%,
    #3b528b 25%,
    #2c728e 37.5%,
    #21918c 50%,
    #28ae80 62.5%,
    #5ec962 75%,
    #addc30 87.5%,
    #fde725 100%
  );
  border: 1px solid var(--color-border-soft);
  border-radius: 3px;
}

.map-legend__altitude-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
}

.map-legend__cape-scale {
  display: grid;
  gap: 7px;
}

.map-legend__cape-gradient {
  display: block;
  width: 100%;
  height: 12px;
  background: linear-gradient(
    90deg,
    #536f8f 0%,
    #6aa84f 33.333%,
    #9b6848 66.667%,
    #9b51b6 100%
  );
  border: 1px solid var(--color-border-soft);
  border-radius: 3px;
}

.map-legend__cape-labels {
  position: relative;
  min-height: 14px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
}

.map-legend__cape-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.map-legend__cape-labels span:nth-child(1) {
  left: 0;
  transform: none;
}

.map-legend__cape-labels span:nth-child(2) {
  left: 33.333%;
}

.map-legend__cape-labels span:nth-child(3) {
  left: 66.667%;
}

.map-legend__cape-labels span:nth-child(4) {
  left: 100%;
  transform: translateX(-100%);
}

.map-legend__load-items {
  display: grid;
  gap: 8px;
}

.map-legend__item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 24px;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 700;
}

.map-legend__swatch {
  width: 14px;
  height: 14px;
  border: 1px solid var(--color-border-soft);
  border-radius: 3px;
}

.map-simulation {
  padding-top: 14px;
  border-top: 1px solid var(--color-border-soft);
}

.map-simulation__label,
.map-simulation__status {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.map-simulation__label {
  text-transform: uppercase;
}

.map-simulation__input {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 10px 12px;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.map-simulation__input:focus {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-simulation__actions {
  display: flex;
  justify-content: flex-end;
}

.map-simulation__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.map-simulation__button:hover,
.map-simulation__button:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-simulation__status {
  margin: 0;
}

@media (max-width: 1100px) {
  .cdm-board,
  .fmp-chart__window-grid {
    grid-template-columns: 1fr;
  }

  .page-host--fmp {
    height: auto;
    min-height: calc(100vh - var(--topbar-height));
    padding: 16px;
    overflow: auto;
  }

  .fmp-page,
  .fmp-page > [data-refresh-fragment="fmp-chart"],
  .fmp-chart {
    height: auto;
  }

  .fmp-chart__window-grid {
    grid-template-rows: none;
  }

  .fmp-window .traffic-chart__bars {
    height: 220px;
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .cdm-flight-card {
    width: 100%;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    min-height: var(--topbar-height);
    gap: 8px;
    padding: 12px 16px;
  }

  .topbar__nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar__actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .page-host {
    min-height: calc(100vh - 116px);
    padding: 16px;
  }

  .page-heading__title {
    font-size: 28px;
  }

  .dashboard-metrics,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card__header,
  .dashboard-card__body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .metric-card__value {
    font-size: 30px;
  }

  .pilot-tobt-console {
    padding: 16px;
  }

  .pilot-tobt-console--display {
    padding: 10px;
  }

  .pilot-tobt-display__line--top,
  .pilot-tobt-display__line--assignment,
  .pilot-tobt-display__timing {
    grid-template-columns: 1fr;
  }

  .pilot-tobt-display__time-lines {
    grid-column: auto;
  }

  .pilot-tobt-display__delta {
    min-height: 86px;
  }

  .pilot-tobt-display strong {
    font-size: 22px;
  }

  .pilot-tobt-display__delta strong {
    font-size: 38px;
  }

  .pilot-tobt-display__search-message,
  .pilot-tobt-display__time-row strong {
    font-size: 24px;
  }

  .pilot-tobt-console__header {
    align-items: stretch;
    flex-direction: column;
  }

  .pilot-tobt-console__callsign {
    font-size: 32px;
  }

  .pilot-tobt-console__route {
    justify-content: center;
    width: 100%;
    white-space: normal;
  }

  .pilot-tobt-console__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pilot-tobt-form,
  .pilot-tobt-form .tobt-field {
    width: 100%;
  }

  .pilot-tobt-form__button {
    width: 100%;
  }

  .traffic-chart__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .traffic-chart__value {
    font-size: 24px;
  }

  .traffic-chart__bars {
    height: 144px;
    min-height: 144px;
  }

  .traffic-chart__slot {
    height: 100%;
  }

  .traffic-chart__axis {
    height: 18px;
  }

  .traffic-chart__axis-label {
    min-height: 18px;
    font-size: 10px;
    line-height: 18px;
  }

  .traffic-chart__tooltip {
    min-width: 160px;
    max-width: 190px;
  }

  .fmp-window {
    padding: 10px;
  }

  .fmp-dialog__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .fmp-dialog__form {
    grid-template-columns: 1fr;
  }

  .cdm-runway-selector__table th,
  .cdm-runway-selector__table td {
    padding: 7px 6px;
  }

  .cdm-runway-selector__choice {
    gap: 5px;
    min-height: 38px;
    padding: 5px;
  }

  .cdm-timeline__header {
    align-items: stretch;
    flex-direction: column;
  }

  .cdm-timeline__content {
    grid-template-columns: 1fr;
  }

  .cdm-timeline__state,
  .cdm-timeline__settings {
    grid-column: 1;
  }

  .fmp-window .traffic-chart__bars {
    height: 220px;
    min-height: 220px;
  }

  .fmp-window .traffic-chart__axis-label {
    font-size: 9px;
  }

  .fmp-chart__controls {
    align-items: stretch;
    flex-direction: column;
  }

  .fmp-chart__field {
    width: 100%;
  }

  .fmp-chart__scroll {
    margin-right: 0;
    padding-right: 0;
  }

  .dashboard-table {
    min-width: 560px;
  }

  .dashboard-table--compact {
    min-width: 300px;
  }

  .dashboard-table--acc {
    min-width: 640px;
  }

  .dashboard-table--fmp {
    min-width: 500px;
  }

  .dashboard-table--nmoc-sector {
    min-width: 660px;
  }

  .dashboard-table--nmoc-intervals {
    min-width: 700px;
  }

.dashboard-table--nmoc-route {
  min-width: 800px;
}

  .dashboard-table--nmoc-ifpz {
    min-width: 340px;
  }

  .nmoc-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .nmoc-field {
    width: 100%;
  }

  .nmoc-button,
  .nmoc-readout {
    width: 100%;
  }

  .nmoc-tabs {
    width: 100%;
  }

  .nmoc-tab {
    flex: 1 1 0;
  }

  .nmoc-flight-grid {
    grid-template-columns: 1fr;
  }

  .map-controls,
  .map-panel {
    grid-template-columns: 1fr;
  }

  .map-controls__meta {
    grid-column: 1;
  }

  .map-controls__toggles {
    justify-content: flex-start;
  }

  .map-controls__toggle {
    flex: 1 1 160px;
  }

  .sector-map {
    min-height: 60dvh;
  }

  .map-aircraft-popup {
    bottom: 12px;
    max-height: calc(100% - 24px);
  }

  .map-aircraft-popup__grid {
    grid-template-columns: 1fr;
  }

}


/* Compact operational map controls. */
.map-controls {
  grid-template-columns: 75px minmax(90px, 1fr) 80px minmax(90px, 1fr) 65px minmax(75px, .7fr) auto;
  gap: 7px 9px;
  padding: 9px 10px;
}
.map-controls__readout span, .map-controls__meta, .map-filter span { font-size: 6px; }
.map-controls__readout strong { font-size: 13px; }
.map-controls__range { min-height: 17px; }
.map-controls__range-track { height: 4px; }
.map-controls__slider, .map-controls__slider::-webkit-slider-runnable-track { height: 17px; }
.map-controls__slider::-webkit-slider-thumb { width: 9px; height: 9px; margin-top: 4px; border-width: 1px; }
.map-controls__slider::-moz-range-track { height: 17px; }
.map-controls__slider::-moz-range-thumb { width: 9px; height: 9px; border-width: 1px; }
.map-controls__toggles { gap: 4px; }
.map-controls__toggle, .map-weather-menu summary { min-height: 19px; padding: 4px 6px; font-size: 7px; border-radius: 3px; }
.map-controls__toggle--mode { min-width: 60px; }
.map-weather-menu { min-width: 59px; }
.map-filter-bar { grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); gap: 5px; }
.map-filter { gap: 3px; }
.map-filter input { min-height: 19px; padding: 4px 5px; font-size: 7px; border-radius: 3px; }
.map-controls__meta { gap: 8px; }
.map-aircraft-popup { background: color-mix(in srgb, var(--color-surface) 80%, transparent); backdrop-filter: blur(3px); }

:root[data-theme="dark"] .fmp-dialog,
:root[data-theme="dark"] .cdm-dialog { color-scheme: dark; }
:root[data-theme="dark"] .cdm-dialog__panel { background: var(--color-surface-strong); }
:root[data-theme="dark"] .cdm-dialog__panel .fmp-window__button,
:root[data-theme="dark"] .cdm-dialog__panel .tobt-button {
  color: var(--color-text);
  background: var(--color-surface);
  border-color: var(--color-border);
}
:root[data-theme="dark"] .cdm-fac__field--delay { background: #28444a; border-color: rgb(207 232 237 / .24); }
:root[data-theme="dark"] .cdm-fac__label,
:root[data-theme="dark"] .cdm-fac__value,
:root[data-theme="dark"] .cdm-fac__input,
:root[data-theme="dark"] .cdm-fac__select,
:root[data-theme="dark"] .cdm-fac__textarea { color: var(--color-text); }
:root[data-theme="dark"] .cdm-fac__textarea,
:root[data-theme="dark"] .cdm-fac__select { background: #3b3b35; border-color: var(--color-border); }
:root[data-theme="dark"] .cdm-fac__textarea[readonly],
:root[data-theme="dark"] .cdm-fac__input[readonly],
:root[data-theme="dark"] .cdm-fac__select:disabled { color: var(--color-muted); }

/* Keep every Leaflet popup in the active application theme, not only context menus. */
.sector-map .leaflet-popup-content-wrapper,
.sector-map .leaflet-popup-tip {
  color: var(--color-text);
  background: var(--color-surface);
}
.sector-map .leaflet-popup-content-wrapper {
  border: 1px solid var(--color-border-soft);
  box-shadow: var(--shadow-tooltip);
}
.sector-map .leaflet-popup-close-button { color: var(--color-muted); }

/* Map controls live on the map so the cartography keeps the full page width. */
.map-page {
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
}

.map-controls {
  position: absolute;
  top: 10px;
  left: 58px;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: min(320px, calc(100% - 78px));
  padding: 0;
  overflow: visible;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 7px;
  box-shadow: var(--shadow-tooltip);
}

.map-controls[hidden],
.map-controls__panel[hidden],
.map-filter-option__menu[hidden] {
  display: none;
}

.map-controls__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 9px 8px 13px;
  border-bottom: 1px solid var(--color-border-soft);
}

.map-controls__header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-controls__close {
  display: inline-grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 5px;
  color: var(--color-muted);
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.map-controls__close svg,
.map-tool-stack__button svg,
.map-filter-option__button svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.map-controls__close svg {
  width: 17px;
  height: 17px;
}

.map-controls__close:hover,
.map-controls__close:focus-visible {
  color: var(--color-text);
  background: var(--color-page);
  outline: 0;
}

.map-controls__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  padding: 13px;
}

.map-controls__readout {
  gap: 4px;
}

.map-controls__readout span,
.map-controls__meta {
  font-size: 9px;
}

.map-controls__readout strong {
  font-size: 18px;
}

.map-controls__range {
  min-height: 34px;
}

.map-controls__range-track {
  height: 5px;
}

.map-controls__slider,
.map-controls__slider::-webkit-slider-runnable-track,
.map-controls__slider::-moz-range-track {
  height: 34px;
}

.map-controls__slider::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: 10px;
  border-width: 1px;
}

.map-controls__slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-width: 1px;
}

.map-controls__toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.map-filter-visibility {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-soft);
}

.map-filter-visibility .map-controls__toggle {
  white-space: normal;
}

.map-controls__toggle,
.map-controls__toggle--mode {
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  font-size: 11px;
  border-radius: 5px;
}

.map-controls__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-column: auto;
  gap: 7px 12px;
  line-height: 1.35;
}

.map-weather-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-weather-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 800;
}

.map-settings {
  gap: 15px;
}

.map-settings__label-toggle {
  width: 100%;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.map-settings__field,
.map-settings__group {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.map-settings__field > span,
.map-settings__group legend {
  padding: 0;
  color: var(--color-muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.map-settings__field select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 800;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: 5px;
}

.map-settings__field select:focus-visible,
.map-settings__reset:focus-visible {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-settings__checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
}

.map-settings__sizes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-settings__checks label,
.map-settings__colors label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 750;
}

.map-settings__colors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.map-settings__colors label {
  justify-content: space-between;
  padding: 6px 7px;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: 5px;
}

.map-settings__colors input[type="color"] {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  padding: 2px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
}

.map-settings__reset {
  min-height: 34px;
  padding: 7px 9px;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 800;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  cursor: pointer;
}

.map-settings__reset:hover {
  color: var(--color-text);
  border-color: var(--color-accent-border);
}

.map-tool-stack {
  position: absolute;
  top: 172px;
  left: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.map-tool-stack__button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 7px;
  color: var(--color-text);
  place-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.22);
  cursor: pointer;
}

.map-tool-stack__button svg {
  width: 19px;
  height: 19px;
}

.map-tool-stack__button:hover,
.map-tool-stack__button:focus-visible,
.map-tool-stack__button[aria-expanded="true"],
.map-tool-stack__button[aria-pressed="true"] {
  color: var(--color-accent);
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-tool-stack__button--active::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--color-accent);
  border-radius: 50%;
}

.map-tool-stack__button--active {
  position: relative;
}

.map-tool-stack__button--projection {
  margin-top: 5px;
  border-radius: 50%;
}

.map-filter-list {
  display: grid;
  gap: 6px;
}

.map-filter-option {
  position: relative;
  min-width: 0;
}

.map-filter-option__button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) 16px;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 9px 8px 11px;
  color: var(--color-text);
  text-align: left;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  cursor: pointer;
}

.map-filter-option__button span {
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
}

.map-filter-option__button strong {
  max-width: 116px;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-filter-option__button svg {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease;
}

.map-filter-option__button[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.map-filter-option__button:hover,
.map-filter-option__button:focus-visible,
.map-filter-option__button[aria-expanded="true"] {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-filter-option__menu {
  position: absolute;
  top: 0;
  left: calc(100% + 9px);
  z-index: 2;
  display: grid;
  gap: 7px;
  width: 250px;
  padding: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: 6px;
  box-shadow: var(--shadow-tooltip);
}

.map-filter-option__menu label {
  color: var(--color-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.map-filter-option__menu > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.map-filter-option__menu input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--color-text);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--color-page);
  border: 1px solid var(--color-border);
  border-radius: 5px;
}

.map-filter-option__menu input:focus {
  border-color: var(--color-accent-border);
  outline: 0;
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.map-filter-option__menu button {
  min-height: 34px;
  padding: 7px 9px;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 800;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  cursor: pointer;
}

.map-filter-option__menu button:hover,
.map-filter-option__menu button:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent-border);
  outline: 0;
}

@media (max-width: 720px) {
  .map-controls {
    right: 10px;
    left: 54px;
    width: auto;
  }

  .map-filter-option__menu {
    position: static;
    width: 100%;
    margin-top: 6px;
  }
}
