:root {
    --banner-height: 80px;
}

/* --- FONTS & RESET --- */
.dpn-bar,
.dpn-panel,
.dpn-overlay {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.dpn-bar *,
.dpn-panel * {
    box-sizing: border-box;
}

/* --- OVERLAY --- */
.dpn-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99998;
}

/* --- BOTTOM BANNER --- */
.dpn-bar {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 99999;
    gap: 24px;
}

.dpn-bar__content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 58%;
}

.dpn-bar__icon {
    color: #111111;
    flex-shrink: 0;
    margin-top: 2px;
}

.dpn-bar__text h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #111111;
}

.dpn-bar__text p {
    margin: 0;
    font-size: 12px;
    color: #444444;
    line-height: 1.4;
}

.dpn-bar__text .dpn-policy-line {
    margin-top: 4px;
}

.dpn-policy-link,
.dpn-footer-link a {
    color: #d93a2f;
    text-decoration: underline;
    font-size: 12px;
    font-weight: 500;
}

.dpn-policy-link:hover,
.dpn-footer-link a:hover {
    color: #b92e24;
}

.dpn-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* --- SIDEBAR / MODAL --- */
.dpn-panel {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--banner-height) + 8px);
    width: 370px;
    max-width: calc(100vw - 40px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 100000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--banner-height) - 60px);
    overflow-y: auto;
}

.dpn-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.dpn-panel__header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #111111;
}

.dpn-closebtn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #595959;
    padding: 0;
    line-height: 1;
}

.dpn-closebtn:hover {
    color: #111111;
}

.dpn-panel__desc {
    font-size: 11.5px;
    color: #595959;
    margin: 0 0 14px 0;
    line-height: 1.35;
}

.dpn-cats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dpn-cat {
    border: 1px solid #ededed;
    border-radius: 8px;
    padding: 10px 12px;
    background-color: #ffffff;
}

.dpn-cat__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dpn-cat__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #111111;
}

.dpn-lock {
    color: #595959;
}

.dpn-cat p {
    font-size: 11px;
    color: #595959;
    margin: 4px 0 0 0;
    line-height: 1.3;
}

/* --- TOGGLE SWITCHES --- */
.dpn-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.dpn-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #dcdce1;
    transition: 0.2s ease;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    transition: 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.dpn-bar input:checked + .slider,
.dpn-panel input:checked + .slider {
    background-color: #d93a2f;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.dpn-switch.disabled .slider {
    background-color: #dcdce1;
    cursor: not-allowed;
}

/* FOOTER */
.dpn-panel__footer {
    margin-top: 16px;
}

.dpn-footer-link {
    text-align: center;
    margin-top: 10px;
    font-size: 11.5px;
    color: #595959;
}

/* --- BUTTONS --- */
.dpn-btn {
    height: 38px;
    padding: 0 20px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.dpn-bar .dpn-primary {
    background-color: #d93a2f;
    color: #ffffff;
}

.dpn-bar .dpn-primary:hover {
    background-color: #b92e24;
    border: 1px solid #b92e24;
}

.dpn-bar .dpn-secondary {
    background-color: #ffffff;
    color: #111111;
    border-color: #d1d5db;
}

.dpn-bar .dpn-secondary:hover {
    background-color: #f9fafb;
    border: 1px solid #b92e24;
}

.dpn-bar .dpn-textbtn {
    background: transparent;
    color: #d93a2f;
    padding: 0 8px;
}

.dpn-bar .dpn-textbtn:hover {
    text-decoration: underline;
}

.dpn-block {
    width: 100%;
}

/* --- MOBILE ADAPTIVE --- */
@media (max-width: 768px) {
    .dpn-bar {
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 12px 12px 0 0;
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }

    .dpn-bar__content {
        max-width: 100%;
    }

    .dpn-bar__actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .dpn-bar__actions button {
        width: 100%;
    }

    .dpn-panel {
        right: 0;
        left: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        border: none;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
        padding: 20px 16px;
    }
}

/* --- DAO site additions (US #608) --- */
.dpn-bar h4 { font-family: inherit; }
.dpn-btn:focus-visible,
.dpn-closebtn:focus-visible,
.dpn-policy-link:focus-visible,
.dpn-switch input:focus-visible + .slider { outline: 2px solid #111111; outline-offset: 2px; }
.dpn-closebtn { font-size: 24px; min-width: 32px; min-height: 32px; }
.dpn-bar .dpn-textbtn { min-height: 38px; }
/* footer link that reopens the settings */
.ft-bottom__btn { background: none; border: 0; font: inherit; cursor: pointer; text-transform: uppercase; }
/* keep the page's back-to-top button above the banner */
.to-top { margin-bottom: var(--banner-height, 0px); }

/* panel fixes: site-wide <strong>/button styles must not leak in; primary button also inside the panel */
.dpn-bar button, .dpn-panel button { font-family: inherit; }
.dpn-panel .dpn-cat__head > strong { font-size: 13px; font-weight: 700; line-height: 1.3; color: #111111; text-transform: none; letter-spacing: 0; }
.dpn-panel .dpn-primary { background-color: #d93a2f; color: #ffffff; }
.dpn-panel .dpn-primary:hover { background-color: #b92e24; border: 1px solid #b92e24; }
.dpn-bar h4, .dpn-panel h3 { text-transform: none; letter-spacing: 0; }

/* headings replaced by non-heading elements (keeps the page heading order clean) */
.dpn-bar__text .dpn-bar__title { margin: 0 0 4px 0; font-size: 15px; font-weight: 700; color: #111111; line-height: 1.3; }
.dpn-panel__title { margin: 0; font-size: 17px; font-weight: 700; color: #111111; }

/* the banner stays visible until the visitor makes a choice (JS sets data-open) */
.dpn-bar[data-open="1"] { display: flex !important; }
