/* Shared surfaces for the public site and the mobile navigation. */
:is(body.ibh-public-body, body.ib-admin-body) {
    --ibh-focus-ring: #ad4d00;
}

html[data-theme="dark"] :is(body.ibh-public-body, body.ib-admin-body) {
    --ibh-focus-ring: #ffb36e;
}

html[data-theme="dark"] :is(body.ibh-public-body, body.ib-admin-body) select {
    color-scheme: dark;
}

html[data-theme="dark"] :is(body.ibh-public-body, body.ib-admin-body) select :is(option, optgroup) {
    color: #eef4ff !important;
    background-color: #223b59 !important;
}

html[data-theme="dark"] :is(body.ibh-public-body, body.ib-admin-body) select option:disabled {
    color: #becfe4 !important;
}
body.ibh-public-body {
    --ibh-shared-glass: rgba(255, 253, 250, .78);
    --ibh-shared-glass-strong: rgba(255, 253, 250, .93);
    --ibh-shared-rim: rgba(29, 59, 96, .13);
    --ibh-shared-shadow: 0 12px 30px #21395614, inset 0 1px 0 #ffffffa6;
    --ibh-dock-surface: rgba(255, 253, 250, .82);
    --ibh-dock-ink: #263d59;
    --ibh-dock-active: #f5822019;
}

