/* Semantic Reusable Component Classes for SongApp.Web (rules.md §5.4 — Zero hardcoded hex literals in Razor views) */

*, *::before, *::after {
    box-sizing: border-box;
}

h1:focus,
h1:focus-visible,
h2:focus,
h2:focus-visible,
h3:focus,
h3:focus-visible,
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
    outline: none;
    box-shadow: none;
}

html {
    scroll-behavior: auto;
    overflow-x: clip;
}

section[id],
article[id],
div[id],
h2[id],
h3[id] {
    scroll-margin-top: 4.5rem;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--stage-bg-canvas);
    background-image:
        radial-gradient(ellipse 80% 50% at 18% -10%, var(--stage-glow-sky), transparent 60%),
        radial-gradient(ellipse 65% 40% at 88% 0%, var(--stage-glow-cue), transparent 55%);
    background-repeat: no-repeat;
    color: var(--stage-text-primary);
    font-family: var(--token-font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--stage-accent-chord);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre {
    font-family: var(--token-font-mono);
}

.inline-code {
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-subtle);
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    font-size: 0.88em;
    color: var(--stage-accent-chord);
}

.code-block {
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-subtle);
    border-radius: var(--token-radius-pill);
    padding: var(--token-space-md);
    overflow-x: auto;
    font-size: 0.9rem;
    color: var(--stage-text-primary);
    margin: var(--token-space-sm) 0;
}

/* Header & Navigation */
body.nav-drawer-open {
    overflow: hidden;
    overscroll-behavior: contain;
}

.site-header {
    border-bottom: 1px solid var(--stage-border-hairline);
    position: sticky;
    top: 0;
    z-index: 40;
}

/* Keep backdrop-filter on ::before rather than .site-header so fixed mobile drawer & backdrop span the full 100dvh viewport.
   Avoid mobile per-frame compositor blur overhead; apply crisp translucent dark bar on <980px and restore light blur on desktop. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: rgba(9, 13, 22, 0.96);
    pointer-events: none;
}

.site-nav {
    max-width: var(--token-studio-max-width);
    margin: 0 auto;
    padding: 0.55rem 0.65rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem 1.25rem;
}

.site-nav-brand-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.site-nav-mobile-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.site-nav-desktop-lang {
    display: none;
}

.site-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(2, 6, 23, 0.72);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.site-nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease, visibility 0s;
}

.site-nav-collapse {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(86vw, 340px);
    height: 100dvh;
    z-index: 120;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0 0 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--stage-bg-card);
    border-left: 1px solid var(--stage-border-subtle);
    box-shadow: var(--stage-shadow-hero);
    transform: translate3d(100%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.22s;
}

.site-nav-collapse.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}

.site-nav-drawer-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--stage-bg-card);
    border-bottom: 1px solid var(--stage-border-hairline);
}

.site-nav-drawer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 0.98rem;
    color: var(--stage-text-primary);
}

.site-nav-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-bg-elevated);
    color: var(--stage-text-primary);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.site-nav-drawer-close:hover {
    border-color: var(--stage-border-glow-sky);
    color: var(--stage-accent-chord);
}

.site-nav-section-label {
    padding: 0.5rem 1rem 0.1rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stage-text-muted);
}

.site-nav-collapse .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.22rem;
    padding: 0 0.75rem;
}

.site-nav-collapse .nav-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    font-size: 0.94rem;
}

.site-nav-collapse .nav-pill::after {
    content: "›";
    font-size: 1.05rem;
    line-height: 1;
    color: var(--stage-text-muted);
    opacity: 0.7;
}

.site-nav-collapse .nav-pill.active::after,
.site-nav-collapse .nav-pill-accent::after {
    color: currentColor;
    opacity: 0.9;
}

.site-nav-collapse .nav-pill.active {
    border-left: 3px solid var(--stage-accent-chord);
}

.site-nav-right {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.22rem;
    margin-top: 0.25rem;
    padding: 0 0.75rem;
    border-top: none;
}

.site-nav-divider {
    display: none;
    width: 1px;
    height: 22px;
    background-color: var(--stage-border-subtle);
    margin: 0 0.25rem;
}

.site-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 9px;
    border: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-bg-elevated);
    color: var(--stage-text-primary);
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.site-nav-toggle .burger-icon-close {
    display: none;
}

.site-nav-toggle[aria-expanded="true"] .burger-icon-bars {
    display: none;
}

.site-nav-toggle[aria-expanded="true"] .burger-icon-close {
    display: block;
}

/* 5-Language Switcher Dropdown & Footer Pills */
.lang-switcher {
    position: relative;
    display: inline-flex;
}

