:root {
  color-scheme: dark;
  --bg: #05090f;
  --panel: rgba(8, 14, 24, 0.9);
  --line: rgba(126, 171, 228, 0.25);
  --line-strong: rgba(126, 171, 228, 0.46);
  --text: #d7e7ff;
  --muted: #9fb7d9;
  --accent: #44d1ff;
  --ok: #5ef1a6;
  --warn: #ffd35a;
  --danger: #ff5d87;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.44);
  --drawer-bottom-clearance: 118px;
}

* {
  box-sizing: border-box;
}

html,
body {
  overscroll-behavior-y: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", "Sora", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 15% -18%, rgba(70, 206, 255, 0.18), transparent 52%),
    radial-gradient(1000px 560px at 90% -16%, rgba(78, 140, 255, 0.18), transparent 52%),
    linear-gradient(165deg, #060b14 0%, #070e19 48%, #04080f 100%);
}

body {
  overflow: hidden;
}

.app-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.topbar,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  position: relative;
  overflow: visible;
  isolation: auto;
  background: var(--panel);
}

.topbar::before,
.topbar::after {
  content: "";
  display: none;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.brand-logo {
  width: auto;
  height: 40px;
  display: block;
  flex: 0 0 auto;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-size: 1.08rem;
  letter-spacing: 0.03em;
}

.brand-text p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-btn {
  min-width: 74px;
  font-weight: 600;
}

.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 9px;
  background: rgba(5, 12, 21, 0.82);
}

.connection .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7a8598;
  box-shadow: 0 0 0 6px rgba(122, 133, 152, 0.18);
}

.connection.ok .dot {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(94, 241, 166, 0.16);
}

.connection.warn .dot {
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(255, 211, 90, 0.2);
}

.connection.err .dot {
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(255, 93, 135, 0.16);
}

.connection strong {
  display: block;
  font-size: 0.8rem;
}

.connection small {
  color: var(--muted);
  font-size: 0.72rem;
}

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

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#selectedDetails {
  flex: 1 1 auto;
  min-height: 0;
}

.map-panel {
  position: absolute;
  inset: 0;
  border-color: rgba(126, 171, 228, 0.34);
  isolation: isolate;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loading-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(130, 178, 238, 0.46);
  border-radius: 11px;
  background: rgba(5, 12, 23, 0.86);
  backdrop-filter: blur(6px);
  color: #dbeeff;
  padding: 10px 14px;
  font-size: 0.84rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(112, 210, 255, 0.22);
  border-top-color: rgba(112, 210, 255, 0.95);
  animation: loading-spin 0.85s linear infinite;
}

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

.leaflet-container {
  background: #08111d;
}

