/* Native actions own consent; reopening is a separate, read-only view state. */
#cookie-notice[hidden],
#simda-analytics-consent [hidden] { display: none !important; }
#cookie-notice.simda-consent-open,
html[data-simda-consent-view="full"] #cookie-notice,
html[data-simda-consent-view="compact"] #cookie-notice,
html:not([data-simda-consent-view]) body.cookies-refused #cookie-notice {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
body.simda-design-v1 #cookie-notice.simda-consent-open,
html[data-simda-consent-view="full"] body.simda-design-v1 #cookie-notice,
html:not([data-simda-consent-view]) body.simda-design-v1.cookies-refused #cookie-notice { max-height: none; overflow: visible; }
body.simda-design-v1 #cookie-notice.simda-consent-open .cookie-notice-container,
html[data-simda-consent-view="full"] body.simda-design-v1 #cookie-notice .cookie-notice-container,
html:not([data-simda-consent-view]) body.simda-design-v1.cookies-refused #cookie-notice .cookie-notice-container {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    max-height: 45vh;
    max-height: 45dvh;
    padding: 16px 24px;
}
#cookie-notice.simda-consent-open #cn-notice-text,
html[data-simda-consent-view="full"] #cookie-notice #cn-notice-text,
html:not([data-simda-consent-view]) body.cookies-refused #cookie-notice #cn-notice-text {
    min-height: 0;
    max-height: calc(45vh - 32px);
    max-height: calc(45dvh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
/* Native binding adds this canary. Without the first-party script, refusal
   falls back to the functional full notice rather than a disabled reopen action. */
#cookie-notice:not([class*="cn-effect-"]) { display: none !important; }
html[data-simda-consent-view="hidden"] #cookie-notice,
html:not([data-simda-consent-view]) body.cookies-accepted #cookie-notice { display: none !important; }
html[data-simda-consent-view="compact"] #cookie-notice .cookie-notice-container { display: none !important; }
html[data-simda-consent-view="full"] #cookie-notice .cookie-revoke-container,
html:not([data-simda-consent-view]) body.cookies-refused #cookie-notice .cookie-revoke-container { display: none !important; }
/* Compact mode deliberately uses the existing native bottom tray and button CSS. */
/* Keep the existing back-to-top navigation above that tray while it is visible. */
html[data-simda-consent-view="compact"] body.simda-design-v1 #slide_top {
    bottom: max(50px, calc(var(--simda-consent-space, 0px) + 8px));
}
#cn-notice-text:focus-visible { outline: 2px solid #325b83; outline-offset: 2px; }
html { scroll-padding-bottom: var(--simda-consent-clearance, 0px); }
#simda-analytics-consent {
    margin: 1.5rem 0 0;
    padding: .75rem 0 0;
    border-top: 1px solid #d8d0c8;
    color: #4b4641;
    font-size: .875rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
#simda-consent-heading { font-weight: 600; margin-right: .5em; }
#simda-analytics-consent p { margin: .25em 0 0; padding: 0; color: inherit; }
#simda-consent-status, #simda-consent-actions { display: inline; }
#simda-consent-status:empty, #simda-consent-detail:empty { display: none; }
#simda-analytics-consent button {
    appearance: none;
    box-sizing: border-box;
    display: inline-block;
    max-width: 100%;
    min-height: 44px;
    height: auto;
    padding: .4em .5em;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: #554638 !important;
    font: inherit;
    line-height: 1.5;
    text-transform: none !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    letter-spacing: normal;
    white-space: normal;
    overflow-wrap: anywhere;
    transform: none !important;
    cursor: pointer;
    box-shadow: none;
}
#simda-analytics-consent button::before, #simda-analytics-consent button::after { content: none !important; }
#simda-analytics-consent button:hover { text-decoration-thickness: 2px; }
#simda-analytics-consent button:focus-visible,
#simda-consent-status:focus { outline: 2px solid #325b83; outline-offset: 3px; }
#simda-analytics-consent button:disabled { cursor: default; opacity: .6; }
@media (max-width: 700px) {
    /* The lifted native back-to-top control must not cover footer text. */
    html[data-simda-consent-view="compact"] body.simda-design-v1 #page #footer .footer_copyright {
        box-sizing: border-box;
        padding-right: 64px;
    }
    /* Keep the theme's existing back-to-top target clear of the consent action. */
    #simda-analytics-consent button { max-width: calc(100% - 64px); }
    body.simda-design-v1 #cookie-notice.simda-consent-open .cookie-notice-container,
    html[data-simda-consent-view="full"] body.simda-design-v1 #cookie-notice .cookie-notice-container,
    html:not([data-simda-consent-view]) body.simda-design-v1.cookies-refused #cookie-notice .cookie-notice-container {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }
    #cookie-notice.simda-consent-open #cn-notice-text,
    html[data-simda-consent-view="full"] #cookie-notice #cn-notice-text,
    html:not([data-simda-consent-view]) body.cookies-refused #cookie-notice #cn-notice-text { max-height: none; }
}
