:root {
  color-scheme: light;

  --bg: #f5f5f7;
  --bg-soft: #fbfbfd;
  --card: rgba(255, 255, 255, 0.78);
  --card-strong: rgba(255, 255, 255, 0.92);
  --card-solid: #ffffff;

  --text: #111111;
  --text-soft: #252528;
  --muted: #6e6e73;
  --muted-2: #52525b;

  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.12);

  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --accent-soft: rgba(37, 99, 235, 0.12);

  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);

  --orange: #f97316;
  --orange-soft: rgba(249, 115, 22, 0.12);

  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.12);

  --radius-sm: 18px;
  --radius: 26px;
  --radius-lg: 36px;
  --radius-xl: 48px;

  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.10);
  --shadow-strong: 0 36px 110px rgba(0, 0, 0, 0.18);

  --blur: blur(22px) saturate(1.2);
  --transition: 220ms cubic-bezier(.22, 1, .36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.16), transparent 32%),
    radial-gradient(circle at 88% 14%, rgba(14, 165, 233, 0.13), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(148, 163, 184, 0.22), transparent 38%),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 44%, #eeeeef 100%);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

body::selection {
  background: var(--accent);
  color: #ffffff;
}

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

button {
  cursor: pointer;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

/* =========================================================
   PAGE LAYOUT
========================================================= */

.page {
  width: min(1460px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
}

.hero-panel,
.map-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62));
  box-shadow:
    var(--shadow-card),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.hero-panel {
  min-height: calc(100vh - 56px);
  padding: clamp(22px, 3vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 18%, rgba(37, 99, 235, 0.18), transparent 34%),
    radial-gradient(circle at 88% 74%, rgba(14, 165, 233, 0.12), transparent 30%);
}

.map-shell {
  min-height: calc(100vh - 56px);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.46)),
    #e9eef5;
}

/* =========================================================
   TOP BRAND
========================================================= */

.brand-pill {
  width: max-content;
  max-width: 100%;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 15px 8px 8px;
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.brand-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.95), transparent 24%),
    linear-gradient(135deg, #2563eb, #0f172a);
  color: #ffffff;
  font-size: 18px;
  box-shadow:
    0 12px 26px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-pill span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-pill strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 860;
  letter-spacing: -0.03em;
}

/* =========================================================
   HERO COPY
========================================================= */

.hero-copy {
  margin-top: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 470px;
  color: var(--text);
  font-size: clamp(46px, 5vw, 78px);
  line-height: 0.9;
  font-weight: 920;
  letter-spacing: -0.08em;
}

.hero-subtitle {
  max-width: 440px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.42;
  font-weight: 560;
}

/* =========================================================
   BUTTON
========================================================= */

#refreshButton {
  width: max-content;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  padding: 0 20px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition),
    opacity var(--transition);
}

#refreshButton:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#refreshButton:active {
  transform: translateY(0) scale(0.985);
}

#refreshButton:disabled {
  opacity: 0.56;
  cursor: wait;
}

.button-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px var(--green-soft);
}

/* =========================================================
   STATUS CARD
========================================================= */

.status-card {
  margin-top: auto;
  display: grid;
  gap: 16px;
}

.status-loading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.64));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.loading-orb,
.status-card::before {
  content: "";
  width: 72px;
  height: 72px;
  display: block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 26%, rgba(255, 255, 255, 0.92), transparent 26%),
    linear-gradient(135deg, #2563eb, #0f172a);
  box-shadow:
    0 18px 46px rgba(37, 99, 235, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.status-loading .loading-orb {
  animation: pulse 1.8s ease-in-out infinite;
}

.status-card:has(.status-loading)::before {
  display: none;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 18px 46px rgba(37, 99, 235, 0.25),
      0 0 0 0 rgba(37, 99, 235, 0.20),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }

  50% {
    transform: scale(1.035);
    box-shadow:
      0 20px 52px rgba(37, 99, 235, 0.30),
      0 0 0 12px rgba(37, 99, 235, 0),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
}

.status-title {
  color: var(--text);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 0.98;
  font-weight: 920;
  letter-spacing: -0.06em;
}

.muted {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

/* =========================================================
   STATUS METRICS FROM JS
========================================================= */

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

.item {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.70));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.048),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.value {
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 880;
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   MAP
========================================================= */

.map-floating-card {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 600;
  max-width: min(360px, calc(100% - 56px));
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.map-floating-card strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 880;
  letter-spacing: -0.03em;
}

.map-floating-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.live-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px var(--green-soft);
}

#map {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 80px);
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 12px);
  background: #e9eef5;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background: #eef2f7;
  font-family: inherit;
}

.leaflet-control-attribution {
  margin: 0 12px 12px 0 !important;
  padding: 5px 9px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
}

