:root {
  color-scheme: light;
  --ink: #1e1f21;
  --muted: #6e6e6b;
  --rule: #d9d6d0;
  --soft-rule: #ece9e4;
  --paper: #ffffff;
  --wash: #f7f6f3;
  --chrome: #faf9f7;
  --accent: #7b1f2b;
  --active: #1e1f21;
  --page-bg: #f1f0ed;
  --card-border: #dfddd8;
  --card-shadow: rgba(27, 25, 21, .08);
  --svg-guide: #e5e2dc;
  --aisle-band: #ede9e1;
  --architectural-rail: #7b1f2b;
  --focus: #111111;
  --check-active: #2f8a4a;
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
}

body[data-chamber="old"] {
  --ink: #302b27;
  --muted: #756e68;
  --rule: #ddd5ce;
  --soft-rule: #eee9e4;
  --paper: #fffefd;
  --wash: #f7f4f1;
  --chrome: #faf8f6;
  --accent: #756258;
  --active: #4b423d;
  --page-bg: #f2efec;
  --card-border: #ded7d1;
  --card-shadow: rgba(55, 43, 34, .08);
  --svg-guide: #ebe6e1;
  --architectural-rail: #b3a397;
  --focus: #342d29;
}

body[data-chamber="new"] {
  --ink: #26343d;
  --muted: #6d7b84;
  --rule: #d7dfe4;
  --soft-rule: #e9eef1;
  --paper: #fefefe;
  --wash: #f5f7f8;
  --chrome: #f8fafb;
  --accent: #617a89;
  --active: #425b69;
  --page-bg: #eff3f5;
  --card-border: #d8e0e4;
  --card-shadow: rgba(39, 61, 73, .08);
  --svg-guide: #e6ecef;
  --architectural-rail: #a9bbc5;
  --focus: #263f4d;
}

* { box-sizing: border-box; }

html { background: #e9e7e2; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page-bg);
  transition: color 220ms ease, background-color 220ms ease;
}

button, select { font: inherit; }

button, select, summary { -webkit-tap-highlight-color: transparent; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(17, 17, 17, .24);
  outline-offset: 3px;
}

.seat:focus,
.seat:focus-visible {
  outline: none;
}

.seat:focus-visible .seat-selection-dot {
  opacity: 1;
}

.page-shell {
  max-width: 1720px;
  margin: 0 auto;
  padding: 28px;
}

.parliament-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--card-border);
  border-top: 4px solid var(--architectural-rail);
  box-shadow: 0 18px 55px var(--card-shadow);
  transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.map-header,
.toolbar,
.visual-grid,
.composition,
.utility-section,
.map-footer {
  padding-right: clamp(22px, 4vw, 58px);
  padding-left: clamp(22px, 4vw, 58px);
}

.map-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-top: 42px;
  padding-bottom: 28px;
}

.map-header > * { position: relative; z-index: 1; }

.language-nav {
  position: absolute;
  top: 14px;
  right: clamp(22px, 4vw, 58px);
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
}

.language-nav a {
  min-width: 31px;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  text-decoration: none;
}

.language-nav a:hover,
.language-nav a:focus-visible { color: var(--ink); background: var(--wash); }
.language-nav a[aria-current="page"] { color: var(--paper); background: var(--active); }

.title-lockup {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  column-gap: 28px;
  min-width: 0;
  width: 100%;
  min-height: 120px;
}

.title-copy {
  grid-column: 2;
  display: flex;
  min-height: 120px;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.building-mark {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  width: 128px;
  height: 120px;
  place-items: center;
  color: var(--accent);
  opacity: .78;
}

.building-silhouette {
  display: none;
  width: 124px;
  height: 82px;
  overflow: visible;
}

body[data-chamber="old"] .building-silhouette--old,
body[data-chamber="new"] .building-silhouette--new { display: block; }

.building-fill { fill: currentColor; opacity: .075; }
.building-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}
.building-detail { fill: currentColor; opacity: .25; }
.building-fine {
  fill: none;
  stroke: currentColor;
  stroke-width: .9;
  opacity: .55;
  vector-effect: non-scaling-stroke;
}

