:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f4f6f9;
  --panel-3: #ffffff;
  --field: #ffffff;
  --ink: #101828;
  --ink-2: #414b5a;
  --muted: #68758a;
  --line: #e3e7ee;
  --line-strong: #cfd6e0;
  --glass: rgba(255, 255, 255, 0.9);
  --accent: #1f6fd1;
  --accent-strong: #185db3;
  --accent-soft: rgba(31, 111, 209, 0.14);
  --route: #2a78d6;
  --optimal: #1baf7a;
  --direct: #5b6b80;
  --terrain: #a08f73;
  --terrain-fill: rgba(176, 158, 126, 0.34);
  --cloud: #7d8798;
  --cloud-fill: rgba(125, 135, 152, 0.3);
  --icing: #1f9cc0;
  --icing-fill: rgba(31, 156, 192, 0.4);
  --airport: #0b7285;
  --navaid: #eb6834;
  --ok: #12925e;
  --warn: #c9760a;
  --danger: #cf3a30;
  --danger-soft: rgba(207, 58, 48, 0.1);
  --casing: #ffffff;
  --shadow-float: 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 24px rgba(16, 24, 40, 0.12);
  --shadow-panel: 0 0 0 1px rgba(16, 24, 40, 0.04), 4px 0 24px rgba(16, 24, 40, 0.06);
  --radius: 12px;
  --radius-sm: 9px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0f16;
  --panel: #111822;
  --panel-2: #18212d;
  --panel-3: #263243;
  --field: #0d141d;
  --ink: #e8edf4;
  --ink-2: #b9c3d0;
  --muted: #8693a5;
  --line: #222d3c;
  --line-strong: #344357;
  --glass: rgba(17, 24, 34, 0.88);
  --accent: #3987e5;
  --accent-strong: #5598e7;
  --accent-soft: rgba(57, 135, 229, 0.22);
  --route: #4a93ea;
  --optimal: #23b683;
  --direct: #9aa8ba;
  --terrain: #8d8169;
  --terrain-fill: rgba(141, 129, 105, 0.36);
  --cloud: #9aa5b8;
  --cloud-fill: rgba(170, 182, 204, 0.26);
  --icing: #45c2e0;
  --icing-fill: rgba(69, 194, 224, 0.38);
  --airport: #54c6d8;
  --navaid: #f08a4b;
  --ok: #3ccf91;
  --warn: #f0a53c;
  --danger: #f2756b;
  --danger-soft: rgba(242, 117, 107, 0.14);
  --casing: #0a0f16;
  --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.45);
  --shadow-panel: 0 0 0 1px rgba(0, 0, 0, 0.3), 4px 0 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter Variable", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

p {
  margin: 0;
}

em {
  color: var(--muted);
  font-style: normal;
  font-weight: 450;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Shell ---------- */

.app {
  --sidebar-width: 388px;
  display: grid;
  grid-template-columns: clamp(300px, var(--sidebar-width), 60vw) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.api-status {
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--line-strong) 35%, transparent);
}

.api-status[data-state="ok"] {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
}

.api-status[data-state="warn"] {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 22%, transparent);
}

.api-status[data-state="error"] {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  text-decoration: none;
}

.icon-btn:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 9px;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transition: opacity 0.12s;
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
.sidebar-resizing .sidebar-resizer::after {
  opacity: 1;
}

.sidebar-resizer:focus-visible {
  outline: none;
}

.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

/* ---------- Planner form ---------- */

