:root {
    --hco-bg: #000000;
    --hco-text: #ffffff;
    --hco-accept: #28a745;
    --hco-secondary: #dc3545;
}

.hco-banner,
.hco-modal-backdrop,
.hco-revisit,
.hco-shortcode-button {
    box-sizing: border-box;
    font-family: inherit;
}

.hco-banner[hidden],
.hco-modal-backdrop[hidden],
.hco-revisit[hidden] {
    display: none !important;
}

.hco-banner {
    position: fixed;
    z-index: 2147483645;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hco-bg);
    color: var(--hco-text);
    padding: 12px 16px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
}

.hco-banner-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.hco-banner-copy {
    flex: 1 1 420px;
    min-width: 0;
}

.hco-banner-copy p {
    margin: 0;
    color: var(--hco-text);
    font-size: 13px;
    line-height: 1.55;
}

.hco-banner-copy a {
    color: var(--hco-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hco-banner-actions,
.hco-modal-footer {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hco-banner-actions {
    flex: 0 0 auto;
}

.hco-btn,
.hco-revisit,
.hco-shortcode-button {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: filter .18s ease, transform .18s ease;
}

.hco-btn {
    min-height: 38px;
    padding: 9px 14px;
    white-space: nowrap;
}

.hco-btn:hover,
.hco-revisit:hover,
.hco-shortcode-button:hover {
    filter: brightness(.9);
}

.hco-btn:focus-visible,
.hco-revisit:focus-visible,
.hco-shortcode-button:focus-visible,
.hco-modal-close:focus-visible,
.hco-switch input:focus-visible + .hco-slider {
    outline: 3px solid #5aa7ff;
    outline-offset: 2px;
}

.hco-btn-accept {
    background: var(--hco-accept);
    border-color: var(--hco-accept);
    color: #fff;
}

.hco-btn-secondary {
    background: var(--hco-secondary);
    border-color: var(--hco-secondary);
    color: #fff;
}

.hco-modal-open {
    overflow: hidden !important;
}

.hco-modal-backdrop {
    position: fixed;
    z-index: 2147483646;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .70);
}

.hco-modal {
    position: relative;
    width: min(540px, 100%);
    max-height: min(84vh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    color: #222;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.hco-modal-close {
    position: absolute;
    z-index: 2;
    top: 7px;
    right: 9px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #777;
    cursor: pointer;
    font-size: 28px;
    line-height: 38px;
}

.hco-modal-close:hover {
    background: #f1f1f1;
    color: #222;
}

.hco-modal-header {
    padding: 18px 54px 12px 22px;
    border-bottom: 1px solid #eee;
}

.hco-modal-header h2 {
    margin: 0 0 7px;
    color: #222;
    font-size: 18px;
    line-height: 1.3;
}

.hco-modal-header p,
.hco-pref-item p {
    margin: 0;
    color: #666;
    font-size: 12.5px;
    line-height: 1.55;
}

.hco-modal-header a {
    color: #1565c0;
    text-decoration: underline;
}

.hco-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 5px 22px;
    overscroll-behavior: contain;
}

.hco-pref-item {
    padding: 13px 0;
    border-bottom: 1px solid #eee;
}

.hco-pref-item:last-child {
    border-bottom: 0;
}

.hco-pref-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}

.hco-pref-head strong {
    color: #222;
    font-size: 14px;
}

.hco-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
}

.hco-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.hco-slider {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: #b8b8b8;
    cursor: pointer;
    transition: .18s ease;
}

.hco-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    transition: .18s ease;
}

.hco-switch input:checked + .hco-slider {
    background: var(--hco-accept);
}

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

.hco-switch input:disabled + .hco-slider {
    cursor: not-allowed;
    opacity: .75;
}

.hco-modal-footer {
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.hco-revisit {
    position: fixed;
    z-index: 2147483644;
    left: 12px;
    bottom: 12px;
    padding: 7px 10px;
    background: #222;
    color: #fff;
    border-color: #222;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
    font-size: 11px;
}

.hco-shortcode-button {
    padding: 8px 11px;
    background: #222;
    color: #fff;
    border-color: #222;
}

@media (max-width: 820px) {
    .hco-banner-inner {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .hco-banner-copy {
        flex-basis: auto;
    }

    .hco-banner-actions {
        width: 100%;
    }

    .hco-banner-actions .hco-btn {
        flex: 1 1 0;
        min-width: 0;
        white-space: normal;
    }
}

@media (max-width: 560px) {
    .hco-banner {
        padding: 10px;
    }

    .hco-banner-copy p {
        font-size: 12px;
        line-height: 1.45;
    }

    .hco-banner-actions {
        gap: 6px;
    }

    .hco-banner-actions .hco-btn {
        min-height: 42px;
        padding: 7px 5px;
        font-size: 10.5px;
        line-height: 1.25;
    }

    .hco-modal-backdrop {
        align-items: flex-end;
        padding: 8px;
    }

    .hco-modal {
        max-height: calc(100dvh - 16px);
        border-radius: 10px 10px 6px 6px;
    }

    .hco-modal-header {
        padding: 16px 48px 10px 16px;
    }

    .hco-modal-body {
        padding: 4px 16px;
    }

    .hco-modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
        padding: 10px;
    }

    .hco-modal-footer .hco-btn {
        min-height: 42px;
        white-space: normal;
        padding: 7px 8px;
    }

    .hco-modal-footer .hco-btn-accept {
        grid-column: 1 / -1;
    }

    .hco-revisit {
        left: 8px;
        bottom: 8px;
        max-width: calc(100vw - 16px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hco-btn,
    .hco-revisit,
    .hco-shortcode-button,
    .hco-slider,
    .hco-slider::before {
        transition: none;
    }
}
