/* QSTOL brand header, loaded last to override legacy header locks. */
body .header-logo {
    flex: 0 0 auto !important;
}

body .header-logo a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: auto !important;
    min-width: 300px !important;
    height: 56px !important;
    min-height: 56px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #202126 !important;
    overflow: visible !important;
    text-decoration: none !important;
}

body .header-logo a::before,
body .header-logo a::after {
    content: none !important;
    display: none !important;
}

body .header-logo-mark {
    display: block !important;
    width: 150px !important;
    height: 48px !important;
    flex: 0 0 150px !important;
    object-fit: contain !important;
}

body .header-brand-text,
body .header-logo span.header-brand-text {
    position: static !important;
    z-index: auto !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    color: #202126 !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    text-shadow: none !important;
}

body .header-logo small {
    display: none !important;
}

@media (min-width: 1024px) {
    body .header-strip-inner {
        gap: 30px !important;
    }

    body .header-logo a {
        display: grid !important;
        grid-template-rows: 36px 16px !important;
        align-content: center !important;
        justify-items: start !important;
        gap: 2px !important;
        min-width: 238px !important;
        height: 66px !important;
        min-height: 66px !important;
    }

    body .header-logo-mark {
        width: 136px !important;
        height: 36px !important;
        flex: none !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        max-width: 238px !important;
        overflow: visible !important;
        font-size: 13px !important;
        line-height: 16px !important;
    }

    body .header-nav {
        gap: 28px !important;
    }
}

@media (max-width: 1280px) and (min-width: 1024px) {
    body .header-logo a {
        min-width: 210px !important;
    }

    body .header-logo-mark {
        width: 118px !important;
        height: 32px !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        max-width: 210px !important;
        font-size: 12px !important;
    }

    body .header-nav {
        gap: 20px !important;
    }
}