.map-header::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  width: min(48%, 620px);
  height: 100%;
  pointer-events: none;
  content: "";
  -webkit-mask-image: linear-gradient(to left, #000 18%, rgba(0, 0, 0, .78) 58%, transparent 100%);
  mask-image: linear-gradient(to left, #000 18%, rgba(0, 0, 0, .78) 58%, transparent 100%);
}

body[data-chamber="old"] .map-header::before {
  opacity: .46;
  background-image:
    linear-gradient(rgba(112, 70, 39, .17) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 70, 39, .17) 1px, transparent 1px),
    radial-gradient(circle at 80% 26%, rgba(137, 88, 46, .18), transparent 44%);
  background-size: 26px 26px, 26px 26px, 100% 100%;
}

body[data-chamber="new"] .map-header::before {
  opacity: .28;
  background-image:
    linear-gradient(32deg, transparent 47%, rgba(73, 124, 153, .16) 48.5%, rgba(73, 124, 153, .16) 51.5%, transparent 53%),
    linear-gradient(-32deg, transparent 47%, rgba(73, 124, 153, .13) 48.5%, rgba(73, 124, 153, .13) 51.5%, transparent 53%),
    linear-gradient(180deg, rgba(188, 218, 232, .2), transparent 76%);
  background-size: 58px 34px, 58px 34px, 100% 100%;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.75rem);
  letter-spacing: -.035em;
  line-height: .98;
}

.subtitle {
  max-width: 100%;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.55;
}

.capacity {
  display: grid;
  grid-template-columns: 148px 1px 112px;
  align-items: center;
  min-width: 0;
  margin-left: auto;
  color: var(--muted);
  column-gap: 13px;
  font-size: .66rem;
  white-space: nowrap;
}

.capacity-item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  width: 100%;
}

.capacity-item strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 500;
}

.capacity i {
  width: 1px;
  height: 24px;
  background: var(--rule);
}

.chamber-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 10px clamp(22px, 4vw, 58px);
  background: var(--chrome);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.chamber-nav-label {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.chamber-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(138px, 1fr));
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.chamber-tab {
  display: grid;
  min-height: 44px;
  padding: 6px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
}

.chamber-tab span { font-size: .76rem; font-weight: 800; }
.chamber-tab small { margin-top: 2px; font-size: .62rem; }
.chamber-tab:hover { color: var(--ink); }
.chamber-tab.is-active { color: white; background: var(--active); }

.election-nav {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.election-tabs {
  display: flex;
  overflow-x: auto;
  padding: 0 clamp(22px, 4vw, 58px);
  scrollbar-width: none;
}

.election-tabs::-webkit-scrollbar { display: none; }

.election-tab {
  position: relative;
  flex: 0 0 auto;
  width: 140px;
  min-height: 52px;
  padding: 0 18px;
  color: #686865;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.election-tab::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 3px;
  background: transparent;
  content: "";
}

.election-tab:hover { color: var(--ink); }
.election-tab.is-active { color: var(--ink); }
.election-tab.is-active::after { background: var(--accent); }

.ordinal-suffix {
  position: relative;
  top: -.38em;
  margin-left: .02em;
  font-size: .62em;
  font-weight: inherit;
  line-height: 0;
  vertical-align: baseline;
}

.data-label .ordinal-suffix { font-size: .58em; }

.toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding-top: 13px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--soft-rule);
}

.data-label {
  width: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 1.85vw, 1.65rem);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.25;
  text-align: center;
}

.mark-style-switch {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 1fr);
  gap: 6px;
  width: min(100%, 900px);
  padding: 5px;
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.mark-style-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 96px;
  min-height: 40px;
  padding: 7px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: .7rem;
  font-weight: 750;
  line-height: 1;
}

