/* votes.goldenpabu.com — same first-gen look as the train tracker: grey panels, blue headings, Arial */
:root {
    --panel: rgba(45, 45, 45, 0.96);
    --card: #3a3a3a;
    --blue: #007bff;
    --text: #eee;
    --muted: #aaa;
    --line: #4a4a4a;
    --for: #1b7837;
    --against: #762a83;
}
body.light-mode {
    --panel: rgba(255, 255, 255, 0.97);
    --card: #eef0f3;
    --text: #222;
    --muted: #666;
    --line: #dcdfe4;
}
html, body { margin: 0; height: 100%; }
body { background: #1b1c1e; font-family: Arial, sans-serif; overflow: hidden; }
#map { position: fixed; inset: 0; background: #2a2c30; }
body.light-mode #map { background: #dfe6ec; }

.ui-panel {
    position: fixed; z-index: 1500;
    background: var(--panel); color: var(--text);
    border-radius: 10px; box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}
.ui-panel h1 { margin: 0; color: var(--blue); font-size: 20px; }
.ui-panel h4 { margin: 0 0 8px; color: var(--blue); font-size: 13px; }
.section { background: var(--card); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.btn {
    border: 0; cursor: pointer; padding: 6px 10px; border-radius: 5px;
    background: #555; color: #ddd; font: bold 12px Arial, sans-serif;
}
body.light-mode .btn { background: #dde1e7; color: #333; }
.btn:hover { filter: brightness(1.15); }
.btn.on { background: var(--blue); color: #fff; }
.muted { color: var(--muted); }
a { color: #5aa6ff; }
body.light-mode a { color: #0062cc; }

/* ---------- left panel ---------- */
#control-panel {
    top: 12px; left: 12px; width: 340px; padding: 14px;
    max-height: calc(100vh - 24px); overflow-y: auto; scrollbar-width: thin;
}
.cp-head { display: flex; align-items: center; justify-content: space-between; }
.cp-icon { width: 34px; height: 34px; border-radius: 6px; border: 0; background: #555; color: #eee; display: grid; place-items: center; cursor: pointer; }
body.light-mode .cp-icon { background: #dde1e7; color: #333; }
.cp-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.search { position: relative; margin-top: 12px; }
.search > svg { position: absolute; left: 11px; top: 13px; color: #8ab8ff; pointer-events: none; }
.search input {
    width: 100%; box-sizing: border-box; padding: 11px 12px 11px 36px; border-radius: 6px;
    border: 2px solid #555; background: #222; color: #fff; font-size: 15px; outline: none;
    -webkit-appearance: none; appearance: none;
}
body.light-mode .search input { background: #fff; color: #111; border-color: #ccd2da; }
.search input:focus { border-color: var(--blue); }
.search input::-webkit-search-cancel-button { filter: invert(1); }
.results {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 10;
    background: #2b2b2b; border: 1px solid #555; border-radius: 8px; overflow: hidden auto; max-height: 60vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
body.light-mode .results { background: #fff; border-color: #ccd2da; }
.res { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 1px solid #3a3a3a; cursor: pointer; }
body.light-mode .res { border-top-color: #eee; }
.res:first-child { border-top: 0; }
.res.sel, .res:hover { background: rgba(0, 123, 255, 0.2); }
.res .n { flex: 1; min-width: 0; font-weight: bold; font-size: 14px; }
.res .n mark { background: none; color: #5aa6ff; }
.res .n small { display: block; font-weight: normal; color: var(--muted); font-size: 11px; margin-top: 2px; }
.res-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 4px; margin-top: 10px; }
.tabs .btn { flex: 1; padding: 8px 0; }

.colour-by .seg { display: flex; gap: 4px; }
.colour-by .seg .btn { flex: 1; }
.picker { margin-top: 8px; }
.picker select, .picker input {
    width: 100%; box-sizing: border-box; padding: 7px 8px; border-radius: 5px;
    background: #222; color: #eee; border: 1px solid #555; font-size: 13px;
}
body.light-mode .picker select, body.light-mode .picker input { background: #fff; color: #222; border-color: #ccd2da; }
.pick-list { max-height: 230px; overflow-y: auto; margin-top: 6px; border-radius: 6px; scrollbar-width: thin; }
.pick { padding: 7px 8px; border-top: 1px solid var(--line); cursor: pointer; font-size: 13px; line-height: 1.25; }
.pick:first-child { border-top: 0; }
.pick:hover { background: rgba(0, 123, 255, 0.15); }
.pick.on { background: rgba(0, 123, 255, 0.3); }
.pick small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.pick .tally { float: right; font-size: 11px; color: var(--muted); margin-left: 6px; }

.legend { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.legend .row { display: flex; align-items: center; gap: 7px; cursor: default; }
.legend .sw { flex: none; width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.legend .row .c { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend .note { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.35; }
.seatbar { display: flex; height: 12px; border-radius: 3px; overflow: hidden; margin: 2px 0 8px; }
.seatbar i { display: block; height: 100%; }
.majority { position: relative; font-size: 10px; color: var(--muted); margin: -4px 0 8px; height: 12px; }
.majority::before { content: ""; position: absolute; left: 50%; top: -10px; height: 10px; border-left: 2px dashed var(--text); opacity: .6; }
.majority span { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }

.jump { display: flex; flex-wrap: wrap; gap: 4px; }
.jump .btn { padding: 5px 8px; font-size: 11px; }

.nerd { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.credit-small { font-size: 10px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

#settings-menu.closed { display: none; }
#settings-menu { font-size: 13px; }
.settings-head { display: flex; justify-content: space-between; align-items: center; }
.x-btn { width: 26px; height: 26px; border-radius: 50%; border: 0; background: #555; color: #eee; cursor: pointer; flex: none; }
body.light-mode .x-btn { background: #dde1e7; color: #333; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.set-row .seg { display: flex; gap: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; cursor: pointer; }

/* ---------- right panel: seat / state / vote ---------- */
#info {
    top: 12px; right: 12px; width: 400px; max-height: calc(100vh - 24px); padding: 14px;
    display: flex; flex-direction: column;
}
#info[hidden] { display: none; }
.i-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex: none; }
.i-top h1 { font-size: 22px; }
.i-top .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.i-scroll { overflow-y: auto; min-height: 0; scrollbar-width: thin; margin-top: 4px; }
.msg { padding: 24px 6px; text-align: center; color: var(--muted); font-size: 14px; }

/* member card stays white, like a printed results card */
.mp { margin-top: 12px; border-radius: 8px; overflow: hidden; background: #fff; color: #111; }
.mp .bar { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; background: var(--c, #555); color: #fff; font-weight: bold; font-size: 14px; }
.mp .bar small { font-weight: normal; opacity: .9; }
.mp .body { padding: 12px; }
.mp .name { font-size: 26px; font-weight: bold; line-height: 1.05; }
.mp .role { color: #555; font-size: 13px; margin-top: 4px; }
.mp .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mp .stat { background: #f2f4f7; border-radius: 6px; padding: 8px; }
.mp .stat b { display: block; font-size: 22px; }
.mp .stat small { color: #555; font-size: 11px; }
.mp .link { display: block; margin-top: 10px; font-size: 13px; color: #0062cc; font-weight: bold; text-decoration: none; }

.how h4 { margin: 14px 0 6px !important; }
.pol { padding: 7px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.pol:first-of-type { border-top: 0; }
.pol:hover { background: rgba(255, 255, 255, 0.04); }
.pol .t { font-size: 13px; line-height: 1.3; }
.pol .w { font-size: 11px; font-weight: bold; margin-top: 3px; }
.meter { position: relative; height: 6px; border-radius: 3px; margin-top: 4px; background: linear-gradient(90deg, var(--against), #bbb 50%, var(--for)); opacity: .9; }
.meter i { position: absolute; top: -3px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 1.5px var(--panel); }
.show-more { display: block; width: 100%; margin-top: 6px; }

/* senate list */
.sen { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 8px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.sen:first-of-type { border-top: 0; }
.sen:hover { background: rgba(255, 255, 255, 0.04); }
.sen .dot { width: 12px; height: 12px; border-radius: 50%; }
.sen .n { font-weight: bold; font-size: 14px; }
.sen .n small { display: block; font-weight: normal; color: var(--muted); font-size: 11px; }
.sen .v { font-size: 11px; font-weight: bold; text-align: right; }
.chamber { display: flex; flex-wrap: wrap; gap: 3px; margin: 10px 0 4px; }
.chamber i { width: 14px; height: 14px; border-radius: 50%; }

/* division (single vote) */
.tally-big { display: flex; gap: 8px; margin-top: 12px; }
.tally-big div { flex: 1; border-radius: 6px; padding: 8px; text-align: center; color: #fff; font-weight: bold; }
.tally-big b { display: block; font-size: 26px; }
.summary { font-size: 13px; line-height: 1.45; margin-top: 10px; }
.summary p { margin: 0 0 8px; }
.summary ul { padding-left: 18px; margin: 0 0 8px; }

.chip { display: inline-block; padding: 2px 6px; border-radius: 3px; color: #fff; font: bold 11px Arial; }

/* map bits */
.seat-label { background: none; border: 0; box-shadow: none; padding: 0; color: #111; font: bold 11px Arial; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; white-space: nowrap; pointer-events: none; }
.seat-label::before { display: none; }
.leaflet-tooltip.hover-tip { background: var(--panel); color: var(--text); border: 0; box-shadow: 0 2px 10px rgba(0,0,0,.5); font: 12px Arial; padding: 6px 8px; border-radius: 6px; }
.leaflet-tooltip.hover-tip::before { display: none; }
.hover-tip b { display: block; font-size: 13px; }
.leaflet-bottom.leaflet-right { margin-bottom: 18px; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--text) !important; border-color: #555 !important; }
.leaflet-container { font-family: Arial, sans-serif; }

#data-credit { position: fixed; bottom: 4px; left: 50%; transform: translateX(-50%); z-index: 1400; font-size: 10px; color: #bbb; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
#data-credit a { color: #ddd; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; z-index: 3000; background: #1b1c1e; color: #aaa; font: 15px Arial; }

.legend-btn { display: none; }

/* ---------- phones ---------- */
@media (max-width: 767px) {
    #control-panel { left: 8px; right: 8px; top: 8px; width: auto; padding: 8px; max-height: calc(100vh - 16px); }
    #control-panel .cp-head h1, #control-panel .cp-sub { display: none; }
    #control-panel .cp-head { position: absolute; right: 8px; top: 8px; z-index: 2; }
    .search { margin: 0 44px 0 0; }
    .tabs { margin-top: 6px; }
    .tabs .btn { padding: 6px 0; }
    .colour-by { background: none; padding: 0; margin-top: 6px; }
    .colour-by > h4 { display: none; }
    .extra { display: none; }
    body.show-more .extra { display: block; }
    body.show-more #control-panel { max-height: 70vh; }
    .legend-btn { display: block; position: fixed; left: 10px; bottom: 26px; z-index: 1400; border: 0; border-radius: 5px; padding: 8px 14px; background: var(--panel); color: var(--text); font: bold 12px Arial; box-shadow: 0 0 10px rgba(0,0,0,.5); }
    body.info-open .legend-btn { display: none; }
    .leaflet-control-zoom { display: none; }
    #info { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 62vh; max-height: none; border-radius: 16px 16px 0 0; padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); }
    #info::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #777; margin: 0 auto 8px; flex: none; }
    .mp .name { font-size: 22px; }
    #data-credit { left: 6px; right: 6px; transform: none; white-space: normal; text-align: center; }
}
/* member photos */
.face { position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 6px; background: var(--c, #666); color: #fff; font: bold 13px Arial; box-shadow: inset 0 -3px 0 var(--c, #666); }
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.face.sm { width: 30px; height: 38px; font-size: 11px; border-radius: 4px; }
.face.md { width: 40px; height: 52px; }
.face.lg { width: 66px; height: 86px; font-size: 20px; border: 3px solid var(--c, #666); box-sizing: border-box; }
.mp .who { display: flex; gap: 12px; align-items: flex-start; }
.party-link { margin-top: 6px; padding: 0; border: 0; background: none; color: #0062cc; font: bold 12px Arial; cursor: pointer; text-align: left; }
.tip-row { display: flex; gap: 8px; align-items: center; }
.sen { grid-template-columns: 10px 30px 1fr auto; }
.faces { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; max-height: 180px; overflow-y: auto; scrollbar-width: thin; }
.face-btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.face-btn:hover .face { outline: 2px solid #ffd400; }
.party-bar { height: 6px; border-radius: 3px; margin-top: 10px; }
.meter u { position: absolute; top: -2px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; border: 2px solid var(--text); box-sizing: border-box; background: none; opacity: .75; }
.pol .pa { float: right; color: var(--muted); font-weight: normal; }
.legend .link-row { cursor: pointer; border-radius: 4px; }
.legend .link-row:hover { background: rgba(255, 255, 255, 0.06); }
.pol[data-party] .chip { margin-right: 4px; }
/* no sideways scrolling in the side panel (meter markers sit right on the edge) */
.i-scroll { overflow-x: hidden; }
.meter { margin-left: 3px; margin-right: 3px; }