/* Shared presentation layer. Existing DOM, routes and native controls own
   behaviour; all paints resolve through the site's semantic theme tokens. */
html.site-shell { background: var(--color-paper); }
html.site-shell body { background: radial-gradient(ellipse at 90% 0%, var(--ui-hero-end), transparent 40rem), var(--color-paper); }
html.site-shell :is(h1,h2,h3,h4,.homepage__title,.homepage__section-title,.homepage__card-title,.story__chapter-title,.story__step-title,.thematic-results__finding h3) {
  font-family: var(--font-sans); font-weight: 600; letter-spacing: -.025em;
}
html.site-shell :is(h1,h2,h3,h4) { overflow-wrap: anywhere; }
html.site-shell h1 { line-height: 1.13; }
html.site-shell :is(.research-page__lead,.story__lede) { font-family: var(--font-sans); }
html.site-shell .site-navigation {
  background: linear-gradient(115deg, var(--ui-nav-surface), var(--ui-nav-end));
  color: var(--ui-nav-ink); border-bottom-color: var(--ui-nav-rule); box-shadow: var(--ui-shadow);
}
html.site-shell .site-navigation__brand { color: var(--ui-nav-ink); font-weight: 600; letter-spacing: -.02em; }
html.site-shell .site-navigation__links { gap: .25rem .65rem; }
html.site-shell .site-navigation__links a { color: var(--ui-nav-ink); border-radius: .5rem; padding-inline: .75rem; }
html.site-shell .site-navigation__links a[aria-current="page"] { background: var(--ui-nav-active); color: var(--ui-nav-active-ink); border-bottom-color: transparent; box-shadow: inset 0 -3px var(--ui-nav-focus); }
html.site-shell .site-navigation__links a:hover { background: var(--ui-nav-hover); color: var(--ui-nav-ink); }
html.site-shell .site-navigation :is(.site-navigation__languages button,.site-navigation__menu,.site-theme button) { background: transparent; color: var(--ui-nav-ink); border-color: var(--ui-nav-rule); border-radius: .55rem; }
html.site-shell .site-navigation .site-navigation__languages button {
  display: grid; place-items: center; padding: 0;
  inline-size: 2.25rem; min-block-size: 2.25rem;
}
html.site-shell .site-navigation .site-navigation__languages svg {
  display: block; inline-size: 1.1rem; block-size: auto;
  border-radius: 2px; outline: 1px solid rgb(255 255 255 / 25%);
}
html.site-shell .site-navigation .site-navigation__languages button[aria-pressed="true"] {
  background: rgb(255 255 255 / 15%); border-color: rgb(255 255 255 / 70%);
}
@media(max-width:719px) {
  html.site-shell .site-navigation .site-navigation__languages button {
    inline-size: 1.85rem; min-block-size: 2.75rem;
  }
}
html.site-shell .site-navigation :is(button,a):focus-visible { outline-color: var(--ui-nav-focus); }
html.site-shell .site-navigation button:hover { background: var(--ui-nav-hover); }
html.site-shell #observablehq-sidebar {
  top: var(--site-navigation-height); bottom: 0; padding: 1.5rem .8rem;
  background: linear-gradient(165deg,var(--ui-nav-surface),var(--ui-nav-end)); border-right: 1px solid var(--ui-nav-rule);
}
html.site-shell #observablehq-sidebar .page-contents__title { color: var(--ui-nav-muted); padding-inline: .7rem; }
html.site-shell #observablehq-sidebar .page-contents a { color: var(--ui-nav-ink); padding: .65rem .65rem; border-radius: .5rem; line-height: 1.4; }
html.site-shell #observablehq-sidebar .page-contents li[data-depth="1"] a { color: var(--ui-nav-muted); padding-block: .45rem; }
html.site-shell #observablehq-sidebar .page-contents a:hover { background: var(--ui-nav-hover); }
html.site-shell #observablehq-sidebar .page-contents a[aria-current="location"] { background: var(--ui-nav-active); color: var(--ui-nav-active-ink); border-left-color: var(--ui-nav-focus); }
html.site-shell #observablehq-sidebar .page-contents li[data-depth="1"] a[aria-current="location"] {
  color: var(--ui-nav-active-ink);
  border-left-color: currentColor;
  text-decoration: underline;
  text-underline-offset: .2em;
}
html.site-shell #observablehq-sidebar .page-contents a:focus-visible { outline-color: var(--ui-nav-focus); }
html.site-shell #observablehq-sidebar .page-contents li[data-depth="1"] a[aria-current="location"]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -3px;
}
/* Compact artwork belongs to the title, never to an extra spacer. */
html.site-shell :is(.single-page-prototype__intro,.homepage__hero,.research-page__header,.story__hero) {
  box-sizing: border-box; max-width: 100%; padding: clamp(1rem,2.2vw,1.8rem);
  border: 1px solid var(--color-rule); border-radius: var(--ui-radius);
  background: radial-gradient(ellipse at 100% 100%,var(--ui-hero-end),transparent 62%),linear-gradient(115deg,var(--color-surface),var(--color-surface-soft));
  box-shadow: var(--ui-shadow);
}
html.site-shell .single-page-prototype__intro { margin: .25rem 0 1rem; }
html.site-shell .single-page-prototype__intro h1 { font-size: clamp(1.6rem,2.7vw,2.45rem); }
html.site-shell .single-page-prototype__intro p { font-size: .88rem; max-width: 80ch; }
html.site-shell :is(.homepage__card,.homepage__topic,.story__visual,.story-composite-summary,.leadership-context) { border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); background: var(--color-surface); border-color: var(--color-rule); }
html.site-shell .homepage__hero { margin-bottom: 1.75rem; }
html.site-shell .homepage__title { font-size: clamp(2rem,4vw,3.6rem); max-width: 23ch; }
html.site-shell .homepage__card-title { line-height: 1.25; }
html.site-shell .homepage__topic { border-left: 3px solid var(--color-accent); }
html.site-shell .homepage a.homepage__cta { background: var(--color-accent); color: var(--color-on-accent); border-color: var(--color-accent); border-radius: .6rem; }
html.site-shell .homepage a.homepage__cta:hover { background: color-mix(in srgb,var(--color-accent) 88%,var(--color-ink)); }
html.site-shell :is(.thematic-results__topic,.thematic-results__conclusion) { margin-top: 2rem; padding-top: 1.25rem; }
html.site-shell :is(.thematic-results__topic>h2,.thematic-results__conclusion>h2) { font-family: var(--font-sans); font-size: clamp(1.5rem,2.6vw,2.15rem); font-weight: 600; }
html.site-shell .thematic-results__kicker { color: var(--color-accent); font-weight: 600; }
html.site-shell .thematic-results__metrics { gap: .85rem; }
html.site-shell .thematic-results .story-composite-summary { border: 1px solid var(--color-rule); border-top: 3px solid var(--color-accent); padding: 1.1rem 1.2rem; }
html.site-shell .thematic-results .story-composite-summary__value { color: var(--color-accent); font-size: clamp(2.6rem,5vw,3.5rem); font-weight: 600; margin: .6rem 0; }
html.site-shell :is(.thematic-results__group,.single-page-prototype__question) {
  box-sizing: border-box; padding: 1.15rem!important; border: 1px solid var(--color-rule);
  border-radius: var(--ui-radius); background: var(--color-surface); box-shadow: var(--ui-shadow); min-width: 0;
}
html.site-shell :is(.thematic-results__group>h3,.single-page-prototype__question-head h2) { border-left: 4px solid var(--color-accent); padding-left: .75rem; font-size: 1.12rem; font-weight: 600; }
html.site-shell .single-page-prototype__question.background-section { margin-bottom: 1.25rem; }
html.site-shell .analysis-view__statement:first-of-type { border-top: 0; }
html.site-shell .analysis-view__inspect { text-decoration-color: var(--color-rule-strong); }
html.site-shell .analysis-view__inspect:hover { color: var(--color-accent); text-decoration-color: currentColor; }
html.site-shell .analysis-view__line--population .analysis-view__label { font-weight: 600; }
html.site-shell :is(.analysis-view__metric,.single-page-prototype__population,.story-composite-summary__value) { font-variant-numeric: tabular-nums; }
html.site-shell .analysis-view__legend { color: var(--color-muted); line-height: 1.5; }
html.site-shell .analysis-view th { background: var(--color-surface-soft); }
html.site-shell .analysis-view tbody tr:hover { background: var(--color-filter-hover); }
html.site-shell :is(.analysis-view__masked,.analysis-view__masked-note strong,.analysis-controls__group-n) { color: var(--color-muted); }
html.site-shell .analysis-view__line--masked { background: var(--color-surface-soft); border-radius: .4rem; padding: .4rem; }
/* Reuse the existing tool hierarchy, including its collapse behaviour. */
html.site-shell .single-page-prototype .single-page-prototype__toolbar {
  --toolbar-header: var(--ui-nav-surface); --toolbar-header-hover: var(--ui-nav-hover); --toolbar-on-header: var(--ui-nav-ink);
  --toolbar-focus: var(--color-focus); --toolbar-text-muted: var(--color-muted);
  border: 1px solid var(--color-rule); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow);
}
html.site-shell .results-toolbar-global { border-radius: calc(var(--ui-radius) - 1px) calc(var(--ui-radius) - 1px) 0 0; }
html.site-shell .single-page-prototype__population { padding: .25rem .7rem; border: 1px solid var(--ui-nav-rule); border-radius: 999px; font-weight: 600; }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:has(:checked) { background: var(--color-accent-soft); color: var(--color-accent); box-shadow: inset 0 -3px var(--color-accent); }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation :is(select,.result-view-selector__tab):focus-visible,
html.site-shell .single-page-prototype .single-page-prototype__toolbar .analysis-controls__group-option:has(:focus-visible) { outline-color: var(--color-focus); }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .analysis-controls__group-option input { accent-color: var(--color-accent); }
html.site-shell :is(.active-filters__chip,.active-filter-chip,.filter-chip) { border-radius: 999px; background: var(--color-accent-soft); color: var(--color-ink); border-color: var(--color-rule-strong); }
html.site-shell :is([popover],dialog.statement-analysis-dialog) { color: var(--color-ink); background: var(--color-surface); border-color: var(--color-rule-strong); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow-raised); }
html.site-shell dialog.statement-analysis-dialog::backdrop { background: rgb(3 14 33 / 65%); backdrop-filter: blur(3px); }
html.site-shell :is(input,select,button) { font-family: var(--font-sans); }
html.site-shell input:not([type=radio],[type=checkbox],[type=range]) { color: var(--color-ink); background: var(--color-surface); border-color: var(--color-rule-strong); }
html.site-shell :is(button,a,input,select,summary):focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
html.site-shell .chart-segment--active { stroke: var(--color-ink); }
html.site-shell .education-waffle__legend-button[aria-pressed="true"] { border-color: var(--color-accent); box-shadow: inset 3px 0 var(--color-accent); }
html.site-shell .education-waffle--highlighting .story-waffle__cell.is-highlighted { box-shadow: inset 0 0 0 1.5px var(--color-ink); }
@media (prefers-reduced-motion:no-preference) {
  html.site-shell :is(.site-navigation a,.site-navigation button,.page-contents a,.homepage__cta,.homepage__topic) { transition: background-color 140ms ease,color 140ms ease; }
}
@media(max-width:1007px) {
  html.site-shell .site-navigation__links a { min-height: 44px; box-sizing: border-box; }
  html.site-shell .page-contents-mobile { background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: .6rem; padding-inline: .75rem; }
}
@media(max-width:600px) {
  html.site-shell :is(.thematic-results__group,.single-page-prototype__question) { padding: .85rem!important; }
  html.site-shell :is(.single-page-prototype__intro,.homepage__hero,.research-page__header,.story__hero) { padding: 1rem; }
  html.site-shell .single-page-prototype__intro { margin-top: 0; }
  html.site-shell :is(.filter-option,.analysis-controls__group-option) { min-height: 44px; }
  html.site-shell .single-page-prototype .single-page-prototype__toolbar .analysis-controls__group-option { min-height: 36px; }
}
@media print {
  html.site-shell body { background: white; }
  html.site-shell :is(.homepage__hero,.homepage__card,.thematic-results__group,.single-page-prototype__question,.story__visual) { box-shadow:none; break-inside:avoid; }
}
/* Keep the respondent context readable without postponing its first chart. */
html.site-shell .background-chapter__intro { padding: 1rem 1.15rem; border: 1px solid var(--color-rule); border-radius: var(--ui-radius); background: linear-gradient(115deg,var(--color-surface),var(--ui-hero-end)); }
html.site-shell .background-chapter__lede { font-family: var(--font-sans); max-width: 85ch; font-size: .9rem; line-height: 1.5; }
html.site-shell .background-chapter__population { margin-block: .6rem 0; }
html.site-shell .leadership-context { margin: 1rem 0; padding: 1rem 1.15rem; }
html.site-shell .leadership-context h2 { font-size: 1.2rem; margin-bottom: .4rem; }
html.site-shell .leadership-context p { max-width: none; font-size: .86rem; line-height: 1.5; margin-block: .5rem; }
html.site-shell .leadership-context__links { margin-block: .5rem 0; font-size: .86rem; gap: .35rem 1.5rem; }
html.site-shell .story-composite-summary__eyebrow { color: var(--ui-secondary-accent); }
@media(max-width:719px) {
  html.site-shell .analysis-view__line--masked { padding-block: .2rem; }
}
html.site-shell .analysis-view .analysis-view__line--masked .analysis-view__masked { color: var(--color-muted); }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:has(:focus-visible) { outline-color: var(--color-focus); }
/* Reference artwork and component silhouette: colour alone is not the design. */
html.site-shell body {
  background: var(--ui-wave-art) right -20rem top -6rem / 100rem auto no-repeat fixed,
    radial-gradient(ellipse at 90% 0,var(--ui-hero-end),transparent 45rem),var(--color-paper);
}
html.site-shell body:has(.results-page) { background: var(--color-paper); }
html.site-shell .navigation-icon { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; vertical-align: middle; }
html.site-shell .site-navigation__brand { display: flex; align-items: center; gap: .75rem; }
html.site-shell .site-navigation__brand>.navigation-icon { box-sizing: border-box; width: 2.9rem; height: 2.9rem; padding: .65rem; color: #fff; border-radius: .7rem; background: linear-gradient(145deg,#069ea3,#006475); box-shadow: inset 0 1px 0 rgb(255 255 255 / 28%); }
html.site-shell .site-navigation__links a { display: flex; align-items: center; gap: .45rem; }
html.site-shell .site-navigation__links a>.navigation-icon { width: 1.15rem; height: 1.15rem; }
html.site-shell #observablehq-sidebar {
  background: var(--ui-sidebar-art) center bottom / 100% auto no-repeat,linear-gradient(155deg,var(--ui-nav-end),var(--ui-nav-surface));
  box-shadow: inset -1px 0 0 rgb(170 202 255 / 15%)!important;
}
html.site-shell #observablehq-sidebar .page-contents { position: relative; }
html.site-shell .page-contents a { display: flex; align-items: center; gap: .75rem; }
html.site-shell .page-contents a>span { min-width: 0; }
html.site-shell .page-contents li[data-depth="0"] a { min-height: 44px; box-sizing: border-box; }
html.site-shell #observablehq-sidebar .page-contents li[data-depth="0"] a>.navigation-icon { color: var(--ui-nav-focus); width: 1.45rem; height: 1.45rem; }
html.site-shell #observablehq-sidebar .page-contents a[aria-current="location"] { border: 1px solid var(--ui-nav-rule); border-left: 3px solid var(--ui-nav-focus); box-shadow: 0 4px 12px rgb(0 10 35 / 16%); }
html.site-shell :is(.single-page-prototype__intro,.homepage__hero,.research-page__header,.story__hero,.background-chapter__intro) {
  /* Opaque cards have their own quiet lighting, never the page's wire mesh. */
  background: radial-gradient(ellipse at 100% 0,color-mix(in srgb,var(--ui-secondary-accent) 10%,transparent),transparent 62%),
    radial-gradient(ellipse at 85% 100%,color-mix(in srgb,var(--color-accent) 9%,transparent),transparent 60%),
    linear-gradient(115deg,var(--color-surface),var(--color-surface-soft));
}
html.site-shell :is(.single-page-prototype__intro h1,.background-chapter__title) { position: relative; padding-left: 1rem; border-left: 5px solid var(--color-accent); }
html.site-shell :is(.single-page-prototype__intro,.background-chapter__intro) { border-color: color-mix(in srgb,var(--color-accent) 25%,var(--color-rule)); }
html.site-shell :is(.thematic-results__group,.single-page-prototype__question) { background: linear-gradient(120deg,var(--color-surface) 40%,color-mix(in srgb,var(--color-surface) 85%,var(--ui-hero-end))); }
html.site-shell .single-page-prototype .single-page-prototype__toolbar { border-color: var(--color-rule-strong); overflow: visible; }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-global {
  background: linear-gradient(110deg,var(--ui-nav-end),var(--ui-nav-surface)); border-bottom: 1px solid var(--ui-nav-rule);
}
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab { min-height: 2.6rem; font-weight: 500; padding-inline: .85rem; }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:has(:checked) {
  color: var(--ui-nav-ink); background: linear-gradient(115deg,var(--ui-nav-end),#393a87); border-radius: .55rem;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 25%),0 3px 8px rgb(12 34 76 / 15%);
}
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views { gap: .2rem; padding-block: .5rem; }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab+.result-view-selector__tab { margin-left: 0; }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab { border: 0; border-radius: .55rem; background: var(--color-surface-soft); }
html.site-shell .analysis-view__legend i { border-radius: .2rem; box-shadow: inset 0 1px 1px rgb(255 255 255 / 25%); }
@media screen {
  html.site-shell[data-theme="dark"] .site-navigation { background: linear-gradient(110deg,#30215e 0%,#14264b 40%,#092238 100%); }
  html.site-shell[data-theme="dark"] #observablehq-sidebar { background: var(--ui-sidebar-art) center bottom / 100% auto no-repeat,linear-gradient(165deg,#201b48,#0b203c 48%,#102f45); }
  html.site-shell[data-theme="dark"] #observablehq-sidebar .page-contents a[aria-current="location"] { background: linear-gradient(110deg,#125969,#3b316e); border-color: #4ba5bb; color: #f4f9ff; }
  html.site-shell[data-theme="dark"] .site-navigation__links a[aria-current="page"] { background: linear-gradient(110deg,#14515e,#3b316e); color: #edffff; }
  html.site-shell[data-theme="dark"] .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab:has(:checked) { background: linear-gradient(110deg,#165969,#443982); color: #f4f9ff; box-shadow: inset 0 0 0 1px #70becb,0 3px 10px rgb(0 0 0 / 20%); }
  html.site-shell[data-theme="dark"] .single-page-prototype .single-page-prototype__toolbar { border-color: #4e7899; }
  html.site-shell[data-theme="dark"] .single-page-prototype .single-page-prototype__toolbar .results-toolbar-global { background: linear-gradient(110deg,#25315d,#0c2d44); }
}
@media(min-width:1200px) {
  html.site-shell .site-navigation { display: grid; grid-template-columns: 250px minmax(0,1fr) auto; align-items: center; min-height: 80px; }
  html.site-shell .site-navigation__row { display: contents; }
  html.site-shell .site-navigation__brand { grid-column: 1; grid-row: 1; padding: .7rem 1rem; font-size: 1rem; line-height: 1.2; }
  html.site-shell .site-navigation__brand>span { max-width: 11ch; }
  html.site-shell .site-navigation__links { grid-column: 2; grid-row: 1; margin: 0; padding: .6rem .75rem; gap: .3rem; }
  html.site-shell .site-navigation__links a { font-size: .82rem; padding: .65rem .6rem; }
  html.site-shell .site-navigation__utilities { grid-column: 3; grid-row: 1; padding-right: 1rem; gap: .5rem; }
}
@media(max-width:1007px) {
  html.site-shell .site-navigation__brand>.navigation-icon { display: none; }
  html.site-shell .site-navigation__menu { display: flex; align-items: center; gap: .3rem; }
  html.site-shell .site-navigation__menu>.navigation-icon { width: 1rem; height: 1rem; }
  html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab { padding-inline: .4rem; min-height: 2.2rem; }
}
@media print {
  html.site-shell :is(body,.homepage__hero,.story__hero,.research-page__header,.background-chapter__intro) { background-image: none; }
}

/* The existing view radios keep their native labels and state. */
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .result-view-selector__tab {display:inline-flex;align-items:center;justify-content:center;gap:.55rem;}
html.site-shell .results-toolbar-presentation .result-view-selector__tab:has(input[value="jakaumat"])::before {content:"";width:1.15rem;height:1.15rem;flex:0 0 auto;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2021V12h3v9M11%2021V7h3v14M18%2021V2h3v19%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;}
html.site-shell .results-toolbar-presentation .result-view-selector__tab:has(input[value="scale"])::before {content:"";width:1.15rem;height:1.15rem;flex:0 0 auto;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012h18M3%208v8M8%2010v4M13%208v8M18%2010v4%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;}
html.site-shell .results-toolbar-presentation .result-view-selector__tab:has(input[value="tunnusluvut"])::before {content:"";width:1.15rem;height:1.15rem;flex:0 0 auto;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M19%203H5l7%209-7%209h14%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;}
html.site-shell .results-toolbar-presentation .result-view-selector__tab:has(input[value="poikkeamat"])::before {content:"";width:1.15rem;height:1.15rem;flex:0 0 auto;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207h17m-4-4%204%204-4%204M21%2017H4m4-4-4%204%204%204%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;}
html.site-shell .results-toolbar-presentation .result-view-selector__tab:has(input[value="taulukko"])::before {content:"";width:1.15rem;height:1.15rem;flex:0 0 auto;background:currentColor;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%203h18v18H3zM3%209h18M3%2015h18M9%203v18%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;}
html.site-shell #observablehq-sidebar { background-blend-mode: normal,normal; }
@media screen {html.site-shell[data-theme="dark"] #observablehq-sidebar {background-blend-mode:normal,normal;}}
html.site-shell #observablehq-sidebar .page-contents li[data-depth="0"] a[aria-current="location"]>.navigation-icon { color: var(--ui-nav-active-ink); }
html.site-shell .analysis-view__line--group svg { height: 14px; }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views { max-width: none; }
html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab { white-space: normal; overflow-wrap: anywhere; }
@media(max-width:719px) {
  html.site-shell .single-page-prototype .single-page-prototype__toolbar .results-toolbar-presentation .analysis-controls__views .result-view-selector__tab { flex-direction: column; gap: .15rem; font-size: .7rem; padding: .35rem .25rem; min-height: 3rem; }
}
@media print { html.site-shell body { background: white; } }
/* A quiet one-pixel colour transition frames cards without adding texture. */
:root {
  --ui-card-outline: linear-gradient(125deg,
    color-mix(in srgb,var(--color-accent) 60%,var(--color-rule)) 0%,
    var(--color-rule) 36%,
    color-mix(in srgb,var(--ui-secondary-accent) 45%,var(--color-rule)) 72%,
    color-mix(in srgb,var(--color-accent) 25%,var(--color-rule)) 100%);
}
html.site-shell :is(.homepage__hero,.homepage__card,.single-page-prototype__intro,.single-page-prototype__question,.background-chapter__intro,.thematic-results__group,.story-composite-summary,.leadership-context,.research-page__header,.story__hero) { position: relative; }
@supports (mask-composite:exclude) {
  html.site-shell :is(.homepage__hero,.homepage__card,.single-page-prototype__intro,.single-page-prototype__question,.background-chapter__intro,.thematic-results__group,.story-composite-summary,.leadership-context,.research-page__header,.story__hero)::before {
    content: ""; position: absolute; inset: -1px; padding: 1px;
    border-radius: inherit; background: var(--ui-card-outline); pointer-events: none;
    -webkit-mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
    mask-composite: exclude;
  }
}
@media print {
  html.site-shell :is(.homepage__hero,.homepage__card,.single-page-prototype__intro,.single-page-prototype__question,.background-chapter__intro,.thematic-results__group,.story-composite-summary,.leadership-context,.research-page__header,.story__hero)::before { display: none; }
}

/* Use the same surface and edge as the result panels for the compact tools. */
html.site-shell .single-page-prototype .single-page-prototype__toolbar.results-toolbar--compact {
  --toolbar-on-header: var(--color-ink);
  --toolbar-panel: color-mix(in srgb, var(--color-surface-soft) 65%, var(--color-surface));
  --toolbar-control-border: var(--color-rule);
  --toolbar-active-border: var(--color-accent);
  --toolbar-text: var(--color-ink);
  --toolbar-text-muted: var(--color-muted);
  border: 1px solid transparent;
  background: linear-gradient(115deg, var(--color-surface) 40%, var(--color-surface-soft)) padding-box,
    var(--ui-card-outline) border-box;
}
html.site-shell .single-page-prototype .single-page-prototype__toolbar.results-toolbar--compact .results-toolbar-global {
  background: transparent;
  border: 0;
  border-radius: inherit;
}
html.site-shell .results-toolbar--compact .results-toolbar-status {
  color: var(--color-muted);
}
html.site-shell .single-page-prototype .results-toolbar--compact .results-toolbar-global .b2-control-trigger {
  border-radius: .55rem !important;
  box-shadow: none;
}
html.site-shell .single-page-prototype .results-toolbar--compact .results-toolbar-global .b2-control-trigger:is(:hover,[aria-expanded="true"]) {
  background: var(--color-accent-soft) !important;
  border-color: var(--color-accent) !important;
}
html.site-shell .single-page-prototype .results-toolbar--compact .results-toolbar-global .b2-control-trigger:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
html.site-shell .single-page-prototype[data-question-collapsed] .results-toolbar--compact .results-toolbar-question-handle:not([hidden]) {
  background: transparent;
  border-color: transparent;
  color: var(--color-ink);
}
html.site-shell .single-page-prototype[data-question-collapsed] .results-toolbar--compact .results-toolbar-question-handle__meta {
  color: var(--color-muted);
}
html.site-shell .single-page-prototype[data-question-collapsed] .results-toolbar--compact .results-toolbar-question-handle[data-has-active="true"] .results-toolbar-question-handle__label {
  color: var(--color-accent);
}

@media screen {
  html.site-shell #observablehq-center:has(.single-page-prototype) {
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }
  html.site-shell #observablehq-main:has(.single-page-prototype) {
    max-width: none;
  }
  html.site-shell .single-page-prototype.page {
    --results-inset-start: 1rem;
    --results-inset-end: 1rem;
    padding-inline: var(--results-inset-start) var(--results-inset-end);
  }
  html.site-shell .single-page-prototype > .single-page-prototype__intro {
    max-width: calc(1120px - 2 * var(--space-4));
    margin-inline: auto;
  }
  html.site-shell .single-page-prototype > .single-page-prototype__toolbar.results-toolbar--compact {
    box-sizing: border-box;
    width: calc(100% + var(--results-inset-start) + var(--results-inset-end));
    max-width: none;
    margin-inline: calc(-1 * var(--results-inset-start)) calc(-1 * var(--results-inset-end));
    border: 0;
    border-block-end: 1px solid var(--color-rule);
    border-radius: 0;
    background: linear-gradient(115deg, var(--color-surface) 40%, var(--color-surface-soft));
  }
  html.site-shell .single-page-prototype > .single-page-prototype__toolbar.results-toolbar--compact > .results-toolbar-global {
    padding-inline: var(--results-inset-start) var(--results-inset-end);
  }
  html.site-shell .single-page-prototype > .results-toolbar--compact .results-toolbar-question-handle {
    padding-inline: var(--results-inset-start) var(--results-inset-end);
  }
}
@media screen and (min-width:720px) {
  html.site-shell .single-page-prototype.page {
    --results-inset-start: 2rem;
    --results-inset-end: 2rem;
  }
}
@media screen and (min-width:1008px) {
  html.site-shell #observablehq-center:has(.single-page-prototype) {
    margin-inline-start: 250px !important;
  }
  html.site-shell .single-page-prototype.page {
    --results-inset-start: 40px;
    --results-inset-end: 64px;
  }
}

/* Footer note on the composite calculation check: quiet, expandable, no badge styling. */
.composite-verification { margin-top:.45rem; font-size:.8rem; }
.composite-verification > summary { display:inline-flex; align-items:center; gap:.45rem; min-height:44px; cursor:pointer; color:var(--color-muted,var(--ui-muted)); list-style:none; }
.composite-verification > summary::-webkit-details-marker { display:none; }
.composite-verification > summary:focus-visible { outline:3px solid var(--color-focus); outline-offset:2px; border-radius:.25rem; }
.composite-verification__dot { width:.5rem; height:.5rem; border-radius:50%; background:light-dark(#2f8a57,#5cc08a); flex:none; }
.composite-verification__body { max-width:60ch; padding:.2rem 0 .6rem 0.95rem; color:var(--color-muted,var(--ui-muted)); }
.composite-verification__body p, .composite-verification__body ul { margin:.35rem 0; }
.composite-verification__body ul { padding-left:1.1rem; }

@media screen {
  html.site-shell body:has(
    .single-page-prototype[data-layout="questions"] .single-page-prototype__question .analysis-view--comparison,
    .single-page-prototype[data-layout="themes"] .thematic-results .analysis-view--comparison
  ) { background: var(--color-paper); }
}
html.site-shell :is(.single-page-prototype__question, .thematic-results__group):has(.analysis-view--comparison) {
  background: var(--color-surface);
  box-shadow: none;
}
html.site-shell :is(.single-page-prototype__question, .thematic-results__group):has(.analysis-view--comparison)::before {
  display: none;
}
html.site-shell .statement-analysis-comparison:has(.analysis-view--comparison) {
  background: var(--color-surface);
}

.analysis-view--comparison {
  --comparison-label-width: clamp(8rem, 27%, 15rem);
  --comparison-n-width: 4rem;
  --comparison-gap: .7rem;
  --comparison-metric-width: 4rem;
  --comparison-columns: var(--comparison-label-width) var(--comparison-n-width) minmax(0, 1fr);
  --comparison-row-rule: color-mix(in srgb, var(--color-rule) 65%, transparent);
}
.analysis-view--comparison:is([data-distribution="scale"], [data-view="poikkeamat"]) {
  --comparison-columns: var(--comparison-label-width) var(--comparison-n-width) minmax(0, 1fr) var(--comparison-metric-width);
}
.analysis-view--comparison .analysis-view__statement {
  padding-block: .65rem;
}
.analysis-view--comparison .analysis-view__statement h3 {
  max-width: none;
  margin: 0 0 .25rem;
}
.analysis-view--comparison .analysis-view__inspect {
  display: block;
  width: 100%;
  padding-block: .15rem;
}
.analysis-view--comparison .analysis-view__legend {
  gap: .22rem .85rem;
  margin-block: .3rem;
}
.analysis-view--comparison .analysis-view__axis-row,
.analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line {
  display: grid;
  grid-template-columns: var(--comparison-columns);
  column-gap: var(--comparison-gap);
}
.analysis-view--comparison .analysis-view__axis-row {
  align-items: center;
  border-bottom: 1px solid var(--color-rule);
  min-height: 1.55rem;
  color: var(--color-muted);
}
.analysis-view.analysis-view--comparison[data-view] .analysis-view__axis-row > :is(.analysis-view__percent-axis, .analysis-view__scale-axis) {
  grid-column: 3;
  position: relative;
  margin: 0;
  font-size: .72rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.analysis-view--comparison .analysis-view__percent-axis {
  container-type: inline-size;
  min-height: 1.25em;
}
.analysis-view--comparison .analysis-view__percent-axis span {
  position: absolute;
  inset-inline-start: var(--tick-position);
  transform: translateX(-50%);
  white-space: nowrap;
}
.analysis-view--comparison .analysis-view__percent-axis span:first-child { transform: none; }
.analysis-view--comparison .analysis-view__percent-axis span:last-child { transform: translateX(-100%); }
.analysis-view--comparison .analysis-view__scale-axis span {
  width: auto;
  margin-inline: -.5ch;
  transform: none;
}
.analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line {
  box-sizing: border-box;
  min-height: 1.4rem;
  margin: 0;
  padding: .13rem 0;
  border-radius: 0;
  background: transparent;
}
.analysis-view--comparison .analysis-view__line + .analysis-view__line {
  border-top: 1px solid var(--comparison-row-rule);
}
.analysis-view--comparison .analysis-view__line--population + .analysis-view__line {
  border-top-color: var(--color-rule-strong);
}
.analysis-view--comparison .analysis-view__line--population .analysis-view__label {
  font-weight: 600;
}
.analysis-view--comparison .analysis-view__label {
  font-size: .82rem;
  hyphens: auto;
}
.analysis-view--comparison .analysis-view__sample-n {
  text-align: end;
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
.analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line svg {
  grid-column: 3;
  grid-row: 1;
  height: 12px;
}
.analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line--population svg,
.analysis-view.analysis-view--comparison[data-view="poikkeamat"][data-distribution] .analysis-view__line svg {
  height: 18px;
}
.analysis-view.analysis-view--comparison[data-view] .analysis-view__line--masked .analysis-view__masked {
  grid-column: 3 / -1;
  font-size: .76rem;
}
@media (hover:hover) {
  .analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line:hover {
    background: color-mix(in srgb, var(--color-ink) 5%, transparent);
  }
}
.analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line:focus-within {
  background: color-mix(in srgb, var(--color-ink) 5%, transparent);
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}
@media (max-width:719px) {
  .analysis-view--comparison .analysis-view__legend {
    column-gap: .6rem;
  }
  .analysis-view--comparison {
    --comparison-line-columns: minmax(0, 1fr) auto;
  }
  .analysis-view--comparison:is([data-distribution="scale"], [data-view="poikkeamat"]) {
    --comparison-line-columns: minmax(0, 1fr) auto var(--comparison-metric-width);
  }
  .analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line {
    grid-template-columns: var(--comparison-line-columns);
    gap: .05rem .5rem;
    padding-block: .2rem;
  }
  .analysis-view--comparison .analysis-view__line > .analysis-view__label {
    grid-area: 1 / 1;
  }
  .analysis-view--comparison .analysis-view__line > .analysis-view__sample-n {
    grid-area: 1 / 2;
  }
  .analysis-view--comparison .analysis-view__line > .analysis-view__metric {
    grid-area: 1 / 3;
  }
  .analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line > svg {
    grid-area: 2 / 1 / auto / -1;
    height: 14px;
  }
  .analysis-view.analysis-view--comparison[data-view][data-distribution] .analysis-view__line--population > svg {
    height: 19px;
  }
  .analysis-view.analysis-view--comparison[data-view] .analysis-view__line--masked .analysis-view__masked {
    grid-area: 2 / 1 / auto / -1;
  }
  .analysis-view.analysis-view--comparison[data-view] .analysis-view__axis-row > :is(.analysis-view__percent-axis, .analysis-view__scale-axis) {
    grid-column: 1 / -1;
  }
  .analysis-view.analysis-view--comparison[data-view] .analysis-view__axis-row > .analysis-view__percent-axis {
    font-size: .68rem;
  }
}
@container (max-width: 11rem) {
  .analysis-view--comparison .analysis-view__percent-axis--centered span:is(:nth-child(2), :nth-child(4)) {
    display: none;
  }
}