.leaflet-control-zoom a {
  width: 42px !important;
  height: 42px !important;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.90) !important;
  color: #111111 !important;
  font-size: 22px !important;
  line-height: 42px !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.leaflet-control-zoom a:hover {
  background: #ffffff !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.leaflet-popup-content {
  margin: 14px 16px !important;
  color: #111111 !important;
  font-size: 13px !important;
  font-weight: 760;
  line-height: 1.45 !important;
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.92) !important;
}

/* =========================================================
   STATES
========================================================= */

.status-card:has(.grid) {
  padding: 0;
}

.status-card:has(.grid)::before {
  margin-bottom: 2px;
}

.status-card > p.muted {
  max-width: 420px;
}

.status-card .status-title + .muted,
.status-card .status-title + p {
  margin-top: -6px;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1180px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(560px, 1fr);
  }

  .hero-panel {
    min-height: auto;
  }

  .status-card {
    margin-top: 12px;
  }

  .map-shell {
    min-height: 590px;
  }

  #map {
    min-height: 566px;
  }
}

@media (max-width: 760px) {
  .page {
    width: calc(100% - 20px);
    padding: 10px 0;
    gap: 12px;
  }

  .hero-panel,
  .map-shell {
    border-radius: 30px;
  }

  .hero-panel {
    padding: 20px;
    gap: 20px;
  }

  .brand-pill {
    width: 100%;
  }

  .hero-copy {
    margin-top: 4px;
  }

  h1 {
    max-width: 100%;
    font-size: 45px;
  }

  .hero-subtitle {
    max-width: 100%;
    font-size: 16px;
  }

  #refreshButton {
    width: 100%;
  }

  .status-loading {
    grid-template-columns: 1fr;
  }

  .loading-orb,
  .status-card::before {
    width: 64px;
    height: 64px;
  }

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

  .item {
    padding: 15px;
    border-radius: 22px;
  }

  .map-shell {
    min-height: 540px;
    padding: 8px;
  }

  #map {
    min-height: 524px;
    border-radius: 24px;
  }

  .map-floating-card {
    top: 18px;
    left: 18px;
    max-width: calc(100% - 36px);
    border-radius: 24px;
  }

  .leaflet-control-attribution {
    display: none !important;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 40px;
  }

  .status-title {
    font-size: 29px;
  }

  .value {
    font-size: 17px;
  }

  .brand-pill strong {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.flight-summary {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.70));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.048),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.summary-line {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.summary-line span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.10);
  font-size: 17px;
}

.summary-line strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 880;
  letter-spacing: -0.04em;
}

.aircraft-marker {
  background: transparent;
  border: 0;
}

.aircraft-marker-inner {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.92), transparent 27%),
    linear-gradient(135deg, #312e81, #1d4ed8);
  box-shadow:
    0 0 0 8px rgba(37, 99, 235, 0.16),
    0 18px 42px rgba(15, 23, 42, 0.28);
}

.aircraft-svg {
  width: 34px;
  height: 34px;
  display: block;
  fill: #ffffff;
  stroke: rgba(15, 23, 42, 0.42);
  stroke-width: 1.4;
  transform-origin: 50% 50%;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45))
    drop-shadow(0 5px 8px rgba(15, 23, 42, 0.28));
}


.planned-route-line {
  stroke: #111111;
  stroke-opacity: 0.40;
}

.live-track-line {
  stroke: #2563eb;
  stroke-opacity: 0.95;
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.35));
}

.flight-summary {
  display: grid;
  gap: 14px;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.70));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.048),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.summary-line {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.summary-line span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.10);
  font-size: 17px;
}

.summary-line strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 880;
  letter-spacing: -0.04em;
}

.summary-flight strong {
  font-size: 22px;
}

.journey-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.journey-item {
  min-width: 0;
}

.journey-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.journey-airport {
  margin-top: 5px;
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.journey-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.journey-arrow {
  display: grid;
  place-items: center;
  color: rgba(15, 23, 42, 0.36);
  font-size: 24px;
  font-weight: 900;
}

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


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

.airport-marker div {
  min-width: 82px;
  height: 36px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  box-shadow:
    0 0 0 6px rgba(15, 23, 42, 0.10),
    0 12px 28px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.airport-marker-departure div {
  background:
    linear-gradient(135deg, #111827, #020617);
}

.airport-marker-arrival div {
  background:
    linear-gradient(135deg, #16a34a, #047857);
}

.live-track-line {
  stroke: #2563eb;
  stroke-opacity: 0.95;
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.35));
}

.aircraft-live-tooltip {
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
}

.aircraft-live-tooltip::before {
  display: none;
}

.aircraft-tooltip-card {
  min-width: 190px;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 18px 50px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.aircraft-tooltip-title {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.aircraft-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.aircraft-tooltip-row strong {
  color: var(--text);
  font-weight: 850;
}

@media (max-width: 760px) {
  .journey-card {
    grid-template-columns: 1fr;
  }

  .journey-arrow {
    transform: rotate(90deg);
  }

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

  .aircraft-tooltip-card {
    min-width: 160px;
  }
}