html[data-theme="dark"] body.ibh-public-body {
    --ibh-shared-glass: rgba(41, 65, 94, .80);
    --ibh-shared-glass-strong: rgba(35, 57, 84, .96);
    --ibh-shared-rim: rgba(184, 209, 239, .26);
    --ibh-shared-shadow: 0 12px 32px #0f233e4d, inset 0 1px 0 #ffffff14;
    --ibh-dock-surface: rgba(29, 50, 77, .87);
    --ibh-dock-ink: #e6effc;
    --ibh-dock-active: #f5822026;
    --ibh-public-ink: #edf4ff;
    --ibh-public-muted: #bdcce1;
    --ibh-public-line: var(--ibh-shared-rim);
    --ibh-public-surface: var(--ibh-shared-glass-strong);
    --ibh-public-orange-soft: #f582201f;
    --ibh-night-canvas: linear-gradient(160deg, #253e5f, #1b314e);
    --ib-soft: #1c304c;
    --ib-surface: #263f5e;
    --ib-surface-2: #2d4868;
    --ib-line: #5b7290;
    --ib-text: #f0f5ff;
    --ib-muted: #bfd0e4;
    --ibh-color-page: #1c304c;
    --ibh-color-card: #263f5e;
    --ibh-color-surface: #263f5e;
    --ibh-color-subtle: #2d4868;
    --ibh-color-text: #f0f5ff;
    --ibh-color-muted: #bfd0e4;
    --ibh-color-border: #527092;
    --ib-auth-surface: #263f5e;
}

body.ibh-public-body > .ib-site-header {
    border-block-end-color: var(--ibh-shared-rim) !important;
    background: var(--ibh-shared-glass) !important;
    box-shadow: var(--ibh-shared-shadow);
    backdrop-filter: blur(20px) saturate(145%);
}

body.ibh-public-body .ib-site-header .ibh-public-nav-dropdown {
    background: var(--ibh-shared-glass-strong);
    border-color: var(--ibh-shared-rim);
    box-shadow: var(--ibh-shared-shadow);
    backdrop-filter: blur(18px) saturate(140%);
}

html[data-theme="dark"] body.ibh-public-body .ib-site-header .ib-logo-link {
    background: #fffdfa;
    border-radius: 10px;
    padding: 3px 6px;
}

html[data-theme="dark"] body.ibh-public-body .ib-site-header .ibh-theme-toggle {
    color: #f0f5ff !important;
}

body.ibh-public-body :is(
    .ib-articles-filter-panel, .ib-article-category-strip, .ib-article-card-pro,
    .ib-article-related-section, .ib-article-related-card, .ib-article-toc-card,
    .ib-radio-card, .ib-academy-path-card-phase16, .ib-academy-course-card-phase16,
    .ib-academy-development-panel-phase16, .ib-academy-school-panel-phase16,
    .ibh-auth-layout, .ibh-filter-panel, .ibh-section-card
) {
    background: var(--ibh-shared-glass) !important;
    border-color: var(--ibh-shared-rim) !important;
    box-shadow: var(--ibh-shared-shadow);
    backdrop-filter: blur(14px) saturate(130%);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-article-card-body, .ib-article-related-body, .ib-article-related-section .ib-section-head,
    .ib-article-toc-card, .ib-radio-card, .ib-academy-path-card-phase16,
    .ib-academy-course-card-phase16, .ib-academy-development-panel-phase16,
    .ib-academy-school-panel-phase16
) :is(h2, h3, h4, h2 a, h3 a, h4 a) {
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(.ib-article-related-body, .ib-article-card-body) > p {
    color: var(--ibh-color-muted) !important;
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-main {
    background: radial-gradient(ellipse at 92% 4%, #f5822020, transparent 26rem),
        var(--ibh-night-canvas);
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-page {
    --member-ink: #edf4ff;
    --member-muted: #bdcee5;
    --member-line: var(--ibh-shared-rim);
    --member-soft: #2b4565;
    --member-card: var(--ibh-shared-glass);
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-page :is(.ibh-member-sidebar, .ibh-member-action-grid a, .ibh-member-stat-grid a) {
    background: var(--ibh-shared-glass);
    border-color: var(--ibh-shared-rim);
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-nav a:not(.is-active):hover {
    background: var(--member-soft);
}

/* Page wrappers with a separate day palette need their surfaces and text paired. */
html[data-theme="dark"] body.ibh-public-body > main:not(.ibh-v7-main, .ibh-member-main, .ib-auth-shell) {
    background: var(--ibh-night-canvas) !important;
}

.ib-radar-show-main .ib-radar-show-page .ib-radar-show-card {
    min-width: 0;
    padding: clamp(16px, 3.2vw, 40px);
}

.ib-radar-show-main .ib-radar-show-page .ib-radar-show-hero {
    max-width: 980px;
    margin-inline: auto;
}

.ib-radar-show-main .ib-radar-show-hero h1 {
    margin-block: 10px 12px;
    font-size: clamp(1.45rem, 3vw, 2.45rem);
    line-height: 1.55;
    text-wrap: pretty;
}

.ib-radar-show-main .ib-radar-show-hero .ib-article-show-meta > span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

html[data-theme="dark"] body.ibh-public-body .ib-radar-show-page :is(.ib-radar-show-card, .ib-radar-source-box) {
    background: var(--ibh-shared-glass) !important;
    border-color: var(--ibh-shared-rim);
}

html[data-theme="dark"] body.ibh-public-body .ib-radar-show-page :is(.ib-article-excerpt, .ib-radar-show-hero .ib-kicker) {
    color: #ffceaa;
    background: #f5822017;
    border-color: #f5822055;
}

html[data-theme="dark"] body.ibh-public-body .ib-radar-show-page .ib-radar-featured-image {
    background: var(--ibh-color-subtle);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-academy-main-phase16, .ib-academy-internal-main-phase18, .ib-academy-phase16,
    .ib-academy-internal-phase18, .ib-academy-dashboard-page-phase17,
    .ib-editorial-page, .ib-history-page-phase9, .ib-hof-page-phase11,
    .ib-profiles-page-phase5, .ib-community-groups-page-phase7, .ib-radio-page-phase4,
    .ib-radar-page-phase3, .ib-dictionary-page-phase14, .ib-dictionary-page-phase15,
    .ib-studios-page, .ibh-shop-page, .ib-cart-page
) {
    color: var(--ibh-color-text);
    background: var(--ibh-night-canvas) !important;
}

html[data-theme="dark"] body.ibh-public-body .ib-academy-phase16 {
    --academy-ink: var(--ibh-color-text);
    --academy-muted: var(--ibh-color-muted);
    --academy-line: var(--ibh-shared-rim);
}

html[data-theme="dark"] body.ibh-public-body .ib-academy-internal-phase18 {
    --ib-academy-18-ink: var(--ibh-color-text);
    --ib-academy-18-muted: var(--ibh-color-muted);
    --ib-academy-18-line: var(--ibh-shared-rim);
    --ib-academy-18-soft: var(--ibh-color-page);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-academy-tool-nav-phase16, .ib-academy-practice-card-phase19,
    .ib-academy-school-card-phase18, .ib-academy-path-step-phase18,
    .ib-editorial-page .ib-polish-panel, .ib-editorial-page .ib-editorial-roles-panel,
    .ib-editorial-page .ib-section-head, .ib-editorial-page .ib-stat,
    .ib-editorial-page .ib-flow-step, .ib-editorial-page .ib-dashboard-summary-card,
    .ib-editorial-page .ib-dashboard-icon-tile, .ibh-member-rail, .ibh-member-checklist
) {
    background: var(--ibh-shared-glass) !important;
    border-color: var(--ibh-shared-rim) !important;
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-academy-tool-nav-phase16, .ib-academy-section-head-phase16,
    .ib-academy-internal-section-head-phase18, .ib-editorial-page .ib-polish-panel,
    .ib-editorial-page .ib-editorial-roles-panel, .ib-editorial-page .ib-dashboard-summary-card,
    .ib-editorial-page .ib-dashboard-icon-tile, .ibh-member-checklist
) :is(h2, h3, strong) {
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-academy-tool-nav-phase16, .ib-academy-section-head-phase16,
    .ib-academy-internal-section-head-phase18, .ib-editorial-page .ib-flow-step,
    .ib-editorial-page .ib-stat, .ib-editorial-page .ib-dashboard-icon-tile, .ibh-member-checklist
) :is(p, small) {
    color: var(--ibh-color-muted) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-academy-path-card-phase16__top, .ib-academy-path-card-phase16__number,
    .ib-academy-path-card-phase16__meta, .ib-academy-practice-card-phase19__top,
    .ib-academy-school-card-phase18__top
) {
    background: transparent;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-academy-tool-nav-phase16__icon, .ib-academy-path-card-phase16__top span,
    .ib-academy-practice-card-phase19__top small, .ib-academy-school-card-phase18__top small,
    .ib-editorial-page .ib-flow-step small, .ibh-member-check-grid a
) {
    background: var(--ibh-color-subtle) !important;
    color: var(--ibh-color-text) !important;
    border-color: var(--ibh-shared-rim) !important;
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-nav a:not(.is-active) {
    color: var(--ibh-color-muted) !important;
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-check-grid a > span {
    background: #ff9a4f26;
    color: #ffbe89;
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-check-grid a.is-done {
    border-color: #83dcb065 !important;
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-check-grid a.is-done > span {
    background: #79deb321;
    color: #a4eac4;
}

html[data-theme="dark"] body.ibh-public-body .ib-academy-tool-nav-phase16 > a {
    border-color: var(--ibh-shared-rim);
}

html[data-theme="dark"] body.ibh-public-body .ib-academy-tool-nav-phase16 > a:hover {
    background: #a5c7f01c;
}

/* Daylight reflections sit above each control's existing background color. */
html:not([data-theme="dark"]) body:is(.ibh-public-body, .ib-admin-body) :is(
    button:not([class*="backdrop"], [data-admin-backdrop]),
    input[type="submit"], input[type="button"], input[type="reset"],
    a:is([class*="-button"], [class*="-btn"], [role="button"], .ib-btn, .ib-button,
        .ib-header-login-link, .ib-header-register-link, .ibh-home-news-read,
        .ibh-v7-play, .ibh-v7-mini-play)
) {
    box-shadow:
        inset 0 1px 0 #ffffffbf,
        inset 0 5px 10px -8px #fff,
        inset 0 0 0 1px #ffffff42,
        0 4px 12px #29405d1c !important;
    backdrop-filter: blur(12px) saturate(135%);
}

/* Use the theme switch's navy glass for action controls in night mode. */
html[data-theme="dark"] body:is(.ibh-public-body, .ib-admin-body) {
    --ibh-night-action: linear-gradient(150deg, #334e70, #233b58 70%);
    --ibh-night-action-hover: linear-gradient(150deg, #405f84, #2b4668 70%);
    --ibh-night-action-rim: #b8d1ef4d;
    --ibh-night-action-ink: #f0f5ff;
}

html[data-theme="dark"] body:is(.ibh-public-body, .ib-admin-body) :is(
    button:not([class*="backdrop"], [data-admin-backdrop]),
    input[type="submit"], input[type="button"], input[type="reset"],
    a:is([class*="-button"], [class*="-btn"], [role="button"], .ib-btn, .ib-button,
        .ib-header-login-link, .ib-header-register-link, .ibh-home-news-read,
        .ibh-v7-play, .ibh-v7-mini-play)
) {
    color: var(--ibh-night-action-ink) !important;
    background: var(--ibh-night-action) !important;
    border-color: var(--ibh-night-action-rim) !important;
    box-shadow: inset 0 0 0 1px var(--ibh-night-action-rim), 0 4px 12px #11243d2e !important;
}

html[data-theme="dark"] body.ibh-public-body .ib-site-header .ib-nav-user-actions a:is(
    .ib-header-icon-link, .ib-nav-dashboard-link, .ib-header-editorial-link
) {
    color: var(--ibh-night-action-ink) !important;
    background: var(--ibh-night-action) !important;
    border-color: var(--ibh-night-action-rim) !important;
    box-shadow: inset 0 1px 0 #ffffff22 !important;
}

html[data-theme="dark"] body.ibh-public-body .ib-site-header .ib-header-icon-link :is(.ib-nav-admin, .ib-nav-bell, .ib-nav-cart) {
    color: inherit !important;
}

html[data-theme="dark"] body:is(.ibh-public-body, .ib-admin-body) :is(
    button:not([class*="backdrop"], [data-admin-backdrop], :disabled, [aria-disabled="true"]),
    input:is([type="submit"], [type="button"], [type="reset"]):not(:disabled, [aria-disabled="true"]),
    a:is([class*="-button"], [class*="-btn"], [role="button"], .ib-btn, .ib-button,
        .ib-header-login-link, .ib-header-register-link, .ibh-home-news-read,
        .ibh-v7-play, .ibh-v7-mini-play):not([aria-disabled="true"])
):is(:hover, :focus-visible) {
    background: var(--ibh-night-action-hover) !important;
    border-color: #f58220a3 !important;
}

@media (max-width: 820px) {
    body.ibh-public-body:not(.ibh-has-radio-player) {
        padding-block-end: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    body.ibh-public-body > .ibh-mobile-tabbar {
        inset-inline: max(10px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)) !important;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        width: min(460px, calc(100% - 2 * max(10px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))));
        margin-inline: auto;
        gap: 2px !important;
        padding: 4px !important;
        border: 1px solid var(--ibh-shared-rim) !important;
        border-radius: 17px !important;
        background: var(--ibh-dock-surface) !important;
        box-shadow: var(--ibh-shared-shadow) !important;
        backdrop-filter: blur(20px) saturate(150%) !important;
    }

    body.ibh-public-body > .ibh-mobile-tabbar a {
        min-width: 0;
        min-height: 44px !important;
        gap: 2px !important;
        border-radius: 12px !important;
        color: var(--ibh-dock-ink);
    }

    body.ibh-public-body > .ibh-mobile-tabbar a:is([aria-current="page"], :hover) {
        background: var(--ibh-dock-active);
    }

    body.ibh-public-body > .ibh-mobile-tabbar a:focus-visible {
        outline: 2px solid #f58220;
        outline-offset: -2px;
    }

    body.ibh-public-body > .ibh-mobile-tabbar :is(span, svg) {
        width: 18px !important;
        height: 18px !important;
    }

    body.ibh-public-body > .ibh-mobile-tabbar strong {
        display: block !important;
        max-width: 100%;
        overflow: hidden;
        color: inherit;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Keep both controls inside the same search row in either theme. */
body.ibh-home-body .ibh-v7-hero-copy .ibh-v7-search {
    grid-template-columns: minmax(0, 1fr) clamp(48px, 8vw, 58px);
    align-items: stretch;
}

body.ibh-home-body .ibh-v7-hero-copy .ibh-v7-search > :is(input, button) {
    grid-row: 1;
    align-self: stretch;
    min-width: 0;
    min-height: 48px;
    margin: 0 !important;
}

body.ibh-home-body .ibh-v7-hero-copy .ibh-v7-search > input {
    grid-column: 1;
}

body.ibh-home-body .ibh-v7-hero-copy .ibh-v7-search > button {
    grid-column: 2;
    width: 100%;
    height: auto;
    padding: 0;
    border-radius: 0 !important;
}

.ibh-v7-search:focus-within {
    outline: 2px solid #ffb36e;
    outline-offset: 3px;
}

:is(.ib-site-header, .ib-mobile-bottom-nav, .ibh-admin-sidebar) :is(a, button, summary):focus-visible {
    outline: 2px solid var(--ibh-focus-ring);
    outline-offset: 2px;
}

body.ibh-public-body .ib-site-header .ibh-public-nav-dropdown {
    max-height: min(72vh, 38rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

html[data-theme="dark"] body.ibh-public-body .ibh-public-nav-dropdown :is(a, summary) {
    color: var(--ibh-color-text);
}

.ibh-radio-detail-page {
    width: min(100% - clamp(24px, 6vw, 72px), 72rem);
    margin-inline: auto;
}

.ibh-radio-detail-content {
    min-width: 0;
    padding-block: clamp(18px, 4vw, 40px);
    color: var(--ibh-color-text, #142945);
}

.ibh-radio-detail-content :is(.ib-radio-show-hero, .ib-radio-player-box, .ibh-radio-reading) {
    min-width: 0;
    padding: clamp(16px, 4vw, 34px);
    background: var(--ibh-shared-glass);
    border: 1px solid var(--ibh-shared-rim);
    border-radius: clamp(16px, 3vw, 26px);
    box-shadow: var(--ibh-shared-shadow);
}

.ibh-radio-detail-content .ib-radio-show-hero h1 {
    color: inherit;
    font-size: clamp(1.45rem, 3.2vw, 2.5rem);
    white-space: normal;
    overflow-wrap: anywhere;
}

.ibh-radio-episode-cover {
    display: block;
    width: 100%;
    max-height: 32rem;
    margin-block-start: 18px;
    object-fit: cover;
    border-radius: clamp(16px, 3vw, 26px);
}

.ibh-radio-reading {
    margin-block: 22px;
}

.ibh-radio-reading-body {
    max-width: 76ch;
    margin-inline: auto;
    font-size: clamp(1rem, 1.4vw, 1.125rem);
    line-height: 2;
    overflow-wrap: anywhere;
}

.ibh-radio-reading-body :is(img, figure, table) {
    max-width: 100%;
    margin-inline: 0;
}

.ibh-radio-reading-body img {
    height: auto;
}

.ibh-radio-reading-body table {
    display: block;
    overflow-x: auto;
}

.ibh-admin-content.ib-admin-profile-show-page {
    padding: clamp(12px, 2.6vw, 36px) !important;
}

.ib-admin-profile-show-page :is(.ib-public-profile-hero, .ib-admin-review-decision-panel, .ib-public-profile-summary-grid .ib-stat) {
    min-width: 0;
    overflow-wrap: anywhere;
    background: var(--ibh-admin-profile-glass, #ffffffdc) !important;
    border: 1px solid var(--ibh-admin-profile-rim, #263d5926);
    box-shadow: 0 12px 28px #14294518;
}

html[data-theme="dark"] body.ib-admin-body {
    --ibh-admin-profile-glass: #263f5eec;
    --ibh-admin-profile-rim: #aac6eb4d;
}

html[data-theme="dark"] body.ib-admin-body :is(.ib-public-profile-hero, .ib-admin-review-decision-panel, .ib-public-profile-summary-grid .ib-stat) {
    color: #eef4ff;
}

html[data-theme="dark"] body.ib-admin-body .ib-admin-profile-show-page :is(h1, h2, h3, .ib-muted) {
    color: #e5eefc;
}

html[data-theme="dark"] body.ib-admin-body .ib-admin-profile-show-page :is(
    .ib-admin-review-decision-card, .ib-admin-review-facts div, .ib-soft-card
) {
    background: #203854 !important;
    border-color: var(--ibh-admin-profile-rim) !important;
    color: #edf4ff;
}

html[data-theme="dark"] body.ib-admin-body .ib-admin-profile-show-page :is(
    .ib-admin-review-decision-card strong, .ib-admin-review-decision-card p, .ib-admin-review-facts p
) {
    color: #dae7f8;
}

html[data-theme="dark"] body.ib-admin-body .ib-admin-profile-show-page .ib-admin-review-facts div.is-done {
    border-inline-start: 3px solid #7ddab0 !important;
}

html[data-theme="dark"] body.ib-admin-body .ib-admin-profile-show-page .ib-admin-review-facts div.is-missing {
    border-inline-start: 3px solid #ffb36e !important;
}

@media (max-width: 600px) {
    .ib-admin-profile-show-page .ib-public-profile-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .ib-admin-profile-show-page .ib-public-profile-main {
        flex-wrap: wrap;
    }
}

.ibh-search-page {
    max-width: 76rem;
}

.ibh-search-content {
    color: var(--ibh-public-ink, #142945);
}

.ibh-search-content .ib-static-hero-search {
    min-height: 0;
    padding: clamp(24px, 5vw, 56px);
}

.ibh-search-content .ib-static-hero-search h1 {
    font-size: clamp(1.75rem, 3.8vw, 3rem);
    white-space: normal;
    overflow-wrap: anywhere;
}

body.ibh-public-body .ibh-search-content .ib-static-hero-search p {
    color: #dce8f8 !important;
}

.ibh-search-form,
.ibh-search-result {
    border: 1px solid var(--ibh-shared-rim);
    border-radius: 16px;
    background: var(--ibh-shared-glass);
    box-shadow: var(--ibh-shared-shadow);
    color: inherit;
    padding: clamp(14px, 3vw, 24px);
}

.ibh-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px 12px;
    margin-block: 18px 26px;
}

.ibh-search-form label {
    grid-column: 1 / -1;
}

.ibh-search-form :is(input, button) {
    min-width: 0;
    min-height: 46px;
    margin: 0 !important;
}

.ibh-search-results {
    margin-block: 26px;
}

.ibh-search-result + .ibh-search-result {
    margin-block-start: 10px;
}

html[data-theme="dark"] body.ibh-public-body .ibh-search-content :is(h2, h3, h4, h4 a, label, .ibh-search-result p) {
    color: var(--ibh-color-text);
}

@media (max-width: 400px) {
    .ibh-search-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .ibh-search-form button {
        justify-self: start;
    }
}

.ibh-radio-card-cover {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: var(--ibh-shared-glass-strong);
}

.ibh-radio-card-cover img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.ibh-radio-cover-link,
.ibh-radio-reading-body [data-radio-image] {
    display: block;
    cursor: zoom-in;
}

.ibh-radio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
    gap: 12px;
    margin-block: 16px;
}

.ibh-radio-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.ibh-radio-image-dialog {
    box-sizing: border-box;
    width: min(94vw, 72rem);
    max-height: 92dvh;
    margin: auto;
    border: 1px solid var(--ibh-shared-rim);
    border-radius: 22px;
    padding: clamp(12px, 2vw, 20px);
    background: var(--ibh-shared-glass-strong);
    color: var(--ibh-public-ink, #142945);
    box-shadow: var(--ibh-shared-shadow);
}

.ibh-radio-image-dialog::backdrop {
    background: #0a162bd9;
    backdrop-filter: blur(7px);
}

.ibh-radio-image-dialog figure {
    margin: 12px 0 0;
    text-align: center;
}

.ibh-radio-image-dialog img {
    display: block;
    width: 100%;
    height: min(64dvh, 700px);
    object-fit: contain;
}

.ibh-radio-image-dialog-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.ibh-radio-image-dialog-tools form {
    margin: 0;
}

/* Archive and directory templates with their own day-mode surfaces. */
html[data-theme="dark"] body.ibh-public-body :is(
    .ib-history-page-phase9 .ib-history-section,
    .ib-hof-page-phase11 .ib-hof-section-phase11,
    .ib-honors-page-phase13 .ib-honors-section-phase13,
    .ib-heritage-institution-page > .ib-section,
    .ib-community-groups-page-phase7 .ib-community-groups-directory
) {
    background: transparent !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ibh-shop-notice, .ib-history-filter, .ib-history-item__body,
    .ib-history-empty, .ib-history-source-note, .ib-hof-filter, .ib-hof-result-head,
    .ib-hof-card, .ib-hof-empty, .ib-honors-filter, .ib-honors-result-head,
    .ib-honor-card, .ib-honors-empty, .ib-honors-archive-page .ib-articles-results-head,
    .ib-heritage-source-content, .ib-directory-filter, .ib-directory-results-head,
    .ib-profile-card, .ib-directory-empty, .ib-community-rules-card,
    .ib-community-advanced, .ib-community-group-card, .ib-editorial-page .ib-admin-table-card,
    .ib-academy-path-step-phase18__body, .ib-academy-path-related-phase18,
    .ib-academy-practice-progress-phase25, .ib-academy-practice-show-phase22__content,
    .ib-academy-practice-show-phase22__sidebar, .ib-academy-practice-show-phase22__checklist
) {
    background: var(--ibh-shared-glass-strong) !important;
    color: var(--ibh-color-text);
    border-color: var(--ibh-shared-rim) !important;
    box-shadow: var(--ibh-shared-shadow);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-history-filter__grid, .ib-hof-filter__grid, .ib-honors-filter__primary,
    .ib-honors-filter__secondary, .ib-community-group-advanced-filter,
    .ib-profile-card-top, .ib-profile-card-title, .ib-profile-card-badges,
    .ib-profile-card-meta, .ib-profile-card-footer, .ib-community-rules-card__intro,
    .ib-academy-path-step-phase18
) {
    background: transparent;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-history-filter, .ib-hof-filter, .ib-honors-filter, .ib-directory-filter, .ib-community-advanced,
    .ib-articles-filter-panel, .ib-radar-filter-panel
) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background-color: var(--ibh-color-subtle) !important;
    border-color: var(--ibh-shared-rim) !important;
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-history-filter, .ib-hof-filter, .ib-honors-filter, .ib-directory-filter, .ib-community-advanced,
    .ib-articles-filter-panel, .ib-radar-filter-panel
) :is(input, textarea)::placeholder {
    color: var(--ibh-color-muted);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-history-periods a, .ib-history-period-nav a, .ib-hof-category, .ib-honors-category,
    .ib-honors-archive-nav a, .ib-profile-role-nav a, .ib-directory-count,
    .ib-community-group-filters a, .ib-honors-advanced, .ib-community-advanced summary,
    .ib-community-rules-list li, .ib-history-item__meta span, .ib-honor-card__meta span,
    .ib-profile-card-meta span, .ib-community-group-meta span,
    .ib-academy-path-step-phase18__meta span, .ib-history-periods a em,
    .ib-hof-category em, .ib-honors-category em
) {
    background: var(--ibh-color-subtle);
    border-color: var(--ibh-shared-rim);
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-history-periods a, .ib-hof-category, .ib-honors-category, .ib-honors-archive-nav a,
    .ib-profile-role-nav a, .ib-community-group-filters a
).is-active {
    background: #593c37;
    border-color: #ba764c;
    color: #ffcdab;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ibh-shop-notice h2, .ib-history-period-card h2, .ib-history-item__axis,
    .ib-history-item__body h3, .ib-hof-card h3, .ib-honor-card h3,
    .ib-heritage-source-content, .ib-directory-count strong, .ib-profile-card-title h2 a
) {
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ibh-shop-notice p, .ib-history-period-card strong, .ib-history-period-card footer,
    .ib-history-legend span, .ib-profile-card-title > span, .ib-profile-card-title small,
    .ib-heritage-source-content figcaption, .ib-heritage-source-content blockquote,
    .ib-academy-path-step-phase18__status
) {
    color: var(--ibh-color-muted);
}

html[data-theme="dark"] body.ibh-public-body .ib-community-groups-page-phase7 :is(
    .ib-community-rules-card__intro p, .ib-community-group-card > p
) {
    color: var(--ibh-color-muted) !important;
}

html[data-theme="dark"] body.ibh-public-body .ib-site-header .ibh-public-nav a.ibh-language-switch {
    background: var(--ibh-color-subtle);
    border-color: var(--ibh-shared-rim);
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-history-item__link, .ib-heritage-source-content a, .ib-profile-link
) {
    color: #ffb47c;
}

html[data-theme="dark"] body.ibh-public-body .ib-editorial-page .ib-admin-table :is(th, td) {
    background: var(--ibh-color-subtle);
    color: var(--ibh-color-text);
    border-color: var(--ibh-shared-rim);
}

html[data-theme="dark"] body.ibh-public-body .ib-editorial-page .ib-admin-table :is(td strong, td small, td .ib-muted) {
    color: inherit;
}

html[data-theme="dark"] body.ibh-public-body .ib-academy-practice-show-phase22__safety {
    background: #493632;
    border-color: #a57150;
    color: #ffe1c9;
}

/* Reading, listening and public information surfaces. */
html[data-theme="dark"] body.ibh-public-body :is(
    .ib-articles-page .ib-articles-results-head, .ib-articles-page .ib-pagination,
    .ib-popular-tags-bottom-section .ib-article-topic-strip,
    .ib-article-show-page .ib-article-body, .ib-article-show-page .ib-article-faq-item,
    .ib-article-show-page .ib-article-sidebar-card, .ib-podcast-player-phase4,
    .ibh-radio-detail-content .ib-roadmap, .ibh-radio-detail-content .ib-feature-card,
    .ib-community-comments, .ib-community-comment-form, .ib-community-comment-item,
    .ib-community-comment-login, .ib-community-comments .ib-empty-state,
    .ib-about-page :is(.ib-static-section, .ib-static-feature-card, .ib-static-list-card, .ib-contact-card, .ib-static-cta),
    .ib-card:has(> .ib-legal-page), .ib-legal-card
) {
    background: var(--ibh-shared-glass-strong) !important;
    border-color: var(--ibh-shared-rim) !important;
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-article-category-pill, .ib-article-topic-pill, .ib-podcast-meta > span,
    .ib-radio-card-meta > span, .ib-radio-results-head > strong
) {
    background: var(--ibh-color-subtle);
    border-color: var(--ibh-shared-rim);
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-article-category-pill, .ib-article-topic-pill
):is(.is-active, [aria-current="page"]) {
    background: #593c37;
    border-color: #ba764c;
    color: #ffcdab;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ibh-shop-category-card h3, .ibh-shop-section-heading h2, .ibh-shop-notice h2,
    .ib-article-body :is(h2, h3, h4, h5, h6), .ib-article-sidebar-card h2,
    .ib-podcast-player-phase4 h2, .ib-podcast-meta strong, .ib-radio-card-meta strong,
    .ibh-radio-detail-content .ib-feature-card strong, .ib-about-page :is(h2, h3),
    .ib-legal-card :is(h1, h2)
) {
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-podcast-player-phase4 p, .ibh-radio-detail-content .ib-feature-card p,
    .ib-about-page :is(.ib-static-section, .ib-contact-card, .ib-static-cta) p,
    .ib-legal-card :is(p, li), .ib-community-comments .ib-empty-state
) {
    color: var(--ibh-color-muted) !important;
}

.ib-radar-page-phase3 .ib-radar-card-phase3 > :is(h2, p) {
    margin-inline: clamp(14px, 2vw, 22px);
}

html[data-theme="dark"] body.ibh-public-body .ib-pagination-wrap nav[role="navigation"] {
    background: var(--ibh-shared-glass-strong) !important;
    border-color: var(--ibh-shared-rim) !important;
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body .ib-pagination-wrap nav :is(a, .ib-pagination__item) {
    background: var(--ibh-color-subtle) !important;
    border-color: var(--ibh-shared-rim) !important;
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body .ib-pagination-wrap nav :is([aria-current="page"], a:hover) {
    background: #593c37 !important;
    color: #ffcdab !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-studio-show, .ib-public-gallery, .ib-photo-detail-page,
    .ib-dictionary-internal-phase15, .ib-honor-show-page-phase10, .ib-hof-show-page-phase12
) {
    background: var(--ibh-night-canvas) !important;
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-card:has(> :is(.ib-studio-show, .ib-public-gallery, .ib-photo-detail-page)),
    .ib-honor-show-section, .ib-hof-show-section
) {
    background: transparent !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-studio-event, .ib-studio-gallery-card, .ib-studio-empty, .ib-studio-trust > *,
    .ib-public-gallery-toolbar, .ib-public-photo-card, .ib-public-gallery-trust > *,
    .ib-photo-purchase-card, .ib-photo-preview-meta, .ib-photo-license-heading,
    .ib-photo-quality-option, .ib-photo-login-panel, .ib-photo-purchase-trust,
    .ib-dictionary-term-article, .ib-dictionary-term-side-box, .ib-dictionary-term-source,
    .ib-dictionary-topic-card-phase15, .ib-honor-show-page-phase10 :is(.ib-honor-prose, .ib-honor-facts, .ib-honor-source, .ib-honor-people, .ib-honor-person, .ib-honor-related),
    .ib-hof-show-page-phase12 :is(.ib-hof-show-identity, .ib-hof-show-story, .ib-hof-show-side-card, .ib-hof-fact, .ib-hof-honor)
) {
    background: var(--ibh-shared-glass-strong) !important;
    border-color: var(--ibh-shared-rim) !important;
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body .ib-photo-quality-option:has(input:checked) {
    background: #2d4868 !important;
    box-shadow: inset 0 0 0 1px #8aaed9;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-studio-gallery-body strong, .ib-public-photo-info strong,
    .ib-photo-preview-meta strong, .ib-photo-preview-meta a, .ib-photo-option-copy strong,
    .ib-photo-option-price, .ib-dictionary-term-side-box a, .ib-dictionary-term-side-box a strong,
    .ib-hof-fact strong
) {
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-studio-brand p, .ib-studio-event-meta, .ib-public-gallery-toolbar span,
    .ib-photo-purchase-header p, .ib-photo-license-heading p, .ib-photo-option-copy small,
    .ib-photo-option-price small, .ib-photo-preview-meta span,
    .ib-dictionary-term-side-box a small, .ib-hof-fact span
) {
    color: var(--ibh-color-muted) !important;
}

html[data-theme="dark"] body.ibh-public-body main :is(
    .ib-kicker, .ib-static-icon, .ib-contact-icon, .ib-form-section-head > span,
    .ib-academy-evaluation-card-phase20__top > span, .ib-academy-certificate-steps-phase21 li > span,
    .ib-academy-dashboard-item-list-phase17__icon
) {
    background: #493832;
    color: #ffbd8b !important;
    border-color: #9c6845;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-articles-results-head > strong, .ib-radar-results-head > strong,
    .ib-community-comments-count, .ib-radio-show-meta > span
) {
    background: var(--ibh-color-subtle) !important;
    color: var(--ibh-color-text) !important;
    border-color: var(--ibh-shared-rim);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ibh-radio-detail-content :is(.ib-card, .ib-section-head, .ib-radio-audio-player-box),
    .ib-honor-show-page-phase10 .ib-card, .ib-hof-show-page-phase12 .ib-card,
    .ib-studio-signature, .ib-studio-trust, .ib-public-gallery-security,
    .ib-photo-preview-meta > div, .ib-photo-cart-link,
    .ib-cart-empty, .ib-privacy-inline-form, .ib-profile-form-steps a,
    .ib-profile-form-hero, .ib-professional-profile-command-card,
    .ib-professional-command-grid a, .ib-role-requirements-card,
    .ib-professional-command-score, .ib-role-requirement-item, .ib-profile-gallery-slot,
    .ib-form-section, .ib-profile-subsection, .ib-review-status-card,
    .ib-dashboard-contact-modern-head, .ibh-member-card,
    .ib-profile-form-meta > *, .ib-role-requirement-mark, .ib-form-section .ib-privacy-card,
    .ib-academy-dashboard-phase17 :is(.ib-academy-dashboard-section-phase17, .ib-academy-dashboard-nav-phase17,
        .ib-academy-dashboard-overview-phase17, .ib-academy-dashboard-stat-grid-phase17 > *, .ib-academy-dashboard-path-card-phase17,
        .ib-academy-dashboard-empty-phase17, .ib-academy-dashboard-recommendations-phase17,
        .ib-academy-dashboard-action-panel-phase17, .ib-academy-dashboard-item-list-phase17 > *,
        .ib-academy-dashboard-progress-phase25, .ib-academy-dashboard-progress-phase25__grid > *,
        .ib-academy-dashboard-certificates-phase17, .ib-academy-dashboard-certificate-empty-phase17,
        .ib-phase27-dashboard, .ib-phase27-dashboard > div > a),
    .ib-phase27-submission, .ib-phase27-result, .ib-phase27-guest, .ib-phase27-fields > .ib-phase27-field,
    .ib-academy-internal-empty-phase18, .ib-academy-evaluation-card-phase20,
    .ib-academy-evaluation-card-phase20 dl > div, .ib-academy-evaluation-card-phase20__status,
    .ib-academy-evaluation-card-phase20__top small,
    .ib-academy-certificate-card-phase21, .ib-academy-certificate-empty-phase21,
    .ib-academy-certificate-empty-phase21__intro, .ib-academy-certificate-steps-phase21 li > div,
    .ib-academy-certificate-steps-phase21 li
) {
    background: var(--ibh-shared-glass-strong) !important;
    border-color: var(--ibh-shared-rim) !important;
    color: var(--ibh-color-text);
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-studio-owner strong, .ib-public-photo-info span, .ib-public-gallery-trust strong,
    .ib-photo-cart-link, .ib-photo-purchase-trust strong, .ib-review-status-card strong,
    .ib-radio-results-head h2, .ib-profile-gallery-slot > strong, .ib-dashboard-contact-modern-head strong,
    .ib-profile-form-meta > div:first-child > span, .ib-professional-command-grid a > span,
    .ib-academy-evaluation-card-phase20 strong, .ib-academy-dashboard-path-card-phase17 > a,
    .ib-academy-dashboard-item-list-phase17 strong, .ib-academy-dashboard-empty-phase17 strong,
    .ib-academy-certificate-steps-phase21 strong
) {
    color: var(--ibh-color-text) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-studio-owner span, .ib-studio-trust p, .ib-public-gallery-trust p,
    .ib-public-gallery-security p, .ib-photo-purchase-trust span, .ib-photo-purchase-trust p,
    .ib-dictionary-term-meta span, .ib-honor-show-page-phase10 .ib-card p,
    .ib-hof-show-page-phase12 .ib-card p, .ib-directory-count span,
    .ib-role-filter-box > span, .ib-community-group-advanced-filter label > span,
    .ib-editorial-page .ib-dashboard-summary-card > span, .ib-form-section > p,
    .ib-review-progress-title > span, .ib-professional-command-score > span, .ib-review-status-card > span
) {
    color: var(--ibh-color-muted) !important;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-academy-section-head-phase16 > a, .ib-academy-panel-title-phase16 > a,
    .ib-honor-show-page-phase10 h3 a, .ib-profile-back-link a
) {
    color: #ffbd8b;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-about-page .ib-static-section-title > span, .ib-review-kicker,
    .ib-privacy-pill.is-warn, .ib-academy-evaluation-card-phase20__type,
    .ib-academy-certificate-empty-phase21__intro > span
) {
    background: #493832;
    color: #ffbd8b !important;
}

html[data-theme="dark"] body.ibh-public-body .ib-privacy-score-badge.is-good {
    background: #183c34;
    color: #b0f2d3;
}

html[data-theme="dark"] body.ibh-public-body .ibh-member-alert {
    background: #183c34 !important;
    color: #c9f4e3;
    border-color: #5b9985;
}

html[data-theme="dark"] body.ibh-public-body .ib-phase27-submission :is(
    textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="submit"])
) {
    background: var(--ibh-color-subtle);
    color: var(--ibh-color-text);
    border-color: var(--ibh-shared-rim);
}

html[data-theme="dark"] body.ibh-home-body :is(.ibh-v7-learning-meta, .ibh-v7-learning-number) {
    color: #ffbd8b;
}

html[data-theme="dark"] body.ibh-public-body :is(
    .ib-profile-form-hero > p, .ib-professional-command-main p, .ib-professional-command-score small
) {
    color: var(--ibh-color-muted) !important;
}

html[data-theme="dark"] body.ibh-public-body .ib-professional-command-grid strong {
    background: #493832;
    color: #ffbd8b;
}

html[data-theme="dark"] body.ibh-public-body .ib-professional-command-grid .is-done strong {
    background: #183c34;
    color: #b0f2d3;
}
