/* CookieYes native pilot and independently scoped site shells. Native provider markup and behaviour remain.
 * Palette roles inherit the existing public site's dark/light tokens.
 */
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-overlay, .cky-consent-container, .cky-btn-revisit-wrapper, .cky-modal) {
    --gk-cookieyes-layer: 2147483647;
    --gk-cookieyes-surface: var(--clr-bg-elevated);
    --gk-cookieyes-control: var(--clr-bg-raised);
    --gk-cookieyes-hover: var(--clr-bg-hover);
    --gk-cookieyes-text: var(--clr-text-primary);
    --gk-cookieyes-secondary: var(--clr-text-secondary);
    --gk-cookieyes-muted: var(--clr-text-muted);
    --gk-cookieyes-border: var(--clr-border);
    --gk-cookieyes-control-border: var(--clr-border-control);
    --gk-cookieyes-accent: var(--clr-brand-dark);
    --gk-cookieyes-link: var(--clr-brand-hover);
    --gk-cookieyes-on-accent: var(--clr-on-brand);
    --gk-cookieyes-success: var(--clr-success-text);
    --gk-cookieyes-toggle-off: var(--clr-border-control);
    --gk-cookieyes-toggle-on: var(--clr-brand-dark);
    --gk-cookieyes-scrim: var(--clr-overlay);
    z-index: var(--gk-cookieyes-layer);
    font-family: var(--font-body);
}

body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production).geekly-cookie-pilot {
    --gk-cookieyes-banner-space: 0px;
    padding-bottom: var(--gk-cookieyes-banner-space);
}

/* Plain utility controls inherit the footer and legal submenu vocabulary. */
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) .geekly-footer__cookie-preferences {
    display: block;
    width: fit-content;
    min-height: 44px;
    padding: var(--space-3) var(--space-2);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--clr-text-muted);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: inherit;
    line-height: 20px;
    text-align: left;
    text-wrap: pretty;
    text-underline-offset: 3px;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) .geekly-footer__cookie-preferences:hover {
    color: var(--clr-brand-text);
    text-decoration: underline;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) .geekly-sidebar__cookie-preferences {
    position: relative;
    display: flex;
    align-items: center;
    width: calc(100% - var(--space-4));
    min-height: 44px;
    gap: var(--space-3);
    margin: 1px var(--space-2);
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--clr-text-muted);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) .geekly-sidebar__cookie-preferences:hover {
    color: var(--clr-text-primary);
    background: var(--clr-bg-active);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) :is(.geekly-footer__cookie-preferences, .geekly-sidebar__cookie-preferences):is(:focus-visible, :focus:where([data-gk-focus="keyboard"])):not(:where([data-gk-focus="pointer"])) {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: var(--gk-site-focus-offset, 2px);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) :is(.geekly-footer__cookie-preferences, .geekly-sidebar__cookie-preferences):disabled {
    cursor: not-allowed;
}