@media (max-width: 1023.98px) {
    body .site-header,
    body .header-strip {
        height: 62px !important;
        min-height: 62px !important;
        background: #d2051e !important;
        border-bottom: 0 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.14) !important;
    }

    body .header-strip-inner {
        display: grid !important;
        grid-template-columns: 34px minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        min-height: 62px !important;
        padding: 0 12px !important;
    }

    body .mobile-menu-toggle {
        display: block !important;
        grid-column: 1 !important;
        width: 30px !important;
        height: 30px !important;
        padding: 4px 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body .mobile-menu-toggle span {
        display: block !important;
        width: 23px !important;
        height: 2px !important;
        margin: 5px 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
    }

    body .header-logo {
        display: block !important;
        grid-column: 2 !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    body .header-logo a {
        display: grid !important;
        grid-template-rows: 28px 16px !important;
        align-content: center !important;
        justify-items: start !important;
        gap: 1px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 54px !important;
        min-height: 54px !important;
        overflow: hidden !important;
    }

    body .header-logo-mark {
        width: 98px !important;
        height: 28px !important;
        flex: none !important;
        padding: 2px 6px !important;
        background: #fff !important;
        mix-blend-mode: normal !important;
        object-fit: contain !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        color: #fff !important;
        font-size: 12px !important;
        font-weight: 900 !important;
        line-height: 16px !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
    }

    body .mobile-header-actions {
        display: flex !important;
        grid-column: 3 !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 12px !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body .mobile-header-icon {
        display: block !important;
        position: relative !important;
        width: 21px !important;
        height: 21px !important;
        flex: 0 0 21px !important;
        color: #fff !important;
    }

    body .mobile-header-user::before {
        left: 7px !important;
        top: 2px !important;
        width: 7px !important;
        height: 7px !important;
        background: #fff !important;
    }

    body .mobile-header-user::after {
        left: 4px !important;
        bottom: 3px !important;
        width: 13px !important;
        height: 8px !important;
        background: #fff !important;
    }

    body .mobile-header-docs::before {
        left: 4px !important;
        top: 4px !important;
        width: 11px !important;
        height: 10px !important;
        border-left-color: #fff !important;
        border-bottom-color: #fff !important;
    }

    body .mobile-header-docs::after {
        left: 9px !important;
        top: 2px !important;
        width: 8px !important;
        height: 12px !important;
        border-right-color: #fff !important;
        border-bottom-color: #fff !important;
    }

    body .mobile-header-search::before {
        left: 3px !important;
        top: 3px !important;
        width: 12px !important;
        height: 12px !important;
        border-color: #fff !important;
    }

    body .mobile-header-search::after {
        right: 1px !important;
        bottom: 3px !important;
        width: 9px !important;
        height: 2px !important;
        background: #fff !important;
    }
}

@media (max-width: 374.98px) {
    body .header-logo-mark {
        width: 86px !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        font-size: 11px !important;
    }

    body .mobile-header-actions {
        gap: 8px !important;
    }
}

/* Keep the mobile header visible above all page-level sticky bars. */
@media (max-width: 1023.98px) {
    body main {
        padding-top: 62px !important;
    }

    body .site-header,
    body .site-header.header-condensed {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 2300 !important;
        width: 100% !important;
        height: 62px !important;
        min-height: 62px !important;
        transform: none !important;
    }

    body .site-header .meta-nav,
    body .site-header.header-condensed .meta-nav {
        display: none !important;
        max-height: 0 !important;
    }

    body .site-header .header-strip,
    body .site-header.header-condensed .header-strip {
        height: 62px !important;
        min-height: 62px !important;
    }

    body .yt-pdp-tabs,
    body .support-page-tabs,
    body .about-tabs {
        top: 62px !important;
        z-index: 2200 !important;
    }

    body .mobile-nav-overlay {
        z-index: 2400 !important;
    }

    body .mobile-nav-panel {
        z-index: 2401 !important;
    }
}

/* Final QSTOL inline header: transparent mark + one-line brand text. */
body .header-logo a {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body .header-logo-mark {
    display: block !important;
    width: 92px !important;
    height: 28px !important;
    flex: 0 0 92px !important;
    padding: 0 !important;
    background: transparent !important;
    object-fit: contain !important;
    object-position: center !important;
}

body .header-brand-text,
body .header-logo span.header-brand-text {
    display: block !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: visible !important;
    color: #2b1970 !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    text-overflow: clip !important;
    text-shadow: none !important;
}

@media (min-width: 1024px) {
    body .header-logo a {
        display: inline-flex !important;
        min-width: 360px !important;
        height: 66px !important;
        min-height: 66px !important;
        gap: 12px !important;
    }

    body .header-logo-mark {
        width: 132px !important;
        height: 40px !important;
        flex-basis: 132px !important;
        filter: brightness(0) saturate(100%) invert(13%) sepia(95%) saturate(4794%) hue-rotate(345deg) brightness(86%) contrast(109%) !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        color: #d2051e !important;
        font-size: 16px !important;
        line-height: 1.15 !important;
    }
}

@media (max-width: 1023.98px) {
    body .header-strip-inner {
        grid-template-columns: 34px minmax(182px, 1fr) auto !important;
        gap: 7px !important;
        padding-right: 10px !important;
        padding-left: 12px !important;
        height: 62px !important;
        min-height: 62px !important;
        align-items: center !important;
    }

    body .header-logo {
        display: flex !important;
        align-items: center !important;
        min-width: 0 !important;
        height: 62px !important;
    }

    body .header-logo a {
        align-items: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: translateY(1px) !important;
    }

    body .mobile-header-actions {
        align-items: center !important;
        gap: 10px !important;
        height: 62px !important;
    }

    body .mobile-menu-toggle {
        align-self: center !important;
    }

    body .header-logo-mark {
        filter: brightness(0) invert(1) !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        color: #fff !important;
        font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif !important;
        font-weight: 600 !important;
        text-rendering: geometricPrecision !important;
        -webkit-font-smoothing: antialiased !important;
    }
}

@media (max-width: 767.98px) {
    body .header-logo-mark {
        width: 62px !important;
        height: 26px !important;
        flex-basis: 62px !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        color: #fff !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
    }

    body .header-logo span.brand-char-wide,
    body .header-logo span.brand-char-narrow,
    body .header-brand-text .brand-char-wide,
    body .header-brand-text .brand-char-narrow {
        display: inline-block !important;
        position: static !important;
        z-index: auto !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
        align-items: initial !important;
        justify-content: initial !important;
        color: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        line-height: inherit !important;
        text-shadow: inherit !important;
        transform-origin: center center !important;
    }

    body .header-logo span.brand-char-wide,
    body .header-brand-text .brand-char-wide {
        transform: scale(1.06) translateY(-0.1px) !important;
    }

    body .header-logo span.brand-char-narrow,
    body .header-brand-text .brand-char-narrow {
        transform: scale(0.96) translateY(0.2px) !important;
    }
}

@media (max-width: 374.98px) {
    body .header-strip-inner {
        grid-template-columns: 30px minmax(170px, 1fr) auto !important;
        gap: 6px !important;
        padding-right: 8px !important;
        padding-left: 10px !important;
    }

    body .header-logo-mark {
        width: 54px !important;
        height: 22px !important;
        flex-basis: 54px !important;
    }

    body .header-brand-text,
    body .header-logo span.header-brand-text {
        font-size: 11.5px !important;
    }

    body .mobile-header-actions {
        gap: 8px !important;
    }
}
