:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #071015;
    --glass: rgba(10, 18, 23, .72);
    --glass-strong: rgba(9, 16, 21, .88);
    --glass-soft: rgba(12, 22, 28, .56);
    --border: rgba(143, 177, 192, .24);
    --border-strong: rgba(143, 190, 211, .38);
    --text: #e8f1f5;
    --muted: #8ca1aa;
    --muted-2: #667c85;
    --accent: #66c8ee;
    --accent-soft: rgba(102, 200, 238, .17);
    --ok: #90e2b8;
    --warn: #f2cf83;
    --danger: #f0a6aa;
    --timeline-height: 122px;
    --timeline-label-width: 80px;
    --top-offset: 100px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
}

button, input, select { font: inherit; }
button, select, input[type="text"] {
    border: 1px solid rgba(135, 166, 180, .35);
    border-radius: 8px;
    background: rgba(21, 32, 39, .78);
    color: #eef7fa;
}
button {
    padding: .42rem .66rem;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
button:hover:not(:disabled) {
    background: rgba(42, 61, 72, .9);
    border-color: rgba(114, 198, 233, .62);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled, input:disabled, select:disabled { opacity: .42; cursor: not-allowed; }
input[type="text"], select { padding: .4rem .55rem; }
input[type="checkbox"] { accent-color: var(--accent); }
code { color: #a5ddf7; }
h2, h3 { margin: 0; }
h3 { font-size: .82rem; color: #d6e4ea; }

.shell, main {
    width: 100%;
    height: 100%;
    min-height: 100%;
    pointer-events: none;
}
main { padding: 0; }

.replay-workspace,
.map-first-workspace {
    position: fixed;
    inset: 0;
    z-index: 10;
    overflow: hidden;
    background: transparent;
    /*
     * The actual MapLibre surface is owned by JavaScript and lives directly
     * under <body>, outside the Blazor interactive render tree. Empty map
     * areas must therefore let pointer events pass through to that surface.
     */
    pointer-events: none;
}

.radar-map,
.fullscreen-map,
.js-owned-map-surface {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #071015;
    z-index: 0;
}

.js-owned-map-surface {
    pointer-events: auto;
}

/* Initial application loader. It remains above both Blazor and MapLibre until
   the replay session and the first usable map style are ready. */
.initial-loader {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 46%, rgba(28, 63, 78, .34), transparent 34%),
        rgba(4, 10, 14, .96);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .32s ease, visibility .32s ease;
}
.initial-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.initial-loader-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: min(420px, calc(100vw - 42px));
    max-width: 560px;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(124, 183, 207, .28);
    border-radius: 16px;
    background: rgba(8, 17, 22, .86);
    box-shadow: 0 18px 52px rgba(0, 0, 0, .42);
    backdrop-filter: blur(12px);
}
.initial-loader-radar {
    position: relative;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid rgba(102, 200, 238, .58);
    border-radius: 50%;
    background:
        linear-gradient(rgba(102, 200, 238, .12) 1px, transparent 1px) 0 50% / 100% 50%,
        linear-gradient(90deg, rgba(102, 200, 238, .12) 1px, transparent 1px) 50% 0 / 50% 100%,
        radial-gradient(circle, transparent 31%, rgba(102, 200, 238, .12) 32%, transparent 34%, transparent 63%, rgba(102, 200, 238, .11) 64%, transparent 66%),
        rgba(8, 27, 35, .9);
    box-shadow: inset 0 0 20px rgba(69, 179, 220, .1), 0 0 18px rgba(73, 178, 219, .08);
}
.initial-loader-sweep {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 50%;
    height: 50%;
    transform-origin: 0 100%;
    background: linear-gradient(24deg, rgba(104, 215, 255, .38), rgba(104, 215, 255, 0) 72%);
    clip-path: polygon(0 100%, 100% 70%, 100% 100%);
    animation: radar-loader-sweep 1.55s linear infinite;
}
.initial-loader-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8fe1ff;
    box-shadow: 0 0 7px rgba(143, 225, 255, .9);
    animation: radar-loader-pulse 1.35s ease-in-out infinite alternate;
}
.initial-loader-dot.dot-a { left: 35px; top: 17px; }
.initial-loader-dot.dot-b { left: 17px; top: 38px; animation-delay: .42s; }
.initial-loader-copy {
    min-width: 0;
    display: grid;
    gap: .18rem;
}
.initial-loader-copy strong {
    color: #effaff;
    font-size: .92rem;
    letter-spacing: .015em;
}
.initial-loader-copy span {
    color: #a7d9ec;
    font-size: .74rem;
}
.initial-loader-copy small {
    color: #6f8e9a;
    font-size: .63rem;
}
.initial-loader[data-state="error"] .initial-loader-card {
    border-color: rgba(224, 107, 113, .55);
}
.initial-loader[data-state="error"] .initial-loader-copy span { color: var(--danger); }
.initial-loader[data-state="error"] .initial-loader-radar {
    border-color: rgba(224, 107, 113, .52);
    filter: saturate(.65);
}
@keyframes radar-loader-sweep { to { transform: rotate(360deg); } }
@keyframes radar-loader-pulse { from { opacity: .25; } to { opacity: 1; } }

/* Glass surface used by all floating HUD elements. */
.glass-panel {
    border: 1px solid var(--border);
    background: var(--glass);
    box-shadow: 0 14px 42px rgba(0, 0, 0, .28);
    backdrop-filter: blur(12px) saturate(115%);
    -webkit-backdrop-filter: blur(12px) saturate(115%);
}

/* Compact top-right HUD: controls on the first row, metadata/credits below. */
.map-tools {
    position: fixed;
    z-index: 32;
    top: 12px;
    right: 12px;
    left: auto;
    width: max-content;
    max-width: calc(100vw - 24px);
    display: grid;
    justify-items: end;
    gap: .28rem;
    padding: .38rem .46rem .3rem .62rem;
    border-radius: 12px;
    pointer-events: auto;
}

.map-tools-main {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .7rem;
}

.map-tools-meta {
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .65rem;
    padding-top: .24rem;
    border-top: 1px solid rgba(137, 169, 184, .13);
    color: var(--muted-2);
    font-size: .56rem;
}

.language-control {
    display: flex;
    align-items: center;
    gap: .3rem;
}
.language-control span {
    text-transform: uppercase;
    letter-spacing: .06em;
}
.language-control select {
    width: auto;
    min-width: 112px;
    padding: .2rem .36rem;
    border-radius: 6px;
    font-size: .58rem;
}
.author-credit {
    white-space: nowrap;
    color: #78909a;
}

.replay-toolbar-group,
.map-toolbar-group,
.toolbar-transport,
.transport-primary,
.transport-rates,
.basemap-switch,
.map-dimming-switch {
    display: flex;
    align-items: center;
}

.replay-toolbar-group {
    min-width: 0;
    gap: .72rem;
}

.map-toolbar-group {
    flex: 0 0 auto;
    gap: .38rem;
}

.map-toolbar-separator {
    align-self: stretch;
    flex: 0 0 1px;
    background: rgba(137, 169, 184, .18);
}

.workspace-clock {
    min-width: 168px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    line-height: 1.06;
}
.workspace-clock-label {
    display: block;
    color: var(--muted-2);
    font-size: .56rem;
    text-transform: uppercase;
    letter-spacing: .11em;
}
.workspace-clock strong {
    display: block;
    margin-top: .08rem;
    color: #edf8fc;
    font-size: .82rem;
    font-weight: 650;
    white-space: nowrap;
}
.clock-state { color: #79acc1; font-size: .59rem; white-space: nowrap; }

.workspace-profile {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .38rem;
}
.workspace-profile label {
    color: var(--muted);
    font-size: .64rem;
}
.workspace-profile select {
    width: clamp(180px, 20vw, 290px);
    min-width: 0;
    padding: .32rem .46rem;
    font-size: .69rem;
    background: rgba(17, 29, 36, .78);
}

.toolbar-transport { gap: .38rem; }
.transport-primary,
.transport-rates { gap: .22rem; }
.transport-primary button {
    width: 34px;
    height: 31px;
    padding: 0;
    font-size: .78rem;
}
.rate-button {
    min-width: 34px;
    padding: .31rem .4rem;
    font-size: .65rem;
}

.basemap-switch,
.map-dimming-switch { gap: .18rem; }
.basemap-button,
.map-dimming-button,
.map-action {
    padding: .34rem .58rem;
    font-size: .68rem;
}
.map-dimming-switch {
    padding-left: .34rem;
    border-left: 1px solid rgba(137, 169, 184, .18);
}
.basemap-button.active,
.map-dimming-button.active,
.rate-button.active,
.transport-primary button.active {
    border-color: rgba(102, 200, 238, .74);
    background: rgba(30, 83, 105, .68);
    color: #d8f4ff;
    box-shadow: inset 0 0 0 1px rgba(102, 200, 238, .12);
}

.badge {
    border-radius: 999px;
    padding: .27rem .55rem;
    font-size: .59rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}
.badge-online { background: rgba(20, 70, 46, .78); color: var(--ok); }
.badge-offline { background: rgba(77, 34, 40, .8); color: #f2a8ae; }

/* Collapsible source and inspector drawers. */
.floating-panel {
    position: absolute;
    z-index: 24;
    top: var(--top-offset);
    width: 286px;
    max-height: calc(100vh - var(--timeline-height) - var(--top-offset) - 40px);
    border-radius: 13px;
    overflow: hidden;
    pointer-events: auto;
    transition: width .18s ease, background .18s ease;
}
.sources-panel { left: 12px; }
.inspector-panel { right: 12px; width: 314px; }
.floating-panel:not([open]) { width: 176px; background: rgba(9, 17, 22, .66); }

.floating-panel > summary,
.diagnostics-panel > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.floating-panel > summary::-webkit-details-marker,
.diagnostics-panel > summary::-webkit-details-marker { display: none; }
.floating-panel > summary {
    min-height: 46px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: center;
    column-gap: .5rem;
    padding: .56rem .7rem;
    border-bottom: 1px solid transparent;
}
.floating-panel[open] > summary { border-bottom-color: rgba(137, 169, 184, .16); }
.floating-panel > summary::after {
    content: "−";
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    color: #9eb1ba;
    font-size: 1rem;
}
.floating-panel:not([open]) > summary::after { content: "+"; }
.panel-summary-title {
    font-size: .86rem;
    font-weight: 670;
    color: #eef7fa;
}
.panel-summary-subtitle {
    font-size: .61rem;
    color: var(--muted-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.floating-panel-content {
    max-height: calc(100vh - var(--timeline-height) - var(--top-offset) - 92px);
    overflow: auto;
    padding: .62rem .68rem .72rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(105, 140, 156, .45) transparent;
}
.panel-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    color: var(--muted-2);
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding-bottom: .45rem;
}
.icon-button { padding: .24rem .48rem; font-size: .67rem; }

.layer-switches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .3rem .5rem;
    padding: .55rem 0;
    border-top: 1px solid rgba(132, 163, 177, .13);
    border-bottom: 1px solid rgba(132, 163, 177, .13);
    font-size: .72rem;
    color: #b7c6cc;
}
.layer-switches label { display: flex; align-items: center; gap: .34rem; }
.layer-switches .layer-switch-wide { grid-column: 1 / -1; }

.source-tree { padding-top: .5rem; }
.source-system { margin-bottom: .5rem; }
.source-system-header,
.physical-radar-header,
.source-channel-row {
    display: flex;
    align-items: center;
    gap: .38rem;
}
.source-system-header { font-weight: 650; padding: .28rem 0; font-size: .72rem; }
.physical-radar-group {
    margin: .22rem 0 .36rem .38rem;
    border-left: 1px solid rgba(114, 148, 163, .32);
    padding-left: .46rem;
}
.physical-radar-header { color: #c7d7dd; font-size: .74rem; padding: .24rem 0; }
.source-channel-row {
    margin-left: .45rem;
    padding: .26rem .3rem;
    border-radius: 6px;
    color: #adbec5;
    font-size: .69rem;
}
.source-channel-row:hover { background: rgba(44, 63, 73, .48); }
.source-channel-row small { color: #708791; margin-left: auto; }
.source-symbol { width: 1.05rem; text-align: center; font-family: ui-monospace, monospace; }
.source-color-swatch {
    width: .62rem;
    height: .62rem;
    flex: 0 0 .62rem;
    border: 1px solid currentColor;
    border-radius: 2px;
    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255,255,255,.035);
}

.future-sources {
    border-top: 1px solid rgba(132, 163, 177, .13);
    margin-top: .5rem;
    padding-top: .45rem;
}
.future-source { display: flex; flex-direction: column; gap: .08rem; padding: .37rem .28rem; border-radius: 6px; }
.future-source small { color: #627983; font-size: .64rem; }
.disabled-source { color: #657780; opacity: .62; }
.empty-state { color: #788d96; font-size: .72rem; line-height: 1.5; padding: .5rem 0; }

.selection-inspector { padding-top: .15rem; }
.inspector-kind { color: #73c7eb; text-transform: uppercase; letter-spacing: .08em; font-size: .59rem; }
.inspector-title { font-size: .9rem; font-weight: 650; margin: .12rem 0 .5rem; }
.inspector-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .55rem; }
.inspector-title-row .inspector-title { min-width: 0; }
.inspector-action-button { padding: .24rem .46rem; font-size: .62rem; white-space: nowrap; }
.inspector-action-button.active {
    border-color: rgba(104, 214, 245, .72);
    background: rgba(52, 135, 166, .36);
    color: #d8f7ff;
}
.inspector-technical {
    margin-top: .55rem;
    border-top: 1px solid rgba(132, 163, 177, .16);
    padding-top: .42rem;
}
.inspector-technical summary {
    color: #78909a;
    font-size: .64rem;
    cursor: pointer;
    user-select: none;
}
.inspector-technical[open] summary { margin-bottom: .45rem; }
.inspector-section { border-top: 1px solid rgba(132, 163, 177, .16); padding-top: .48rem; margin-top: .48rem; }
.inspector-grid { display: grid; grid-template-columns: 6.8rem 1fr; gap: .27rem .48rem; font-size: .68rem; }
.inspector-grid dt { color: #738994; }
.inspector-grid dd { margin: 0; color: #c4d1d6; }
.inspector-sensors { margin: .25rem 0 0; padding-left: 1rem; color: #a9bbc2; font-size: .67rem; }

.inspector-section-title {
    margin-bottom: .42rem;
    color: #93a9b2;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.radar-hardware-list,
.radar-extractor-list {
    display: grid;
    gap: .38rem;
}
.radar-hardware-item,
.radar-extractor-item {
    padding: .42rem .48rem;
    border: 1px solid rgba(128, 159, 172, .15);
    border-radius: 8px;
    background: rgba(18, 31, 38, .38);
}
.radar-hardware-name {
    color: #d5e1e5;
    font-size: .69rem;
    font-weight: 650;
}
.radar-hardware-model {
    margin-top: .08rem;
    color: #a9bbc2;
    font-size: .68rem;
}
.radar-hardware-item small,
.radar-extractor-item small {
    display: block;
    margin-top: .12rem;
    color: #6f8791;
    font-size: .58rem;
}
.radar-extractor-item {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
}
.radar-extractor-item strong {
    color: #c7d7dd;
    font-size: .68rem;
    font-weight: 650;
}
.empty-state.compact { padding: .25rem 0; }

/*
 * Darkens only the cartography. The radar canvas and radar-site markers sit
 * above this layer, so plot/track colours keep their original luminosity.
 */
.map-dimmer {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity .16s ease;
}

/* Radar canvas sits over MapLibre but stays transparent and mouse-pass-through. */
.radar-overlay-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.radar-site-marker,
.atc-site-marker,
.nadge-site-marker {
    z-index: 5;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(231, 210, 132, .72);
    background: rgba(8, 18, 24, .88);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(244, 212, 119, .10), 0 3px 10px rgba(0,0,0,.35);
    color: #f4d477;
    cursor: pointer;
}
.radar-site-marker svg,
.atc-site-marker svg,
.nadge-site-marker svg {
    width: 22px;
    height: 22px;
    overflow: visible;
}
.radar-site-marker.selected,
.atc-site-marker.selected,
.nadge-site-marker.selected {
    border-color: #fff0a7;
    background: rgba(68, 58, 27, .94);
    box-shadow: 0 0 0 6px rgba(244, 212, 119, .22), 0 3px 12px rgba(0,0,0,.4);
}
.atc-site-marker {
    border-color: rgba(123, 210, 238, .82);
    color: #8fe1ff;
    box-shadow: 0 0 0 4px rgba(89, 190, 230, .11), 0 3px 10px rgba(0,0,0,.35);
}
.atc-site-marker.selected {
    border-color: #c8f3ff;
    background: rgba(19, 59, 74, .94);
    box-shadow: 0 0 0 6px rgba(89, 190, 230, .22), 0 3px 12px rgba(0,0,0,.4);
}


.nadge-site-marker {
    border-color: rgba(241, 195, 94, .88);
    color: #f0c35e;
    background: rgba(24, 22, 14, .92);
    border-radius: 7px;
    box-shadow: 0 0 0 4px rgba(241, 195, 94, .11), 0 3px 10px rgba(0,0,0,.38);
}
.nadge-site-marker.selected {
    border-color: #ffe3a0;
    background: rgba(72, 57, 22, .95);
    box-shadow: 0 0 0 6px rgba(241, 195, 94, .22), 0 3px 12px rgba(0,0,0,.42);
}

/* Compact analysis timeline. It is fixed to the viewport, uses a shared UTC
   ruler and a playhead crossing every source lane. */
.timeline-overlay {
    position: fixed;
    z-index: 34;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    min-width: 0;
    max-height: calc(100dvh - 20px);
    display: block;
    padding: .5rem .68rem .42rem;
    border-radius: 14px;
    overflow: auto;
    overscroll-behavior: contain;
    pointer-events: auto;
}
.timeline-content {
    position: relative;
    min-width: 0;
}
.timeline-axis-area {
    position: relative;
    min-width: 0;
}

/* One common UTC ruler for every source. */
.timeline-ruler-row {
    display: grid;
    grid-template-columns: var(--timeline-label-width) minmax(0, 1fr);
    gap: .38rem;
    height: 19px;
    align-items: end;
}
.timeline-ruler-spacer { min-width: 0; }
.timeline-ruler {
    position: relative;
    height: 19px;
    border-bottom: 1px solid rgba(123, 157, 171, .22);
}
.timeline-ruler-tick {
    position: absolute;
    bottom: -1px;
    width: 1px;
    height: 5px;
    background: rgba(146, 177, 190, .3);
    transform: translateX(-.5px);
}
.timeline-ruler-tick.major,
.timeline-ruler-tick.endpoint {
    height: 8px;
    background: rgba(174, 205, 218, .48);
}
.timeline-ruler-label {
    position: absolute;
    left: 0;
    bottom: 8px;
    transform: translateX(-50%);
    color: #718a95;
    font: .53rem ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: nowrap;
    pointer-events: none;
}
.timeline-ruler-tick.endpoint.start .timeline-ruler-label { transform: none; }
.timeline-ruler-tick.endpoint.end .timeline-ruler-label { transform: translateX(-100%); }

.timeline-lanes {
    display: grid;
    gap: .1rem;
    margin-top: .16rem;
}
.timeline-lane {
    display: grid;
    grid-template-columns: var(--timeline-label-width) minmax(0, 1fr);
    align-items: center;
    gap: .38rem;
    height: 12px;
}
.timeline-lane-label {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .55rem;
    color: #8ea2aa;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.timeline-lane-track {
    position: relative;
    height: 5px;
    border-radius: 999px;
    background: rgba(91, 116, 127, .17);
    overflow: visible;
}
.timeline-coverage-group {
    position: absolute;
    inset: 0;
}
.timeline-coverage-segment,
.timeline-presence-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    border-radius: inherit;
}
.timeline-coverage-segment { background: rgba(112, 144, 157, .42); }
.timeline-coverage-segment.active {
    background: linear-gradient(90deg, rgba(79, 174, 214, .7), rgba(113, 207, 242, .94));
    box-shadow: 0 0 8px rgba(95, 198, 236, .28);
}
.identity-lane { opacity: .98; }
.identity-label {
    color: #f3d58b;
    font-weight: 700;
}
.identity-track { background: rgba(118, 101, 53, .2); }
.timeline-presence-segment.itigi {
    background: linear-gradient(90deg, rgba(231, 188, 80, .72), rgba(255, 226, 143, .98));
    box-shadow: 0 0 8px rgba(244, 205, 105, .38);
}
.timeline-presence-segment.itigi::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    border: 1px solid rgba(255, 239, 191, .9);
    border-radius: 50%;
    background: #f4cd69;
    box-shadow: 0 0 7px rgba(244, 205, 105, .7);
    transform: translate(50%, -50%);
}
.timeline-presence-segment[hidden] { display: none; }

/* Future lanes stay in the common time system but consume little visual weight. */
.disabled-lane {
    height: 8px;
    opacity: .2;
}
.disabled-lane .timeline-lane-label { font-size: .48rem; }
.disabled-lane .timeline-lane-track { height: 2px; }

.timeline-toolbar {
    position: absolute;
    z-index: 10;
    right: .35rem;
    top: .24rem;
    display: flex;
    align-items: center;
    gap: .18rem;
}
.timeline-tool-button {
    min-width: 24px;
    height: 22px;
    padding: 0 .35rem;
    border: 1px solid rgba(120, 171, 192, .24);
    border-radius: 5px;
    background: rgba(8, 20, 27, .78);
    color: #b9dce9;
    font: 700 .68rem ui-monospace, SFMono-Regular, Consolas, monospace;
    cursor: pointer;
}
.timeline-tool-button:hover {
    background: rgba(20, 50, 63, .9);
    border-color: rgba(133, 205, 232, .48);
}
.timeline-fit-button { min-width: 34px; }
.timeline-zoom-label {
    min-width: 48px;
    text-align: right;
    color: #89aab7;
    font: 600 .52rem ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Transparent scrubber supplies pointer/keyboard seeking while the visual time
   reference comes from the shared playhead above. */
.timeline-scrubber-wrap {
    position: relative;
    min-width: 0;
    margin-left: calc(var(--timeline-label-width) + .38rem);
    margin-top: .12rem;
    height: 13px;
}
.timeline-scrubber {
    position: absolute;
    z-index: 8;
    inset: 0;
    width: 100%;
    height: 13px;
    margin: 0;
    opacity: .72;
    accent-color: var(--accent);
    cursor: ew-resize;
}
.timeline-scrubber::-webkit-slider-runnable-track {
    height: 2px;
    border-radius: 999px;
    background: rgba(120, 151, 164, .19);
}
.timeline-scrubber::-webkit-slider-thumb {
    margin-top: -4px;
}
.timeline-scrubber::-moz-range-track {
    height: 2px;
    border-radius: 999px;
    background: rgba(120, 151, 164, .19);
}

/* Current replay time: one line crossing ruler, lanes and scrubber. */
.timeline-playhead-layer {
    position: absolute;
    z-index: 7;
    left: calc(var(--timeline-label-width) + .38rem);
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}
.timeline-playhead {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(155, 224, 250, .78);
    box-shadow: 0 0 7px rgba(102, 200, 238, .42);
    transform: translateX(-.5px);
    will-change: left;
}
.timeline-playhead::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 17px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #bcecff;
    box-shadow: 0 0 7px rgba(151, 224, 251, .8);
    transform: translate(-50%, -50%);
}
.timeline-playhead-time {
    position: absolute;
    left: 50%;
    top: 0;
    padding: .06rem .26rem;
    border: 1px solid rgba(105, 190, 225, .28);
    border-radius: 4px;
    background: rgba(7, 18, 24, .94);
    color: #c9eefa;
    font: 600 .54rem ui-monospace, SFMono-Regular, Consolas, monospace;
    line-height: 1.25;
    white-space: nowrap;
    transform: translateX(-50%);
}

/* Accident reference spans the analytical part of the timeline and remains
   intentionally stronger than ordinary source coverage. */
.timeline-event-overlay {
    position: absolute;
    z-index: 6;
    left: calc(var(--timeline-label-width) + .38rem);
    right: 0;
    top: 19px;
    bottom: 13px;
    pointer-events: none;
}
.timeline-incident-band {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    border-left: 1px solid rgba(255, 121, 126, .5);
    border-right: 1px solid rgba(255, 121, 126, .5);
    background: linear-gradient(180deg, rgba(217, 65, 73, .22), rgba(217, 65, 73, .08));
    pointer-events: none;
}
.timeline-incident-marker {
    position: absolute;
    z-index: 5;
    top: -19px;
    bottom: -13px;
    width: 3px;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #ff7077;
    box-shadow: 0 0 12px rgba(255, 94, 102, .9), 0 0 2px rgba(255,255,255,.78);
    transform: translateX(-1.5px);
    cursor: pointer;
    pointer-events: auto;
}
.timeline-incident-marker::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 1px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #ff858b;
    filter: drop-shadow(0 0 4px rgba(255, 105, 112, .8));
    transform: translateX(-50%);
}
.timeline-incident-marker:hover:not(:disabled) {
    background: #ffadb0;
    border: 0;
}
.timeline-incident-marker span {
    position: absolute;
    left: 7px;
    top: -1px;
    padding: .08rem .3rem;
    border: 1px solid rgba(255, 125, 131, .5);
    border-radius: 5px;
    background: rgba(92, 24, 29, .97);
    color: #ffe2e3;
    font-size: .52rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .045em;
    white-space: nowrap;
    pointer-events: none;
}
.timeline-incident-marker[hidden],
.timeline-incident-band[hidden] { display: none; }

/* Map bootstrap / degradation message. */
.map-load-status {
    position: absolute;
    z-index: 40;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(80%, 620px);
    padding: .38rem .62rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: rgba(8, 16, 21, .86);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    backdrop-filter: blur(8px);
    color: #bfd0d6;
    font-size: .67rem;
    text-align: center;
    pointer-events: none;
}
.map-load-status[data-state="ready"] {
    opacity: 0;
    transition: opacity .65s ease 1s;
}
.map-load-status[data-state="fallback"] {
    border-color: rgba(218, 171, 77, .66);
    color: var(--warn);
}
.map-load-status[data-state="error"] {
    border-color: rgba(210, 88, 95, .7);
    color: var(--danger);
}

/* Diagnostics stays out of the way until explicitly opened. */
.diagnostics-panel {
    position: absolute;
    z-index: 36;
    right: 12px;
    left: auto;
    bottom: calc(var(--timeline-height) + 12px);
    transform: none;
    width: min(720px, calc(100vw - 24px));
    max-height: min(64vh, 660px);
    border-radius: 12px;
    overflow: hidden;
    pointer-events: auto;
}
.diagnostics-panel:not([open]) {
    width: auto;
    max-width: calc(100vw - 24px);
    background: rgba(9, 17, 22, .66);
}
.diagnostics-panel > summary {
    width: max-content;
    max-width: 100%;
    margin: 0 0 0 auto;
    padding: .32rem .58rem;
    color: #8299a3;
    font-size: .62rem;
    white-space: nowrap;
}
.diagnostics-panel[open] > summary {
    padding-right: .7rem;
}
.diagnostics-panel > summary::before { content: "▸ "; }
.diagnostics-panel[open] > summary::before { content: "▾ "; }
.diagnostics-content {
    max-height: calc(min(64vh, 660px) - 36px);
    overflow: auto;
    padding: .7rem;
    border-top: 1px solid rgba(137, 169, 184, .16);
    background: var(--glass-strong);
}
.diagnostics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.details dl {
    display: grid;
    grid-template-columns: 7.4rem 1fr;
    gap: .25rem .55rem;
    margin: .45rem 0 0;
    font-size: .65rem;
}
.details dt { color: #718792; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.diagnostic-seek { display: flex; align-items: center; gap: .45rem; margin-top: .7rem; }
.diagnostic-seek label { color: #788e97; font-size: .66rem; }
.diagnostic-seek input { min-width: 22rem; }
.log-panel { margin-top: .7rem; }
pre {
    margin: .4rem 0 0;
    min-height: 7rem;
    max-height: 14rem;
    overflow: auto;
    padding: .55rem;
    border-radius: 8px;
    background: rgba(3, 8, 11, .62);
    color: #aabdc4;
    white-space: pre-wrap;
    font-size: .62rem;
}

/* MapLibre chrome integrated in the dark HUD. */
.maplibregl-ctrl-top-right { top: 104px !important; right: 8px !important; }
.maplibregl-ctrl-bottom-left { bottom: calc(var(--timeline-height) + 18px) !important; left: 8px !important; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--timeline-height) + 18px) !important; right: 8px !important; }
.maplibregl-ctrl-group {
    background: rgba(11, 20, 25, .75) !important;
    border: 1px solid rgba(137, 169, 184, .22) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,.22) !important;
    backdrop-filter: blur(8px);
}
.maplibregl-ctrl button { filter: invert(.86); }
.maplibregl-ctrl-attrib {
    background: rgba(8, 15, 19, .68) !important;
    color: #7f949d !important;
    font-size: 10px !important;
}
.maplibregl-ctrl-attrib a { color: #9ccfe3 !important; }
.maplibregl-canvas { outline: none; }

@media (max-width: 1320px) {
    :root { --top-offset: 138px; }
    .map-tools { max-width: calc(100vw - 20px); top: 10px; right: 10px; }
    .map-tools-main { flex-wrap: wrap; }
    .replay-toolbar-group { flex: 1 1 100%; justify-content: flex-end; }
    .map-toolbar-separator { display: none; }
    .map-toolbar-group { margin-left: auto; }
    .sources-panel { width: 250px; }
    .inspector-panel { width: 270px; }
    .diagnostics-grid { grid-template-columns: 1fr 1fr; }
    .maplibregl-ctrl-top-right { top: 142px !important; }
}

@media (max-width: 860px) {
    :root {
        --timeline-height: 128px;
        --timeline-label-width: 70px;
        --top-offset: 202px;
    }
    .map-tools {
        top: 8px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        max-height: min(188px, 45dvh);
        overflow: auto;
        justify-items: stretch;
    }
    .map-tools-main,
    .replay-toolbar-group,
    .map-toolbar-group {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .workspace-clock { min-width: 150px; }
    .workspace-profile { flex: 1 1 250px; }
    .workspace-profile select { width: min(54vw, 290px); }
    .map-tools-meta { justify-content: flex-end; }
    .sources-panel { left: 10px; width: 230px; }
    .inspector-panel { right: 10px; width: 250px; }
    .timeline-overlay {
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        max-height: min(48dvh, 210px);
        padding: .5rem .56rem;
    }
    .diagnostics-panel { right: 8px; bottom: calc(var(--timeline-height) + 8px); width: min(720px, calc(100vw - 16px)); }
    .diagnostics-panel:not([open]) { width: auto; max-width: calc(100vw - 16px); }
    .maplibregl-ctrl-top-right { top: 196px !important; }
}

@media (max-width: 620px) {
    :root {
        --timeline-height: 132px;
        --timeline-label-width: 68px;
    }
    .workspace-profile { flex-basis: 100%; }
    .workspace-profile select { width: min(70vw, 270px); }
    .toolbar-transport { flex-wrap: wrap; justify-content: flex-end; }
    .map-toolbar-group { gap: .26rem; }
    .map-dimming-switch { padding-left: .22rem; }
    .map-tools-meta { flex-wrap: wrap; gap: .35rem .6rem; }
    .floating-panel[open] { width: calc(100vw - 20px); }
    .inspector-panel[open] { top: auto; bottom: calc(var(--timeline-height) + 16px); }
    .floating-panel:not([open]) { width: 150px; }
    .timeline-overlay {
        left: 6px;
        right: 6px;
        bottom: max(6px, env(safe-area-inset-bottom));
        max-height: min(52dvh, 220px);
    }
    .timeline-incident-marker span { font-size: .48rem; }
    .diagnostics-panel { right: 6px; width: calc(100vw - 12px); }
    .diagnostics-panel:not([open]) { width: auto; max-width: calc(100vw - 12px); }
    .diagnostics-grid { grid-template-columns: 1fr; }
    .diagnostic-seek { align-items: stretch; flex-direction: column; }
    .diagnostic-seek input { min-width: 0; width: 100%; }
}

@media (max-height: 620px) {
    :root { --top-offset: 112px; --timeline-height: 112px; }
    .map-tools-meta { padding-top: .12rem; font-size: .52rem; }
    .language-control select { padding-top: .14rem; padding-bottom: .14rem; }
    .floating-panel { max-height: calc(100dvh - var(--timeline-height) - 92px); }
    .timeline-overlay {
        max-height: 42dvh;
        padding-top: .42rem;
        padding-bottom: .42rem;
    }
    .timeline-lane { height: 10px; }
    .timeline-ruler-row, .timeline-ruler { height: 17px; }
}

@media (max-width: 520px) {
    .initial-loader-card { min-width: 0; width: 100%; padding: .85rem .9rem; gap: .8rem; }
    .initial-loader-radar { flex-basis: 50px; width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
    .initial-loader-sweep, .initial-loader-dot { animation: none; }
}

/* NADGE live replay source group. Individual radar systems are listed
   separately while visibility and time synchronization remain global. */
.nadge-source {
    border: 1px solid rgba(227, 204, 121, .2);
    background: rgba(79, 67, 32, .12);
    color: #d7dde0;
}
.nadge-source-header,
.nadge-source-header label,
.nadge-sync-control {
    display: flex;
    align-items: center;
    gap: .38rem;
}
.nadge-source-header {
    justify-content: space-between;
    font-size: .72rem;
    font-weight: 650;
}
.nadge-source-header small {
    color: #dbc878;
    font: 600 .62rem ui-monospace, SFMono-Regular, Consolas, monospace;
}
.nadge-sync-control {
    margin-top: .28rem;
    font-size: .66rem;
    color: #aebdc2;
}
.nadge-source > small {
    margin-left: 1.35rem;
}

/* NADGE inspector: evidenza compatta del Mode 3/A 1136 senza trasformarlo
   in una identificazione automatica della track. */
.nadge-identity-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: .08rem .36rem;
    border: 1px solid rgba(240, 211, 106, .48);
    border-radius: 999px;
    background: rgba(240, 211, 106, .10);
    color: #f5dda0;
    font: 700 .58rem ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .025em;
    white-space: nowrap;
}

/* NADGE multi-site (v16). The global source card keeps one visibility/sync
   control while exposing the individual radar systems beneath it. */
.nadge-source-systems {
    display: grid;
    gap: .12rem;
    margin: .28rem 0 .1rem 1.35rem;
}
.nadge-source-system-row {
    display: grid;
    grid-template-columns: 14px 7px minmax(0, 1fr) auto;
    align-items: center;
    gap: .32rem;
    min-height: 17px;
    color: #b7c3c7;
    font-size: .61rem;
}
.nadge-source-system-toggle {
    width: 12px;
    height: 12px;
    margin: 0;
}
.nadge-source-system-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    box-shadow: 0 0 5px currentColor;
}
.nadge-source-system-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nadge-source-system-row small {
    color: #879ba4;
    font: 500 .55rem ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Dynamic NADGE lanes are inserted into the timeline grid. */
.timeline-nadge-lanes { display: contents; }
.nadge-timeline-lane .timeline-lane-label { color: #cbbd7f; }
.timeline-track-presence-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    border-radius: inherit;
}
.timeline-track-presence-segment.nadge-track-presence-segment {
    background: repeating-linear-gradient(
        90deg,
        color-mix(in srgb, var(--nadge-lane-color, #f0d36a) 54%, transparent) 0 6px,
        transparent 6px 10px);
    opacity: .42;
}
.timeline-coverage-segment.nadge-coverage-segment {
    background: var(--nadge-lane-color, #f0d36a);
    opacity: .82;
    box-shadow: 0 0 7px color-mix(in srgb, var(--nadge-lane-color, #f0d36a) 35%, transparent);
}


/* v17 source panel hierarchy: general visibility is separate from the
   source-specific ATCAS/NADGE controls, with equal visual weight. */
.source-layer-group {
    margin-top: .32rem;
    padding-top: .42rem;
    border-top: 1px solid rgba(132, 163, 177, .13);
}
.source-layer-group-title {
    margin-bottom: .26rem;
    color: #91a6af;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .065em;
    text-transform: uppercase;
}
.compact-layer-switches {
    padding: .28rem 0 .34rem;
    border-top: 0;
    border-bottom: 0;
}
.atcas-source-group .source-tree {
    padding-top: .12rem;
}
.future-sources {
    margin-top: .38rem;
}
.nadge-source {
    padding: .44rem .34rem;
}
.nadge-source-header,
.source-system-header {
    min-height: 24px;
    font-size: .72rem;
    font-weight: 650;
}
.nadge-layer-controls {
    display: grid;
    gap: .18rem;
    margin: .24rem 0 .1rem 1.35rem;
    color: #aebdc2;
    font-size: .66rem;
}
.nadge-layer-controls label {
    display: flex;
    align-items: center;
    gap: .38rem;
}

/* NADGE THR-derived event history. */
.nadge-events-note {
    margin: -.08rem 0 .42rem;
    color: #6f8791;
    font-size: .59rem;
    line-height: 1.4;
}
.nadge-event-list {
    display: grid;
    gap: .34rem;
}
.nadge-event-item {
    display: grid;
    grid-template-columns: 7.7rem minmax(0, 1fr);
    gap: .08rem .42rem;
    padding: .36rem .42rem;
    border: 1px solid rgba(128, 159, 172, .14);
    border-radius: 7px;
    background: rgba(18, 31, 38, .32);
}
.nadge-event-time {
    grid-row: 1 / span 3;
    color: #708791;
    font: .56rem ui-monospace, SFMono-Regular, Consolas, monospace;
}
.nadge-event-name {
    color: #cbd8dd;
    font-size: .65rem;
    font-weight: 650;
}
.nadge-event-change {
    color: #9fb2ba;
    font: .6rem ui-monospace, SFMono-Regular, Consolas, monospace;
}
.nadge-event-item small {
    color: #637b85;
    font-size: .54rem;
}
.nadge-inspector-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .25rem;
}
.nadge-simulation-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: .08rem .36rem;
    border: 1px dashed rgba(184, 204, 212, .52);
    border-radius: 999px;
    background: rgba(157, 180, 190, .08);
    color: #c3d2d8;
    font: 750 .56rem ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .045em;
    white-space: nowrap;
}
.nadge-quality-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: .08rem .36rem;
    border: 1px solid rgba(255, 209, 102, .52);
    border-radius: 999px;
    background: rgba(255, 209, 102, .10);
    color: #ffe19a;
    font: 700 .56rem ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: nowrap;
}
.nadge-quality-badge.q1 {
    border-color: rgba(255, 159, 67, .62);
    background: rgba(255, 159, 67, .12);
    color: #ffc078;
}
.nadge-quality-badge.q0 {
    border-color: rgba(255, 107, 107, .7);
    background: rgba(255, 107, 107, .13);
    color: #ff9a9a;
}

/* v18 diagnostic layers and functionally grouped timeline. */
:root { --timeline-height: 188px; }

.diagnostic-layer-toggle {
    color: #c7a8bb;
}
.diagnostic-layer-toggle input:checked + span {
    color: #f1c2da;
    text-shadow: 0 0 7px rgba(255, 111, 181, .18);
}

.diagnostic-section {
    border-color: rgba(238, 153, 91, .22);
    background: rgba(38, 25, 18, .16);
}
.diagnostic-note {
    margin: -.08rem 0 .42rem;
    color: #80949c;
    font-size: .58rem;
    line-height: 1.4;
}
.side-lobe-diagnostic {
    border-left: 2px solid rgba(255, 111, 181, .62);
    padding-left: .52rem;
}
.kinematic-diagnostic-item.medium { border-left: 2px solid rgba(255, 180, 92, .72); }
.kinematic-diagnostic-item.high { border-left: 2px solid rgba(255, 95, 87, .82); }

.timeline-groups {
    display: grid;
    gap: .22rem;
    margin-top: .16rem;
}
.timeline-group {
    display: grid;
    gap: .07rem;
    padding-top: .12rem;
    border-top: 1px solid rgba(125, 157, 171, .09);
}
.timeline-group:first-child { border-top: 0; padding-top: 0; }
.timeline-group-title {
    height: 9px;
    padding-left: .08rem;
    color: #536c77;
    font-size: .46rem;
    font-weight: 750;
    letter-spacing: .075em;
    line-height: 9px;
    text-transform: uppercase;
    white-space: nowrap;
}
.timeline-group-lanes {
    display: grid;
    gap: .08rem;
}
.timeline-nadge-lanes { display: contents; }
.scenario-events-group .timeline-group-title { color: #815f63; }
.identity-group .timeline-group-title { color: #74684c; }
.evidence-group { opacity: .72; }

.incident-track {
    height: 5px;
    background: rgba(123, 58, 62, .18);
    overflow: visible;
}
.timeline-incident-band {
    top: -2px;
    bottom: -2px;
    border-left: 1px solid rgba(255, 121, 126, .5);
    border-right: 1px solid rgba(255, 121, 126, .5);
    border-radius: 3px;
    background: rgba(217, 65, 73, .22);
}
.timeline-incident-marker {
    top: 50%;
    bottom: auto;
    width: 3px;
    height: 15px;
    transform: translate(-1.5px, -50%);
}
.timeline-incident-marker::after {
    top: -1px;
}
.timeline-incident-marker span {
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 860px) {
    :root { --timeline-height: 198px; }
}
@media (max-width: 620px) {
    :root { --timeline-height: 208px; }
    .timeline-group-title { font-size: .43rem; }
}
@media (max-height: 620px) {
    :root { --timeline-height: 158px; }
    .timeline-group-title { display: none; }
    .timeline-groups { gap: .08rem; }
    .timeline-group { padding-top: .04rem; }
}

/* v19 compact source layout, draggable timeline viewport and NADGE follow UI. */
.sources-panel { width: 304px; }
.sources-panel .floating-panel-content {
    padding: .46rem .56rem .56rem;
}
.sources-panel .panel-action-row { padding-bottom: .28rem; }
.sources-panel .source-layer-group {
    margin-top: .20rem;
    padding-top: .28rem;
}
.sources-panel .source-layer-group-title { margin-bottom: .16rem; }
.sources-panel .compact-layer-switches {
    gap: .18rem .38rem;
    padding: .16rem 0 .20rem;
    font-size: .67rem;
}
.sources-panel .source-tree { padding-top: .04rem; }
.sources-panel .source-system {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .28rem;
    margin-bottom: .12rem;
}
.sources-panel .source-system-header {
    grid-column: 1 / -1;
    min-height: 20px;
    padding: .14rem 0;
}
.sources-panel .physical-radar-group {
    min-width: 0;
    margin: 0;
    padding: .22rem .28rem;
    border: 1px solid rgba(114, 148, 163, .20);
    border-left-width: 1px;
    border-radius: 7px;
    background: rgba(17, 29, 36, .22);
}
.sources-panel .physical-radar-header {
    min-width: 0;
    padding: .08rem 0 .14rem;
    font-size: .66rem;
}
.sources-panel .physical-radar-header span,
.sources-panel .source-channel-row > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sources-panel .source-channel-row {
    min-width: 0;
    margin-left: 0;
    padding: .13rem .08rem;
    gap: .24rem;
    font-size: .62rem;
}
.sources-panel .source-color-swatch {
    width: .50rem;
    height: .50rem;
    flex-basis: .50rem;
}
.sources-panel .future-sources {
    margin-top: .24rem;
    padding-top: .24rem;
}
.sources-panel .nadge-source { padding: .30rem .30rem; }
.sources-panel .nadge-layer-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .16rem .38rem;
    margin: .18rem 0 .08rem;
    font-size: .67rem;
}
.sources-panel .nadge-layer-controls label {
    min-width: 0;
    gap: .34rem;
    line-height: 1.2;
}
.sources-panel .nadge-layer-controls .diagnostic-layer-toggle { grid-column: 1 / -1; }

/* I due siti NADGE usano la stessa griglia a due colonne dei controlli
   immediatamente sopra. Ogni voce e' poi una riga flex: checkbox, indicatore
   colore e nome condividono cosi lo stesso asse verticale. */
.sources-panel .nadge-source-systems {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .16rem .38rem;
    margin: .16rem 0 .08rem;
}
.sources-panel .nadge-source-system-row {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 20px;
    margin: 0;
    padding: 0;
    gap: .34rem;
    color: #b7c3c7;
    font-size: .67rem;
    line-height: 1.2;
}
.sources-panel .nadge-source-system-dot {
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    margin: 0;
}
.sources-panel .nadge-source-system-name {
    min-width: 0;
    line-height: 1.2;
}
.sources-panel .nadge-source-system-row small { display: none; }

/* Uniformiamo dimensione e centratura dei checkbox del pannello sorgenti.
   Su mobile la regola dei touch target puo' portarli a 18px, ma resta comune
   a ATCAS e NADGE. */
.sources-panel .source-master-toggle,
.sources-panel .physical-radar-toggle,
.sources-panel .source-channel-toggle,
.sources-panel .nadge-system-toggle {
    width: 13px;
    height: 13px;
    margin: 0;
    flex: 0 0 auto;
    align-self: center;
}
.sources-panel .nadge-sync-control {
    margin-top: .16rem;
    gap: .34rem;
    font-size: .67rem;
    line-height: 1.2;
}
.sources-panel .nadge-source > small {
    display: block;
    margin: .04rem 0 0 1.24rem;
    font-size: .56rem;
}
.sources-panel .disabled-source {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: .35rem;
    padding: .20rem .20rem;
}
.sources-panel .disabled-source small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .56rem;
}

.timeline-axis-area { touch-action: none; }
.timeline-ruler,
.timeline-lane-track,
.timeline-groups { cursor: grab; }
.timeline-overlay.timeline-panning .timeline-axis-area,
.timeline-overlay.timeline-panning .timeline-ruler,
.timeline-overlay.timeline-panning .timeline-lane-track,
.timeline-overlay.timeline-panning .timeline-groups {
    cursor: grabbing;
    user-select: none;
}
.timeline-overlay.timeline-panning .timeline-scrubber { cursor: grabbing; }

.nadge-inspector-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .28rem;
}

/* v19.2: state projection resilient to Blazor DOM reconciliation and a
   persistent minimal timeline mode. */
html[data-map-dimming="clear"] .map-dimming-button[data-map-dimming="clear"],
html[data-map-dimming="radar"] .map-dimming-button[data-map-dimming="radar"],
html[data-map-dimming="dark"] .map-dimming-button[data-map-dimming="dark"] {
    border-color: rgba(102, 200, 238, .74);
    background: rgba(30, 83, 105, .68);
    color: #d8f4ff;
    box-shadow: inset 0 0 0 1px rgba(102, 200, 238, .12);
}

.timeline-expand-button {
    display: none;
    position: absolute;
    z-index: 15;
    top: .24rem;
    right: .32rem;
    min-width: 26px;
    padding: 0 .30rem;
}

html.timeline-compact-mode {
    --timeline-height: 58px;
    --timeline-label-width: 0px;
}
html.timeline-compact-mode .timeline-overlay {
    padding: .34rem .54rem .28rem;
    border-radius: 10px;
    overflow: hidden;
}
html.timeline-compact-mode .timeline-toolbar,
html.timeline-compact-mode .timeline-groups {
    display: none;
}
html.timeline-compact-mode .timeline-expand-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
html.timeline-compact-mode .timeline-ruler-row {
    grid-template-columns: 0 minmax(0, 1fr);
    gap: 0;
    height: 19px;
}
html.timeline-compact-mode .timeline-scrubber-wrap {
    margin-left: 0;
    margin-right: 30px;
    margin-top: .10rem;
}
html.timeline-compact-mode .timeline-axis-area {
    min-height: 36px;
}
html.timeline-compact-mode .timeline-ruler {
    margin-right: 30px;
}
html.timeline-compact-mode .timeline-playhead-layer {
    left: 0;
    right: 30px;
}

@media (max-width: 860px), (max-height: 620px) {
    html.timeline-compact-mode { --timeline-height: 58px; }
}

/* v21 scenario catalog + synchronized media timeline. Scenario markers come
   from scenario_entity_locations; radar phase centres remain technical markers. */
.scenario-entity-marker {
    z-index: 5;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(175, 196, 205, .72);
    background: rgba(12, 23, 29, .88);
    border-radius: 8px;
    box-shadow: 0 0 0 3px rgba(154, 184, 196, .08), 0 3px 10px rgba(0,0,0,.34);
    color: #b8d2dc;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.scenario-entity-marker svg { width: 19px; height: 19px; overflow: visible; }
.scenario-entity-marker.selected {
    border-color: #d9f4ff;
    color: #e8f9ff;
    background: rgba(30, 67, 80, .94);
    box-shadow: 0 0 0 5px rgba(113, 205, 236, .18), 0 3px 12px rgba(0,0,0,.4);
}
.radar-site-marker.active-participant,
.atc-site-marker.active-participant,
.nadge-site-marker.active-participant,
.scenario-entity-marker.active-participant {
    border-color: #f5f0b1;
    box-shadow: 0 0 0 7px rgba(242, 227, 117, .25), 0 0 18px rgba(242, 227, 117, .36);
}

.communications-source { opacity: 1; }
.communications-source-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.communications-source-header small {
    color: #a8cbd8;
    font: 600 .62rem ui-monospace, SFMono-Regular, Consolas, monospace;
}
.media-autoplay-control {
    display: flex;
    align-items: center;
    gap: .38rem;
    margin-top: .3rem;
    color: #aebdc2;
    font-size: .63rem;
}
#mediaPlaybackStatus {
    display: block;
    margin-top: .18rem;
    color: #8197a0;
    font: 500 .55rem ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-event-track { overflow: visible; }
.timeline-media-events {
    position: absolute;
    inset: 0;
    display: block;
}
.timeline-media-event,
.timeline-media-segment {
    position: absolute;
    top: 50%;
    height: 6px;
    min-width: 2px;
    transform: translateY(-50%);
    border-radius: 2px;
}
.timeline-media-event {
    padding: 0;
    border: 1px solid rgba(255,255,255,.16);
    cursor: pointer;
    opacity: .9;
}
.timeline-media-event:hover { height: 9px; opacity: 1; z-index: 3; }
.timeline-media-event.radio { background: rgba(99, 190, 221, .86); }
.timeline-media-event.telephone { background: rgba(202, 166, 102, .86); }
.timeline-media-event.cockpit { background: rgba(200, 119, 128, .88); }
.timeline-media-event.other { background: rgba(162, 177, 184, .75); }
.timeline-media-event.manual {
    background: transparent;
    border-style: dashed;
    border-color: rgba(191, 204, 210, .72);
}
.timeline-media-segment {
    height: 3px;
    background: rgba(171, 195, 204, .72);
    pointer-events: none;
}
.timeline-media-segment.manual { opacity: .42; }
.timeline-media-segment.autoplay { box-shadow: 0 0 5px rgba(171, 195, 204, .24); }

.timeline-anchored-media {
    position: absolute;
    top: 50%;
    height: 5px;
    min-width: 2px;
    transform: translateY(-50%);
    padding: 0;
    border: 1px dashed rgba(225, 194, 124, .82);
    border-radius: 2px;
    background: rgba(225, 194, 124, .18);
    cursor: pointer;
    z-index: 2;
}
.timeline-anchored-media:hover { height: 9px; background: rgba(225, 194, 124, .32); }
.timeline-media-anchor {
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 1px;
    background: rgba(248, 222, 151, .95);
    box-shadow: 0 0 4px rgba(248, 222, 151, .7);
    pointer-events: none;
    z-index: 4;
}

/* v21.2: marker stability, participant pulse and media-type waveform lanes. */
.scenario-entity-marker {
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.scenario-entity-marker.scenario-radar-site {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border-color: rgba(170, 181, 186, .82);
    color: #aeb9bd;
    background: rgba(22, 25, 27, .92);
    box-shadow: 0 0 0 4px rgba(170, 181, 186, .09), 0 3px 10px rgba(0,0,0,.38);
}
.scenario-entity-marker.scenario-radar-site svg { width: 22px; height: 22px; }

.radar-site-marker.active-participant,
.atc-site-marker.active-participant,
.nadge-site-marker.active-participant,
.scenario-entity-marker.active-participant {
    border-color: #f5f0b1;
    animation: scenario-participant-pulse 1.15s ease-in-out infinite;
}
@keyframes scenario-participant-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(242, 227, 117, .16), 0 0 10px rgba(242, 227, 117, .20), 0 3px 10px rgba(0,0,0,.35); }
    50% { box-shadow: 0 0 0 9px rgba(242, 227, 117, .28), 0 0 24px rgba(242, 227, 117, .52), 0 3px 12px rgba(0,0,0,.4); }
}

.media-kind-lanes { gap: .14rem; }
.media-kind-lanes .timeline-lane { height: 17px; }
.media-kind-lanes .timeline-lane-track { height: 12px; border-radius: 3px; }
.media-kind-label {
    display: flex;
    align-items: center;
    gap: .28rem;
}
.media-kind-glyph {
    display: inline-grid;
    place-items: center;
    min-width: 14px;
    color: #9eb4bc;
    font: 700 .58rem ui-monospace, SFMono-Regular, Consolas, monospace;
}
.media-kind-glyph.cvr {
    min-width: 18px;
    font-size: .46rem;
    letter-spacing: .02em;
}
.timeline-media-event,
.timeline-anchored-media {
    top: 50%;
    height: 12px;
    min-width: 3px;
    transform: translateY(-50%);
    overflow: hidden;
    border-radius: 3px;
}
.timeline-media-event:hover,
.timeline-anchored-media:hover { height: 15px; opacity: 1; z-index: 5; }
.timeline-media-event.radio { color: rgba(124, 214, 241, .92); background: rgba(55, 111, 132, .32); }
.timeline-media-event.telephone { color: rgba(231, 194, 126, .92); background: rgba(122, 91, 43, .31); }
.timeline-media-event.cockpit,
.timeline-anchored-media.cockpit { color: rgba(235, 150, 160, .94); background: rgba(124, 62, 72, .30); }
.timeline-media-event.manual,
.timeline-anchored-media.manual {
    background: rgba(40, 48, 51, .18);
    border-style: dashed;
    opacity: .78;
}
.timeline-waveform {
    position: absolute;
    inset: 1px;
    width: calc(100% - 2px);
    height: calc(100% - 2px);
    pointer-events: none;
    opacity: .92;
}
.timeline-waveform polygon { fill: currentColor; }
.timeline-media-anchor {
    top: 0;
    bottom: 0;
}
.scenario-description-section .diagnostic-note {
    font-size: .68rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* v21.4: condensed media timeline, I-TIGI presence backdrop and map marker decluttering. */
:root { --timeline-height: 144px; }

.timeline-scenario-overlay {
    position: absolute;
    z-index: 6;
    left: calc(var(--timeline-label-width) + .38rem);
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
}
.timeline-presence-backdrop {
    position: absolute;
    z-index: 0;
    top: 19px;
    bottom: 13px;
    left: 0;
    width: 0;
    border-left: 1px solid rgba(241, 205, 105, .16);
    border-right: 1px solid rgba(241, 205, 105, .16);
    background: linear-gradient(180deg, rgba(241, 205, 105, .075), rgba(241, 205, 105, .035));
    box-shadow: inset 0 0 14px rgba(241, 205, 105, .025);
    pointer-events: none;
}
.timeline-presence-backdrop[hidden] { display: none; }

.timeline-incident-marker-full {
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    transform: translateX(-1.5px) !important;
    pointer-events: auto;
}
.timeline-incident-marker-full::after { top: 18px; }
.timeline-incident-marker-full span {
    top: 18px;
    transform: none;
}

.evidence-group { opacity: 1; }
.audio-timeline-group .timeline-group-title { color: #718790; }
.combined-media-lane { height: 34px; }
.combined-media-track {
    height: 34px !important;
    border-radius: 5px !important;
    overflow: visible;
    background: rgba(67, 85, 93, .13);
}
.audio-lane-label { color: transparent; }
.timeline-media-events { overflow: visible; }

.combined-media-track .timeline-media-event,
.combined-media-track .timeline-anchored-media {
    top: calc(2px + (var(--media-stack, 0) * 16px));
    height: 14px;
    transform: none;
    min-width: 3px;
    border-radius: 3px;
    overflow: hidden;
}
.combined-media-track .timeline-media-event:hover,
.combined-media-track .timeline-anchored-media:hover {
    height: 15px;
    z-index: 8;
}
.combined-media-track .timeline-media-event.radio {
    color: rgba(109, 220, 247, .97);
    background: rgba(30, 104, 132, .40);
    border-color: rgba(109, 220, 247, .36);
}
.combined-media-track .timeline-media-event.telephone {
    color: rgba(245, 195, 102, .98);
    background: rgba(121, 82, 24, .40);
    border-color: rgba(245, 195, 102, .34);
}
.combined-media-track .timeline-media-event.cockpit,
.combined-media-track .timeline-anchored-media.cockpit {
    color: rgba(245, 139, 157, .98);
    background: rgba(119, 44, 61, .42);
    border-color: rgba(245, 139, 157, .36);
}
.combined-media-track .timeline-media-event.manual,
.combined-media-track .timeline-anchored-media.manual {
    background: rgba(31, 39, 43, .22);
    border-style: dashed;
}

.timeline-media-kind-icon {
    position: absolute;
    z-index: 4;
    left: 1px;
    top: 50%;
    width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border-radius: 2px;
    background: rgba(4, 12, 16, .72);
    color: currentColor;
    transform: translateY(-50%);
    pointer-events: none;
}
.timeline-media-kind-icon svg {
    width: 13px;
    height: 13px;
    display: block;
}
.timeline-cvr-glyph {
    font: 800 .38rem ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: -.02em;
}
.combined-media-track .timeline-waveform {
    left: 18px;
    right: 1px;
    width: auto;
    top: 1px;
    bottom: 1px;
    height: auto;
}
.combined-media-track .timeline-media-anchor {
    top: 0;
    bottom: 0;
    z-index: 7;
}

@media (max-width: 860px) {
    :root { --timeline-height: 152px; }
}
@media (max-width: 620px) {
    :root { --timeline-height: 158px; }
}
@media (max-height: 620px) {
    :root { --timeline-height: 132px; }
}

/* v21.5: one true audio lane and priority-based marker layering. */
:root { --timeline-height: 158px; }

.audio-timeline-group {
    gap: 0;
    padding-top: .08rem;
    border-top-color: rgba(125, 157, 171, .07);
}
.audio-timeline-group .timeline-group-title {
    display: none;
    height: 0;
    margin: 0;
    padding: 0;
}
.audio-timeline-group .timeline-group-lanes { gap: 0; }
.combined-media-lane { height: 48px; }
.combined-media-track {
    height: 46px !important;
    border-radius: 5px !important;
    overflow: visible;
    background: rgba(67, 85, 93, .12);
    box-shadow: inset 0 0 0 1px rgba(129, 159, 172, .06);
}

/* Every audio item shares the same vertical lane. True temporal overlaps are
   intentionally drawn on top of each other instead of being moved to rows. */
.combined-media-track .timeline-media-event,
.combined-media-track .timeline-anchored-media {
    top: 4px;
    bottom: auto;
    height: 38px;
    transform: none;
    min-width: 4px;
    border-radius: 4px;
    overflow: hidden;
    opacity: .94;
}
.combined-media-track .timeline-media-event:hover,
.combined-media-track .timeline-anchored-media:hover {
    height: 38px;
    opacity: 1;
    z-index: 8;
    filter: brightness(1.12);
}
.combined-media-track .timeline-media-event.radio {
    color: rgba(105, 222, 250, .98);
    background: rgba(29, 92, 115, .20);
    border-color: rgba(105, 222, 250, .40);
}
.combined-media-track .timeline-media-event.telephone {
    color: rgba(247, 195, 95, .98);
    background: rgba(114, 76, 20, .20);
    border-color: rgba(247, 195, 95, .38);
}
.combined-media-track .timeline-media-event.cockpit,
.combined-media-track .timeline-anchored-media.cockpit {
    color: rgba(247, 135, 157, .98);
    background: rgba(112, 40, 57, .22);
    border-color: rgba(247, 135, 157, .40);
}
.combined-media-track .timeline-media-event.manual,
.combined-media-track .timeline-anchored-media.manual {
    background: rgba(31, 39, 43, .12);
    border-style: dashed;
}

/* The waveform owns almost the whole clip. The type glyph is deliberately
   tiny and overlays its first samples instead of reserving a large blank area. */
.combined-media-track .timeline-waveform {
    inset: 2px 1px;
    left: 1px;
    right: 1px;
    width: auto;
    height: auto;
    opacity: .96;
}
.timeline-media-kind-icon {
    z-index: 5;
    left: 2px;
    top: 3px;
    width: 10px;
    height: 10px;
    transform: none;
    border: 1px solid color-mix(in srgb, currentColor 38%, transparent);
    border-radius: 2px;
    background: rgba(5, 13, 17, .60);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .30);
    opacity: .92;
}
.timeline-media-kind-icon svg {
    width: 8px;
    height: 8px;
}
.timeline-cvr-glyph {
    font: 800 .29rem ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: -.035em;
}
.combined-media-track .timeline-media-anchor {
    top: 0;
    bottom: 0;
    z-index: 9;
}

/* Marker priority is now depth, not visibility. Low-priority nearby entities
   remain on the map but recede visually behind the higher-priority marker. */
.radar-site-marker.marker-secondary,
.atc-site-marker.marker-secondary,
.nadge-site-marker.marker-secondary,
.scenario-entity-marker.marker-secondary {
    opacity: .68;
    filter: saturate(.68) brightness(.86);
}
.radar-site-marker.selected,
.atc-site-marker.selected,
.nadge-site-marker.selected,
.scenario-entity-marker.selected,
.radar-site-marker.active-participant,
.atc-site-marker.active-participant,
.nadge-site-marker.active-participant,
.scenario-entity-marker.active-participant {
    opacity: 1;
    filter: none;
}

@media (max-width: 860px) {
    :root { --timeline-height: 166px; }
    .combined-media-lane { height: 44px; }
    .combined-media-track { height: 42px !important; }
    .combined-media-track .timeline-media-event,
    .combined-media-track .timeline-anchored-media { height: 34px; }
}
@media (max-width: 620px) {
    :root { --timeline-height: 172px; }
}
@media (max-height: 620px) {
    :root { --timeline-height: 142px; }
    .combined-media-lane { height: 38px; }
    .combined-media-track { height: 36px !important; }
    .combined-media-track .timeline-media-event,
    .combined-media-track .timeline-anchored-media { top: 3px; height: 30px; }
}

/* v21.6: waveform-only audio lane. No per-clip card/box; the waveform itself
   is the visual encoding and keeps its true temporal width while zooming. */
.audio-timeline-group {
    padding-top: 0;
    border-top-color: rgba(125, 157, 171, .05);
}
.combined-media-lane { height: 54px; }
.combined-media-track {
    height: 52px !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
}
.combined-media-track .timeline-media-event,
.combined-media-track .timeline-anchored-media {
    top: 4px;
    height: 44px;
    min-width: 2px;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
    opacity: .96;
}
.combined-media-track .timeline-media-event:hover,
.combined-media-track .timeline-anchored-media:hover {
    height: 44px;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1;
    filter: brightness(1.18);
    z-index: 8;
}
.combined-media-track .timeline-media-event.radio {
    color: rgba(92, 213, 247, .98);
    background: transparent !important;
}
.combined-media-track .timeline-media-event.telephone {
    color: rgba(247, 190, 78, .98);
    background: transparent !important;
}
.combined-media-track .timeline-media-event.cockpit,
.combined-media-track .timeline-anchored-media.cockpit {
    color: rgba(244, 128, 153, .98);
    background: transparent !important;
}
.combined-media-track .timeline-media-event.manual,
.combined-media-track .timeline-anchored-media.manual {
    background: transparent !important;
    border: 0 !important;
    opacity: .62;
}
.combined-media-track .timeline-media-event.manual .timeline-waveform,
.combined-media-track .timeline-anchored-media.manual .timeline-waveform {
    opacity: .62;
}
.combined-media-track .timeline-waveform {
    position: absolute;
    inset: 1px 0;
    width: 100%;
    height: calc(100% - 2px);
    opacity: .94;
    overflow: visible;
    pointer-events: none;
}
.combined-media-track .timeline-waveform polygon {
    fill: currentColor;
}
/* Tiny semantic badge: it overlays only the first few pixels and never reserves
   horizontal waveform space. */
.combined-media-track .timeline-media-kind-icon {
    z-index: 6;
    left: 1px;
    top: 2px;
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: .82;
    filter: drop-shadow(0 1px 1px rgba(2, 8, 11, .88));
}
.combined-media-track .timeline-media-kind-icon svg {
    width: 9px;
    height: 9px;
}
.combined-media-track .timeline-cvr-glyph {
    font: 800 .28rem ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: -.045em;
    text-shadow: 0 1px 1px rgba(2, 8, 11, .9);
}

@media (max-width: 860px) {
    .combined-media-lane { height: 48px; }
    .combined-media-track { height: 46px !important; }
    .combined-media-track .timeline-media-event,
    .combined-media-track .timeline-anchored-media,
    .combined-media-track .timeline-media-event:hover,
    .combined-media-track .timeline-anchored-media:hover { top: 3px; height: 40px; }
}
@media (max-height: 620px) {
    .combined-media-lane { height: 42px; }
    .combined-media-track { height: 40px !important; }
    .combined-media-track .timeline-media-event,
    .combined-media-track .timeline-anchored-media,
    .combined-media-track .timeline-media-event:hover,
    .combined-media-track .timeline-anchored-media:hover { top: 3px; height: 34px; }
}

/* v22: compact active-media status, provenance badges and persistent panels. */
.media-now-playing {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .34rem;
    margin-top: .32rem;
    padding-top: .28rem;
    border-top: 1px solid rgba(127, 157, 169, .12);
    min-width: 0;
}
.media-now-playing[hidden] { display: none; }
.media-now-playing-kind {
    min-width: 18px;
    color: #9fd8ec;
    font: 700 .52rem ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center;
}
.media-now-playing-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #c2d3da;
    font-size: .6rem;
}
.media-now-playing-progress {
    color: #839aa4;
    font: 500 .54rem ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: nowrap;
}
.inspector-provenance-summary {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: .42rem;
}
.evidence-badge {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    padding: 0 .38rem;
    border: 1px solid rgba(134, 169, 183, .28);
    border-radius: 999px;
    background: rgba(74, 100, 111, .15);
    color: #acc5cf;
    font: 700 .51rem ui-monospace, SFMono-Regular, Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: .045em;
}
.evidence-badge.evidence-documented { color: #a9d9b8; border-color: rgba(127, 192, 149, .32); }
.evidence-badge.evidence-inferred { color: #e3c78f; border-color: rgba(211, 173, 101, .34); }
.evidence-badge.evidence-derived { color: #a9c9e3; border-color: rgba(119, 167, 205, .34); }
.evidence-datum { color: #728993; font: 500 .52rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.inspector-provenance {
    margin-top: .34rem;
    border-top: 1px solid rgba(132, 163, 177, .10);
    padding-top: .3rem;
    color: #8fa5ae;
    font-size: .61rem;
}
.inspector-provenance summary { cursor: pointer; color: #8faab5; }
.inspector-provenance a { display: inline-block; margin-top: .28rem; color: #7fc4df; }


/* v22.3: ATCAS primary-quality readout and clearer media-kind labels. */
.atcas-quality-readout {
    display: grid;
    grid-template-columns: minmax(82px, auto) minmax(72px, 118px);
    align-items: center;
    gap: .45rem;
    min-width: 170px;
}
.atcas-quality-value {
    display: inline-flex;
    align-items: baseline;
    gap: .34rem;
    white-space: nowrap;
}
.atcas-quality-value strong {
    font: 700 .69rem ui-monospace, SFMono-Regular, Consolas, monospace;
    color: #dce8ec;
}
.atcas-quality-value span {
    font: 650 .61rem ui-monospace, SFMono-Regular, Consolas, monospace;
    color: #9eb0b8;
}
.atcas-quality-meter {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(111, 136, 147, .18);
    box-shadow: inset 0 0 0 1px rgba(155, 178, 187, .10);
}
.atcas-quality-fill {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 1px;
    border-radius: inherit;
    background: #d7b75c;
}
.atcas-quality-meter.below-threshold .atcas-quality-fill { background: #d76d64; }
.atcas-quality-meter.nominal .atcas-quality-fill { background: #d7b75c; }
.atcas-quality-meter.high .atcas-quality-fill { background: #79bd8a; }
.atcas-quality-threshold {
    position: absolute;
    top: -1px;
    bottom: -1px;
    width: 1px;
    background: rgba(235, 244, 247, .80);
    box-shadow: 0 0 2px rgba(0, 0, 0, .65);
}

/* Keep the waveform temporally aligned with the true audio start. The semantic
   badge sits immediately before that start, instead of covering its first peaks. */
.combined-media-track .timeline-media-event,
.combined-media-track .timeline-anchored-media {
    overflow: visible;
}
.combined-media-track .timeline-waveform {
    z-index: 2;
}
.combined-media-track .timeline-media-kind-icon {
    left: -20px;
    top: 50%;
    width: 17px;
    height: 17px;
    padding: 2px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, currentColor 42%, transparent);
    border-radius: 4px;
    background: rgba(5, 13, 17, .88);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .48);
    opacity: 1;
    filter: none;
    pointer-events: none;
}
.combined-media-track .timeline-media-kind-icon svg {
    width: 13px;
    height: 13px;
}
.combined-media-track .timeline-media-kind-icon.cockpit {
    width: 25px;
    left: -28px;
    padding-left: 3px;
    padding-right: 3px;
}
.combined-media-track .timeline-cvr-glyph {
    font: 800 .48rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: -.025em;
    text-shadow: none;
}
@media (max-height: 620px) {
    .combined-media-track .timeline-media-kind-icon {
        width: 15px;
        height: 15px;
        left: -18px;
    }
    .combined-media-track .timeline-media-kind-icon svg {
        width: 11px;
        height: 11px;
    }
    .combined-media-track .timeline-media-kind-icon.cockpit {
        width: 23px;
        left: -26px;
    }
}

/* v23: adaptive mobile UX. Desktop layout remains untouched; phones and
   touch-oriented narrow tablets use a map-first HUD, bottom sheets and a
   compact-by-default timeline instead of shrinking the desktop workspace. */
.mobile-replay-bar,
.mobile-sheet,
.mobile-sheet-scrim,
.mobile-panel-close {
    display: none;
}

@media (max-width: 760px), (pointer: coarse) and (max-width: 980px) {
    :root {
        --mobile-bar-height: 62px;
        --mobile-gap: 6px;
        --mobile-timeline-compact-height: 52px;
        --timeline-label-width: 58px;
        --top-offset: 8px;
    }

    body {
        overscroll-behavior: none;
        touch-action: manipulation;
    }

    /* The desktop HUD still exists as the canonical control surface for the
       JS clients, but it is visually replaced by the mobile proxy controls. */
    .map-tools {
        display: none !important;
    }

    .mobile-replay-bar {
        position: fixed;
        z-index: 82;
        left: var(--mobile-gap);
        right: var(--mobile-gap);
        bottom: max(var(--mobile-gap), env(safe-area-inset-bottom));
        min-height: var(--mobile-bar-height);
        display: grid;
        grid-template-columns: minmax(78px, 1.45fr) repeat(5, minmax(42px, .72fr));
        align-items: stretch;
        gap: 2px;
        padding: 4px;
        border-radius: 15px;
        pointer-events: auto;
    }

    .mobile-replay-clock {
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 1px;
        padding: 0 5px;
        font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    }
    .mobile-replay-clock strong {
        overflow: hidden;
        text-overflow: ellipsis;
        color: #edf8fc;
        font-size: .63rem;
        font-weight: 700;
        white-space: nowrap;
    }
    .mobile-replay-clock small {
        overflow: hidden;
        text-overflow: ellipsis;
        color: #7fa8b8;
        font-size: .49rem;
        white-space: nowrap;
    }

    .mobile-bar-button {
        min-width: 0;
        min-height: 52px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 2px 1px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        box-shadow: none;
        color: #bcd0d8;
        touch-action: manipulation;
    }
    .mobile-bar-button:hover:not(:disabled),
    .mobile-bar-button:active:not(:disabled),
    .mobile-bar-button.active {
        background: rgba(43, 80, 96, .48);
        color: #e5f7fd;
        transform: none;
    }
    .mobile-bar-icon,
    .mobile-rate-value {
        display: block;
        min-height: 19px;
        font: 700 .92rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
        letter-spacing: -.02em;
    }
    .mobile-rate-value { font-size: .75rem; padding-top: 2px; }
    .mobile-bar-label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        color: #819ca7;
        font-size: .46rem;
        font-weight: 650;
        line-height: 1;
        white-space: nowrap;
    }
    .mobile-play-button .mobile-bar-icon { color: #8fdcf7; }

    /* Mobile timeline: always available as a very small strip. The complete
       analysis timeline becomes a deliberate, temporary expansion. */
    .timeline-overlay {
        z-index: 60;
        left: var(--mobile-gap) !important;
        right: var(--mobile-gap) !important;
        bottom: calc(max(var(--mobile-gap), env(safe-area-inset-bottom)) + var(--mobile-bar-height) + var(--mobile-gap)) !important;
        height: var(--mobile-timeline-compact-height);
        max-height: var(--mobile-timeline-compact-height) !important;
        padding: .24rem .42rem .22rem !important;
        overflow: hidden;
        border-radius: 12px;
        transition: height .18s ease, max-height .18s ease, opacity .16s ease;
    }
    .timeline-overlay .timeline-toolbar,
    .timeline-overlay .timeline-groups,
    .timeline-overlay .timeline-expand-button,
    .timeline-overlay .timeline-collapse-button {
        display: none !important;
    }
    .timeline-overlay .timeline-ruler-row {
        grid-template-columns: 0 minmax(0, 1fr);
        gap: 0;
        height: 18px;
    }
    .timeline-overlay .timeline-ruler {
        height: 18px;
        margin-right: 0;
    }
    .timeline-overlay .timeline-axis-area { min-height: 36px; }
    .timeline-overlay .timeline-scrubber-wrap {
        margin: .08rem 0 0 !important;
    }
    .timeline-overlay .timeline-playhead-layer {
        left: 0;
        right: 0;
    }
    .timeline-overlay .timeline-playhead-time {
        font-size: .52rem;
    }

    html.mobile-timeline-expanded .timeline-overlay {
        height: min(54dvh, 440px);
        max-height: min(54dvh, 440px) !important;
        padding: .44rem .5rem .4rem !important;
        overflow: auto;
        overscroll-behavior: contain;
    }
    html.mobile-timeline-expanded .timeline-overlay .timeline-toolbar {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 20;
        padding-bottom: .28rem;
        background: linear-gradient(rgba(9, 17, 22, .96) 70%, rgba(9, 17, 22, 0));
    }
    html.mobile-timeline-expanded .timeline-overlay .timeline-groups {
        display: block !important;
    }
    html.mobile-timeline-expanded .timeline-overlay .timeline-ruler-row {
        grid-template-columns: var(--timeline-label-width) minmax(0, 1fr);
        gap: .3rem;
    }
    html.mobile-timeline-expanded .timeline-overlay .timeline-scrubber-wrap {
        margin-left: calc(var(--timeline-label-width) + .3rem) !important;
    }
    html.mobile-timeline-expanded .timeline-overlay .timeline-playhead-layer {
        left: calc(var(--timeline-label-width) + .3rem);
    }
    html.mobile-timeline-expanded #mobileTimelineButton {
        background: rgba(43, 80, 96, .48);
        color: #e5f7fd;
    }

    /* Existing desktop panels become mutually exclusive bottom sheets. Their
       open/closed desktop preference remains meaningful outside this media query. */
    .floating-panel,
    .diagnostics-panel,
    .mobile-sheet {
        position: fixed !important;
        z-index: 74 !important;
        top: auto !important;
        left: var(--mobile-gap) !important;
        right: var(--mobile-gap) !important;
        bottom: calc(max(var(--mobile-gap), env(safe-area-inset-bottom)) + var(--mobile-bar-height) + var(--mobile-gap)) !important;
        width: auto !important;
        max-width: none !important;
        max-height: min(74dvh, 640px) !important;
        margin: 0 !important;
        border-radius: 16px !important;
        overflow: hidden;
        transform: translateY(12px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform .17s ease, opacity .17s ease, visibility .17s ease;
    }
    .floating-panel:not(.mobile-sheet-active),
    .diagnostics-panel:not(.mobile-sheet-active),
    .mobile-sheet:not(.mobile-sheet-active) {
        display: block !important;
    }
    .floating-panel.mobile-sheet-active,
    .diagnostics-panel.mobile-sheet-active,
    .mobile-sheet.mobile-sheet-active {
        display: block !important;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .floating-panel > summary,
    .diagnostics-panel > summary {
        display: none !important;
    }
    .floating-panel-content,
    .diagnostics-content,
    .mobile-sheet-content {
        position: relative;
        max-height: min(74dvh, 640px) !important;
        overflow: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .floating-panel-content,
    .diagnostics-content {
        padding-top: 2.6rem;
    }

    .mobile-sheet-header {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        padding: .58rem .72rem;
        border-bottom: 1px solid rgba(137, 169, 184, .16);
    }
    .mobile-sheet-header > div {
        min-width: 0;
        display: grid;
        gap: .06rem;
    }
    .mobile-sheet-header strong { color: #edf7fa; font-size: .86rem; }
    .mobile-sheet-header small { color: #718994; font-size: .58rem; }
    .mobile-sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding: 0;
        border-radius: 12px;
        font-size: 1.15rem;
        line-height: 1;
    }
    .mobile-panel-close {
        position: absolute;
        z-index: 15;
        top: .35rem;
        right: .4rem;
    }

    .mobile-sheet-scrim {
        position: fixed;
        z-index: 70;
        inset: 0;
        display: block;
        background: rgba(2, 7, 10, .38);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .16s ease, visibility .16s ease;
    }
    .mobile-sheet-scrim.is-active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    html.mobile-sheet-open .timeline-overlay {
        opacity: .15;
        pointer-events: none;
    }

    /* More sheet: only controls that are useful occasionally on a phone. */
    .mobile-settings-content {
        display: grid;
        gap: .8rem;
        padding: .72rem;
    }
    .mobile-setting-group {
        min-width: 0;
        display: grid;
        gap: .34rem;
    }
    .mobile-setting-title {
        color: #89a3ae;
        font-size: .61rem;
        font-weight: 650;
        text-transform: uppercase;
        letter-spacing: .055em;
    }
    .mobile-segmented-control {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .3rem;
    }
    .mobile-segmented-control.mobile-three-segments {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .mobile-segmented-control button,
    .mobile-setting-actions button,
    .mobile-select-setting select {
        min-height: 44px;
        padding: .42rem .52rem;
    }
    .mobile-segmented-control button.active {
        border-color: rgba(102, 200, 238, .74);
        background: rgba(30, 83, 105, .68);
        color: #d8f4ff;
    }
    .mobile-select-setting select { width: 100%; }
    .mobile-setting-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .32rem;
    }

    /* Touch targets and legibility inside sheets. */
    .floating-panel input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    .floating-panel label,
    .source-channel-row,
    .nadge-source-system-row {
        min-height: 36px;
    }
    .floating-panel .panel-action-row,
    .floating-panel .source-layer-group-title,
    .floating-panel .future-source,
    .selection-inspector {
        font-size: .72rem;
    }
    .selection-inspector .inspector-grid {
        row-gap: .34rem;
    }
    .selection-inspector .inspector-grid dt,
    .selection-inspector .inspector-grid dd {
        line-height: 1.28;
    }
    .atcas-quality-readout {
        grid-template-columns: minmax(88px, auto) minmax(86px, 1fr);
        min-width: 0;
    }

    /* Keep MapLibre controls reachable without competing with the hidden
       desktop top HUD. Attribution stays above the compact timeline/bar. */
    .maplibregl-ctrl-top-right {
        top: 6px !important;
        right: 6px !important;
    }
    .maplibregl-ctrl-bottom-right,
    .maplibregl-ctrl-bottom-left {
        bottom: calc(var(--mobile-bar-height) + var(--mobile-timeline-compact-height) + 2 * var(--mobile-gap) + env(safe-area-inset-bottom)) !important;
    }
    html.mobile-timeline-expanded .maplibregl-ctrl-bottom-right,
    html.mobile-timeline-expanded .maplibregl-ctrl-bottom-left {
        opacity: 0;
        pointer-events: none;
    }

    /* Waveform labels remain outside the waveform, but gain enough left room
       on the smaller timeline labels so CVR/telephone glyphs stay readable. */
    html.mobile-timeline-expanded .combined-media-track .timeline-media-kind-icon {
        transform: translate(-1px, -50%);
    }

    .initial-loader { padding: 14px; }
}

@media (max-width: 390px) {
    .mobile-replay-bar {
        grid-template-columns: minmax(72px, 1.35fr) repeat(5, minmax(39px, .68fr));
    }
    .mobile-bar-label { font-size: .42rem; }
    .mobile-replay-clock strong { font-size: .58rem; }
    .mobile-replay-clock small { font-size: .45rem; }
    .mobile-setting-actions { grid-template-columns: 1fr; }
}

@media (pointer: coarse) and (max-width: 980px) and (orientation: landscape) and (max-height: 560px) {
    :root {
        --mobile-bar-height: 54px;
        --mobile-timeline-compact-height: 46px;
    }
    .mobile-replay-bar { min-height: var(--mobile-bar-height); }
    .mobile-bar-button { min-height: 44px; }
    .mobile-bar-label { display: none; }
    .mobile-replay-clock small { display: none; }
    html.mobile-timeline-expanded .timeline-overlay {
        height: min(64dvh, 330px);
        max-height: min(64dvh, 330px) !important;
    }
    .floating-panel,
    .diagnostics-panel,
    .mobile-sheet,
    .floating-panel-content,
    .diagnostics-content,
    .mobile-sheet-content {
        max-height: min(82dvh, 390px) !important;
    }
}


/* v23.6 - NADGE source group rebuilt.
   Every interactive NADGE item participates in one shared two-column grid.
   Native checkboxes sit inside a fixed-size slot so their optical alignment
   no longer depends on label height, wrapping or browser form-control metrics. */
.sources-panel .nadge-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: .38rem;
    row-gap: .16rem;
    margin: .18rem 0 .08rem;
}
.sources-panel .nadge-controls-grid .nadge-source-systems {
    display: contents;
    margin: 0;
}
.sources-panel .nadge-control-item {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 22px;
    margin: 0;
    padding: 0;
    gap: .34rem;
    color: #b7c3c7;
    font-size: .67rem;
    line-height: 1.2;
}
.sources-panel .nadge-control-wide {
    grid-column: 1 / -1;
}
.sources-panel .nadge-checkbox-slot {
    display: grid;
    place-items: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin: 0;
    padding: 0;
    line-height: 0;
}
.sources-panel .nadge-checkbox-slot > input[type="checkbox"] {
    display: block;
    width: 13px;
    height: 13px;
    margin: 0;
    padding: 0;
    flex: none;
}
.sources-panel .nadge-site-control {
    height: 22px;
    min-height: 22px;
    white-space: nowrap;
}
.sources-panel .nadge-site-control .nadge-source-system-dot {
    display: block;
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    margin: 0;
}
.sources-panel .nadge-site-control .nadge-source-system-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}
.sources-panel .nadge-site-control small {
    display: none;
}
.sources-panel .nadge-controls-grid .nadge-sync-control {
    margin: 0;
    gap: .34rem;
    font-size: .67rem;
    line-height: 1.2;
}

/* Track search inside Inspector (v24.4). */
.track-search-panel[hidden] { display: none; }

.track-search-panel {
    display: grid;
    gap: .48rem;
    margin: .15rem 0 .55rem;
    padding-bottom: .52rem;
    border-bottom: 1px solid rgba(132, 163, 177, .16);
}
.track-search-block { display: grid; gap: .22rem; }
.track-search-label {
    color: #93aeb9;
    font-size: .61rem;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.track-search-input-row { display: flex; align-items: stretch; gap: .24rem; }
.track-search-input {
    min-width: 0;
    flex: 1 1 auto;
    height: 1.72rem;
    padding: .2rem .42rem;
    border: 1px solid rgba(123, 163, 180, .28);
    border-radius: .28rem;
    background: rgba(5, 18, 25, .58);
    color: #d7e2e7;
    font: 600 .68rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    outline: none;
}
.track-search-input:focus { border-color: rgba(104, 190, 225, .7); box-shadow: 0 0 0 1px rgba(104, 190, 225, .12); }
.track-search-button,
.track-search-clear {
    height: 1.72rem;
    border: 1px solid rgba(123, 163, 180, .26);
    border-radius: .28rem;
    background: rgba(42, 73, 86, .52);
    color: #c7d6dc;
    cursor: pointer;
    font-size: .62rem;
}
.track-search-button { padding: 0 .48rem; }
.track-search-clear { width: 1.72rem; padding: 0; font-size: .86rem; }
.track-search-button:hover,
.track-search-clear:hover { background: rgba(61, 100, 116, .66); }
.track-search-help { color: #647d88; font-size: .56rem; line-height: 1.3; }
.track-search-results {
    display: grid;
    gap: .18rem;
    max-height: 9.4rem;
    overflow-y: auto;
    padding: .18rem;
    border: 1px solid rgba(123, 163, 180, .16);
    border-radius: .28rem;
    background: rgba(4, 13, 18, .65);
}
.track-search-result {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .2rem .4rem;
    align-items: center;
    padding: .3rem .36rem;
    border: 0;
    border-radius: .22rem;
    background: rgba(39, 63, 73, .32);
    color: #c9d7dd;
    cursor: pointer;
    text-align: left;
}
.track-search-result:hover { background: rgba(54, 91, 107, .55); }
.track-search-result-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; font-weight: 650; }
.track-search-result-meta { color: #79939e; font-size: .56rem; white-space: nowrap; }
.track-search-message { color: #8299a3; font-size: .61rem; padding: .25rem .3rem; }
.track-search-message.error { color: #e7aa8f; }
.nadge-locality-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.08rem;
    padding: .08rem .32rem;
    border-radius: .2rem;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .055em;
    border: 1px solid rgba(160, 188, 198, .25);
}
.nadge-locality-badge.local { color: #9cd7ff; background: rgba(48, 124, 170, .18); border-color: rgba(88, 170, 218, .38); }
.nadge-locality-badge.remote { color: #ffd59a; background: rgba(177, 111, 38, .17); border-color: rgba(219, 155, 72, .4); }
.nadge-locality-badge.unknown { color: #aebbc0; background: rgba(120, 130, 135, .12); }

/* NADGE temporal calibration profile selector (v24.7). */
.sources-panel .nadge-time-profile-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(7.8rem, 1.05fr);
    align-items: center;
    gap: .4rem;
}
.sources-panel .nadge-time-profile-control select {
    min-width: 0;
    width: 100%;
    height: 1.7rem;
    padding: .08rem 1.45rem .08rem .4rem;
    border: 1px solid rgba(148, 174, 183, .3);
    border-radius: .34rem;
    background: rgba(16, 26, 31, .72);
    color: #d7dde0;
    font: 600 .62rem ui-monospace, SFMono-Regular, Consolas, monospace;
}
.sources-panel .nadge-time-profile-control select:disabled {
    opacity: .58;
}


/* Temporary map-analysis tools (v24.11). */
.map-analysis-tools-panel {
    display: grid;
    gap: .38rem;
    margin-top: .08rem;
    padding-top: .5rem;
    border-top: 1px solid rgba(132, 163, 177, .16);
}
.map-analysis-tools-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
}
.map-analysis-tools-heading > span {
    color: #93aeb9;
    font-size: .61rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.map-analysis-tools-heading small { color: #607984; font-size: .54rem; }
.map-analysis-tools-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
.map-analysis-tool-button {
    min-width: 0;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: .3rem .42rem;
    border: 1px solid rgba(123, 163, 180, .26);
    border-radius: .34rem;
    background: rgba(32, 60, 72, .46);
    color: #c7d6dc;
    cursor: pointer;
    font-size: .62rem;
}
.map-analysis-tool-button:hover { background: rgba(55, 91, 106, .64); }
.map-analysis-tool-button.active,
.map-analysis-tool-button[aria-pressed="true"] {
    border-color: rgba(104, 214, 245, .72);
    background: rgba(52, 135, 166, .36);
    color: #e2f9ff;
    box-shadow: 0 0 0 1px rgba(104, 214, 245, .08) inset;
}
.map-analysis-tool-status {
    display: grid;
    gap: .3rem;
    padding: .42rem .46rem;
    border: 1px solid rgba(104, 190, 225, .18);
    border-radius: .36rem;
    background: rgba(7, 22, 29, .55);
}
.map-analysis-tool-status[hidden] { display: none; }
.map-analysis-tool-status-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.map-analysis-tool-status-head strong { color: #b9d4de; font-size: .63rem; font-weight: 700; }
.map-analysis-tool-clear {
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    border: 1px solid rgba(123, 163, 180, .22);
    border-radius: .28rem;
    background: rgba(42, 73, 86, .42);
    color: #aec1c9;
    cursor: pointer;
}
.map-analysis-tool-clear:hover { background: rgba(72, 105, 119, .62); }
.map-analysis-tool-prompt { color: #88a7b3; font-size: .59rem; line-height: 1.35; }
.map-analysis-tool-values {
    display: grid;
    grid-template-columns: 4.8rem minmax(0, 1fr);
    gap: .22rem .38rem;
    margin: 0;
    font-size: .6rem;
}
.map-analysis-tool-values[hidden] { display: none; }
.map-analysis-tool-values dt { color: #667f89; }
.map-analysis-tool-values dd { margin: 0; color: #c6d6dc; overflow-wrap: anywhere; }
.map-analysis-tools-help { margin-top: .02rem; }

/* Site presentation / maintenance (v25.2.3). */
html.welcome-open,
html.welcome-open body { overflow: hidden; }

.site-presentation-loading,
.maintenance-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 50% 30%, rgba(39, 98, 123, .22), transparent 38%),
        #071015;
    color: #e7f2f6;
}
.site-presentation-loading { align-content: center; gap: .45rem; text-align: center; }
.site-presentation-loading span { color: #7f9aa6; font-size: .8rem; }
.maintenance-card {
    width: min(680px, 100%);
    position: relative;
    overflow: hidden;
    padding: clamp(1.6rem, 5vw, 3.2rem);
    border: 1px solid rgba(135, 190, 211, .18);
    border-radius: 1rem;
    background: rgba(8, 21, 28, .92);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}
.maintenance-brand,
.welcome-brand {
    margin-bottom: 1rem;
    color: #72cbe9;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.maintenance-card h1,
.welcome-card h1 { margin: 0 0 1rem; color: #eef9fc; line-height: 1.12; }
.maintenance-card h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); max-width: 15ch; }
/* FocusOnNavigate focuses the route heading after navigation. Headings are not
   interactive controls, and the browser outline becomes fragmented on wrapped
   multi-line copy. Keep the semantic focus for screen readers without the
   distracting visual artifact. */
.maintenance-card h1:focus,
.welcome-card h1:focus { outline: none; }
.maintenance-card p,
.welcome-card p { white-space: pre-line; color: #a9bec7; line-height: 1.65; }
.maintenance-radar {
    width: 150px;
    height: 150px;
    position: absolute;
    right: -36px;
    bottom: -44px;
    border: 1px solid rgba(98, 192, 224, .18);
    border-radius: 50%;
    opacity: .55;
}
.maintenance-radar::before,
.maintenance-radar::after {
    content: "";
    position: absolute;
    inset: 25%;
    border: 1px solid rgba(98, 192, 224, .16);
    border-radius: 50%;
}
.maintenance-radar::after { inset: 48%; }
.maintenance-radar span {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 1px;
    height: 48%;
    transform-origin: bottom;
    background: linear-gradient(to top, rgba(102, 219, 247, .8), transparent);
    animation: maintenance-radar-sweep 3.8s linear infinite;
}
@keyframes maintenance-radar-sweep { to { transform: rotate(360deg); } }

.welcome-overlay[hidden] { display: none; }
.welcome-overlay {
    position: fixed;
    /* MainLayout intentionally disables pointer events so empty replay areas
       fall through to the JavaScript-owned MapLibre surface. The welcome is
       an actual modal and must explicitly opt back into hit testing. */
    pointer-events: auto;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: clamp(.8rem, 3vw, 2rem);
    background: rgba(1, 7, 10, .78);
    backdrop-filter: blur(8px) brightness(.42);
    opacity: 1;
    transition: opacity .16s ease-out;
}
.welcome-overlay.is-closing { opacity: 0; pointer-events: none; }
.welcome-card {
    width: min(760px, 100%);
    max-height: min(86dvh, 760px);
    overflow: auto;
    padding: clamp(1.35rem, 4vw, 2.5rem);
    border: 1px solid rgba(119, 190, 215, .2);
    border-radius: .95rem;
    background: linear-gradient(155deg, rgba(13, 31, 40, .98), rgba(5, 15, 21, .98));
    box-shadow: 0 35px 100px rgba(0, 0, 0, .52);
}
.welcome-card h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); }
.welcome-card p { margin: 0 0 1.45rem; font-size: clamp(.88rem, 2vw, 1rem); }
.welcome-dismiss-choice {
    display: flex;
    gap: .55rem;
    align-items: center;
    margin: 0 0 1.2rem;
    color: #9fb6c0;
    font-size: .82rem;
    cursor: pointer;
}
.welcome-dismiss-choice input { accent-color: #67c6e5; }
.welcome-enter {
    width: 100%;
    min-height: 2.8rem;
    border: 1px solid rgba(99, 211, 244, .48);
    border-radius: .55rem;
    background: rgba(48, 157, 190, .19);
    color: #ecfbff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}
.welcome-enter:hover { background: rgba(56, 175, 211, .28); }


/* Phase 20: welcome text grows naturally up to a readable viewport cap. Only
   the message becomes scrollable, so title and actions remain stable. */
.welcome-card {
    width: min(700px, calc(100vw - 1.6rem));
    max-height: min(82dvh, 680px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(1.15rem, 3vw, 2rem);
}
.welcome-card h1 {
    margin-bottom: .7rem;
    font-size: clamp(1.35rem, 3.2vw, 1.9rem);
    line-height: 1.08;
}
.welcome-message-scroll {
    min-height: 0;
    max-height: min(48dvh, 360px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: .42rem;
    margin-bottom: 1rem;
    scrollbar-gutter: stable;
}
.welcome-message-scroll p {
    margin: 0;
    font-size: clamp(.78rem, 1.45vw, .9rem);
    line-height: 1.42;
}
.welcome-dismiss-choice { margin-bottom: .9rem; }
.welcome-enter { min-height: 2.5rem; }

/* Phase 20: stronger I-TIGI presence area and generic scenario event markers. */
.timeline-presence-backdrop {
    border-left-color: rgba(247, 211, 102, .42);
    border-right-color: rgba(247, 211, 102, .42);
    background: linear-gradient(180deg, rgba(247, 211, 102, .16), rgba(247, 211, 102, .075));
    box-shadow: inset 0 0 18px rgba(247, 211, 102, .06), 0 0 10px rgba(247, 211, 102, .06);
}
.timeline-scenario-events {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.timeline-scenario-event-marker {
    position: absolute;
    z-index: 7;
    top: 0;
    bottom: 0;
    width: 9px;
    min-width: 9px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translateX(-4.5px);
    cursor: pointer;
    pointer-events: auto;
    color: #b9dce9;
}
.timeline-scenario-event-marker::before {
    content: "";
    position: absolute;
    left: 3.5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: currentColor;
    opacity: .82;
    box-shadow: 0 0 4px currentColor;
    pointer-events: none;
}
.timeline-scenario-event-marker::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 17px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid currentColor;
    filter: drop-shadow(0 0 3px currentColor);
    transform: translateX(-50%);
}
.timeline-scenario-event-marker span {
    position: absolute;
    left: 12px;
    top: calc(6px + (var(--event-label-row, 0) * 19px));
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: .10rem .32rem;
    border: 1px solid color-mix(in srgb, currentColor 48%, transparent);
    border-radius: 5px;
    background: rgba(8, 22, 29, .96);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
    color: inherit;
    font-size: .52rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: .025em;
    white-space: nowrap;
    opacity: .96;
    pointer-events: none;
}
.timeline-scenario-event-marker.label-left span {
    left: auto;
    right: 12px;
}
.timeline-scenario-event-marker:hover span,
.timeline-scenario-event-marker:focus-visible span {
    opacity: 1;
    filter: brightness(1.13);
}
.timeline-scenario-event-marker.incident {
    color: #ff858b;
    background: transparent;
    box-shadow: none;
}
.timeline-scenario-event-marker.incident span {
    background: rgba(92, 24, 29, .97);
    color: #ffe2e3;
}
.timeline-scenario-event-marker.alert,
.timeline-scenario-event-marker.alarm {
    color: #ffd46f;
    background: transparent;
    box-shadow: none;
}
.timeline-scenario-event-marker.alert span,
.timeline-scenario-event-marker.alarm span {
    background: rgba(71, 54, 14, .97);
    color: #ffedbd;
}
.timeline-scenario-event-marker.observation,
.timeline-scenario-event-marker.radar-observation {
    color: #86d6ef;
}
.timeline-scenario-event-marker.observation span,
.timeline-scenario-event-marker.radar-observation span {
    background: rgba(10, 48, 62, .97);
    color: #d9f5ff;
}

/* A scenario event of kind alert/alarm can highlight its configured
   EVENT_PARTICIPANTS on the map around the event time. */
.maplibregl-marker.scenario-event-pulse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 210, 91, .92);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: scenario-event-marker-pulse 1.15s ease-out infinite;
    pointer-events: none;
}
@keyframes scenario-event-marker-pulse {
    0% { transform: translate(-50%, -50%) scale(.45); opacity: .95; }
    75%, 100% { transform: translate(-50%, -50%) scale(2.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .maplibregl-marker.scenario-event-pulse::after { animation: none; opacity: .7; }
}

.radar-map.scenario-alert-active::after {
    content: "";
    position: absolute;
    z-index: 8;
    inset: 0;
    border: 2px solid rgba(255, 205, 77, .45);
    box-shadow: inset 0 0 34px rgba(255, 184, 61, .12);
    pointer-events: none;
    animation: scenario-map-alert-pulse 1.15s ease-in-out infinite alternate;
}
@keyframes scenario-map-alert-pulse {
    from { opacity: .28; }
    to { opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
    .radar-map.scenario-alert-active::after { animation: none; opacity: .65; }
}


/* v25.3 visual refinement: site dialogs, grouped sources, mobile polish. */
.header-link-button {
    padding: .14rem .42rem;
    border: 1px solid rgba(118, 170, 194, .2);
    border-radius: 999px;
    background: rgba(11, 24, 32, .55);
    color: #c8e8f2;
    cursor: pointer;
    font: inherit;
    font-size: .56rem;
    line-height: 1.2;
}
.header-link-button:hover { background: rgba(20, 40, 52, .75); }
.site-version-badge {
    padding: .12rem .38rem;
    border: 1px solid rgba(118, 170, 194, .14);
    border-radius: 999px;
    background: rgba(10, 18, 24, .48);
    color: #8cb7c8;
    white-space: nowrap;
}
.maintenance-card,
.welcome-card,
.site-dialog-card { text-align: center; }
.maintenance-tagline,
.welcome-tagline {
    margin: -.15rem 0 1rem;
    color: #89bdd0;
    font-size: .76rem;
    letter-spacing: .02em;
}
.site-language-copy-centered h1,
.site-language-copy-centered p { text-align: center; }
.welcome-message-justified p { text-align: justify; }
.site-dialog-overlay[hidden] { display: none; }
.site-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: grid;
    place-items: center;
    padding: clamp(.8rem, 3vw, 2rem);
    background: rgba(1, 7, 10, .78);
    backdrop-filter: blur(8px) brightness(.42);
    pointer-events: auto;
}
.site-dialog-card {
    width: min(880px, calc(100vw - 1.6rem));
    max-height: min(88dvh, 760px);
    overflow: auto;
    position: relative;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid rgba(119, 190, 215, .2);
    border-radius: .95rem;
    background: linear-gradient(155deg, rgba(13, 31, 40, .98), rgba(5, 15, 21, .98));
    box-shadow: 0 35px 100px rgba(0, 0, 0, .52);
}
.site-dialog-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(122, 177, 196, .25);
    border-radius: 999px;
    background: rgba(8, 19, 25, .8);
    color: #dff6fb;
    cursor: pointer;
    font: inherit;
    font-size: 1.1rem;
}
.site-info-card h1 { margin: .1rem 0 .5rem; }
.site-info-version {
    margin-bottom: 1rem;
    color: #8bb6c7;
    font-size: .8rem;
}
.site-info-sections {
    display: grid;
    gap: .85rem;
    text-align: left;
}
.site-info-section {
    padding: .8rem .9rem;
    border: 1px solid rgba(110, 154, 173, .14);
    border-radius: .7rem;
    background: rgba(9, 20, 26, .55);
}
.site-info-section h2 {
    margin: 0 0 .35rem;
    color: #dff4fb;
    font-size: .88rem;
}
.site-info-section p {
    margin: 0;
    white-space: pre-line;
    color: #aac0ca;
    line-height: 1.55;
    text-align: left;
    font-size: .82rem;
}
.sources-panel { width: 328px; }
.sources-panel .floating-panel-content { gap: .72rem; }
.sources-section-heading {
    padding: .05rem 0 .12rem;
    color: #8eb9ca;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.source-layer-group {
    padding: .55rem .65rem;
    border: 1px solid rgba(142, 174, 186, .12);
    border-radius: .8rem;
    background: rgba(7, 17, 23, .3);
}
.source-layer-group-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .3rem;
}
.indented-switches,
.source-tree-indented,
.indented-grid,
.indented-check-row { margin-left: .55rem; }
.sources-panel .source-system { padding: 0; border: 0; background: transparent; }
.sources-panel .physical-radar-group { margin-top: .35rem; padding-left: .55rem; border-left: 1px solid rgba(118, 170, 194, .14); }
.sources-panel .physical-radar-header { font-size: .69rem; }
.sources-panel .source-channel-row { padding-left: .2rem; }
.sources-panel .nadge-source-systems { display: contents; }
.source-select-row {
    display: grid;
    gap: .35rem;
    margin-bottom: .6rem;
}
.source-select-row:last-child { margin-bottom: 0; }
.source-select-row span,
.source-check-row span:last-child {
    color: #dbeef4;
    font-size: .72rem;
    font-weight: 650;
}
.source-select-row select {
    width: 100%;
    min-width: 0;
    padding: .45rem .55rem;
    border-radius: .55rem;
}
.source-check-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .5rem;
    align-items: center;
}
.communications-source-group > small:first-child { display: block; margin-bottom: .45rem; }
.timeline-scenario-event-marker {
    width: 4px;
    min-width: 4px;
    transform: translateX(-2px);
}
.timeline-scenario-event-marker::before {
    left: 1px;
    width: 2px;
}
.timeline-scenario-event-marker::after { top: 16px; }
.timeline-scenario-event-marker span {
    left: 10px;
    max-width: 210px;
    font-size: .56rem;
    line-height: 1.25;
}
.timeline-scenario-event-marker.label-left span { right: 10px; }
.nadge-inspector-tabs {
    display: flex;
    gap: .35rem;
    margin: .65rem 0 .55rem;
}
.nadge-inspector-tab {
    padding: .28rem .58rem;
    border: 1px solid rgba(110, 161, 182, .18);
    border-radius: 999px;
    background: rgba(11, 23, 30, .55);
    color: #a7c4cf;
    cursor: pointer;
    font: inherit;
    font-size: .68rem;
    font-weight: 700;
}
.nadge-inspector-tab.active {
    background: rgba(50, 116, 144, .34);
    color: #effbff;
    border-color: rgba(113, 205, 238, .35);
}
.nadge-inspector-pane[hidden] { display: none !important; }
@media (max-width: 700px) {
    .sources-panel { width: min(360px, calc(100vw - 12px)); }
    .map-tools-meta { gap: .4rem; }
    .site-version-badge { display: none; }
    .site-info-card,
    .welcome-card,
    .maintenance-card { width: min(100%, calc(100vw - 1rem)); }
    .site-info-section { padding: .7rem .75rem; }
}
@media (max-width: 420px) {
    .welcome-message-scroll p,
    .site-info-section p { font-size: .78rem; }
    .header-link-button { font-size: .52rem; }
    .timeline-scenario-event-marker span { max-width: 150px; }
}


/* Phase 25.3.1 - editorial refinement, lighter display hierarchy and tabbed NADGE inspector. */

/* The display palette belongs to the left edge of the map and can align with the
   Scenario time heading because it no longer competes with the top-right HUD. */
@media (min-width: 861px) {
    .sources-panel { top: 12px; }
}

/* "Informazioni" is navigation, not an action button. */
.header-info-link {
    color: #8fb8c8;
    text-decoration: none;
    text-underline-offset: .18em;
    white-space: nowrap;
    font-size: .57rem;
    letter-spacing: .015em;
}
.header-info-link:hover,
.header-info-link:focus-visible {
    color: #d9f3fb;
    text-decoration: underline;
}

/* Welcome: editorial rather than dashboard-card styling. */
.welcome-card {
    width: min(760px, calc(100vw - 1.6rem));
    padding: clamp(1.45rem, 4vw, 2.65rem) clamp(1.45rem, 5vw, 3rem);
    border-radius: .65rem;
    border-color: rgba(135, 190, 211, .16);
    background: rgba(7, 18, 24, .975);
    box-shadow: 0 34px 95px rgba(0, 0, 0, .5);
}
.welcome-card .welcome-brand {
    margin-bottom: .55rem;
    font-size: .66rem;
}
.welcome-card .welcome-tagline {
    margin: 0 auto 1.35rem;
    color: #7ea6b6;
    font-size: .68rem;
    letter-spacing: .015em;
}
.welcome-card h1 {
    margin-bottom: 1.2rem;
    font-size: clamp(1.55rem, 3.3vw, 2.05rem);
    font-weight: 680;
    letter-spacing: -.015em;
}
.welcome-message-scroll {
    max-height: min(46dvh, 330px);
    margin-bottom: 1.25rem;
    padding: .15rem .35rem .15rem 0;
}
.welcome-message-scroll p {
    color: #b0c2ca;
    font-size: clamp(.76rem, 1.25vw, .86rem);
    line-height: 1.58;
}
.welcome-dismiss-choice {
    width: fit-content;
    margin: .1rem 0 .75rem;
    color: #879da7;
    font-size: .74rem;
    text-align: left;
}
.welcome-enter {
    width: min(190px, 100%);
    min-height: 2.35rem;
    margin-left: auto;
    display: block;
    border-radius: .42rem;
    font-size: .78rem;
}

/* Information dialog: a single editorial sheet, with typographic sections rather
   than a stack of rounded mini-cards. */
.site-dialog-overlay { background: rgba(1, 6, 9, .82); }
.site-info-card {
    width: min(920px, calc(100vw - 2rem));
    padding: clamp(1.6rem, 4vw, 3rem) clamp(1.4rem, 5vw, 3.6rem);
    border-radius: .65rem;
    background: rgba(7, 18, 24, .985);
}
.site-info-card .welcome-brand { margin-bottom: .55rem; }
.site-info-card h1 {
    margin: .1rem 0 .35rem;
    font-size: clamp(1.7rem, 4vw, 2.45rem);
    font-weight: 660;
    letter-spacing: -.02em;
}
.site-info-version {
    margin-bottom: 1.6rem;
    color: #7394a1;
    font-size: .7rem;
    letter-spacing: .025em;
}
.site-info-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2.2rem;
    border-top: 1px solid rgba(125, 166, 181, .18);
    text-align: left;
}
.site-info-section {
    min-width: 0;
    padding: 1rem 0 1.1rem;
    border: 0;
    border-bottom: 1px solid rgba(125, 166, 181, .13);
    border-radius: 0;
    background: transparent;
}
.site-info-project { grid-column: 1 / -1; }
.site-info-section h2 {
    margin: 0 0 .42rem;
    color: #d9e9ef;
    font-size: .78rem;
    font-weight: 720;
    letter-spacing: .025em;
    text-transform: uppercase;
}
.site-info-section p {
    color: #aabcc4;
    font-size: .8rem;
    line-height: 1.62;
}
.site-dialog-close {
    top: .85rem;
    right: .9rem;
    border: 0;
    background: transparent;
    color: #829aa5;
}
.site-dialog-close:hover { color: #e4f5fa; }

/* Display panel: the hierarchy is carried by headings, spacing and separators.
   Rounded boxes are reserved for actual selectable groups (extractors/sites). */
.sources-panel {
    width: 318px;
}
.sources-panel .floating-panel-content {
    display: block;
    padding: .38rem .65rem .62rem;
}
.sources-section-heading {
    margin: .18rem 0 .12rem;
    padding: .42rem 0 .18rem;
    border-top: 1px solid rgba(129, 164, 178, .14);
    color: #87adbc;
    font-size: .59rem;
    letter-spacing: .095em;
}
.sources-section-heading:first-of-type {
    margin-top: 0;
    padding-top: .12rem;
    border-top: 0;
}
.display-section {
    margin: 0;
    padding: .34rem 0 .5rem;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.display-section + .display-section {
    border-top: 1px solid rgba(129, 164, 178, .09);
}
.sources-panel .source-layer-group-title,
.sources-panel .source-layer-group-title-row {
    margin: 0 0 .23rem;
}
.sources-panel .source-layer-group-title {
    color: #9babb2;
    font-size: .61rem;
    font-weight: 760;
    letter-spacing: .045em;
}
.sources-panel .source-layer-group-title-row small {
    color: #d7e5ea;
    font-size: .68rem;
}
.display-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .12rem .42rem;
    margin-left: .48rem;
    padding: .08rem 0 .14rem !important;
}
.display-control-grid label {
    min-width: 0;
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    padding: .05rem 0;
    color: #b7c4c9;
    font-size: .65rem;
    line-height: 1.22;
}
.display-control-grid input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    flex: 0 0 13px;
}
.display-control-wide { grid-column: 1 / -1; }

/* ATCAS extractor groups keep their established boxed treatment. */
.sources-panel .extractor-groups {
    margin: .18rem 0 .02rem .48rem;
    padding: 0;
}
.sources-panel .source-system {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .28rem;
}
.sources-panel .physical-radar-group {
    margin: 0;
    padding: .24rem .3rem;
    border: 1px solid rgba(114, 148, 163, .20);
    border-radius: 7px;
    background: rgba(17, 29, 36, .22);
}

/* NADGE sites use the same visual grammar as the ATCAS extractor boxes. */
.sources-panel .nadge-site-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .28rem;
    margin: .2rem 0 .02rem .48rem;
}
.sources-panel .nadge-site-box {
    min-width: 0;
    min-height: 34px;
    display: grid;
    grid-template-columns: 13px 7px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: .28rem;
    padding: .24rem .3rem;
    border: 1px solid rgba(114, 148, 163, .20);
    border-radius: 7px;
    background: rgba(17, 29, 36, .22);
    color: #b7c4c9;
    font-size: .62rem;
    cursor: pointer;
}
.sources-panel .nadge-site-box input {
    grid-row: 1 / span 2;
    width: 13px;
    height: 13px;
    margin: 0;
}
.sources-panel .nadge-site-box .nadge-source-system-dot {
    grid-row: 1 / span 2;
    width: 6px;
    height: 6px;
    margin: 0;
}
.sources-panel .nadge-site-box .nadge-source-system-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sources-panel .nadge-site-box small {
    grid-column: 3;
    display: none;
}

/* Calibrations are intentionally compact controls, not large form fields. */
.calibrations-source-group {
    display: grid;
    gap: .48rem;
    padding-left: .48rem;
}
.source-select-row {
    gap: .22rem;
    margin: 0;
}
.source-select-row span,
.source-check-row span:last-child {
    font-size: .65rem;
    color: #c7d5da;
}
.source-select-row select {
    width: min(218px, 100%);
    min-height: 29px;
    padding: .25rem .42rem;
    border-radius: .38rem;
    font-size: .66rem;
    line-height: 1.1;
    background: rgba(13, 25, 32, .74);
}
.source-check-row {
    grid-template-columns: 13px 1fr;
    gap: .35rem;
}
.source-check-row input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
}
.communications-source-group {
    padding-left: .48rem;
}
.communications-kind-copy {
    display: block;
    margin: 0 0 .3rem;
    color: #708993;
    font-size: .56rem;
    line-height: 1.2;
}
.communications-source-group .media-autoplay-control {
    margin-left: 0;
    font-size: .64rem;
}

/* The NADGE inspector reads as a traditional tabbed folder rather than two pills. */
.nadge-inspector-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0;
    margin: .7rem 0 0;
    border-bottom: 1px solid rgba(123, 160, 175, .22);
}
.nadge-inspector-tab {
    position: relative;
    margin: 0 0 -1px;
    padding: .38rem .72rem .34rem;
    border: 1px solid transparent;
    border-bottom: 1px solid rgba(123, 160, 175, .22);
    border-radius: .42rem .42rem 0 0;
    background: transparent;
    color: #829aa4;
    font-size: .66rem;
    font-weight: 690;
}
.nadge-inspector-tab:hover { color: #c7dbe2; }
.nadge-inspector-tab.active {
    border-color: rgba(123, 160, 175, .22);
    border-bottom-color: #101d24;
    background: #101d24;
    color: #e8f5f9;
    box-shadow: none;
}
.nadge-inspector-pane {
    padding-top: .55rem;
}
.nadge-inspector-pane .nadge-events-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

@media (max-width: 700px) {
    .site-info-sections { grid-template-columns: 1fr; }
    .site-info-project { grid-column: 1; }
    .welcome-card { padding: 1.35rem 1.15rem; }
    .welcome-enter { width: 100%; }
    .display-control-grid { margin-left: .25rem; }
    .sources-panel .extractor-groups,
    .sources-panel .nadge-site-groups,
    .calibrations-source-group,
    .communications-source-group { margin-left: .25rem; padding-left: 0; }
}


/* Phase 25.3.2 - compact NADGE site group and restored track counter styling. */
.sources-panel .nadge-site-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .08rem .35rem;
    margin: .2rem 0 .02rem .48rem;
    padding: .28rem .34rem;
    border: 1px solid rgba(114, 148, 163, .20);
    border-radius: 7px;
    background: rgba(17, 29, 36, .22);
}
.sources-panel .nadge-site-box {
    min-width: 0;
    min-height: 26px;
    padding: .16rem .08rem;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.sources-panel .nadge-site-box:hover {
    background: rgba(115, 164, 183, .055);
}
.sources-panel #nadgeTrackCount {
    color: #dbc878;
    font: 600 .59rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .015em;
    opacity: .92;
}

/* Phase 25.3.3 - enlarged information sheet, integrated functional guide,
   clickable rich text and explicit close action. */
.site-info-card {
    width: min(1120px, calc(100vw - 1.4rem));
    max-height: min(92dvh, 920px);
    padding: clamp(1.7rem, 4vw, 3.2rem) clamp(1.45rem, 4.8vw, 3.8rem);
}
.site-info-card .welcome-brand {
    margin-bottom: .45rem;
}
.site-info-card h1 {
    max-width: 16ch;
    margin: .08rem 0 .28rem;
    line-height: .96;
    font-size: clamp(1.62rem, 3.35vw, 2.28rem);
    font-weight: 660;
    letter-spacing: -.03em;
    text-wrap: balance;
}
.site-info-version {
    margin-bottom: 1.35rem;
    color: #7f9ea9;
    font-size: .72rem;
    letter-spacing: .03em;
}
.site-info-sections {
    gap: 0 2.5rem;
}
.site-info-section {
    padding: .95rem 0 1.08rem;
}
.site-info-guide {
    grid-column: 1 / -1;
}
.site-info-richtext {
    color: #aabcc4;
    font-size: .83rem;
    line-height: 1.68;
}
.site-info-richtext p,
.site-info-richtext ul,
.site-info-richtext ol,
.site-info-richtext blockquote,
.site-info-richtext pre {
    margin: 0 0 .82rem;
}
.site-info-richtext p:last-child,
.site-info-richtext ul:last-child,
.site-info-richtext ol:last-child,
.site-info-richtext blockquote:last-child,
.site-info-richtext pre:last-child {
    margin-bottom: 0;
}
.site-info-richtext ul,
.site-info-richtext ol {
    padding-left: 1.15rem;
}
.site-info-richtext li + li {
    margin-top: .22rem;
}
.site-info-richtext h2,
.site-info-richtext h3,
.site-info-richtext h4 {
    margin: 1rem 0 .42rem;
    color: #e2f0f5;
    line-height: 1.18;
    text-transform: none;
    letter-spacing: -.01em;
}
.site-info-richtext h2:first-child,
.site-info-richtext h3:first-child,
.site-info-richtext h4:first-child {
    margin-top: 0;
}
.site-info-richtext h2 { font-size: 1rem; }
.site-info-richtext h3 { font-size: .92rem; }
.site-info-richtext h4 { font-size: .86rem; }
.site-info-richtext a {
    color: #a5ddf6;
    text-decoration: underline;
    text-decoration-color: rgba(165, 221, 246, .45);
    text-underline-offset: .16em;
}
.site-info-richtext a:hover,
.site-info-richtext a:focus-visible {
    color: #dff8ff;
    text-decoration-color: currentColor;
}
.site-info-richtext code {
    padding: .08rem .28rem;
    border-radius: .25rem;
    background: rgba(33, 55, 67, .62);
    color: #dbedf4;
    font-size: .74rem;
}
.site-info-richtext pre {
    overflow: auto;
    padding: .75rem .85rem;
    border: 1px solid rgba(117, 164, 182, .14);
    border-radius: .45rem;
    background: rgba(11, 22, 29, .78);
    color: #c5d7de;
    font-size: .73rem;
    line-height: 1.52;
}
.site-info-richtext pre code {
    padding: 0;
    border-radius: 0;
    background: transparent;
}
.site-info-richtext blockquote {
    padding: .15rem 0 .15rem .8rem;
    border-left: 2px solid rgba(127, 187, 212, .28);
    color: #c3d6de;
}
.site-info-guide-disclosure {
    margin-top: .2rem;
    padding: .78rem .9rem .9rem;
    border: 1px solid rgba(115, 160, 177, .16);
    border-radius: .48rem;
    background: rgba(11, 22, 29, .48);
}
.site-info-guide-disclosure > summary {
    cursor: pointer;
    color: #d9ebf1;
    font-size: .8rem;
    font-weight: 650;
    list-style: none;
}
.site-info-guide-disclosure > summary::-webkit-details-marker {
    display: none;
}
.site-info-guide-disclosure > summary::after {
    content: '▾';
    float: right;
    color: #86b9cd;
}
.site-info-guide-disclosure[open] > summary::after {
    content: '▴';
}
.site-info-guide-content {
    max-height: min(42dvh, 430px);
    margin-top: .82rem;
    padding-right: .3rem;
    overflow: auto;
}
.site-info-guide-empty {
    margin-top: .7rem;
    color: #89a1ab;
}
.site-dialog-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
}
.site-dialog-action {
    min-height: 2.45rem;
    padding: 0 1rem;
    border: 1px solid rgba(118, 183, 205, .2);
    border-radius: .45rem;
    background: rgba(18, 41, 54, .82);
    color: #e2f3f8;
    font-size: .8rem;
    font-weight: 620;
    letter-spacing: .01em;
}
.site-dialog-action:hover,
.site-dialog-action:focus-visible {
    background: rgba(34, 86, 110, .88);
}

@media (max-width: 700px) {
    .site-info-card {
        width: min(100vw - .8rem, 1000px);
        max-height: min(94dvh, 1000px);
        padding: 1.2rem 1rem 1.1rem;
    }
    .site-info-card h1 {
        max-width: none;
        font-size: clamp(1.45rem, 6.4vw, 1.9rem);
    }
    .site-info-richtext {
        font-size: .79rem;
    }
    .site-info-guide-disclosure {
        padding: .72rem .75rem .78rem;
    }
    .site-info-guide-content {
        max-height: min(44dvh, 360px);
    }
    .site-dialog-actions {
        justify-content: stretch;
    }
    .site-dialog-action {
        width: 100%;
    }
}

/* Phase 25.3.4 - dedicated information page with full-width integrated guide. */
.mobile-setting-actions .mobile-setting-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .42rem .52rem;
    border: 1px solid rgba(141, 187, 205, .2);
    border-radius: 10px;
    background: rgba(7, 12, 16, .6);
    color: #dceef5;
    text-decoration: none;
    text-align: center;
    font: inherit;
}
.mobile-setting-actions .mobile-setting-link:hover,
.mobile-setting-actions .mobile-setting-link:focus-visible {
    color: #f6fdff;
    border-color: rgba(102, 200, 238, .34);
    background: rgba(19, 32, 41, .8);
}

.site-info-page {
    min-height: 100dvh;
    padding: clamp(1rem, 3vw, 2rem);
    background:
        radial-gradient(circle at top, rgba(36, 72, 90, .18), transparent 38%),
        linear-gradient(180deg, rgba(6, 14, 18, .98), rgba(8, 18, 24, .98));
    color: #e4f1f6;
}
.site-info-page-shell {
    width: min(1360px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: clamp(1.35rem, 2.8vw, 2.4rem) clamp(1.2rem, 3vw, 2.5rem);
    border: 1px solid rgba(123, 171, 189, .16);
    border-radius: .9rem;
    background: rgba(8, 17, 22, .94);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
}
.site-info-page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}
.site-info-page-title {
    max-width: 28ch;
    margin: 0 auto 1.2rem;
    color: #eef7fb;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: .98;
    letter-spacing: -.035em;
    text-align: center;
    text-wrap: balance;
}
.site-info-page-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2.6rem;
}
.site-info-page-section {
    padding: 1rem 0 1.15rem;
    border-top: 1px solid rgba(120, 158, 174, .14);
}
.site-info-page-project,
.site-info-page-guide {
    grid-column: 1 / -1;
}
.site-info-page-section h2 {
    margin: 0 0 .65rem;
    color: #d7ebf3;
    font-size: .82rem;
    font-weight: 650;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.site-info-guide-inline {
    margin-top: .15rem;
}
.site-info-page-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.75rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(120, 158, 174, .14);
}
.site-info-page-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0 1.2rem;
    border: 1px solid rgba(118, 183, 205, .22);
    border-radius: .5rem;
    background: rgba(16, 39, 50, .88);
    color: #e5f5fb;
    text-decoration: none;
    font-size: .84rem;
    font-weight: 620;
    letter-spacing: .012em;
}
.site-info-page-action:hover,
.site-info-page-action:focus-visible {
    background: rgba(29, 79, 100, .88);
}

/* richer markdown rendering via Markdig */
.site-info-page .site-info-richtext {
    color: #aabcc4;
    font-size: .9rem;
    line-height: 1.72;
}
.site-info-page .site-info-richtext > *:first-child { margin-top: 0; }
.site-info-page .site-info-richtext > *:last-child { margin-bottom: 0; }
.site-info-page .site-info-richtext p,
.site-info-page .site-info-richtext ul,
.site-info-page .site-info-richtext ol,
.site-info-page .site-info-richtext blockquote,
.site-info-page .site-info-richtext pre,
.site-info-page .site-info-richtext table,
.site-info-page .site-info-richtext hr {
    margin: 0 0 .92rem;
}
.site-info-page .site-info-richtext ul,
.site-info-page .site-info-richtext ol {
    padding-left: 1.25rem;
}
.site-info-page .site-info-richtext li + li {
    margin-top: .2rem;
}
.site-info-page .site-info-richtext h1,
.site-info-page .site-info-richtext h2,
.site-info-page .site-info-richtext h3,
.site-info-page .site-info-richtext h4,
.site-info-page .site-info-richtext h5,
.site-info-page .site-info-richtext h6 {
    margin: 1.3rem 0 .55rem;
    color: #e3f2f7;
    line-height: 1.16;
    text-transform: none;
    letter-spacing: -.015em;
}
.site-info-page .site-info-richtext h1 { font-size: 1.55rem; }
.site-info-page .site-info-richtext h2 { font-size: 1.18rem; }
.site-info-page .site-info-richtext h3 { font-size: 1.02rem; }
.site-info-page .site-info-richtext h4 { font-size: .96rem; }
.site-info-page .site-info-richtext h5,
.site-info-page .site-info-richtext h6 { font-size: .9rem; }
.site-info-page .site-info-richtext a {
    color: #a5ddf6;
    text-decoration: underline;
    text-decoration-color: rgba(165, 221, 246, .45);
    text-underline-offset: .16em;
}
.site-info-page .site-info-richtext a:hover,
.site-info-page .site-info-richtext a:focus-visible {
    color: #dcf6ff;
    text-decoration-color: currentColor;
}
.site-info-page .site-info-richtext code {
    padding: .1rem .32rem;
    border-radius: .28rem;
    background: rgba(33, 55, 67, .62);
    color: #dbedf4;
    font-size: .81em;
}
.site-info-page .site-info-richtext pre {
    overflow-x: auto;
    padding: .85rem .95rem;
    border: 1px solid rgba(117, 164, 182, .14);
    border-radius: .5rem;
    background: rgba(11, 22, 29, .78);
    color: #c5d7de;
    line-height: 1.55;
}
.site-info-page .site-info-richtext pre code {
    padding: 0;
    background: transparent;
}
.site-info-page .site-info-richtext blockquote {
    padding: .25rem 0 .25rem .9rem;
    border-left: 2px solid rgba(127, 187, 212, .28);
    color: #c7dae2;
}
.site-info-page .site-info-richtext hr {
    border: 0;
    border-top: 1px solid rgba(118, 160, 177, .18);
}
.site-info-page .site-info-richtext table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid rgba(117, 164, 182, .16);
    border-radius: .55rem;
    background: rgba(8, 18, 24, .52);
}
.site-info-page .site-info-richtext th,
.site-info-page .site-info-richtext td {
    padding: .55rem .7rem;
    border-bottom: 1px solid rgba(117, 164, 182, .12);
    text-align: left;
    vertical-align: top;
}
.site-info-page .site-info-richtext th {
    color: #e0f1f7;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: rgba(18, 40, 51, .56);
}
.site-info-page .site-info-richtext tr:last-child td {
    border-bottom: 0;
}
.site-info-page .site-info-richtext img {
    max-width: 100%;
    height: auto;
}
.site-info-page .site-info-richtext input[type="checkbox"] {
    margin-right: .45rem;
    accent-color: #7fd5ef;
}

@media (max-width: 900px) {
    .site-info-page-shell {
        width: min(100vw - 1rem, 1360px);
        padding: 1.1rem .95rem 1.35rem;
    }
    .site-info-page-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: .7rem;
    }
    .site-info-page-title {
        max-width: none;
        margin-bottom: .95rem;
    }
    .site-info-page-sections {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .site-info-page .site-info-richtext {
        font-size: .84rem;
    }
}

/* Phase 25.3.6 - full-screen information surface over the replay.
   It behaves like a page, but stays inside the replay route so MapLibre and
   Blazor do not have to be torn down/recreated just to read documentation. */
html.info-open,
html.info-open body {
    overflow: hidden;
}
.site-info-overlay[hidden] {
    display: none;
}
.site-info-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        radial-gradient(circle at top, rgba(33, 73, 92, .18), transparent 34%),
        linear-gradient(180deg, rgba(5, 13, 18, .995), rgba(7, 16, 21, .995));
    color: #e5f2f7;
}
.site-info-surface {
    width: min(1480px, calc(100vw - 1.4rem));
    min-height: 100dvh;
    margin: 0 auto;
    padding: 1rem clamp(1rem, 3vw, 2.8rem) 2rem;
}
.site-info-topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    margin: 0 calc(-1 * clamp(1rem, 3vw, 2.8rem)) 1.15rem;
    padding: .7rem clamp(1rem, 3vw, 2.8rem);
    border-bottom: 1px solid rgba(117, 160, 177, .14);
    background: rgba(5, 13, 18, .94);
    backdrop-filter: blur(10px);
}
.site-info-topbar-brand {
    color: #91b4c2;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.site-info-close-link {
    border: 0;
    background: transparent;
    color: #a9cfde;
    cursor: pointer;
    font: inherit;
    font-size: .76rem;
    text-decoration: underline;
    text-decoration-color: rgba(169, 207, 222, .36);
    text-underline-offset: .2em;
}
.site-info-close-link:hover,
.site-info-close-link:focus-visible {
    color: #effbff;
    text-decoration-color: currentColor;
}
.site-info-full-title {
    max-width: 32ch;
    margin: .35rem auto .28rem;
    color: #f0f8fb;
    font-size: clamp(1.85rem, 3.8vw, 2.8rem);
    line-height: .96;
    font-weight: 670;
    letter-spacing: -.035em;
    text-align: center;
    text-wrap: balance;
}
.site-info-full-version {
    margin-bottom: 1.4rem;
    color: #819da8;
    font-size: .72rem;
    text-align: center;
    letter-spacing: .03em;
}
.site-info-full-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 2.8rem;
}
.site-info-full-section {
    min-width: 0;
    padding: 1rem 0 1.15rem;
    border-top: 1px solid rgba(117, 160, 177, .14);
}
.site-info-full-wide {
    grid-column: 1 / -1;
}
.site-info-full-section > h2 {
    margin: 0 0 .65rem;
    color: #d8eaf1;
    font-size: .8rem;
    font-weight: 690;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.site-info-full-guide {
    padding-top: 1.2rem;
}
.site-info-bottom-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.3rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(117, 160, 177, .14);
}
.site-info-bottom-close {
    min-height: 2.7rem;
    padding: 0 1.25rem;
    border: 1px solid rgba(116, 181, 204, .22);
    border-radius: .48rem;
    background: rgba(17, 43, 55, .82);
    color: #e5f5fa;
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
    font-weight: 650;
}
.site-info-bottom-close:hover,
.site-info-bottom-close:focus-visible {
    background: rgba(30, 81, 102, .9);
}

/* Markdig output inside the information surface. */
.site-info-overlay .site-info-richtext {
    color: #aebfc6;
    font-size: .9rem;
    line-height: 1.72;
}
.site-info-overlay .site-info-richtext > *:first-child { margin-top: 0; }
.site-info-overlay .site-info-richtext > *:last-child { margin-bottom: 0; }
.site-info-overlay .site-info-richtext p,
.site-info-overlay .site-info-richtext ul,
.site-info-overlay .site-info-richtext ol,
.site-info-overlay .site-info-richtext blockquote,
.site-info-overlay .site-info-richtext pre,
.site-info-overlay .site-info-richtext table,
.site-info-overlay .site-info-richtext hr {
    margin: 0 0 .92rem;
}
.site-info-overlay .site-info-richtext ul,
.site-info-overlay .site-info-richtext ol {
    padding-left: 1.3rem;
}
.site-info-overlay .site-info-richtext li + li {
    margin-top: .2rem;
}
.site-info-overlay .site-info-richtext h1,
.site-info-overlay .site-info-richtext h2,
.site-info-overlay .site-info-richtext h3,
.site-info-overlay .site-info-richtext h4,
.site-info-overlay .site-info-richtext h5,
.site-info-overlay .site-info-richtext h6 {
    margin: 1.45rem 0 .58rem;
    color: #e4f2f7;
    line-height: 1.16;
    font-weight: 680;
    text-transform: none;
    letter-spacing: -.015em;
}
.site-info-overlay .site-info-richtext h1 { font-size: 1.58rem; }
.site-info-overlay .site-info-richtext h2 { font-size: 1.2rem; }
.site-info-overlay .site-info-richtext h3 { font-size: 1.05rem; }
.site-info-overlay .site-info-richtext h4 { font-size: .97rem; }
.site-info-overlay .site-info-richtext h5,
.site-info-overlay .site-info-richtext h6 { font-size: .91rem; }
.site-info-overlay .site-info-richtext a {
    color: #a6ddf5;
    text-decoration: underline;
    text-decoration-color: rgba(166, 221, 245, .44);
    text-underline-offset: .16em;
}
.site-info-overlay .site-info-richtext a:hover,
.site-info-overlay .site-info-richtext a:focus-visible {
    color: #e2f8ff;
    text-decoration-color: currentColor;
}
.site-info-overlay .site-info-richtext code {
    padding: .1rem .31rem;
    border-radius: .28rem;
    background: rgba(32, 55, 67, .62);
    color: #dcecf3;
    font-size: .82em;
}
.site-info-overlay .site-info-richtext pre {
    overflow-x: auto;
    padding: .85rem .95rem;
    border: 1px solid rgba(117, 164, 182, .14);
    border-radius: .48rem;
    background: rgba(10, 21, 28, .78);
    color: #c6d8df;
    line-height: 1.55;
}
.site-info-overlay .site-info-richtext pre code {
    padding: 0;
    background: transparent;
}
.site-info-overlay .site-info-richtext blockquote {
    padding: .25rem 0 .25rem .9rem;
    border-left: 2px solid rgba(128, 189, 213, .3);
    color: #c7dbe2;
}
.site-info-overlay .site-info-richtext hr {
    border: 0;
    border-top: 1px solid rgba(117, 160, 177, .18);
}
.site-info-overlay .site-info-richtext table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid rgba(117, 164, 182, .16);
    background: rgba(7, 17, 23, .48);
}
.site-info-overlay .site-info-richtext th,
.site-info-overlay .site-info-richtext td {
    padding: .56rem .7rem;
    border: 1px solid rgba(117, 164, 182, .12);
    text-align: left;
    vertical-align: top;
}
.site-info-overlay .site-info-richtext th {
    color: #e1f0f6;
    font-size: .78rem;
    background: rgba(17, 40, 51, .55);
}
.site-info-overlay .site-info-richtext img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 900px) {
    .site-info-surface {
        width: calc(100vw - .5rem);
        padding: .75rem .9rem 1.5rem;
    }
    .site-info-topbar {
        margin: 0 -.9rem .9rem;
        padding: .65rem .9rem;
    }
    .site-info-full-title {
        max-width: none;
        font-size: clamp(1.6rem, 7vw, 2rem);
    }
    .site-info-full-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .site-info-full-wide {
        grid-column: 1;
    }
    .site-info-overlay .site-info-richtext {
        font-size: .84rem;
    }
    .site-info-overlay .site-info-richtext table {
        display: block;
        overflow-x: auto;
        white-space: normal;
    }
    .site-info-bottom-close {
        width: 100%;
    }
}

/* Phase 25.3.7 - information overlay must own pointer/touch/scroll input.
   The replay layout deliberately uses pointer-events:none on its main shell so
   the JS-owned MapLibre canvas can receive empty-map interactions. The
   full-screen information surface therefore has to opt back in explicitly. */
html.info-open .site-info-overlay,
html.info-open .site-info-overlay .site-info-surface,
.site-info-overlay:not([hidden]),
.site-info-overlay:not([hidden]) .site-info-surface {
    pointer-events: auto !important;
}

.site-info-overlay {
    height: 100dvh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-gutter: stable;
    isolation: isolate;
}

.site-info-surface {
    position: relative;
    pointer-events: auto;
    touch-action: pan-y;
}

/* While information is open, the replay underneath is intentionally inert.
   This also protects against MapLibre receiving wheel/pointer input through
   transparent portions of the information surface. */
html.info-open .js-owned-map-surface,
html.info-open .maplibregl-map,
html.info-open .maplibregl-canvas,
html.info-open .replay-workspace,
html.info-open .map-first-workspace,
html.info-open .map-tools,
html.info-open .floating-panel,
html.info-open .timeline-overlay,
html.info-open .diagnostics-panel,
html.info-open .mobile-replay-bar,
html.info-open .mobile-sheet,
html.info-open .mobile-sheet-scrim {
    pointer-events: none !important;
}

/* The information surface itself must remain interactive after the broad
   replay lock above. */
html.info-open .site-info-overlay,
html.info-open .site-info-overlay * {
    pointer-events: auto;
}

/* Phase 25.3.8 - embedded README navigation and natural Markdown code blocks. */
.site-info-overlay .site-info-richtext pre {
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow-x: auto;
    overflow-y: visible;
    box-sizing: border-box;
    white-space: pre-wrap;
}
.site-info-overlay .site-info-guide-inline h1,
.site-info-overlay .site-info-guide-inline h2,
.site-info-overlay .site-info-guide-inline h3,
.site-info-overlay .site-info-guide-inline h4,
.site-info-overlay .site-info-guide-inline h5,
.site-info-overlay .site-info-guide-inline h6 {
    scroll-margin-top: 5rem;
}

/* Phase 25.3.9 - compact entity palette, tabbed ATCAS/NADGE, media waveform,
   responsive top HUD, favicon support and information alignment experiment. */
.sources-panel {
    width: 320px;
}
.sources-panel .floating-panel-content {
    padding-top: .32rem;
}
.sources-panel .general-layer-group {
    padding-top: .18rem;
    padding-bottom: .38rem;
}

.entity-source-tabs {
    display: flex;
    align-items: flex-end;
    gap: 0;
    margin: .1rem 0 0;
    border-bottom: 1px solid rgba(123, 160, 175, .22);
}
.entity-source-tab {
    position: relative;
    min-width: 72px;
    margin: 0 0 -1px;
    padding: .34rem .72rem .31rem;
    border: 1px solid transparent;
    border-bottom-color: rgba(123, 160, 175, .22);
    border-radius: .42rem .42rem 0 0;
    background: transparent;
    color: #8298a2;
    font-size: .66rem;
    font-weight: 650;
    letter-spacing: .035em;
    cursor: pointer;
}
.entity-source-tab:hover:not(:disabled) {
    color: #d7e9ef;
    background: rgba(34, 57, 67, .24);
}
.entity-source-tab.active {
    border-color: rgba(123, 160, 175, .22);
    border-bottom-color: #101d24;
    background: #101d24;
    color: #e8f5f9;
}
.entity-source-tab:disabled {
    opacity: .42;
    cursor: default;
}
.entity-source-pane[hidden] {
    display: none !important;
}
.entity-source-pane {
    padding-top: .22rem;
}
.entity-source-pane .display-section {
    padding-bottom: .35rem;
}
.entity-calibration-divider {
    height: 1px;
    margin: .14rem 0 0;
    background: rgba(129, 164, 178, .12);
}
.sources-panel .entity-calibration-heading {
    margin: .28rem 0 .06rem;
    padding: .32rem 0 .1rem;
    border-top: 0;
}
.sources-panel .entity-calibration-group {
    gap: .35rem;
    padding: .18rem 0 .35rem .48rem;
}
.sources-panel .source-select-inline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .55rem;
}
.sources-panel .source-select-inline > span {
    min-width: 58px;
}
.sources-panel .source-select-inline select {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.sources-panel .nadge-spatial-calibration-control {
    margin-top: .05rem;
}

/* NADGE sites remain in one shared box, but use the same visual rhythm as the
   ATCAS extractor rows. */
.sources-panel .nadge-site-groups {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: .18rem;
    padding: .22rem .3rem;
}
.sources-panel .nadge-site-box {
    min-height: 25px;
    display: grid;
    grid-template-columns: 13px 9px minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    gap: .24rem;
    padding: .13rem .08rem;
    font-size: .62rem;
    line-height: 1.2;
}
.sources-panel .nadge-site-box input {
    grid-row: 1;
}
.sources-panel .nadge-site-box .nadge-source-system-dot {
    grid-row: 1;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    box-shadow: 0 0 6px currentColor;
}
.sources-panel .nadge-site-box .nadge-source-system-name {
    grid-column: 3;
    grid-row: 1;
}
.sources-panel .nadge-site-box small {
    display: none;
}

.sources-panel .communications-heading {
    margin-top: .15rem;
}
.communications-source-group {
    padding-bottom: .28rem;
}
.media-now-playing {
    margin-top: .28rem;
}
.media-now-playing-copy {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .32rem;
}
.media-compact-waveform {
    width: 100%;
    height: 32px;
    margin-bottom: .28rem;
    overflow: hidden;
    border-radius: .34rem;
    background: rgba(7, 16, 21, .54);
    border: 1px solid rgba(118, 161, 178, .12);
}
.media-compact-waveform-svg {
    width: 100%;
    height: 100%;
    display: block;
}
.media-compact-waveform-shape {
    fill: #7dbbd1;
    opacity: .72;
}
.media-compact-waveform-progress {
    stroke: #f1d06d;
    stroke-width: 1.1;
    vector-effect: non-scaling-stroke;
}

/* When collapsed, the palette header is genuinely compact rather than keeping
   the two-line open-state height. */
.sources-panel:not([open]) {
    width: 112px;
}
.sources-panel:not([open]) > summary {
    min-height: 34px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: .34rem .55rem;
}
.sources-panel:not([open]) .panel-summary-subtitle {
    display: none;
}
.sources-panel:not([open]) .panel-summary-title {
    font-size: .76rem;
}

/* Medium desktop widths: avoid a large empty first row in the top HUD. */
@media (min-width: 861px) and (max-width: 1320px) {
    :root { --top-offset: 118px; }
    .map-tools {
        width: fit-content;
        max-width: min(860px, calc(100vw - 20px));
    }
    .map-tools-main {
        width: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: .42rem .6rem;
    }
    .replay-toolbar-group {
        flex: 0 1 auto;
        width: auto;
        justify-content: flex-end;
    }
    .map-toolbar-group {
        margin-left: 0;
    }
    .map-tools-meta {
        width: auto;
        min-width: min(100%, 520px);
        margin-left: auto;
    }
    .maplibregl-ctrl-top-right { top: 122px !important; }
}

/* Information layout experiment requested for author and changelog. */
.site-info-full-section.site-info-align-right {
    text-align: right;
}
.site-info-full-section.site-info-align-right .site-info-richtext,
.site-info-full-section.site-info-align-right .site-info-richtext p,
.site-info-full-section.site-info-align-right .site-info-richtext ul,
.site-info-full-section.site-info-align-right .site-info-richtext ol {
    text-align: right;
}

@media (max-width: 700px) {
    .sources-panel:not([open]) { width: 108px; }
    .site-info-full-section.site-info-align-right,
    .site-info-full-section.site-info-align-right .site-info-richtext,
    .site-info-full-section.site-info-align-right .site-info-richtext p,
    .site-info-full-section.site-info-align-right .site-info-richtext ul,
    .site-info-full-section.site-info-align-right .site-info-richtext ol {
        text-align: left;
    }
}
.media-now-playing {
    display: block;
}


/* Phase 25.3.10 - entity panel label cleanup and NADGE site compacting. */
.sources-panel .nadge-site-groups {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: .18rem;
    padding: .22rem .28rem;
}
.sources-panel .nadge-site-box {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    gap: .24rem;
    margin: 0;
    padding: .13rem .08rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #adbec5;
    font-size: .62rem;
    line-height: normal;
}
.sources-panel .nadge-site-box input {
    width: 13px;
    height: 13px;
    margin: 0;
    flex: 0 0 13px;
}
.sources-panel .nadge-site-box .nadge-source-system-dot {
    width: 8px;
    height: 8px;
    margin: 0;
    flex: 0 0 8px;
    border-radius: 999px;
    box-shadow: 0 0 6px currentColor;
}
.sources-panel .nadge-site-box .nadge-source-system-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sources-panel .nadge-site-box:hover {
    background: rgba(44, 63, 73, .48);
}
.sources-panel .nadge-site-box small { display: none; }

/* Phase 25.3.11 - keep the requested right-aligned Information sections
   without breaking Markdown list geometry. */
.site-info-full-section.site-info-align-right > h2,
.site-info-full-section.site-info-align-right .site-info-richtext > p {
    text-align: right;
}
.site-info-full-section.site-info-align-right .site-info-richtext > ul,
.site-info-full-section.site-info-align-right .site-info-richtext > ol {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: 0;
    padding-left: 1.25rem;
    text-align: left;
    list-style-position: outside;
}
.site-info-full-section.site-info-align-right .site-info-richtext > ul li,
.site-info-full-section.site-info-align-right .site-info-richtext > ol li,
.site-info-full-section.site-info-align-right .site-info-richtext > blockquote,
.site-info-full-section.site-info-align-right .site-info-richtext > pre,
.site-info-full-section.site-info-align-right .site-info-richtext > table {
    text-align: left;
}

@media (max-width: 700px) {
    .site-info-full-section.site-info-align-right > h2,
    .site-info-full-section.site-info-align-right .site-info-richtext > p {
        text-align: left;
    }
    .site-info-full-section.site-info-align-right .site-info-richtext > ul,
    .site-info-full-section.site-info-align-right .site-info-richtext > ol {
        width: auto;
        margin-left: 0;
        margin-right: 0;
    }
}


/* Phase 25.3.12 - normalize right-aligned changelog Markdown.
   The admin content may legitimately be a paragraph (version) followed by a
   Markdown list. Native outside list markers do not share the paragraph's
   right-alignment box, so render the changelog bullets explicitly. */
.site-info-full-section.site-info-changelog .site-info-richtext {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.site-info-full-section.site-info-changelog .site-info-richtext > p {
    width: 100%;
    margin: 0 0 .34rem;
    text-align: right;
}
.site-info-full-section.site-info-changelog .site-info-richtext > ul {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: right;
}
.site-info-full-section.site-info-changelog .site-info-richtext > ul > li {
    margin: 0;
    padding: 0;
    text-align: right;
}
.site-info-full-section.site-info-changelog .site-info-richtext > ul > li::before {
    content: "•";
    display: inline-block;
    margin-right: .52rem;
    color: #aebfc6;
}
.site-info-full-section.site-info-changelog .site-info-richtext > ul > li + li {
    margin-top: .28rem;
}
.site-info-full-section.site-info-changelog .site-info-richtext > ol {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    list-style-position: inside;
    text-align: right;
}
.site-info-full-section.site-info-changelog .site-info-richtext > ol > li {
    text-align: right;
}

@media (max-width: 700px) {
    .site-info-full-section.site-info-changelog .site-info-richtext > p,
    .site-info-full-section.site-info-changelog .site-info-richtext > ul,
    .site-info-full-section.site-info-changelog .site-info-richtext > ul > li,
    .site-info-full-section.site-info-changelog .site-info-richtext > ol,
    .site-info-full-section.site-info-changelog .site-info-richtext > ol > li {
        text-align: left;
    }
}

/* Phase 25.3.13 - maintenance screen centering fix. */
.maintenance-card .site-language-copy-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.maintenance-card h1 {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.maintenance-card p,
.maintenance-card .maintenance-tagline {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}


/* Phase 25.3.14 - maintenance language visibility and more compact title. */
.maintenance-card [data-site-language][hidden] {
    display: none !important;
}
.maintenance-card h1 {
    max-width: 18ch;
    font-size: clamp(1.5rem, 4vw, 2.15rem);
    line-height: 1.08;
}

/* Phase 25.3.16 - mobile timeline sizing and inspector action cleanup. */
.clear-selection-mobile-label {
    display: none;
}

@media (max-width: 760px), (pointer: coarse) and (max-width: 980px) {
    /* Compact and expanded timeline must project events on the same horizontal
       time axis. In compact mode there is no label column, so the scenario
       overlay starts at the same x-origin as ruler, playhead and scrubber. */
    html.mobile-layout-active:not(.mobile-timeline-expanded) .timeline-scenario-overlay {
        left: 0;
        right: 0;
    }

    /* On phones the captions become unreadable when several documentary events
       are close together. Keep clean, colour-coded touch markers; in the
       expanded timeline the caption of the focused marker can still be shown. */
    html.mobile-layout-active .timeline-scenario-event-marker {
        width: 18px;
        min-width: 18px;
        transform: translateX(-9px);
    }
    html.mobile-layout-active .timeline-scenario-event-marker::before {
        left: 8px;
        width: 2px;
    }
    html.mobile-layout-active .timeline-scenario-event-marker span {
        display: none !important;
    }
    html.mobile-layout-active.mobile-timeline-expanded .timeline-scenario-event-marker:focus span {
        display: block !important;
        left: 14px;
        max-width: min(220px, 62vw);
    }
    html.mobile-layout-active.mobile-timeline-expanded .timeline-scenario-event-marker.label-left:focus span {
        left: auto;
        right: 14px;
    }

    /* The detailed mobile timeline is content-sized. The previous fixed
       viewport-based height left a large empty tail below the scrubber on
       tall phones. Keep only a maximum height so richer timelines can scroll. */
    html.mobile-timeline-expanded .timeline-overlay {
        height: auto !important;
        min-height: 0;
        max-height: min(46dvh, 360px) !important;
    }
    html.mobile-timeline-expanded .timeline-axis-area {
        touch-action: none;
    }

    /* "Altro" is the explicit entry point to inspector + search + analysis
       tools. Two columns make the longer label discoverable instead of clipped. */
    .mobile-setting-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* There must be only one close affordance for the sheet. The inspector's
       other action clears the selected entity, so keep it away from the top-
       right close button and present it as a secondary textual action. */
    #inspectorPanel.mobile-sheet-active .panel-action-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-items: start;
        align-items: start;
        gap: .28rem;
        padding-right: 3.1rem;
        padding-bottom: .55rem;
    }
    #inspectorPanel.mobile-sheet-active .clear-selection-desktop-glyph {
        display: none;
    }
    #inspectorPanel.mobile-sheet-active .clear-selection-mobile-label {
        display: inline;
    }
    #inspectorPanel.mobile-sheet-active #clearSelectionButton {
        width: auto;
        min-width: 0;
        height: auto;
        min-height: 30px;
        margin: 0;
        padding: .28rem .48rem;
        border-color: rgba(120, 171, 192, .18);
        border-radius: .45rem;
        background: rgba(16, 36, 45, .34);
        box-shadow: none;
        color: #9bb2bc;
        font-size: .61rem;
        font-weight: 600;
        line-height: 1.15;
        letter-spacing: 0;
        text-transform: none;
        white-space: nowrap;
    }
}

/* Phase 25.3.23: the NADGE anomalies tab is already a separate pane, so it
   should not inherit the generic in-pane separator used by stacked sections. */
.nadge-inspector-pane[data-nadge-pane="track-anomalies"] .nadge-kinematic-section {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}