summary.lang-switcher-btn,
.lang-switcher-btn {
    list-style: none;
    list-style-type: none;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 28px;
    padding: 0.16rem 0.48rem;
    border-radius: var(--token-radius-round);
    border: 1px solid var(--stage-border-hairline);
    background-color: transparent;
    color: var(--stage-text-secondary);
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.lang-switcher-btn::-webkit-details-marker,
.lang-switcher-btn::marker {
    display: none;
    content: "";
}

.lang-globe-icon {
    color: var(--stage-text-muted);
    flex-shrink: 0;
    transition: color 0.14s ease;
}

.lang-chevron-icon {
    color: var(--stage-text-muted);
    flex-shrink: 0;
    transition: transform 0.16s ease, color 0.16s ease;
}

.lang-switcher-btn:hover .lang-globe-icon,
.lang-switcher[open] .lang-globe-icon {
    color: var(--stage-accent-chord);
}

.lang-switcher[open] .lang-chevron-icon {
    transform: rotate(180deg);
    color: var(--stage-accent-chord);
}

.lang-switcher-btn:hover,
.lang-switcher[open] .lang-switcher-btn {
    border-color: var(--stage-border-glow-sky);
    background-color: var(--stage-bg-elevated);
    color: var(--stage-text-primary);
}

.lang-switcher-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 80;
    min-width: 176px;
    max-width: calc(100vw - 1.5rem);
    padding: 0.32rem;
    border-radius: 11px;
    background-color: var(--stage-bg-card);
    border: 1px solid var(--stage-border-glow-sky);
    box-shadow: var(--stage-shadow-hero);
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.lang-switcher-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    padding: 0.4rem 0.55rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--stage-text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.lang-option-main {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.lang-switcher-option:hover,
.lang-switcher-option.is-active {
    background-color: var(--stage-tint-sky);
    color: var(--stage-accent-chord);
    text-decoration: none;
}

.lang-code-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 0.12rem 0.36rem;
    border-radius: 6px;
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-subtle);
    font-family: var(--token-font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--stage-text-muted);
}

.lang-switcher-option.is-active .lang-code-tag {
    border-color: var(--stage-border-glow-sky);
    color: var(--stage-accent-chord);
}

.lang-check-icon {
    opacity: 0;
    color: var(--stage-accent-chord);
    flex-shrink: 0;
}

.lang-switcher-option.is-active .lang-check-icon {
    opacity: 1;
}

.footer-lang-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.footer-lang-pill {
    padding: 0.2rem 0.55rem;
    border-radius: var(--token-radius-round);
    border: 1px solid var(--stage-border-subtle);
    color: var(--stage-text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.footer-lang-pill:hover,
.footer-lang-pill.is-active {
    border-color: var(--stage-border-glow-sky);
    background-color: var(--stage-tint-sky);
    color: var(--stage-accent-chord);
    text-decoration: none;
}

.brand-link {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--stage-text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--stage-tint-sky), var(--stage-tint-cue));
    border: 1px solid var(--stage-border-glow-sky);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--stage-accent-chord);
    flex-shrink: 0;
}

.brand-logo-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.site-footer .brand-logo-img {
    width: 30px;
    height: 30px;
    border-radius: 7px;
}

