/* The split: the split button on every card (its twisting helix), the preview that grows
   out of it, the details dialog (curves, men and women, the map, the numbers), and the
   post page's split: the same tabs and panels, drawn by the server. */

/* ─── The split button ─────────────────────────────────────────────────── */

.split-pill { position: relative; margin-left: auto; gap: 0.4rem; padding: 0 0.75rem 0 0.625rem; }
.split-pill-label { font-size: 0.8125rem; }
.split-pill.is-locked .split-pill-label { color: var(--muted); }
.split-pill.is-open { background: var(--surface-2); color: var(--ink); }
/* On a profile, with its counts: who follows. */
.profile-stats .split-pill { margin-left: 0; }
.split-pill.is-notable .split-pill-label { color: var(--ink); font-weight: 600; }
/* Something stands out: a small dot over the helix. */
.split-pill.is-notable::after {
  content: '';
  position: absolute;
  top: 0.45rem;
  left: 2rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: currentColor;
  box-shadow: 0 0 0 2px var(--surface);
}

.helix { flex-shrink: 0; overflow: hidden; }
.helix path { fill: none; stroke: currentColor; stroke-linecap: round; }
.helix-a, .helix-b { stroke-width: 1.8; }
.helix-rungs { stroke-width: 1.3; opacity: 0.4; }
.helix-flow.is-muted { opacity: 0.3; }
/* Hovered, the strands twist: the pattern slides by one turn, seamlessly. */
.split-pill:hover .helix-flow, .split-pill:focus-visible .helix-flow, .split-pill.is-open .helix-flow { animation: helix-flow 1.6s linear infinite; }
.split-pill.is-crunching .helix-flow { animation: helix-flow 3.2s linear infinite; }
.split-pill:active .helix { transform: scale(0.92); }
.helix { transition: transform 0.15s; }

@keyframes helix-flow {
  to { transform: translateX(-24px); }
}

/* ─── The preview ──────────────────────────────────────────────────────── */

