/* The six big features (owner, 28 Nov 2026): /kingmakers, /gerrymander-test, /wrong-party, /synthetic-nation, /u-turns, /2045.
   Square corners, rich cards, tables that scroll sideways on a phone (owner: space first, Amazon-style). Builds on lab.css. */

.bl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 8px; }
.bl-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm, 14px); min-width: 560px; }
.bl-table th, .bl-table td { padding: 7px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line, #e3e6ea); }
.bl-table th { font: 600 12px/1.3 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5f6670); white-space: nowrap; }
.bl-table td.n, .bl-table th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bl-table tr.hl td { background: #fff7e6; }
.bl-table a { text-decoration: none; }
.bl-table a:hover { text-decoration: underline; }

.bl-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; background: var(--c, #9aa0a6); }
.bl-party { white-space: nowrap; }

.bl-bar { position: relative; height: 12px; background: var(--b2, #eceef1); min-width: 80px; }
.bl-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, #1d3f73); }
.bl-bar > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink, #111); }

.bl-seatbar { display: flex; height: 26px; background: var(--b2, #eceef1); margin: 8px 0 4px; overflow: hidden; }
.bl-seatbar > i { display: block; height: 100%; }
.bl-seatbar-wrap { position: relative; }
.bl-seatbar-wrap > b { position: absolute; left: 50%; top: 0; height: 26px; width: 2px; background: var(--ink, #111); opacity: .75; }
.bl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted, #5f6670); }

.bl-hist { display: flex; align-items: flex-end; gap: 1px; height: 120px; padding: 4px 0; border-bottom: 1px solid var(--line, #e3e6ea); }
.bl-hist > i { flex: 1 1 0; background: var(--c, #1d3f73); opacity: .85; min-width: 2px; position: relative; }
.bl-hist > i.real { opacity: 1; background: #e8a33d; }
.bl-hist-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted, #5f6670); }

.bl-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 10px 0 18px; }
.bl-pair > blockquote { margin: 0; padding: 12px 14px; background: var(--b2, #f6f7f9); border-left: 4px solid var(--c, #1d3f73); font-size: 15px; line-height: 1.5; }
.bl-pair > blockquote footer { margin-top: 8px; font: 600 12px/1.3 var(--font-ui); color: var(--muted, #5f6670); }
.bl-uturn { border-top: 1px solid var(--line, #e3e6ea); padding-top: 12px; margin-top: 12px; }
.bl-uturn h3 { margin: 0 0 4px; font-size: 17px; }
.bl-uturn .bl-meta { font-size: 13px; color: var(--muted, #5f6670); }

/* the members' map is drawn 360 wide (phone size) and grows to 640 on a computer; it has no text, so it scales cleanly */
.bl-map { width: 100%; max-width: 640px; height: auto; background: var(--b2, #f6f7f9); display: block; }
.bl-map circle { stroke: rgba(0,0,0,.25); stroke-width: .4; }
.bl-map circle.wrong { stroke: var(--ink, #111); stroke-width: .9; }

.bl-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.bl-pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.bl-pills a, .bl-pills span { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--line, #d6dae0); font-size: 13px; text-decoration: none; white-space: nowrap; }
.bl-pills .on { background: var(--ink, #111); color: #fff; border-color: var(--ink, #111); }
.bl-empty { padding: 18px; background: var(--b2, #f6f7f9); }
/* a long list of seats wraps into lines instead of one row 650 pills long */
.bl-pills--wrap { flex-wrap: wrap; overflow-x: visible; }
/* one party's agreement on a member's page: name, bar, figure; the name column narrows on a phone */
.bl-withrow { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 48px; gap: 10px; align-items: center; }
.bl-withrow .n { text-align: right; font-variant-numeric: tabular-nums; }
.bl-withrow .bl-party { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; min-width: 0; }

@media (max-width: 760px) {
    .bl-pair, .bl-grid2 { grid-template-columns: minmax(0, 1fr); }
    .bl-table { font-size: 13px; }
}
@media (max-width: 430px) {
    .bl-withrow { grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) 42px; gap: 8px; font-size: 14px; }
}

/* the seat chart (LabHtml.Hemicycle) on the big-feature pages: no wider than a readable chamber, and the page's letter
   spacing kept out of its SVG text (it is measured in chart units there, so the label came apart) */
.bl-hemi { max-width: 560px; margin: 0 auto 8px; }
.bl-hemi svg text { letter-spacing: 0; word-spacing: 0; }

/* the big answer number: never broken digit by digit (it came out as a column of single digits on phones, 28 Nov 2026);
   on a narrow screen the sentence drops under the number instead */
.lab-hero__answer { flex-wrap: wrap; }
.lab-hero__answer b.big { flex: 0 0 auto; white-space: nowrap; word-break: normal; overflow-wrap: normal; }
.lab-hero__answer span { flex: 1 1 200px; min-width: 0; }
/* the same box inside a page section (light background): dark text, a light panel */
.lab-section .lab-hero__answer, .tab-panel .lab-hero__answer { background: var(--surface-2, #f4f5f7); color: inherit; }
.lab-section .lab-hero__answer span, .tab-panel .lab-hero__answer span { color: inherit; }
@media (max-width: 430px) {
    .lab-hero__answer { gap: 6px 14px; padding: 12px 14px; }
    .lab-hero__answer b.big { font-size: clamp(34px, 11vw, 48px); }
}

/* the U-turn Engine, one block per MP with all their reversals under their name */
.bl-uturn-person { margin-top: 22px; }
.bl-uturn-person > h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 4px; font-size: 21px; }
.bl-uturn-person > h2 .bl-meta { font-size: 13px; font-weight: 600; color: var(--muted, #5f6670); }
.bl-uturn-person .bl-uturn:first-of-type { border-top: 0; margin-top: 4px; }
.bl-uturn p.bl-meta { margin: 0 0 8px; font-size: 14px; }

/* "How to read this": one or two plain sentences right under a headline figure or above a table (28 Nov 2026) */
.bl-read { margin: 10px 0 0; font-size: 14px; line-height: 1.45; opacity: .92; max-width: 70ch; }
.lab-section .bl-read { opacity: 1; color: var(--muted, #5f6670); margin: 0 0 8px; }

/* what the reader can do next, straight under the hero: a labelled seat search and the pick-a-country pills */
.bl-next { display: grid; gap: 10px; }
.bl-next > h2 { margin: 0; font-size: 17px; }
.bl-find { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: flex-end; margin: 0; }
.bl-find label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 220px; font: 600 13px/1.3 var(--font-ui); }
.bl-find input[type=search] { width: 100%; min-height: 40px; padding: 8px 10px; font-size: 16px; border: 1px solid var(--line, #c9ced5); border-radius: 0; }
.bl-find button { min-height: 40px; padding: 8px 14px; border: 1px solid var(--ink, #111); background: var(--ink, #111); color: #fff; font: 600 14px/1 var(--font-ui); border-radius: 0; cursor: pointer; }

/* the six features under every page: name and one line each; the reader's own feature marked and linking to its start */
.bl-features__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.bl-features__list a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid var(--line, #d6dae0); text-decoration: none; color: inherit; }
.bl-features__list a:hover b { text-decoration: underline; }
.bl-features__list b { font-size: 15px; }
.bl-features__list span { font-size: 13px; color: var(--muted, #5f6670); }
.bl-features__list li.on a { border-color: var(--ink, #111); border-width: 2px; padding: 9px 11px; }
@media (max-width: 430px) { .bl-features__list { grid-template-columns: minmax(0, 1fr); } }

/* the error-report line at the foot of each "How this works" */
.bl-report { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line, #e3e6ea); font-size: 14px; }
.lab-how h3 { margin: 14px 0 4px; font-size: 15px; }
.lab-how ul, .lab-how ol { margin: 4px 0 8px; padding-left: 20px; }
.lab-how li { margin: 2px 0; }

/* the link under the six-feature row to the page with all of them */
.bl-features__all { margin: 10px 0 0; font-size: 14px; }
.bl-features__all a { font-weight: 600; }
/* the same link in the front page's "Try them yourself" band */
.lab-show__all { margin: 6px 0 0; font-size: 14px; }
.lab-show__all a { font-weight: 600; }

/* /big-features: one compact card per feature, square corners; one column on a phone, two on a tablet, three on a computer.
   The feature's colour runs along the top of its card (--c), its headline figure large under the name. */
.bl-hub { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bl-hub > li { display: flex; }
.bl-hub__card { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 14px 12px; border: 1px solid var(--line, #d6dae0);
    border-top: 4px solid var(--ink); border-radius: 0; color: inherit; text-decoration: none; }
.bl-hub__card:hover, .bl-hub__card:focus-visible { border-color: var(--ink); }
.bl-hub__card:hover .bl-hub__go { text-decoration: underline; }
.bl-hub__where { display: flex; align-items: center; gap: 6px; font: 600 12px/1.3 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5f6670); }
.bl-hub__name { font-size: 18px; line-height: 1.25; }
.bl-hub__fig { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.bl-hub__fig > b { flex: 0 0 auto; font-size: 34px; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a figure about a party carries that party's colour as a short rule under it, never as a block (29 Nov 2026) */
.bl-hub__fig > b[data-party] { box-shadow: inset 0 -5px 0 var(--pc, transparent); padding-bottom: 2px; }
.bl-hub__fig > span { flex: 1 1 160px; min-width: 0; font-size: 14px; line-height: 1.35; }
.bl-hub__fig--none > span { color: var(--muted, #5f6670); font-style: italic; }
.bl-hub__what { font-size: 14px; line-height: 1.4; color: var(--muted, #5f6670); }
.bl-hub__go { margin-top: auto; padding-top: 2px; font: 600 14px/1.3 var(--font-ui); color: var(--ink); }
@media (min-width: 640px) { .bl-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1000px) { .bl-hub { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 430px) {
    .bl-hub__card { padding: 10px 12px; }
    .bl-hub__fig > b { font-size: 28px; }
}

/* phone check, 28 Nov 2026: the stacked tables' cell labels wrap instead of ending in "..." ("Neutral maps: usu..."); a note
   inside a feature's heading follows the heading's ink (29 Nov 2026: the heading is no longer a coloured box) */
html[data-phone=app][data-mtables=stack] table.bl-table.m-stack [data-label]::before, .bl-table.m-stack td::before { white-space: normal !important; text-overflow: clip !important; overflow: visible !important; height: auto !important; min-height: 14px !important; }
.lab-hero .lab-note { color: var(--ink-2, #3b4148); }