.brand-link:hover {
    text-decoration: none;
    color: var(--stage-accent-chord);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.nav-pill {
    padding: 0.42rem 0.82rem;
    border-radius: var(--token-radius-round);
    color: var(--stage-text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
    white-space: nowrap;
}

.nav-pill:hover, .nav-pill.active {
    color: var(--stage-text-primary);
    background-color: var(--stage-bg-toolbar);
    border-color: var(--stage-border-hairline);
    text-decoration: none;
}

.nav-pill-accent {
    color: var(--stage-cta-primary-fg);
    background-color: var(--stage-cta-primary-bg);
    border-color: var(--stage-cta-primary-bg);
    font-weight: 700;
}

.nav-pill-accent:hover, .nav-pill-accent.active {
    background-color: var(--stage-cta-primary-hover);
    color: var(--stage-cta-primary-fg);
    border-color: var(--stage-cta-primary-hover);
}

.nav-pill-workspace {
    color: var(--stage-text-secondary);
    background-color: var(--stage-bg-elevated);
    border-color: var(--stage-border-hairline);
}

.nav-pill-workspace.active, .nav-pill-workspace:hover {
    color: var(--stage-accent-chord);
    border-color: var(--stage-border-glow-sky);
    background-color: var(--stage-tint-sky);
}

.nav-pill-admin {
    color: var(--stage-accent-cue);
    background-color: var(--stage-tint-cue);
    border-color: var(--stage-border-glow-cue);
}

.nav-pill-admin.active, .nav-pill-admin:hover {
    color: var(--stage-text-primary);
    border-color: var(--stage-accent-cue);
    background-color: var(--stage-bg-toolbar);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.72rem;
    border-radius: var(--token-radius-round);
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-hairline);
    font-size: 0.84rem;
    color: var(--stage-text-secondary);
}

.user-chip strong {
    color: var(--stage-text-primary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 980px) {
    .site-nav {
        padding: 0.72rem 1.5rem;
    }

    .site-nav-brand-bar {
        width: auto;
    }

    .site-nav-mobile-actions {
        display: none;
    }

    .site-nav-desktop-lang {
        display: inline-flex;
    }

    .site-nav-toggle,
    .site-nav-backdrop,
    .site-nav-drawer-header,
    .site-nav-section-label {
        display: none;
    }

    .site-nav-collapse,
    .site-nav-collapse.is-open {
        position: static;
        width: auto;
        height: auto;
        z-index: auto;
        display: flex;
        flex: 1 1 auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.7rem;
        padding: 0;
        overflow: visible;
        background: transparent;
        border: none;
        box-shadow: none;
        transform: none;
        visibility: visible;
        pointer-events: auto;
        transition: none;
    }

    .site-nav-collapse .nav-links {
        flex-direction: row;
        align-items: center;
        gap: 0.35rem;
        padding: 0;
    }

    .site-nav-collapse .nav-pill {
        display: inline-flex;
        width: auto;
        min-height: 0;
        padding: 0.42rem 0.82rem;
        border-radius: var(--token-radius-round);
        font-size: 0.9rem;
    }

    .site-nav-collapse .nav-pill::after {
        display: none;
    }

    .site-nav-collapse .nav-pill.active {
        border-left: 1px solid var(--stage-border-hairline);
    }

    .site-nav-right {
        margin-top: 0;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
        border-top: none;
    }

    .site-nav-divider {
        display: block;
    }
}

/* Mobile-First Main Shell, Containers & Step-Up Grids */
.portal-shell {
    width: 100%;
    max-width: var(--token-max-width);
    margin: 0 auto;
    padding: 0.7rem 0.45rem 1.75rem;
}

.portal-shell-studio {
    width: 100%;
    max-width: var(--token-studio-max-width);
    margin: 0 auto;
    padding: 0.15rem 0.4rem 1.5rem;
}

.portal-shell > *,
.portal-shell-studio > *,
.portal-sidebar-layout > *,
.repertoire-studio-grid > *,
.stage-card,
.bento-card,
.showcase-window {
    min-width: 0;
}

.stage-card {
    background-color: var(--stage-bg-card);
    border: 1px solid var(--stage-border-hairline);
    border-radius: 13px;
    padding: 0.78rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--stage-shadow-card);
}

.stage-card-featured {
    border-color: var(--stage-border-glow-sky);
    border-width: 1px;
    background: linear-gradient(160deg, var(--stage-bg-card), var(--stage-bg-elevated));
}

.stage-card-band-highlight {
    border-color: var(--stage-accent-cue);
    border-width: 2px;
    background: linear-gradient(160deg, var(--stage-bg-card), var(--stage-bg-elevated));
}

.band-confirm-inline {
    background-color: var(--stage-tint-cue);
    border: 1px solid var(--stage-accent-cue);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    margin-top: 0.5rem;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.18;
    margin: 0.35rem 0 0.75rem 0;
}

.text-secondary {
    color: var(--stage-text-secondary);
}

.text-muted {
    color: var(--stage-text-muted);
    font-size: 0.9rem;
}

.text-chord {
    color: var(--stage-accent-chord);
}

.text-cue {
    color: var(--stage-accent-cue);
}

.text-green {
    color: var(--stage-sync-green);
}

.text-danger {
    color: var(--stage-sync-red);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
    align-items: stretch;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
    align-items: stretch;
}

.grid-2 > .stage-card,
.grid-3 > .stage-card,
.grid-2 > .ast-chart-surface,
.grid-3 > .ast-chart-surface,
.role-grid > .stage-card {
    height: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.grid-2 > .stage-card > .toolbar-row:last-child,
.grid-3 > .stage-card > .toolbar-row:last-child,
.grid-2 > .ast-chart-surface > .pill-badge:last-child,
.grid-3 > .ast-chart-surface > .pill-badge:last-child {
    margin-top: auto;
    align-self: flex-start;
}

@media (min-width: 680px) {
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 720px) {
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--token-space-lg);
    }

    .portal-shell {
        padding: var(--token-space-xl) 1.5rem;
    }

    .portal-shell-studio {
        padding: 0.25rem 1.5rem 2.5rem;
    }

    .stage-card {
        padding: var(--token-space-lg);
        margin-bottom: var(--token-space-lg);
        border-radius: var(--token-radius-card);
    }
}

