.header-pref-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header-pref-form {
    margin: 0;
    display: inline;
}

.academy-sso-chip {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, .92);
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, .34);
    text-decoration: none;
    font-family: Inter, system-ui, sans-serif;
    line-height: 1;
    cursor: pointer;
}

.academy-sso-chip:hover,
.academy-sso-chip:focus-visible {
    background: #303030;
    color: #fff;
    outline: 2px solid rgba(59, 130, 246, .72);
    outline-offset: 2px;
}

.academy-sso-icon-chip {
    width: 38px;
    padding: 0;
}

.academy-sso-currency {
    position: relative;
}

.academy-sso-currency summary {
    list-style: none;
    cursor: pointer;
}

.academy-sso-currency summary::-webkit-details-marker {
    display: none;
}

.academy-sso-currency-menu {
    position: absolute;
    right: 0;
    top: 44px;
    min-width: 108px;
    border-radius: 10px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, .34);
    background: #0f172a;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .35);
    z-index: 10000;
}

.academy-sso-currency-menu button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 7px;
    padding: 7px 9px;
    background: transparent;
    color: #f1f5f9;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.academy-sso-currency-menu button:hover,
.academy-sso-currency-menu button.is-active {
    background: #262626;
}

[data-theme="light"] .academy-sso-chip {
    background: #e5e5e5;
    color: #171717;
}

[data-theme="light"] .academy-sso-chip:hover,
[data-theme="light"] .academy-sso-chip:focus-visible {
    background: #d4d4d4;
    color: #171717;
}

[data-theme="light"] .academy-sso-currency-menu {
    background: #fff;
    border-color: #d4d4d4;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
}

[data-theme="light"] .academy-sso-currency-menu button {
    color: #171717;
}

[data-theme="light"] .academy-sso-currency-menu button:hover,
[data-theme="light"] .academy-sso-currency-menu button.is-active {
    background: #f5f5f5;
}

@media (max-width: 720px) {
    .header-pref-controls {
        gap: 6px;
    }

    .academy-sso-chip {
        height: 34px;
        padding: 0 10px;
    }

    .academy-sso-icon-chip {
        width: 34px;
    }
}

/* Logged-in LX header aligned with Academy admin shell */
.lx-topnav {
    height: 64px;
    gap: 12px;
    padding: 0 36px;
    background: #102b35;
    border-bottom: 0;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
    color: #f1f5f9;
}

.lx-brand {
    width: 240px;
    flex-shrink: 0;
    gap: 10px;
    color: #f1f5f9;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
}

.lx-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1, #22d3ee);
    color: #fff;
    box-shadow: none;
    font-size: 16px;
    font-weight: 700;
}

.lx-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lx-brand-name {
    color: #f1f5f9;
}

.lx-brand-tagline {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 500;
}

.lx-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.lx-page-title-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 220px;
    max-width: 520px;
    line-height: 1.2;
}