.mark-style-button svg {
  width: 17px;
  height: 17px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.mark-style-button circle { fill: currentColor; stroke: none; }
.mark-style-button .solid-arch-icon { fill: currentColor; stroke: none; }
.mark-style-button:hover { color: var(--ink); }
.mark-style-button.is-active { color: var(--paper); background: var(--active); }
.mark-style-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mark-style-button[hidden] { display: none; }

.visual-composition-group {
  background: var(--paper);
}

.visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: clamp(24px, 3vw, 48px);
  padding-top: 34px;
  padding-bottom: 0;
}

.visual-grid.is-details-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.chart-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.details-open-button {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: clamp(22px, 4vw, 58px);
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border: 1.25px solid color-mix(in srgb, var(--muted) 58%, var(--rule));
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
  opacity: .96;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.details-open-button[hidden] { display: none; }
.details-open-button:hover { color: var(--ink); background: var(--paper); border-color: var(--muted); opacity: 1; }
.details-open-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.details-toggle-minus { display: none; }
.details-open-button.is-expanded .details-toggle-plus { display: none; }
.details-open-button.is-expanded .details-toggle-minus { display: block; }

.chart-shell {
  position: relative;
  width: min(100%, 1280px);
  min-height: 620px;
  margin-inline: auto;
}

.chart-shell.is-institution-free,
#parliament-map.is-institution-free {
  min-height: 0;
}

.render-error {
  margin: 20px 0;
  padding: 18px;
  color: #7b1f2b;
  background: #fff4f4;
  border: 1px solid #e6bbbb;
  line-height: 1.5;
}

#parliament-map {
  display: block;
  width: 100%;
  height: auto;
  min-height: 620px;
}

.visual-source {
  margin: 18px 0 0;
  padding-top: 0;
  color: var(--ink);
  border-top: 0;
  font-size: .72rem;
  line-height: 1.4;
  text-align: center;
}

.visual-source a {
  color: var(--ink);
  font-weight: 750;
  text-underline-offset: 2px;
}

.official-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .045em;
}

.old-bank-rail {
  fill: #cfbca8;
  stroke: #9c806b;
  stroke-width: .7;
  opacity: .72;
  vector-effect: non-scaling-stroke;
}

.chamber-row-guide {
  fill: none;
  stroke: #b9a88f;
  stroke-linecap: round;
  stroke-width: 5;
  opacity: .55;
  vector-effect: non-scaling-stroke;
}

.official-label { text-transform: uppercase; }
.official-label { text-anchor: middle; }