@media (min-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--token-space-lg);
    }
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--token-space-sm);
    margin: var(--token-space-sm) 0;
}

.split-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--token-space-md);
    margin-bottom: var(--token-space-md);
}

/* Buttons & Inputs */
.stage-btn {
    min-height: var(--token-touch-min);
    padding: 0.56rem 1.08rem;
    border-radius: var(--token-radius-pill);
    border: 1px solid var(--stage-border-strong);
    background-color: rgba(30, 41, 59, 0.72);
    color: var(--stage-text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-shadow: inset 0 1px 0 var(--stage-surface-card-top);
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.stage-btn:hover {
    border-color: var(--stage-border-glow-sky);
    background-color: var(--stage-bg-toolbar);
    text-decoration: none;
    transform: translateY(-1px);
}

.stage-btn:active {
    transform: translateY(0);
}

.stage-btn-accent {
    background: linear-gradient(180deg, #52C8FA 0%, var(--stage-cta-primary-bg) 100%);
    color: var(--stage-cta-primary-fg);
    border-color: rgba(125, 211, 252, 0.7);
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.stage-btn-accent:hover {
    background: linear-gradient(180deg, #7DD3FC 0%, #38BDF8 100%);
    border-color: var(--stage-cta-primary-hover);
    color: var(--stage-cta-primary-fg);
    box-shadow: 0 10px 26px rgba(56, 189, 248, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.stage-btn-cue {
    background-color: var(--stage-tint-cue);
    color: var(--stage-accent-cue);
    border-color: var(--stage-border-glow-cue);
}

.stage-btn-cue:hover {
    background-color: rgba(251, 191, 36, 0.18);
    border-color: var(--stage-accent-cue);
}

.stage-btn-danger {
    background-color: var(--stage-bg-elevated);
    color: var(--stage-sync-red);
    border-color: var(--stage-sync-red);
}

.stage-btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.16);
    color: #FCA5A5;
    border-color: var(--stage-sync-red);
}

.stage-input, .stage-textarea {
    width: 100%;
    min-height: var(--token-touch-min);
    padding: 0.6rem 0.85rem;
    border-radius: var(--token-radius-pill);
    border: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-bg-elevated);
    color: var(--stage-text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.stage-textarea {
    min-height: 220px;
    font-family: var(--token-font-mono);
    font-size: 0.88rem;
    line-height: 1.45;
    resize: vertical;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--token-space-sm);
}

.status-banner {
    background-color: var(--stage-bg-toolbar);
    border: 1px solid var(--stage-accent-cue);
    border-radius: var(--token-radius-pill);
    padding: 0.65rem 1rem;
    color: var(--stage-accent-cue);
    font-weight: 600;
    margin-bottom: var(--token-space-md);
}

.status-banner-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.32rem 0.72rem;
    font-size: 0.83rem;
    line-height: 1.25;
    margin-bottom: 0.65rem;
    max-width: 100%;
}

.status-banner-dismiss {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.78;
    cursor: pointer;
    padding: 0 0.2rem;
    font-size: 0.85rem;
    line-height: 1;
    border-radius: 4px;
}

.status-banner-dismiss:hover {
    opacity: 1;
    background-color: rgba(251, 191, 36, 0.16);
}

/* Badges & Tables */
.cue-badge {
    color: var(--stage-accent-cue);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: var(--token-radius-pill);
    border: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-bg-elevated);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--stage-accent-chord);
}

.stage-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--token-space-sm);
}

.stage-table th, .stage-table td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--stage-border-subtle);
}

