.bgm-root {
	--bgm-navy: #1f568f;
	--bgm-navy-2: #2a69a8;
	--bgm-teal: #347fbd;
	--bgm-teal-dark: #255f9f;
	--bgm-sky: #86b7dd;
	--bgm-pink: #d5b4d1;
	--bgm-pink-dark: #8a5e87;
	--bgm-ink: #17324f;
	--bgm-muted: #60758b;
	--bgm-line: #d7e2ed;
	--bgm-soft: #edf5fb;
	--bgm-warm: #f7f4f8;
	--bgm-white: #ffffff;
	--bgm-danger: #b42318;
	--bgm-warning: #9a6700;
	width: 100%;
	max-width: 1440px;
	margin: 0 auto;
	color: var(--bgm-ink);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.bgm-root *, .bgm-root *::before, .bgm-root *::after { box-sizing: border-box; }
.bgm-root button, .bgm-root input, .bgm-root select { font: inherit; }
.bgm-root textarea { font: inherit; }
.bgm-root button { cursor: pointer; }
.bgm-loading { padding: 72px 24px; text-align: center; color: var(--bgm-muted); }
.bgm-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.bgm-login-shell {
	min-height: 640px;
	display: grid;
	place-items: center;
	padding: 48px 20px;
	background:
		radial-gradient(circle at 17% 12%, rgba(213, 180, 209, .48), transparent 34%),
		linear-gradient(145deg, var(--bgm-sky), var(--bgm-navy-2) 48%, #1d4d88);
	border-radius: 24px;
}

.bgm-login-card {
	width: min(100%, 440px);
	padding: 42px;
	background: var(--bgm-white);
	border-radius: 20px;
	box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
}

.bgm-mark {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--bgm-teal);
	color: var(--bgm-white);
	font-weight: 800;
	letter-spacing: -.04em;
}

.bgm-brand-logo { display: block; width: 68px; height: 68px; flex: 0 0 auto; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(22, 64, 108, .2)); }
.bgm-login-logo { width: 118px; height: 118px; margin-bottom: 4px; }