.planner {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.planner-body {
  display: grid;
  flex: 1;
  gap: 18px;
  align-content: start;
  min-height: 0;
  padding: 18px 18px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-actions {
  display: flex;
  gap: 2px;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.text-btn:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.text-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.route-note {
  margin: 0;
  padding: 8px 18px 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.route-edit-note {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.route-edit-note .text-btn {
  flex: none;
}

.hint-tight {
  margin-top: -6px;
}

.field-error {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 550;
}

.control,
.control-affix {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background-color: var(--field);
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.control {
  padding: 0 11px;
}

textarea.control {
  font: inherit;
  height: auto;
  min-height: 60px;
  padding: 8px 11px;
  line-height: 1.45;
  resize: vertical;
}

.am-tail-number {
  text-transform: uppercase;
}

.am-tail-number::placeholder {
  text-transform: none;
}

select.control {
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238693a5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}

.control-affix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
}

.control-affix input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  appearance: textfield;
  -moz-appearance: textfield;
}

.control-affix input::-webkit-outer-spin-button,
.control-affix input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.affix-label,
.affix-unit {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.control:hover,
.control-affix:hover {
  border-color: color-mix(in srgb, var(--line-strong) 60%, var(--ink-2));
}

.control:focus,
.control:focus-visible,
.control-affix:focus-within {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.takeoff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 8px;
}

.range-dash {
  height: 1.5px;
  background: var(--line-strong);
}

/* Segmented control */

.segmented {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

.segmented button {
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-checked="true"] {
  background: var(--panel-3);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.14), 0 0 0 1px var(--line);
}

.segmented button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Route stops */

.stops-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--field);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.stops-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.stops-card.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.stops {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.stops:empty {
  display: none;
}

.stop {
  position: relative;
  display: grid;
  grid-template-columns: 14px 22px minmax(0, 1fr) auto 26px;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 4px 8px 4px 5px;
  cursor: pointer;
  user-select: none;
}

.stop:hover {
  background: var(--panel-2);
}

.stop.drag-over {
  box-shadow: inset 0 2px 0 var(--accent);
}

.stop.dragging {
  opacity: 0.45;
}

.stop-grip {
  color: var(--line-strong);
  font-size: 14px;
  cursor: grab;
}

.stop:hover .stop-grip {
  color: var(--muted);
}

.stop-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--direct);
  border-radius: 50%;
  background: var(--field);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stop:not(:last-child) .stop-marker::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  width: 2px;
  height: 22px;
  background: repeating-linear-gradient(to bottom, var(--line-strong) 0 4px, transparent 4px 7px);
  transform: translateX(-50%);
}

.stop.origin .stop-marker,
.stop.destination .stop-marker {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.stop.invalid .stop-marker {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.stop-main {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.stop-ident {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stop.invalid .stop-ident,
.stop.invalid .stop-name {
  color: var(--danger);
}

.stop-kind {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stop:hover .stop-kind {
  background: var(--line);
}

.stop.airport .stop-kind {
  background: color-mix(in srgb, var(--airport) 13%, transparent);
  color: color-mix(in srgb, var(--airport) 75%, var(--ink));
}

.stop.navaid .stop-kind {
  background: color-mix(in srgb, var(--navaid) 14%, transparent);
  color: color-mix(in srgb, var(--navaid) 70%, var(--ink));
}

.stop.invalid .stop-kind {
  background: var(--danger-soft);
  color: var(--danger);
}

.stop-remove {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.stop-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.stop-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.stop-add {
  display: flex;
  gap: 10px;
  align-items: center;
  height: 42px;
  padding: 0 12px 0 31px;
  color: var(--muted);
  cursor: text;
}

.stops:not(:empty) + .stop-add {
  border-top: 1px solid var(--line);
}

.stop-add i {
  display: grid;
  place-items: center;
  width: 22px;
  font-size: 13px;
}

.stop-add input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stop-add input::placeholder {
  color: var(--muted);
  font-weight: 450;
  letter-spacing: 0;
  text-transform: none;
}

/* Disclosures and switches */

.disclosure {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.disclosure summary {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 11px 12px;
  border-radius: var(--radius);
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure summary:hover {
  background: var(--panel-2);
}

.disclosure-caret {
  color: var(--muted);
  font-size: 11px;
  transition: transform 140ms ease;
}

.disclosure[open] .disclosure-caret {
  transform: rotate(90deg);
}

.disclosure-title {
  flex: none;
  font-size: 13px;
  font-weight: 650;
}

.disclosure-summary {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disclosure-body {
  padding: 6px 12px 14px;
}

.disclosure-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.hint:empty {
  display: none;
}

.switch-hint {
  margin-bottom: 6px;
}

.switch-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.switch {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  appearance: none;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.3);
  transition: transform 140ms ease;
}

.switch:checked {
  background: var(--accent);
}

.switch:checked::after {
  transform: translateX(16px);
}

/* Footer: run state and actions */

.planner-foot {
  display: grid;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.run-state[data-state="idle"] {
  display: none;
}

.run-state-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
}

.run-state-label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.run-state-label::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.run-state[data-state="running"] .run-state-label::before {
  animation: pulse 1.1s ease-in-out infinite;
}

.run-state[data-state="done"] .run-state-label::before {
  background: var(--ok);
}

.run-state[data-state="error"] .run-state-label::before {
  background: var(--danger);
}

.run-state[data-state="cancelled"] .run-state-label::before {
  background: var(--muted);
}

.run-state-percent {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.run-progress {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.run-state:not([data-state="running"]) .run-progress {
  display: none;
}

#run-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 240ms ease;
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 650;
  transition: background-color 120ms ease, transform 80ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}

/* ---------- Map stage ---------- */

.stage {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  /* Keeps the map's layers below the planner panel and its resize handle. */
  isolation: isolate;
}

.map-wrap {
  position: relative;
  min-height: 0;
}

#route-map {
  position: absolute;
  inset: 0;
  background: var(--bg);
}

.leaflet-container {
  font: inherit;
}

.leaflet-container .leaflet-interactive:focus {
  outline: none;
}

[data-theme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.86) saturate(0.55);
}

.leaflet-control-attribution {
  background: var(--glass) !important;
  color: var(--muted) !important;
  font-size: 10px;
}

.leaflet-control-attribution a {
  color: var(--ink-2) !important;
}

.leaflet-bar {
  overflow: hidden;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-float) !important;
}

.leaflet-bar a {
  width: 38px !important;
  height: 36px !important;
  border-bottom-color: var(--line) !important;
  background: var(--panel) !important;
  color: var(--ink-2) !important;
  font-size: 18px !important;
  line-height: 36px !important;
}

.leaflet-bar a:hover {
  background: var(--panel-2) !important;
  color: var(--ink) !important;
}

.leaflet-right .leaflet-control {
  margin-right: 14px;
}

.leaflet-bottom .leaflet-control-zoom {
  margin-bottom: 14px;
}

.sidebar-toggle {
  position: absolute;
  top: 14px;
  left: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  width: 26px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel);
  box-shadow: var(--shadow-float);
  color: var(--ink-2);
  font-size: 13px;
}

.sidebar-toggle:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.map-tools {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 600;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-float);
}

.map-tool {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
}

.map-tool + .map-tool {
  border-top: 1px solid var(--line);
}

.map-tool:hover {
  background: var(--panel-2);
  color: var(--ink);
}

.map-tool[aria-pressed="true"] {
  color: var(--accent);
}

.map-tool[aria-pressed="false"] {
  color: var(--muted);
  opacity: 0.6;
}

.map-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  max-width: calc(100% - 90px);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--shadow-float);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 550;
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.legend-line {
  width: 18px;
  height: 0;
  border-top: 3px solid var(--route);
  border-radius: 2px;
}

.legend-line.optimal {
  border-top-color: var(--optimal);
}

.legend-line.direct {
  border-top: 2px dashed var(--direct);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border: 2px solid var(--airport);
  border-radius: 50%;
}

.legend-dot.navaid {
  width: 8px;
  height: 8px;
  border: 0;
  background: var(--navaid);
}

.working-overlay,
.map-alert {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 700;
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: min(460px, calc(100% - 130px));
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.working-overlay {
  min-width: 250px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
}

.working-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.working-text strong {
  font-size: 14px;
  font-weight: 650;
}

.working-text span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spinner {
  flex: none;
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.map-alert {
  align-items: flex-start;
  width: min(460px, calc(100% - 130px));
  padding: 12px 10px 12px 14px;
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  border-radius: var(--radius);
}

.map-alert > i {
  margin-top: 1px;
  color: var(--danger);
  font-size: 17px;
}

.map-alert-text {
  flex: 1;
  min-width: 0;
}

.map-alert-text strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
}

.map-alert-text p {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.map-alert .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

/* Map markers and labels */

.leaflet-tooltip.wp-label {
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.leaflet-tooltip.wp-label::before {
  display: none;
}

.leaflet-tooltip.wp-label.endpoint {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.leaflet-tooltip.wp-tip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow-float);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.leaflet-tooltip.wp-tip::before {
  display: none;
}

.stop-pin {
  display: grid;
  place-items: center;
  border: 2px solid var(--direct);
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.35);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: grab;
}

.stop-pin.endpoint {
  border-color: #fff;
  background: var(--accent);
  color: #fff;
}

.stop-pin.muted {
  opacity: 0.75;
}

.stop-pin:active {
  cursor: grabbing;
}

.map-cursor {
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 1px 5px rgba(16, 24, 40, 0.5);
}

.route-bend-hit,
.route-waypoint-hit {
  cursor: grab;
}

.route-waypoint-hit:active {
  cursor: grabbing;
}

.leaflet-popup-content-wrapper {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-float);
  color: var(--ink);
}

.leaflet-popup-tip {
  background: var(--panel);
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--muted);
}

.route-bend-popup .leaflet-popup-content {
  margin: 10px;
}

.route-bend-menu {
  display: grid;
  gap: 2px;
  min-width: 230px;
  max-width: 300px;
}

.route-bend-heading {
  padding: 2px 8px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.route-bend-message {
  min-width: 190px;
  padding: 4px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

.route-bend-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.route-bend-choice:hover {
  background: var(--accent-soft);
}

.route-bend-choice strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-bend-choice span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-bend-choice .distance {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.airport-target-marker {
  border: 0;
  background: transparent;
}

.airport-target-icon {
  position: relative;
  display: block;
  opacity: 0.9;
}

.airport-target-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid var(--airport);
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.airport-target-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--airport);
  transform: translate(-50%, -50%);
}

/* ---------- Aircraft manager ---------- */

.control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.btn-secondary,
.btn-primary-sm {
  display: inline-flex;
  flex: none;
  gap: 7px;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: color-mix(in srgb, var(--line-strong) 60%, var(--ink-2));
  color: var(--ink);
}

.btn-secondary.danger {
  color: var(--danger);
}

.btn-secondary.danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-primary-sm {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

.btn-primary-sm:hover {
  background: var(--accent-strong);
}

.btn-secondary:disabled,
.btn-primary-sm:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.account {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.user-chip {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.sign-in {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.sign-in:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.account-menu {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 2px;
  min-width: 210px;
  max-width: 280px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-float);
}

.account-menu[hidden],
.account-summary[hidden] {
  display: none;
}

.account-summary {
  display: grid;
  gap: 2px;
  padding: 6px 8px 8px;
  overflow-wrap: anywhere;
}

.account-summary strong {
  font-size: 13px;
}

.account-summary small {
  color: var(--muted);
  font-size: 12px;
}

.account-summary small:empty {
  display: none;
}

.account-providers {
  display: grid;
  gap: 2px;
}

.account-providers:empty {
  display: none;
}

.account-item {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-item:hover {
  background: var(--panel-2);
}

.user-chip.admin {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent);
}

.modal {
  width: min(1140px, calc(100vw - 32px));
  height: min(780px, calc(100dvh - 32px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(10, 15, 22, 0.35);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(10, 15, 22, 0.55);
  backdrop-filter: blur(2px);
}

.modal-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.modal-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.aircraft-manager {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 0;
}

.am-list {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
}

.am-list-items {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.am-list-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.am-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  padding: 8px 8px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.am-group .text-btn {
  letter-spacing: 0;
  text-transform: none;
}

.am-empty {
  padding: 2px 8px 6px;
  color: var(--muted);
  font-size: 12px;
}

.am-item {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.am-item:hover {
  background: var(--line);
}

.am-item.active {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.am-item-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.am-item-text strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.am-item-text small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.am-badge {
  flex: none;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.am-badge.user {
  background: var(--accent-soft);
  color: var(--accent);
}

.am-editor {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 18px 20px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.am-editor-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}

.am-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  min-width: 0;
}

.am-title h3 {
  margin: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.am-dirty {
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
}

.am-saved {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
}

.am-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.am-actions .btn-secondary,
.am-actions .btn-primary-sm,
.am-profile-actions .btn-secondary {
  height: 34px;
}

.am-banner {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 13px;
}

.am-banner.error {
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 550;
}

.am-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  align-items: start;
}

.am-switch {
  border-top: 0;
  min-height: 0;
}

.am-switch small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.am-section {
  margin: 4px 0 -4px;
  font-size: 13px;
  font-weight: 650;
}

.am-profiles {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.am-profile-list {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius) 0 0 var(--radius);
}

.am-profile {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 14px;
}

.am-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.am-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.am-table th {
  padding: 7px 10px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.am-table th small {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.am-table td {
  padding: 0;
  border-top: 1px solid var(--line);
}

.am-table td + td {
  border-left: 1px solid var(--line);
}

.am-table input {
  width: 100%;
  min-width: 70px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 550;
  appearance: textfield;
  -moz-appearance: textfield;
}

.am-table input::-webkit-outer-spin-button,
.am-table input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.am-table input:focus {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.am-table input:disabled {
  color: var(--ink-2);
}

.am-table input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.am-row-action {
  width: 36px;
  text-align: center;
}

.am-row-action .icon-btn {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.am-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.am-message {
  padding: 40px 16px;
  color: var(--muted);
  text-align: center;
}

.am-message.error {
  color: var(--danger);
}

@media (max-width: 860px) {
  .modal {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .aircraft-manager {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .am-list {
    max-height: 34vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .am-profiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .am-profile-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
  }
}

/* ---------- Results drawer ---------- */

.results {
  position: relative;
  z-index: 1;
  min-width: 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 -6px 24px rgba(16, 24, 40, 0.07);
}

.results-head {
  display: flex;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 10px 18px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 30px;
  min-width: 0;
  margin: 0;
}

.stat {
  display: grid;
  gap: 1px;
}

.stat dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat dd {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.stat dd small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
}

.stat-minor dd {
  color: var(--ink-2);
  font-weight: 550;
}

.results-controls {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: center;
}

.layer-toggles {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-right: 4px;
}

.layer-toggles[hidden] {
  display: none;
}

.layer-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.layer-toggle input {
  margin: 0;
  accent-color: var(--accent);
}

.layer-swatch {
  width: 14px;
  height: 10px;
  border-radius: 2px;
}

.layer-swatch-cloud {
  border: 1px solid var(--cloud);
  background: var(--cloud-fill);
}

.layer-swatch-icing {
  border: 1px solid var(--icing);
  background: var(--icing-fill);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}

.tab {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected="true"] {
  background: var(--panel-3);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.14), 0 0 0 1px var(--line);
}

.results-body {
  height: 250px;
  border-top: 1px solid var(--line);
}

.results.collapsed .results-body {
  display: none;
}

.profile-pane {
  position: relative;
  height: 100%;
  padding: 10px 16px 8px 10px;
}

.profile-pane canvas {
  width: 100%;
  height: 100%;
}

.profile-tooltip {
  position: absolute;
  top: 12px;
  z-index: 5;
  display: grid;
  gap: 3px;
  min-width: 168px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  box-shadow: var(--shadow-float);
  font-size: 12px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.profile-tooltip-title {
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 600;
}

.profile-tooltip-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  color: var(--ink-2);
}

.profile-tooltip-row i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.profile-tooltip-row b {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.navlog-pane {
  height: 100%;
}

.route-list {
  height: 100%;
  overflow: auto;
  scrollbar-width: thin;
}

.navlog-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.navlog-table th,
.navlog-table td {
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.navlog-table th:first-child,
.navlog-table td:first-child {
  padding-left: 18px;
  text-align: left;
}

.navlog-table th:last-child,
.navlog-table td:last-child {
  padding-right: 18px;
  text-align: left;
}

.navlog-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.navlog-table th small {
  margin-left: 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.navlog-table tbody tr {
  cursor: pointer;
}

.navlog-table tbody tr:hover {
  background: var(--accent-soft);
}

.navlog-fix {
  display: flex;
  gap: 10px;
  align-items: center;
}

.navlog-fix::before {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border: 2px solid var(--route);
  border-radius: 50%;
  background: var(--panel);
}

.navlog-table tr.is-endpoint .navlog-fix::before {
  background: var(--route);
}

.navlog-table tr.is-event .navlog-fix::before {
  width: 5px;
  height: 5px;
  margin: 0 2px;
  border: 0;
  background: var(--muted);
}

.navlog-table .fix {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: 0.02em;
}

.navlog-table tr.is-event .fix {
  color: var(--ink-2);
  font-weight: 550;
}

.navlog-table .subfix {
  color: var(--muted);
  font-size: 11.5px;
}

.navlog-table td.is-zero {
  color: var(--muted);
}

.navlog-remove {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  opacity: 0.55;
}

.navlog-table tr:hover .navlog-remove,
.navlog-remove:focus-visible {
  opacity: 1;
}

.navlog-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.navlog-table tr.is-airway td {
  background: var(--panel-2);
  color: var(--ink-2);
}

.navlog-table tr.is-airway:not(.is-static):hover td {
  background: var(--accent-soft);
}

.navlog-table tr.is-airway.is-static {
  cursor: default;
}

.airway-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
}

.airway-toggle i {
  flex: none;
  width: 9px;
  color: var(--muted);
  font-size: 10px;
}

.airway-name {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.03em;
}

.navlog-table tr.in-airway td:first-child {
  padding-left: 37px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Narrow screens ---------- */

@media (min-width: 861px) {
  .app.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .app.sidebar-collapsed .sidebar {
    display: none;
  }
}

@media (max-width: 1180px) {
  .app {
    --sidebar-width: 340px;
  }

  .stats {
    gap: 6px 22px;
  }

  .stat-minor {
    display: none;
  }
}

@media (max-width: 860px) {
  html,
  body {
    height: auto;
  }

  .app {
    display: block;
    height: auto;
  }

  .sidebar {
    box-shadow: none;
  }

  .sidebar-resizer,
  .sidebar-toggle {
    display: none;
  }

  .planner-body {
    overflow: visible;
  }

  .planner-foot {
    position: sticky;
    bottom: 0;
    z-index: 3;
  }

  .stage {
    display: block;
    border-top: 1px solid var(--line);
  }

  .map-wrap {
    height: 68vh;
    min-height: 360px;
  }

  .results-head {
    flex-wrap: wrap;
  }

  .stats {
    gap: 8px 20px;
  }

  .stat dd {
    font-size: 15px;
  }

  .working-overlay,
  .map-alert {
    max-width: calc(100% - 28px);
  }

  .map-alert {
    top: 64px;
    width: calc(100% - 28px);
  }

  .map-legend {
    max-width: calc(100% - 28px);
    border-radius: var(--radius);
  }

  .leaflet-bottom .leaflet-control-zoom {
    margin-bottom: 58px;
  }
}