.split-blob {
  position: fixed;
  z-index: 35;
  width: min(20rem, calc(100vw - 1.5rem));
  border-radius: 24px;
  padding: 0.875rem 1rem;
  background:
    radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, var(--s1) 7%, transparent), transparent 62%),
    radial-gradient(120% 80% at 100% 100%, color-mix(in oklab, var(--s2) 7%, transparent), transparent 62%),
    var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--line);
}
.blob-head { display: flex; min-height: 1.5rem; align-items: center; justify-content: space-between; gap: 0.75rem; }
.blob-title { font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.blob-dots { display: flex; gap: 0.375rem; }
.blob-dot { height: 0.5rem; width: 0.5rem; border-radius: 9999px; background: var(--line-strong); transition: width 0.3s cubic-bezier(0.3, 0.9, 0.3, 1), background-color 0.3s; }
.blob-dot:hover { background: var(--muted); }
.blob-dot[aria-pressed='true'] { width: 1.25rem; background: var(--ink-2); }
.blob-plot { margin: 0.125rem -0.25rem 0; }
.blob-chart { display: block; width: 100%; height: auto; overflow: visible; }
.blob-middle { stroke: var(--ink-2); stroke-width: 1.3; stroke-dasharray: 0.5 4.5; stroke-linecap: round; opacity: 0.5; transition: opacity 0.4s; }
.blob-chart[data-view='age'] .blob-middle { opacity: 0; }
.blob-line { transition: stroke 0.5s; }
.blob-fill-rect { transform-box: fill-box; transform-origin: left center; }
/* An option's name riding its line, haloed in the card's colour so crossing lines never muddle it. */
.blob-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.18s;
}
.blob-label.is-on { opacity: 1; transition-duration: 0.4s; }
.blob-ruler { visibility: hidden; }
.blob-row-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.01em; text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.blob-labels text { font-family: var(--font-sans); animation: blob-fade 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.blob-labels { transition: opacity 0.22s; }
.blob-labels.is-leaving { opacity: 0; }
.blob-tick { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.blob-tick.is-middle { font-weight: 700; fill: var(--ink-2); }
.blob-tick.is-start { font-weight: 600; text-anchor: start; }
.blob-b { font-size: 0.82em; }
.blob-side { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; }
.blob-share { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; fill: var(--ink); }
.blob-share.is-left { text-anchor: end; }
.blob-caption { margin-top: 0.25rem; min-height: 2.25rem; font-size: 0.8125rem; line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }
.blob-title, .blob-caption { transition: opacity 0.17s, transform 0.17s; }
.blob-title.is-swapping, .blob-caption.is-swapping { opacity: 0; transform: translateY(3px); }
.blob-shimmer {
  display: block;
  margin-top: 0.375rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: bt-shimmer 1.4s linear infinite;
}
.blob-shimmer.is-short { width: 60%; }
/* A split that's in keeps one size from its first frame: three lines for every view's
   caption (and the loading shimmer), the footer laid out while the numbers load. */
.split-blob[data-phase='ready'] .blob-caption {
  display: -webkit-box;
  height: calc(3 * 1.4em);
  min-height: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.blob-shimmer.is-count { display: inline-block; width: 7.5rem; margin-top: 0; vertical-align: middle; }
.blob-count { transition: opacity 0.17s, transform 0.17s; }
.blob-count.is-swapping { opacity: 0; transform: translateY(3px); }
.blob-dot { animation: blob-dot-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes blob-dot-in { from { opacity: 0; transform: scale(0.4); } }
.blob-foot { margin-top: 0.75rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.blob-foot:empty { display: none; }
.blob-count { font-size: 0.75rem; color: var(--muted); }
.blob-details { gap: 0.375rem; }
.blob-note { font-size: 0.75rem; color: var(--muted); }
.blob-watch[aria-pressed='true'] { color: var(--link); }

@keyframes blob-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── The details ──────────────────────────────────────────────────────── */

.split-dialog {
  --map-base: var(--surface-3);
  width: min(46rem, calc(100vw - 2rem));
  max-width: none;
  max-height: min(54rem, calc(100dvh - 2rem));
  margin: auto;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2xl), 0 0 0 1px var(--line);
}
.split-dialog::backdrop { background: rgb(0 0 0 / 0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: bt-fade-in 0.3s both; }
.sd { display: flex; max-height: inherit; flex-direction: column; }
.sd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.25rem 0.875rem; }
.sd-kicker { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sd-title { margin-top: 0.25rem; font-family: var(--font-serif); font-size: 1.375rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; overflow-wrap: anywhere; }
.sd-meta { margin-top: 0.375rem; font-size: 0.75rem; color: var(--muted); }
.sd-close { margin: -0.375rem -0.5rem 0 0; flex-shrink: 0; }
.sd-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 1.25rem 1.25rem; }
.sd-loading, .sd-empty { display: grid; place-items: center; gap: 0.75rem; padding: 3rem 1rem; text-align: center; font-size: 0.875rem; color: var(--muted); }
.sd-empty-title { font-family: var(--font-serif); font-size: 1.125rem; font-weight: 600; color: var(--ink); }

.sd-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.25rem;
  background: var(--surface-2);
  outline: 0.5rem solid var(--surface);
}
.sd-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  height: 2.25rem;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s;
}
.sd-tab:hover { color: var(--ink); }
.sd-tab[aria-selected='true'] { font-weight: 600; color: var(--ink); }
.sd-tab-dot { height: 0.375rem; width: 0.375rem; border-radius: 9999px; background: var(--s2); }
.sd-tab-indicator {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0;
  border-radius: 9999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transition: transform 0.38s cubic-bezier(0.3, 0.9, 0.3, 1), width 0.38s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.sd-panel { display: flex; flex-direction: column; gap: 1rem; outline: none; }
.sd-panel:not(.is-active) { display: none; }
.sd-key { display: inline-block; height: 0.625rem; width: 0.625rem; flex-shrink: 0; border-radius: 9999px; }
.sd-callouts { display: flex; flex-direction: column; gap: 0.5rem; }
.sd-callout { display: flex; align-items: baseline; gap: 0.75rem; border-radius: 16px; background: var(--surface-2); padding: 0.75rem 1rem; }
.sd-callout p { font-size: 0.9375rem; line-height: 1.4; text-wrap: pretty; }
.sd-legend { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; font-size: 0.8125rem; color: var(--ink-2); }
.sd-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.sd-legend-label { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Curves. */
.sd-figure { position: relative; margin: 0; }
.sd-plot { position: relative; cursor: crosshair; border-radius: 12px; outline-offset: 4px; touch-action: pan-y; }
.sd-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sd-grid { stroke: var(--grid); stroke-width: 1; }
.sd-axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.sd-axis.is-middle { font-weight: 700; fill: var(--ink); }
.sd-axis-title { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; fill: var(--ink-2); }
.sd-b { font-size: 0.82em; }
.sd-middle { stroke: var(--ink-2); stroke-width: 1.3; stroke-dasharray: 0.5 4.5; stroke-linecap: round; opacity: 0.55; }
.sd-cursor { stroke: var(--line-strong); stroke-width: 1; transition: opacity 0.15s; }
.sd-line { fill: none; stroke: var(--c); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sd-line.is-drawing { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sd-draw 1.1s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; animation-delay: calc(var(--i) * 90ms); }
.sd-gap { stroke: var(--c); stroke-width: 1.6; stroke-dasharray: 2 5; stroke-linecap: round; opacity: 0.6; }
.sd-dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; transition: r 0.15s; }
.sd-dot.is-drawing { animation: blob-fade 0.4s both; animation-delay: calc(450ms + var(--i) * 90ms); }
.sd-dot.is-on { r: 5.5px; }
/* Each option's name riding its line, haloed so crossing lines never muddle it. */
.sd-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  fill: var(--c);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.sd-label.is-drawing { animation: blob-fade 0.45s both; animation-delay: calc(750ms + var(--i) * 90ms); }
.sd-ruler { visibility: hidden; }

@keyframes sd-draw {
  to { stroke-dashoffset: 0; }
}

.sd-readout {
  pointer-events: none;
  position: absolute;
  top: 0.25rem;
  left: 0;
  z-index: 3;
  min-width: 11rem;
  max-width: 16rem;
  border-radius: 14px;
  padding: 0.625rem 0.75rem;
  background: var(--surface);
  font-size: 0.8125rem;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
  opacity: 0;
  transition: opacity 0.15s;
}
.sd-readout.is-on { opacity: 1; }
.sd-readout-head { margin-bottom: 0.375rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.sd-readout-name { font-weight: 600; }
.sd-readout-n { font-size: 0.75rem; color: var(--muted); }
.sd-readout-note { font-size: 0.75rem; color: var(--muted); }
.sd-readout-rows { display: flex; flex-direction: column; gap: 0.25rem; }
.sd-readout-rows li { display: flex; align-items: center; gap: 0.5rem; }
.sd-readout-share { width: 2.5rem; flex-shrink: 0; font-weight: 700; }
.sd-readout-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sd-readout-ci { flex-shrink: 0; font-size: 0.6875rem; color: var(--muted); }

/* Men and women: each option's two bars grow out of the dotted middle. */
.sd-gender { margin: 0; display: flex; flex-direction: column; gap: 0.875rem; }
.sd-gender-head { display: grid; grid-template-columns: 1fr 1fr; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sd-gender-head .is-men { padding-right: 1rem; text-align: right; }
.sd-gender-head .is-women { padding-left: 1rem; }
.sd-gender-head small { margin-left: 0.375rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.sd-gender-row { display: flex; flex-direction: column; gap: 0.25rem; }
.sd-gender-label { display: flex; align-items: center; justify-content: center; gap: 0.4rem; font-size: 0.875rem; font-weight: 500; }
.sd-butterfly { position: relative; display: grid; height: 1.75rem; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.sd-butterfly::after { content: ''; position: absolute; top: -0.3rem; bottom: -0.3rem; left: 50%; border-left: 1.5px dotted color-mix(in oklab, var(--ink-2) 60%, transparent); }
.sd-half { position: relative; }
.sd-bar { position: absolute; top: 0.25rem; bottom: 0.25rem; width: var(--w); border-radius: 9999px; background: var(--c); animation: bt-grow-x 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay); }
.sd-half.is-men .sd-bar { right: 0; transform-origin: right center; }
.sd-half.is-women .sd-bar { left: 0; transform-origin: left center; }
.sd-pct { position: absolute; top: 50%; translate: 0 -50%; font-size: 0.8125rem; font-weight: 700; animation: blob-fade 0.4s both; animation-delay: calc(var(--delay) + 350ms); }
.sd-half.is-men .sd-pct { right: calc(var(--w) + 0.5rem); }
.sd-half.is-women .sd-pct { left: calc(var(--w) + 0.5rem); }
.sd-gender-other, .sd-caption { text-align: center; font-size: 0.8125rem; color: var(--muted); }

/* Countries: the map, its colour scale and the list with every country. */
.sd-countries-view { margin: 0; display: flex; flex-direction: column; gap: 0.875rem; }
.sd-pick { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.sd-chip {
  display: inline-flex;
  height: 2rem;
  align-items: center;
  gap: 0.4rem;
  border-radius: 9999px;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.sd-chip:hover { color: var(--ink); }
.sd-chip[aria-checked='true'] { background: color-mix(in oklab, var(--c) 14%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--c); }
.sd-map { position: relative; display: grid; aspect-ratio: 2000 / 890; place-items: center; overflow: hidden; border-radius: 16px; background: color-mix(in oklab, var(--surface-2) 65%, var(--surface)); }
.sd-map-svg { display: block; height: 100%; width: 100%; }
.sd-land { fill: var(--map-base); opacity: 0.7; }
.sd-country-shape { fill: var(--map-base); stroke: var(--surface); stroke-width: 0.8; vector-effect: non-scaling-stroke; transition: fill 0.45s; }
.sd-country-shape.has-data { cursor: pointer; }
.sd-country-shape.is-hot { stroke: var(--ink); stroke-width: 1.6; }
.sd-country-dot { stroke-width: 1.4; }
.sd-map-readout { top: 0.5rem; left: 0.5rem; }
.sd-scale { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted); }
.sd-scale-bar { height: 0.5rem; width: 9rem; border-radius: 9999px; }
.sd-scale-label { color: var(--ink-2); }
.sd-countries { display: flex; flex-direction: column; }
.sd-country {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) 3rem minmax(4rem, 8rem) 2.75rem;
  align-items: center;
  gap: 0.625rem;
  border-top: 1px solid var(--line);
  padding: 0.5rem 0.25rem;
  font-size: 0.875rem;
}
.sd-country:first-child { border-top: 0; }
.sd-country:hover { background: var(--surface-2); }
.sd-country.is-muted { color: var(--muted); }
.sd-flag { font-size: 1.125rem; line-height: 1; }
.sd-country-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-country-n { text-align: right; font-size: 0.75rem; color: var(--muted); }
.sd-country-bar { display: flex; height: 0.5rem; overflow: hidden; border-radius: 9999px; background: var(--surface-2); }
.sd-country-bar > span { flex-basis: 0; }
/* One option (an audience): each country's bar is its share of the biggest's. */
.sd-countries.is-single .sd-country-bar > span { flex: none; border-radius: 9999px; }
.sd-country-bar.is-empty { height: auto; background: none; font-size: 0.75rem; font-style: italic; }
.sd-country-share { text-align: right; font-weight: 600; }

/* The numbers, notes, how to read. */
.sd-notes { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; color: var(--muted); }
.sd-notes p { display: flex; gap: 0.5rem; }
.sd-notes .icon { margin-top: 0.125rem; flex-shrink: 0; }
.sd-numbers { border-radius: 14px; background: var(--surface-2); padding: 0.625rem 0.875rem; }
.sd-numbers summary { display: flex; cursor: pointer; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); list-style: none; }
.sd-numbers summary::-webkit-details-marker { display: none; }
.sd-numbers[open] summary { margin-bottom: 0.625rem; }
.sd-numbers .data-table-wrap { background: var(--surface); }
.sd-numbers-note { margin-top: 0.5rem; font-size: 0.75rem; color: var(--muted); }
.sd-how { margin-top: 1.25rem; }

@media (max-width: 640px) {
  .split-dialog { width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .sd-head { padding: 1rem 1rem 0.625rem; }
  .sd-body { padding: 0 1rem 1.5rem; }
  .sd-title { font-size: 1.1875rem; }
  .sd-tab { font-size: 0.8125rem; }
  .sd-country { grid-template-columns: 1.5rem minmax(0, 1fr) 2.5rem 3.5rem 2.5rem; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .helix-flow, .split-pill .helix-flow { animation: none !important; }
  .sd-line.is-drawing, .sd-dot.is-drawing, .sd-label.is-drawing, .sd-bar, .sd-pct, .blob-labels text, .blob-dot { animation: none; stroke-dashoffset: 0; }
  .sd-tab-indicator { transition: none; }
}

/* ─── The split on the post page ───────────────────────────────────────── */
/* The details' tabs and panels, in the page (partials/split.html). Every panel is in the
   HTML, for search engines and readers without a script; one shows at a time, so the
   replies stay a short scroll away. The server draws the curves (split-*), the details
   draw theirs (sd-*): one look. */

.split { display: flex; flex-direction: column; gap: 1rem; scroll-margin-top: 5rem; }
.split-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; }
.split-head h2 { font-family: var(--font-serif); font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.025em; }
.split-meta { font-size: 0.75rem; color: var(--muted); }
.split-card { --map-base: var(--surface-3); display: flex; flex-direction: column; border-radius: 24px; padding: 1rem 1.25rem 1.25rem; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.split-card .sd-tabs { position: relative; outline: 0; }
/* In the details dialog, the card is the dialog's body: its tabs stay put while it scrolls. */
.split-dialog .split-card { padding: 0; border-radius: 0; background: none; box-shadow: none; }
.split-dialog .split-card .sd-tabs { position: relative; outline: 0; }
.split-dialog .split-card .sd-select { position: sticky; top: 0; z-index: 4; background: var(--surface); box-shadow: 0 -0.5rem 0 var(--surface), 0 0.5rem 0 var(--surface); }
.split-card .sd-panel { scroll-margin-top: 9rem; }
.sd-tab-lock { display: inline-flex; color: var(--muted); }
/* Each panel's name, for screen readers and search engines (the tab shows it). */
.split-panel-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.split-members { padding: 1.5rem 0.5rem 1rem; }
.split-members p:not(.sd-empty-title) { max-width: 30rem; }
.split-map:empty { display: none; }

/* Until the script takes over, the chosen tab carries its own highlight, and the tabs are
   links: the panel the address points at shows. */
.split-card:not(.is-live) .sd-tab.is-selected { background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); font-weight: 600; color: var(--ink); }
.split-card:not(.is-live) .split-panels:has(> .sd-panel:target) > .sd-panel { display: none; }
.split-card:not(.is-live) .split-panels:has(> .sd-panel:target) > .sd-panel:target { display: flex; }
.split-card:not(.is-live):has(.sd-panel:target) .sd-tab.is-selected { background: none; box-shadow: none; font-weight: 500; color: var(--ink-2); }
.split-card:not(.is-live):has(.sd-panel[data-dim='iq']:target) .sd-tab[data-dim='iq'],
.split-card:not(.is-live):has(.sd-panel[data-dim='gender']:target) .sd-tab[data-dim='gender'],
.split-card:not(.is-live):has(.sd-panel[data-dim='age']:target) .sd-tab[data-dim='age'],
.split-card:not(.is-live):has(.sd-panel[data-dim='country']:target) .sd-tab[data-dim='country'] { background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); font-weight: 600; color: var(--ink); }

/* Without a script: every panel, one after the other, under its name. */
@media (scripting: none) {
  .split-card .sd-select { display: none; }
  .split-card .sd-panel { display: flex; }
  .split-card .sd-panel + .sd-panel { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
  .split-panel-title { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-family: var(--font-serif); font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.01em; }
}

.insights { display: flex; flex-direction: column; gap: 0.5rem; }
.insight { display: flex; align-items: baseline; gap: 0.75rem; border-radius: 16px; background: var(--surface-2); padding: 0.75rem 1rem; }
.insight p { font-size: 0.9375rem; line-height: 1.4; color: var(--ink); text-wrap: pretty; }
.insight-key { height: 0.625rem; width: 0.625rem; flex-shrink: 0; border-radius: 9999px; transform: translateY(-1px); }

/* The server's curves: a wide and a narrow drawing, whichever suits the card's width. */
.split-chart { position: relative; container-type: inline-size; border-radius: 12px; outline-offset: 4px; }
.split-chart-wide { display: none; }
@container (min-width: 30rem) {
  .split-chart-wide { display: block; }
  .split-chart-narrow { display: none; }
}
.split-card.is-live .split-chart { cursor: crosshair; touch-action: pan-y; }
.split-svg { display: block; height: auto; width: 100%; overflow: visible; }
.split-svg .split-grid { stroke: var(--grid); stroke-width: 1; }
.split-axis { font-family: var(--font-sans); font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.split-axis.is-middle { font-weight: 700; fill: var(--ink); }
.split-axis-title { font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; fill: var(--ink-2); }
.split-b { font-size: 0.82em; }
.split-middle { stroke: var(--ink-2); stroke-width: 1.3; stroke-dasharray: 0.5 4.5; stroke-linecap: round; opacity: 0.55; }
.split-cursor { stroke: var(--line-strong); stroke-width: 1; transition: opacity 0.15s; }
.split-line { fill: none; stroke: var(--c); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* An audience's one line stands on filled ground. */
.split-area { fill: color-mix(in oklab, var(--c) 14%, transparent); stroke: none; }
.split-gap { stroke: var(--c); stroke-width: 1.6; stroke-dasharray: 2 5; stroke-linecap: round; opacity: 0.6; }
.split-dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; transition: r 0.15s; }
.split-dot.is-on { r: 5.5px; }
.split-label { font-family: var(--font-sans); font-size: 12px; font-weight: 700; fill: var(--c); text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 3.5px; stroke-linejoin: round; }
/* A chart shown again draws itself in, as the details' do. */
.split-svg.is-drawing .split-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sd-draw 1.1s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; animation-delay: calc(var(--i) * 90ms); }
.split-svg.is-drawing .split-dot, .split-svg.is-drawing .split-area { animation: blob-fade 0.4s both; animation-delay: calc(450ms + var(--i) * 90ms); }
.split-svg.is-drawing .split-label { animation: blob-fade 0.45s both; animation-delay: calc(750ms + var(--i) * 90ms); }

@media (prefers-reduced-motion: reduce) {
  .split-svg.is-drawing .split-line, .split-svg.is-drawing .split-dot, .split-svg.is-drawing .split-area, .split-svg.is-drawing .split-label { animation: none; stroke-dashoffset: 0; }
}

.how-to { border-radius: 0.75rem; background: var(--surface-2); padding: 0.75rem 1rem; font-size: 0.875rem; }
.how-to summary { display: flex; cursor: pointer; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--ink-2); list-style: none; }
.how-to summary::-webkit-details-marker { display: none; }
.how-to-body { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; line-height: 1.625; color: var(--muted); }
.how-to-body strong { font-weight: 500; color: var(--ink-2); }

.data-table-wrap { overflow-x: auto; border-radius: 0.75rem; box-shadow: 0 0 0 1px var(--line); }
.data-table { width: 100%; min-width: 28rem; text-align: left; font-size: 0.875rem; }
.data-table thead { background: var(--surface-2); font-size: 0.75rem; color: var(--muted); }
.data-table th, .data-table td { padding: 0.5rem 0.75rem; }
.data-table thead th { font-weight: 500; }
.data-table tbody tr { border-top: 1px solid var(--line); }
.data-table tbody th { font-weight: 500; color: var(--ink); }
.data-table td { color: var(--ink); }
.data-table .num { text-align: right; }
.data-table td.is-muted { color: var(--muted); }
.data-table .is-italic { font-style: italic; }
.data-table-ci { font-size: 0.75rem; color: var(--muted); }
.data-table-key { display: inline-flex; align-items: center; gap: 0.375rem; }

/* ─── The map: drag, pinch and zoom (js/lib/pan-zoom.js) ─────────────────── */

/* One finger scrolls the page until the map is zoomed in; then it moves the map. */
.sd-map { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.sd-map.is-zoomed { touch-action: none; }
.sd-map.is-dragging, .sd-map.is-dragging .sd-country-shape { cursor: grabbing; }
.sd-map .sd-country-shape.has-data { cursor: inherit; }
.sd-map:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sd-zoom {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}
.sd-zoom-btn { display: grid; height: 2rem; width: 2rem; place-items: center; color: var(--ink-2); transition: background-color 0.15s, color 0.15s; }
.sd-zoom-btn + .sd-zoom-btn { border-top: 1px solid var(--line); }
.sd-zoom-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.sd-zoom-btn:disabled { cursor: default; opacity: 0.35; }
.sd-map-hint {
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--ink) 38%, transparent);
  color: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s;
}
.sd-map-hint.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sd-map-hint { transition: none; } }

/* ─── The optional questions ───────────────────────────────────────────── */
/* Under the tabs, a member's card has a chip per question its split is published by ("More
   about who answered"), the row scrolling sideways; picked, the question's panel shows in
   the tabs' place: a dot plot, a row per group (site::curves::dots_chart_svg), drawn with
   the curves' own marks, which the apps draw too. */

.sd-qtabs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.375rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  /* Room inside the scroller for the chips' focus rings. */
  margin: -0.1875rem;
  padding: 0.1875rem;
  scroll-padding-inline: 1.5rem;
}
.sd-qtabs::-webkit-scrollbar { display: none; }
.sd-qtabs-label { flex: none; margin-right: 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sd-qtab { flex: none; height: 1.875rem; white-space: nowrap; }
.sd-qtab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sd-qtab[aria-selected='true'] { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--ink-2); }

/* The dot plot: each group's name at its row's left, a faint bar between a row's answers. */
.split-name { fill: var(--ink-2); font-variant-numeric: normal; }
.split-few { font-style: italic; }
.split-dots .split-span { stroke-dasharray: none; stroke-width: 3; opacity: 0.3; }
.split-dots .split-dot.is-on { r: 6.5px; }

/* A question crossed with a dimension: its groups' names need a wider spine; crossed with
   country, the table is the whole view. */
.sd-pyramid.is-groups { --spine: 10rem; }
.sd-x[data-view='table'] .sd-x-variant .sd-x-table { display: flex; }
@media (max-width: 640px) {
  .sd-pyramid.is-groups { --spine: 7rem; }
}

/* ─── Crossing two splits ──────────────────────────────────────────────── */
/* The card's tab row ends with the cross button; it drops a second, lighter row ("× bIQ").
   Picked there, the panel becomes the split by both (partials/split_cross.html, drawn by
   site::split_cross; components/split-cross.js reads it). */

.sd-select { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.375rem; }
.sd-select .sd-tabs { margin-bottom: 0; }
.sd-row { display: flex; align-items: center; gap: 0.5rem; }
.sd-row > .sd-tabs { min-width: 0; flex: 1; }
.sd-row-2[hidden] { display: none; }
.sd-cross-btn {
  display: grid;
  height: 2.5rem;
  width: 2.5rem;
  flex: none;
  place-items: center;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--ink-2);
  transition: background-color 0.15s, color 0.15s;
}
.sd-cross-btn:hover { color: var(--ink); background: var(--surface-3); }
.sd-cross-btn svg { transition: transform 0.32s cubic-bezier(0.3, 0.9, 0.3, 1); }
.sd-cross-btn[aria-expanded='true'] { color: var(--ink); }
.sd-cross-btn[aria-expanded='true'] svg { transform: rotate(180deg); }
.sd-x-mark { width: 2.5rem; flex: none; text-align: center; font-size: 1.125rem; line-height: 1; color: var(--muted); }
/* The second row: the same tabs, lighter. */
.sd-tabs.sd-tabs-2 { padding: 0.1875rem; background: none; box-shadow: inset 0 0 0 1px var(--line); }
.sd-tabs-2 .sd-tab { height: 2rem; font-size: 0.8125rem; color: var(--muted); }
.sd-tabs-2 .sd-tab:hover { color: var(--ink); }
.sd-tabs-2 .sd-tab[aria-pressed='true'] { font-weight: 600; color: var(--ink); }
.sd-tabs-2 .sd-tab-indicator { top: 0.1875rem; bottom: 0.1875rem; background: var(--surface-2); box-shadow: none; transition: transform 0.38s cubic-bezier(0.3, 0.9, 0.3, 1), width 0.38s cubic-bezier(0.3, 0.9, 0.3, 1), opacity 0.2s; }
.sd-tab-indicator.is-off { opacity: 0; }
.sd-tabs-2 .sd-tab:focus-visible, .sd-cross-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* What a cross shows, in place of the panels. */
.sd-cross-host { display: flex; flex-direction: column; }
.sd-cross-host:not(.is-active) { display: none; }
.sd-cross-host > [hidden] { display: none; }
.sd-x-loading { display: flex; flex-direction: column; gap: 0.875rem; padding-top: 0.25rem; }
.sd-x-shimmer { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: bt-shimmer 1.4s linear infinite; }
.sd-x-shimmer.is-title { height: 1.25rem; width: 40%; }
.sd-x-shimmer.is-chart { min-height: 12rem; flex: 1; }
.sd-x-shimmer.is-line { height: 0.75rem; width: 70%; }

.sd-x { display: flex; flex-direction: column; gap: 1rem; }
.sd-x-head { display: flex; min-height: 2rem; align-items: center; gap: 0.25rem; }
.sd-x-title { margin-right: auto; font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.sd-x-swap { display: grid; height: 2rem; width: 2rem; place-items: center; border-radius: 9999px; color: var(--ink-2); transition: background-color 0.15s, color 0.15s; }
.sd-x-swap:hover { background: var(--surface-2); color: var(--ink); }
.sd-x-mode { display: inline-flex; align-items: center; margin-left: 0.25rem; font-size: 0.8125rem; }
.sd-x-mode button { padding: 0.25rem 0.375rem; color: var(--muted); transition: color 0.15s; }
.sd-x-mode button + button::before { content: '\00B7'; margin-right: 0.5rem; margin-left: -0.125rem; color: var(--muted); font-weight: 400; }
.sd-x-mode button:hover { color: var(--ink); }
.sd-x-mode button[aria-pressed='true'] { color: var(--ink); font-weight: 600; }
.sd-x-empty { padding: 2rem 0.5rem; }
.sd-x-variant { --fc2: color-mix(in oklab, var(--fc) 52%, var(--ink)); --fc3: color-mix(in oklab, var(--fc) 45%, var(--surface)); display: flex; flex-direction: column; gap: 0.75rem; }
.sd-x-variant[hidden] { display: none; }
.sd-x.is-table .sd-x-chart, .sd-x:not(.is-table) .sd-x-table { display: none; }
.sd-x-chart, .sd-x-table { position: relative; display: flex; flex-direction: column; gap: 0.75rem; }
.sd-x-caption { font-size: 0.8125rem; line-height: 1.45; color: var(--muted); text-wrap: pretty; }

/* Lines: men and women part from everyone's line, the faint one behind. */
.split-ghost { fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-key.is-ghost { height: 0.1875rem; width: 0.875rem; border-radius: 2px; }
.split-svg.is-parting .split-dot, .split-svg.is-parting .split-label { animation: blob-fade 0.45s both; animation-delay: 0.6s; }

/* The ridgeline: a row per group, the nearer in front, all on one scale. */
.sd-ridgebox { outline-offset: 4px; }
.sd-ridge-base { stroke: color-mix(in oklab, var(--c) 30%, var(--line)); stroke-width: 1; }
.sd-ridge-area { fill: color-mix(in oklab, var(--c) 16%, var(--surface)); }
.sd-ridge-line { fill: none; stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke-width 0.15s; }
.sd-ridge-stem { stroke: var(--c); stroke-width: 2.2; stroke-linecap: round; }
.sd-ridge-dot { stroke-width: 1.5; }
.sd-ridge-label { font-family: var(--font-sans); font-size: 11px; fill: var(--ink-2); font-variant-numeric: tabular-nums; transition: fill 0.15s; }
.sd-ridge { transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sd-ridge.is-lift { transform: translateY(-4px); }
.sd-ridge.is-lift .sd-ridge-line { stroke-width: 3; }
.sd-ridge.is-lift .sd-ridge-label { fill: var(--ink); font-weight: 700; }
.sd-ridge-shape { transform-box: fill-box; transform-origin: 50% 100%; animation: sd-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 70ms); }
.sd-ridge-scale line { stroke: var(--muted); stroke-width: 1; }
.sd-ridge-scale text { font-family: var(--font-sans); font-size: 10px; fill: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes sd-rise { from { transform: scaleY(0.05); opacity: 0.4; } }

/* Greyed: too few to show safely. */
.sd-hatch-ground { fill: var(--surface-2); }
.sd-hatch-line { stroke: var(--line-strong); stroke-width: 1.6; }
.sd-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Small multiples: a small chart per country on hairlines, one scale. */
.sd-multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 1.125rem 1.25rem; }
.sd-multiple { display: flex; min-width: 0; flex-direction: column; gap: 0.25rem; border-top: 1px solid var(--line); padding-top: 0.5rem; animation: blob-fade 0.4s both; animation-delay: calc(var(--i) * 35ms); }
.sd-multiple-head { display: flex; align-items: baseline; gap: 0.375rem; font-size: 0.8125rem; }
.sd-multiple-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sd-multiples-thin { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.875rem; margin-top: 0.875rem; border-top: 1px solid var(--line); padding-top: 0.625rem; font-size: 0.8125rem; color: var(--muted); }
.sd-multiples-thin-label { font-weight: 600; color: var(--ink-2); }
.sd-multiples-thin-item { display: inline-flex; align-items: baseline; gap: 0.3rem; white-space: nowrap; }
.sd-multiples-thin-item .tabular { font-size: 0.75rem; opacity: 0.8; }
.sd-multiple-n { flex: none; font-size: 0.75rem; color: var(--muted); }
.sd-multiple-chart { position: relative; border-radius: 8px; outline-offset: 3px; cursor: crosshair; touch-action: pan-y; }
.sd-mini { display: block; height: auto; width: 100%; overflow: visible; }
.sd-mini .split-line { stroke-width: 2.2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: sd-draw 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; animation-delay: calc(var(--i, 0) * 35ms + 120ms); }
.sd-mini .split-dot { animation: blob-fade 0.35s both; animation-delay: calc(var(--i, 0) * 35ms + 500ms); }
.sd-mini .split-axis { font-size: 10px; }
.sd-bar-shape { fill: var(--c); }
.sd-bar-value { font-family: var(--font-sans); font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.sd-bar-value.is-hidden { fill: var(--muted); font-weight: 500; }
.sd-bar-label { font-family: var(--font-sans); fill: var(--muted); }

/* The pyramid: men to the left, women to the right of the groups' names. */
.sd-pyramid { --spine: 5rem; position: relative; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; border-radius: 12px; outline-offset: 4px; }
.sd-pyramid.is-countries { --spine: 8.5rem; }
.sd-pyramid .sd-gender-head { grid-template-columns: 1fr var(--spine) 1fr; margin-bottom: 0.25rem; }
.sd-pyramid .sd-gender-head .is-women { grid-column: 3; }
.sd-pyr-row { display: grid; height: 1.75rem; grid-template-columns: 1fr var(--spine) 1fr; align-items: center; border-radius: 6px; transition: background-color 0.15s; }
.sd-pyr-row.is-on { background: var(--surface-2); }
.sd-pyr-label { overflow: hidden; padding: 0 0.375rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sd-pyr-row.is-on .sd-pyr-label { color: var(--ink); font-weight: 600; }
.sd-pyramid .sd-half { height: 100%; }
.sd-pyramid .sd-bar { top: 0.3rem; bottom: 0.3rem; border-radius: 4px; background: var(--fc); animation: sd-bar-part 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: var(--delay); }
.sd-pyramid .sd-pct { font-size: 0.75rem; animation-delay: calc(var(--delay) + 300ms); }
.sd-pyramid .sd-half.is-hidden { --w: 1.25rem; }
.sd-pyramid .sd-half.is-hidden .sd-pct { font-weight: 500; color: var(--muted); }
.sd-pyr-stub { position: absolute; top: 0.45rem; bottom: 0.45rem; width: 1.25rem; border-radius: 3px; background: repeating-linear-gradient(45deg, var(--surface-3) 0 2px, transparent 2px 5px); }
.sd-half.is-men .sd-pyr-stub { right: 0; }
.sd-half.is-women .sd-pyr-stub { left: 0; }
@keyframes sd-bar-part { from { transform: scaleX(var(--from, 0)); } }

/* The crossed map: each country's own chart over it once it's big enough. */
.sd-x-mapbox { --fc2: color-mix(in oklab, var(--fc) 52%, var(--ink)); gap: 0.75rem; container-type: inline-size; }
/* On a small map, a country's readout is its name and count: its chart is over it and in the list. */
@container (max-width: 30rem) {
  .sd-x-map-chart { display: none; }
  .sd-x-map-readout { min-width: 0; max-width: 11rem; padding: 0.375rem 0.5rem; font-size: 0.75rem; }
  .sd-x-map-readout .sd-readout-head { margin-bottom: 0; flex-direction: column; align-items: flex-start; gap: 0; }
}
.sd-overlay { pointer-events: none; }
.sd-glyph { transition: opacity 0.2s; }
.sd-glyph-plate { fill: var(--surface); fill-opacity: 0.9; }
.sd-mini.is-glyph .split-line, .sd-mini.is-glyph .split-grid, .sd-mini.is-glyph .split-middle { vector-effect: non-scaling-stroke; }
.sd-mini.is-glyph .split-dot { stroke-width: 1.5; }
.sd-map-note {
  pointer-events: none;
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  max-width: calc(100% - 1rem);
  overflow: hidden;
  border-radius: 8px;
  padding: 0.1875rem 0.5rem;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  opacity: 0;
  transition: opacity 0.25s;
}
.sd-map-note.is-on { opacity: 1; }
.sd-x-map-readout { max-width: 15rem; }
.sd-x-map-chart { margin-top: 0.25rem; }
.sd-x-map-chart svg { display: block; height: auto; width: 13rem; max-width: 100%; }
.sd-x-countries { display: flex; flex-direction: column; }
.sd-x-country {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) 3rem 5.5rem 2.75rem;
  align-items: center;
  gap: 0.625rem;
  border-top: 1px solid var(--line);
  padding: 0.25rem 0.25rem;
  font-size: 0.875rem;
}
.sd-x-country:first-child { border-top: 0; }
.sd-x-country[role='button'] { cursor: pointer; }
.sd-x-country[role='button']:hover { background: var(--surface-2); }
.sd-x-country[role='button']:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sd-x-country.is-muted { color: var(--muted); }
.sd-x-country-glyph svg { display: block; height: auto; width: 100%; }
.sd-x-country-glyph .sd-glyph-plate { fill: none; }
.sd-x-country-none { font-size: 0.6875rem; line-height: 1.25; font-style: italic; color: var(--muted); }

/* The table: each cell tinted by its share, greyed where hidden. */
.sd-heat-wrap { outline-offset: 3px; }
.sd-heat td { background: color-mix(in oklab, var(--fc) var(--t, 0%), var(--surface)); transition: background-color 0.3s; }
.sd-heat td.is-hidden { background: repeating-linear-gradient(45deg, var(--surface-2) 0 3px, var(--surface) 3px 7px); color: var(--muted); }
.sd-heat td.is-on { box-shadow: inset 0 0 0 2px var(--ink); }
.sd-heat .sd-heat-head { padding-bottom: 0; text-align: center; font-weight: 600; color: var(--ink-2); }
.sd-heat thead tr + tr th { padding-top: 0.25rem; }
.sd-heat abbr { text-decoration: none; }
.sd-heat th { white-space: nowrap; }
.sd-heat tbody tr { animation: blob-fade 0.35s both; }

/* The Pro panel, in place of a cross: an invented ridgeline, what Pro gives, the way in. */
.sd-pro { display: flex; flex-direction: column; align-items: center; gap: 0.875rem; padding: 1rem 0.5rem 1.5rem; text-align: center; }
.sd-pro-art { height: auto; width: min(17.5rem, 80%); }
.sd-pro-art g { transform-box: fill-box; transform-origin: 50% 100%; animation: sd-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 80ms); }
.sd-pro-area { fill: color-mix(in oklab, var(--pro) 14%, var(--surface)); }
.sd-pro-line { fill: none; stroke: var(--pro); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-pro-middle { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 0.5 4; stroke-linecap: round; opacity: 0.5; }
.sd-pro-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.sd-pro-list { display: flex; max-width: 26rem; flex-direction: column; gap: 0.625rem; text-align: left; font-size: 0.875rem; line-height: 1.45; color: var(--ink-2); }
.sd-pro-list li { display: flex; align-items: flex-start; gap: 0.625rem; }
.sd-pro-list strong { font-weight: 600; color: var(--ink); }
.sd-pro-icon { display: grid; height: 1.25rem; width: 1.5rem; flex: none; place-items: center; color: var(--pro); }
.sd-pro-icon .pro-badge { margin: 0; }
.sd-pro-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

@media (max-width: 640px) {
  .sd-x-country { grid-template-columns: 1.5rem minmax(0, 1fr) 2.5rem 4.5rem 2.5rem; gap: 0.5rem; }
  .sd-multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.875rem; }
  .sd-pyramid.is-countries { --spine: 6.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sd-ridge-shape, .sd-multiple, .sd-mini .split-line, .sd-mini .split-dot, .sd-pyramid .sd-bar, .sd-pyramid .sd-pct, .sd-pro-art g, .sd-heat tbody tr,
  .split-svg.is-parting .split-dot, .split-svg.is-parting .split-label { animation: none; stroke-dashoffset: 0; }
  .sd-cross-btn svg, .sd-ridge, .sd-tabs-2 .sd-tab-indicator { transition: none; }
}
