:root {
    --report-shell-z: 900;
    --report-progress-h: 3px;
    --report-header-h: 44px;
    --report-sidebar-w: 240px;
}

html {
    scroll-padding-top: calc(var(--nav-height, 80px) + var(--report-progress-h) + var(--report-header-offset, var(--report-header-h)) + 16px);
}

body.report-shell {
    --report-header-offset: var(--report-header-h);
}

body.report-shell.report-header-collapsed {
    --report-header-offset: 0px;
}

.report-progress {
    position: fixed;
    top: var(--nav-height, 80px);
    left: 0;
    height: var(--report-progress-h);
    width: 0;
    z-index: var(--report-shell-z);
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    box-shadow: 0 0 8px rgba(184, 168, 138, 0.35);
    transition: width .15s ease;
}

.report-header {
    position: fixed;
    top: calc(var(--nav-height, 80px) + var(--report-progress-h));
    left: 0;
    right: 0;
    height: var(--report-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 24px;
    background: rgba(250, 250, 248, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--report-border, rgba(212, 207, 198, 0.3));
    z-index: var(--report-shell-z);
    transition: transform .25s ease, opacity .25s ease;
}

.report-header__brand {
    font-family: var(--serif);
    font-size: 1rem;
    letter-spacing: 0.14em;
    color: var(--gold-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.report-header__title {
    font-size: .78rem;
    color: var(--warm-gray);
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: center;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.report-header__status {
    font-family: var(--font-mono, var(--sans));
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .12em;
    color: #9A4040;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

body.report-shell.report-header-collapsed .report-header {
    transform: translateY(calc(-1 * var(--report-header-h)));
    opacity: 0;
    pointer-events: none;
}

.report-sidebar {
    position: fixed;
    top: calc(var(--nav-height, 80px) + var(--report-progress-h) + var(--report-header-h));
    left: 0;
    right: auto;
    width: var(--report-sidebar-w);
    height: calc(100vh - var(--nav-height, 80px) - var(--report-progress-h) - var(--report-header-h));
    display: block;
    justify-content: initial;
    align-items: initial;
    flex-direction: column;
    background: var(--white);
    border-right: 1px solid var(--report-border, rgba(212, 207, 198, 0.3));
    overflow-y: auto;
    z-index: var(--report-shell-z);
    padding: 20px 0;
    box-shadow: var(--shadow-1);
    transition: transform .3s ease, top .25s ease, height .25s ease;
}

.lang-switcher {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
    height: auto !important;
    display: block !important;
    width: auto !important;
    justify-content: initial !important;
    align-items: initial !important;
    padding: 32px 20px 16px !important;
}

body.report-shell.report-header-collapsed .report-sidebar {
    top: calc(var(--nav-height, 80px) + var(--report-progress-h));
    height: calc(100vh - var(--nav-height, 80px) - var(--report-progress-h));
}

.report-sidebar a {
    display: block;
    padding: 8px 20px;
    font-size: .78rem;
    color: var(--charcoal);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all .2s ease;
    line-height: 1.4;
}

.report-sidebar a:hover,
.report-sidebar a.active {
    color: var(--gold-dark);
    border-left-color: var(--gold);
    background: var(--gold-bg);
}

.report-sidebar__label {
    font-size: .65rem;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: .15em;
    padding: 16px 20px 4px;
    font-weight: 600;
}

.report-main {
    margin-left: var(--report-sidebar-w);
    margin-top: calc(var(--nav-height, 80px) + var(--report-progress-h) + var(--report-header-h));
    transition: margin-top .25s ease;
}

body.report-shell.report-header-collapsed .report-main {
    margin-top: calc(var(--nav-height, 80px) + var(--report-progress-h));
}

.report-sidebar-overlay {
    display: none;
}

.report-sidebar-toggle {
    display: none;
}

.report-lang-footer__summary {
    display: none;
}

body.report-shell #floating-cta.cta-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (max-width: 768px) {
    :root {
        --report-header-h: 41px;
    }

    .report-header {
        padding: 0 16px;
    }

    .report-header__brand {
        font-size: .84rem;
    }

    .report-header__title {
        font-size: .68rem;
    }

    .report-header__status {
        font-size: .58rem;
    }

    .report-sidebar {
        width: min(84vw, 320px);
        transform: translateX(-100%);
        box-shadow: var(--shadow-3);
    }

    .report-sidebar.open {
        transform: translateX(0);
    }

    .report-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: calc(var(--report-shell-z) - 1);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .report-sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .report-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
        border: 1px solid rgba(201, 168, 76, 0.3);
        border-radius: 10px;
        background: rgba(6, 8, 16, 0.45);
        backdrop-filter: blur(10px);
        color: #C9A84C;
        font-size: 18px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
        cursor: pointer;
        z-index: calc(var(--report-shell-z) + 1);
    }

    .report-main {
        margin-left: 0;
    }

    .report-lang-footer {
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .report-lang-footer__label {
        margin-bottom: 10px;
        font-size: .66rem;
    }

    .report-lang-footer--collapsible .report-lang-footer__summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        width: 100%;
        margin: 0;
        padding: 12px 14px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        color: rgba(255, 255, 255, 0.88);
        text-align: left;
        cursor: pointer;
    }

    .report-lang-footer--collapsible .report-lang-footer__summary-main {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .report-lang-footer--collapsible .report-lang-footer__summary-label {
        font-size: .74rem;
        color: rgba(255, 255, 255, 0.66);
    }

    .report-lang-footer--collapsible .report-lang-footer__summary-current {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 28px;
        padding: 0 10px;
        border-radius: 999px;
        border: 1px solid rgba(201, 168, 76, 0.34);
        background: rgba(201, 168, 76, 0.16);
        color: var(--bauhinia-gold);
        font-size: .72rem;
        font-weight: 600;
        line-height: 1;
    }

    .report-lang-footer--collapsible .report-lang-footer__summary-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 28px;
        padding: 0 10px;
        border-radius: 999px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.82);
        font-size: .72rem;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
    }

    .report-lang-footer--collapsible .report-lang-footer__grid {
        display: none;
    }

    .report-lang-footer--collapsible.is-open .report-lang-footer__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        max-width: none;
        margin-top: 12px;
    }

    .report-lang-footer__link {
        padding: 10px 12px;
        font-size: .74rem;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    body.report-shell #floating-cta {
        bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .4s ease, visibility .4s ease, transform .4s ease;
        transform: translateY(12px);
    }

    body.report-shell #floating-cta.cta-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    html[dir="rtl"] body.report-shell #floating-cta {
        bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
        left: 12px !important;
        right: auto !important;
    }

    html[dir="rtl"] .report-sidebar-toggle {
        left: auto;
        right: 20px;
    }

    body.report-shell.report-footer-visible #floating-cta {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(12px);
    }
}
