:root {
    --bg: #08111b;
    --bg-soft: rgba(8, 17, 27, 0.72);
    --bg-card: rgba(13, 23, 36, 0.78);
    --bg-card-strong: rgba(10, 18, 28, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --text: #eef5ff;
    --muted: #9eb3c9;
    --accent: #64d2ff;
    --accent-strong: #2fb7ff;
    --accent-soft: rgba(100, 210, 255, 0.16);
    --ok: #7cf4c0;
    --warn: #ffbf69;
    --danger: #ff8e8e;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    --radius: 22px;
    --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-display: "Rajdhani", "Segoe UI", sans-serif;
}

body.theme-light {
    --bg: #eef5fb;
    --bg-soft: rgba(255, 255, 255, 0.82);
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-strong: rgba(255, 255, 255, 0.96);
    --border: rgba(8, 17, 27, 0.09);
    --text: #08111b;
    --muted: #5b7085;
    --accent: #0078b8;
    --accent-strong: #0097e0;
    --accent-soft: rgba(0, 120, 184, 0.12);
    --ok: #0f9f72;
    --warn: #c97a11;
    --danger: #cf4d4d;
    --shadow: 0 24px 80px rgba(15, 23, 42, 0.15);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body.mapa-page {
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(47, 183, 255, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(255, 191, 105, 0.08), transparent 26%),
        linear-gradient(180deg, #03080f 0%, var(--bg) 42%, #040c14 100%);
    color: var(--text);
    font-family: var(--font-body);
}

.map-app {
    position: relative;
    width: 100%;
    height: 100%;
    isolation: isolate;
    --edge-gap: 22px;
    --sidebar-width: min(390px, calc(100vw - 44px));
    --topbar-clearance: 142px;
}

.map-canvas {
    position: absolute;
    inset: 0;
}

.hud-gradient {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.hud-gradient--top {
    inset: 0 0 auto;
    height: 180px;
    background: linear-gradient(180deg, rgba(4, 9, 15, 0.8) 0%, rgba(4, 9, 15, 0) 100%);
}

.hud-gradient--bottom {
    inset: auto 0 0;
    height: 220px;
    background: linear-gradient(180deg, rgba(4, 9, 15, 0) 0%, rgba(4, 9, 15, 0.7) 100%);
}

.glass {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.topbar {
    position: absolute;
    top: var(--edge-gap);
    left: var(--edge-gap);
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) auto auto;
    align-items: start;
    gap: 16px 18px;
    width: min(980px, calc(100vw - 220px));
    min-width: 320px;
    padding: 15px 18px 16px;
    border-radius: 34px;
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar__brand > div {
    min-width: 0;
}

.topbar__logo {
    width: 66px;
    height: 46px;
    padding: 6px 8px;
    border-radius: 16px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.topbar__eyebrow {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
}

.topbar__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 29px;
    line-height: 0.95;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.topbar__subtitle {
    margin: 0;
    max-width: 46ch;
    font-size: 12px;
    line-height: 1.35;
    color: var(--muted);
}

.topbar__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.mini-stat {
    min-width: 86px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--accent-soft);
    border: 1px solid rgba(100, 210, 255, 0.18);
}

.mini-stat__label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.mini-stat__value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.topbar__refresh {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(124, 244, 192, 0.6);
    animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 244, 192, 0.55);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(124, 244, 192, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(124, 244, 192, 0);
    }
}

.top-actions {
    position: absolute;
    top: var(--edge-gap);
    right: var(--edge-gap);
    z-index: 8;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.action-button,
.chip-button,
.sidebar-minimize,
.filters-row,
.flight-card__focus {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 999px;
    background: var(--bg-card-strong);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.action-button__icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 18px;
    font-weight: 700;
}

.filters-panel {
    position: relative;
    z-index: 8;
    width: 320px;
    padding: 16px;
    border-radius: 26px;
    pointer-events: auto;
}

.filters-panel[hidden] {
    display: none;
}

.filters-panel__title {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.filters-panel__copy {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--muted);
}

.filters-grid {
    display: grid;
    gap: 10px;
}

.filters-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.filters-row__label {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.filters-row__title {
    font-size: 14px;
    font-weight: 600;
}

.filters-row__text {
    font-size: 12px;
    color: var(--muted);
}

.toggle {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    transition: background 0.2s ease;
}

.toggle::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.2s ease;
}

.toggle.is-on {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.toggle.is-on::after {
    transform: translateX(22px);
}

.sidebar {
    position: absolute;
    top: var(--topbar-clearance);
    left: var(--edge-gap);
    bottom: 24px;
    z-index: 4;
    width: var(--sidebar-width);
    max-height: calc(100vh - var(--topbar-clearance) - 24px);
    display: flex;
    flex-direction: column;
    border-radius: 30px;
    overflow: hidden;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.sidebar.is-collapsed {
    transform: translateX(calc(-100% - 28px));
    opacity: 0;
    pointer-events: none;
}

.sidebar__header {
    position: relative;
    padding: 22px 22px 18px;
    padding-right: 78px;
    border-bottom: 1px solid var(--border);
}

.sidebar-minimize {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-minimize:hover {
    background: rgba(100, 210, 255, 0.12);
    border-color: rgba(100, 210, 255, 0.22);
}

.sidebar-minimize__icon {
    font-size: 22px;
    line-height: 1;
    transform: translateY(-1px);
}

.sidebar__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
}

.sidebar__eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
}

.sidebar__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 32px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar__copy {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.sidebar__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 22px 18px;
}

.sidebar__body {
    flex: 1;
    overflow: auto;
    padding: 0 10px 18px 22px;
}

.sidebar__body::-webkit-scrollbar {
    width: 8px;
}

.sidebar__body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.22);
    border-radius: 999px;
}

.flight-list {
    display: grid;
    gap: 12px;
    padding-right: 12px;
}

.flight-card {
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.flight-card:hover {
    transform: translateY(-2px);
    border-color: rgba(100, 210, 255, 0.28);
}

.flight-card.is-selected {
    background: linear-gradient(180deg, rgba(100, 210, 255, 0.13) 0%, rgba(100, 210, 255, 0.06) 100%);
    border-color: rgba(100, 210, 255, 0.36);
}

.flight-card__top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.flight-card__avatar {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.flight-card__callsign {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.flight-card__callsign strong {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 0.03em;
}

.network-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    background: rgba(124, 244, 192, 0.14);
}

.network-badge.is-offline {
    background: rgba(255, 142, 142, 0.14);
}

.flight-card__pilot {
    font-size: 13px;
    color: var(--muted);
}

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

.route-airport {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.route-airport--arrival {
    text-align: right;
}

.route-airport__icao {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.route-airport__name {
    font-size: 11px;
    color: var(--muted);
}

.route-arrow {
    width: 46px;
    text-align: center;
    font-size: 18px;
    color: var(--accent);
}

.flight-card__fpl {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.flight-card__fpl-label {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.flight-card__fpl-value {
    display: block;
    font-family: "IBM Plex Mono", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    word-break: break-word;
}

.flight-card__progress {
    margin-top: 14px;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
}

.progress-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.progress-bar__value {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-strong) 0%, var(--accent) 100%);
}

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

.meta-box {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.meta-box__label {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.meta-box__value {
    font-size: 15px;
    font-weight: 700;
}

.flight-card__bottom {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
}

.flight-card__focus {
    padding: 10px 14px;
    border-radius: 999px;
    color: #001522;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    font-weight: 700;
}

.flight-card__focus.is-active {
    color: #e9f7ff;
    background: linear-gradient(135deg, rgba(25, 211, 255, 0.22) 0%, rgba(17, 94, 163, 0.78) 100%);
    box-shadow: inset 0 0 0 1px rgba(122, 227, 255, 0.36);
}

.empty-state {
    padding: 34px 24px;
    border-radius: 26px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(148, 163, 184, 0.26);
}

.empty-state__icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 34px;
}

.empty-state__title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.empty-state__text {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

.sidebar-toggle {
    position: absolute;
    left: var(--edge-gap);
    top: calc(var(--topbar-clearance) + 18px);
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 999px;
    color: var(--text);
    background: var(--bg-card-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.sidebar-toggle[hidden] {
    display: none;
}

.panel-stack {
    position: absolute;
    top: var(--topbar-clearance);
    right: var(--edge-gap);
    bottom: 70px;
    z-index: 4;
    width: min(420px, calc(100vw - 44px));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.24) transparent;
}

.panel-stack--left {
    left: calc(var(--edge-gap) + var(--sidebar-width) + 18px);
    right: auto;
    width: min(430px, calc(100vw - 44px));
}

.panel-stack--left.is-sidebar-collapsed {
    left: var(--edge-gap);
}

.panel-stack::-webkit-scrollbar {
    width: 8px;
}

.panel-stack::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.24);
    border-radius: 999px;
}

.info-panel {
    padding: 16px 18px;
    border-radius: 26px;
}

.info-panel[hidden] {
    display: none;
}

.info-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.info-panel__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.info-panel__subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.chip-button {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.atis-list,
.metar-list {
    display: grid;
    gap: 10px;
}

.atis-card,
.metar-card {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.atis-card__head,
.metar-card__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.atis-card__callsign,
.metar-card__icao {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.atis-card__freq,
.metar-card__category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.atis-card__lines {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
}

.atis-card__foot {
    margin-top: 12px;
    font-size: 11px;
    color: var(--muted);
}

.metar-card__raw {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.24);
    font-family: "IBM Plex Mono", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.45;
}

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

.metric {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.metric__label {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.metric__value {
    font-size: 15px;
    font-weight: 700;
}

.attribution {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 4;
    transform: translateX(-50%);
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(4, 10, 16, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.loading-screen {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, rgba(47, 183, 255, 0.14) 0%, rgba(4, 9, 15, 0.96) 58%),
        rgba(4, 9, 15, 0.97);
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.loading-screen.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-card {
    width: min(420px, calc(100vw - 44px));
    padding: 28px 24px;
    text-align: center;
    border-radius: 28px;
    background: rgba(10, 18, 28, 0.88);
    border: 1px solid rgba(100, 210, 255, 0.16);
    box-shadow: var(--shadow);
}

.loading-card__logo {
    width: 118px;
    height: 72px;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 22px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
}

.loading-card__title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: 34px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.loading-card__text {
    margin: 0;
    color: var(--muted);
}

.loading-bar {
    height: 8px;
    margin-top: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.loading-bar::after {
    content: "";
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-strong) 0%, var(--accent) 100%);
    animation: loading-slide 1.2s infinite ease-in-out;
}

@keyframes loading-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(280%);
    }
}

.toast {
    position: absolute;
    left: 50%;
    top: calc(var(--topbar-clearance) - 10px);
    z-index: 7;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: 520px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 142, 142, 0.16);
    color: var(--text);
    border: 1px solid rgba(255, 142, 142, 0.24);
    box-shadow: var(--shadow);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    visibility: visible;
}

.maplibregl-ctrl-top-right,
.maplibregl-ctrl-bottom-right {
    display: none;
}

.maplibregl-canvas {
    cursor: grab;
}

.maplibregl-canvas:active {
    cursor: grabbing;
}

@media (max-width: 1180px) {
    .map-app {
        --topbar-clearance: 118px;
    }

    .topbar {
        grid-template-columns: minmax(0, 1fr);
        width: calc(100vw - 164px);
        min-width: 0;
    }

    .topbar__stats,
    .topbar__refresh {
        display: none;
    }

    .panel-stack--left {
        left: var(--edge-gap);
        width: min(380px, calc(100vw - 44px));
    }
}

@media (max-width: 860px) {
    .map-app {
        --topbar-clearance: 114px;
    }

    .topbar {
        width: calc(100vw - 44px);
        min-width: 0;
    }

    .topbar__logo {
        width: 58px;
        height: 40px;
        padding: 5px 7px;
        border-radius: 14px;
    }

    .topbar__title {
        font-size: 24px;
    }

    .sidebar {
        top: var(--topbar-clearance);
        bottom: 22px;
        width: calc(100vw - 44px);
        max-height: calc(100vh - var(--topbar-clearance) - 22px);
    }

    .sidebar-toggle {
        top: auto;
        bottom: 184px;
    }

    .filters-panel {
        width: calc(100vw - 44px);
    }

    .panel-stack,
    .panel-stack--left,
    .panel-stack--left.is-sidebar-collapsed {
        left: var(--edge-gap);
        right: var(--edge-gap);
        width: auto;
    }

    .panel-stack {
        top: auto;
    }

    .panel-stack--left {
        bottom: 252px;
    }

    .panel-stack {
        bottom: 68px;
    }

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

@media (max-width: 640px) {
    .map-app {
        --topbar-clearance: 108px;
    }

    .topbar {
        padding: 14px 16px;
        border-radius: 26px;
    }

    .topbar__eyebrow {
        font-size: 10px;
    }

    .topbar__title {
        font-size: 22px;
    }

    .action-button {
        padding: 12px 14px;
    }

    .action-button__icon {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        font-size: 16px;
    }

    .sidebar__summary,
    .flight-card__meta,
    .metar-card__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .flight-card__meta .meta-box:last-child,
    .sidebar__summary .mini-stat:last-child {
        grid-column: 1 / -1;
    }

    .flight-card__route {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .route-airport,
    .route-airport--arrival {
        text-align: left;
    }

    .route-arrow {
        width: auto;
        text-align: left;
    }

    .attribution {
        left: 22px;
        right: 22px;
        transform: none;
        border-radius: 18px;
    }
}
