:root {
    --radio-bg: #07131e;
    --radio-panel: #0c1d2b;
    --radio-panel-raised: #102538;
    --radio-line: rgba(89, 171, 194, .2);
    --radio-line-strong: rgba(89, 171, 194, .38);
    --radio-text: #e4f0f5;
    --radio-muted: #8fa8b9;
    --radio-blue: #2997ff;
    --radio-cyan: #00d4ff;
    --radio-green: #3ddc97;
    --radio-amber: #ffbe55;
    --radio-red: #ff5577;
}

.radio-shell,
.mud-dialog.radio-dialog { color-scheme: dark; }

/* Follow the two existing boot gates, then leave the page to the router. */
.radio-startup,
.radio-startup-session,
html[data-radio-startup] #app > :is(.loading-console-wrap, .app-auth-bootstrap),
#app:has(> .app-auth-bootstrap) + .radio-startup .radio-startup-runtime {
    display: none;
}

html[data-radio-startup] #app:has(> :is(.loading-console-wrap, .app-auth-bootstrap)) + .radio-startup {
    display: grid;
}

#app:has(> .app-auth-bootstrap) + .radio-startup .radio-startup-session {
    display: inline;
}

.radio-startup {
    min-height: 100svh;
    box-sizing: border-box;
    place-items: center;
    padding: 24px;
    color: var(--radio-text);
    color-scheme: dark;
    background: radial-gradient(ellipse at 50% 38%, #143749, var(--radio-bg) 68%);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    text-align: center;
}

.radio-startup-content { width: min(100%, 360px); }
.radio-startup-record {
    position: relative;
    display: grid;
    width: clamp(106px, 26vmin, 156px);
    aspect-ratio: 1;
    margin: 0 auto clamp(16px, 4vmin, 28px);
    place-items: center;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, #0c1d2b 0 5px, #183346 6px, #0b1925 7px);
    box-shadow: 0 0 44px #00d4ff1c, 0 12px 32px #0007;
}

/* Spin the record's highlights while keeping the station mark readable. */
.radio-startup-record::before {
    position: absolute;
    inset: 0;
    border: 2px solid var(--radio-line-strong);
    border-top-color: #ff4fc8;
    border-right-color: #ff9b54;
    border-bottom-color: var(--radio-cyan);
    border-radius: inherit;
    background: conic-gradient(from 24deg, transparent, #b0edff30, transparent 32% 64%, #b0edff20, transparent 90%);
    content: "";
    animation: radio-startup-spin 2.6s linear infinite;
}

.radio-startup-record img { position: relative; display: block; width: 48%; height: auto; }
.radio-startup-brand {
    margin: 0 0 8px;
    color: var(--radio-cyan);
    font: 700 .69rem/1.4 ui-monospace, Menlo, monospace;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.radio-startup-title { margin: 0; font-size: clamp(1.75rem, 6vw, 2.6rem); font-weight: 750; line-height: 1.1; }
.radio-startup-status { margin: 12px 0 0; color: var(--radio-muted); font-size: .9rem; }

/* Keep the track in place during session restore so the centered artwork doesn't jump. */
.radio-startup-progress {
    width: min(200px, 70%);
    height: 3px;
    margin: 17px auto 0;
    overflow: hidden;
    border-radius: 99px;
    background: var(--radio-line);
}
.radio-startup-progress::before {
    display: block;
    width: var(--blazor-load-percentage, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff4fc8, var(--radio-cyan));
    content: "";
    transition: width 140ms linear;
}
#app:has(> .app-auth-bootstrap) + .radio-startup .radio-startup-progress {
    visibility: hidden;
}

@keyframes radio-startup-spin { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
    .radio-startup-record::before { animation: none; }
    .radio-startup-progress::before { transition: none; }
}

/* The shared app shell locks document scrolling; radio pages grow with their control panels. */
html:has(.radio-shell), body:has(.radio-shell) {
    height: auto;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-color: #24677b #07131e;
}

/* Radio uses the same compact, data-forward shell as the workforce consoles. */
.radio-shell {
    min-height: 100dvh;
    color: var(--radio-text);
    background: radial-gradient(ellipse at 50% -20%, #123447 0, var(--radio-bg) 55%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.radio-shell-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 7px clamp(14px, 3vw, 36px);
    border-bottom: 1px solid var(--radio-line);
    background: rgba(7, 16, 25, .96);
    backdrop-filter: blur(14px);
}

.radio-shell-brand { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; color: inherit; text-decoration: none; white-space: nowrap; }
.radio-shell-brand > span:last-child { display: grid; gap: 1px; }
.radio-shell-brand small { color: var(--radio-muted); font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.radio-shell-brand strong { color: #f1f7fa; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.radio-shell-mark { display: grid; width: 34px; height: 34px; place-items: center; overflow: hidden; border: 1px solid #ed48a5; border-radius: 4px; color: #fff; background: linear-gradient(145deg, #e432a2, #883be8 58%, #247ef4); box-shadow: 0 0 16px #d333a244; }
.radio-shell-mark svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.6; }

.radio-shell-header nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.radio-shell-header nav a { padding: 7px 9px; border: 1px solid transparent; border-radius: 4px; color: #b7cbd6; font-size: .76rem; text-decoration: none; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
.radio-shell-header nav a:hover { color: #e8fbff; background: rgba(31, 102, 124, .16); }
.radio-shell-header nav a.active { border-color: var(--radio-line-strong); color: #e8fbff; background: rgba(31, 102, 124, .28); }
.radio-shell-header nav a:focus-visible, .radio-shell-brand:focus-visible { outline: 2px solid var(--radio-cyan); outline-offset: 2px; }
.radio-shell-main { width: min(1440px, 100%); margin: 0 auto; padding: clamp(16px, 2.4vw, 30px) clamp(14px, 2.4vw, 30px) 48px; }

/* Dialogs are rendered through MudBlazor's provider outside the page section. */
.mud-dialog.radio-dialog { overflow: hidden; border: 1px solid var(--radio-line-strong); border-radius: 8px; color: var(--radio-text); background: var(--radio-panel); box-shadow: 0 24px 72px rgba(0, 0, 0, .52); }
.mud-dialog.radio-dialog .mud-dialog-title { border-bottom: 1px solid var(--radio-line); color: #f1f7fa; background: #0a1722; }
.mud-dialog.radio-dialog .mud-dialog-content { color: #cfe0e8; }
.mud-dialog.radio-dialog .mud-dialog-actions { gap: 8px; border-top: 1px solid var(--radio-line); background: #0a1722; }
.mud-dialog.radio-dialog .mud-input-outlined-border { border-color: var(--radio-line-strong); }
.mud-dialog.radio-dialog .mud-input-control > .mud-input-control-input-container > .mud-input { background: rgba(5, 19, 29, .58); }
.mud-dialog.radio-dialog .mud-button-root { min-height: 40px; text-transform: none; letter-spacing: normal; }
.mud-dialog.radio-dialog .mud-button-root.mud-button-filled-primary { color: #07111d; background: var(--radio-cyan); }
.mud-dialog.radio-dialog .mud-button-outlined { border-color: var(--radio-line-strong); }
.radio-confirm-dialog .radio-confirm-message { margin: 0; color: #cfe0e8; line-height: 1.6; }

@media (max-width: 680px) {
    .radio-shell-header { align-items: flex-start; flex-direction: column; gap: 8px; padding: 9px 12px; }
    .radio-shell-header nav { width: 100%; justify-content: flex-start; gap: 2px; }
    .radio-shell-header nav a { padding: 6px 8px; font-size: .72rem; }
}

@media (max-width: 560px) {
    .mud-dialog.radio-dialog { max-height: calc(100dvh - 20px); border-radius: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .radio-shell-header nav a { transition: none; }
}
