/* polaris_consent/static/polaris_consent/consent.css
 * Framework-independent banner styles. Hosts theme it by setting these
 * custom properties (e.g. on :root):
 *   --polaris-consent-bg, --polaris-consent-fg, --polaris-consent-muted,
 *   --polaris-consent-border, --polaris-consent-accent,
 *   --polaris-consent-accent-fg, --polaris-consent-radius,
 *   --polaris-consent-font, --polaris-consent-z
 */
.polaris-consent {
    --_bg: var(--polaris-consent-bg, #ffffff);
    --_fg: var(--polaris-consent-fg, #1f2420);
    --_muted: var(--polaris-consent-muted, #5f675e);
    --_border: var(--polaris-consent-border, #dfe4d8);
    --_accent: var(--polaris-consent-accent, #3b5c34);
    --_accent-fg: var(--polaris-consent-accent-fg, #ffffff);
    --_radius: var(--polaris-consent-radius, 14px);

    position: fixed;
    inset: auto 16px 16px 16px;
    z-index: var(--polaris-consent-z, 2147483000);
    display: flex;
    justify-content: center;
    pointer-events: none;
    font-family: var(--polaris-consent-font, inherit);
    color: var(--_fg);
}

@media (prefers-color-scheme: dark) {
    .polaris-consent {
        --_bg: var(--polaris-consent-bg, #1b1f1b);
        --_fg: var(--polaris-consent-fg, #eef1ea);
        --_muted: var(--polaris-consent-muted, #aab3a6);
        --_border: var(--polaris-consent-border, #343b33);
        --_accent: var(--polaris-consent-accent, #8fb584);
        --_accent-fg: var(--polaris-consent-accent-fg, #111511);
    }
}

.polaris-consent[hidden] {
    display: none;
}

.polaris-consent__panel {
    pointer-events: auto;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 20px 22px;
    background: var(--_bg);
    border: 1px solid var(--_border);
    border-radius: var(--_radius);
    box-shadow: 0 18px 50px rgba(15, 20, 15, 0.18);
    font-size: 15px;
    line-height: 1.5;
}

.polaris-consent__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.polaris-consent__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--_fg);
}

.polaris-consent__close {
    flex: none;
    font-size: 24px;
    line-height: 1;
    text-decoration: none;
    color: var(--_muted);
}

.polaris-consent__close[hidden] {
    display: none;
}

.polaris-consent__body {
    margin: 0 0 12px;
    color: var(--_muted);
}

.polaris-consent a {
    color: var(--_accent);
}

.polaris-consent__details {
    margin: 0 0 14px;
    border-top: 1px solid var(--_border);
    padding-top: 10px;
}

.polaris-consent__details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--_fg);
}

.polaris-consent__categories {
    list-style: none;
    margin: 12px 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.polaris-consent__category {
    padding: 12px 14px;
    border: 1px solid var(--_border);
    border-radius: calc(var(--_radius) - 4px);
}

.polaris-consent__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.polaris-consent__toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--_accent);
}

.polaris-consent__badge {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--_muted);
}

.polaris-consent__category-desc {
    margin: 6px 0 0 28px;
    font-size: 14px;
    color: var(--_muted);
}

.polaris-consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.polaris-consent__actions--single {
    grid-template-columns: 1fr;
}

/* Both first-layer choices share one style on purpose (equal weight). */
.polaris-consent__button {
    appearance: none;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid var(--_accent);
    border-radius: calc(var(--_radius) - 4px);
    background: var(--_accent);
    color: var(--_accent-fg);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.polaris-consent__button--secondary {
    background: transparent;
    color: var(--_accent);
}

.polaris-consent__button:hover {
    filter: brightness(1.08);
}

.polaris-consent__button:focus-visible,
.polaris-consent summary:focus-visible,
.polaris-consent a:focus-visible,
.polaris-consent input:focus-visible {
    outline: 3px solid var(--_accent);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .polaris-consent {
        inset: auto 8px 8px 8px;
    }

    .polaris-consent__panel {
        padding: 16px;
    }

    .polaris-consent__actions {
        grid-template-columns: 1fr;
    }
}
