.modal:has(.poll-stats) {
    max-width: 980px;
    background: radial-gradient(ellipse at 85% 0%, #252e1b, #161b15 42%);
    border-color: #d4fac233;
}

.poll-stats { --stat-accent: #c6f366; }
.poll-stat-header { position: relative; padding-right: 55px; margin-bottom: 18px; }
.poll-stat-header h2 { margin: 7px 0 10px; font-size: clamp(24px, 4vw, 38px); overflow-wrap: anywhere; }
.poll-stat-header .eyebrow { color: var(--stat-accent); }
.poll-stat-header button svg { width: 15px; height: 15px; }
.poll-stat-feedback { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.poll-stat-feedback:empty { display: none; }
.poll-stats.is-loading [data-stat-refresh] svg { animation: poll-stat-spin 1s linear infinite; }

.poll-stat-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
    gap: 8px;
    margin: 0 0 13px;
}

.poll-stat-metric {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
    padding: 12px 15px;
    border: 1px solid #d4fac228;
    border-radius: 13px;
    background: linear-gradient(130deg, #c6f36616, #ffffff03 80%);
    animation: poll-stat-enter .35s both cubic-bezier(.22, 1, .36, 1);
    animation-delay: calc(var(--stat-index) * 55ms);
}

.poll-stat-metric dt { font-size: 11px; color: #bdc9b5; }
.poll-stat-metric dd { margin: 0; color: #e4ffb2; font-size: clamp(19px, 4vw, 28px); font-weight: 800; }
.poll-stat-charts { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.poll-stat-panel { min-width: 0; padding: 15px; border: 1px solid #d4fac223; border-radius: 14px; background: #ffffff04; }
.poll-stat-panel h3 { margin: 0 0 6px; font-size: 16px; }
.poll-stat-caption { margin: 0; color: #aebda7; font-size: 11px; line-height: 1.5; }
.poll-stat-bars { display: grid; gap: 3px; margin-top: 13px; }

.poll-stat-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 7px 10px;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-align: left;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.poll-stat-option:hover, .poll-stat-option[aria-pressed=true] { background: #c6f36610; border-color: #c6f36645; }
.poll-stat-option-name { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.poll-stat-option-name small { display: block; margin-top: 3px; color: #d1ed98; font-size: 9px; font-weight: 600; }
.poll-stat-option-value { color: #bfc9b8; font-size: 10px; white-space: nowrap; }
.poll-stat-option-value b { display: inline-block; min-width: 36px; margin-left: 4px; color: #e6f9ce; font-size: 12px; text-align: right; }
.poll-stat-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 10px; background: #d4fac217; }

.poll-stat-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #638b39, var(--stat-accent));
    transform: scaleX(var(--stat-share));
    transform-origin: left;
    animation: poll-stat-width .65s both cubic-bezier(.22, 1, .36, 1);
    animation-delay: min(calc(var(--stat-index) * 35ms), 180ms);
}

.poll-stat-day-info { margin: 13px 0 4px; color: #e5ffbb; font-size: 12px; font-weight: 700; }
.poll-stat-timeline { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); height: 115px; border-bottom: 1px solid #d4fac22c; }
.poll-stat-timeline button { position: relative; display: flex; align-items: flex-end; justify-content: center; min-width: 0; padding: 0 2px; }
.poll-stat-timeline button::after { content: ''; position: absolute; inset: 0 1px; border-radius: 6px 6px 0 0; transition: background .2s ease; }
.poll-stat-timeline button:is(:hover, :focus-visible, [aria-pressed=true])::after { background: #c6f36611; }

.poll-stat-timeline i {
    width: 100%;
    max-width: 20px;
    height: max(2px, calc(var(--stat-share) * 100%));
    border-radius: 5px 5px 0 0;
    background: linear-gradient(0deg, #547439, #b4ed6b);
    transform-origin: bottom;
    animation: poll-stat-height .65s both cubic-bezier(.22, 1, .36, 1);
    animation-delay: calc(var(--stat-index) * 20ms);
}

.poll-stat-timeline button[aria-pressed=true] i { background: var(--stat-accent); box-shadow: 0 0 14px #c6f36650; }
.poll-stat-axis { display: flex; justify-content: space-between; margin-top: 6px; color: #adb8a7; font-size: 10px; }
.poll-stat-undated { margin-top: 11px; }
.poll-stat-voters { margin-top: 13px; animation: poll-stat-enter .3s both cubic-bezier(.22, 1, .36, 1); }
.poll-stat-voter-heading { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin-bottom: 10px; }
.poll-stat-voter-heading h3 span { margin-left: 4px; color: var(--stat-accent); font-size: 12px; }
.poll-stat-voter-heading .field { min-width: 130px; max-width: 220px; font-size: 10px; }
.poll-stat-voter-heading select { min-width: 0; width: 100%; padding: 7px 9px; }
.poll-stat-voter-list { display: grid; margin: 0; padding: 0; list-style: none; }

.poll-stat-voter {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-top: 1px solid #d4fac217;
}

.poll-stat-profile {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 3px 5px 3px 0;
    border-radius: 9px;
    text-align: left;
}

button.poll-stat-profile:is(:hover, :focus-visible) { background: #c6f36610; }
button.poll-stat-profile:focus-visible { outline-offset: 1px; }
.poll-stat-profile svg { width: 14px; height: 14px; color: var(--stat-accent); }

.poll-stat-avatar {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 9px;
    background: #c6f3661c;
    color: #d8f7a3;
    font-size: 12px;
    font-weight: 800;
}

.poll-stat-person, .poll-stat-vote { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.poll-stat-person strong { font-size: 12px; }
.poll-stat-person small, .poll-stat-date { color: #b0bea9; font-size: 10px; }
.poll-stat-vote > span { display: flex; flex-wrap: wrap; gap: 3px; }
.poll-stat-vote > span > span { padding: 3px 5px; border-radius: 6px; background: #c6f36612; font-size: 10px; }
.poll-stat-vote small { font-size: 9px; }
.poll-stat-vote .is-right { color: #d3ef9e; }
.poll-stat-vote .is-wrong { color: #ffb4a9; }
.poll-stat-empty { padding: 14px 0 4px; color: #b0bea9; font-size: 12px; }
.poll-stat-pages { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.poll-stat-pages span { color: #b0bea9; font-size: 10px; }
.poll-stat-pages button:disabled { opacity: .4; cursor: default; }

@keyframes poll-stat-enter {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes poll-stat-width { from { transform: scaleX(0); } }
@keyframes poll-stat-height { from { transform: scaleY(0); } }
@keyframes poll-stat-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: no-preference) {
    .poll-stat-option:active { transform: scale(.98); }
}

@media (max-width: 700px) {
    .poll-stat-charts { grid-template-columns: minmax(0, 1fr); }
    .poll-stat-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 115px), 1fr)); }
    .poll-stat-voter { grid-template-columns: minmax(0, 1fr); gap: 5px; }
    .poll-stat-vote, .poll-stat-date { margin-left: 39px; }
    .poll-stat-voter-heading { flex-wrap: wrap; }
    .poll-stat-voter-heading .field { max-width: 100%; }
}
