/* PropertyDog consent experience v2. Loaded only on PropertyDog account/PAYG pages.
 * The first-visit bar participates in normal document flow immediately after
 * the header. It cannot overlay the Create account / Sign in buttons on mobile.
 * All consent categories, storage rules and event handlers remain unchanged.
 */
html[data-pd-brand="1"] body .ip217-consent {
    position: relative !important;
    inset: auto !important;
    display: block;
    width: 100%;
    padding: 0 !important;
    z-index: 15;
    pointer-events: auto;
    background: #f3f8ef;
    scroll-margin-top: 105px;
}
html[data-pd-brand="1"] body .ip217-consent[hidden] { display: none !important; }
html[data-pd-brand="1"] body .ip217-consent-panel {
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border: 0;
    border-bottom: 1px solid #bfd2bd;
    padding: 12px clamp(16px, 4vw, 40px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 20px;
    row-gap: 8px;
    background: #f3f8ef;
    color: #1b3823;
}
html[data-pd-brand="1"] body .ip217-consent-top { gap: 10px; }
html[data-pd-brand="1"] body .ip217-consent-icon { display: none; }
html[data-pd-brand="1"] body .ip217-consent-top h2 {
    color: #173821;
    font-size: 1rem;
    line-height: 1.25;
    margin: 0 0 3px;
}
html[data-pd-brand="1"] body .ip217-consent-top p {
    color: #405447;
    font-size: .78rem;
    line-height: 1.45;
    max-width: 760px;
}
html[data-pd-brand="1"] body .ip217-consent-actions {
    display: flex;
    flex-wrap: nowrap;
    grid-row: 1;
    grid-column: 2;
    margin: 0;
    gap: 7px;
}
html[data-pd-brand="1"] body .ip217-consent-button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 11px;
    font-size: .75rem;
    white-space: nowrap;
}
html[data-pd-brand="1"] body .ip217-consent-options {
    grid-row: 2;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 5px 0 0;
}
html[data-pd-brand="1"] body .ip217-consent-foot {
    grid-row: 3;
    grid-column: 1 / -1;
    font-size: .69rem;
    line-height: 1.4;
    margin: 0;
}
html[data-pd-brand="1"] body .ip217-consent-foot a { color: #225f35; }
html[data-pd-brand="1"] body .ip217-consent-shade { display: none !important; }
html[data-pd-brand="1"] body #ip-sw1-consent-space { display: none !important; }
html[data-theme="dark"][data-pd-brand="1"] body .ip217-consent,
html[data-theme="dark"][data-pd-brand="1"] body .ip217-consent-panel {
    background: #1b3124;
    color: #edf7e9;
    border-color: #3d6049;
}
html[data-theme="dark"][data-pd-brand="1"] body .ip217-consent-top h2 { color: #f0f8e9; }
html[data-theme="dark"][data-pd-brand="1"] body .ip217-consent-top p { color: #c1d7c6; }
html[data-theme="dark"][data-pd-brand="1"] body .ip217-consent-foot { color: #bdcebf; }
html[data-theme="dark"][data-pd-brand="1"] body .ip217-consent-foot a { color: #a8dfa8; }
@media (max-width: 800px) {
    html[data-pd-brand="1"] body .ip217-consent-panel {
        grid-template-columns: 1fr;
        padding: 10px 14px;
        row-gap: 8px;
    }
    html[data-pd-brand="1"] body .ip217-consent-top { grid-column: 1; grid-row: 1; }
    html[data-pd-brand="1"] body .ip217-consent-actions {
        grid-column: 1; grid-row: 2;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    html[data-pd-brand="1"] body .ip217-consent-button {
        padding: 8px 3px;
        min-width: 0;
        min-height: 36px;
        font-size: .73rem;
    }
    html[data-pd-brand="1"] body .ip217-consent-options { grid-column: 1; grid-row: 3; grid-template-columns: 1fr; }
    html[data-pd-brand="1"] body .ip217-consent-foot { grid-column: 1; grid-row: 4; font-size: .67rem; }
}
@media (max-width: 360px) {
    html[data-pd-brand="1"] body .ip217-consent-actions { grid-template-columns: 1fr 1fr; }
    html[data-pd-brand="1"] body .ip217-consent-button.ip217-accept { grid-column: 1 / -1; }
    html[data-pd-brand="1"] body .ip217-consent-button.ip217-save { grid-column: 1 / -1; }
}
