/* Punjab Assembly 2027 · Survey Analytics — "Glass 1 · Steel Blue" theme (dark, frosted glass), with a light mode. */
:root, [data-theme="dark"] {
  --bg: #080c11;
  --blob1: rgba(107, 154, 196, .17); --blob2: rgba(85, 132, 173, .13); --blob3: rgba(28, 44, 61, .60); --blob4: rgba(147, 181, 214, .05);
  --stars: rgba(255, 255, 255, .45);
  --glass: rgba(255, 255, 255, .06); --glass-2: rgba(255, 255, 255, .04); --glass-border: rgba(255, 255, 255, .14);
  --glass-shadow: 0 10px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .10);
  --ink: #e8ecf0; --ink2: #c8d0d9; --muted: #97a3b0; --muted2: #76818e;
  --p: #6b9ac4; --p-rgb: 107, 154, 196; --pl: #93b5d6; --pll: #d4e3f1; --s: #5584ad; --sl: #c9dbec;
  --big: linear-gradient(90deg, #ffffff, #d4e3f1 55%, #c9dbec);
  --field: rgba(255, 255, 255, .07); --field-border: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .10); --line2: rgba(255, 255, 255, .06); --row-sel: rgba(107, 154, 196, .12);
  --th: rgba(10, 15, 22, .92);
  --ok: #6ee7b7; --okbg: rgba(52, 211, 153, .15); --okline: rgba(52, 211, 153, .35);
  --warn: #fcd34d; --warnbg: rgba(251, 191, 36, .14); --warnline: rgba(251, 191, 36, .35);
  --bad: #fca5a5; --badbg: rgba(248, 113, 113, .14); --badline: rgba(248, 113, 113, .38);
  --btn-ink: #ffffff; --modal-veil: rgba(3, 6, 10, .6); --modal-bg: rgba(14, 20, 28, .88); --link: #93b5d6;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #e6ebf1;
  --blob1: rgba(107, 154, 196, .32); --blob2: rgba(85, 132, 173, .22); --blob3: rgba(147, 181, 214, .40); --blob4: rgba(255, 255, 255, .6);
  --stars: rgba(255, 255, 255, 0);
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .45); --glass-border: rgba(20, 40, 65, .10);
  --glass-shadow: 0 8px 30px rgba(30, 50, 80, .10), inset 0 1px 0 rgba(255, 255, 255, .9);
  --ink: #0f1b2a; --ink2: #334155; --muted: #5b6b7d; --muted2: #7b8a9b;
  --p: #3f74a6; --p-rgb: 63, 116, 166; --pl: #4f84b6; --pll: #1c2c3d; --s: #5584ad; --sl: #1c2c3d;
  --big: linear-gradient(90deg, #0f1b2a, #3f74a6);
  --field: rgba(255, 255, 255, .8); --field-border: rgba(20, 40, 65, .15);
  --line: rgba(20, 40, 65, .10); --line2: rgba(20, 40, 65, .06); --row-sel: rgba(63, 116, 166, .10);
  --th: rgba(240, 244, 249, .96);
  --ok: #157f47; --okbg: #e3f4ea; --okline: rgba(21, 127, 71, .3);
  --warn: #8a5300; --warnbg: #fcf0d6; --warnline: rgba(154, 91, 0, .3);
  --bad: #b42323; --badbg: #fbe6e6; --badline: rgba(180, 35, 35, .3);
  --btn-ink: #ffffff; --modal-veil: rgba(30, 45, 65, .35); --modal-bg: rgba(250, 252, 255, .92); --link: #3f74a6;
  color-scheme: light;
}
/* Theme 2: Royal Navy & Silver (dark and light) */
[data-palette="navy"][data-theme="dark"] {
  --bg: #060b18;
  --blob1: rgba(143, 168, 212, .17); --blob2: rgba(111, 143, 196, .13); --blob3: rgba(27, 42, 74, .60); --blob4: rgba(183, 199, 230, .05);
  --ink: #e9edf5; --ink2: #c5ccdc; --muted: #95a0b8; --muted2: #737f99;
  --p: #8fa8d4; --p-rgb: 143, 168, 212; --pl: #b7c7e6; --pll: #e2e9f6; --s: #6f8fc4; --sl: #d6e0f2;
  --big: linear-gradient(90deg, #ffffff, #e2e9f6 55%, #d6e0f2);
  --row-sel: rgba(143, 168, 212, .12); --th: rgba(9, 15, 30, .93);
  --btn-ink: #0b1220; --modal-bg: rgba(12, 19, 36, .9); --link: #b7c7e6;
}
[data-palette="navy"][data-theme="light"] {
  --bg: #e8ecf4;
  --blob1: rgba(143, 168, 212, .34); --blob2: rgba(111, 143, 196, .24); --blob3: rgba(183, 199, 230, .45); --blob4: rgba(255, 255, 255, .6);
  --ink: #0d1626; --ink2: #2f3b52; --muted: #59657d; --muted2: #79849a;
  --p: #3d5a8f; --p-rgb: 61, 90, 143; --pl: #4f6ca3; --pll: #1b2a4a; --s: #6f8fc4; --sl: #1b2a4a;
  --big: linear-gradient(90deg, #0d1626, #3d5a8f);
  --row-sel: rgba(61, 90, 143, .10); --th: rgba(241, 244, 250, .96);
  --btn-ink: #ffffff; --modal-bg: rgba(250, 251, 254, .93); --link: #3d5a8f;
}
/* Theme 3: Glacier Grey-Teal (dark and light) */
[data-palette="glacier"][data-theme="dark"] {
  --bg: #060c0e;
  --blob1: rgba(127, 179, 191, .17); --blob2: rgba(95, 154, 168, .13); --blob3: rgba(22, 41, 46, .60); --blob4: rgba(166, 205, 214, .05);
  --ink: #e9f1f3; --ink2: #c6d3d6; --muted: #93a6aa; --muted2: #718489;
  --p: #7fb3bf; --p-rgb: 127, 179, 191; --pl: #a6cdd6; --pll: #dceef2; --s: #5f9aa8; --sl: #d2e8ed;
  --big: linear-gradient(90deg, #ffffff, #dceef2 55%, #d2e8ed);
  --row-sel: rgba(127, 179, 191, .12); --th: rgba(8, 16, 19, .93);
  --btn-ink: #0b1a1e; --modal-bg: rgba(10, 20, 23, .9); --link: #a6cdd6;
}
[data-palette="glacier"][data-theme="light"] {
  --bg: #e7eef0;
  --blob1: rgba(127, 179, 191, .34); --blob2: rgba(95, 154, 168, .24); --blob3: rgba(166, 205, 214, .45); --blob4: rgba(255, 255, 255, .6);
  --ink: #0b1a1e; --ink2: #2c3f44; --muted: #56696e; --muted2: #76888d;
  --p: #2f6b78; --p-rgb: 47, 107, 120; --pl: #3d7d8b; --pll: #16292e; --s: #5f9aa8; --sl: #16292e;
  --big: linear-gradient(90deg, #0b1a1e, #2f6b78);
  --row-sel: rgba(47, 107, 120, .10); --th: rgba(240, 246, 247, .96);
  --btn-ink: #ffffff; --modal-bg: rgba(250, 253, 253, .93); --link: #2f6b78;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { color: var(--ink); font: 13.5px/1.5 "Segoe UI", system-ui, -apple-system, Arial, sans-serif; background-color: var(--bg);
  background-image: radial-gradient(1.2px 1.2px at 20px 30px, var(--stars), transparent), radial-gradient(1px 1px at 120px 80px, var(--stars), transparent),
    radial-gradient(1.4px 1.4px at 260px 150px, var(--stars), transparent), radial-gradient(1px 1px at 330px 40px, var(--stars), transparent);
  background-size: 360px 200px; }
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(560px 400px at 12% 18%, var(--blob1), transparent 65%), radial-gradient(560px 420px at 88% 8%, var(--blob2), transparent 65%),
    radial-gradient(720px 520px at 65% 95%, var(--blob3), transparent 65%), radial-gradient(440px 320px at 35% 70%, var(--blob4), transparent 65%); }
.hide { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 12px 0 0 0; } .hint b { color: var(--ink2); }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }
.req { color: var(--bad); font-weight: 700; }
.grow { flex: 1; } .nowrap { white-space: nowrap; }
h2 { font-size: 14.5px; margin: 0; font-weight: 650; letter-spacing: .01em; }
h3 { font-size: 15px; margin: 0 0 10px 0; } h4 { font-size: 13px; margin: 16px 0 4px 0; }

/* glass surfaces */
.glass { background: var(--glass); border: 1px solid var(--glass-border); border-radius: 18px; box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
.card { padding: 16px 18px; margin-bottom: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 236px; flex: none; margin: 16px 0 16px 16px; padding: 18px 14px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 16px; height: calc(100vh - 32px); }
.logo { display: flex; gap: 11px; align-items: center; font-weight: 700; font-size: 14px; margin: 2px 6px 22px; line-height: 1.25; }
.logo small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.orb { width: 34px; height: 34px; flex: none; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, var(--pl) 32%, var(--s) 70%, #1c2c3d);
  box-shadow: 0 0 12px rgba(var(--p-rgb), .45); }
.sec { font-size: 10.5px; letter-spacing: .12em; color: var(--muted2); margin: 14px 10px 6px; text-transform: uppercase; }
.nav { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 12px; color: var(--ink2); font: inherit;
  font-weight: 550; background: none; border: 0; cursor: pointer; text-align: left; }
.nav:hover { background: var(--glass-2); color: var(--ink); }
.nav.on { background: linear-gradient(90deg, rgba(var(--p-rgb), .32), rgba(var(--p-rgb), .10)); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(var(--p-rgb), .40), 0 0 10px rgba(var(--p-rgb), .16); }
.ic { width: 17px; height: 17px; border-radius: 5px; border: 1.6px solid currentColor; opacity: .8; flex: none; position: relative; }
.ic-arch::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 1.6px; background: currentColor; }
.ic-db { border-radius: 50% / 35%; }
.ic-gen::after { content: ""; position: absolute; left: 5px; top: 3px; border-left: 6px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.side-foot { font-size: 12px; padding: 12px; border-radius: 12px; background: var(--glass-2); display: flex; flex-direction: column; gap: 3px; color: var(--ink2); }
.live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; margin-right: 7px; }
.appearance { margin-top: auto; margin-bottom: 10px; border-radius: 12px; }
.appearance[open] { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.appearance summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer;
  color: var(--ink2); margin: 0; font-weight: 400; }
.appearance summary::-webkit-details-marker { display: none; }
.appearance summary:hover { background: var(--glass-2); color: var(--ink); }
.ap-title { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink); }
.appearance summary small { display: block; color: var(--muted); font-size: 11.5px; }
.chev { width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .2s; margin-right: 4px; }
.appearance[open] .chev { transform: rotate(45deg); }
.appear-body { padding: 2px 10px 12px; }
.ap-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted2); margin: 8px 2px 5px; }
.seg-full { display: flex; } .seg-full label { flex: 1; } .seg-full span { text-align: center; }
#appear-sw.steel { background: conic-gradient(#6b9ac4 0 50%, #080c11 0 75%, #93b5d6 0); }
#appear-sw.navy { background: conic-gradient(#8fa8d4 0 50%, #060b18 0 75%, #e2e9f6 0); }
#appear-sw.glacier { background: conic-gradient(#7fb3bf 0 50%, #060c0e 0 75%, #a6cdd6 0); }
.swatches { display: flex; flex-direction: column; gap: 4px; }
.swatch { display: flex; gap: 9px; align-items: center; width: 100%; padding: 7px 10px; border-radius: 10px; border: 1px solid transparent; background: none;
  color: var(--ink2); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.swatch:hover { background: var(--glass-2); }
.swatch.on { border-color: rgba(var(--p-rgb), .45); background: rgba(var(--p-rgb), .12); color: var(--ink); }
.sw { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.sw-steel { background: conic-gradient(#6b9ac4 0 50%, #080c11 0 75%, #93b5d6 0); }
.sw-navy { background: conic-gradient(#8fa8d4 0 50%, #060b18 0 75%, #e2e9f6 0); }
.sw-glacier { background: conic-gradient(#7fb3bf 0 50%, #060c0e 0 75%, #a6cdd6 0); }
.main { flex: 1; min-width: 0; padding: 22px 26px 30px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.topbar h1 { font-size: 22px; margin: 0; font-weight: 650; } .topbar p { margin: 2px 0 0; }
.user { display: flex; gap: 12px; align-items: center; color: var(--ink2); padding: 6px 8px 6px 16px; border-radius: 999px; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--pl), var(--s)); display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 12px; }

/* headline figures */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; position: relative; overflow: hidden; min-height: 104px; }
.kpi label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.big { font-size: 27px; font-weight: 700; margin-top: 2px; background: var(--big); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .sub.up { color: var(--ok); } .kpi .sub.down { color: var(--bad); }
.spark { position: absolute; right: 14px; bottom: 12px; }
.spark svg { display: block; overflow: visible; }
.glow { filter: drop-shadow(0 0 3px rgba(var(--p-rgb), .8)); }

/* layout */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.col-side { position: sticky; top: 16px; }

/* form controls */
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.field.grow { flex: 1; min-width: 200px; }
input, select { font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--field-border); border-radius: 10px; padding: 8px 12px;
  text-transform: none; letter-spacing: 0; font-weight: 500; }
input[type=date] { min-width: 150px; }
input::placeholder { color: var(--muted2); }
input:focus, select:focus, button:focus-visible { outline: 2px solid rgba(var(--p-rgb), .7); outline-offset: 1px; }
input[type=radio], input[type=checkbox] { accent-color: var(--p); }
.w-s { width: 100px; } .w-m { width: 170px; } .w-40 { width: 40%; } .w-ck { width: 34px; }
.inline { display: flex; gap: 6px; align-items: center; } .inline input { flex: 1; min-width: 200px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--field); border: 1px solid var(--field-border); position: relative; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg span { display: block; padding: 6px 13px; border-radius: 9px; color: var(--ink2); text-transform: none; letter-spacing: 0; font-weight: 550; font-size: 12.5px; white-space: nowrap; }
.seg input:checked + span { background: linear-gradient(135deg, var(--p), var(--s)); color: var(--btn-ink); box-shadow: 0 0 10px rgba(var(--p-rgb), .30); }
.seg input:focus-visible + span { outline: 2px solid rgba(var(--p-rgb), .7); }
.presets { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.chip { padding: 5px 13px; border-radius: 999px; border: 1px solid var(--field-border); font: inherit; font-size: 12.5px; color: var(--ink2); background: var(--glass-2); cursor: pointer; }
.chip:hover { border-color: var(--p); }
.chip.on { border-color: var(--pl); color: var(--ink); background: rgba(var(--p-rgb), .22); box-shadow: 0 0 8px rgba(var(--p-rgb), .26); }
.btn { white-space: nowrap; font: inherit; font-weight: 600; border: 1px solid var(--field-border); background: var(--field); color: var(--ink); border-radius: 10px;
  padding: 8px 14px; cursor: pointer; }
.btn:hover { border-color: var(--p); }
.btn.small { padding: 5px 11px; font-size: 12.5px; }
.btn.primary { background: linear-gradient(135deg, var(--p), var(--s)); border-color: transparent; color: var(--btn-ink); box-shadow: 0 0 16px rgba(var(--p-rgb), .32); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.block { width: 100%; padding: 12px 14px; margin-top: 14px; border-radius: 12px; font-weight: 700; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.link { border: 0; background: none; color: var(--link); cursor: pointer; font: inherit; padding: 0; }
a.act { color: var(--link); text-decoration: none; font-weight: 600; margin-right: 12px; white-space: nowrap; }
a.act:hover { text-decoration: underline; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .toolbar input { flex: 1; min-width: 240px; }
.radio { display: flex; gap: 8px; align-items: center; cursor: pointer; }

/* tables */
.table-wrap { overflow-x: auto; }
.seats-wrap { max-height: 560px; overflow: auto; }
.table-wrap.map { max-height: 400px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; color: var(--muted2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; padding: 8px; border-bottom: 1px solid var(--line);
  font-weight: 600; white-space: nowrap; position: sticky; top: 0; background: var(--th); z-index: 1; }
table.t td { padding: 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .n { text-align: right; font-variant-numeric: tabular-nums; }
table.seats tbody tr { cursor: pointer; }
table.seats tbody tr:hover td { background: var(--glass-2); }
table.seats tr.sel td { background: var(--row-sel); }
table.seats td { vertical-align: middle; }
.ac { font-weight: 650; color: var(--ink2); font-variant-numeric: tabular-nums; }
.star { color: var(--pl); font-size: 11px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); width: 110px; display: inline-block; vertical-align: middle; margin-right: 9px; overflow: hidden; }
.bar b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--s), var(--pl)); border-radius: 3px; }
.num { font-variant-numeric: tabular-nums; }
.badge { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.badge.ok { background: var(--okbg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--okline); }
.badge.warn { background: var(--warnbg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warnline); }
.badge.bad { background: var(--badbg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--badline); }
.badge.mute { background: var(--glass-2); color: var(--ink2); box-shadow: inset 0 0 0 1px var(--line); }
.badge.run { background: rgba(var(--p-rgb), .18); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(var(--p-rgb), .45); }

/* run summary and recent runs */
.m { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); color: var(--ink2); }
.m b { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pv-body { margin-top: 10px; font-size: 13px; color: var(--ink2); }
.pv-body p { margin: 6px 0; } .pv-body b { color: var(--ink); }
.waves { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0; }
.waves span { padding: 2px 8px; border-radius: 6px; background: var(--field); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.waves .now { background: rgba(var(--p-rgb), .25); color: var(--ink); box-shadow: 0 0 8px rgba(var(--p-rgb), .35); }
.note { border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 12.5px; }
.note.warn { background: var(--warnbg); color: var(--warn); } .note.ok { background: var(--okbg); color: var(--ok); } .note.bad { background: var(--badbg); color: var(--bad); }
details summary { cursor: pointer; color: var(--link); font-weight: 600; margin-top: 8px; }
.mini { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.mini td { border-top: 1px solid var(--line2); padding: 4px; vertical-align: top; }
.runrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.runrow:last-child { border-bottom: 0; }
.runrow .grow { min-width: 0; } .runrow .grow small { color: var(--muted); }
.runrow .badge { flex: none; }
/* a run in progress: a pulsing dot in the badge, and a moving bar until the first report is done */
.badge.run::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px;
  vertical-align: 1px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.prog.indet > div, .progress.indet > div { width: 32% !important; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
.prog, .progress { height: 6px; border-radius: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.prog > div, .progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--s), var(--pl)); box-shadow: 0 0 8px rgba(var(--p-rgb), .6); transition: width .4s; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--pl); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.deliver { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); background: var(--glass-2); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
pre.log { background: var(--glass-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-height: 220px; overflow: auto; font-size: 12px; white-space: pre-wrap; margin: 6px 0 0 0; color: var(--ink2); }
.actions-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.editor { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.msgs { margin: 10px 0; font-size: 13px; } .msgs div { margin: 3px 0; }

/* sign in */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { padding: 28px; width: 100%; max-width: 390px; display: flex; flex-direction: column; gap: 12px; }
.login-box .logo { margin: 0 0 6px; }

/* modal and toast */
.modal { position: fixed; inset: 0; background: var(--modal-veil); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-box { padding: 22px 24px; width: 100%; max-width: 520px; background: var(--modal-bg); }
.modal-box p { margin: 6px 0; } .modal-box ul { margin: 6px 0; padding-left: 20px; max-height: 180px; overflow: auto; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(15, 25, 38, .94); color: #fff; border: 1px solid rgba(107, 154, 196, .5);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 90vw; z-index: 60; }
#toast.on { opacity: 1; }

@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, 1fr); } .grid { grid-template-columns: 1fr; } .col-side { position: static; } }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: relative; z-index: 30; margin: 12px 12px 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .side .logo { margin: 0 12px 0 0; } .sec, .side-foot { display: none; }
  .appearance { margin: 0 0 0 auto; position: relative; } .appearance[open] .appear-body { position: absolute; right: 0; top: 100%; z-index: 20; width: 240px;
    background: linear-gradient(var(--modal-bg), var(--modal-bg)), var(--bg); border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px 12px 12px; } #nav { display: flex; flex-wrap: wrap; gap: 4px; } .nav { width: auto; }
  .main { padding: 14px 12px 24px; } .kpis { grid-template-columns: 1fr; } .topbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* small charts in the headline figures (colours from the theme) */
.spk { fill: none; stroke: var(--pl); stroke-width: 2; }
.spk-bar { fill: var(--pl); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.ring-fg { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; }

/* ---------------- constituency snapshot: side drawer ("analyst brief") */
.seat-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-align: left;
  border-bottom: 1px dashed rgba(var(--p-rgb), .6); }
.seat-link:hover, .seat-link:focus-visible { color: var(--link); border-bottom-style: solid; outline: none; }
#seats tr.focus td { background: rgba(var(--p-rgb), .22); }
.veil { position: fixed; inset: 0; background: var(--modal-veil); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.veil.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 16px; right: 16px; bottom: 16px; width: min(470px, calc(100vw - 32px)); z-index: 41; display: flex;
  flex-direction: column; padding: 18px 20px 16px; background: var(--modal-bg); border-color: rgba(var(--p-rgb), .35);
  box-shadow: -20px 0 60px rgba(0, 0, 0, .40), var(--glass-shadow); transform: translateX(calc(100% + 40px)); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s; }
.drawer.open { transform: none; visibility: visible; transition: transform .25s ease; }
.dr-head { display: flex; gap: 10px; align-items: flex-start; }
.dr-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.dr-meta { font-size: 12px; margin-top: 2px; }
.dr-close { width: 30px; height: 30px; flex: none; border-radius: 9px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--ink2); cursor: pointer; font-size: 13px; }
.dr-close:hover, .dr-close:focus-visible { border-color: var(--p); color: var(--ink); }
.dr-tag { margin: 9px 0 0; }
.stag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.stag.good { background: var(--okbg); color: var(--ok); box-shadow: inset 0 0 0 1px var(--okline); }
.stag.bad { background: var(--badbg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--badline); }
.stag.warn { background: var(--warnbg); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warnline); }
.stag.neutral { background: rgba(var(--p-rgb), .14); color: var(--link); box-shadow: inset 0 0 0 1px rgba(var(--p-rgb), .4); }
.dr-body { flex: 1; min-height: 0; overflow: auto; margin: 4px -8px 0 0; padding-right: 8px; }
.dr-lead { font-size: 15.5px; line-height: 1.5; color: var(--ink); margin: 10px 0 9px; }
.dr-lead b { font-weight: 700; }
.strip { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.strip b { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 3px 13px; font-size: 12px; color: var(--ink2); margin: 7px 0 2px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.legend b { color: var(--ink); }
.dr-small { font-size: 12px; color: var(--ink2); margin: 6px 0; }
.dr-small b { color: var(--ink); }
.blk { padding: 9px 12px 9px 13px; border-radius: 12px; background: var(--glass-2); border: 1px solid var(--line); border-left: 3px solid var(--p);
  margin-top: 9px; font-size: 12.8px; color: var(--ink2); line-height: 1.5; }
.blk h4 { margin: 0 0 2px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--link); }
.blk b { color: var(--ink); }
.blk.good { border-left-color: var(--ok); } .blk.good h4 { color: var(--ok); }
.blk.bad { border-left-color: var(--bad); } .blk.bad h4 { color: var(--bad); }
.blk.warn { border-left-color: var(--warn); } .blk.warn h4 { color: var(--warn); }
.blk.neutral { border-left-color: var(--muted2); } .blk.neutral h4 { color: var(--muted); }
.dr-sub { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted2); margin: 14px 0 4px; font-weight: 600; }
.dr-list { list-style: none; margin: 0; padding: 0; }
.dr-list li { position: relative; padding: 3px 0 3px 14px; font-size: 12.5px; color: var(--ink2); }
.dr-list li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--p); }
.dr-list b { color: var(--ink); }
.hist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.hist div { padding: 6px 8px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.hist b { display: block; color: var(--ink); font-size: 12.5px; }
.hist span { display: block; }
.dr-src { font-size: 11px; color: var(--muted2); margin: 12px 0 2px; }
.dr-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px; }
.dr-acts:empty { display: none; }
.dr-acts a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.dr-lr { flex-basis: 100%; }
.dr-wait { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12.5px; margin: 14px 0; }
.skel { height: 12px; border-radius: 6px; background: var(--glass-2); border: 1px solid var(--line); margin: 10px 0; animation: skel 1.4s ease-in-out infinite; }
.skel.w90 { width: 90%; } .skel.w70 { width: 70%; } .skel.box { height: 64px; border-radius: 12px; }
@keyframes skel { 50% { opacity: .4; } }
@media (max-width: 560px) { .hist { grid-template-columns: repeat(2, 1fr); } .drawer { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); } }

/* ---------------- information-rich page: constituency table, report archive, sidebar status */
.seat-card { container-type: inline-size; }
table.seats { min-width: 980px; }
@container (max-width: 1180px) { table.seats .c-trend { display: none; } }
.sub2 { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 1px; white-space: nowrap; }
.pchip { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.pchip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chg { font-weight: 700; white-space: nowrap; } .chg.up { color: var(--ok); } .chg.dn { color: var(--bad); } .chg.flat { color: var(--ink2); font-weight: 600; }
.seat-spark { display: block; }
.sumchips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-wrap .chip { padding: 4px 11px; } .chips-wrap .chip b { color: var(--ink); margin-left: 6px; }
.sortbox { display: inline-flex; align-items: center; gap: 6px; }
.sel2 { font: inherit; font-size: 12.5px; color: var(--ink); background: var(--field); border: 1px solid var(--field-border); border-radius: 9px; padding: 5px 9px; }
.sel2 option { background: var(--bg); color: var(--ink); }
table.seats th[data-sort] { cursor: pointer; user-select: none; }
table.seats th[data-sort]:hover, table.seats th[data-sort]:focus-visible { color: var(--ink); outline: none; }
table.seats th.sorted { color: var(--link); }
table.seats th.sorted::after { content: " " attr(data-dir); }
.acchips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 380px; }
.acchips span { padding: 1px 7px; border-radius: 6px; background: var(--glass-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink2); white-space: nowrap; }
.acchips span.nd { opacity: .55; text-decoration: line-through; } .acchips span.more { color: var(--link); }
.acts2 { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.ibtn { display: inline-flex; height: 30px; min-width: 30px; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; border-radius: 9px;
  border: 1px solid var(--field-border); background: var(--field); color: var(--ink2); font: inherit; font-size: 12.5px; font-weight: 650;
  text-decoration: none; cursor: pointer; }
.ibtn:hover, .ibtn:focus-visible { border-color: var(--p); color: var(--ink); outline: none; }
.ibtn.pri { background: linear-gradient(135deg, var(--p), var(--s)); color: var(--btn-ink); border-color: transparent; padding: 0 12px; }
.ibtn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { gap: 4px; }
.sf-r { display: flex; justify-content: space-between; align-items: center; gap: 8px; white-space: nowrap; }
.sf-r b { color: var(--ink); }
.sf-l { display: inline-flex; align-items: center; color: var(--ink2); }
.sf-sub { font-size: 11px; color: var(--muted); margin: -3px 0 5px 15px; justify-content: flex-start; gap: 6px; }
.sf-sub span:not(:empty) + span:not(:empty)::before { content: "· "; }
.sf-pills { display: inline-flex; gap: 4px; }
.sf-pills .pill { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(var(--p-rgb), .16); color: var(--link); }
.sf-link { color: var(--link); text-decoration: none; font-weight: 600; }
.sf-link[href]:hover { text-decoration: underline; }
.live { cursor: help; }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.live.off { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.live.busy { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; animation: pulse 1.4s ease-in-out infinite; }
/* party colour marks: a thin outline keeps dark colours (SAD) and light ones (IND) visible in both themes */
.pdot, .pchip i, .legend i { box-shadow: 0 0 0 1px rgba(var(--p-rgb), .35); }

/* ---------------- share dialog */
.sh-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sh-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.sh-row .btn { display: inline-flex; align-items: center; gap: 6px; }
.sh-row .btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sh-url, #dl-url, .dl-many { flex: 1; min-width: 220px; font: inherit; font-size: 12.5px; color: var(--ink); background: var(--field); border: 1px solid var(--field-border);
  border-radius: 9px; padding: 7px 10px; }
.dl-many { display: block; width: 100%; box-sizing: border-box; resize: vertical; margin-top: 8px; white-space: pre; overflow: auto; }
.modal-box a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.sh-sub { margin: 12px 0 4px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted2); font-weight: 600; }
.modal-box ul.sh-list { list-style: none; margin: 0; padding: 0; max-height: 150px; overflow: auto; }
.sh-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line);
  font-size: 12px; color: var(--ink2); }
button.link.act { margin-right: 12px; font-weight: 600; }
.sh-list li .link { white-space: nowrap; flex: none; }
/* narrow screens: the one-column grid may shrink below its content; segmented controls and the search box wrap */
@media (max-width: 1180px) { .grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .seg { flex-wrap: wrap; max-width: 100%; } .toolbar input { min-width: 0; flex-basis: 100%; } .row > .field { max-width: 100%; } }

/* ---------------- Data Sources lock */
.lockcard { max-width: 430px; margin: 48px auto; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.lockcard h2 { margin: 0; }
.lockcard p { margin: 0; font-size: 13px; line-height: 1.5; }
.lockcard .btn.block { margin-top: 0; }
.lk-ico { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: rgba(var(--p-rgb), .14); box-shadow: inset 0 0 0 1px rgba(var(--p-rgb), .35); }
.lk-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#view-sources #src-line { margin-left: auto; }

/* ---------------- Report Archive: delete */
.ibtn.del:hover, .ibtn.del:focus-visible { border-color: var(--badline); color: var(--bad); background: var(--badbg); }
.btn.danger { background: var(--badbg); color: var(--bad); border-color: var(--badline); font-weight: 650; }
.btn.danger:hover { filter: brightness(1.08); }

/* ---------------- a section that could not load: a placeholder, never a blank area */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 26px 16px;
  text-align: center; color: var(--muted); }
.empty svg { width: 30px; height: 30px; fill: none; stroke: var(--muted2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  margin-bottom: 4px; }
.empty b { color: var(--ink2); font-size: 13.5px; font-weight: 650; }
.empty span { font-size: 12px; max-width: 380px; line-height: 1.45; }
tr.empty-row td { padding: 0; border-bottom: 0; }
tr.empty-row:hover td { background: none; }

/* ---------------- Report Archive: multiple selection */
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 12px; border-radius: 11px;
  background: rgba(var(--p-rgb), .10); box-shadow: inset 0 0 0 1px rgba(var(--p-rgb), .35); }
.bulkbar .bulk-n { font-weight: 650; color: var(--ink); margin-right: 4px; }
.bulkbar .btn { display: inline-flex; align-items: center; gap: 6px; }
.bulkbar .btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bulkbar .btn .spinner { width: 12px; height: 12px; }
.bulkbar .link { margin-left: auto; }
table.archive-t tbody tr:hover td { background: var(--glass-2); }
table.archive-t tr.sel td { background: var(--row-sel); }
table.archive-t input[type=checkbox] { cursor: pointer; }
table.archive-t input[type=checkbox]:disabled { cursor: default; opacity: .4; }

/* ---------------- Latest wave responses: the Punjab-wide result beside the count (the card is twice as wide) */
.kpis { grid-template-columns: 1fr 2.3fr 1fr 1fr; }
.kpi .spark { top: 46px; bottom: auto; }                         /* beside the big number: the cards are narrower now */
.kpi.kpi-resp { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); column-gap: 18px; }
.kpi-resp .kr-l { min-width: 0; }
.kpi.kpi-resp .spark { position: static; margin-top: 8px; }
.kres:empty { display: none; }
.kres { min-width: 0; border-left: 1px solid var(--line); padding-left: 18px; display: flex; flex-direction: column; justify-content: center;
  font-size: 12px; color: var(--ink2); }
.kres-h { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; }
.kres-bar { display: flex; gap: 2px; height: 9px; border-radius: 5px; overflow: hidden; }
.kres-bar i { display: block; height: 100%; }
.kres-bar i:first-child { border-radius: 5px 0 0 5px; } .kres-bar i:last-child { border-radius: 0 5px 5px 0; } .kres-bar i { min-width: 2px; }
.kres-bar i.rest { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); }
.kres-t { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 2px 10px; margin-top: 7px; font-size: 11px; }
.kres-t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kres-t b { color: var(--ink); font-weight: 650; }
.kres .pd { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.kres-m { margin-top: 5px; color: var(--ink); font-weight: 650; }
.kres-s { margin-top: 1px; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kres-s b { color: var(--ink2); }
.kres-d { white-space: nowrap; font-weight: 650; cursor: help; } .kres-d.up { color: var(--ok); } .kres-d.down { color: var(--bad); }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); } .kpi.kpi-resp { grid-column: 1 / -1; order: -1; }
  .kpi .spark { top: auto; bottom: 12px; }                        /* wide enough again */
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr; }
  .kpi.kpi-resp { grid-template-columns: 1fr; }
  .kres { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
}

.kpi-resp .kr-l[title] { cursor: help; }

/* ---------------- Analysis Setup: Reset */
#avail { margin-left: auto; }
.reset-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.reset-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- /embed (inside Power BI): no sign-out (the link's token signs it in) */
body.embed #signout { display: none !important; }

/* ---------------- seat status: the Status column, the Seat status card and the legend. Shapes differ as well as colours
   (diamond, triangle, circle with "?", disc with a tick, square with a dash); --calling: the reports' calling-effect brown */
:root, [data-theme="dark"] { --calling: #cdb795; --si-in: #052417; }
[data-theme="light"] { --calling: #7a6a55; --si-in: #ffffff; }
.si-w { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.si-w[title] { cursor: help; }
.si { width: 16px; height: 16px; display: block; overflow: visible; }
.si path, .si circle, .si rect { fill: currentColor; stroke: none; }
.si .o { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.si .k { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.si .in { fill: none; stroke: var(--si-in); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.si-real { color: var(--bad); } .si-watch { color: var(--warn); } .si-calling { color: var(--calling); }
.si-stable { color: var(--ok); } .si-na { color: var(--muted2); }
.si-pend { display: block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--pl); border-radius: 50%;
  animation: spin .9s linear infinite; }
table.seats .c-st { text-align: center; width: 54px; }
table.seats { min-width: 1040px; }                  /* room for the Status column: names keep their priority star */
#ss-card .card-h { flex-wrap: wrap; row-gap: 2px; }
#ss-card .card-h h2 { white-space: nowrap; }
#ss-sub { margin-left: auto; text-align: right; }
table.seats td.c-st .si-w { vertical-align: middle; }
.ss-chip { display: inline-flex; align-items: center; gap: 6px; }
.ss-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-count { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--field-border);
  background: var(--glass-2); color: var(--ink2); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.ss-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ss-count:hover:not(:disabled) { border-color: var(--p); }
.ss-count.on { border-color: var(--pl); color: var(--ink); background: rgba(var(--p-rgb), .22); box-shadow: 0 0 8px rgba(var(--p-rgb), .26); }
.ss-count:disabled { opacity: .45; cursor: default; }
.ss-prog { margin-top: 10px; font-size: 12.5px; color: var(--ink2); }
.ss-prog:empty { display: none; }
.ss-pl { display: flex; align-items: center; gap: 8px; }
.ss-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 264px; overflow-y: auto; border-top: 1px solid var(--line); }
.ss-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--line2);
  background: none; color: var(--ink2); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.ss-row:hover, .ss-row:focus-visible { background: var(--glass-2); color: var(--ink); outline: none; }
.ss-row:focus-visible { box-shadow: inset 0 0 0 2px rgba(var(--p-rgb), .7); }
.ss-row.focus { background: rgba(var(--p-rgb), .22); }
.ss-row .ac2 { font-weight: 650; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.ss-row .sep { color: var(--muted2); flex: none; }
.ss-row .nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-row .lab { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex: none; }
.ss-none { padding: 10px 2px; } .ss-none .empty { padding: 14px 8px; }
.ss-foot { margin: 8px 0 0; }
.ss-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--ink2); }
.ss-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ss-legend .ss-lt { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted2); font-weight: 600; }
.ss-legend .ss-lnote { color: var(--muted); }
.col-side.unstick { position: static; }            /* taller than the window: scrolls with the page (app.js fitSide) */

/* ---------------- narrow screens and small Power BI visuals. The constituency table: when wider than its card it scrolls
   sideways with the seat (checkbox, AC, Constituency) and its Status pinned on the left; in a phone-sized card it drops
   its other columns step by step instead (the snapshot and the tooltips still have them). The right-hand cards sit side
   by side under the table. */
@container (min-width: 641px) {
  table.seats .w-ck { width: 36px; min-width: 36px; } table.seats th[data-sort=ac] { width: 46px; min-width: 46px; }
  table.seats th[data-sort=name] { width: 172px; min-width: 172px; } table.seats th.c-st { width: 58px; min-width: 58px; }
  /* pinned cells are opaque (the page colour under the card's glass), so the columns scrolling beneath never show through */
  table.seats td:nth-child(-n+4) { position: sticky; z-index: 2; background: linear-gradient(var(--glass), var(--glass)), var(--bg); }
  table.seats th:nth-child(-n+4) { z-index: 3; background: linear-gradient(var(--th), var(--th)), var(--bg); }
  table.seats :is(th, td):nth-child(1) { left: 0; } table.seats :is(th, td):nth-child(2) { left: 36px; }
  table.seats :is(th, td):nth-child(3) { left: 82px; } table.seats :is(th, td):nth-child(4) { left: 254px; }
  table.seats :is(th, td):nth-child(4) { box-shadow: 8px 0 8px -8px rgba(0, 0, 0, .45); }
  table.seats tbody tr:hover td:nth-child(-n+4) { background: linear-gradient(var(--glass-2), var(--glass-2)), linear-gradient(var(--glass), var(--glass)), var(--bg); }
  table.seats tr.sel td:nth-child(-n+4) { background: linear-gradient(var(--row-sel), var(--row-sel)), linear-gradient(var(--glass), var(--glass)), var(--bg); }
  #seats tr.focus td:nth-child(-n+4) { background: linear-gradient(rgba(var(--p-rgb), .22), rgba(var(--p-rgb), .22)), linear-gradient(var(--glass), var(--glass)), var(--bg); }
}
@container (max-width: 640px) {
  table.seats { min-width: 0; }
  table.seats .c-trend, table.seats .c-vse, table.seats .c-resp, table.seats .c-data { display: none; }
  table.seats td, table.seats th { padding: 7px 5px; }
  .seat-card .sumchips { margin-bottom: 8px; } .chips-wrap .chip { padding: 3px 9px; font-size: 12px; }
}
@container (max-width: 560px) { table.seats .c-mar { display: none; } }
@container (max-width: 440px) { table.seats .c-lead { display: none; } }
@media (max-width: 1180px) {
  .col-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
  .col-side > .card { margin-bottom: 0; }
}
@media (max-width: 760px) {
  .ss-list { max-height: 320px; }
  .ss-count { padding: 4px 9px; font-size: 12px; }
  .ss-legend .ss-lnote { flex-basis: 100%; }
}
/* two columns: both end on the same line. The taller column sets the height; in the other one the constituency table
   (left) or the Seat status list (right) grows into the space, so it holds more rows rather than a gap */
@media (min-width: 1181px) {
  .grid { align-items: stretch; }
  .col-main, .col-side { display: flex; flex-direction: column; }
  .col-main > .seat-card, .col-side > #ss-card { flex: 1 1 auto; display: flex; flex-direction: column; }
  .seat-card .seats-wrap { flex: 1 1 0; min-height: 560px; max-height: none; }
  #ss-card .ss-list { flex: 1 1 0; min-height: 264px; max-height: none; }
}
