/* Election results page. Builds on styles.css (panels, pill buttons, the full-viewport map). */
/* the left column is the home map's #left-column (breadcrumb, search, results), a little wider */
#left-column.el-column { width: 340px; max-height: calc(100vh - 40px); }
.el-search { padding: 8px; }
.el-search input { width: 100%; padding: 8px 10px; border: 1px solid var(--panel-border); border-radius: 8px; font: inherit; }
.el-hits { max-height: 220px; overflow-y: auto; }
.el-hit { padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.el-hit:hover { background: var(--overlay-weak); }
.el-result { padding: 12px 14px; overflow-y: auto; min-height: 60px; }
.el-result h2 { margin: 0 0 2px; font-size: 18px; }
.el-dim { color: var(--text-dim); }
.el-small { font-size: 12px; }
.el-msg { color: var(--err); }
.el-link { background: none; border: none; padding: 4px 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; }
.el-row { display: block; width: 100%; text-align: left; background: none; border: 1px solid var(--panel-border); border-radius: 8px;
    padding: 8px 10px; margin: 6px 0; cursor: pointer; font: inherit; color: var(--text); }
.el-row:hover { background: var(--overlay-weak); }

.el-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.el-stat { background: var(--overlay-weak); border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.el-stat strong { font-size: 15px; }

.el-cands { display: flex; flex-direction: column; gap: 8px; }
.el-card { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--panel-border); border-radius: 10px; }
.el-card.el-winner { border-color: #2e7d32; box-shadow: inset 3px 0 0 #2e7d32; }
.el-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--overlay-strong); }
.el-nophoto { display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-dim); }
.el-body { flex: 1; min-width: 0; font-size: 13px; }
.el-name { font-size: 14px; }
.el-bar { height: 8px; background: var(--overlay-strong); border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.el-fill { height: 100%; border-radius: 4px; }
.el-badge { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; margin-left: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.el-ok { background: #e3f2e6; color: #2e7d32; }
.el-disputed { background: #fdf0d2; color: var(--warn); }
.el-win { background: #2e7d32; color: #fff; }
.el-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

.el-legend { position: absolute; z-index: 1000; right: 20px; bottom: 90px; padding: 10px 12px; max-width: 260px; font-size: 13px; }
.el-legend-row { margin: 3px 0; }

#controls select.pill-btn { cursor: pointer; }
#controls a.pill-btn { text-decoration: none; display: inline-flex; align-items: center; }
#toast { position: absolute; z-index: 1100; left: 50%; bottom: 30px; transform: translateX(-50%); background: #263238; color: #fff;
    padding: 8px 14px; border-radius: 8px; font-family: var(--font); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
#toast.show { display: block; opacity: 1; }

.el-dialog { border: none; border-radius: 12px; padding: 18px; width: min(440px, calc(100vw - 32px)); font-family: var(--font); }
.el-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.el-dialog h3 { margin: 0 0 4px; }
.el-dialog label { display: block; margin: 10px 0; font-size: 13px; color: var(--text-dim); }
.el-dialog input, .el-dialog textarea, .el-dialog select { display: block; width: 100%; margin-top: 4px; padding: 8px; font: inherit; color: var(--text);
    border: 1px solid var(--panel-border); border-radius: 8px; }
.el-actions { display: flex; justify-content: flex-end; gap: 8px; }
.el-primary { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
    #left-column.el-column { top: auto; bottom: 0; left: 0; width: 100%; max-width: 100%; max-height: 50vh; padding: 0 8px 8px; }
    .el-legend { display: none; }
    #controls { max-width: calc(100vw - 32px); }
}

/* party tally of a place */
.el-tally { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.el-tally-row { display: grid; grid-template-columns: 1fr 70px 36px; align-items: center; gap: 8px; font-size: 12.5px; }
.el-tally-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-tally-row .el-bar { margin: 0; }
.el-tally-n { text-align: right; }
.el-result h3 { margin: 12px 0 2px; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }

/* the posts of a local body or ward */
.el-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }
.el-tab { border: 1px solid var(--panel-border); background: none; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--text); }
.el-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* "Elected only" */
#elected.on { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.el-post { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); font-weight: 600; }
.el-winner-tag { color: #2e7d32; font-weight: 700; }