.stage-table th {
    color: var(--stage-accent-cue);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Repertoire Master/Detail List */
.repertoire-item {
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.45rem;
    border-radius: var(--token-radius-pill);
    border: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-bg-elevated);
    color: var(--stage-text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.repertoire-item:hover, .repertoire-item-active {
    border-color: var(--stage-accent-chord);
    background-color: var(--stage-bg-toolbar);
}

.repertoire-item-body {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.repertoire-item-note {
    font-size: 0.84rem;
    line-height: 1.3;
    margin-top: 0.15rem;
    overflow: hidden;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.web-zoom-control {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.14rem 0.22rem;
    border-radius: var(--token-radius-pill);
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-subtle);
}

.web-zoom-scrub-btn {
    cursor: ew-resize;
    user-select: none;
    touch-action: none;
    min-width: 68px;
    justify-content: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.web-zoom-scrub-btn:hover,
.web-zoom-scrub-btn.is-scrubbing {
    border-color: var(--stage-accent-chord);
    background-color: rgba(56, 189, 248, 0.16);
    color: var(--stage-text-primary);
}

.web-zoom-scrub-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Flush Full-Width Sidebar Navigation Tabs (Songs | Sets | Libraries) + Action Row */
.stage-card.repertoire-sidebar-pane {
    position: relative;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.repertoire-sidebar-body {
    padding: 0.85rem;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-top-tabs {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    margin: 0;
    border-bottom: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-bg-toolbar);
    flex-shrink: 0;
}

.sidebar-top-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-width: 0;
    padding: 0.68rem 0.65rem;
    background: transparent;
    border: none;
    border-bottom: 2.5px solid transparent;
    border-right: 1px solid var(--stage-border-hairline);
    color: var(--stage-text-secondary);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.sidebar-top-tab-library {
    justify-content: flex-start;
    padding: 0.68rem 0.7rem;
}

.sidebar-top-tab-library-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}

.sidebar-top-tab:last-child {
    border-right: none;
}

.sidebar-top-tab:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--stage-text-primary);
}

.sidebar-top-tab.is-active {
    color: var(--stage-accent-chord);
    border-bottom-color: var(--stage-accent-chord);
    background-color: rgba(56, 189, 248, 0.08);
}

.sidebar-top-tab.is-active-cue {
    color: var(--stage-accent-cue);
    border-bottom-color: var(--stage-accent-cue);
    background-color: rgba(251, 191, 36, 0.08);
}

.sidebar-library-dropdown {
    margin: -0.35rem 0 0.65rem 0;
    padding: 0.5rem;
    border-radius: var(--token-radius-pill);
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-glow-sky);
    box-shadow: var(--stage-shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-library-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sidebar-library-item {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.42rem 0.6rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--stage-text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.sidebar-library-item:hover {
    background-color: var(--stage-bg-toolbar);
    color: var(--stage-text-primary);
}

.sidebar-library-item.is-selected {
    background-color: rgba(56, 189, 248, 0.14);
    border-color: var(--stage-border-glow-sky);
    color: var(--stage-accent-chord);
}

.sidebar-action-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.sidebar-action-row > .stage-btn {
    flex: 1;
    justify-content: center;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--stage-border-hairline);
    background-color: var(--stage-bg-card);
    margin-top: var(--token-space-xl);
    padding: 2rem 0.9rem 1.75rem;
}

.site-footer-inner {
    max-width: var(--token-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    color: var(--stage-text-muted);
    font-size: 0.9rem;
}

.site-footer-col h4 {
    margin: 0 0 0.7rem 0;
    color: var(--stage-text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.site-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.site-footer-col a {
    color: var(--stage-text-secondary);
}

.site-footer-col a:hover {
    color: var(--stage-accent-chord);
}

.site-footer-contact {
    margin-top: 0.75rem !important;
    gap: 0.3rem !important;
    font-size: 0.86rem;
}

.site-footer-bottom-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
}

.footer-cookie-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--stage-text-muted);
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
}

.footer-cookie-link:hover {
    color: var(--stage-accent-chord);
}

.cookie-consent-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: 780px;
    margin: 0 auto;
    z-index: 950;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.15rem;
    padding: 0.85rem 1.05rem;
    border-radius: 12px;
    background: var(--stage-bg-card);
    border: 1px solid var(--stage-border-subtle);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.cookie-consent-banner[hidden] {
    display: none;
}

.cookie-consent-text {
    margin: 0;
    flex: 1 1 280px;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--stage-text-secondary);
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-footer-bottom {
    max-width: var(--token-max-width);
    margin: 1.75rem auto 0 auto;
    padding-top: 1.15rem;
    border-top: 1px solid var(--stage-border-hairline);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    color: var(--stage-text-muted);
    font-size: 0.82rem;
}

@media (min-width: 560px) {
    .site-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 860px) {
    .site-footer {
        padding: 2.75rem 1.5rem 2.25rem;
    }

    .site-footer-inner {
        grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(150px, 1fr));
        gap: 2rem;
    }
}

/* ============================================================================
   Wide Repertoire Master/Detail + 1:1 Web Song Studio (ADR-015, FR-9.4, FR-9.5)
   ============================================================================ */

.repertoire-studio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.repertoire-sidebar-scroll {
    max-height: 38vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

@media (min-width: 980px) {
    .repertoire-studio-grid {
        grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
        gap: var(--token-space-lg);
    }

    .repertoire-sidebar-scroll {
        max-height: 74vh;
    }
}

.stage-btn-sm {
    min-height: 36px;
    padding: 0.35rem 0.72rem;
    font-size: 0.85rem;
}

.stage-btn-success {
    background-color: var(--stage-sync-green);
    color: var(--stage-bg-canvas);
    border-color: var(--stage-sync-green);
    font-weight: 800;
}

.stage-btn-success:hover {
    background-color: #34D399;
    color: var(--stage-bg-canvas);
    border-color: #A7F3D0;
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.28);
}

.stage-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Interactive Web Modals (Drum Groove Builder & Custom Chord Creator) */
.web-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    background-color: var(--stage-backdrop-scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.web-modal-dialog {
    width: min(96vw, 1380px);
    max-height: 92vh;
    overflow-y: auto;
    background-color: var(--stage-bg-card);
    border: 2px solid var(--stage-accent-chord);
    border-radius: var(--token-radius-card);
    padding: 1.15rem 1.35rem;
}

.web-modal-dialog-narrow {
    width: min(95vw, 680px);
}

/* ============================================================================
   Pro Fullscreen Studio Mode (Image 1 Repertoire & Image 2 Song/Setlist Editor)
   + Web Setlist Builder & Locked Over-Quota Setlist Chips
   ============================================================================ */

body:has(.web-studio-fullscreen-active) {
    overflow: hidden;
}

body:has(.web-studio-fullscreen-active) .site-header,
body:has(.web-studio-fullscreen-active) .site-footer,
body:has(.web-studio-fullscreen-active) .site-announcement-bar {
    display: none !important;
}

.web-repertoire-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 90;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 0.45rem 0.6rem;
    gap: 0.65rem;
    background-color: var(--stage-bg-canvas);
    align-items: stretch;
    overflow: hidden;
}

@media (min-width: 980px) {
    .web-repertoire-fullscreen {
        grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
        gap: 0.65rem;
    }

    .web-repertoire-fullscreen.web-sidebar-collapsed {
        grid-template-columns: minmax(0, 1fr);
    }
}

.web-repertoire-fullscreen.web-sidebar-collapsed > .repertoire-sidebar-pane {
    display: none;
}

.web-repertoire-fullscreen > .repertoire-pane-card {
    height: 100%;
    margin-bottom: 0;
    padding: 0.55rem 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.web-repertoire-fullscreen > .stage-card.repertoire-sidebar-pane {
    padding: 0;
}

.web-repertoire-fullscreen .repertoire-sidebar-body {
    padding: 0.6rem 0.7rem;
}

.web-repertoire-fullscreen .web-pdf-toolbar {
    padding: 0.42rem 0.7rem;
    gap: 0.45rem;
}

.web-repertoire-fullscreen .repertoire-sidebar-scroll {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
}

.repertoire-detail-scroll {
    min-height: 0;
}

.web-repertoire-fullscreen .repertoire-detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.web-repertoire-fullscreen .web-annot-stage-wrap,
.web-editor-fullscreen .web-editor-pdf-stage,
.web-editor-fullscreen .web-editor-pdf-stage > .web-annot-stage-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.repertoire-chart-toolbar {
    margin-top: 0;
    margin-bottom: 0.65rem;
    gap: 0.3rem;
}

.repertoire-chart-toolbar .stage-btn-sm {
    min-height: 30px;
    padding: 0.18rem 0.46rem;
    font-size: 0.77rem;
    white-space: nowrap;
}

.repertoire-chart-toolbar .web-zoom-control .stage-btn-sm {
    padding: 0.18rem 0.38rem;
}

.repertoire-chart-toolbar .stage-input {
    min-height: 30px;
    padding: 0.16rem 0.42rem;
    font-size: 0.77rem;
}

.repertoire-locked-set-btn {
    opacity: 0.72;
    border-style: dashed;
}

/* Dedicated zero-CLS borderless notification rail between site nav and Studio header bar */
.studio-top-notice-rail {
    height: 1.75rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.studio-top-notice-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    min-width: 0;
    padding: 0 0.15rem;
    color: var(--stage-accent-cue);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    animation: studio-notice-pulse-twice 0.55s ease-in-out 2;
}

.studio-top-notice-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--stage-accent-cue);
    flex-shrink: 0;
}

.studio-top-notice-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.studio-top-notice-item .status-banner-dismiss {
    flex-shrink: 0;
}

@keyframes studio-notice-pulse-twice {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.28;
    }
}

