/* 2026 local-election poll. Uses the site's tokens so it follows light and dark
   mode with the rest of the page. No party colours anywhere: every option is
   the same neutral bar, and only the reader's own answer is highlighted. */

.rwp[hidden], .rwp-chip[hidden] { display: none !important; }

.rwp button, .rwp input, .rwp select, .rwp-chip button { font-family: inherit; }

.rwp {
    font-family: var(--rw-font);
    color: var(--rw-fg);
    background: var(--rw-surface);
    border: 1px solid var(--rw-line);
    border-radius: var(--rw-radius, 16px);
}

/* ---------- bottom sheet ---------- */
.rwp--sheet {
    position: fixed;
    z-index: 110; /* above the tab bar (60) and cookie notice (70), below the exit prompt (120) */
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    width: 400px;
    max-width: calc(100vw - 24px);
    max-height: min(70vh, 640px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--rw-shadow-lg, 0 30px 70px rgba(12, 22, 35, .18));
    transform: translateY(24px);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
    overflow: hidden;
}
.rwp--sheet.on { transform: none; opacity: 1; }

@media (max-width: 767px) {
    /* Phones: a banner above the tab bar, a third of the screen at most until
       the reader taps into it (user-initiated growth, see .rwp--expanded). */
    .rwp--sheet {
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
        bottom: calc(70px + env(safe-area-inset-bottom));
        max-height: 33vh;
        border-radius: 18px;
    }
    .rwp--sheet.rwp--expanded { max-height: calc(100vh - 150px); }
}

.rwp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 8px 16px;
    border-bottom: 1px solid var(--rw-line-2);
    flex: 0 0 auto;
}
.rwp-badge {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--rw-green);
}
.rwp-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--rw-muted);
    margin-right: auto;
}
.rwp-count:not(:empty)::before { content: "·"; margin-right: 8px; }
.rwp-x {
    border: 0;
    background: transparent;
    color: var(--rw-muted);
    font-size: 24px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
}
.rwp-x:hover { background: var(--rw-line-2); color: var(--rw-fg); }