.drawer {
  position: absolute;
  top: 10px;
  bottom: var(--drawer-bottom-clearance);
  width: 340px;
  max-width: calc(100vw - 24px);
  z-index: 800;
  backdrop-filter: blur(5px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.drawer-close {
  display: none;
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 9;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(130, 178, 238, 0.68);
  border-radius: 999px;
  background: rgba(5, 12, 23, 0.96);
  color: #d7e7ff;
  font: inherit;
  font-size: 1.02rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawer-close:hover {
  border-color: rgba(170, 212, 255, 0.95);
}

.drawer-title,
.panel-head {
  position: relative;
}

.left-drawer {
  left: 10px;
}

.right-drawer {
  right: 10px;
  width: 440px;
  max-width: min(440px, calc(100vw - 24px));
}

.left-drawer.collapsed {
  transform: translateX(calc(-100% - 16px));
  opacity: 0.05;
  pointer-events: none;
}

.right-drawer.collapsed {
  transform: translateX(calc(100% + 16px));
  opacity: 0.05;
  pointer-events: none;
}

.drawer-title {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(44, 87, 142, 0.15);
}

.controls {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.control {
  display: grid;
  gap: 4px;
}

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

.control > span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.control input,
.control select {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(6, 13, 23, 0.9);
  color: var(--text);
  padding: 0 9px;
  font: inherit;
}

.toggle {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  background: rgba(6, 13, 23, 0.72);
}

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

.button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  grid-column: 1 / -1;
}

.btn {
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(7, 16, 29, 0.92);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.16s ease;
}

.btn:hover {
  border-color: var(--line-strong);
}

.btn.active {
  background: linear-gradient(135deg, rgba(68, 209, 255, 0.35), rgba(80, 125, 255, 0.26));
  border-color: rgba(112, 210, 255, 0.86);
}

.btn.warn.active {
  background: linear-gradient(135deg, rgba(255, 171, 109, 0.36), rgba(255, 92, 142, 0.24));
  border-color: rgba(255, 171, 109, 0.84);
}

.btn.ghost {
  border-style: dashed;
  color: var(--muted);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(44, 87, 142, 0.14);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 0.7rem;
  background: rgba(8, 17, 30, 0.85);
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1.24fr 0.9fr 0.78fr 0.78fr 0.72fr 0.72fr;
  gap: 7px;
  align-items: center;
}

.table-head {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.table-body {
  min-height: 0;
  overflow: auto;
  font-size: 0.79rem;
}

.table-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

.table-row {
  width: 100%;
  border: 0;
  text-align: left;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(126, 171, 228, 0.1);
  cursor: pointer;
}

.table-row:hover {
  background: rgba(84, 130, 196, 0.14);
}

.table-row.selected {
  background: linear-gradient(90deg, rgba(67, 208, 255, 0.26), rgba(67, 208, 255, 0.06));
  box-shadow: inset 2px 0 0 var(--accent);
}

.table-row.stale {
  opacity: 0.72;
}

.map-hud {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 58px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 7px;
  pointer-events: none;
}

.hud-card {
  border: 1px solid rgba(130, 178, 238, 0.4);
  border-radius: 10px;
  background: rgba(5, 12, 23, 0.74);
  backdrop-filter: blur(4px);
  padding: 7px 9px;
}

.hud-card span {
  display: block;
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hud-card strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.footer-strip {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 24px;
  z-index: 7;
  border: 1px solid rgba(130, 178, 238, 0.36);
  border-radius: 9px;
  background: rgba(5, 12, 23, 0.74);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  backdrop-filter: blur(4px);
}

.selected-summary {
  margin: 10px;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(6, 13, 23, 0.84);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
  overflow: hidden;
}

.selected-summary.empty {
  color: var(--muted);
}

.selected-summary strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0;
}

.callsign-heading {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.callsign-flag {
  width: 21px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  margin-left: 6px;
  border: 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
}

.callsign-text {
  line-height: 1.1;
}

.selected-summary small {
  color: var(--muted);
}

.selected-details-stack {
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 0 10px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-content: start;
}

.flight-hero-card {
  border: 1px solid rgba(126, 171, 228, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(11, 20, 35, 0.94), rgba(6, 12, 21, 0.88));
  padding: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  min-width: 0;
}

.flight-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.flight-hero-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.flight-hero-airline {
  font-size: 0.92rem;
  font-weight: 700;
  color: #eef6ff;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.flight-hero-route-label {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.flight-status-tag {
  flex: 0 0 auto;
  max-width: 55%;
  border-radius: 999px;
  border: 1px solid rgba(94, 241, 166, 0.34);
  background: rgba(14, 34, 26, 0.84);
  color: #dbffef;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.1;
  padding: 5px 9px;
  text-align: center;
  overflow-wrap: anywhere;
}

.flight-route-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.route-endpoint {
  min-width: 0;
  border: 1px solid rgba(126, 171, 228, 0.14);
  border-radius: 10px;
  background: rgba(7, 14, 24, 0.58);
  padding: 10px 8px;
  text-align: center;
}

.route-endpoint-code {
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-size: 1.36rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  color: #f3f9ff;
}

.route-endpoint-name {
  margin-top: 5px;
  color: #dbeaff;
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.route-endpoint-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.route-stage-center {
  align-self: center;
  justify-self: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(240, 197, 79, 0.28);
  background: rgba(35, 27, 8, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.route-stage-arrow {
  color: #f0c54f;
  font-size: 1rem;
  line-height: 1;
}

.flight-times-panel-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.time-panel {
  min-width: 0;
  border: 1px solid rgba(126, 171, 228, 0.14);
  border-radius: 10px;
  background: rgba(7, 14, 24, 0.56);
  padding: 8px 9px;
}

.time-panel h3 {
  margin: 0 0 7px;
  color: #dcecff;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
  min-width: 0;
}

.time-row span {
  color: var(--muted);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.time-row strong {
  color: #eef7ff;
  font-size: 0.79rem;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.time-empty {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.flight-progress-strip {
  margin-top: 10px;
  border-top: 1px solid rgba(126, 171, 228, 0.14);
  padding-top: 8px;
}

.flight-progress-line {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(8, 16, 28, 0.85);
  border: 1px solid rgba(126, 171, 228, 0.16);
  overflow: visible;
}

.flight-progress-line-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f5d15e 0%, #e4bc44 100%);
  box-shadow: 0 0 8px rgba(240, 197, 79, 0.35);
}

.flight-progress-line-plane {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #f0c54f;
  font-size: 0.92rem;
  line-height: 1;
  text-shadow: 0 0 10px rgba(240, 197, 79, 0.46);
  pointer-events: none;
}

.flight-progress-line-texts {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.flight-progress-left,
.flight-progress-right {
  min-width: 0;
  color: #d7e6fb;
  font-size: 0.83rem;
  line-height: 1.2;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.flight-progress-right {
  text-align: right;
}

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

.flight-chip {
  min-width: 0;
  border: 1px solid rgba(126, 171, 228, 0.12);
  border-radius: 10px;
  background: rgba(6, 13, 23, 0.42);
  padding: 7px 8px;
}

.flight-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.flight-chip strong {
  display: block;
  margin-top: 3px;
  color: #eff7ff;
  font-size: 0.88rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

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

.flight-info-card {
  min-width: 0;
  border: 1px solid rgba(126, 171, 228, 0.14);
  border-radius: 12px;
  background: rgba(6, 13, 23, 0.68);
  padding: 10px;
}

.flight-info-card h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.flight-kv-row {
  display: grid;
  grid-template-columns: minmax(104px, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 4px 0;
  border-bottom: 1px solid rgba(126, 171, 228, 0.08);
}

.flight-kv-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.flight-kv-key {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.flight-kv-val {
  color: #eef7ff;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: normal;
}

.flight-tech-card {
  margin: 0;
}

.flight-tech-card .flight-kv-list {
  margin-top: 8px;
}

.flight-card {
  margin: 0 10px 10px;
  padding: 12px;
  border: 1px solid rgba(130, 178, 238, 0.26);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(7, 14, 24, 0.96), rgba(5, 10, 18, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  min-width: 0;
  overflow-x: hidden;
}

.flight-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.flight-card-meta {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.flight-card-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  min-width: 0;
  flex-wrap: wrap;
}

.flight-card-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.flight-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(130, 178, 238, 0.38);
  background: rgba(8, 16, 28, 0.8);
  color: #dcecff;
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.flight-status-pill.has-status {
  border-color: rgba(94, 241, 166, 0.35);
  background: rgba(14, 34, 26, 0.82);
}

.flight-route-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.flight-route-airport {
  min-width: 0;
  text-align: center;
  border: 1px solid rgba(126, 171, 228, 0.16);
  border-radius: 10px;
  background: rgba(6, 13, 23, 0.58);
  padding: 10px 8px;
  overflow: hidden;
}

.flight-route-code {
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.28rem;
  letter-spacing: 0.04em;
  color: #eef6ff;
  line-height: 1;
  overflow-wrap: anywhere;
}

.flight-route-name {
  margin-top: 4px;
  font-size: 0.81rem;
  line-height: 1.2;
  color: #d8eaff;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.flight-route-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.flight-route-arrow {
  color: #f0c54f;
  font-size: 1.08rem;
  opacity: 0.92;
}

.flight-times-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.flight-time-box {
  border: 1px solid rgba(126, 171, 228, 0.16);
  border-radius: 10px;
  background: rgba(6, 13, 23, 0.56);
  padding: 9px;
}

.flight-time-title {
  margin-bottom: 6px;
  color: #dcecff;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flight-time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  font-size: 0.78rem;
  padding: 3px 0;
  min-width: 0;
}

.flight-time-row span {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.flight-time-row strong {
  color: #eff7ff;
  text-align: right;
  font-weight: 600;
  font-size: 0.8rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.flight-calc-grid {
  border: 1px solid rgba(126, 171, 228, 0.16);
  border-radius: 10px;
  background: rgba(6, 13, 23, 0.56);
  padding: 9px;
}

.flight-calc-title {
  margin-bottom: 6px;
  color: #dcecff;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flight-calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  font-size: 0.78rem;
  padding: 3px 0;
  min-width: 0;
}

.flight-calc-row span {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.flight-calc-row strong {
  color: #eff7ff;
  text-align: right;
  font-weight: 600;
  font-size: 0.8rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-block {
  margin-top: 0;
}

.details-card {
  padding: 0;
  margin-top: 6px;
}

.detail-block-tech summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
}

.aircraft-photo-wrap {
  margin-top: 2px;
}

.aircraft-photo-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(4, 10, 18, 0.92);
}

.aircraft-photo-placeholder {
  border: 1px dashed var(--line);
  border-radius: 8px;
  min-height: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  text-align: center;
  color: var(--muted);
  background: rgba(4, 10, 18, 0.84);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.aircraft-photo {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  object-position: center;
}

.aircraft-photo-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.66rem;
  color: var(--muted);
}

.action-row {
  padding: 0 10px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-row .btn {
  height: 30px;
  font-size: 0.74rem;
}

.details {
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 0 10px 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  font-size: 0.82rem;
  min-width: 0;
}

.details > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.details .key {
  color: var(--muted);
}

.subsection {
  margin: 0 10px 10px;
  padding: 10px;
  border: 1px solid rgba(126, 171, 228, 0.14);
  border-radius: 10px;
  background: rgba(6, 13, 23, 0.68);
}

.subsection h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.trace-stats {
  font-size: 0.77rem;
}

.table-row .mono,
.details .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.airport-div-icon {
  background: transparent;
  border: 0;
}

.airport-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(150, 208, 255, 0.75);
  background: rgba(8, 20, 35, 0.88);
  color: #93d8ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  line-height: 1;
  box-shadow: 0 0 7px rgba(0, 0, 0, 0.55);
  user-select: none;
}

.airport-pin.large_airport {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 212, 121, 0.9);
  background: rgba(30, 21, 8, 0.9);
  color: #ffd37a;
  font-size: 10px;
}

.airport-pin.medium_airport {
  width: 16px;
  height: 16px;
  font-size: 9px;
}

.airport-pin.small_airport,
.airport-pin.seaplane_base {
  width: 13px;
  height: 13px;
  font-size: 8px;
  opacity: 0.95;
}

.airport-pin.heliport,
.airport-pin.balloonport {
  width: 11px;
  height: 11px;
  font-size: 7px;
  opacity: 0.85;
}

.airport-tooltip {
  background: rgba(6, 14, 25, 0.9);
  border: 1px solid rgba(130, 178, 238, 0.42);
  color: #ddecff;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  padding: 3px 6px;
}

.airport-tooltip::before {
  border-top-color: rgba(130, 178, 238, 0.42);
}

.aircraft-marker {
  position: relative;
  width: 26px;
  height: 26px;
}

.aircraft-icon {
  width: 26px;
  height: 26px;
  transform-origin: center;
}

.aircraft-svg {
  display: block;
  filter: drop-shadow(0 0 8px rgba(68, 209, 255, 0.38));
}

.aircraft-marker.selected .aircraft-svg {
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)) drop-shadow(0 0 12px rgba(126, 237, 255, 0.96));
}

.aircraft-label {
  position: absolute;
  left: 15px;
  top: -9px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(126, 171, 228, 0.38);
  background: rgba(4, 11, 20, 0.84);
  color: #edf6ff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.aircraft-label .label-flag {
  width: 13px;
  height: 10px;
  object-fit: cover;
  border-radius: 1px;
  margin-left: 3px;
  border: 0;
  flex: 0 0 auto;
}

.aircraft-label .label-text {
  line-height: 1;
}

.range-label-wrapper {
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  background: transparent;
  border: 0;
}

.range-label {
  display: inline-flex;
  align-items: center;
  transform: translate(10px, -50%);
  white-space: nowrap;
  background: rgba(5, 12, 23, 0.86);
  border: 1px solid rgba(130, 178, 238, 0.44);
  border-radius: 999px;
  color: #def0ff;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

@media (max-width: 1580px) {
  :root {
    --drawer-bottom-clearance: 176px;
  }

  .map-hud {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .right-drawer {
    width: 320px;
  }

  .left-drawer {
    width: 300px;
  }
}

@media (max-width: 1260px) {
  :root {
    --drawer-bottom-clearance: 206px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .connection {
    flex: 1;
    min-width: 250px;
  }

  .left-drawer,
  .right-drawer {
    width: min(92vw, 360px);
  }

  .footer-strip {
    flex-direction: column;
  }
}

.mobile-stats-btn {
  display: none;
}

@media (max-width: 920px) {

  html,
  body {
    height: 100dvh;
    min-height: 100dvh;
    overflow: clip;
    overscroll-behavior: none;
  }

  .app-shell {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .map-layout {
    height: 100%;
    overflow: hidden;
  }

  .mobile-stats-btn.active {
    color: #031426;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(106, 229, 255, 0.98), rgba(66, 146, 255, 0.96));
    border-color: rgba(212, 244, 255, 0.96);
    box-shadow: 0 0 0 1px rgba(210, 242, 255, 0.38), 0 10px 22px rgba(5, 19, 48, 0.58);
  }

  body.selection-active .mobile-stats-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.selection-active .map-hud {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
  }
  :root {
    --drawer-bottom-clearance: 74px;
  }

  .app-shell {
    gap: 8px;
    padding: 8px;
  }

  .topbar {
    min-height: 0;
    padding: 8px 9px;
    gap: 8px;
  }

  .brand {
    gap: 5px;
    padding-right: 94px;
  }

  .brand-logo {
    height: 30px;
  }

  .brand-text h1 {
    font-size: 0.94rem;
  }

  .brand-text p {
    margin-top: 1px;
    font-size: 0.66rem;
  }

  .top-actions {
    width: 100%;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .top-actions .btn {
    height: 29px;
    padding: 0 9px;
    font-size: 0.74rem;
  }

  .lang-btn {
    min-width: 66px;
  }

  .connection {
    position: absolute;
    top: 8px;
    right: 9px;
    min-width: 0;
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 8px;
    gap: 6px;
  }

  .connection .dot {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 4px rgba(122, 133, 152, 0.18);
  }

  .connection.ok .dot {
    box-shadow: 0 0 0 4px rgba(94, 241, 166, 0.16);
  }

  .connection.warn .dot {
    box-shadow: 0 0 0 4px rgba(255, 211, 90, 0.2);
  }

  .connection.err .dot {
    box-shadow: 0 0 0 4px rgba(255, 93, 135, 0.16);
  }

  .connection strong {
    font-size: 0.7rem;
    line-height: 1;
  }

  .connection small {
    display: none;
  }

  .left-drawer,
  .right-drawer {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: var(--drawer-bottom-clearance);
  }

  .details {
    grid-template-columns: 1fr;
  }

  .table-head,
  .table-row {
    grid-template-columns: 1.1fr 0.78fr 0.62fr 0.62fr 0.6fr 0.6fr;
    gap: 5px;
  }

  .table-head {
    font-size: 0.6rem;
  }

  .table-body {
    font-size: 0.73rem;
  }

  .mobile-stats-btn {
    display: inline-flex;
    position: absolute;
    right: 8px;
    bottom: 56px;
    z-index: 9;
    height: 28px;
    min-width: 66px;
    font-size: 0.72rem;
    padding: 0 9px;
    pointer-events: auto;
    background: rgba(5, 12, 23, 0.97);
    border-color: rgba(130, 178, 238, 0.82);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  }

  .map-hud {
    left: 8px;
    right: 8px;
    bottom: 44px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  }

  body.mobile-hud-open .map-hud {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .hud-card {
    padding: 6px 7px;
    border-radius: 9px;
  }

  .hud-card span {
    font-size: 0.56rem;
  }

  .hud-card strong {
    margin-top: 1px;
    font-size: 0.84rem;
  }

  body.mobile-hud-open .mobile-stats-btn {
    bottom: 146px;
  }

  .footer-strip {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 4px 7px;
    font-size: 0.64rem;
    gap: 6px;
    flex-direction: row;
    align-items: center;
  }

  .footer-strip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (pointer: coarse), (max-width: 1080px) {
  .drawer-close {
    display: inline-flex;
  }

  #leftDrawer .drawer-title {
    padding-right: 44px;
    min-height: 42px;
    display: flex;
    align-items: center;
  }

  #rightDrawer .panel-head {
    padding-right: 44px;
    min-height: 42px;
  }
}

body.selection-active .map-hud {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(10px);
}

body.selection-active .mobile-stats-btn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 920px) {
  .selected-details-stack {
    gap: 8px;
    padding: 0 8px 8px;
  }

  .flight-hero-card,
  .flight-info-card {
    padding: 9px;
    border-radius: 10px;
  }

  .flight-hero-top {
    gap: 8px;
    margin-bottom: 8px;
  }

  .flight-hero-airline {
    font-size: 0.84rem;
  }

  .flight-hero-route-label {
    font-size: 0.68rem;
  }

  .flight-status-tag {
    max-width: 52%;
    font-size: 0.68rem;
    padding: 4px 7px;
  }

  .flight-route-stage {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .route-stage-center {
    width: 28px;
    height: 28px;
  }

  .route-stage-arrow {
    transform: rotate(90deg);
    font-size: 0.9rem;
  }

  .route-endpoint-code {
    font-size: 1.12rem;
  }

  .route-endpoint-name {
    font-size: 0.75rem;
  }

  .route-endpoint-sub {
    font-size: 0.64rem;
  }

  .flight-times-panel-grid,
  .flight-chip-grid,
  .flight-info-grid,
  .flight-progress-line-texts {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .flight-progress-right {
    text-align: left;
  }

  .flight-kv-row {
    grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.1fr);
    gap: 7px;
  }

  .time-panel h3,
  .flight-info-card h3 {
    font-size: 0.7rem;
  }

  .flight-chip strong {
    font-size: 0.82rem;
  }

  .flight-kv-key {
    font-size: 0.73rem;
  }

  .flight-kv-val {
    font-size: 0.77rem;
  }

  .flight-route-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .flight-route-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .flight-times-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .flight-route-code {
    font-size: 1.14rem;
  }

  .flight-route-name {
    font-size: 0.76rem;
  }

  .flight-card-line {
    font-size: 0.78rem;
  }

  .aircraft-photo-wrap {
    margin-top: 0;
  }

  .aircraft-photo-link {
    border-radius: 6px;
  }

  .aircraft-photo {
    max-height: 82px;
  }
  .aircraft-photo-placeholder {
    min-height: 76px;
    font-size: 0.68rem;
    padding: 10px 8px;
  }

  .aircraft-photo-meta {
    margin-top: 3px;
    font-size: 0.6rem;
  }
}

@media (max-width: 560px) {
  .aircraft-photo {
    max-height: 68px;
  }

  .aircraft-photo-placeholder {
    min-height: 64px;
    font-size: 0.64rem;
  }
}

@media (max-width: 920px) {
  #centerSelectedBtn {
    display: none;
  }
}

@media (max-width: 920px) {
  #leftDrawer .panel-head,
  #leftDrawer .table-head,
  #leftDrawer #aircraftTable {
    display: none;
  }
}

.avinor-card {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 10, 18, 0.52);
}

.avinor-card h3 {
  margin: 0 0 6px;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.avinor-muted {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.avinor-list {
  display: grid;
  gap: 7px;
}

.avinor-row {
  display: grid;
  grid-template-columns: 42px 20px 1fr;
  align-items: start;
  gap: 7px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avinor-row:first-child {
  border-top: 0;
}

.avinor-time,
.avinor-direction {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
}

.avinor-flight {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.avinor-flight strong {
  font-size: 0.78rem;
}

.avinor-flight small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

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

.avinor-tab {
  min-width: 0;
}

.avinor-tab h3 {
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-align: center;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.avinor-tabs .avinor-row {
  grid-template-columns: 42px 1fr;
}

@media (max-width: 720px) {
  .avinor-tabs {
    grid-template-columns: 1fr;
  }
}

.avinor-card {
  display: grid;
  gap: 10px;
}

.avinor-dropdown {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.avinor-dropdown summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.06);
}

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

.avinor-dropdown summary::before {
  content: "▸";
  color: var(--accent);
  transition: transform 0.16s ease;
}

.avinor-dropdown[open] summary::before {
  transform: rotate(90deg);
}

.avinor-dropdown summary span {
  margin-left: auto;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  text-align: center;
  font-size: 0.7rem;
}

.avinor-dropdown .avinor-list {
  padding: 8px 12px 10px;
}

.avinor-dropdown .avinor-row {
  grid-template-columns: 46px 1fr;
  gap: 10px;
}

.avinor-columns {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: start;
}

.avinor-columns .avinor-dropdown {
  min-width: 0;
}

.avinor-columns .avinor-list {
  max-height: 360px;
  overflow-y: auto;
}

.avinor-columns .avinor-row {
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
}

.avinor-columns .avinor-flight small {
  display: block;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .avinor-columns {
    grid-template-columns: 1fr;
  }
}

.details:has(.airport-details-grid) {
  display: block;
}

.airport-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px 10px;
  margin-bottom: 12px;
}

.airport-details-grid > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .airport-details-grid {
    grid-template-columns: 1fr;
  }
}

.avinor-card {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.avinor-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 100%;
}

.avinor-dropdown {
  max-width: 100%;
}

.avinor-dropdown summary {
  padding: 8px 9px;
  gap: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.045em;
}

.avinor-dropdown summary span {
  min-width: 20px;
  padding: 1px 6px;
  font-size: 0.64rem;
}

.avinor-dropdown .avinor-list {
  padding: 6px 8px 8px;
  max-height: 260px;
}

.avinor-columns .avinor-row,
.avinor-dropdown .avinor-row,
.avinor-tabs .avinor-row {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px;
  padding: 6px 0;
}

.avinor-time {
  font-size: 0.7rem;
}

.avinor-flight strong {
  font-size: 0.7rem;
}

.avinor-flight small {
  font-size: 0.64rem;
}

@media (max-width: 1180px) {
  .avinor-columns {
    grid-template-columns: 1fr;
  }
}

.avinor-airport-code {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.66rem;
}

.avinor-flight-details {
  display: grid;
  gap: 1px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.25;
}

.avinor-flight-details span {
  display: block;
  overflow-wrap: anywhere;
}