@media (prefers-reduced-motion: reduce) {
    .studio-top-notice-item {
        animation: none;
    }
}

/* Compact Workspace Header (Web Song Studio) */
.studio-header-bar {
    background-color: var(--stage-bg-card);
    border: 1px solid var(--stage-border-hairline);
    border-radius: var(--token-radius-card);
    padding: 0.85rem 1.15rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.toggle-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-hairline);
    border-radius: var(--token-radius-pill);
}

.login-shell {
    max-width: 980px;
    margin: 1rem auto;
    padding: 0 0.9rem;
}

@media (min-width: 720px) {
    .login-shell {
        margin: 1.5rem auto;
        padding: 0 1.5rem;
    }
}

.pill-badge-cue {
    color: var(--stage-accent-cue);
    border-color: var(--stage-border-glow-cue);
    background-color: var(--stage-tint-cue);
}

.pill-badge-green {
    color: var(--stage-sync-green);
    border-color: var(--stage-sync-green);
    background-color: var(--stage-tint-green);
}

.pill-badge-red {
    color: var(--stage-sync-red);
    border-color: var(--stage-sync-red);
    background-color: var(--stage-tint-red);
}

.table-scroll-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stage-btn.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

@keyframes stage-spin {
    to { transform: rotate(360deg); }
}