.rwp-body {
    padding: 12px 16px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.rwp-title { font-size: 18px; line-height: 1.3; margin: 2px 0 6px; font-weight: 800; }
.rwp-help, .rwp-fine, .rwp-based, .rwp-proof, .rwp-step { font-size: 13px; color: var(--rw-muted); margin: 0 0 10px; }
.rwp-step { margin-bottom: 2px; font-weight: 600; }
.rwp-fine { margin: 12px 0 0; font-size: 12px; }
.rwp-proof:empty { display: none; }
.rwp-where { font-size: 13px; margin: 0 0 8px; color: var(--rw-muted); }
.rwp-link {
    border: 0; background: none; padding: 0; color: var(--rw-green); font: inherit; font-weight: 700;
    text-decoration: underline; cursor: pointer;
}

/* province chips + municipality list */
.rwp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.rwp-chipbtn {
    border: 1px solid var(--rw-line);
    background: var(--rw-surface);
    color: var(--rw-fg);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 13px;
    cursor: pointer;
}
.rwp-chipbtn.on { background: var(--rw-green); border-color: var(--rw-green); color: #fff; }
.rwp-search {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--rw-line);
    border-radius: 10px;
    font-size: 15px;
    background: var(--rw-surface);
    color: var(--rw-fg);
    margin-bottom: 8px;
}
.rwp-list { display: grid; gap: 6px; }
.rwp-item, .rwp-opt, .rwp-suggest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: 1px solid var(--rw-line);
    background: var(--rw-surface);
    color: var(--rw-fg);
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.rwp-item:hover, .rwp-opt:hover, .rwp-suggest:hover { border-color: var(--rw-green); background: var(--rw-mint); }
.rwp-item:active, .rwp-opt:active { transform: scale(.99); }
.rwp-suggest { border-color: var(--rw-mint-line); background: var(--rw-mint); margin-bottom: 10px; justify-content: flex-start; }
.rwp-tag { font-size: 11px; font-weight: 700; color: var(--rw-muted); text-transform: uppercase; letter-spacing: .04em; }
.rwp-empty { font-size: 14px; color: var(--rw-muted); }

.rwp-options { display: grid; gap: 6px; margin: 4px 0 8px; }
.rwp-options--long { grid-template-columns: 1fr 1fr; }
.rwp-options--long .rwp-opt { font-size: 13.5px; padding: 10px 11px; }
@media (max-width: 380px) { .rwp-options--long { grid-template-columns: 1fr; } }
.rwp-opt.is-busy { opacity: .6; pointer-events: none; }

/* results */
.rwp-note { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--rw-line-2); margin: 0 0 8px; }
.rwp-note--ok { background: var(--rw-mint); color: var(--rw-green-700, #075029); font-weight: 700; }
.rwp-tabs { display: flex; gap: 4px; margin: 6px 0 10px; background: var(--rw-line-2); padding: 3px; border-radius: 10px; }
.rwp-tab {
    flex: 1 1 0;
    border: 0;
    background: transparent;
    color: var(--rw-muted);
    padding: 7px 6px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rwp-tab.on { background: var(--rw-surface); color: var(--rw-fg); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.rwp-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.rwp-bar { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: baseline; font-size: 14px; }
.rwp-lbl { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.rwp-pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.rwp-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--rw-line-2); overflow: hidden; }
.rwp-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--rw-muted); opacity: .55; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.rwp-bar.is-mine .rwp-fill { background: var(--rw-green); opacity: 1; }
.rwp-you {
    font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    color: var(--rw-green); background: var(--rw-mint); border-radius: 999px; padding: 2px 7px;
}
.rwp-based { margin: 10px 0 0; }
.rwp-locked { font-size: 14px; margin: 4px 0; padding: 12px; border: 1px dashed var(--rw-line); border-radius: 12px; }

.rwp-cost {
    display: block; margin: 12px 0 0; padding: 11px 13px; border-radius: 12px;
    background: var(--rw-mint); border: 1px solid var(--rw-mint-line); color: var(--rw-fg);
    text-decoration: none; font-size: 14px;
}
.rwp-cost:hover { border-color: var(--rw-green); }
.rwp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.rwp-next { flex: 1 1 auto; justify-content: center; text-align: center; }
.rwp-wa { font-size: 14px; font-weight: 700; color: var(--rw-green); }
.rwp-error { color: var(--rw-rust, #B4552D); font-size: 13px; margin: 8px 0 0; }

/* results chip, after the reader has answered */
.rwp-chip {
    position: fixed;
    z-index: 105;
    left: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    border-radius: 999px;
    background: var(--rw-surface);
    color: var(--rw-fg);
    border: 1px solid var(--rw-line);
    box-shadow: var(--rw-shadow-lg, 0 10px 30px rgba(0, 0, 0, .15));
    font-family: var(--rw-font);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    max-width: calc(100vw - 32px);
}
.rwp-chip > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rwp-chip-x {
    border: 0; background: var(--rw-line-2); color: var(--rw-muted);
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1;
}
@media (max-width: 767px) {
    .rwp-chip { bottom: calc(76px + env(safe-area-inset-bottom)); left: 10px; }
}

/* ---------- inline poll + explorer on /elections-2026/ ---------- */
.rwp--inline { margin: 0 0 28px; box-shadow: var(--rw-shadow, 0 8px 24px rgba(12, 22, 35, .08)); }
.rwp--inline .rwp-body { padding: 16px 20px 20px; }
.rwp--inline .rwp-title { font-size: 21px; }

.rwp-explore-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 0 0 16px; align-items: end; }
.rwp-explore-controls label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--rw-muted); }
.rwp-select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--rw-line); border-radius: 10px;
    background: var(--rw-surface); color: var(--rw-fg); font-size: 14.5px;
}
.rwp-check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 600 !important; }
.rwp-explore-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.rwp-card { border: 1px solid var(--rw-line); border-radius: var(--rw-radius, 16px); padding: 16px; background: var(--rw-surface); }
.rwp-card-title { font-size: 16px; margin: 0 0 12px; }

/* ---------- article sidebar card ---------- */
.rwp-side {
    border: 1px solid var(--rw-mint-line);
    background: var(--rw-mint);
    border-radius: var(--rw-radius, 16px);
    padding: 16px;
    margin: 0 0 18px;
}
.rwp-side-eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--rw-green); margin-bottom: 6px; }
.rwp-side-title { display: block; font-size: 17px; line-height: 1.3; margin-bottom: 6px; color: var(--rw-fg); }
.rwp-side-text { font-size: 13.5px; color: var(--rw-muted); margin: 0 0 12px; }

@media (prefers-reduced-motion: reduce) {
    .rwp--sheet, .rwp-fill, .rwp-item, .rwp-opt { transition: none !important; }
}