.lx-topnav .lx-page-title {
    color: #f8fafc;
    font-family: Inter, system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0;
    margin: 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lx-topnav .lx-page-crumbs {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    color: #818cf8;
    font-family: Inter, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.lx-topnav .admin-header-crumbs a,
.lx-page-tag-role {
    color: #818cf8;
    text-decoration: none;
}

.lx-topnav .admin-header-crumbs a:hover,
.lx-page-tag-role:hover {
    color: #a5b4fc;
    text-decoration: none;
}

.lx-topnav .admin-header-crumbs span + span {
    border-left: 1px solid rgba(148, 163, 184, .34);
    padding-left: 8px;
}

.lx-header-back,
.av2-winhdr-role-btn,
.lx-icon-btn,
.lx-topnav .academy-sso-chip {
    height: 38px;
    border-radius: 8px;
    background: rgba(15, 23, 42, .92);
    border: 1px solid rgba(148, 163, 184, .34);
    color: #f1f5f9;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
}

.lx-icon-btn,
.lx-topnav .academy-sso-icon-chip {
    width: 38px;
    padding: 0;
}

.lx-header-back {
    margin-left: 0;
    padding: 0 12px;
}

.av2-winhdr-role-btn {
    padding: 0 13px;
    max-width: 220px;
    background: rgba(6, 182, 212, .22);
    border-color: rgba(103, 232, 249, .72);
    color: #67e8f9;
}

.lx-header-back:hover,
.lx-icon-btn:hover,
.av2-winhdr-role-btn:hover,
.lx-topnav .academy-sso-chip:hover {
    background: rgba(30, 41, 59, .96);
    color: #fff;
    outline: 2px solid rgba(103, 232, 249, .45);
    outline-offset: 2px;
}

.lx-icon-btn.danger:hover {
    background: rgba(239, 68, 68, .24);
    color: #fff;
    outline-color: rgba(239, 68, 68, .72);
}

.av2-winhdr-role-dropdown {
    top: 44px;
    min-width: 240px;
    border-radius: 10px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, .34);
    background: #0f172a;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .35);
}

.av2-winhdr-role-dropdown-title {
    color: #cbd5e1;
    font-family: Inter, system-ui, sans-serif;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
}

.av2-winhdr-role-dropdown a,
.av2-winhdr-role-dropdown button {
    border-radius: 7px;
    color: #f1f5f9;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.av2-winhdr-role-dropdown a:hover,
.av2-winhdr-role-dropdown button:hover,
.av2-winhdr-role-dropdown a.active,
.av2-winhdr-role-dropdown button:disabled {
    background: rgba(6, 182, 212, .16);
    color: #fff;
}

.lx-footer {
    min-height: 34px;
    height: 34px;
    padding: 0 36px;
    background: #102b35;
    color: #cbd5e1;
    box-shadow: 0 -10px 26px rgba(0, 0, 0, .28);
    font-family: Inter, system-ui, sans-serif;
    font-size: 12px;
}

.lx-footer-page-info {
    margin: 0 auto;
}

.lx-footer-status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

[data-theme="light"] .lx-topnav,
[data-theme="light"] .lx-footer {
    background: #ffffff;
    color: #334155;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
}

[data-theme="light"] .lx-brand,
[data-theme="light"] .lx-brand-name,
[data-theme="light"] .lx-page-title {
    color: #1e293b;
}

[data-theme="light"] .lx-brand-tagline {
    color: #64748b;
}

[data-theme="light"] .lx-page-crumbs,
[data-theme="light"] .lx-page-tag-role {
    color: #4f46e5;
}

[data-theme="light"] .lx-header-back,
[data-theme="light"] .av2-winhdr-role-btn,
[data-theme="light"] .lx-icon-btn,
[data-theme="light"] .lx-topnav .academy-sso-chip {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] .av2-winhdr-role-btn {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

[data-theme="light"] .av2-winhdr-role-dropdown {
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .12);
}

[data-theme="light"] .av2-winhdr-role-dropdown-title,
[data-theme="light"] .av2-winhdr-role-dropdown a,
[data-theme="light"] .av2-winhdr-role-dropdown button {
    color: #1e293b;
}

[data-theme="light"] .av2-winhdr-role-dropdown a:hover,
[data-theme="light"] .av2-winhdr-role-dropdown button:hover,
[data-theme="light"] .av2-winhdr-role-dropdown a.active,
[data-theme="light"] .av2-winhdr-role-dropdown button:disabled {
    background: #f1f5f9;
    color: #0f172a;
}

@media (max-width: 900px) {
    .lx-brand {
        width: auto;
        padding-right: 8px;
    }

    .lx-page-title-block {
        max-width: 240px;
    }
}

@media (max-width: 640px) {
    .lx-topnav {
        gap: 8px;
        padding: 0 12px;
    }

    .lx-brand-text,
    .lx-page-title-block {
        display: none;
    }
}