.stage-spinner {
    width: 0.95rem;
    height: 0.95rem;
    border: 2px solid var(--stage-border-subtle);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: stage-spin 0.75s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

.stage-spinner-lg {
    width: 2.25rem;
    height: 2.25rem;
    border-width: 3px;
    color: var(--stage-accent-chord);
}

.status-banner-busy {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.web-studio-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 25, 0.55);
    pointer-events: all;
}

.web-busy-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: 220px;
    max-width: 360px;
    padding: 1.4rem 1.8rem;
    border-radius: 12px;
    border: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-surface-card);
    color: var(--stage-text-primary);
    box-shadow: var(--stage-shadow-card);
    font-weight: 600;
    text-align: center;
}

/* ============================================================================
   Global Blazor Error UI Bar (Fix: globally hidden by default across all layouts)
   ============================================================================ */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: auto;
    max-width: min(92vw, 540px);
    padding: 0.72rem 2.6rem 0.72rem 1.15rem;
    border-radius: 12px;
    background-color: var(--stage-bg-elevated);
    border: 1px solid var(--stage-border-glow-cue);
    color: var(--stage-text-primary);
    box-shadow: var(--stage-shadow-hero);
    font-size: 0.9rem;
    font-weight: 500;
    box-sizing: border-box;
}

#blazor-error-ui .reload {
    margin-left: 0.65rem;
    color: var(--stage-accent-chord);
    font-weight: 700;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--stage-text-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
}

#blazor-error-ui .dismiss:hover {
    color: var(--stage-text-primary);
    background-color: var(--stage-bg-toolbar);
}

/* ============================================================================
   Site-Wide Announcement / Beta Notice Bar (SuperAdmin-Managed)
   ============================================================================ */
.site-announcement-bar {
    width: 100%;
    border-bottom: 1px solid var(--stage-border-subtle);
    background-color: var(--stage-bg-elevated);
    color: var(--stage-text-primary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.site-announcement-preview {
    border: 1px solid var(--stage-border-subtle);
    border-radius: var(--token-radius-pill);
    overflow: hidden;
}

.banner-admin-preview-wrap {
    padding: 0.85rem 1rem;
    border-radius: var(--token-radius-card);
    background-color: var(--stage-bg-canvas);
    border: 1px solid var(--stage-border-subtle);
}

.site-announcement-tone-amber {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.14) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-bottom-color: rgba(251, 191, 36, 0.34);
}

.site-announcement-tone-sky {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.14) 0%, rgba(14, 165, 233, 0.08) 100%);
    border-bottom-color: rgba(56, 189, 248, 0.34);
}

.site-announcement-tone-green {
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.14) 0%, rgba(34, 197, 94, 0.08) 100%);
    border-bottom-color: rgba(74, 222, 128, 0.34);
}

.site-announcement-tone-red {
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.16) 0%, rgba(239, 68, 68, 0.09) 100%);
    border-bottom-color: rgba(248, 113, 113, 0.38);
}

.site-announcement-inner {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0.58rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

.site-announcement-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    text-align: center;
    flex: 1 1 auto;
}

.site-announcement-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.52rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background-color: var(--stage-accent-cue);
    color: var(--stage-bg-canvas);
}

.site-announcement-tone-sky .site-announcement-badge {
    background-color: var(--stage-accent-chord);
}

.site-announcement-tone-green .site-announcement-badge {
    background-color: var(--stage-sync-green);
}

.site-announcement-tone-red .site-announcement-badge {
    background-color: var(--stage-danger);
    color: #ffffff;
}

.site-announcement-text {
    color: var(--stage-text-primary);
    font-weight: 500;
}