.bgm-kicker {
	margin: 18px 0 4px;
	color: var(--bgm-teal);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.bgm-login-card h1 { margin: 0; color: var(--bgm-navy); font-size: clamp(28px, 5vw, 38px); line-height: 1.1; letter-spacing: -.035em; }
.bgm-login-copy { margin: 16px 0 26px; color: var(--bgm-muted); }
.bgm-login-card form { display: grid; gap: 10px; }
.bgm-login-card label, .bgm-field > span { color: var(--bgm-navy); font-weight: 700; }

.bgm-root input[type="text"],
.bgm-root input[type="password"],
.bgm-root input[type="number"],
.bgm-root select,
.bgm-root textarea {
	width: 100%;
	min-height: 44px;
	padding: 9px 12px;
	border: 1px solid #bdc9d5;
	border-radius: 9px;
	background: var(--bgm-white);
	color: var(--bgm-ink);
}
.bgm-root textarea { resize: vertical; }

.bgm-root input:focus, .bgm-root select:focus, .bgm-root button:focus-visible {
	outline: 3px solid rgba(52, 127, 189, .25);
	outline-offset: 2px;
}

.bgm-alert { padding: 10px 12px; border-radius: 8px; background: #fff1f0; color: var(--bgm-danger); font-weight: 650; }
.bgm-login-card .bgm-button { margin-top: 8px; width: 100%; }

.bgm-app-shell { background: var(--bgm-warm); border: 1px solid var(--bgm-line); border-radius: 20px; overflow: hidden; box-shadow: 0 12px 38px rgba(31, 86, 143, .11); }
.bgm-app-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 17px 28px; background: linear-gradient(108deg, #79adda 0%, #397fbd 45%, #245b9d 100%); color: var(--bgm-white); }
.bgm-brand { display: flex; align-items: center; gap: 13px; }
.bgm-brand .bgm-mark { background: var(--bgm-white); color: var(--bgm-navy); }
.bgm-brand .bgm-kicker { margin: 0; color: #f3dff0; }
.bgm-brand h1 { margin: 2px 0 0; color: var(--bgm-white); font-size: 25px; line-height: 1.05; letter-spacing: -.02em; }
.bgm-header-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.bgm-button {
	min-height: 42px;
	padding: 9px 15px;
	border: 1px solid transparent;
	border-radius: 9px;
	font-weight: 750;
	line-height: 1.1;
	transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.bgm-button:hover { transform: translateY(-1px); }
.bgm-button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.bgm-button-primary { background: var(--bgm-teal); color: var(--bgm-white); }
.bgm-button-primary:hover { background: var(--bgm-teal-dark); color: var(--bgm-white); }
.bgm-button-light { background: var(--bgm-white); color: var(--bgm-navy); border-color: var(--bgm-line); }
.bgm-button-ghost { background: transparent; color: var(--bgm-white); border-color: rgba(255, 255, 255, .35); }

.bgm-main-nav { display: flex; gap: 24px; padding: 0 28px; background: var(--bgm-white); border-bottom: 1px solid var(--bgm-line); }
.bgm-main-nav button { position: relative; min-height: 54px; padding: 0 1px; border: 0; background: transparent; color: var(--bgm-muted); font-weight: 750; }
.bgm-main-nav button::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: transparent; content: ""; }
.bgm-main-nav button:hover, .bgm-main-nav button.is-active { color: var(--bgm-navy); }
.bgm-main-nav button.is-active::after { background: linear-gradient(90deg, var(--bgm-teal), var(--bgm-pink-dark)); }

.bgm-community { padding: 22px 28px 24px; border-bottom: 1px solid var(--bgm-line); background: linear-gradient(120deg, #eaf4fb, #f8eef7 82%); }
.bgm-community-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.bgm-community-heading .bgm-kicker { margin: 0 0 2px; }
.bgm-community-heading h2 { margin: 0; color: var(--bgm-navy); font-size: 20px; line-height: 1.2; letter-spacing: -.02em; }
.bgm-community-heading > p { margin: 0; color: var(--bgm-muted); font-size: 12px; }
.bgm-community-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bgm-community-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 20px; min-width: 0; padding: 17px 19px; border: 1px solid rgba(52, 127, 189, .19); border-radius: 12px; background: rgba(255, 255, 255, .88); box-shadow: 0 4px 14px rgba(31, 86, 143, .05); }
.bgm-community-card > div > span { color: var(--bgm-teal); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bgm-community-card h3 { margin: 1px 0 2px; color: var(--bgm-navy); font-size: 16px; line-height: 1.25; }
.bgm-community-card p { margin: 0; color: var(--bgm-muted); font-size: 11px; }
.bgm-community-card > strong { grid-row: 1 / span 2; grid-column: 2; color: var(--bgm-navy); font-size: clamp(29px, 3vw, 39px); line-height: 1; letter-spacing: -.05em; }
.bgm-community-card > a { grid-column: 1 / -1; width: max-content; margin-top: 4px; color: var(--bgm-teal); font-size: 11px; font-weight: 750; text-decoration: none; }
.bgm-community-card > a:hover { text-decoration: underline; }

.bgm-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 28px; background: var(--bgm-white); border-bottom: 1px solid var(--bgm-line); }
.bgm-toolbar label { font-weight: 750; color: var(--bgm-navy); }
.bgm-toolbar select { width: auto; min-width: 190px; min-height: 38px; padding-block: 5px; }
.bgm-toolbar > span { margin-left: auto; color: var(--bgm-muted); font-size: 13px; }

.bgm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--bgm-line); background: var(--bgm-white); }
.bgm-metric { margin: 0; padding: 20px 22px; border-right: 1px solid var(--bgm-line); border-bottom: 1px solid var(--bgm-line); }
.bgm-metric:nth-child(4n) { border-right: 0; }
.bgm-metric:nth-last-child(-n+4) { border-bottom: 0; }
.bgm-metric p { margin: 0; color: var(--bgm-muted); font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.bgm-metric strong { display: block; margin: 4px 0 2px; color: var(--bgm-navy); font-size: 28px; line-height: 1.15; letter-spacing: -.035em; }
.bgm-metric span { color: var(--bgm-muted); font-size: 11px; }

.bgm-dashboard { display: grid; gap: 20px; padding: 22px; }
.bgm-panel { min-width: 0; padding: 24px; background: var(--bgm-white); border: 1px solid var(--bgm-line); border-radius: 14px; }
.bgm-two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bgm-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.bgm-section-heading > div { display: flex; align-items: center; gap: 11px; }
.bgm-section-heading > div > span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--bgm-soft); color: var(--bgm-teal); font-size: 12px; font-weight: 850; }
.bgm-section-heading h2 { margin: 0; color: var(--bgm-navy); font-size: 21px; line-height: 1.2; letter-spacing: -.02em; }
.bgm-section-heading p { margin: 0; color: var(--bgm-muted); font-size: 13px; text-align: right; }

.bgm-map { position: relative; width: 100%; height: 500px; overflow: hidden; border-radius: 11px; background: #e8f1f8; }
.bgm-map > svg { display: block; width: 100%; height: 100%; }
.bgm-google-map-canvas { position: absolute; inset: 0; }
.bgm-map-zone { cursor: pointer; outline: none; }
.bgm-map-zone path { transition: fill-opacity .16s ease, stroke .16s ease, filter .16s ease; }
.bgm-map-zone:hover path, .bgm-map-zone:focus path { fill-opacity: .9 !important; stroke: var(--bgm-pink-dark); stroke-width: 2.8; filter: drop-shadow(0 4px 5px rgba(31, 86, 143, .3)); }
.bgm-map-zone text { fill: var(--bgm-navy); stroke: rgba(255, 255, 255, .94); stroke-width: 3px; paint-order: stroke; pointer-events: none; font-size: 10px; font-weight: 800; letter-spacing: -.01em; }
.bgm-map-zone:hover text, .bgm-map-zone:focus text { fill: var(--bgm-white); stroke: var(--bgm-navy); }
.bgm-map-tooltip { position: absolute; z-index: 20; display: grid; gap: 1px; max-width: 230px; padding: 8px 10px; border-radius: 8px; background: var(--bgm-navy); color: var(--bgm-white); box-shadow: 0 8px 24px rgba(31, 86, 143, .25); opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .12s ease, transform .12s ease; }
.bgm-map-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.bgm-map-tooltip strong { font-size: 12px; }
.bgm-map-tooltip span { color: #dbeefa; font-size: 11px; }
.bgm-google-zone-label { position: absolute; z-index: 2; max-width: 132px; padding: 3px 6px; border: 1px solid rgba(42, 105, 168, .3); border-radius: 6px; background: rgba(255, 255, 255, .92); color: var(--bgm-navy); box-shadow: 0 2px 7px rgba(31, 86, 143, .14); font-size: 10px; font-weight: 800; line-height: 1.15; text-align: center; transform: translate(-50%, -50%); white-space: normal; pointer-events: none; }
.bgm-map-error { margin: 0; padding: 24px; color: var(--bgm-muted); text-align: center; }
.bgm-map-popup { min-width: 150px; color: var(--bgm-ink); font-size: 13px; }
.bgm-zone-key { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 18px; background: var(--bgm-line); border: 1px solid var(--bgm-line); border-radius: 9px; overflow: hidden; }
.bgm-zone-key > div { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 7px; min-width: 0; padding: 9px 10px; background: var(--bgm-white); }
.bgm-zone-key span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--bgm-navy); color: var(--bgm-white); font-size: 10px; font-weight: 800; }
.bgm-zone-key p { margin: 0; overflow: hidden; color: var(--bgm-muted); font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.bgm-zone-key strong { color: var(--bgm-teal); }

.bgm-bars { display: grid; gap: 15px; }
.bgm-bar-row { display: grid; gap: 6px; }
.bgm-bar-label { display: flex; justify-content: space-between; gap: 15px; color: var(--bgm-muted); font-size: 13px; }
.bgm-bar-label span { color: var(--bgm-ink); font-weight: 650; }
.bgm-bar-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e5ecef; }
.bgm-bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--bgm-teal), var(--bgm-sky)); }
.bgm-text-button { margin-top: 18px; padding: 0; border: 0; background: transparent; color: var(--bgm-teal); font-weight: 750; }
.bgm-text-button:disabled { color: var(--bgm-muted); cursor: not-allowed; }
.bgm-footnote { margin: 13px 0 0; color: var(--bgm-muted); font-size: 11px; }

