.live-body {
    min-width: 18rem;
    overflow-x: hidden;
    background: #eef3f5;
}

.live-page {
    width: min(100%, 96rem);
    margin: 0 auto;
    padding: clamp(.8rem, 2vw, 1.35rem) clamp(.75rem, 2.5vw, 1.5rem) 1.5rem;
}

.live-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}

.live-heading > div {
    min-width: 0;
    max-width: 100%;
}

.live-heading .eyebrow {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .25rem;
    color: var(--primary);
}

.live-heading h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.live-heading > div > p:last-child {
    max-width: 42rem;
    margin: .35rem 0 0;
    color: var(--text-secondary);
    font-size: clamp(.83rem, 1.4vw, .98rem);
}

.live-pulse {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    flex: 0 0 auto;
    border: 2px solid rgba(201, 31, 73, .2);
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 .25rem rgba(201, 31, 73, .1);
}

.live-map-shell {
    position: relative;
    height: clamp(31rem, 73vh, 48rem);
    min-height: 31rem;
    overflow: hidden;
    border: 1px solid rgba(32, 57, 73, .14);
    border-radius: 1rem;
    background: #dbe6e8;
    box-shadow: 0 1rem 2.8rem rgba(20, 35, 52, .12);
    isolation: isolate;
}

.live-map {
    width: 100%;
    height: 100%;
    background: #dce7e8;
    direction: ltr;
}

.live-map-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
}

.live-map-actions {
    position: absolute;
    z-index: 600;
    top: .75rem;
    right: .75rem;
    display: flex;
    gap: .45rem;
    direction: ltr;
}

[dir="rtl"] .live-map-actions {
    right: auto;
    left: 4rem;
}

.live-map-action,
.live-panel-toggle {
    display: inline-flex;
    min-height: 2.55rem;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .48rem .7rem;
    border: 1px solid rgba(31, 47, 61, .16);
    border-radius: .65rem;
    background: rgba(255, 255, 255, .95);
    color: var(--navy);
    box-shadow: 0 .35rem 1rem rgba(17, 42, 54, .14);
    font-size: .76rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.live-map-action:hover,
.live-map-action[aria-pressed="true"],
.live-panel-toggle:hover {
    background: var(--primary);
    color: #fff;
}

.live-map-action > span:first-child {
    font-size: 1rem;
    line-height: 1;
}

.live-pilots-panel {
    position: absolute;
    z-index: 550;
    top: .75rem;
    bottom: .75rem;
    left: .75rem;
    display: flex;
    width: min(21rem, calc(100% - 7.5rem));
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(31, 47, 61, .14);
    border-radius: .85rem;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 .8rem 2.2rem rgba(17, 42, 54, .18);
    backdrop-filter: blur(12px);
}

[dir="rtl"] .live-pilots-panel {
    right: .75rem;
    left: auto;
}

.live-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem .85rem .65rem;
    border-bottom: 1px solid var(--border);
}

.live-panel-header > div {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: var(--primary);
    font-size: .75rem;
    letter-spacing: .06em;
}