.site-announcement-link {
    font-weight: 700;
    color: var(--stage-accent-cue);
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.site-announcement-tone-sky .site-announcement-link {
    color: var(--stage-accent-chord);
}

.site-announcement-tone-green .site-announcement-link {
    color: var(--stage-sync-green);
}

.site-announcement-tone-red .site-announcement-link {
    color: var(--stage-danger);
}

.site-announcement-close {
    background: transparent;
    border: 1px solid transparent;
    color: var(--stage-text-secondary);
    cursor: pointer;
    font-size: 0.86rem;
    line-height: 1;
    padding: 0.25rem 0.42rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.site-announcement-close:hover {
    color: var(--stage-text-primary);
    border-color: var(--stage-border-subtle);
    background-color: rgba(255, 255, 255, 0.06);
}







/* ============================================================================
   Mobile Drawer Structure, Site-Wide Mobile Density, Micro-Badges, Dots,
   Editorial Jump TOC, & Responsive Admin Cards / Pagination
   ============================================================================ */
.site-nav-user-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 0.25rem 0.25rem;
    border-top: 1px solid var(--stage-border-hairline);
}

.site-nav-user-actions .user-chip {
    min-width: 0;
    max-width: 100%;
    padding: 0.24rem 0.55rem;
    font-size: 0.78rem;
}

@media (min-width: 980px) {
    .site-nav-right {
        flex: 0 1 auto;
        margin-top: 0;
        padding: 0;
        gap: 0.5rem;
    }

    .site-nav-user-actions {
        margin-top: 0;
        display: inline-flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
        border-top: none;
    }

    .site-nav-user-actions .user-chip {
        padding: 0.3rem 0.72rem;
        font-size: 0.84rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-nav-collapse,
    .site-nav-backdrop {
        transition: none;
    }
}

/* Mobile-First Inner Padding Reductions (Desktop step-ups restored >= 740px) */
.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================================
   Desktop Header Blur, Mobile Drawer Submenus & Subtab / Account Responsive Views
   ============================================================================ */
.site-nav-desktop-only,
.site-nav-collapse .nav-pill.site-nav-desktop-only {
    display: none;
}

.site-nav-mobile-only {
    display: block;
}

.site-nav-submenu {
    width: 100%;
}

summary.site-nav-submenu-trigger::-webkit-details-marker,
summary.site-nav-submenu-trigger::marker {
    display: none;
    content: "";
}

.site-nav-collapse .nav-pill.site-nav-submenu-trigger {
    width: 100%;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    list-style: none;
}

.site-nav-collapse .nav-pill.site-nav-submenu-trigger::after {
    display: none;
}

.site-nav-submenu-chevron {
    flex-shrink: 0;
    color: var(--stage-text-muted);
    transition: transform 0.16s ease, color 0.16s ease;
}

details.site-nav-submenu[open] .site-nav-submenu-chevron,
.site-nav-submenu.is-open .site-nav-submenu-chevron {
    transform: rotate(180deg);
    color: var(--stage-accent-chord);
}

.site-nav-sublinks {
    margin: 0.22rem 0 0.35rem 0.85rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--stage-border-subtle);
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

div.site-nav-submenu:not(.is-open) > .site-nav-sublinks {
    display: none;
}

.site-nav-sublink {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0.45rem 0.72rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--stage-text-secondary);
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.site-nav-sublink:hover {
    background-color: var(--stage-bg-toolbar);
    color: var(--stage-text-primary);
    text-decoration: none;
}

.site-nav-sublink.active {
    background-color: var(--stage-tint-sky);
    color: var(--stage-accent-chord);
}

.site-nav-sublink-danger {
    color: var(--stage-sync-red);
}

.site-nav-sublink-danger:hover,
.site-nav-sublink-danger.active {
    background-color: var(--stage-tint-red);
    color: var(--stage-sync-red);
}

@media (min-width: 980px) {
    .site-header::before {
        background-color: var(--stage-header-glass);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .site-nav-desktop-only,
    .site-nav-collapse .nav-pill.site-nav-desktop-only {
        display: inline-flex;
    }

    .site-nav-mobile-only {
        display: none;
    }
}

.mobile-subtab-select-wrap {
    display: block;
    margin-bottom: 0.85rem;
}

.mobile-subtab-select-wrap .stage-input {
    width: 100%;
}

.desktop-subtabs-bar {
    display: none;
}

.account-desktop-table-wrap {
    display: none;
}

.account-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

@media (min-width: 720px) {
    .mobile-subtab-select-wrap {
        display: none;
    }

    .desktop-subtabs-bar {
        display: flex;
    }

    .account-desktop-table-wrap {
        display: block;
    }

    .account-mobile-cards {
        display: none;
    }
}