.institution-chair { color: #65747c; }
.institution-chair .chair-back,
.institution-chair .chair-cushion { fill: #aeb8bd; stroke: currentColor; }
.institution-chair .chair-arms { stroke: currentColor; }
.institution-chair .chair-detail { stroke: rgba(66, 82, 91, .34); }
.institution-chair--presidium .chair-back,
.institution-chair--presidium .chair-cushion { fill: #87969e; }
body[data-chamber="old"] .institution-chair { color: #766a62; }
body[data-chamber="old"] .institution-chair .chair-back,
body[data-chamber="old"] .institution-chair .chair-cushion { fill: #b6ada6; }
body[data-chamber="old"] .institution-chair .chair-detail { stroke: rgba(80, 64, 54, .34); }
body[data-chamber="old"] .institution-chair--presidium .chair-back,
body[data-chamber="old"] .institution-chair--presidium .chair-cushion { fill: #91847b; }
.presidium-platform { fill: #7f8e96; opacity: .38; }
body[data-chamber="old"] .presidium-platform { fill: #826f63; opacity: .42; }

.rostrum-lectern { fill: #6f7f87; stroke: #53656e; stroke-width: .75; }
.rostrum-step { fill: #aab4b9; }
body[data-chamber="old"] .rostrum-lectern { fill: #75675f; stroke: #594b44; }
body[data-chamber="old"] .rostrum-step { fill: #b3a79f; }
.rostrum-label {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .055em;
  text-anchor: middle;
  text-transform: uppercase;
}

#parliament-map.is-compact .official-label,
#parliament-map.is-compact .rostrum-label { font-size: 10.5px; }

.seat { cursor: pointer; }
.seat-hit { fill: transparent; }
.seat-mark {
  transition: opacity 160ms ease, transform 160ms ease;
  transform-box: fill-box;
  transform-origin: center;
}
.seat-chair {
  stroke: rgba(30, 31, 33, .36);
}
.seat-dot-mark { stroke: rgba(30, 31, 33, .32); stroke-width: .75; vector-effect: non-scaling-stroke; }
.member-piece {
  stroke: rgba(30, 31, 33, .38);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}
.member-detail {
  fill: none;
  stroke: rgba(255, 255, 255, .62);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: .65;
  vector-effect: non-scaling-stroke;
}
.chair-piece {
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: .85;
  vector-effect: non-scaling-stroke;
}
.chair-arms { stroke-width: 1; }
.chair-detail {
  stroke: rgba(255, 255, 255, .42);
  stroke-width: .55;
  vector-effect: non-scaling-stroke;
}
.chair-base-detail {
  fill: none;
  stroke: rgba(30, 31, 33, .38);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: .72;
  vector-effect: non-scaling-stroke;
}
.chair-glyph--old .chair-detail,
.chair-glyph--new .chair-detail { stroke-width: .6; }
.chair-glyph--new .chair-back,
.chair-glyph--old .chair-back { stroke-width: .82; }
.top-chair-glyph .chair-back,
.top-chair-glyph .chair-cushion { stroke-width: .78; }
.top-chair-glyph .chair-detail { stroke-width: .5; }
.seat:hover .seat-mark { transform: scale(1.14); }
.seat--empty .chair-back,
.seat--empty .chair-cushion { fill: var(--paper); stroke: #aebbc2; }
.seat--empty .chair-arms { stroke: #aebbc2; }
.seat--empty .chair-detail { stroke: #d2dade; }
.seat--empty .chair-base-detail { stroke: #aebbc2; }
.seat--empty .seat-dot-mark { fill: var(--paper); stroke: #aebbc2; }
.seat--empty .member-piece { fill: var(--paper); stroke: #aebbc2; }
.seat--empty .member-detail { stroke: #d2dade; }
.seat-selection-dot {
  fill: #4d575d;
  stroke: #fff;
  stroke-width: .85;
  opacity: 0;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.seat.is-selected .seat-selection-dot { opacity: 1; }
.seat.is-selected .seat-mark {
  filter: drop-shadow(0 0 1.2px var(--seat-color)) drop-shadow(0 0 2.6px var(--seat-color));
}
.seat.is-highlighted .seat-mark {
  opacity: 1;
  transform: scale(1.08);
  filter: drop-shadow(0 0 1.1px var(--seat-color)) drop-shadow(0 0 2.2px var(--seat-color));
}
.seat.is-dimmed .seat-mark {
  opacity: .32;
  filter: grayscale(1) saturate(0);
}

.old-bank-rail,
.chamber-row-guide { opacity: 0; }

#parliament-map.is-benches-view .old-bank-rail {
  fill: #c9b7a4;
  stroke: #8f7664;
  stroke-width: .8;
  opacity: .9;
}

#parliament-map.is-benches-view .bench-seat-mark .chair-base-detail { opacity: .55; }

#parliament-map.is-schematic-view .seat-dot-mark {
  stroke: var(--paper);
  stroke-width: 1.1;
}

.solid-arch-segment {
  cursor: pointer;
  stroke: var(--paper);
  stroke-width: 1.4;
  transition: opacity 170ms ease, filter 170ms ease;
  vector-effect: non-scaling-stroke;
}

.solid-arch-segment:focus { outline: none; }

.solid-arch-segment:hover,
.solid-arch-segment:focus-visible {
  filter: brightness(1.08) drop-shadow(0 0 2px var(--segment-color));
}

.solid-arch-segment:focus-visible {
  outline: none;
  stroke: #4d575d;
  stroke-width: 2.5;
}

.solid-arch-segment.is-highlighted {
  opacity: 1;
  filter: brightness(1.04) drop-shadow(0 0 2.2px var(--segment-color));
}

.solid-arch-segment.is-dimmed {
  opacity: .25;
  filter: grayscale(1) saturate(0);
}

.solid-arch-reveal-rect {
  transform-box: fill-box;
  transform-origin: left center;
}

.solid-arch-center,
.solid-arch-label-layer { pointer-events: none; }

.solid-arch-center-value,
.solid-arch-center-label,
.solid-arch-count-value {
  fill: var(--ink);
  text-anchor: middle;
}

.solid-arch-party-name { fill: var(--ink); }

.solid-arch-center-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  font-weight: 500;
}

.solid-arch-center-label {
  font-size: 19px;
  font-weight: 650;
  dominant-baseline: text-after-edge;
}

.solid-arch-party-name {
  font-size: 15px;
  font-weight: 780;
}

.solid-arch-count-badge {
  fill: var(--segment-color, #292d30);
  stroke: var(--paper);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.solid-arch-count-value {
  fill: #fff;
  font-size: 13px;
  font-weight: 800;
  dominant-baseline: central;
}

#parliament-map.is-animating .solid-arch-label-layer {
  animation: solid-arch-labels-in 220ms ease 500ms backwards;
}

#parliament-map.is-animating .solid-arch-reveal-rect {
  animation: solid-arch-reveal 680ms cubic-bezier(.2, .72, .26, 1) backwards;
}

#parliament-map.is-animating .seat-mark {
  animation: seat-sweep-in 360ms cubic-bezier(.2, .72, .26, 1) var(--seat-delay) backwards;
}

@keyframes seat-sweep-in {
  from { opacity: 0; transform: translateX(-7px) scale(.78); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes solid-arch-reveal {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes solid-arch-labels-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tooltip {
  position: fixed;
  z-index: 10;
  width: max-content;
  max-width: min(270px, calc(100vw - 32px));
  padding: 9px 11px;
  color: white;
  background: #202124;
  border-radius: 3px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .17);
  pointer-events: none;
  font-size: .72rem;
  line-height: 1.45;
}

.tooltip strong { display: block; font-size: .78rem; }

.map-key {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 110px;
  border-top: 1px solid var(--rule);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px clamp(24px, 3vw, 38px);
  width: 100%;
}

.legend-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: .82rem;
  transition: color 160ms ease, opacity 160ms ease;
}

.legend-button > span:last-child {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.legend-button:hover, .legend-button.is-active { color: var(--ink); }
.legend.has-filter .legend-button:not(.is-active) { opacity: .42; }
.legend-button.is-active .legend-swatch {
  outline: 2px solid color-mix(in srgb, var(--swatch) 52%, #26333a);
  outline-offset: 2px;
}

.legend-swatch,
.party-swatch {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  background-color: var(--swatch, #ddd);
  border: 1px solid rgba(30, 31, 33, .28);
  border-radius: 2px;
}

.details-panel {
  align-self: start;
  min-height: 672px;
  padding: 24px;
  background: var(--wash);
  border-top: 4px solid var(--accent);
}

.details-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  min-height: 92px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.details-heading h2, .composition h2, .utility-section h2 {
  margin-bottom: 0;
  font-size: 1.4rem;
}

.details-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seat-nav { display: flex; gap: 5px; }

.seat-nav button,
.details-close-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
}

.seat-nav svg,
.details-close-button svg { width: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.seat-nav button:disabled { cursor: default; opacity: .35; }
.details-close-button:hover { color: var(--paper); background: var(--active); border-color: var(--active); }

.seat-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 152.5px;
  padding: 22px 0;
}

.party-swatch { width: 22px; height: 18px; border-radius: 4px; }
.details-panel.is-empty .party-swatch { opacity: 0; }
.seat-identity p { margin-bottom: 4px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .06em; }
.seat-identity h3 { margin-bottom: 0; font-size: .98rem; line-height: 1.35; }
.seat-identity .party-description {
  max-width: 250px;
  margin: 7px 0 0;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
}
.party-description span { display: block; }
.party-description span + span { margin-top: 2px; }

.detail-list { min-height: 251px; margin: 0; }
.detail-list div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid #e2dfd9;
  font-size: .73rem;
  line-height: 1.35;
}
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 700; text-align: right; }

.selection-status {
  min-height: 52.5px;
  margin-top: 16px;
  padding: 10px 12px;
  color: #4f4f4c;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  font-size: .7rem;
  line-height: 1.45;
}

.keyboard-note { min-height: 46px; margin: 14px 0 0; color: var(--muted); font-size: .66rem; line-height: 1.45; }

.composition {
  display: block;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 0;
}

.composition-content {
  width: min(86%, 1100px);
  margin-inline: auto;
}

.composition-bar {
  display: flex;
  width: 100%;
  height: 22px;
  overflow: hidden;
  background: var(--wash);
  border-radius: 999px;
}

.composition-segment { min-width: 1px; height: 100%; }

.composition-list {
  display: grid;
  grid-template-columns: repeat(var(--composition-columns, 6), max-content);
  justify-content: center;
  gap: 13px clamp(24px, 3vw, 52px);
  margin-top: 18px;
}
.composition-list[data-party-count="1"] { --composition-columns: 1; }
.composition-list[data-party-count="2"] { --composition-columns: 2; }
.composition-list[data-party-count="3"] { --composition-columns: 3; }
.composition-list[data-party-count="4"] { --composition-columns: 4; }
.composition-list[data-party-count="5"] { --composition-columns: 5; }
.composition-list[data-party-count="6"] { --composition-columns: 6; }
.composition-list[data-party-count="7"],
.composition-list[data-party-count="8"] { --composition-columns: 4; }
.composition-list[data-party-count="9"],
.composition-list[data-party-count="10"] { --composition-columns: 5; }

.composition-item {
  display: grid;
  grid-template-columns: 11px max-content minmax(2ch, auto);
  align-items: center;
  gap: 9px;
  width: max-content;
  min-width: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.3;
}
.composition-item span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composition-item strong { color: var(--ink); text-align: right; }
.composition-item .composition-percentage { color: var(--muted); font-size: .88em; font-weight: 600; }

.utility-section {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 38px;
  align-items: start;
  padding-top: 26px;
  padding-bottom: 28px;
  border-top: 1px solid var(--rule);
}

.format-section,
.image-section {
  border-top: 0;
}

.format-section { align-items: center; }
.image-section { align-items: start; }
.image-section .utility-copy { padding-top: 4px; }
.format-section .utility-copy--continuation .eyebrow,
.image-section .utility-copy--continuation .eyebrow { display: none; }

.utility-copy h2 { margin-top: 0; }
.utility-copy--continuation .eyebrow { visibility: hidden; }

.visualization-section .utility-content {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 58px;
}

.visualization-section .mark-style-switch {
  justify-self: start;
  background: var(--chrome);
}

.format-section .utility-content {
  display: flex;
  align-items: center;
  min-height: 58px;
}

.format-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
}

.format-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 9px 13px;
  color: var(--muted);
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.format-toggle:hover { color: var(--ink); border-color: var(--muted); }
.format-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.format-toggle-label { font-size: .72rem; font-weight: 720; line-height: 1.25; }

.format-toggle-label-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 22px;
}

.format-toggle-label-list span { white-space: nowrap; }

.format-toggle-box {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: transparent;
  background: var(--paper);
  border: 2px solid var(--muted);
  border-radius: 6px;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.format-toggle-box svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.format-toggle-state {
  flex: 0 0 auto;
  min-width: 39px;
  padding: 4px 7px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.format-toggle.is-active { color: var(--ink); background: var(--chrome); }
.format-toggle.is-active .format-toggle-box { color: #fff; background: var(--check-active); border-color: var(--check-active); }
.format-toggle.is-active .format-toggle-state { color: var(--check-active); background: var(--paper); border-color: rgba(47, 138, 74, .42); }

.embed-content { min-width: 0; }

.embed-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.5;
}

.embed-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.embed-code-row pre {
  min-width: 0;
  margin: 0;
  padding: 13px 15px;
  overflow: auto;
  color: var(--ink);
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: .68rem;
  line-height: 1.55;
}

.embed-code-row code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-code-button {
  min-width: 132px;
  padding: 10px 18px;
  color: var(--paper);
  background: var(--active);
  border: 1px solid var(--active);
  border-radius: 8px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 750;
}

.copy-code-button:hover { filter: brightness(1.08); }
.copy-code-button:active { transform: translateY(1px); }

.copy-status {
  min-height: 1.35em;
  margin: 7px 0 0;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 700;
}

.export-content {
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(300px, 1fr);
  align-items: start;
  gap: 32px;
}

.export-controls {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.parliament-ad {
  min-width: 0;
  min-height: 280px;
  overflow: hidden;
}

.parliament-ad .adsbygoogle {
  width: 100%;
}

.export-label {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}

.export-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.export-button {
  min-width: 132px;
  min-height: 36px;
  padding: 7px 18px;
  color: var(--paper);
  background: var(--active);
  border: 1px solid var(--active);
  border-radius: 8px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 750;
}

.export-button:hover { filter: brightness(1.08); }
.export-button:active { transform: translateY(1px); }

.export-status {
  grid-column: 1 / -1;
  min-height: 1.35em;
  margin: 7px 0 0;
  color: var(--accent);
  font-size: .67rem;
  font-weight: 700;
}

.map-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding-top: 20px;
  padding-bottom: 20px;
  color: var(--muted);
  background: var(--chrome);
  border-top: 1px solid var(--soft-rule);
  font-size: .66rem;
  line-height: 1.5;
}
.map-footer p { margin-bottom: 0; }
.map-footer span[lang="bg"] { color: var(--ink); }
.map-footer code { color: var(--ink); }
.map-footer a { color: var(--accent); font-weight: 700; text-underline-offset: 2px; }
.copyright-note {
  grid-column: 1 / -1;
  padding-top: 14px;
  color: var(--ink);
  border-top: 1px solid var(--soft-rule);
}

@media (max-width: 980px) {
  .visual-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
  .composition-list[data-party-count="4"] { --composition-columns: 2; }
  .composition-list[data-party-count="5"],
  .composition-list[data-party-count="6"] { --composition-columns: 3; }
  .composition-list[data-party-count="7"],
  .composition-list[data-party-count="8"] { --composition-columns: 4; }
  .map-footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .page-shell { padding: 0; }
  .parliament-card { border: 0; box-shadow: none; }
  .map-header { align-items: start; padding-top: 58px; }
  .language-nav { top: 12px; right: 22px; }
  .title-lockup { grid-template-columns: 106px minmax(0, 1fr); column-gap: 20px; min-height: 104px; }
  .title-copy { min-height: 104px; }
  .building-mark { width: 106px; height: 104px; }
  .building-silhouette { width: 106px; height: 76px; }
  .chamber-nav { display: block; padding-top: 12px; padding-bottom: 12px; }
  .chamber-nav-label { display: block; margin-bottom: 8px; }
  .chamber-tabs { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chamber-tab { text-align: center; }
  .capacity { justify-content: center; margin: 10px 0 0; }
  .toolbar { display: block; min-height: 68px; padding-top: 16px; padding-bottom: 16px; }
  .data-label { margin-left: 0; }
  .mark-style-switch { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; padding: 6px; border-radius: 20px; }
  .mark-style-button { min-width: 0; min-height: 44px; gap: 5px; padding-right: 9px; padding-left: 9px; }
  body[data-chamber="old"] .mark-style-button[data-mark-style="solid"] { grid-column: 2; }
  .mark-style-button span { line-height: 1.12; text-align: center; }
  .visual-grid { display: block; padding-top: 24px; }
  .chart-shell, #parliament-map { min-height: 0; }
  .details-panel { min-height: 0; margin-top: 28px; padding: 22px; border-top-width: 3px; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 36px rgba(31, 30, 26, .08); }
  .details-heading, .seat-identity, .detail-list, .selection-status, .keyboard-note { min-height: 0; }
  .composition { grid-template-columns: 1fr; gap: 18px; }
  .composition-content { width: 100%; }
  .utility-section { grid-template-columns: 1fr; gap: 18px; }
  .visualization-section .utility-content, .format-section .utility-content { min-height: 0; }
  .composition-list[data-party-count="4"] { --composition-columns: 2; }
  .composition-list[data-party-count="3"],
  .composition-list[data-party-count="5"],
  .composition-list[data-party-count="6"] { --composition-columns: 3; }
  .composition-list[data-party-count="7"] { --composition-columns: 4; }
  .composition-list[data-party-count="8"] { --composition-columns: 4; }
  .map-footer { display: block; }
  .map-footer p + p { margin-top: 8px; }
}

@media (max-width: 600px) {
  .composition-list { --composition-columns: 1 !important; }
}

@media (max-width: 430px) {
  .map-header, .toolbar, .visual-grid, .composition, .utility-section, .map-footer { padding-right: 16px; padding-left: 16px; }
  .election-tabs { padding-right: 16px; padding-left: 16px; }
  .election-tab { padding-right: 13px; padding-left: 13px; }
  .election-tab::after { right: 13px; left: 13px; }
  .subtitle { font-size: .88rem; }
  .title-lockup { grid-template-columns: 86px minmax(0, 1fr); gap: 12px 16px; min-height: 0; }
  .building-mark { grid-column: 1; grid-row: 1; width: 86px; height: 88px; }
  .building-silhouette { width: 86px; height: 62px; }
  .title-copy { grid-column: 2; grid-row: 1; min-height: 88px; }
  .language-nav { right: 16px; }
  .details-open-button { right: 16px; }
  h1 { font-size: 2rem; }
  .mark-style-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-chamber="old"] .mark-style-button[data-mark-style="solid"] { grid-column: 1 / -1; justify-self: center; width: calc(50% - 4px); }
  .embed-code-row { grid-template-columns: 1fr; }
  .copy-code-button { min-height: 44px; }
  .format-controls { grid-template-columns: 1fr; }
  .export-content { grid-template-columns: 1fr; align-items: start; gap: 24px; }
  .export-buttons { justify-content: flex-start; width: 100%; }
  .export-button { flex: 1 1 140px; min-height: 44px; }
}

html.embed-mode,
html.embed-mode body {
  min-height: 0;
  background: #ffffff;
}

html.embed-mode .page-shell {
  max-width: none;
  margin: 0;
  padding: 0;
}

html.embed-mode .parliament-card {
  overflow: visible;
  border: 0;
  box-shadow: none;
}

html.embed-mode .map-header,
html.embed-mode .chamber-nav,
html.embed-mode .election-nav,
html.embed-mode .visualization-section,
html.embed-mode .format-section,
html.embed-mode .embedding-group,
html.embed-mode .map-footer,
html.embed-mode .details-panel,
html.embed-mode .details-open-button {
  display: none !important;
}

html.embed-mode .toolbar {
  display: flex;
  min-height: 84px;
  padding: 22px clamp(18px, 3.5vw, 48px);
  border-bottom: 1px solid var(--soft-rule);
}

html.embed-mode .data-label {
  font-size: clamp(1.35rem, 2.1vw, 1.85rem);
}

html.embed-mode .visual-grid,
html.embed-mode .visual-grid.is-details-collapsed {
  display: block;
  padding: clamp(18px, 3vw, 34px) clamp(18px, 3.5vw, 48px) 0;
}

html.embed-mode .chart-shell {
  width: min(100%, 1280px);
}

html.embed-mode .composition {
  padding: clamp(18px, 2.6vw, 30px) clamp(18px, 3.5vw, 48px) clamp(24px, 3vw, 38px);
}

html.embed-mode .composition-content {
  width: min(100%, 1280px);
}

@media (max-width: 760px) {
  html.embed-mode .toolbar {
    min-height: 72px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  html.embed-mode .visual-grid {
    padding-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}