.bgm-reports-dashboard { gap: 16px; }
.bgm-report-intro { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 28px 30px; overflow: hidden; border-radius: 14px; background: radial-gradient(circle at 82% 10%, rgba(213, 180, 209, .42), transparent 35%), linear-gradient(115deg, #3e86c2, var(--bgm-navy)); color: var(--bgm-white); }
.bgm-report-intro .bgm-kicker { margin: 0 0 4px; color: #f0d9ed; }
.bgm-report-intro h2 { margin: 0; color: var(--bgm-white); font-size: clamp(27px, 4vw, 38px); line-height: 1.05; letter-spacing: -.04em; }
.bgm-report-intro p:last-child { max-width: 690px; margin: 9px 0 0; color: #cbd9e5; }
.bgm-report-intro .bgm-button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.bgm-election-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bgm-election-selector button { display: grid; gap: 2px; padding: 17px 19px; border: 1px solid var(--bgm-line); border-radius: 12px; background: var(--bgm-white); color: var(--bgm-navy); text-align: left; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.bgm-election-selector button:hover { transform: translateY(-1px); border-color: #a7b8c7; }
.bgm-election-selector button.is-active { border-color: var(--bgm-teal); background: linear-gradient(135deg, #f1f8fd, #fbf4fa); box-shadow: inset 0 0 0 1px var(--bgm-teal), 0 7px 18px rgba(52, 127, 189, .1); }
.bgm-election-selector span { color: var(--bgm-muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.bgm-election-selector strong { font-size: 27px; line-height: 1.1; letter-spacing: -.03em; }
.bgm-election-selector small { color: var(--bgm-muted); font-size: 11px; }
.bgm-election-report { padding: 0; overflow: hidden; }
.bgm-election-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 25px 27px 20px; }
.bgm-election-title-row .bgm-kicker { margin: 0 0 3px; }
.bgm-election-title-row h2 { margin: 0; color: var(--bgm-navy); font-size: 25px; line-height: 1.15; letter-spacing: -.03em; }
.bgm-election-title-row > p { margin: 0; color: var(--bgm-muted); font-size: 12px; }
.bgm-election-title-row > p strong { color: var(--bgm-navy); }
.bgm-election-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-block: 1px solid var(--bgm-line); background: #fafcfd; }
.bgm-election-metrics article { min-width: 0; padding: 16px 19px; border-right: 1px solid var(--bgm-line); }
.bgm-election-metrics article:last-child { border-right: 0; }
.bgm-election-metrics span { display: block; overflow: hidden; color: var(--bgm-muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.bgm-election-metrics strong { display: block; margin: 3px 0 0; color: var(--bgm-navy); font-size: 24px; line-height: 1.15; letter-spacing: -.03em; }
.bgm-election-metrics small { color: var(--bgm-muted); font-size: 10px; }
.bgm-results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 23px 27px 11px; }
.bgm-results-heading h3 { margin: 0; color: var(--bgm-navy); font-size: 17px; }
.bgm-results-heading span { color: var(--bgm-muted); font-size: 11px; }
.bgm-election-results { display: grid; gap: 9px; padding: 0 27px 25px; }
.bgm-election-result { position: relative; display: grid; grid-template-columns: 34px minmax(230px, 1fr) 92px 98px 68px; align-items: center; gap: 13px; padding: 15px 16px 20px; overflow: hidden; border: 1px solid var(--bgm-line); border-radius: 10px; background: var(--bgm-white); }
.bgm-election-result.is-elected { border-color: rgba(52, 127, 189, .4); background: linear-gradient(90deg, #edf6fc, #fbf4fa 52%, var(--bgm-white)); }
.bgm-result-rank { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--bgm-soft); color: var(--bgm-teal); font-size: 11px; font-weight: 850; }
.bgm-result-person { min-width: 0; }
.bgm-result-person > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bgm-result-person h4 { margin: 0; overflow: hidden; color: var(--bgm-navy); font-size: 15px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.bgm-result-person p { margin: 3px 0 0; overflow: hidden; color: var(--bgm-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bgm-elected-badge { padding: 3px 7px; border-radius: 999px; background: #f3e4f1; color: var(--bgm-pink-dark); font-size: 9px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.bgm-result-numbers { text-align: right; }
.bgm-result-numbers strong { display: block; color: var(--bgm-navy); font-size: 15px; line-height: 1.15; }
.bgm-result-numbers span { color: var(--bgm-muted); font-size: 9px; text-transform: uppercase; }
.bgm-result-bar { position: absolute; right: 16px; bottom: 8px; left: 63px; height: 4px; overflow: hidden; border-radius: 999px; background: #e7edf0; }
.bgm-result-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--bgm-teal), var(--bgm-sky)); }
.bgm-report-note { margin: 0; padding: 13px 27px 17px; border-top: 1px solid var(--bgm-line); color: var(--bgm-muted); font-size: 10px; }

.bgm-table-wrap { overflow-x: auto; }
.bgm-table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.bgm-table th { padding: 9px 10px; border-bottom: 1px solid var(--bgm-line); color: var(--bgm-muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.bgm-table td { padding: 13px 10px; border-bottom: 1px solid #edf1f4; vertical-align: top; }
.bgm-table tbody tr:hover { background: #fafcfd; }
.bgm-table td > strong { color: var(--bgm-navy); }
.bgm-candidate-note { display: block; max-width: 240px; margin-top: 4px; color: var(--bgm-muted); font-weight: 500; line-height: 1.35; }
.bgm-missing { color: var(--bgm-warning); font-size: 12px; font-weight: 700; }
.bgm-table small { color: var(--bgm-muted); }
.bgm-status, .bgm-chip { display: inline-block; margin: 0 3px 3px 0; padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 750; line-height: 1.35; white-space: nowrap; }
.bgm-status-confirmed { background: #e1f0fa; color: #205b91; }
.bgm-status-draft { background: #f7eaf5; color: #7b4e78; }
.bgm-status-to_contact { background: #e9f3fb; color: #2a69a8; }
.bgm-status-external { background: #eee8f5; color: #684f88; }
.bgm-chip { background: var(--bgm-soft); color: var(--bgm-navy-2); }
.bgm-chip-soft { background: #f2f1fa; color: #5a4b8a; }
.bgm-row-actions { white-space: nowrap; }
.bgm-row-actions button { margin-right: 10px; padding: 0; border: 0; background: none; color: var(--bgm-teal); font-size: 12px; font-weight: 750; }
.bgm-row-actions button[data-delete] { color: var(--bgm-danger); }
.bgm-empty-state { padding: 50px 20px; text-align: center; color: var(--bgm-muted); }
.bgm-empty-state strong { color: var(--bgm-navy); font-size: 17px; }
.bgm-empty-state p { margin-bottom: 0; }

.bgm-dialog { width: min(900px, calc(100vw - 28px)); max-height: calc(100vh - 36px); margin: auto; padding: 0; overflow: auto; border: 0; border-radius: 16px; background: var(--bgm-white); color: var(--bgm-ink); box-shadow: 0 28px 90px rgba(7, 25, 42, .35); }
.bgm-dialog::backdrop { background: rgba(5, 22, 37, .68); backdrop-filter: blur(3px); }
.bgm-small-dialog { width: min(520px, calc(100vw - 28px)); }
.bgm-dialog form { padding: 26px; }
.bgm-dialog-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.bgm-dialog-header .bgm-kicker { margin: 0 0 3px; }
.bgm-dialog-header h2 { margin: 0; color: var(--bgm-navy); font-size: 25px; line-height: 1.15; }
.bgm-dialog-close { align-self: flex-start; width: 38px; height: 38px; padding: 0; border: 1px solid var(--bgm-line); border-radius: 9px; background: var(--bgm-white); color: var(--bgm-navy); font-size: 25px; line-height: 1; }
.bgm-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bgm-field { display: grid; gap: 6px; }
.bgm-field-wide { grid-column: 1 / -1; }
.bgm-field small, .bgm-fieldset small { color: var(--bgm-muted); font-weight: 500; }
.bgm-fieldset { margin: 22px 0 0; padding: 18px; border: 1px solid var(--bgm-line); border-radius: 11px; }
.bgm-fieldset legend { padding: 0 8px; color: var(--bgm-navy); font-weight: 800; }
.bgm-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bgm-choice { position: relative; display: block; }
.bgm-choice input { position: absolute; opacity: 0; pointer-events: none; }
.bgm-choice span { display: flex; align-items: center; min-height: 42px; padding: 8px 10px; border: 1px solid var(--bgm-line); border-radius: 8px; color: var(--bgm-ink); font-size: 12px; font-weight: 650; cursor: pointer; }
.bgm-choice input:checked + span { border-color: var(--bgm-teal); background: linear-gradient(135deg, #e8f3fb, #f8edf6); color: var(--bgm-teal-dark); box-shadow: inset 0 0 0 1px var(--bgm-teal); }
.bgm-choice input:focus-visible + span { outline: 3px solid rgba(52, 127, 189, .25); outline-offset: 2px; }
.bgm-form-error { min-height: 21px; margin: 13px 0 0; color: var(--bgm-danger); font-weight: 650; }
.bgm-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--bgm-line); }

.bgm-toast { position: fixed; right: 24px; bottom: 24px; z-index: 100000; max-width: 360px; padding: 12px 16px; border-radius: 9px; background: var(--bgm-navy); color: var(--bgm-white); box-shadow: 0 10px 28px rgba(0,0,0,.2); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.bgm-toast.is-visible { opacity: 1; transform: translateY(0); }
.bgm-toast.is-error { background: var(--bgm-danger); }

@media (max-width: 1080px) {
	.bgm-stats { grid-template-columns: repeat(2, 1fr); }
	.bgm-metric, .bgm-metric:nth-child(4n) { border-right: 1px solid var(--bgm-line); border-bottom: 1px solid var(--bgm-line); }
	.bgm-metric:nth-child(even) { border-right: 0; }
	.bgm-metric:nth-last-child(-n+2) { border-bottom: 0; }
	.bgm-zone-key { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
	.bgm-app-header { align-items: flex-start; flex-direction: column; }
	.bgm-header-actions { width: 100%; justify-content: flex-start; }
	.bgm-two-columns { grid-template-columns: 1fr; }
	.bgm-map { height: 420px; }
	.bgm-zone-key { grid-template-columns: repeat(2, 1fr); }
	.bgm-choice-grid { grid-template-columns: repeat(2, 1fr); }
	.bgm-report-intro { align-items: flex-start; flex-direction: column; }
	.bgm-election-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--bgm-line); }
	.bgm-election-metrics article { border: 0; background: #fafcfd; }
	.bgm-election-result { grid-template-columns: 30px minmax(135px, 1fr) repeat(3, auto); gap: 9px; }
}

@media (max-width: 560px) {
	.bgm-login-shell { min-height: 540px; padding: 20px 12px; border-radius: 14px; }
	.bgm-login-card { padding: 28px 22px; }
	.bgm-app-shell { border-radius: 0; border-inline: 0; }
	.bgm-app-header, .bgm-toolbar, .bgm-main-nav { padding-inline: 17px; }
	.bgm-header-actions { display: grid; grid-template-columns: 1fr 1fr; }
	.bgm-header-actions .bgm-button { width: 100%; }
	.bgm-header-actions .bgm-button-ghost { grid-column: 1 / -1; }
	.bgm-main-nav { gap: 18px; overflow-x: auto; }
	.bgm-main-nav button { flex: 0 0 auto; }
	.bgm-community { padding: 19px 17px; }
	.bgm-community-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
	.bgm-community-cards { grid-template-columns: 1fr; }
	.bgm-community-card { padding: 15px; }
	.bgm-community-card > strong { font-size: 31px; }
	.bgm-toolbar { align-items: flex-start; flex-direction: column; }
	.bgm-toolbar select { width: 100%; }
	.bgm-toolbar > span { margin-left: 0; }
	.bgm-stats { grid-template-columns: repeat(2, 1fr); }
	.bgm-metric, .bgm-metric:nth-child(3) { border-right: 1px solid var(--bgm-line); border-bottom: 1px solid var(--bgm-line); }
	.bgm-metric:nth-child(even) { border-right: 0; }
	.bgm-metric:nth-last-child(-n+2) { border-bottom: 0; }
	.bgm-dashboard { padding: 12px; gap: 12px; }
	.bgm-panel { padding: 18px; }
	.bgm-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
	.bgm-section-heading p { text-align: left; }
	.bgm-map { height: 340px; }
	.bgm-zone-key { grid-template-columns: 1fr; }
	.bgm-form-grid, .bgm-choice-grid { grid-template-columns: 1fr; }
	.bgm-dialog form { padding: 20px; }
	.bgm-report-intro { padding: 23px 20px; }
	.bgm-report-intro .bgm-button { width: 100%; justify-content: center; }
	.bgm-election-selector { gap: 6px; }
	.bgm-election-selector button { padding: 12px 10px; }
	.bgm-election-selector strong { font-size: 22px; }
	.bgm-election-selector small { font-size: 9px; line-height: 1.3; }
	.bgm-election-title-row { align-items: flex-start; flex-direction: column; gap: 8px; padding: 21px 18px 17px; }
	.bgm-election-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bgm-election-metrics article { padding: 13px 15px; }
	.bgm-results-heading { padding: 20px 18px 10px; }
	.bgm-results-heading span { display: none; }
	.bgm-election-results { gap: 8px; padding: 0 18px 20px; }
	.bgm-election-result { grid-template-columns: 28px minmax(0, 1fr) repeat(3, auto); gap: 7px; padding: 13px 11px 19px; }
	.bgm-result-rank { width: 27px; height: 27px; }
	.bgm-result-person h4 { white-space: normal; }
	.bgm-result-person p { white-space: normal; }
	.bgm-elected-badge { display: none; }
	.bgm-result-numbers strong { font-size: 12px; }
	.bgm-result-numbers span { display: none; }
	.bgm-result-bar { right: 11px; left: 49px; }
	.bgm-report-note { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.bgm-root *, .bgm-root *::before, .bgm-root *::after { scroll-behavior: auto !important; transition: none !important; }
}

body.bgm-fullscreen-page { min-height: 100vh; margin: 0; padding: 0; background: var(--bgm-warm, #f7f4f8); }
body.bgm-fullscreen-page .bgm-fullscreen-main { min-height: 100vh; }
body.bgm-fullscreen-page .bgm-root { max-width: none; min-height: 100vh; }
body.bgm-fullscreen-page .bgm-app-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
body.bgm-fullscreen-page .bgm-login-shell { min-height: 100vh; border-radius: 0; }
