/* Shared canonical results surface. */
.chart-segment-hover{overflow:visible}
.chart-segment{transform-box:fill-box;transform-origin:center;transition:transform 120ms ease,filter 120ms ease}
.chart-segment--active{transform:scaleY(1.8);filter:brightness(1.08) drop-shadow(0 1px 2px rgb(0 0 0 / 25%));stroke:#243746;stroke-width:1.2px;vector-effect:non-scaling-stroke}
circle.chart-segment--active{transform:scale(1.5)}
.analysis-view__line:has(.chart-segment--active){position:relative;z-index:2}
.chart-segment-tooltip{position:fixed;inset:auto;margin:0;box-sizing:border-box;max-width:min(25rem,calc(100vw - 24px));padding:.7rem .9rem;border:1px solid #a9b6c2;border-radius:8px;background:var(--ui-surface, #fff);color:var(--ui-ink, #172d3e);box-shadow:0 6px 24px rgb(17 36 53 / 22%);font:500 .875rem/1.5 system-ui,sans-serif;white-space:pre-line;pointer-events:none}
.chart-segment-tooltip strong{display:block;margin-bottom:.2rem;font-weight:700}
@media(prefers-reduced-motion:reduce){.chart-segment{transition:none}}
/* Section scroll-margin already accounts for the sticky toolbar. */
html:has(.single-page-prototype){scroll-padding-top:0}
.single-page-prototype .analysis-controls__views{display:flex;flex-wrap:wrap;overflow:visible;border:0;background:none}
.single-page-prototype .analysis-controls__views .result-view-selector__tab{flex:0 1 auto;white-space:normal;overflow:visible;text-overflow:clip;min-height:2rem}
.single-page-prototype .b2-control-trigger__label{white-space:normal;overflow:visible;text-overflow:clip}
@media(max-width:719px){
 .single-page-prototype .analysis-controls__views{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:.25rem}
 .single-page-prototype .analysis-controls__views .result-view-selector__tab{padding:.25rem .4rem;font-size:.76rem;white-space:normal}
 .single-page-prototype .single-page-prototype__toolbar .b2-control-trigger{padding-right:1.9rem;font-size:.74rem}
 .single-page-prototype .single-page-prototype__toolbar .b2-control-toolbar{width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}
}
.analysis-controls{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .7rem;width:100%;min-width:0}
.analysis-heading{width:100%;margin:0}
.analysis-heading h2{font:600 1.2rem/1.2 var(--font-sans);margin:0}
.analysis-heading p{font-size:.74rem;color:var(--color-muted);margin:.2rem 0 0}
.analysis-heading[hidden]{display:none}
.statement-analysis-dialog .analysis-heading,.statement-analysis-dialog .analysis-controls__order,.statement-analysis-dialog .analysis-controls__exit{display:none!important}
.statement-analysis-comparison{border:1px solid var(--color-rule);border-radius:4px;background:var(--color-paper);padding:.75rem}
.statement-analysis-comparison .ryhmavertailu-view__subject{font:600 1rem/1.3 var(--font-sans)}
@media(max-width:719px){
 .results-page .statement-analysis-dialog .statement-focus-header{gap:.2rem;padding:.1rem 0 .5rem}
 .results-page .statement-analysis-dialog .statement-analysis-dialog__controls{margin:.4rem 0 .5rem}
 .results-page .statement-analysis-dialog .results-toolbar--compact .results-toolbar-global{
   display:grid;align-items:stretch;gap:.25rem;padding:.25rem;
   grid-template-columns:minmax(0,.85fr) minmax(0,1.35fr) minmax(0,1fr) max-content;
   grid-template-areas:"filters compare tools population";
 }
 .results-page .statement-analysis-dialog .results-toolbar-global > .b2-control-group{min-width:0}
 .results-page .statement-analysis-dialog .results-toolbar-global :is(.b2-control-group > .b2-control-trigger,.results-tools-trigger){
   box-sizing:border-box;width:100%!important;
   padding:.2rem 1rem .2rem .35rem!important;
 }
 .results-page .statement-analysis-dialog .results-toolbar-global .b2-control-trigger::after{right:.35rem}
 .results-page .statement-analysis-dialog .results-toolbar-global > .analysis-population{
   justify-self:end;align-self:center;margin:0;width:auto;white-space:nowrap;
 }
 .results-page .statement-analysis-dialog .statement-analysis-comparison{border:0;padding:0}
 .results-page .statement-analysis-dialog .statement-analysis-comparison .ryhmavertailu-view__heading{
   flex-direction:row;align-items:center;gap:.45rem;
 }
 .results-page .statement-analysis-dialog .statement-analysis-comparison .ryhmavertailu-view__subject{font-size:.9rem}
 .results-page .statement-analysis-dialog .statement-analysis-comparison .ryhmavertailu-view__exit{
   align-self:center;min-height:2.25rem;padding:.2rem .35rem;border:0;
   color:var(--color-accent);font-size:.8rem;text-decoration:underline;text-underline-offset:.15em;
 }
 .results-page .statement-analysis-dialog .statement-analysis-comparison .analysis-view__note{margin:.22rem 0 .35rem}
 .results-page .statement-analysis-dialog .statement-analysis-comparison .analysis-view__legend{margin-block:.3rem}
 .results-page .statement-analysis-dialog .statement-analysis-comparison .analysis-view__statement{padding-top:.25rem}
}
.single-page-prototype__question .single-page-prototype__question-head h2{font:500 1.05rem/1.35 var(--font-sans)}
.single-page-prototype__question-head .single-page-prototype__question-n{display:none}
.analysis-controls [hidden],.results-toolbar-presentation [hidden],.analysis-view [hidden]{display:none!important}
.analysis-controls__context{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .7rem;width:100%;font-size:.82rem}
.analysis-controls fieldset,.results-toolbar-presentation fieldset{border:0;padding:0;margin:0;min-width:0}
.analysis-controls__modes,.analysis-controls__views{display:flex;flex-wrap:wrap;gap:.25rem}
.analysis-controls label,.results-toolbar-presentation label{display:flex;align-items:center;gap:.25rem;min-width:0}
.analysis-controls__views label{cursor:pointer;padding:.3rem .55rem;border:1px solid var(--color-rule);border-radius:4px;font-size:.84rem}
.analysis-controls__views label:has(:checked){background:var(--color-accent-soft);border-color:var(--color-accent);color:var(--color-accent)}
.analysis-controls input,.results-toolbar-presentation input{margin:0;accent-color:var(--color-accent)}
.analysis-controls select,.results-toolbar-presentation select{max-width:100%;min-width:0;font:inherit;padding:.3rem;border:1px solid var(--color-rule);border-radius:4px;background:var(--color-paper);color:var(--color-ink)}
.analysis-controls__group{max-width:24rem;flex:0 1 auto}
.analysis-controls__exit{border:0;background:transparent;color:var(--color-accent);font:inherit;cursor:pointer}
.analysis-controls__order{max-width:100%;font-size:.76rem}
.analysis-view{min-width:0;font-family:var(--font-sans)}
.analysis-view__legend{display:flex;flex-wrap:wrap;gap:.3rem 1rem;margin:.3rem 0 .7rem;font-size:.73rem;color:var(--color-muted)}
.analysis-view__legend span{display:inline-flex;align-items:center;gap:.3rem}
.analysis-view__legend i{width:.7rem;height:.7rem;border-radius:2px;flex-shrink:0}
.analysis-view__legend--series{margin-top:-.4rem}
.analysis-view__legend .analysis-view__series-swatch{box-sizing:border-box;width:.85rem;height:.55rem;border:2px solid transparent;border-radius:1px;background:transparent!important}
.analysis-view__legend-note{font-style:italic}
.analysis-view__statement{padding:.65rem 0;border-top:1px solid var(--color-rule);min-width:0}
.analysis-view__statement h3{font:600 .94rem/1.4 var(--font-sans);margin:0 0 .35rem}
.analysis-view__inspect{padding:0;text-align:left;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:var(--color-rule);text-underline-offset:3px}
.analysis-view__line{display:grid;grid-template-columns:minmax(5rem,7.5rem) minmax(0,1fr) 3.5rem;gap:.4rem;align-items:center;margin:.15rem 0}
.analysis-view__line--population{grid-template-columns:minmax(0,1fr) auto;margin:0 0 .45rem}
.analysis-view__line--population svg{grid-column:1/-1;grid-row:2}
.analysis-view__line--group{margin-left:.5rem}
.analysis-view__line svg{width:100%;min-width:0;height:10px;display:block}
.analysis-view__line--population svg{height:24px}
.analysis-view[data-view="poikkeamat"] .analysis-view__line svg{height:24px}
.analysis-view__label{font-size:.76rem;overflow-wrap:anywhere;line-height:1.3}
.analysis-view__metric{font-size:.73rem;text-align:right;font-variant-numeric:tabular-nums}
.analysis-view__note,.analysis-view__status{font-size:.82rem;line-height:1.4;margin:.3rem 0 .6rem;color:var(--color-muted)}
.analysis-view__table-scroll{min-width:0;width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.analysis-view table,.background-profile-scalar{width:100%;max-width:none;font-size:.78rem;border-collapse:collapse;margin:0}
.background-profile-scalar :is(th,td){padding:.35rem .5rem;border-bottom:1px solid var(--color-rule)}
.background-profile-scalar :is(th,td):last-child{text-align:right;font-variant-numeric:tabular-nums}
.analysis-view th,.analysis-view td{text-align:right;padding:.35rem .5rem;border-bottom:1px solid var(--color-rule);font-variant-numeric:tabular-nums}
.analysis-view th:first-child,.analysis-view td:first-child{text-align:left;min-width:6rem;max-width:10rem;overflow-wrap:anywhere}
.analysis-view__table-statement th{text-align:left;max-width:none!important;padding-top:.8rem}
.analysis-view__table-statement button{white-space:normal;max-width:100%}
.analysis-view__table-hint{display:none;font-size:.7rem;color:var(--color-muted);margin:.2rem 0}
.analysis-view__sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.single-page-prototype__toolbar{gap:.35rem!important}
.single-page-prototype__question-head{margin-bottom:.45rem!important}
.single-page-prototype__question{padding-top:.9rem!important}
@media(max-width:719px){
 .analysis-view__line{grid-template-columns:minmax(0,1fr) auto;gap:.08rem .4rem;margin:.22rem 0}
 .analysis-view__line--group{margin-left:.4rem}
 .analysis-view__table-hint{display:block}
 .analysis-view__line svg{grid-row:2;grid-column:1/-1}
 .analysis-view__label{font-size:.73rem}
 .analysis-view__metric{font-size:.69rem}
 .analysis-controls__views label{font-size:.73rem;padding:.25rem .35rem}
 .analysis-controls__context{gap:.3rem .5rem;font-size:.76rem}
 .analysis-controls__group{max-width:100%}
 .analysis-controls__order{font-size:.7rem}
 .analysis-view__legend{font-size:.68rem;gap:.2rem .6rem}
 .single-page-prototype__toolbar .result-view-selector{width:100%}
 .single-page-prototype__question .analysis-view h3{font-size:.9rem}
}
.single-page-prototype{--single-page-anchor-offset:6.5rem;max-width:var(--width-wide);padding-bottom:4rem;overflow-x:clip}
.single-page-prototype__intro{max-width:65rem;margin:1.25rem 0 1.5rem}
.single-page-prototype__intro h1{margin:0 0 .5rem;font-size:clamp(1.7rem,3vw,2.6rem)}
.single-page-prototype__intro p{margin:.25rem 0;color:var(--color-muted)}
.single-page-prototype__toolbar{position:sticky;top:0;z-index:10;display:flex;flex-wrap:wrap;align-items:center;gap:.7rem;padding:.55rem 0;border-block:1px solid var(--color-rule);border-bottom-color:var(--color-rule-strong);background:var(--color-accent-soft);box-shadow:0 5px 12px color-mix(in srgb,var(--color-ink) 12%,transparent)}
.single-page-prototype__toolbar .filter-menus{min-width:0}
.single-page-prototype__toolbar .b2-control-toolbar{display:flex;flex-wrap:wrap;gap:.5rem}
.single-page-prototype__toolbar .result-view-selector{margin:0}
.single-page-prototype__toolbar .active-filters--compact{width:100%}
.single-page-prototype__population{margin:0;color:var(--color-muted);font-size:.85rem}
.single-page-prototype__question{min-height:12rem;margin:0 0 2rem;padding:1.8rem 0 0;border-top:1px solid var(--color-rule);scroll-margin-top:var(--single-page-anchor-offset)}
.single-page-prototype__question:first-child{border-top:0}
.single-page-prototype__question-head{margin:0 0 1rem}
.single-page-prototype__question-head h2{margin:0;font-size:clamp(1.4rem,2.3vw,2rem);line-height:1.2}
.single-page-prototype__comparison-toggle{display:block;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;line-height:inherit;text-align:left;overflow-wrap:anywhere;hyphens:auto;cursor:pointer}
.single-page-prototype__comparison-toggle::after{content:"−";display:inline-block;margin-left:.55rem;color:var(--color-accent);font-family:system-ui,sans-serif;font-size:.8em;font-weight:600}
.single-page-prototype__comparison-toggle[aria-expanded="false"]::after{content:"+"}
.single-page-prototype__question-head p{margin:.3rem 0 0;color:var(--color-muted)}
.single-page-prototype__question[data-collapsed="true"]{min-height:0;margin-bottom:0;padding:.9rem 0}
.single-page-prototype__question[data-collapsed="true"] .single-page-prototype__question-head{margin-bottom:0}
.single-page-prototype__question[data-collapsed="true"] h2{font-size:clamp(1.12rem,1.8vw,1.45rem)}
.single-page-prototype__result[hidden]{display:none}
.single-page-prototype__question .matrix-question-with-views{margin-top:.4rem}
.single-page-prototype__question .b2-theme-question__heading--primary{display:block}
.single-page-prototype__status{min-height:4rem;color:var(--color-muted)}
#results-collection-navigation .single-page-prototype__sublinks{list-style:none;margin:.1rem 0 .4rem 1rem;padding:0}
#results-collection-navigation .single-page-prototype__sublinks a{font-size:.86rem}
#observablehq-sidebar .single-page-prototype__sublinks a:not([aria-current="location"]){border-left-color:transparent;font-weight:400}
#results-collection-navigation a[data-prototype-question][aria-current="location"]{color:var(--color-accent);font-weight:700}
.single-page-prototype a:focus-visible,.single-page-prototype button:focus-visible,.single-page-prototype select:focus-visible{outline:3px solid var(--color-focus);outline-offset:2px}
@media(max-width:1007px){.single-page-prototype{--single-page-anchor-offset:9rem}.single-page-prototype__toolbar{top:0;gap:.35rem}.single-page-prototype__toolbar .b2-control-toolbar{gap:.25rem}}
@media(max-width:719px){.single-page-prototype__toolbar .active-filters--compact .active-filters__chip{flex-wrap:wrap}.single-page-prototype__toolbar .active-filters--compact .active-filters__remove{font-size:.75rem;width:1.5rem;height:1.5rem;line-height:1.5rem}}
@media(max-width:390px){.single-page-prototype__toolbar{padding:.35rem 0;gap:.25rem}.single-page-prototype__toolbar .filter-menus{display:contents}.single-page-prototype__toolbar .b2-control-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:.25rem;width:auto}.single-page-prototype__toolbar .b2-control-group{min-width:0}.single-page-prototype__toolbar .b2-control-trigger{width:auto;min-width:0;min-height:2.6rem;padding:.35rem .5rem;padding-right:2.6rem;font-size:var(--step-fine);line-height:1.15;text-align:left}.single-page-prototype__toolbar .b2-control-trigger__label{display:inline}.single-page-prototype__toolbar .b2-control-group .b2-control-clear,.single-page-prototype__toolbar .b2-control-group .b2-control-clear-slot{min-height:2.6rem}.single-page-prototype__toolbar .result-view-selector{width:auto;flex:0 1 auto;min-width:0}.single-page-prototype__toolbar .result-view-selector__tab{padding:.25rem .35rem;min-height:2.2rem;font-size:var(--step-fine);white-space:nowrap}.single-page-prototype__toolbar .single-page-prototype__population{flex:1 1 auto;min-width:0;font-size:.7rem;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.single-page-prototype__toolbar .active-filters--compact{width:auto;display:flex;flex-wrap:wrap;gap:.25rem;align-items:center}.single-page-prototype__toolbar .active-filters--compact .active-filters__chip{padding:.1rem .3rem .1rem .4rem;font-size:.65rem;gap:.15rem;line-height:1.1}.single-page-prototype__toolbar .active-filters--compact .active-filters__remove{width:1.5rem;height:1.5rem;line-height:1.5rem}}
@media(max-width:360px){.single-page-prototype__toolbar{padding:.3rem 0}.single-page-prototype__toolbar .b2-control-toolbar{grid-template-columns:1fr 1fr;gap:.2rem}.single-page-prototype__toolbar .b2-control-trigger{min-height:2.5rem;padding:.3rem .4rem;padding-right:2.4rem;font-size:var(--step-fine)}.single-page-prototype__toolbar .result-view-selector__tab{padding:.2rem .4rem;min-height:2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.single-page-prototype__toolbar .single-page-prototype__population{font-size:.66rem;line-height:1.1}.single-page-prototype__toolbar .active-filters--compact .active-filters__chip{padding:.08rem .25rem .08rem .35rem;font-size:.62rem}}
@media(prefers-reduced-motion:reduce){.single-page-prototype *{scroll-behavior:auto!important;transition-duration:0s!important}}
/* Hide the whole-sample scope banner in the unified view's Jakaumat tab: the
    active tab label already says "Jakaumat", the sticky toolbar carries the
    shared N, and the question header repeats the per-question N. Analogous to
    the canonical rule at matrix-page.css:2262 (.b2-analysis-surface …). The
    Ryhmavertailu scope banner (by-grouping) stays because it carries unique
    information (per-group denominators, grouping-total N). */
.single-page-prototype .jakaumat-view > .result-view-scope{display:none}

/* Hide the per-row "Piilota väittämä" (hide) button in the single-page
    prototype at every width. The unified view wires an empty onHideItem
    callback (see results-single-page.js), so the button would be a silent
    no-op if rendered. "Tarkastele väittämää" still opens the per-statement
    dialog for focused reading. */
.single-page-prototype .statement-distribution__hide{display:none}

/* Background chapter — questionnaire's early questions presented in survey order */
.background-chapter{display:block;margin:0 0 2rem}
.background-chapter__intro{margin:0.5rem 0 0.5rem;padding:0.5rem 0 0.5rem;border-top:1px solid var(--color-rule);border-bottom:1px solid var(--color-rule)}
.background-chapter__kicker{margin:0 0 .4rem;color:var(--color-accent);font-family:var(--font-sans);font-size:.78rem;font-weight:650;letter-spacing:.1em;text-transform:uppercase}
.background-chapter__title{margin:0;font-family:var(--font-serif);font-size:clamp(1.4rem,2.3vw,2rem);font-weight:500;letter-spacing:-.015em}
.background-chapter__lede{margin:.5rem 0 0;max-width:60ch;color:var(--color-muted);font-family:var(--font-serif);font-size:1rem;line-height:1.55}
.background-chapter__availability{margin:.6rem 0 1rem;color:var(--color-muted);font-family:var(--font-sans);font-size:.82rem}
.background-section{min-height:0;margin:0 0 1rem;padding:0.8rem 0 .3rem;border-top:1px solid var(--color-rule);scroll-margin-top:var(--single-page-anchor-offset)}
.background-section:first-of-type{border-top:0}
.background-section__header{margin:0 0 .6rem}
.background-section__kicker{margin:0 0 .25rem;color:var(--color-muted);font-family:var(--font-sans);font-size:.78rem;font-weight:650;letter-spacing:.1em;text-transform:uppercase}
.background-section .single-page-prototype__question-title{margin:0;font-family:var(--font-serif);font-size:clamp(1.4rem,2.3vw,2rem);font-weight:500;letter-spacing:-.015em;line-height:1.2}
.background-section__n{margin:.35rem 0 0;color:var(--color-muted);font-family:var(--font-sans);font-size:.85rem;font-variant-numeric:tabular-nums}
.background-section__viz{margin:0.6rem 0 .3rem}
.background-section__viz figure{margin:0}
.background-section__viz .story-map svg,
.background-section__viz .story-municipality-map svg{max-width:100%;max-height:28rem}
.background-section__viz .story-map__legend,
.background-section__viz .story-municipality-map__legend{margin-top:.5rem}

/* Side-by-side map + legend on wide viewports. The map occupies the left
    column; the full existing legend (every row, swatch and figcaption) sits
    on the right so none of the methodological text is lost. Mobile falls
    back to the default stacked flow. */
@media(min-width:900px){
  .background-section__viz--fixed .story-map{
    display:grid;
    grid-template-columns:minmax(0,1.25fr) minmax(16rem,.9fr);
    grid-template-areas:"title title" "svg legend" "caption caption";
    column-gap:1.5rem;align-items:start
  }
  .background-section__viz--fixed .story-map>.story-likert__title{grid-area:title}
  .background-section__viz--fixed .story-map>svg{grid-area:svg;max-height:none}
  .background-section__viz--fixed .story-map>.story-map__legend{grid-area:legend;max-height:34rem;overflow-y:auto;margin-top:0;grid-template-columns:1fr;align-content:start}
  .background-section__viz--fixed .story-map>.story__figure-caption{grid-area:caption;margin-top:.75rem}
  .background-section__viz--fixed .story-municipality-map__layout{
    display:grid;
    grid-template-columns:minmax(0,1.3fr) minmax(14rem,.8fr);
    column-gap:1.5rem;align-items:start
  }
  .background-section__viz--fixed .story-municipality-map__layout>svg{max-height:none}
  .background-section__viz--fixed .story-municipality-map__layout>.story-municipality-map__legend{grid-template-columns:1fr;margin-top:0;align-content:start}
}
.background-section__viz .story-waffle{max-width:34rem}
.background-section__viz .story-waffle__cells{gap:.25rem}
.background-section__viz .story-waffle--interactive{max-width:48rem}
.education-waffle__layout{display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:1rem;align-items:start}
.education-waffle__layout>.story-waffle__cells{width:100%;max-width:340px;aspect-ratio:1;gap:3px;align-self:start}
.story-waffle--interactive .story-waffle__cell{transition:opacity 100ms ease,filter 100ms ease;cursor:pointer;min-width:0}
.education-waffle--highlighting .story-waffle__cell{opacity:.35}
.education-waffle--highlighting .story-waffle__cell.is-highlighted{opacity:1;box-shadow:inset 0 0 0 1.5px #263746;filter:brightness(1.04)}
.education-waffle__side{min-width:0}
.education-waffle__legend{list-style:none;padding:0;margin:0;display:grid;gap:.15rem}
.education-waffle__legend>li{margin:0;padding:0}
.education-waffle__legend-button{display:flex;gap:.5rem;align-items:center;width:100%;min-height:2.6rem;padding:.25rem .4rem;border:1px solid transparent;border-radius:4px;text-align:left;font:inherit;font-size:.8rem;line-height:1.25;color:inherit;background:transparent;cursor:pointer}
.education-waffle__legend-button.is-highlighted{background:var(--ui-surface-soft, #edf2f7);border-color:var(--ui-rule, #bccbd8)}
.education-waffle__legend-button[aria-pressed="true"]{border-color:#3167ad;box-shadow:inset 3px 0 #3167ad}
.education-waffle__legend-button .story-waffle__swatch{margin:0;width:.85rem;height:.85rem;flex:0 0 .85rem;border:1px solid rgb(0 0 0 / 15%)}
.education-waffle__legend-text{display:grid;gap:.1rem;min-width:0;overflow-wrap:anywhere}
.education-waffle__legend-text small{font-size:.72rem;font-variant-numeric:tabular-nums;color:var(--color-muted)}
.education-waffle__detail{font-size:.8rem;line-height:1.4}
.education-waffle__detail[popover]{position:absolute;inset:auto;margin:0;padding:.65rem .8rem;min-height:0;max-width:min(23rem,calc(100vw - 24px));box-sizing:border-box;border:1px solid #a9b6c2;border-radius:7px;background:var(--ui-surface, #fff);color:var(--ui-ink, #172d3e);box-shadow:0 5px 20px rgb(17 36 53 / 22%);pointer-events:none}
.education-waffle__reset{margin-top:.5rem}
.education-waffle__detail strong,.education-waffle__detail span,.education-waffle__detail small{display:block}
.education-waffle__detail small{margin-top:.2rem;color:var(--color-muted)}
.education-waffle__reset{font:inherit;font-size:.78rem;padding:.3rem .65rem;border:1px solid var(--color-rule);border-radius:999px;background:transparent;color:inherit;cursor:pointer}
.education-waffle__reset:focus-visible,.education-waffle__legend-button:focus-visible{outline:2px solid #3167ad;outline-offset:2px}
@media(max-width:719px){.education-waffle__layout{grid-template-columns:minmax(0,1fr);gap:.7rem}.education-waffle__legend-button{min-height:2.75rem}}
@media(prefers-reduced-motion:reduce){.story-waffle--interactive .story-waffle__cell{transition:none}}
.background-section__viz .story-likert__title{margin:0 0 .5rem;font-family:var(--font-sans);font-size:.95rem;font-weight:650;color:var(--color-ink)}
.background-section__viz .story__figure-caption{margin:.5rem 0 0;color:var(--color-muted);font-size:.82rem}
.background-section__caption{margin:.35rem 0 0;color:var(--color-muted);font-family:var(--font-sans);font-size:.78rem;font-style:italic}

/* Lightweight histogram for age and experience */
.background-histogram{margin:0}
.background-histogram svg{display:block;width:100%;height:auto}
.background-histogram__grid{stroke:var(--color-rule);stroke-width:.5}
.background-histogram__bar{fill:var(--color-accent);opacity:.85}
.background-histogram__ygridlabel{fill:var(--color-muted);font-family:var(--font-sans);font-size:10px;font-variant-numeric:tabular-nums}
.background-histogram__xlabel{fill:var(--color-ink);font-family:var(--font-sans);font-size:10px}
.background-histogram__barvalue{fill:var(--color-muted);font-family:var(--font-sans);font-size:10px;font-variant-numeric:tabular-nums}
.background-histogram__caption{fill:var(--color-muted);font-family:var(--font-sans);font-size:11px}

/* Badges and filtered-body container */
.background-section__body{margin:.5rem 0 .3rem}
.background-section__badge{display:inline-block;margin:0 0 .5rem;padding:.2rem .6rem;border-radius:999px;font-family:var(--font-sans);font-size:.76rem;font-weight:650;letter-spacing:.02em}
.background-section__badge--whole{background:color-mix(in oklab,var(--color-surface) 70%,var(--color-rule) 30%);color:var(--color-muted)}
.background-section__badge--active{background:color-mix(in oklab,var(--color-accent-soft) 80%,white 20%);color:var(--color-accent)}
.background-section__viz--fixed{margin:0 0 1rem}
.background-section__filtered{margin:1rem 0 0;padding:1rem 0 0;border-top:1px dashed var(--color-rule)}
.background-section__filtered-heading{margin:0 0 .5rem;font-family:var(--font-sans);font-size:.9rem;font-weight:650;color:var(--color-ink)}

/* Compact distribution bar list — reused for Q3/Q4/Q5/Q6/Q7/Q8/Q9 filter view */
.background-distribution{margin:.25rem 0 .5rem}
.background-distribution__list{list-style:none;margin:0;padding:0;display:grid;gap:.3rem}
.background-distribution__row{display:grid;grid-template-columns:minmax(0,14rem) minmax(0,1fr) auto;align-items:center;gap:.6rem;padding:.1rem 0;font-family:var(--font-sans);font-size:.85rem}
.background-distribution__row--selected .background-distribution__label{font-weight:700;color:var(--color-accent)}
.background-distribution__label{color:var(--color-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.background-distribution__bar{position:relative;display:block;height:.6rem;background:color-mix(in oklab,var(--color-surface) 85%,var(--color-rule) 15%);border-radius:3px;overflow:hidden}
.background-distribution__bar-fill{position:absolute;left:0;top:0;bottom:0;background:var(--color-accent);opacity:.75;border-radius:3px}
.background-distribution__row--selected .background-distribution__bar-fill{opacity:1}
.background-distribution__count{color:var(--color-muted);font-variant-numeric:tabular-nums;font-size:.82rem;white-space:nowrap}
.background-distribution--empty{color:var(--color-muted);font-family:var(--font-sans);font-size:.85rem;font-style:italic;padding:.5rem 0}
@media(max-width:600px){
  .background-distribution__row{grid-template-columns:minmax(0,8rem) minmax(0,1fr) auto;gap:.4rem;font-size:.8rem}
  .background-distribution__count{font-size:.76rem}
}
@media(max-width:390px){
  .background-distribution__row{grid-template-columns:minmax(0,6.5rem) minmax(0,1fr) auto;gap:.35rem}
}

/* Deferred list — honest documentation of what's not yet rendered */
.background-chapter__deferred{margin:1.5rem 0 0;padding:1rem 1rem .9rem;border:1px solid var(--color-rule);border-radius:8px;background:var(--color-surface-soft)}
.background-chapter__deferred-heading{margin:0 0 .35rem;font-family:var(--font-sans);font-size:.95rem;font-weight:650;color:var(--color-ink)}
.background-chapter__deferred-lede{margin:0 0 .75rem;color:var(--color-muted);font-size:.85rem}
.background-chapter__deferred-list{margin:0;padding:0;list-style:none;display:grid;gap:.5rem}
.background-chapter__deferred-item{display:grid;grid-template-columns:4.5rem 1fr;gap:.1rem .7rem;padding:.35rem 0;border-top:1px solid var(--color-rule);font-size:.82rem}
.background-chapter__deferred-item:first-child{border-top:0}
.background-chapter__deferred-id{color:var(--color-accent);font-family:var(--font-sans);font-weight:650}
.background-chapter__deferred-title{color:var(--color-ink);font-weight:600}
.background-chapter__deferred-reason{grid-column:2;color:var(--color-muted);font-size:.78rem;line-height:1.4}
@media(max-width:600px){
  .background-chapter__deferred-item{grid-template-columns:1fr;gap:.1rem}
  .background-chapter__deferred-reason{grid-column:auto}
  .background-section__viz .story-map svg,
  .background-section__viz .story-municipality-map svg{max-height:22rem}
}

/* Jakaumat mobile density — compress the long single-page prototype on
    narrow viewports so all 12 result questions remain readable but the
    page stops demanding ~28k pixels of vertical scroll. Scoped to
    .single-page-prototype so the production /tulokset view and other
    routes are untouched. The Ryhmavertailu view uses a different
    component tree and is not reached by these selectors. */
@media(max-width:600px){
  /* Question-section rhythm */
  .single-page-prototype__question{padding-top:1.1rem;margin-bottom:1.1rem}
  .single-page-prototype__question-head{margin:0 0 .55rem}
  .single-page-prototype__question-head h2{font-size:clamp(1.1rem,1.8vw,1.3rem);line-height:1.2}
  .single-page-prototype__question-n{font-size:.8rem;margin:.1rem 0 0}
  /* Jakaumat-view header + reading note + legend */
  .single-page-prototype .jakaumat-view__tools{gap:.3rem;padding:.3rem 0;margin:0 0 .35rem}
  .single-page-prototype .jakaumat-view__reading-note{font-size:.72rem;line-height:1.3;margin:0}
  .single-page-prototype .jakaumat-view__legend{row-gap:.2rem;margin:.1rem 0 .25rem;font-size:.74rem}
  .single-page-prototype .jakaumat-view__legend-item{gap:.3rem}
  .single-page-prototype .jakaumat-view__legend-swatch{width:.65rem;height:.65rem}
  .single-page-prototype .jakaumat-view__statements{gap:.15rem}
  /* Statement card internals */
  .single-page-prototype .statement-distribution.item-detail{padding:.15rem 0 .2rem}
  .single-page-prototype .statement-distribution__header{align-items:center;row-gap:.1rem;gap:.4rem}
  .single-page-prototype .statement-distribution__title{font-size:.86rem;line-height:1.22;margin:0 0 .05rem;font-weight:600}
  .single-page-prototype .statement-distribution__select{min-height:2.75rem;padding:.3rem .55rem;font-size:.8rem;letter-spacing:0}
  .single-page-prototype .statement-distribution__chart-row{gap:.1rem;margin-top:.05rem}
  .single-page-prototype .statement-distribution__metrics{gap:.1rem .65rem;margin:.05rem 0 0;line-height:1.25}
  /* Inline response table — collapse on mobile to keep the scroll short.
      The same table is reachable through the Tarkastele väittämää dialog
      (statement-dialog.js reuses renderStatementDistribution). */
  .single-page-prototype .statement-distribution__table{display:none}
  /* Background chapter — slightly tighter so the chapter + 12 questions
      stay within reach of a single swipe gesture. */
  .background-section{padding:1rem 0 .35rem;margin-bottom:1rem}
  .background-chapter__intro{margin:1rem 0 .7rem;padding:.9rem 0 .7rem}
  .background-chapter__lede{font-size:.92rem;line-height:1.45}
}
@media(max-width:600px){
  .single-page-prototype__intro{margin:.6rem 0 .8rem}
  .background-chapter{margin-bottom:1rem}
  .background-section{padding:.6rem 0 .3rem;margin-bottom:.7rem}
  .background-section__header{margin:0 0 .5rem}
  .background-chapter__intro{margin:.5rem 0 .5rem;padding:.5rem 0 .4rem}
  .background-chapter__lede{font-size:.86rem;line-height:1.38}
}
@media(max-width:390px){
  .single-page-prototype__intro{margin:.5rem 0 .7rem}
  .background-chapter__intro{margin:.4rem 0 .4rem;padding:.4rem 0 .3rem}
  .background-section{padding:.5rem 0 .2rem;margin-bottom:.6rem}
  .background-section__header{margin:0 0 .4rem}
}

/* Province map layout and sr-list for /tulokset route */
.single-page-prototype .story-municipality-map--donut .story-municipality-map__layout{display:grid;grid-template-columns:minmax(0,1fr);gap:.5rem;align-items:stretch}
.story-municipality-map__frame{position:relative;min-width:0;height:22rem}
.single-page-prototype .story-municipality-map__frame>svg{position:absolute;inset:0;display:block;width:100%;height:100%;max-height:none}
.municipality-donut{display:grid;gap:.6rem;min-width:0;width:100%;max-width:29rem;margin:auto;font-family:var(--font-sans)}
.municipality-donut__ring{position:relative;width:min(100%,15rem);aspect-ratio:1;margin:0 auto}
.single-page-prototype .story-municipality-map .municipality-donut__svg{display:block;width:100%;height:100%;max-height:none}
.municipality-donut__center{position:absolute;inset:24%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none}
.municipality-donut__center strong{font-size:clamp(1.6rem,2.5vw,2rem);font-weight:650;line-height:1.15;white-space:nowrap;letter-spacing:-.035em;font-variant-numeric:tabular-nums}
.municipality-donut__center span{font-size:.76rem;line-height:1.35;margin-top:.4rem}
.municipality-donut__list{min-width:0}
.municipality-donut__label{display:grid;grid-template-columns:.5rem minmax(0,1fr) auto;align-items:center;gap:.7rem;box-sizing:border-box;padding:.7rem 0;border-bottom:1px solid var(--color-rule);font-size:.86rem;line-height:1.3}
.municipality-donut__label:last-child{border-bottom:0}
.municipality-donut__swatch{display:block;width:.5rem;height:.5rem;border-radius:50%;background:var(--municipality-color)}
.municipality-donut__text strong{display:block;font-weight:550}
.municipality-donut__count{display:block;margin-top:.2rem;color:var(--color-muted);font-size:.78rem;font-variant-numeric:tabular-nums}
.municipality-donut__share{font-size:1.1rem;font-weight:550;white-space:nowrap;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.municipality-donut__sector{stroke-width:0}
.municipality-donut__sector.is-highlighted{stroke:#152b43;stroke-width:2}
.municipality-donut__label.is-highlighted .municipality-donut__text strong{color:var(--municipality-color);text-decoration:underline;text-underline-offset:.2em}
.municipality-donut__sector:focus-visible{outline:none;stroke:#152b43;stroke-width:3;stroke-dasharray:4 2}
.municipality-donut__label:focus-visible{outline:2px solid #152b43;outline-offset:3px}
@media(min-width:900px){
  .single-page-prototype .story-municipality-map--donut .story-municipality-map__layout{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:1.5rem}
  .story-municipality-map__frame{height:auto}
}
/* Q5 "Korkein tutkinto" dual-ring layout. Two panels stack on narrow
   screens and sit side-by-side from 900px up. Each panel reuses
   .municipality-donut for its ring + legend. */
.single-page-prototype .highest-degree-dual-donut{display:flex;flex-direction:column;gap:.9rem;margin:0}
.single-page-prototype .highest-degree-dual-donut__pair{display:grid;grid-template-columns:minmax(0,1fr);gap:1.5rem;align-items:start}
.single-page-prototype .highest-degree-dual-donut__panel{display:flex;flex-direction:column;gap:.5rem;min-width:0}
.single-page-prototype .highest-degree-dual-donut__panel-title{margin:0;font-family:var(--font-sans);font-size:.88rem;font-weight:650;color:var(--color-ink);letter-spacing:.01em}
.single-page-prototype .highest-degree-dual-donut .municipality-donut{max-width:none}
.single-page-prototype .highest-degree-dual-donut__panel--left .municipality-donut__ring{width:min(100%,14rem)}
.single-page-prototype .highest-degree-dual-donut__panel--right .municipality-donut__ring{width:min(100%,13rem)}
.single-page-prototype .highest-degree-dual-donut__note{margin:.2rem 0 0;color:var(--color-muted);font-size:.8rem;line-height:1.45;max-width:46rem}
.single-page-prototype .highest-degree-dual-donut__sr-summary{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;clip-path:inset(50%) !important;white-space:nowrap !important;border:0 !important}
@media(min-width:900px){
  .single-page-prototype .highest-degree-dual-donut__pair{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:1.75rem}
}
/* Q3 "Sukupuoli" donut wrapper. Stacks ring over list on narrow screens,
   switches to ring-left / list-right from 720px. Uses the same underlying
   .municipality-donut component as Q7/Q8/Q9 — only the outer two-column
   grid differs, because Q3 shows no map. */
.single-page-prototype .gender-donut-figure{margin:0}
.single-page-prototype .gender-donut-figure .municipality-donut{max-width:none;gap:.8rem}
@media(min-width:720px){
  .single-page-prototype .gender-donut-figure .municipality-donut{grid-template-columns:minmax(10rem,16rem) minmax(0,1fr);gap:1.75rem;align-items:center}
  .single-page-prototype .gender-donut-figure .municipality-donut__ring{margin:0}
}
.single-page-prototype .province-map__layout{display:grid;gap:1rem;grid-template-columns:minmax(0,1fr)}
@media (min-width:768px){.single-page-prototype .province-map__layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}}
.single-page-prototype .province-map__figure{display:block;width:100%;height:auto;max-height:650px}
.single-page-prototype .province-map{position:relative;width:100%;max-width:none;height:auto;margin:0}
.single-page-prototype .province-map__table{min-width:0;overflow-x:auto}
.single-page-prototype .province-map__table table{min-width:440px}
.single-page-prototype .province-map__table tbody tr{cursor:pointer}
.single-page-prototype .province-map__table tbody tr:focus-visible{outline:2px solid #3167ad;outline-offset:-2px}
.single-page-prototype .province-map__table tbody tr.province-map__table-row--selected > td{background:rgba(49,103,173,.16)}
.single-page-prototype .province-map__table tbody tr.province-map__table-row--selected > td:first-child{box-shadow:inset 3px 0 0 #0f3460}
.single-page-prototype .province-map__table tbody tr.province-map__table-row--disabled{cursor:not-allowed;opacity:.55}
.single-page-prototype .province-map__table tbody tr.province-map__table-row--hover > td{background:rgba(49,103,173,.08)}
.single-page-prototype .province-map__table-swatch{display:inline-block;width:14px;height:14px;border:1px solid rgba(0,0,0,.08);border-radius:2px;vertical-align:middle}
.single-page-prototype .province-map__table-totals{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:.4rem .9rem;margin:.65rem 0 0;padding:.65rem .85rem;background:var(--ui-surface-soft, #f3f6fb);border:1px solid var(--ui-rule, #d6dfec);border-radius:.5rem;box-shadow:0 1px 2px rgba(15,52,96,.06);font-size:.88rem;color:var(--ui-ink, #1a2b40)}
.single-page-prototype .province-map__table-totals__regions{font-weight:600}
.single-page-prototype .province-map__table-totals__respondents{color:var(--ui-accent, #324a66)}
.single-page-prototype .province-map__figure{pointer-events:none}
.single-page-prototype .province-map__region{stroke:#fff;stroke-width:1;cursor:pointer;pointer-events:visibleFill}
.single-page-prototype .province-map__region--hover{stroke:#3167ad;stroke-width:2}
.single-page-prototype .province-map__region--selected{stroke:#0f3460;stroke-width:3}
.single-page-prototype .province-map__region:focus-visible{outline:2px solid #3167ad}
.single-page-prototype .province-map__region--disabled{cursor:not-allowed;opacity:.5}
.province-map__sr-list{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;clip-path:inset(50%) !important;white-space:nowrap !important;border:0 !important;list-style:none !important}
.province-map__sr-list li{list-style:none !important}
.province-map__sr-button{all:unset;position:absolute;width:1px;height:1px;clip-path:inset(50%)}

/* The Framework frame and .page must share one mobile gutter. */
@media(max-width:719px){
 #observablehq-center:has(.single-page-prototype){margin-inline:16px}
 .single-page-prototype.page{padding-inline:0;overflow-x:visible}
 .single-page-prototype .analysis-heading{box-sizing:border-box;padding-left:1.65rem}
 .single-page-prototype .analysis-controls{gap:.3rem}
 .single-page-prototype .analysis-controls__views{order:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.15rem}
 .single-page-prototype .analysis-controls__views .result-view-selector__tab{justify-content:center;min-height:2.25rem;padding:.2rem .1rem;font-size:.73rem;text-align:center;line-height:1.15}
 .single-page-prototype .analysis-controls__views input{position:absolute;width:1px;height:1px;opacity:0}
 .single-page-prototype .analysis-controls__views label:has(:focus-visible){outline:2px solid var(--color-accent);outline-offset:1px}
 .single-page-prototype .analysis-controls__context{order:1;gap:.2rem .45rem;font-size:.7rem}
 .single-page-prototype .analysis-controls__dimension{width:100%;font-size:.68rem}
 .single-page-prototype .analysis-controls__modes label{min-height:2rem;gap:.2rem}
 .single-page-prototype .analysis-controls__exit{margin-left:auto;font-size:.65rem;padding:.2rem 0}
 .single-page-prototype .analysis-controls__group{flex:1 1 100%}
 .single-page-prototype .analysis-controls__group select{width:100%}
 .single-page-prototype .analysis-controls__order{order:2;width:100%}
 .single-page-prototype .analysis-controls__order select{width:100%;font-size:.7rem;padding:.2rem}
 .single-page-prototype .single-page-prototype__population{flex:1 0 100%;font-size:.72rem}
 .single-page-prototype .single-page-prototype__toolbar .b2-control-trigger{min-height:2.2rem}
 .analysis-view__table th:first-child,.analysis-view__metrics th:first-child{min-width:5.5rem;max-width:7.5rem}
 .analysis-view th,.analysis-view td{padding:.3rem .35rem}
}

/* Contextual controls follow the reference's reading order on every screen. */
.single-page-prototype__toolbar .filter-menus{display:contents}
.single-page-prototype__toolbar .b2-control-toolbar{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;gap:.6rem!important}
.single-page-prototype__toolbar .b2-control-group{display:grid;grid-template-columns:minmax(0,1fr);min-width:0;gap:.15rem}
.single-page-prototype__toolbar .b2-control-group::before{content:attr(data-caption);font-size:.8rem;color:var(--color-muted)}
.single-page-prototype__toolbar .b2-control-clear,.single-page-prototype__toolbar .b2-control-clear-slot{display:none!important}
.single-page-prototype__toolbar .b2-control-trigger{position:relative;box-sizing:border-box;width:100%!important;min-height:2.15rem!important;border:1px solid var(--color-rule-strong)!important;border-radius:999px!important;background:var(--color-paper)!important;color:var(--color-ink)!important;padding:.25rem 1.8rem .25rem .8rem!important;font:inherit!important;font-size:.82rem!important;line-height:1.2!important}
.single-page-prototype__toolbar .b2-control-trigger::after{content:"⌄";position:absolute;right:.65rem;top:50%;transform:translateY(-50%);color:var(--color-muted)}
.analysis-population{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.2rem .7rem;width:100%;margin:.15rem 0}
.analysis-population .single-page-prototype__population{flex:0 0 auto;margin:0;font-size:.8rem}
.analysis-population strong{font-size:1.15rem;color:var(--color-ink)}
.analysis-population .active-filters{margin:0;padding:0;min-height:0;background:none;flex:0 1 auto;display:flex;flex-wrap:wrap;gap:.3rem}
.single-page-prototype .analysis-controls{display:flex;flex-direction:column;align-items:stretch;gap:.45rem}
.single-page-prototype .analysis-controls__context{order:0;display:grid;grid-template-columns:minmax(0,1fr);gap:.25rem;width:100%}
.analysis-controls__comparison-heading{display:flex;justify-content:space-between;align-items:center;gap:.5rem;font-size:.78rem}
.single-page-prototype .analysis-controls__dimension{width:auto;font-size:inherit}
.single-page-prototype .analysis-controls__exit{padding:.15rem .25rem;margin:0;font-size:.78rem;color:var(--color-muted)}
.single-page-prototype .analysis-controls__modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:.25rem}
.single-page-prototype .analysis-controls__modes label{justify-content:center;min-height:1.9rem;border-radius:999px;font-size:.8rem;cursor:pointer}
.analysis-controls__modes label:has(:checked){background:var(--color-surface-soft,var(--ui-surface-soft, #eee))}
.single-page-prototype .analysis-controls__group{max-width:none;width:100%;flex:none}
.single-page-prototype .analysis-controls__group select{width:100%;border-radius:999px;padding:.25rem .8rem}
.single-page-prototype .analysis-controls__views{order:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;gap:.2rem}
.single-page-prototype .analysis-controls__views .result-view-selector__tab{justify-content:center;box-sizing:border-box;min-height:2rem;padding:.2rem .15rem;font-size:.8rem;border:0;border-radius:999px;background:transparent;text-align:center;line-height:1.2}
.single-page-prototype .analysis-controls__views label:has(:checked){background:var(--color-surface-soft,var(--ui-surface-soft, #eee));color:var(--color-ink)}
.analysis-controls__distribution{order:2;display:flex;align-items:center;gap:.65rem;font-size:.77rem}
.analysis-controls__distribution label{min-height:1.8rem;cursor:pointer}
.single-page-prototype .analysis-controls__order{order:3;width:100%;max-width:none}
.single-page-prototype .analysis-controls__order select{width:100%;border-radius:999px;font-size:.78rem;padding:.25rem .7rem}
.analysis-controls__views input,.analysis-controls__modes input{position:absolute;width:1px;height:1px;opacity:0}
.analysis-controls label:has(:focus-visible){outline:2px solid var(--color-accent);outline-offset:2px}
.analysis-view[data-view="jakaumat"][data-distribution="percent"] .analysis-view__line--group{grid-template-columns:minmax(5rem,7.5rem) minmax(0,1fr)}
.analysis-view__percent-axis{grid-column:1/-1;display:flex;justify-content:space-between;font-size:.64rem;color:var(--color-muted)}
.experience-comparison{min-width:0;width:100%}
.single-page-prototype .analysis-controls[hidden]{display:none!important}
.experience-comparison__controls{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;margin:.6rem 0;font-size:.8rem}
.experience-comparison__controls button{font:inherit;padding:.35rem .8rem;border:1px solid var(--color-rule);border-radius:999px;background:transparent;color:inherit;cursor:pointer}
.experience-comparison__controls button[aria-pressed="true"]{background:var(--color-surface-soft,var(--ui-surface-soft, #eee));border-color:var(--color-accent)}
.experience-comparison__controls label{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;max-width:100%}
.experience-comparison__controls select{max-width:100%;font:inherit}
.experience-comparison__legend{display:flex;flex-wrap:wrap;gap:.4rem 1rem;font-size:.72rem;margin:.7rem 0}
.experience-comparison__legend span{display:flex;align-items:center;gap:.3rem;max-width:100%}
.experience-comparison__legend i{width:.8rem;height:.2rem;flex:none}
.experience-comparison>svg{display:block;max-width:100%;height:auto}
.experience-comparison svg circle[role="button"]{cursor:pointer;stroke-width:2;pointer-events:all}
.experience-comparison svg circle[role="button"]:focus{outline:2px solid var(--color-accent);outline-offset:3px}
.experience-comparison__detail,.experience-comparison__status{font-size:.8rem;min-height:1.5em}
@media(min-width:720px){
 .analysis-view[data-view="jakaumat"][data-distribution="percent"] .analysis-view__line--population{grid-template-columns:minmax(5rem,7.5rem) minmax(0,1fr);margin-left:.5rem}
 .analysis-view[data-view="jakaumat"][data-distribution="percent"] .analysis-view__line--population svg{grid-column:2;grid-row:1}
 .analysis-view[data-view="jakaumat"][data-distribution="percent"] .analysis-view__percent-axis{grid-column:2}
}
.analysis-view__scale-axis{display:flex;justify-content:space-between;margin:0 calc(3.5rem + .4rem + 5px) .25rem calc(7.5rem + .4rem + 5px);font-size:.7rem;color:var(--color-muted)}
.analysis-view__scale-axis--bands{box-sizing:border-box;padding-inline:8.333333%}
.analysis-view[data-distribution="scale"] .analysis-view__line--population{grid-template-columns:minmax(5rem,7.5rem) minmax(0,1fr) 3.5rem;margin-left:.5rem}
.analysis-view[data-distribution="scale"] .analysis-view__line--population svg{grid-column:2;grid-row:auto}
.analysis-view[data-distribution="scale"] .analysis-view__line--group svg{height:18px}
@media(max-width:719px){
 .single-page-prototype .analysis-controls__views .result-view-selector__tab{font-size:.73rem;min-height:2rem}
 .single-page-prototype .analysis-controls__modes label{font-size:.75rem;min-height:1.7rem}
 .analysis-controls__comparison-heading{font-size:.72rem}
 .single-page-prototype .analysis-controls__exit{font-size:.72rem}
 .analysis-controls__distribution{font-size:.73rem;gap:.65rem}
 .single-page-prototype__toolbar .b2-control-group::before{font-size:.75rem}
 .single-page-prototype__toolbar .b2-control-trigger{font-size:.77rem!important}
 .analysis-view[data-view="jakaumat"][data-distribution="percent"] .analysis-view__line--group{grid-template-columns:minmax(0,1fr)}
 .analysis-view[data-percent-layout="centered"] .analysis-view__line--population{margin-left:.4rem}
 .analysis-view[data-distribution="scale"] .analysis-view__line--population{grid-template-columns:minmax(0,1fr) auto;margin-left:.4rem}
 .analysis-view[data-distribution="scale"] .analysis-view__line--population svg{grid-column:1/-1;grid-row:2}
 .analysis-view__scale-axis{margin-inline:calc(.4rem + 5px) 5px}
}
/* A bounded native popover leaves the analysis context visible behind it. */
.analysis-filter-popover:popover-open,.analysis-compare-popover.b2-top-layer--compare-workspace:popover-open{width:min(38rem,calc(100vw - 1.5rem));max-width:calc(100vw - 1.5rem);scrollbar-gutter:auto}
.analysis-filter-popover .b2-top-layer__header,.analysis-compare-popover .b2-top-layer__header{padding:.65rem .9rem}
.analysis-filter-popover .b2-top-layer__body,.analysis-compare-popover .b2-top-layer__body{padding:.5rem .9rem .8rem;overflow-y:auto;scrollbar-gutter:auto}
@media(max-width:719px){
 .b2-top-layer.analysis-filter-popover:popover-open,.b2-top-layer.analysis-compare-popover:popover-open{inset:auto 8px 8px;width:calc(100vw - 16px);max-width:none;height:auto;max-height:72dvh!important;border:1px solid var(--color-rule);border-radius:.75rem;margin:0;box-sizing:border-box}
 .analysis-filter-popover .b2-top-layer__body,.analysis-compare-popover .b2-top-layer__body{overflow-y:auto;min-height:0}
}
.single-page-prototype__toolbar .b2-control-group::before{grid-row:1;grid-column:1}
.single-page-prototype__toolbar .b2-control-group > .b2-control-trigger{grid-row:2!important;grid-column:1!important}
.single-page-prototype__toolbar{gap:.2rem!important}
.single-page-prototype .analysis-controls{gap:.2rem}
.analysis-view__scale-axis{margin-left:calc(7.5rem + .4rem + .5rem + 5px)}
.analysis-view__scale-axis span{width:0;transform:translateX(-.5ch)}
@media(max-width:719px){
 .single-page-prototype .analysis-controls__views .result-view-selector__tab{min-height:1.75rem}
 .single-page-prototype .analysis-controls__modes label{min-height:1.5rem}
 .analysis-controls__distribution label{min-height:1.5rem}
 .analysis-view__scale-axis{margin-inline:calc(.4rem + 5px) 5px}
}
.single-page-prototype__result,.statement-analysis-dialog .result-view-shell{position:relative}
.analysis-updating{font-size:.75rem;color:var(--color-ink);background:var(--color-paper);padding:.3rem .5rem;border:1px solid var(--color-rule);position:absolute;top:0;right:0;z-index:2;max-width:100%;box-sizing:border-box}
[aria-busy="true"]>.matrix-question-with-views .analysis-view,[aria-busy="true"]>.statement-analysis-population,[aria-busy="true"]>.statement-analysis-comparison{opacity:.4;pointer-events:none}

/* A presentation profile beside the existing population controls. */
.education-profile-control{display:flex;align-items:center;gap:.45rem;max-width:100%;min-width:0;font-size:.78rem;color:var(--theme-foreground-muted);margin:.25rem 0;}
.education-profile-control select{font:inherit;color:var(--theme-foreground);background:var(--color-paper);border:1px solid var(--color-rule-strong);border-radius:999px;padding:.35rem .6rem;max-width:16rem;min-width:0;}
.education-profile-control select:focus-visible,.education-profile-background button:focus-visible{outline:2px solid #2d6b9a;outline-offset:3px;}
.education-profile-background{border:0;padding:.4rem 0;margin:.5rem 0 1rem;display:flex;flex-wrap:wrap;gap:.35rem;min-width:0;}
.education-profile-background legend{font-size:.8rem;line-height:1.4;margin-bottom:.4rem;}
.education-profile-background button{font:inherit;font-size:.78rem;border:1px solid var(--ui-rule, #d1d8de);border-radius:1rem;background:transparent;color:inherit;padding:.35rem .65rem;white-space:normal;}
.education-profile-background button[aria-pressed="true"]{background:var(--ui-accent-soft, #e9f1f8);border-color:#5981a4;}
.education-profile-status{font-size:.8rem;line-height:1.5;color:var(--theme-foreground-muted);}
.education-profile-background-results{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:1.2rem;min-width:0;}
.education-profile-background-series{min-width:0;max-width:100%;}
.education-profile-background-series h3{font-size:.95rem;margin:.4rem 0;}
.education-profile-background-n{font-size:.8rem;margin:.2rem 0;}
.education-profile-background-series svg{max-width:100%;height:auto;}
@media(max-width:520px){.education-profile-control{flex-wrap:wrap;gap:.2rem .4rem;}.education-profile-control select{max-width:100%;}.education-profile-background-results{grid-template-columns:minmax(0,1fr);}}
@media(max-width:700px){.single-page-prototype .education-profile-control{box-sizing:border-box;padding-left:1.65rem;width:100%;}}
.education-waffle__legend-button.is-muted{opacity:.4;}
.education-profile-background button:disabled{opacity:.5;cursor:default;}
.education-profile-background-status{position:sticky;top:calc(var(--single-page-anchor-offset) - 16px);z-index:8;background:var(--color-paper);font-size:.78rem;line-height:1.4;padding:.3rem 0;margin:.3rem 0;}
.background-chapter:has(> .education-profile-background-status) .background-section{scroll-margin-top:calc(var(--single-page-anchor-offset) + 4rem);}
.analysis-view__sample-n{font-size:.72rem;color:var(--color-muted);font-weight:400;white-space:nowrap;}
.analysis-view__profile-n{display:block;font-size:.68rem;color:var(--color-muted);font-weight:400;}

/* ---------------------------------------------------------------------- */
/* Mobile toolbar disclosure: a sticky ~44px handle that toggles the full */
/* toolbar panel on narrow screens. Desktop keeps the original toolbar    */
/* layout and never renders the handle.                                   */
/* ---------------------------------------------------------------------- */
.single-page-prototype__toolbar-handle{display:none}
@media(max-width:600px){
  .single-page-prototype__toolbar-handle{
    display:flex;align-items:center;gap:.4rem;
    position:sticky;top:0;z-index:11;
    width:100%;min-height:44px;padding:.5rem .9rem;
    background:var(--color-paper);
    border:0;border-block:1px solid var(--color-rule-strong);
    border-radius:8px;
    font:500 .9rem/1.2 var(--font-sans);color:inherit;
    text-align:left;cursor:pointer;
  }
  .single-page-prototype__toolbar-handle:focus-visible{outline:2px solid var(--color-focus,#2a5fa0);outline-offset:-2px}
  .single-page-prototype__toolbar-handle-label{font-weight:600;flex-shrink:0}
  .single-page-prototype__toolbar-handle-meta{color:var(--color-muted);font-weight:400;font-size:.8rem;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .single-page-prototype__toolbar-handle-chevron{flex-shrink:0;margin-left:auto;transition:transform 150ms}
  .single-page-prototype__toolbar-handle[aria-expanded="true"] .single-page-prototype__toolbar-handle-chevron{transform:rotate(180deg)}
  .single-page-prototype__toolbar-handle[data-has-active="true"] .single-page-prototype__toolbar-handle-label{color:var(--color-accent,var(--ui-accent, #2a5fa0))}

  /* Panel: hidden by default, becomes visible when handle is expanded. */
  .single-page-prototype__toolbar-handle[aria-expanded="false"] + .single-page-prototype__toolbar{display:none}
  .single-page-prototype__toolbar-handle[aria-expanded="true"] + .single-page-prototype__toolbar{
    position:sticky;top:44px;z-index:10;
    max-height:70vh;overflow-y:auto;
    border-block-end:1px solid var(--color-rule);
    background:var(--color-paper);
    padding-block:.5rem;
  }
}

/* ---------------------------------------------------------------------- */
/* Three-layer toolbar: semantically separate contextual stacks pinned     */
/* under one sticky container. The global layer carries session-wide       */
/* controls (education profile, filter trigger, N); the question layer     */
/* carries the active question's heading + comparison + view selector;     */
/* and the details layer (desktop only) carries presentation controls.    */
/* ---------------------------------------------------------------------- */
.single-page-prototype__toolbar{
  --toolbar-inline-padding:0px;
  display:block;
  box-sizing:border-box;
  width:100%;
  padding:0;
  background:var(--color-surface);
}
.results-toolbar-layer{box-sizing:border-box;min-width:0}
.results-toolbar-global{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) auto;
  align-items:end;
  gap:.4rem;
  padding:.55rem var(--toolbar-inline-padding);
  background:var(--color-accent-soft);
}
.single-page-prototype__toolbar .results-toolbar-global > .education-profile-control{
  display:grid;
  gap:.15rem;
  width:auto;
  padding-left:0;
  margin:0;
  color:var(--color-ink);
}
.single-page-prototype__toolbar .education-profile-control select{
  box-sizing:border-box;width:100%;max-width:none;min-height:2.15rem;
}
.single-page-prototype__toolbar .results-toolbar-global > .analysis-population{
  display:flex;align-self:center;width:auto;margin:0;
}
.results-toolbar-question{
  padding:.5rem var(--toolbar-inline-padding) 0;
  border-top:1px solid var(--color-rule-strong);
  background:var(--color-surface);
}
.results-toolbar-question[hidden]{display:none}
.results-toolbar-question > .analysis-heading{margin-bottom:.4rem}
.single-page-prototype__toolbar .results-toolbar-question .b2-control-toolbar{display:block!important}
.single-page-prototype .results-toolbar-question .analysis-controls{gap:0}
.results-toolbar-question .analysis-controls__context{padding:.4rem 0}
.results-toolbar-question .analysis-controls__views{padding:.35rem 0}
.single-page-prototype .results-toolbar-details{
  display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .8rem;
  order:2;
  margin-inline:calc(-1 * var(--toolbar-inline-padding));
  padding:.45rem var(--toolbar-inline-padding);
  border-top:1px solid var(--color-rule);
  background:var(--color-filter-surface);
}
.single-page-prototype .results-toolbar-details .analysis-controls__order{flex:1;min-width:0}
@media(min-width:720px){
  #observablehq-center:has(.single-page-prototype){margin-inline:0}
  .single-page-prototype.page{
    max-width:none;
    margin-inline:0;
    padding-inline:var(--space-4);
  }
  .single-page-prototype > .single-page-prototype__toolbar{
    --toolbar-inline-padding:var(--space-4);
    width:calc(100% + 2 * var(--space-4));
    margin-inline:calc(-1 * var(--space-4));
  }
}
@media(max-width:1007px){
  .single-page-prototype__toolbar .results-toolbar-global > .education-profile-control > span{padding-left:1.65rem}
}
@media(max-width:600px){
  .results-toolbar-global{grid-template-columns:repeat(2,minmax(0,1fr));padding-block:.35rem}
  .single-page-prototype__toolbar .results-toolbar-global > .analysis-population{grid-column:1/-1}
  .single-page-prototype__toolbar .results-toolbar-global > .education-profile-control{font-size:.75rem}
  .single-page-prototype .results-toolbar-details{display:none}
}

/* Local Q10 experiment: one model, one legend and the existing waffle. */
.education-waffle__donut{display:none;}
@media(min-width:1200px){
  .background-section__viz .education-waffle--with-donut{max-width:100%;}
  .education-waffle--with-donut .education-waffle__layout{grid-template-columns:minmax(0,240px) minmax(0,340px) minmax(0,1fr);}
  .education-waffle__donut{display:block;width:100%;max-width:240px;height:auto;align-self:center;overflow:visible;}
}
.education-waffle__donut path[data-level]{cursor:pointer;transition:opacity 100ms ease;}
.education-waffle--highlighting .education-waffle__donut path[data-level]{opacity:.35;}
.education-waffle--highlighting .education-waffle__donut path.is-highlighted{opacity:1;stroke:#263746;stroke-width:1.5px;}
.education-waffle__donut-n{font:600 26px var(--font-sans);fill:var(--color-ink);}
.education-waffle__donut-caption{font:12px var(--font-sans);fill:var(--color-muted);}
@media(prefers-reduced-motion:reduce){.education-waffle__donut path[data-level]{transition:none;}}

/* Compact respondent introduction and Q10 work context. */
.background-chapter__population{display:flex;align-items:baseline;gap:.65rem;margin:.5rem 0 0;font-family:var(--font-sans);}
.background-chapter__population strong{font-size:clamp(2rem,4vw,3rem);line-height:1.1;font-variant-numeric:tabular-nums;}
.background-chapter__population span{font-size:.85rem;color:var(--color-muted);}
.single-page-prototype__population[data-intro-visible]{visibility:hidden;}
.background-chapter__intro{scroll-margin-top:var(--single-page-anchor-offset);}
.respondent-work-context{margin:.6rem 0 .8rem;padding-top:.6rem;border-top:1px solid var(--color-rule);font-family:var(--font-sans);font-size:.85rem;}
.respondent-work-context h3{font:600 .95rem var(--font-sans);margin:0;}
.respondent-work-context__scope{color:var(--color-muted);font-size:.75rem;margin:.2rem 0 .5rem;}
.respondent-work-context__metric{margin:.25rem 0;line-height:1.5;}
.respondent-work-context__metric strong{font-size:1.15rem;font-variant-numeric:tabular-nums;}
.respondent-work-context__breakdown{display:flex;flex-wrap:wrap;gap:.3rem 1.1rem;margin:.25rem 0 .65rem;font-size:.78rem;}
.respondent-work-context__breakdown div{display:flex;gap:.35rem;}
.respondent-work-context__breakdown dd{margin:0;font-weight:600;}
.respondent-work-context__metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem 1rem;}
@media(max-width:600px){.respondent-work-context__metrics{grid-template-columns:1fr;gap:0;}.background-chapter__lede{font-size:.85rem;line-height:1.45;}}

/* Global population remains reachable in the existing closed mobile handle. */
.single-page-prototype__toolbar-handle-n{flex:0 0 auto;white-space:nowrap;font-size:.8rem;font-weight:600;font-variant-numeric:tabular-nums;}
@media(min-width:1008px){.single-page-prototype__toolbar .single-page-prototype__population{min-inline-size:10ch;}}
/* Reserve the intro's final desktop lines while its serif font loads. */
@media(min-width:1008px){
  .background-chapter__intro > .background-chapter__lede{min-block-size:4lh;}
  html:lang(sv) .background-chapter__intro > .background-chapter__lede{min-block-size:5lh;}
}

/* Reserve explanation space only while a protected national group is active. */
.results-toolbar-global > .national-lock-explanation{grid-column:1/-1;min-width:0;margin:0;font-size:.75rem;line-height:1.35}
@media(min-width:601px){.results-toolbar-global:has(> .national-lock-explanation){grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1.6fr)}}

/* Desktop: while the reader scrolls down, the filter/compare block (shared
   row and comparison) folds into a compact handle above the presentation
   row; scrolling up restores the block. */
.results-toolbar-question-handle{display:none}
@media(min-width:601px){
  .single-page-prototype[data-question-collapsed] .results-toolbar-global,
  .single-page-prototype[data-question-collapsed] .results-toolbar-question{display:none}
  .single-page-prototype[data-question-collapsed] .results-toolbar-question-handle:not([hidden]){
    display:flex;align-items:center;gap:.4rem;
    box-sizing:border-box;width:100%;min-height:2.25rem;margin:0;
    padding:.3rem var(--toolbar-inline-padding);
    border:0;border-top:1px solid var(--color-rule-strong);
    background:var(--color-surface);color:var(--color-ink);
    font:500 .85rem/1.2 var(--font-sans);text-align:left;cursor:pointer;
  }
  .results-toolbar-question-handle:focus-visible{outline:2px solid var(--color-focus,#2a5fa0);outline-offset:-2px}
  .results-toolbar-question-handle__label{flex-shrink:0;font-weight:600}
  .results-toolbar-question-handle__meta{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-muted);font-weight:400}
  .results-toolbar-question-handle__n{flex-shrink:0;font-weight:600;font-variant-numeric:tabular-nums}
  .results-toolbar-question-handle__n::before{content:"· ";font-weight:400}
  .results-toolbar-question-handle__chevron{flex-shrink:0;margin-left:auto;font-size:1rem;line-height:1}
}

/* Analysis toolbar colours. The shared row is the dark header of the
   toolbar; question controls sit on white. State changes use colour plus
   weight and inset rings so no state changes a control's size. */
.single-page-prototype .single-page-prototype__toolbar{
  --toolbar-header:#24466B;--toolbar-header-hover:#1C3856;--toolbar-on-header:#FFFFFF;
  --toolbar-panel:var(--ui-surface, #FFFFFF);--toolbar-text:var(--ui-ink, #243447);--toolbar-text-muted:var(--ui-ink, #334155);
  --toolbar-control-border:var(--ui-muted, #64748B);--toolbar-active-bg:var(--ui-accent-soft, #DBEAFE);--toolbar-active-text:var(--ui-accent, #173A63);--toolbar-active-border:var(--ui-accent, #315C93);
  --toolbar-hover-bg:var(--ui-accent-soft, #EFF6FF);--toolbar-focus:var(--ui-accent, #173A63);
  background:var(--toolbar-panel);color:var(--toolbar-text);
}
/* Header row: profile, filter and N. */
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-global{background:var(--toolbar-header);color:var(--toolbar-on-header)}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-global > .education-profile-control,
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-global .b2-control-group::before,
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-global .single-page-prototype__population,
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-global .single-page-prototype__population strong,
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-global > .national-lock-explanation{color:var(--toolbar-on-header)}
/* Panel content. */
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-question,
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-details{background:var(--toolbar-panel);color:var(--toolbar-text)}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-details{border-top-color:var(--ui-rule, #CBD5E1)}
.single-page-prototype .single-page-prototype__toolbar .analysis-heading h2,
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__dimension,
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__distribution label{color:var(--toolbar-text)}
.single-page-prototype .single-page-prototype__toolbar .analysis-heading p,
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-question .b2-control-group::before,
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__exit{color:var(--toolbar-text-muted)}
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__distribution input{accent-color:var(--toolbar-active-border)}
/* Fields: white with a 3:1 border in both rows. */
.single-page-prototype .single-page-prototype__toolbar .b2-control-trigger{border-color:var(--toolbar-control-border)!important;background:var(--toolbar-panel)!important;color:var(--toolbar-text)!important}
.single-page-prototype .single-page-prototype__toolbar .b2-control-trigger::after{color:var(--toolbar-text-muted)}
.single-page-prototype .single-page-prototype__toolbar select{border:1px solid var(--toolbar-control-border);background-color:var(--toolbar-panel);color:var(--toolbar-text)}
.single-page-prototype .single-page-prototype__toolbar select:disabled{border-color:#94A3B8;background-color:var(--ui-surface-soft, #F1F5F9);color:var(--ui-muted, #475569);cursor:not-allowed}
.single-page-prototype .single-page-prototype__toolbar .b2-control-trigger:hover,
.single-page-prototype .single-page-prototype__toolbar select:not(:disabled):hover{border-color:var(--toolbar-active-border)!important;box-shadow:inset 0 0 0 1px var(--toolbar-active-border)}
/* Segmented choices: modes and views. Inactive choices carry a 3:1 ring;
   the active one adds fill, darker text, weight and a 2px ring. */
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__modes label,
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__views .result-view-selector__tab{color:var(--toolbar-text);background:var(--toolbar-panel);box-shadow:inset 0 0 0 1px var(--toolbar-control-border)}
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__modes label:hover,
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__views .result-view-selector__tab:hover{background:var(--toolbar-hover-bg);box-shadow:inset 0 0 0 1px var(--toolbar-active-border)}
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__modes label:has(:checked),
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__views .result-view-selector__tab:has(:checked){background:var(--toolbar-active-bg);color:var(--toolbar-active-text);font-weight:700;box-shadow:inset 0 0 0 2px var(--toolbar-active-border)}
/* Focus rings sit outside the control and never change its box. */
.single-page-prototype .single-page-prototype__toolbar .analysis-controls label:has(:focus-visible),
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation label:has(:focus-visible),
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-question :is(button,select):focus-visible,
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-details :is(button,select):focus-visible{outline:2px solid var(--toolbar-focus);outline-offset:2px}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-global:is(button,select):focus-visible{outline:2px solid var(--toolbar-on-header);outline-offset:2px}
/* Handles share the header colour. */
.single-page-prototype[data-question-collapsed] .results-toolbar-question-handle:not([hidden]),
.single-page-prototype .single-page-prototype__toolbar-handle{background:#24466B;color:#FFFFFF;border-color:#24466B}
.single-page-prototype[data-question-collapsed] .results-toolbar-question-handle:not([hidden]){border-top:0}
.single-page-prototype .results-toolbar-question-handle .results-toolbar-question-handle__meta,
.single-page-prototype .single-page-prototype__toolbar-handle .single-page-prototype__toolbar-handle-meta{color:#DBEAFE}
.single-page-prototype .results-toolbar-question-handle[data-has-active="true"] .results-toolbar-question-handle__label,
.single-page-prototype .single-page-prototype__toolbar-handle[data-has-active="true"] .single-page-prototype__toolbar-handle-label{color:#FFFFFF;text-decoration:underline;text-underline-offset:3px}
.single-page-prototype[data-question-collapsed] .results-toolbar-question-handle:not([hidden]):hover,
.single-page-prototype .single-page-prototype__toolbar-handle:hover{background:#1C3856}
.single-page-prototype .results-toolbar-question-handle:focus-visible,
.single-page-prototype .single-page-prototype__toolbar-handle:focus-visible{outline:2px solid var(--ui-rule, #FFFFFF);outline-offset:-4px}
/* Observable's fixed 44px sidebar button sits over the dark toolbar on
   narrow screens. Give its unchanged hit target a light chip so the icon
   reads on any background, and start the mobile handle text beside it. */
@media(max-width:1007px){
  html:has(.single-page-prototype) #observablehq-sidebar-toggle{
    box-sizing:border-box;border:1px solid var(--ui-rule-strong, #64748B);border-radius:8px;
    background:var(--ui-surface, #FFFFFF);color:var(--ui-accent, #24466B);
  }
  html:has(.single-page-prototype) #observablehq-sidebar-toggle:focus-visible{outline:2px solid #173A63;outline-offset:2px}
}
@media(max-width:600px){
  .single-page-prototype .single-page-prototype__toolbar-handle{padding-left:calc(2.75rem - var(--handle-left,1rem) + .6rem)}
}
@media(min-width:601px) and (max-width:1007px){
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-global{padding-left:calc(2.75rem + .5rem)}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-global > .education-profile-control > span{padding-left:0}
}
/* The toolbar opens the results page: no framework spacing above it. */
#observablehq-center:has(.single-page-prototype),
#observablehq-main:has(.single-page-prototype),
.observablehq--block:has(> .single-page-prototype){margin-top:0}
.single-page-prototype.page{padding-top:0}

/* Presentation row: view, distribution and order for question sections.
   It belongs to the sticky toolbar and never folds with the filter block. */
.results-toolbar-presentation{
  box-sizing:border-box;padding:0 var(--toolbar-inline-padding);
  border-top:1px solid var(--color-rule-strong);background:var(--color-surface);
}
.results-toolbar-presentation[hidden]{display:none}
.results-toolbar-presentation .analysis-controls__views{padding:.35rem 0}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation{background:var(--toolbar-panel);color:var(--toolbar-text)}
.results-toolbar-question{padding-bottom:.4rem}
.results-toolbar-presentation .analysis-controls__views input{position:absolute;width:1px;height:1px;opacity:0}
.results-toolbar-presentation label:has(:focus-visible){outline:2px solid var(--color-accent);outline-offset:2px}
/* Narrow screens: the closed handle hides only the filter/compare block. */
@media(max-width:600px){
  .single-page-prototype .single-page-prototype__toolbar-handle[aria-expanded="false"] + .single-page-prototype__toolbar{display:block;position:sticky;top:44px;z-index:10}
  .single-page-prototype .single-page-prototype__toolbar-handle[aria-expanded="false"] + .single-page-prototype__toolbar > :not(.results-toolbar-presentation){display:none}
  .single-page-prototype .single-page-prototype__toolbar-handle{min-height:44px;box-sizing:border-box}
}

/* Presentation row as a dashboard control strip: one segmented control for
   the four views and two compact labelled selects for distribution and
   order. Overrides the earlier pill styling only inside this row. */
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__caption{
  display:block;margin:0;padding:0;font:600 .72rem/1.2 var(--font-sans);letter-spacing:.02em;color:var(--ui-ink, #334155);
}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views{
  display:flex;flex-wrap:nowrap;gap:0;width:100%;max-width:40rem;padding:.35rem 0 .4rem;
}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views > legend{margin-bottom:.2rem;text-transform:uppercase}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab{
  position:relative;flex:1 1 0;justify-content:center;box-sizing:border-box;min-width:0;min-height:2rem;margin:0;
  padding:.3rem .6rem;border:1px solid var(--ui-rule-strong, #64748B);border-left-color:#94A3B8;border-radius:0;box-shadow:none;
  background:var(--ui-surface-soft, #F1F5F9);color:var(--ui-ink, #334155);font:500 .8rem/1.2 var(--font-sans);text-align:center;white-space:nowrap;cursor:pointer;
}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab + .result-view-selector__tab{margin-left:-1px}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:first-of-type{border-left-color:var(--ui-rule-strong, #64748B);border-radius:5px 0 0 5px}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:last-of-type{border-radius:0 5px 5px 0}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:hover{background:var(--ui-accent-soft, #E2E8F0);color:var(--ui-ink, #243447);box-shadow:none}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:has(:checked){
  z-index:1;border-color:#24466B;background:#24466B;color:#FFFFFF;font-weight:700;box-shadow:inset 0 -3px 0 #DBEAFE;
}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:has(:focus-visible){z-index:2;outline:2px solid #173A63;outline-offset:2px}
/* Distribution and order: labelled selects, shown only when they apply. */
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .results-toolbar-details{
  display:flex;flex-wrap:wrap;align-items:center;gap:.35rem 1.5rem;margin:0;padding:0 0 .45rem;border:0;background:transparent;
}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation:is(.analysis-controls__distribution,.analysis-controls__order){
  display:flex;align-items:center;gap:.5rem;flex:0 1 auto;order:0;width:auto;max-width:100%;min-width:0;margin:0;font-size:.8rem;
}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__order{flex:0 1 26rem}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation:is(.analysis-controls__distribution,.analysis-controls__order) .analysis-controls__caption{flex-shrink:0;white-space:nowrap}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation:is(.analysis-controls__distribution,.analysis-controls__order) select{
  box-sizing:border-box;min-width:0;width:auto;max-width:100%;height:2rem;margin:0;padding:.2rem .5rem;
  border:1px solid var(--ui-rule-strong, #64748B);border-radius:5px;background-color:var(--ui-surface, #FFFFFF);color:var(--ui-ink, #243447);font:400 .8rem/1.2 var(--font-sans);box-shadow:none;
}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__order select{flex:1 1 auto}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation select:not(:disabled):hover{border-color:#315C93;box-shadow:inset 0 0 0 1px #315C93}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation select:focus-visible{outline:2px solid #173A63;outline-offset:2px}
.single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation:is(.analysis-controls__distribution,.analysis-controls__order):has(:focus-visible){outline:none}
@media(max-width:600px){
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views{padding:.3rem 0}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab{padding:.3rem .2rem;font-size:.74rem}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .results-toolbar-details{display:grid;grid-template-columns:minmax(0,1fr);gap:.3rem .5rem;padding-bottom:.35rem}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation:is(.analysis-controls__distribution,.analysis-controls__order){display:grid;gap:.1rem;width:100%}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation:is(.analysis-controls__distribution,.analysis-controls__order) select{width:100%;height:1.9rem;font-size:.76rem}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__caption{font-size:.68rem}
  /* The segment labels name themselves; keep the group name for screen readers only. */
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views > legend{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}

/* Selected comparison groups: native checkboxes in the comparison part of
   Suodata / vertaile. */
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__group{
  display:flex;flex-wrap:wrap;gap:.3rem .9rem;max-width:none;width:100%;margin:0;padding:.15rem 0 0;border:0;
}
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__group-option{
  display:inline-flex;align-items:center;gap:.35rem;min-height:1.75rem;font-size:.8rem;color:var(--toolbar-text,var(--ui-ink, #243447));cursor:pointer;
}
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__group-option input{
  position:static;width:1rem;height:1rem;margin:0;opacity:1;accent-color:#24466B;
}
.single-page-prototype .single-page-prototype__toolbar .analysis-controls__group-option:has(:focus-visible){outline:2px solid #173A63;outline-offset:2px}

/* Exact distribution table: share above the count in each response cell. */
.analysis-view__table--distribution th[scope="col"]{vertical-align:bottom;white-space:nowrap}
.analysis-view__table--distribution tbody:is(th,td){vertical-align:top}
.analysis-view .analysis-view__table--distribution th[scope="row"]{min-width:8.5rem;max-width:11rem;overflow-wrap:normal;hyphens:manual}
.analysis-view__table-scale{display:block;max-width:7rem;font-weight:400;font-size:.68rem;line-height:1.2;color:var(--ui-ink, #334155);white-space:normal}
.analysis-view__table-share{white-space:nowrap}
.analysis-view__table-count{display:block;font-size:.68rem;color:var(--ui-muted, #475569)}

/* Five presentation choices wrap into a compact grid on narrow screens. */
@media(max-width:600px){
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views{display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab{grid-column:span 2;margin:0 0 -1px -1px;border-radius:0;border-left-color:var(--ui-rule-strong, #64748B)}
  .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:nth-of-type(n+4){grid-column:span 3}
}

/* Masked N=1 comparison group: name and N only, no result. */
.analysis-view .analysis-view__line--masked .analysis-view__masked{grid-column:2/-1;font-size:.74rem;font-style:italic;color:#475569}
.analysis-view td.analysis-view__masked{text-align:left;font-size:.74rem;font-style:italic;color:#475569}
.analysis-view__masked-note strong{font-weight:600;color:#334155}
.analysis-controls__group-option .analysis-controls__group-n{font-size:.72rem;color:#475569}
@media(max-width:719px){.analysis-view .analysis-view__line--masked .analysis-view__masked{grid-column:1/-1}}

/* Compact result controls share one row; their lists live in the top layer. */
.single-page-prototype .results-toolbar--compact .results-toolbar-question { display:none; }
.single-page-prototype .results-toolbar--compact .results-toolbar-global {
  display:flex; align-items:center; flex-wrap:wrap; gap:.35rem;
  padding:.4rem var(--toolbar-inline-padding);
}
.single-page-prototype .results-toolbar--compact .results-toolbar-global > :is(.b2-control-group,.b2-control-trigger) { flex:0 1 auto; min-width:0; }
.single-page-prototype .results-toolbar--compact .results-toolbar-global > .analysis-population { margin-inline-start:auto; flex:0 0 auto; }
.single-page-prototype .results-toolbar--compact .results-toolbar-global .b2-control-group::before { content:none; }
.single-page-prototype .results-toolbar--compact .results-toolbar-global .b2-control-trigger {
  display:flex; align-items:center; gap:.35rem; width:auto!important; max-width:100%;
  min-height:44px!important; margin:0; padding:.25rem 1.5rem .25rem .65rem!important;
  border-radius:.35rem!important;
}
.single-page-prototype .results-toolbar--compact .results-toolbar-global > [data-control="compare"] {
  display:flex; align-items:center; gap:.5rem;
}
html.site-shell .single-page-prototype .results-toolbar--compact .single-page-prototype__population {
  border:0; border-radius:0; min-inline-size:0; padding:.25rem .2rem;
}
.single-page-prototype .results-toolbar--compact .results-toolbar-global :is(.b2-control-trigger,.b2-control-group)[hidden] { display:none; }
.results-tools-popover .results-layout-switch {
  width: fit-content;
  min-height: 2.5rem;
  margin-top: .35rem;
  padding: .3rem .65rem;
  border-radius: .35rem;
}
.results-toolbar--compact .results-toolbar-status {
  min-width:0; max-width:11rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  padding-inline-start:.45rem;
  border-inline-start:1px solid var(--color-filter-border);
  font-size:.76rem; font-weight:500; color:var(--ui-nav-ink);
}
.results-toolbar--compact .b2-control-trigger__label { flex-shrink:0; }

.single-page-prototype .results-toolbar--compact .results-toolbar-global > .active-filters--compact {
  flex:1 0 100%; gap:.3rem; min-width:0; margin:0; padding:0;
}
.single-page-prototype .results-toolbar--compact .active-filters__chip { max-width:100%; overflow-wrap:anywhere; }
.single-page-prototype .results-toolbar--compact .active-filters__remove { flex-shrink:0; }
/* Comparison popover: one column the width of the filter popover. A compact
 * segmented control chooses the way to compare; its content uses the whole
 * width below it, and the shown-groups filter follows under a rule. */
.b2-top-layer.b2-top-layer--compare-workspace {
  width:min(38rem, calc(100vw - 1.5rem));
}
.b2-top-layer--compare-workspace .b2-top-layer__body {
  display:block;
  padding:.5rem .9rem .8rem;
  overflow-y:auto;
  scrollbar-gutter:auto;
  box-shadow:none;
}
.b2-top-layer--compare-workspace .compare-selector__heading { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.results-comparison-options .analysis-controls__dimension {
  margin:0;
  font-size:.8rem;
  font-weight:650;
  color:var(--color-ink);
}
.b2-top-layer--compare-workspace .compare-selector__inputs {
  display:block;
}
.b2-top-layer--compare-workspace .compare-selector__groups {
  columns:2 15rem;
  column-gap:1rem;
}
.b2-top-layer--compare-workspace .compare-selector__group {
  break-inside:avoid;
  margin:0 0 .35rem;
  padding:0;
  border:0;
  min-width:0;
}
.b2-top-layer--compare-workspace .compare-selector__group-label {
  padding:.3rem 0 .1rem;
  color:var(--color-muted);
  font-size:.7rem;
  font-weight:650;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.b2-top-layer--compare-workspace .compare-selector__option {
  min-height:1.85rem;
  padding:.2rem .4rem;
  gap:.45rem;
  box-sizing:border-box;
  font-size:.85rem;
  overflow-wrap:anywhere;
}
.b2-top-layer--compare-workspace .compare-selector__option:has(:checked) {
  background:var(--color-filter-hover);
  font-weight:650;
}
.b2-top-layer--compare-workspace .compare-selector__select { display:none; }
.results-comparison-options:not([hidden]) {
  display:block;
  box-sizing:border-box;
  width:auto;
  min-width:0;
  margin-top:.6rem;
  padding:.55rem 0 0;
  border-top:1px solid var(--color-rule);
}
.results-comparison-options__hint {
  margin:0;
  font-size:.85rem;
  color:var(--color-muted);
}
.results-comparison-options__header {
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:space-between;
  gap:.15rem .7rem;
}
.results-comparison-options__header .analysis-controls__dimension { margin:0; }
.results-comparison-options__reset {
  min-height:1.85rem;
  padding:0 .2rem;
  border:0;
  background:transparent;
  color:var(--color-accent);
  font:inherit;
  font-size:.8rem;
  text-decoration:underline;
  text-underline-offset:.18em;
  cursor:pointer;
}
.results-comparison-options__reset:disabled {
  color:var(--color-muted);
  text-decoration:none;
  cursor:default;
}
@media (max-width:719px) {
  .b2-top-layer--compare-workspace .compare-selector__inputs { display:none; }
  .b2-top-layer--compare-workspace .compare-selector__select {
    display:block;
    width:100%;
    min-height:2.75rem;
    padding:.4rem .55rem;
    border:1px solid var(--color-filter-border);
    border-radius:.35rem;
    background:var(--color-surface);
    color:var(--color-ink);
    font:inherit;
  }
}
.results-comparison-options .analysis-controls__group:not([hidden]) {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap:.25rem .75rem;
  width:100%; max-width:none; margin:0; padding:0; border:0;
}
.results-comparison-options .analysis-controls__group-option {
  display:flex; align-items:center; gap:.35rem; min-height:1.85rem; font-size:.85rem;
}
/* Compact job-title sections inside the comparison popover. */
.b2-top-layer--compare-workspace .results-jobtitle-groups > details > summary { min-height:2rem; padding-block:.2rem; font-size:.85rem; }
.b2-top-layer--compare-workspace .results-comparison-options__header { align-items:center; }
@media (pointer:coarse) {
  .b2-top-layer--compare-workspace .results-jobtitle-groups > details > summary,
  .results-comparison-options .analysis-controls__group-option,
  .b2-top-layer--compare-workspace .compare-selector__option { min-height:2.5rem; }
}
.results-comparison-options .analysis-controls__group-option input {
  margin:0; accent-color:var(--color-accent);
}
.single-page-prototype .results-toolbar--compact .results-tools-popover .results-toolbar-presentation {
  padding:0; border:0; background:transparent;
}
.results-tools-popover [data-distribution-only] .analysis-controls__views {
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.results-tools-popover [data-distribution-only] .result-view-selector__tab {
  min-height:44px;
}
@media (max-width:600px) {
  html.site-shell .single-page-prototype > .single-page-prototype__toolbar.results-toolbar--compact {
    top:var(--site-navigation-height); padding:0;
  }
}
/* Below the desktop width the controls sit in a fixed grid instead of wrapping
   by content width: label over value, equal heights, N as a plain figure. */
@media (max-width:1007px) {
  html.site-shell .single-page-prototype > .single-page-prototype__toolbar.results-toolbar--compact {
    border-bottom:1px solid var(--color-rule);
  }
  html.site-shell .single-page-prototype > .single-page-prototype__toolbar.results-toolbar--compact > .results-toolbar-global {
    display:grid; align-items:stretch; gap:6px; padding:6px 8px;
    grid-template-columns:repeat(3,max-content) minmax(max-content,1fr);
    grid-template-areas:"filters compare tools population";
  }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global > [data-control="filters"] { grid-area:filters; }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global > [data-control="compare"] { grid-area:compare; }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global > .results-tools-trigger { grid-area:tools; }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global > .analysis-population {
    grid-area:population; justify-self:end; align-self:center; margin:0; min-height:0; white-space:nowrap;
  }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global > :is(.active-filters--compact,.national-lock-explanation) { grid-column:1/-1; }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global > .b2-control-group { display:flex; min-width:0; }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global
    :is(.b2-control-group > .b2-control-trigger, .results-tools-trigger) {
    width:100%!important; height:100%; min-height:44px!important; box-sizing:border-box;
    flex-direction:column; justify-content:center; align-items:flex-start; gap:0;
  }
  .results-toolbar--compact .results-toolbar-status {
    width:100%; max-width:100%; box-sizing:border-box;
    padding:0; border:0; font-size:.68rem;
  }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global > [data-control="compare"] .b2-control-trigger { flex-shrink:0; }
  .single-page-prototype .results-toolbar--compact .single-page-prototype__population strong { font-size:.85rem; }
  .results-toolbar--compact .b2-control-trigger__label[data-short-label] { font-size:0; }
  .results-toolbar--compact .b2-control-trigger__label[data-short-label]::before { content:attr(data-short-label); font-size:.78rem; }
  .results-toolbar--compact .results-tools-trigger .results-toolbar-status[data-short-label] { font-size:0; }
  .results-toolbar--compact .results-tools-trigger .results-toolbar-status[data-short-label]::before {
    content:attr(data-short-label); font-size:.68rem;
  }
}
@media (max-width:639px) {
  html.site-shell .single-page-prototype > .single-page-prototype__toolbar.results-toolbar--compact > .results-toolbar-global {
    grid-template-columns:minmax(0,.85fr) minmax(0,1.35fr) minmax(0,1fr) max-content;
  }
  html.site-shell .single-page-prototype > .single-page-prototype__toolbar.results-toolbar--compact > .results-toolbar-global:not(:has(> .results-tools-trigger:not([hidden]))) {
    grid-template-columns:minmax(0,1fr) minmax(0,1.35fr) auto;
    grid-template-areas:"filters compare population";
  }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global
    :is(.b2-control-group > .b2-control-trigger, .results-tools-trigger) {
    padding:.2rem 1rem .2rem .35rem!important;
  }
  .single-page-prototype .results-toolbar--compact .results-toolbar-global .b2-control-trigger::after {
    right:.35rem;
  }
}

.results-comparison-options .results-jobtitle-groups:not([hidden]) {
  grid-template-columns:minmax(0,1fr);
  gap:0;
}
.results-jobtitle-groups > details {
  margin:0;
  padding:0;
  border:0;
  border-bottom:1px solid var(--color-rule);
}
.results-jobtitle-groups > details > summary {
  display:flex;
  align-items:center;
  gap:.6rem;
  list-style:none;
  min-height:44px;
  box-sizing:border-box;
  margin:0;
  padding:.55rem .2rem;
  border:0;
  font-size:.85rem;
  font-weight:650;
  cursor:pointer;
}
.results-jobtitle-groups > details > summary:focus-visible {
  outline:2px solid var(--color-focus);
  outline-offset:-2px;
}
.results-jobtitle-groups__options {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr));
  gap:.25rem .6rem;
  padding:0 .2rem .45rem;
}
.results-jobtitle-groups > details > summary::-webkit-details-marker { display:none; }
.results-jobtitle-groups > details > summary::before {
  content:"";
  flex:none;
  width:.42rem;
  height:.42rem;
  border:solid var(--color-accent);
  border-width:0 2px 2px 0;
  transform:rotate(-45deg);
}
.results-jobtitle-groups > details[open] > summary::before { transform:rotate(45deg); }
/* Group rows of the shared comparison in the respondents chapter. */
.background-group-rows{min-width:0;max-width:100%;}
.background-group-rows__legend{display:flex;flex-wrap:wrap;gap:.3rem .9rem;margin:.2rem 0 .6rem;font-size:.82rem;}
.background-group-rows__legend-item{display:inline-flex;align-items:center;gap:.35rem;}
.background-group-rows__legend i{display:inline-block;width:.8rem;height:.8rem;border-radius:2px;}
.background-group-rows svg{max-width:100%;height:auto;}
/* Q7–Q9: one map beside the three question steps. */
.respondent-map-story{display:grid;grid-template-columns:minmax(0,.72fr) minmax(0,1.6fr);gap:1.2rem;align-items:start;min-width:0;}
.respondent-map-story__steps{display:grid;gap:1rem;min-width:0;}
.respondent-map-story__steps>.background-section{min-height:62vh;}
.respondent-map-story__visual{position:sticky;top:var(--single-page-anchor-offset,9rem);min-width:0;padding:1rem;border:1px solid var(--color-rule);border-radius:1rem;background:var(--color-surface);}
.respondent-map-story__lede{margin:.4rem 0 .8rem;color:var(--color-ink);}
.respondent-map-story__show{font:inherit;font-size:.85rem;padding:.35rem .8rem;border:1px solid var(--color-rule);border-radius:999px;background:transparent;color:inherit;cursor:pointer;}
.respondent-map-story__note:empty{display:none;}
.respondent-map-story__note{margin:.3rem 0;color:var(--color-muted);font-size:.85rem;}
.respondent-map__modes{margin-top:0;}
.respondent-map-story__caption{margin:0 0 .2rem;font-size:.75rem;font-weight:600;color:var(--color-muted);text-transform:uppercase;letter-spacing:.04em;}
.respondent-map-story__groups .experience-comparison__controls{margin-top:.2rem;}
/* Work-context story (thematic layout): steps on the left, one chart panel beside them on wide screens. */
.work-context-story{display:grid;gap:.8rem;min-width:0;}
.work-context-story__nav{display:flex;flex-wrap:wrap;gap:.4rem;}
.work-context-story__nav-button{display:inline-flex;align-items:center;gap:.45rem;min-height:44px;padding:.3rem .85rem;border:1px solid var(--color-rule);border-radius:999px;background:transparent;color:inherit;font:inherit;font-size:.85rem;cursor:pointer;}
.work-context-story__nav-button[aria-current="step"]{border-color:var(--color-accent);font-weight:600;box-shadow:inset 0 0 0 1px var(--color-accent);}
.work-context-story__nav-number{display:inline-grid;place-items:center;width:1.4rem;height:1.4rem;border:1px solid currentColor;border-radius:50%;font-size:.72rem;}
.work-context-story__grid{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;min-width:0;}
.work-context-story__steps{display:grid;gap:1rem;min-width:0;}
.work-context-story__steps>[data-work-step]{min-width:0;scroll-margin-top:var(--single-page-anchor-offset,9rem);}
.work-context-story__kicker{margin:0;color:var(--color-muted);font-size:.75rem;font-weight:600;letter-spacing:.04em;}
.work-context-story__question{margin:.2rem 0 .4rem;color:var(--color-ink);font-size:1.05rem;font-weight:600;}
.work-context-story__intro,.work-context-story__finding{margin:.35rem 0;max-width:62ch;}
.work-context-story__finding{padding-left:.7rem;border-left:3px solid var(--color-accent);}
.work-context-story__level-control{margin:.7rem 0;}
.work-context-story__levels-label{margin:0 0 .3rem;color:var(--color-muted);font-size:.8rem;font-weight:600;}
.work-context-story__levels{display:flex;flex-wrap:wrap;gap:.35rem;}
.work-context-story__level{min-height:44px;padding:.3rem .75rem;border:1px solid var(--color-rule);border-radius:.6rem;background:var(--color-surface);color:inherit;font:inherit;font-size:.85rem;text-align:left;cursor:pointer;}
.work-context-story__level[aria-pressed="true"]{border-color:var(--color-accent);box-shadow:inset 0 0 0 1px var(--color-accent);font-weight:600;}
.work-context-story__hint{margin:.3rem 0 0;color:var(--color-muted);font-size:.78rem;}
.work-context-story button:focus-visible,.work-context-story a:focus-visible{outline:3px solid var(--color-focus,var(--color-accent));outline-offset:2px;}
.work-context-story__panel{min-width:0;margin-top:.6rem;padding:.9rem;border:1px solid var(--color-rule);border-radius:1rem;background:var(--color-surface);}
.work-context-chart__header{margin-bottom:.7rem;}
.work-context-chart__title{margin:0;font-weight:600;}
.work-context-chart__meta,.work-context-chart__note,.work-context-chart__status{margin:.2rem 0;color:var(--color-muted);font-size:.82rem;}
.work-context-chart__note{margin-top:.7rem;}
.work-context-chart__toggle{min-height:44px;margin-top:.7rem;padding:.3rem .85rem;border:1px solid var(--color-rule);border-radius:999px;background:transparent;color:inherit;font:inherit;font-size:.85rem;cursor:pointer;}
.work-context-bars{display:grid;gap:.5rem;margin:0;padding:0;list-style:none;}
.work-context-bars__row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.2rem .6rem;align-items:baseline;}
.work-context-bars__label{font-size:.86rem;overflow-wrap:break-word;hyphens:auto;}
.work-context-bars__value{color:var(--color-muted);font-size:.8rem;font-variant-numeric:tabular-nums;white-space:nowrap;}
.work-context-bars__bar{grid-column:1/-1;height:.55rem;overflow:hidden;border-radius:999px;background:var(--color-rule);}
.work-context-bars__fill{display:block;height:100%;border-radius:inherit;background:var(--color-accent);}
.work-context-bars__row--suppressed .work-context-bars__value{font-style:italic;}
.respondent-treemap__withheld{margin:.5rem 0 0;color:var(--color-muted);font-size:.82rem;}
.work-context-story__panel .leadership-context__links{display:grid;gap:.5rem;margin:.2rem 0 0;padding:0;list-style:none;}
.work-context-story__panel .leadership-context__links a{display:flex;align-items:center;min-height:44px;padding:.55rem .85rem;border:1px solid var(--color-rule);border-radius:.7rem;color:inherit;font-weight:600;text-decoration:none;}
.work-context-story__panel .leadership-context__links a::after{content:"→";margin-left:auto;padding-left:.6rem;}
@media (min-width:1008px) and (min-height:700px){
  .work-context-story__grid{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);align-items:start;}
  /* Space between the steps lets the reading position move the chart without stretching the cards. */
  .work-context-story__steps{gap:34vh;padding-bottom:20vh;}
  .work-context-story__steps>[data-work-step]{transition:opacity .2s ease;}
  .work-context-story__steps>[data-work-step]:not(.is-active){opacity:.6;}
  .work-context-story__visual{position:sticky;top:var(--single-page-anchor-offset,9rem);max-height:calc(100vh - var(--single-page-anchor-offset,9rem) - 1rem);overflow:auto;}
  .work-context-story__visual>.work-context-story__panel{margin-top:0;}
  .work-context-story__visual>.work-context-story__panel:not(.is-active){display:none;}
}
@media (prefers-reduced-motion:reduce){.work-context-story__steps>[data-work-step]{transition:none;}}
.respondent-map__body{display:grid;grid-template-columns:minmax(0,1fr) minmax(12rem,15rem);gap:.8rem;align-items:start;}
.respondent-map__svg{display:block;width:100%;height:auto;max-height:64vh;}
.respondent-map__area{stroke:var(--color-surface);stroke-width:.7;transition:fill .2s ease,opacity .2s ease;}
.respondent-map__area--kunta{stroke-width:.25;}
.respondent-map__area.is-muted{opacity:.4;}
.respondent-map[data-highlight="selected"] .respondent-map__area.is-muted{fill:var(--respondent-map-neutral);opacity:.75;}
.respondent-map__area.is-focus{stroke:var(--color-ink);stroke-width:1.8;}
.respondent-map__area--kunta.is-focus{stroke-width:.6;}
.respondent-map__area:focus{outline:none;}
.respondent-map__area:focus-visible{stroke:var(--color-focus);stroke-width:3;}
.respondent-map__info{margin:0 0 .4rem;font-size:.9rem;min-height:4.4em;}
.respondent-map__actions{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.5rem;min-height:1.9rem;}

.respondent-map__action{font:inherit;font-size:.8rem;padding:.3rem .7rem;border:1px solid var(--color-rule);border-radius:999px;background:transparent;color:inherit;cursor:pointer;}
.respondent-map__action--filter{border-color:var(--color-accent);}
.respondent-map__legend{display:grid;gap:.15rem;}
.respondent-map__legend-item{display:grid;grid-template-columns:.8rem minmax(0,1fr) auto;gap:.45rem;align-items:center;font:inherit;font-size:.8rem;text-align:left;padding:.22rem .4rem;border:1px solid transparent;border-radius:.4rem;background:transparent;color:inherit;cursor:pointer;}
.respondent-map__legend-item i{display:block;width:.8rem;height:.8rem;border-radius:2px;}
.respondent-map__legend-item.is-focus,.respondent-map__legend-item:hover{background:var(--color-surface-soft);}
.respondent-map__legend-item[aria-pressed="true"]{border-color:var(--color-ink);font-weight:600;}
.respondent-map__legend-n{color:var(--color-muted);white-space:nowrap;}
@media (prefers-reduced-motion:reduce){.respondent-map__area{transition:none;}}
@media (max-width:900px){
  .respondent-map-story{grid-template-columns:minmax(0,1fr);}
  /* The three short steps come first and the map right after them, so the
     map stays next to the text that explains it; the step buttons and the
     map's own buttons choose the perspective. */
  .respondent-map-story__steps{gap:.6rem;}
  .respondent-map-story__steps>.background-section{min-height:0;}
  .respondent-map-story__visual{position:static;padding:.7rem;scroll-margin-top:var(--single-page-anchor-offset,9rem);}
  .respondent-map__body{grid-template-columns:minmax(0,1fr);}
  .respondent-map__svg{max-height:52vh;}
  .respondent-map__legend{grid-template-columns:minmax(0,1fr);}
}

/* Active population filters under the toolbar: one compact row, the same chip
 * style as inside the filter popover. */
.single-page-prototype .results-toolbar-global > .results-active-filters {
  flex:1 0 100%; display:flex; flex-wrap:wrap; align-items:center; gap:.3rem; margin:.15rem 0 0; padding:0;
}
.single-page-prototype .results-toolbar-global > .results-active-filters .active-filters__chip { min-height:1.75rem; padding:.05rem .1rem .05rem .6rem; font-size:.78rem; }
.results-active-filters .active-filters__remove { width:1.6rem; height:1.6rem; }
.results-active-filters .active-filters__clear-all { min-height:1.75rem; padding:0 .3rem; font-size:.78rem; }
@media (pointer:coarse) {
  .results-active-filters .active-filters__remove { width:2.25rem; height:2.25rem; }
  .results-active-filters .active-filters__clear-all { min-height:2.25rem; }
}
.single-page-prototype .results-toolbar-global > .results-active-filters .active-filters__chip { max-width:min(100%, 24rem); }
.results-active-filters .active-filters__text { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
@media (max-width:719px) {
  .single-page-prototype .results-toolbar-global > .results-active-filters { gap:.25rem; }
  .single-page-prototype .results-toolbar-global > .results-active-filters .active-filters__chip {
    min-width:0; flex-wrap:nowrap; font-size:.72rem;
  }
  .results-active-filters .active-filters__clear-all { flex:none; font-size:.72rem; }
  .results-active-filters .active-filters__clear-full { display:none; }
  .results-active-filters .active-filters__clear-short { display:inline; }
}
@media (min-width:720px) {
  .results-active-filters .active-filters__clear-short { display:none; }
}

.results-mobile-actions,.results-contents-sheet,.results-toolbar-summary {display:none;}
.page-contents .page-contents__branch {margin:.1rem 0 .65rem .3rem;max-width:none;}
.page-contents .page-contents__branch > summary {padding:.35rem .3rem;border:0;}
.results-toolbar-summary span {display:block;}
.results-toolbar-summary span[hidden] {display:none;}
@media (width < 1008px) {
 html.site-shell:has(.single-page-prototype) .site-navigation__menu {display:none;}
 html.site-shell:has(.single-page-prototype) .site-navigation__row {padding-block:.25rem;}
 html.site-shell:has(.single-page-prototype) .site-navigation__languages button {min-width:44px;min-height:44px;}
 html.site-shell:has(.single-page-prototype) body {padding-bottom:calc(56px + env(safe-area-inset-bottom, 0px));}
 html.site-shell .single-page-prototype > .single-page-prototype__intro {padding:0;margin:0;border:0;min-height:0;background:none;box-shadow:none;}
 html.site-shell .single-page-prototype > .single-page-prototype__intro > h1 {position:absolute;width:1px;height:1px;margin:0;clip-path:inset(50%);overflow:hidden;white-space:nowrap;}
 .single-page-prototype > .single-page-prototype__intro > p {display:none;}
 .results-mobile-actions {display:grid;position:fixed;inset:auto 0 0;z-index:40;grid-template-columns:repeat(3,minmax(0,1fr));gap:.2rem;padding:.3rem max(.4rem,env(safe-area-inset-right,0px)) calc(.3rem + env(safe-area-inset-bottom,0px)) max(.4rem,env(safe-area-inset-left,0px));border-top:1px solid var(--color-rule);background:var(--color-surface);}
 .results-mobile-actions button,.results-contents-sheet header button {font:600 .85rem/1.2 var(--font-sans);min-height:44px;border:0;border-radius:.35rem;color:var(--color-ink);background:transparent;cursor:pointer;}
 .results-mobile-actions button:hover,.results-mobile-actions button[aria-expanded=true] {background:var(--color-accent-soft);}
 .results-contents-sheet:popover-open,
 .single-page-prototype .b2-top-layer:is(.analysis-filter-popover,.analysis-compare-popover):popover-open {
  display:flex;flex-direction:column;position:fixed;inset:auto 0 0!important;width:100%!important;max-width:none!important;
  max-height:calc(88dvh - env(safe-area-inset-top,0px))!important;margin:0;padding-bottom:env(safe-area-inset-bottom,0px);
  box-sizing:border-box;border-radius:1rem 1rem 0 0;background:var(--color-surface);color:var(--color-ink);
 }
 .results-contents-sheet:popover-open {padding:0 0 env(safe-area-inset-bottom,0px);border:1px solid var(--color-rule);}
 .results-contents-sheet::backdrop {background:rgb(13 27 44 / .34);}
 .results-contents-sheet header {display:flex;align-items:center;justify-content:space-between;padding:.35rem .9rem;border-bottom:1px solid var(--color-rule);}
 .results-contents-sheet header h2 {margin:0;font-size:1.08rem;}
 .results-contents-sheet header button {min-width:44px;font-size:1.4rem;}
 .results-contents-sheet nav {min-height:0;overflow-y:auto;padding:.4rem .9rem 1rem;overscroll-behavior:contain;}
 .results-contents-sheet .page-contents__title {display:none;}
 .results-contents-sheet .page-contents :is(a,summary) {display:flex;align-items:center;min-height:44px;}
 .results-contents-sheet .page-contents [data-depth="1"] a {font-size:.85rem;}
 html.site-shell .single-page-prototype > .results-toolbar--compact .results-toolbar-question-handle,
 html.site-shell .single-page-prototype > .results-toolbar--compact .results-toolbar-global > :is([data-control="filters"],[data-control="compare"],.results-active-filters) {display:none!important;}
 html.site-shell .single-page-prototype > .results-toolbar--compact > .results-toolbar-global {display:flex!important;align-items:center;gap:.3rem;min-height:30px;padding-block:.2rem;}
 .results-toolbar-summary {display:block;order:-2;flex:1 1 auto;min-width:0;font:600 .83rem/1.25 var(--font-sans);}
 .results-toolbar-summary__filter {display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;}
 .results-toolbar-summary__compare {font-weight:500;color:var(--color-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
 .results-toolbar-global .analysis-population {flex:none;}
 body:has(.statement-analysis-dialog[open]) .results-mobile-actions {display:none;}
 .single-page-prototype .results-tools-popover .result-view-selector__tab {min-height:44px;}
 .single-page-prototype .results-tools-popover .analysis-controls__views {grid-template-columns:minmax(0,1fr);}
 .single-page-prototype .results-tools-popover .result-view-selector__tab::before {content:none!important;}
}
@media print {.results-mobile-actions,.results-contents-sheet {display:none!important;}}

.results-context-view {display:none;}
@media (width < 1008px) {
 html.site-shell .single-page-prototype > .results-toolbar--compact > .results-toolbar-global {flex-wrap:nowrap;}
 html.site-shell .single-page-prototype > .results-toolbar--compact > .results-toolbar-global > .analysis-population {
  width:auto;min-width:max-content;margin:0 0 0 auto;flex:0 0 auto;white-space:nowrap;
 }
 html.site-shell .single-page-prototype > .results-toolbar--compact > .results-toolbar-global > .results-tools-trigger {display:none!important;}
 .results-context-view {display:block;min-height:44px;padding:.25rem 0;border:0;background:none;color:var(--color-accent);font:600 .85rem/1.25 var(--font-sans);text-align:start;cursor:pointer;}
 .single-page-prototype .results-tools-popover .results-layout-switch {display:none!important;}
 .single-page-prototype .results-tools-popover label.result-view-selector__tab:not([hidden]) {display:flex;flex-direction:row;justify-content:space-between;align-items:center;text-align:start;}
}

.page-contents .page-contents__with-branch {position:relative;}
html.site-shell .page-contents .page-contents__with-branch > a {padding-inline-end:3rem;}
.page-contents .page-contents__branch > summary {
 position:absolute;inset:0 0 auto auto;display:grid;place-items:center;width:44px;height:44px;
 box-sizing:border-box;border:0;border-radius:.35rem;padding:0;
 color:var(--color-ink);font-size:0;
}
.page-contents .page-contents__branch > summary::before,
.page-contents .page-contents__branch > summary::after {content:none;}
.page-contents .page-contents__branch > summary span {font-size:1.18rem;}
.page-contents .page-contents__branch[open] > summary span {rotate:180deg;}
.page-contents .page-contents__branch > summary:hover {background:var(--color-surface-soft);}
html.site-shell #observablehq-sidebar .page-contents__branch > summary {color:var(--ui-nav-ink);}
html.site-shell #observablehq-sidebar .page-contents__branch > summary:hover {background:var(--ui-nav-hover);}
@media(width < 1008px) {
 .results-contents-sheet .page-contents .page-contents__branch > summary {display:grid;}
}

.statement-analysis-dialog .results-tools-popover .results-layout-switch {display:none!important;}