.live-count {
    display: grid;
    min-width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    padding: 0 .35rem;
    border-radius: 99px;
    background: var(--navy);
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.live-search {
    gap: .3rem;
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: .68rem;
}

.live-search input {
    min-height: 2.3rem;
    padding: .5rem .65rem;
    font-size: .8rem;
}

.live-directory-sections {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.live-directory-sections[hidden] {
    display: none;
}

.live-pilot-section > h2 {
    margin: 0;
    padding: .65rem .85rem .15rem;
    color: var(--navy);
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.live-recent-section {
    border-top: 1px solid var(--border);
}

.live-pilot-list {
    display: grid;
    min-height: 0;
    align-content: start;
    gap: .45rem;
    overflow: visible;
    padding: .65rem;
    overscroll-behavior: contain;
}

.live-section-empty {
    margin: 0;
    padding: .55rem .85rem .75rem;
    color: var(--text-secondary);
    font-size: .7rem;
    line-height: 1.45;
}

.live-section-empty[hidden] {
    display: none;
}

.live-pilot-row {
    display: grid;
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    padding: .65rem;
    border: 1px solid var(--border);
    border-radius: .7rem;
    background: #fff;
    color: var(--text-primary);
    text-align: start;
    box-shadow: none;
}

.live-pilot-main {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .65rem;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: start;
}

.live-pilot-main:focus-visible,
.live-pilot-details-button:focus-visible,
.live-details-back:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.live-pilot-details-button {
    display: none;
}

.live-pilot-row:hover,
.live-pilot-row.is-selected {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
    background: var(--primary-soft);
}

.live-pilot-row.is-selected {
    box-shadow: inset .18rem 0 0 var(--primary);
}

[dir="rtl"] .live-pilot-row.is-selected {
    box-shadow: inset -.18rem 0 0 var(--primary);
}

.live-pilot-avatar {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.live-pilot-copy,
.live-selected-copy {
    min-width: 0;
}

.live-pilot-copy strong,
.live-selected-copy h2 {
    display: block;
    margin: 0;
    overflow: hidden;
    color: var(--navy);
    font-size: .84rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-pilot-meta,
.live-selected-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .55rem;
    align-items: center;
    margin-top: .3rem;
    color: var(--text-secondary);
    font-size: .68rem;
    line-height: 1.3;
}

.live-status {
    display: inline-flex;
    align-items: center;
    padding: .2rem .42rem;
    border-radius: 99px;
    background: var(--success-background);
    color: var(--success);
    font-size: .61rem;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.live-status.is-stale {
    background: var(--warning-background);
    color: var(--warning);
}

.live-status.is-ended {
    background: var(--secondary);
    color: var(--text-secondary);
}

.live-status.is-private {
    background: var(--navy);
    color: #fff;
}

.live-selected-card {
    min-height: 0;
    max-height: calc(100% - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: .65rem .65rem 0;
    padding: .75rem;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: .75rem;
    background: linear-gradient(135deg, #fff, var(--primary-soft));
}

.live-selected-card[hidden] {
    display: none;
}

.live-details-back {
    display: block;
    min-height: 2.5rem;
    margin-bottom: .65rem;
    padding: .35rem .65rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fff;
    color: var(--navy);
    font-size: .76rem;
    font-weight: 800;
}

.live-last-location {
    margin-top: .7rem;
    padding-top: .65rem;
    border-top: 1px solid var(--border);
}

.live-last-location h3 {
    margin: 0 0 .35rem;
    color: var(--navy);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.live-location-note,
.live-location-unavailable,
.live-location-time,
.live-location-accuracy {
    margin: .25rem 0;
    color: var(--text-secondary);
    font-size: .7rem;
    line-height: 1.4;
}

.live-location-label {
    display: block;
    margin-top: .45rem;
    color: var(--text-secondary);
    font-size: .66rem;
}

.live-location-coordinates {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--navy);
    font-size: .88rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    text-align: start;
    unicode-bidi: isolate;
}

.live-location-time time {
    color: var(--navy);
    font-weight: 700;
}

.live-location-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
    margin-top: .55rem;
}

.live-location-actions > :is(button, a) {
    display: inline-flex;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    padding: .4rem;
    border: 1px solid var(--primary);
    border-radius: .5rem;
    background: #fff;
    color: var(--primary);
    font-size: .67rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.live-location-actions > :is(button, a):hover,
.live-location-actions > :is(button, a):focus-visible {
    background: var(--primary);
    color: #fff;
}

.live-copy-status {
    display: block;
    min-height: 1.1rem;
    margin-top: .2rem;
    color: var(--text-secondary);
    font-size: .65rem;
}

.live-panel-message {
    display: grid;
    min-height: 7rem;
    place-items: center;
    padding: 1rem;
    color: var(--text-secondary);
    font-size: .78rem;
    text-align: center;
}

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

.live-empty-state {
    position: absolute;
    z-index: 450;
    top: 50%;
    left: 50%;
    width: min(27rem, calc(100% - 4rem));
    padding: 1.3rem;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .93);
    color: var(--navy);
    box-shadow: 0 1rem 2.5rem rgba(17, 42, 54, .18);
    text-align: center;
    backdrop-filter: blur(10px);
}

.live-empty-state[hidden] {
    display: none;
}

.live-empty-state > span {
    color: var(--primary);
    font-size: 2rem;
}

.live-empty-state h2 {
    margin: .25rem 0;
    font-size: 1.15rem;
}

.live-empty-state p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .82rem;
    line-height: 1.55;
}

.live-panel-toggle {
    display: none;
}

.live-pilot-marker-wrap {
    position: relative;
    background: transparent;
    border: 0;
    overflow: visible;
}

.live-pilot-marker {
    position: relative;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    transform: rotate(var(--course, 0deg));
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 12%;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 .25rem .75rem rgba(15, 37, 49, .35);
    font-size: .8rem;
    font-weight: 900;
}

.live-pilot-marker.is-selected {
    width: 2.45rem;
    height: 2.45rem;
    margin: -.22rem;
    background: var(--primary);
    box-shadow: 0 0 0 .35rem rgba(201, 31, 73, .18), 0 .4rem 1rem rgba(15, 37, 49, .4);
}

.live-pilot-marker > span {
    transform: rotate(calc(-1 * var(--course, 0deg)));
}

.live-pilot-label {
    position: absolute;
    top: calc(.05rem + (var(--label-slot, 0) * 1.05rem));
    left: 2.15rem;
    display: block;
    max-width: 9.5rem;
    overflow: hidden;
    padding: .16rem .35rem;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: .35rem;
    background: rgba(15, 37, 49, .82);
    color: #fff;
    box-shadow: 0 .15rem .45rem rgba(15, 37, 49, .2);
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.15;
    pointer-events: none;
    text-align: start;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-pilot-label.is-selected {
    z-index: 2;
    border-color: rgba(255, 255, 255, .95);
    background: var(--primary);
    font-weight: 900;
}

.live-pilot-label.is-decluttered {
    opacity: 0;
}

.live-map .leaflet-control-layers,
.live-map .leaflet-control-zoom {
    border: 0;
    box-shadow: 0 .35rem 1rem rgba(17, 42, 54, .16);
}

.live-map .leaflet-control-attribution {
    font-size: .58rem;
}

html[lang="ar"] .live-page,
html[lang="ar"] .live-page :is(button, input, h1, h2, p, strong, span, label) {
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
}

@media (max-width: 48rem) {
    .live-map-shell {
        --live-sheet-height: min(17rem, 42svh, calc(100% - 3.5rem));
    }

    .live-map-shell.is-details-mode {
        --live-sheet-height: min(22rem, 55svh, calc(100% - 3.5rem));
    }

    @supports (height: 100dvh) {
        .live-map-shell {
            --live-sheet-height: min(17rem, 42dvh, calc(100% - 3.5rem));
        }

        .live-map-shell.is-details-mode {
            --live-sheet-height: min(22rem, 55dvh, calc(100% - 3.5rem));
        }
    }

    .live-page {
        padding: .65rem .65rem 1rem;
    }

    .live-heading {
        margin-bottom: .6rem;
        padding-inline: .15rem;
    }

    .live-heading h1 {
        max-width: 100%;
        font-size: clamp(1.45rem, 7vw, 1.9rem);
        overflow-wrap: anywhere;
    }

    .live-heading > div > p:last-child {
        font-size: .78rem;
    }

    .live-map-shell {
        height: calc(100svh - 10.8rem);
        height: calc(100dvh - 10.8rem);
        min-height: 26rem;
        border-radius: .85rem;
    }

    .live-map-actions {
        top: .55rem;
        right: .55rem;
    }

    [dir="rtl"] .live-map-actions {
        right: auto;
        left: 3.75rem;
    }

    .live-body .site-language-switcher {
        display: none;
    }

    .live-map-action {
        width: 2.55rem;
        padding: .45rem;
    }

    .live-map-action > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .live-panel-toggle {
        position: absolute;
        z-index: 570;
        right: 50%;
        bottom: calc(var(--live-sheet-height) + 1.1rem);
        display: inline-flex;
        min-height: 2.35rem;
        transform: translateX(50%);
        border-radius: .7rem .7rem 0 0;
        font-size: .72rem;
    }

    .live-map-shell.is-panel-collapsed .live-panel-toggle {
        bottom: .55rem;
        border-radius: .7rem;
    }

    .live-pilots-panel,
    [dir="rtl"] .live-pilots-panel {
        top: auto;
        right: .55rem;
        bottom: .55rem;
        left: .55rem;
        width: auto;
        height: var(--live-sheet-height);
        max-height: calc(100% - 3.5rem);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: .85rem;
        transition: transform .2s ease, opacity .2s ease;
    }

    .live-map-shell.is-panel-collapsed .live-pilots-panel {
        transform: translateY(calc(100% + 1rem));
        opacity: 0;
        pointer-events: none;
    }

    .live-panel-header {
        padding: .55rem .7rem .45rem;
    }

    .live-search {
        padding: .4rem .65rem;
    }

    .live-search > span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .live-search input {
        min-height: 2.15rem;
    }

    .live-search[hidden] {
        display: none;
    }

    .live-directory-sections {
        min-height: auto;
        overflow: visible;
        overscroll-behavior: auto;
    }

    .live-pilot-list {
        grid-auto-flow: row;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        overflow: visible;
        padding: .45rem .6rem .6rem;
    }

    .live-pilot-row {
        gap: .4rem;
        padding: .45rem .5rem;
    }

    .live-pilot-main {
        gap: .45rem;
    }

    .live-pilot-meta {
        margin-top: .15rem;
        gap: .15rem .4rem;
    }

    .live-pilot-details-button {
        display: inline-flex;
        min-height: 2.5rem;
        align-items: center;
        justify-content: center;
        padding: .3rem .5rem;
        border: 1px solid var(--primary);
        border-radius: .5rem;
        background: #fff;
        color: var(--primary);
        font-size: .68rem;
        font-weight: 800;
    }

    .live-selected-card {
        max-height: none;
        overflow: visible;
        margin: 0;
        padding: .65rem .75rem;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .live-location-actions > :is(button, a) {
        min-height: 2.75rem;
    }

    .live-pilot-section > h2 {
        padding: .45rem .65rem .1rem;
    }

    .live-recent-section {
        margin-top: .15rem;
    }

    .live-section-empty {
        padding: .4rem .65rem .6rem;
    }

    .live-pilot-label {
        max-width: 7.5rem;
        font-size: .61rem;
    }

    .live-panel-message {
        min-height: 3.75rem;
    }

    .live-empty-state {
        top: 43%;
        width: min(24rem, calc(100% - 2rem));
        padding: 1rem;
    }
}

@media (max-width: 48rem) and (orientation: landscape) {
    .live-heading {
        display: none;
    }

    .live-map-shell {
        height: calc(100svh - 4.5rem);
        min-height: 20rem;
    }

    .live-pilots-panel,
    [dir="rtl"] .live-pilots-panel {
        right: auto;
        left: .55rem;
        width: min(18rem, 42vw);
    }

    [dir="rtl"] .live-pilots-panel {
        right: .55rem;
        left: auto;
    }
}
