#icn-root {
    --icn-primary: #1e6fd9;
    --icn-bg: #111827;
    --icn-text: #f9fafb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
}

#icn-root,
#icn-root *,
#icn-root *::before,
#icn-root *::after {
    box-sizing: border-box;
}

.icn-text-wrap {
    flex: 1 1 380px;
    min-width: 0;
}

.icn-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 6px;
}

.icn-legal-links a {
    font-size: 12px;
    text-decoration: underline;
    white-space: nowrap;
}

.icn-banner .icn-legal-links a {
    color: var(--icn-text);
    opacity: .85;
}

.icn-modal-panel .icn-legal-links {
    margin: 16px 0 0;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.icn-modal-panel .icn-legal-links a {
    color: var(--icn-primary);
}

.icn-banner {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 2147483000;
    background: var(--icn-bg);
    color: var(--icn-text);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, .25);
    overflow-x: hidden;
}

.icn-banner.icn-bottom { bottom: 0; }
.icn-banner.icn-top { top: 0; box-shadow: 0 2px 12px rgba(0, 0, 0, .25); }

.icn-banner-inner {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
}

.icn-text {
    margin: 0;
    line-height: 1.5;
}

.icn-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icn-btn {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.icn-btn-primary {
    background: var(--icn-primary);
    color: #fff;
}

.icn-btn-ghost {
    background: transparent;
    color: var(--icn-text);
    border-color: rgba(255, 255, 255, .35);
}

.icn-btn-ghost:hover {
    border-color: rgba(255, 255, 255, .7);
}

.icn-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: 100vh;
    z-index: 2147483001;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.icn-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.icn-modal-panel {
    position: relative;
    background: #fff;
    color: #1f2937;
    width: min(520px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 10px;
    padding: 24px;
}

.icn-modal-panel h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.icn-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-top: 1px solid #e5e7eb;
}

.icn-row:first-of-type {
    border-top: none;
}

.icn-row-text strong {
    display: block;
    margin-bottom: 2px;
}

.icn-row-text p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.icn-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex: none;
    margin-top: 2px;
}

.icn-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.icn-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    transition: .15s;
    cursor: pointer;
}

.icn-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .15s;
}

.icn-switch input:checked + .icn-slider {
    background: var(--icn-primary);
}

.icn-switch input:checked + .icn-slider::before {
    transform: translateX(18px);
}

.icn-switch-disabled .icn-slider {
    cursor: not-allowed;
    opacity: .6;
}

.icn-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

#icn-manage-btn {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 2147482999;
    background: var(--icn-bg);
    color: var(--icn-text);
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    cursor: pointer;
    opacity: .85;
}

#icn-manage-btn:hover {
    opacity: 1;
}

@media (max-width: 640px) {
    .icn-banner {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .icn-banner-inner {
        display: block;
        padding: 16px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .icn-text-wrap {
        display: block;
        width: 100%;
    }

    .icn-text {
        font-size: 13px;
    }

    .icn-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }

    /* Visually lead with the primary action on small screens, keep DOM
       order intact (Reject, Customize, Accept) for consistent tab order. */
    .icn-actions #icn-accept-all {
        order: -1;
    }

    .icn-actions .icn-btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 15px;
    }

    .icn-modal-panel {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0));
    }

    .icn-modal-panel h2 {
        font-size: 17px;
    }

    .icn-row {
        gap: 12px;
    }

    .icn-modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .icn-modal-actions .icn-btn {
        width: 100%;
        padding: 12px 16px;
    }

    #icn-manage-btn {
        left: 12px;
        bottom: 12px;
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .icn-switch {
        width: 36px;
        height: 20px;
    }

    .icn-slider::before {
        width: 14px;
        height: 14px;
    }

    .icn-switch input:checked + .icn-slider::before {
        transform: translateX(16px);
    }
}