/* Public chrome already reaches the browser maximum. The adapter places native
 * roots last in body so the consent layer wins that equal-layer DOM-order tie. */
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-overlay {
    opacity: 1;
    background: var(--gk-cookieyes-scrim);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-consent-bar {
    border: 1px solid var(--gk-cookieyes-border);
    box-shadow: var(--shadow-card);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-content-wrapper {
    max-width: var(--layout-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-8);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-group {
    gap: var(--space-8);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-group > div:first-child {
    max-width: 46rem;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal) :is(.cky-title, .cky-preference-title) {
    font-size: var(--text-md);
    line-height: var(--lh-ui);
    font-weight: 700;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal) :is(.cky-notice-des, .cky-preference-content-wrapper, .cky-accordion-header-des) {
    line-height: var(--lh-reading);
    text-wrap: pretty;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-btn-wrapper {
    gap: var(--space-2);
    margin: 0;
    flex-shrink: 0;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal) .cky-btn {
    min-height: 44px;
    border-width: 1px;
    border-style: solid;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    padding: var(--space-2) var(--space-4);
    margin: 0;
    line-height: var(--lh-ui);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal) .cky-btn:hover {
    filter: none;
    box-shadow: inset 0 0 0 1px var(--gk-cookieyes-control-border);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal) :is(button, a, input):is(:focus-visible, :focus:where([data-gk-focus="keyboard"])):not(:where([data-gk-focus="pointer"])) {
    outline: var(--focus-ring-width) solid currentColor;
    outline-offset: 3px;
}
/* Preserve the native keyboard fallback if the shared focus script is absent. */
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal, .cky-btn-revisit-wrapper) :is(button, a, input):where([data-gk-focus="pointer"]):focus {
    outline: none;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal) .cky-policy {
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: normal;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal {
    background: var(--gk-cookieyes-surface);
    color: var(--gk-cookieyes-text);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-preference-center {
    width: min(52rem, calc(100vw - var(--space-8)));
    max-height: calc(100dvh - var(--space-8));
    border-radius: var(--radius-lg);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-preference-header {
    padding: var(--space-5) var(--space-6);
    border-color: var(--gk-cookieyes-border);
    gap: var(--space-4);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-btn-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    color: var(--gk-cookieyes-text);
}
/* Keep the provider's existing icon image. It is black by default. */
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-btn-close img {
    width: 14px;
    height: 14px;
    filter: invert(1);
}
:root[data-theme="light"] body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-btn-close img {
    filter: none;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-preference-body-wrapper {
    padding: 0 var(--space-6);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-horizontal-separator,
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-accordion {
    border-color: var(--gk-cookieyes-border);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-accordion-btn {
    min-height: 44px;
    text-align: left;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-accordion-chevron {
    margin-right: var(--space-5);
    color: var(--gk-cookieyes-secondary);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-switch input[type="checkbox"] {
    width: 44px;
    height: 24px;
    border: 1px solid var(--gk-cookieyes-control-border);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-switch input[type="checkbox"]::before {
    background: var(--gk-cookieyes-on-accent);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-prefrence-btn-wrapper {
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-color: var(--gk-cookieyes-border);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-cookie-des-table {
    line-height: var(--lh-reading);
    padding: var(--space-4);
    border-color: var(--gk-cookieyes-border);
}
/* Hide only provider-confirmed empty OPTIONAL tables, never Necessary.
 * Populated production External media and Analytics sections stay visible. */
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-accordion:not(#ckyDetailCategorynecessary):has(.cky-empty-cookies-text) {
    display: none;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-btn-revisit-wrapper {
    width: 48px;
    height: 48px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--gk-cookieyes-control-border);
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-btn-revisit-wrapper .cky-btn-revisit {
    width: 44px;
    height: 44px;
}
body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-btn-revisit-wrapper .cky-btn-revisit:is(:focus-visible, :focus:where([data-gk-focus="keyboard"])):not(:where([data-gk-focus="pointer"])) {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 50%;
}

@media (max-width: 1199px) {
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-group {
        display: block;
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-btn-wrapper {
        justify-content: flex-start;
        margin-top: var(--space-4);
        flex-wrap: wrap;
    }
}
@media (max-width: 599px) {
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-content-wrapper {
        padding: var(--space-5);
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container :is(.cky-title, .cky-notice-des, .cky-notice-btn-wrapper) {
        padding: 0;
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-des {
        overflow-y: auto;
        max-height: 35dvh;
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-btn-wrapper {
        flex-direction: column;
        gap: var(--space-2);
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-consent-container .cky-notice-btn-wrapper .cky-btn {
        margin: 0;
        order: 0;
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-preference-center {
        width: calc(100vw - var(--space-4));
        max-height: calc(100dvh - var(--space-4));
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal :is(.cky-preference-header, .cky-prefrence-btn-wrapper) {
        padding: var(--space-4);
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-preference-body-wrapper {
        padding: 0 var(--space-4);
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-prefrence-btn-wrapper {
        display: grid;
        grid-template-columns: 1fr;
    }
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal .cky-prefrence-btn-wrapper .cky-btn {
        margin: 0;
        order: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal),
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > .cky-modal :is(.cky-switch input, .cky-switch input::before, .cky-accordion-chevron i::before) {
        transition: none;
    }
}
@media (forced-colors: active) {
    body:is(.geekly-body, .geekly-consent-staging, .geekly-consent-production) > :is(.cky-consent-container, .cky-modal, .cky-btn-revisit-wrapper) {
        --gk-cookieyes-control-border: ButtonText;
        --gk-cookieyes-text: CanvasText;
        --gk-cookieyes-toggle-on: Highlight;
        --gk-cookieyes-toggle-off: Canvas;
    }
}

/* Consent-scoped utilities. No unrelated public or app bundle expansion. */
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-consent-media, .geekly-consent-gif, [data-geekly-social-facade]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    background: var(--clr-bg-raised);
    color: var(--clr-text-secondary);
    line-height: var(--lh-reading);
    overflow-wrap: anywhere;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-consent-media, [data-geekly-social-facade]) p {
    flex-basis: 100%;
    margin: 0;
}
body:is(.geekly-consent-staging, .geekly-consent-production) .geekly-consent-media iframe:not([hidden]) {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-consent-media, .geekly-consent-gif) button:not(.cky-banner-element) {
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--clr-border-control);
    border-radius: var(--radius-md);
    background: var(--clr-bg-elevated);
    color: var(--clr-text-primary);
    font: inherit;
    cursor: pointer;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-cookie-preferences--auth, .geekly-cookie-preferences--media) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: var(--space-2);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--clr-text-primary);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-cookie-preferences--auth, .geekly-cookie-preferences--media, .geekly-cookie-preferences--app):disabled {
    cursor: not-allowed;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-auth__policies, .geekly-consent-policies) {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    line-height: var(--lh-reading);
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-auth__policies, .geekly-consent-policies) a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--clr-text-primary);
    text-underline-offset: 3px;
}
body:is(.geekly-consent-staging, .geekly-consent-production) .geekly-cookie-preferences--app {
    width: 100%;
    min-height: 44px;
    border: 0;
    background: transparent;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-consent-media, .geekly-consent-gif, .geekly-consent-policies) [hidden] {
    display: none;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-consent-media, .geekly-consent-gif) img {
    max-width: 100%;
    height: auto;
}
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-consent-media, .geekly-consent-gif, .geekly-cookie-preferences--auth, .geekly-cookie-preferences--media, .geekly-cookie-preferences--app):is(:focus-visible, :focus:where([data-gk-focus="keyboard"])):not(:where([data-gk-focus="pointer"])),
body:is(.geekly-consent-staging, .geekly-consent-production) :is(.geekly-consent-media, .geekly-consent-gif) :is(button, a, [data-geekly-media-output][tabindex]):is(:focus-visible, :focus:where([data-gk-focus="keyboard"])):not(:where([data-gk-focus="pointer"])) {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: var(--focus-ring-offset);
}
