/* The same navigation, type and material run through the entire visit. */
:root {
  --bead-a: #082c4a; --bead-b: #24577f; --bead-c: #6a95b4; --bead-d: #bb6e30;
}
:root[data-theme="dark"] {
  --bead-a: #41749c; --bead-b: #8abadc; --bead-c: #cce2ec; --bead-d: #f7b264;
}
.m-enter .nav .menu-btn { display: inline-grid; }
.m-enter .nav-portal-icon,
.m-enter .nav-links a:is([href="marketlab.html"],[href="politiclab.html"],[href="work-with-us.html"]) { display:none; }
@media (min-width: 895px) {
  .m-enter .nav-links { display:flex; margin:0 auto; gap:clamp(4px,1.4vw,24px); }
  .m-enter .nav-right { margin-left:0; }
  .m-enter .nav-right .theme-toggle { display:inline-grid; }
  .sheet { left:auto; width:min(100%,480px); padding-inline:40px; border-left:1px solid var(--line); }
  .sheet.open { box-shadow:0 0 0 100vmax rgb(4 14 24 / .38); }
}
html.m-enter main > .population:first-child h1 { opacity:1; }
/* A direct link should land immediately, even if the screen turns while
   loading. The opening button controls its own animated journey. */
html:has(#simulation:target) { scroll-behavior:auto; }
.population {
  --screen-space:clamp(590px,calc(100svh - 76px),880px);
  --plot-size:clamp(340px,min(44vw,66svh),630px);
}
.journey {
  display:grid; grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);
  grid-template-areas:"opening plot" "example plot"; column-gap:clamp(24px,3.5vw,64px);
}
.opening, .example { min-height:var(--screen-space); display:flex; flex-direction:column; justify-content:center; align-items:flex-start; padding:48px 0; }
.opening { grid-area:opening; padding-bottom:clamp(92px,14svh,156px); }
.example .eyebrow, .field-heading .eyebrow { margin-bottom:20px; font-size:.95rem; }
.opening h1 {
  max-width:9em; font-size:clamp(2rem,4.46vw,4.25rem); font-weight:485;
  line-height:1.09; letter-spacing:-.043em; text-wrap:balance;
}
.opening .hl { color:var(--accent); }
.begin { margin-top:clamp(28px,4svh,38px); }
.begin .ph { rotate:90deg; }
.plot {
  grid-area:plot; position:sticky; align-self:start; min-width:0;
  top:calc(var(--nav-h,69px) + (var(--screen-space) - var(--plot-size) - 60px)/2);
  margin-block:calc((var(--screen-space) - var(--plot-size) - 60px)/2);
}
.plot-inner { height:var(--plot-size); position:relative; }
#simCanvas { display:none; width:100%; height:100%; position:absolute; inset:0; }
.interactive #simCanvas { display:block; }
.example { grid-area:example; min-width:0; }
.example-copy { width:100%; max-width:36rem; }
.example-q { font-size:clamp(1.8rem,2.58vw,2.55rem); line-height:1.1; text-wrap:pretty; }
.interactive .example-q { display:grid; }
.example-q > span { grid-area:1/1; }
.example-q > span[aria-hidden="true"] { visibility:hidden; }
.scenarios, .again { display:none; }
.interactive .scenarios { display:flex; flex-wrap:wrap; gap:7px; margin-block:24px; }
.scenario, .again { font:500 .875rem/1.28 var(--font-body); min-height:44px; cursor:pointer; color:var(--ink-2); }
.scenario { border-radius:99px; padding:8px 14px; border:1px solid var(--line-2); background:transparent; }
.scenario:hover { border-color:var(--accent); }
.scenario[aria-pressed="true"] { background:var(--ink); color:var(--on-ink); border-color:var(--ink); }
.responses { display:flex; gap:clamp(22px,4vw,74px); margin-block:24px; }
.response { display:flex; flex-direction:column-reverse; }
.response .n { font-size:clamp(1.8rem,3vw,3rem); line-height:1.2; font-weight:500; letter-spacing:-.045em; font-variant-numeric:tabular-nums; }
.response .k { color:var(--ink-2); display:flex; align-items:center; gap:7px; font-size:.89rem; }
.response .k::before { content:""; width:9px; height:9px; border-radius:50%; background:var(--c); flex:none; }
.interpretation { color:var(--ink-2); font-size:1.04rem; line-height:1.52; }
.interpretation strong { color:var(--ink); font-weight:550; }
.example-note { color:var(--ink-3); font-size:.85rem; line-height:1.45; margin-top:14px; }
.next-links { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-top:18px; }
.next-links .textlink, .method-demo { min-height:44px; }
.interactive .again { display:inline-flex; align-items:center; gap:7px; border:0; background:none; padding:0 4px; }
.again:hover { color:var(--accent-ink); text-decoration:underline; }
.group-labels {
  position:absolute; inset:6% 0; display:grid; grid-auto-rows:1fr;
  align-items:center; pointer-events:none;
}
.group-labels .team-result {
  display:flex; flex-direction:column; width:7.6rem; text-align:left;
  font-size:1rem; color:var(--ink); line-height:1.45; font-weight:500; opacity:1;
}
.group-labels .team-result b { font-family:var(--font-mono); font-size:.86rem; color:var(--accent-ink); font-weight:500; }
.group-labels .team-result em { display:inline; font-style:normal; }
.group-labels .team-result.friction b { color:var(--resist-ink); }

/* Chapter headings leave the illustration in the same column as the home chart. */
.field-heading { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:5%; align-items:center; }
.field-heading .field-art { width:100%; height:clamp(230px,24vw,350px); }
.page-hero :is(.field-heading,.ph-grid,.contact-grid) h1 {
  font-size:clamp(2.5rem,4.1vw,4rem); letter-spacing:-.048em; line-height:1.04; text-wrap:pretty;
}
.method-demo { margin-top:20px; }
.field-heading .eyebrow { display:flex; }
.field-heading h1 { margin-top:0; }
.sec.method-steps { padding-top:0; }
.page-hero .net-card { background:none; box-shadow:none; border:0; padding:0; }
.hp-uses { border-top:1px solid var(--line); }
.case-art { width:58px; height:58px; flex:none; }
.hp-uses-grid article .case-art { margin-bottom:4px; }
.hp-uses-grid article:has(.case-link:is(:hover,:focus-visible)) { border-color:var(--accent); }
.case-context { display:flex; gap:16px; align-items:center; margin-bottom:22px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.case-context a { display:inline-flex; align-items:center; min-height:36px; color:var(--accent-ink); font-size:.94rem; text-underline-offset:3px; }
.case-context strong { display:block; color:var(--ink); font-size:1.05rem; font-weight:540; }

@media (max-width:820px), (max-height:560px) and (max-width:1050px) {
  .journey { display:flex; flex-direction:column; max-width:42rem; }
  .opening,.example { min-height:auto; }
  .opening { align-items:center; text-align:center; padding:clamp(34px,5.8svh,72px) 0 clamp(22px,3.3svh,36px); }
  .opening .eyebrow,.example .eyebrow { font-size:.875rem; margin-bottom:14px; }
  .opening h1 { font-size:clamp(1.9rem,9.85vw,3.65rem); line-height:1.14; }
  .begin { margin-top:clamp(26px,4.1svh,40px); }
  .plot { position:relative; top:auto; width:100%; margin:4px 0 0; }
  .group-labels .team-result { width:5.8rem; font-size:.85rem; line-height:1.3; }
  .group-labels .team-result b { font-size:.78rem; }
  .example { padding:clamp(28px,4.5svh,48px) 0 clamp(56px,8svh,80px); scroll-margin-top:calc(var(--chart-size) + 4px); }
  .example-copy { max-width:none; }
  .example-q { font-size:clamp(1.55rem,6.2vw,2rem); line-height:1.17; }
  .interactive .scenarios { margin-block:24px; gap:10px; flex-wrap:nowrap; }
  .scenario { flex:1; min-width:0; font-size:.81rem; border-radius:14px; padding:10px 4px; text-wrap:balance; }
  .scenario:last-child { flex:1.15; }
  .responses { justify-content:space-between; max-width:24rem; gap:8px; margin-block:28px; }
  .response { gap:4px; }
  .response .k { font-size:.8rem; gap:5px; }
  .interpretation { font-size:1rem; }
  .field-heading { display:flex; flex-direction:column; gap:22px; align-items:stretch; }
  .field-heading .field-art { height:clamp(144px,42vw,210px); }
  .page-hero :is(.field-heading,.ph-grid,.contact-grid) h1 { font-size:clamp(2.12rem,9.2vw,3.1rem); }
}
@media (max-width:720px) {
  :root { --gutter:clamp(18px,5.8vw,32px); --section-space:clamp(54px,10vw,72px); }
  .page-hero { padding-top:44px; }
  .hp-uses-head { margin-bottom:32px; }
  .hp-uses-grid article { padding-block:26px; padding-left:62px; }
  .hp-uses-grid article .case-art { position:absolute; left:0; top:26px; width:46px; height:46px; }
  .hp-uses-grid .case-link .ph { top:26px; }
  .hp-uses .textlink { margin-top:26px; }
  .field-heading { gap:32px; }
}
@media (max-height:560px) and (min-width:1051px) {
  .plot { top:75px; }
  .population { --plot-size:clamp(235px,64svh,340px); }
}
@media (max-width:359px) {
  .interactive .scenarios { display:grid; grid-template-columns:1fr 1fr; }
  .scenario:last-child { grid-column:1/-1; }
}
@media (min-width:360px) and (max-width:410px) {
  .interactive .scenario:last-child { min-width:8.4em; }
}
html:not(.m-enter) :is(.case-art,.field-art) { display:none; }
html:not(.m-enter) .field-heading { display:block; }
html:not(.m-enter) .hp-uses-grid article { padding-left:0; }
html:not(.m-enter) .nav-links { flex-wrap:wrap; }
@media (prefers-reduced-motion:reduce) {
  .interactive .again { display:none; }
  .interactive .group-labels, .interactive.show-result .group-labels { transition:none; }
}

/* The camera can cover the full width while the labels stay in the chart column. */
.population { overflow-x:clip; }
.population .opening,.population .example { position:relative; z-index:2; }
.population .opening { pointer-events:none; }
.population .opening :is(h1,a) { pointer-events:auto; }
.population .plot { z-index:1; }
.population .plot-inner #simCanvas { position:absolute; inset:auto; max-width:none; pointer-events:none; }
.population .example-note { max-width:56ch; }
.population .example-tools { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.population .example-tools .eyebrow { margin:0; }
.population .example-tools .again { flex:none; }
.population .motion-toggle {
  position:absolute; z-index:3; bottom:0; right:0;
  display:inline-grid; place-items:center; width:44px; height:44px; padding:0;
  border-radius:50%; border:1px solid var(--line-2);
  background:color-mix(in srgb,var(--bg) 91%,transparent); color:var(--ink-2); cursor:pointer;
}
.population .motion-toggle[hidden],.population .motion-toggle .play,.population .motion-toggle.paused .pause { display:none; }
.population .motion-toggle.paused .play { display:block; }
.population .motion-toggle svg { width:15px;height:15px;fill:currentColor; }
.population .motion-toggle:hover { border-color:var(--ink-3); color:var(--ink); }
html.m-enter:not(.static-population) .group-labels .team-result { opacity:0; }
.population .group-labels { opacity:1;transition:none; }
.population.interactive.show-result .group-labels { opacity:1;transition:none; }
.population .team-result b { font-variant-numeric:tabular-nums; }
.population .example:focus:not(:focus-visible) { outline:none; }
@media (min-width:821px) and (min-height:561px), (min-width:1051px) {
  .population .plot {
    top:calc(var(--nav-h,69px) + (var(--screen-space) - var(--plot-size)) / 2);
    margin-block:calc((var(--screen-space) - var(--plot-size)) / 2);
  }
  .population .motion-toggle { bottom:calc((var(--plot-size) - var(--screen-space)) / 2 + 24px); }
}
@media (max-width:820px), (max-height:560px) and (max-width:1050px) {
  .population {
    /* Give the opening the remaining stable screen height after the actual
       headline, button, header and lower breathing room have been measured. */
    --plot-size:clamp(236px,calc(100svh - var(--intro-height,275px) - 91px),min(146vw,760px));
    --chart-size:min(calc(var(--plot-size) - 16px),clamp(214px,34svh,338px));
  }
  .population .group-labels { inset:auto 0 0; height:var(--chart-size); }
  .population .example-tools { margin-bottom:14px; }
  .population .example-tools .again { font-size:.82rem; }
  .population .example-note { margin-top:22px; line-height:1.55; }
  .population .next-links { margin-top:18px; }
  .population .motion-toggle { bottom:2px; }
  .population .example-copy { max-width:100%; }
}
@media (max-width:639px) and (max-height:690px) {
  .opening .begin { min-height:44px; padding-block:10px; }
}
@media (max-width:559px) and (max-height:630px) {
  .population { --chart-size:200px; }
  .population .example { padding-top:24px; }
  .population .example-tools { margin-bottom:10px; }
  .example-q { font-size:1.4rem; }
  .interactive .scenarios,.responses { margin-block:20px; }
}
@media (max-height:560px) and (min-width:1051px) {
  .population .plot { top:70px; }
  .population .motion-toggle { bottom:6px; }
}
@media (prefers-reduced-motion:reduce) {
  .population .motion-toggle,.population.interactive .again { display:none; }
}

/* On wide screens the opening spans both columns. Reserve space below the
   actual button for the crowd, even when the reader enlarges the text. */
@media (min-width:821px) and (min-height:561px) {
  .population { --screen-space:clamp(560px,calc(100svh - 72px),1060px); }
  /* Switching questions or teams changes the notes below the figures.
     Keep the controls anchored while those notes grow and shrink. */
  .population.interactive .example {
    justify-content:flex-start;
    padding-top:max(48px,calc((var(--screen-space) - 626px) / 2));
  }
  .population .opening {
    grid-column:1/-1; align-items:center; justify-content:flex-start; text-align:center;
    padding:clamp(24px,4.6svh,68px) 0 clamp(260px,42svh,520px);
  }
  .opening h1 {
    line-height:1.11; font-size:clamp(2.625rem,min(5.4vw,7.4svh),5rem);
  }
  .opening .begin { margin-top:clamp(22px,3.6svh,38px); }
}
/* On a sideways phone, keep the question and the moving population side by side. */
@media (min-width:560px) and (max-height:560px) {
  .population { --screen-space:max(248px,calc(100svh - 72px)); --plot-size:calc(var(--screen-space) - 12px); }
  .population .journey { display:grid; max-width:var(--max,1200px); gap:0 22px; grid-template-columns:minmax(0,.96fr) minmax(0,1.04fr); }
  .population .opening { min-height:var(--screen-space); padding:10px 0 18px; text-align:left; align-items:flex-start; }
  .population .opening h1 { font-size:clamp(1.65rem,min(4.3vw,9.5svh),2.65rem); }
  .population .opening .begin { min-height:44px; margin-top:16px; }
  .population .plot { position:sticky; top:75px; margin:6px 0; }
  .population .group-labels { inset:4% 0; height:auto; }
  .population .group-labels .team-result { width:5.55rem; font-size:.81rem; line-height:1.25; }
  .population .group-labels .team-result b { font-size:.75rem; }
  .population .motion-toggle { bottom:4px; }
  .population .example { scroll-margin-top:0; padding:10px 0 36px; }
  .population .example-tools { margin-bottom:6px; }
  .population .example-q { font-size:clamp(1.22rem,2.6vw,1.64rem); }
  .population .scenarios { margin:12px 0; flex-wrap:nowrap; gap:5px; }
  .population .scenario { padding:6px 3px; border-radius:12px; font-size:.76rem; flex:1; text-wrap:balance; }
  .population .scenario:last-child { flex:1.18; min-width:8.3em; }
  .population .responses { gap:4px; justify-content:space-between; margin:12px 0; }
  .population .response .k { font-size:.76rem; gap:4px; }
}
@media (min-width:560px) and (max-width:620px) and (max-height:560px) {
  .population .begin { padding-inline:16px; }
}

/* Keep the built-in example readable if scripting or the canvas is unavailable.
   Wait for initialisation before changing the space reserved for the crowd. */
:is(html:not(.m-enter),html.static-population) .population .opening { grid-column:1/-1; min-height:0; padding-block:clamp(28px,6svh,60px) 20px; }
:is(html:not(.m-enter),html.static-population) .population .opening h1 { max-width:22ch; }
:is(html:not(.m-enter),html.static-population) .population .begin { display:none; }
:is(html:not(.m-enter),html.static-population) .population .example { min-height:0; padding-block:14px 30px; scroll-margin-top:0; }
:is(html:not(.m-enter),html.static-population) .population .plot { position:static; grid-row:2; order:1; align-self:start; width:100%; margin:14px 0 36px; }
:is(html:not(.m-enter),html.static-population) .population .plot-inner { height:auto; }
:is(html:not(.m-enter),html.static-population) .population .group-labels { position:static; height:auto; gap:0; }
:is(html:not(.m-enter),html.static-population) .population .group-labels .team-result {
  opacity:1; flex-direction:row; justify-content:space-between; width:100%;
  gap:12px; padding:12px 0; border-bottom:1px solid var(--line);
}
/* Explore a team without losing the scale of the rest of the workforce. */
.interactive .group-labels:not([inert]) { pointer-events:auto; }
.interactive .group-labels button.team-result {
  position:relative; align-self:stretch; justify-content:center; width:100%; min-width:0;
  background:transparent; padding:0; border:0; font-family:var(--font-body);
  border-radius:10px; cursor:pointer;
}
.team-name { width:8.25rem; display:flex; align-items:center; justify-content:space-between; padding-right:6px; }
.team-name::after { content:'+'; font-size:1rem; font-weight:400; color:var(--accent-ink); }
.team-result[aria-pressed="true"] .team-name::after { content:'−'; }
.interactive .team-result[aria-pressed="true"]::before,
.interactive .team-result:focus-visible::before {
  content:''; position:absolute; inset:1px -7px; border:1px solid var(--accent);
  border-radius:10px; background:color-mix(in srgb,var(--accent) 6%,transparent); pointer-events:none;
}
@media(hover:hover) {
  .interactive button.team-result:hover { background:color-mix(in srgb,var(--accent) 6%,transparent); }
}
.scope:not([hidden]) {
  display:flex; align-items:center; justify-content:space-between; gap:4px 12px; flex-wrap:wrap;
  border-top:1px solid var(--line); padding-top:6px; min-height:50px;
  font-size:.94rem; font-weight:550; color:var(--ink);
}
.scope-hint,.scope-reset { color:var(--ink-2); font:400 .875rem/1.35 var(--font-body); }
.scope-hint > span { display:none; }
.scope-count { white-space:nowrap; }
.scope-count::before { content:'· '; }
.scope-reset { flex:none; }
@media (max-width:359px), (min-width:560px) and (max-width:759px) and (max-height:560px) {
  .scope:not([hidden]) { flex-wrap:nowrap; line-height:1.3; }
  .scope-count { display:block; font-size:.82rem; font-weight:400; color:var(--ink-2); }
  .scope-count::before { content:none; }
}
.team-jump { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0; cursor:pointer;
  color:var(--accent-ink); font:inherit; background:none; border:0; }
.team-jump:hover { text-decoration:underline; }
.scope-reset { background:none; border:0; padding:0; color:var(--accent-ink); min-height:44px;
  text-decoration:underline; text-underline-offset:.22em; cursor:pointer; }
.scope:not([hidden]) + .responses { margin-top:6px; }
.whole-note { display:block; margin-bottom:4px; font-size:.9rem; font-weight:550; color:var(--accent-ink); }
.population .policy-link {
  display:inline-flex; min-height:46px; margin:0 0 21px; padding:10px 17px;
  border-radius:30px; border:1px solid var(--line-2); font-size:.94rem; line-height:1.35;
}
.population .policy-link:hover { border-color:var(--accent); text-decoration:none; }
.population .policy-link[hidden] { display:none; }
.chart-slot { display:none; }
@media (max-width:559px), (max-width:820px) and (min-height:561px) {
  .population.interactive { --chart-size:min(var(--plot-size),clamp(230px,30svh,300px)); }
  .population.interactive .example {
    margin-top:calc(-1 * var(--chart-size)); padding-top:0; scroll-margin-top:0; pointer-events:none;
  }
  .interactive .example-copy > :not(.question-panel,.chart-slot),
  .interactive .question-panel > :not([inert]) { pointer-events:auto; }
  .scope-hint > span { display:inline; }
  .team-jump { display:none; }
  .interactive .question-panel { pointer-events:none; display:flow-root; opacity:0; }
  .interactive .example-tools { margin-bottom:6px; }
  .interactive .scenarios { margin:16px 0 21px; gap:7px; }
  .interactive .chart-slot { display:block; height:var(--chart-size); position:relative; margin-bottom:14px; }
  .interactive .team-name { width:6.4rem; }
  .interactive .scope { font-size:.87rem; }
  .interactive .scope-hint,.interactive .scope-reset { font-size:.82rem; }
  .interactive .responses { margin-bottom:20px; }
  .interactive .example-note { margin-top:12px; }
  .interactive .example-copy .next-links { margin-top:12px; }
}
@media (min-width:560px) and (max-height:560px) {
  .interactive .team-name { width:6.25rem; }
}

/* Keep the separate policy comparison within reach without lengthening the home page. */
html:has(.policy-dialog[open]) { overflow:hidden; }
.policy-dialog {
  --pad:clamp(18px,4.5vw,34px);
  width:min(560px,calc(100% - 24px)); max-width:none;
  max-height:90vh; max-height:92dvh; margin:auto; padding:0 var(--pad) var(--pad);
  background:var(--surface); color:var(--ink); border:1px solid var(--line);
  border-radius:24px; box-shadow:var(--paper-shadow); overscroll-behavior:contain;
}
.policy-dialog::backdrop { background:rgb(4 15 25 / .58); }
.policy-top {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  position:sticky; top:0; background:var(--surface); padding:12px 0 8px; z-index:1;
  font-size:.88rem; font-weight:530; color:var(--accent-ink);
}
.policy-top button { flex:none; }
.policy-dialog h2 { font-size:clamp(1.65rem,5vw,2.2rem); line-height:1.09; text-wrap:balance; }
.policy-dialog p { font-size:.98rem; line-height:1.45; margin:12px 0; color:var(--ink-2); }
.policy-options { display:grid; gap:7px; margin:22px 0 0; }
.policy-options button {
  display:grid; grid-template-columns:18px 1fr auto; gap:8px; align-items:center; min-height:48px;
  text-align:left; padding:10px 15px; font:500 .98rem/1.3 var(--font-body); color:var(--ink);
  border:1px solid var(--line-2); border-radius:12px; background:transparent; cursor:pointer;
}
.policy-options button:hover { border-color:var(--accent); }
.policy-options button[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:var(--on-ink); }
.policy-key { font-size:.84rem; opacity:.84; }
.policy-options b,.policy-figure b { font-weight:550; font-variant-numeric:tabular-nums; }
.policy-figure canvas { display:block; width:100%; aspect-ratio:2.9; height:auto; margin-top:6px; }
.policy-figure > div { display:grid; grid-template-columns:1fr 1fr; text-align:center; gap:6px; font-size:.89rem; color:var(--ink-2); }
.policy-figure b { display:block; font-size:clamp(1.75rem,5vw,2.2rem); line-height:1.15; color:var(--ink); letter-spacing:-.04em; }
.policy-dialog .policy-reading { color:var(--ink); min-height:3em; margin-top:21px; }
.policy-dialog .policy-note { font-size:.86rem; margin:0; padding-top:14px; border-top:1px solid var(--line); }
@media(max-width:420px){
  .policy-dialog p { font-size:.93rem; }
  .policy-options { margin-top:15px; }
  .policy-options button { font-size:.9rem; padding:9px 11px; }
  .policy-figure canvas { aspect-ratio:2.3; }
  .policy-dialog .policy-reading { min-height:4.35em; }
}
@media(prefers-reduced-motion:no-preference){
  .policy-dialog[open] { animation:policy-open .24s ease-out both; }
  @keyframes policy-open { from { opacity:0; transform:translateY(8px); } }
}

/* The narrow view follows the question with three groups, in the same
   order as the three percentages. Keep their columns exactly aligned. */
.phone-controls { display:none; }
.population.phone-view {
  --chart-size:min(var(--plot-size),clamp(126px,39vw,224px));
}
.phone-view .opening {
  padding-top:clamp(44px,8svh,88px);
  padding-bottom:clamp(34px,5svh,60px);
}
.phone-view .opening h1 { font-size:clamp(1.8rem,9.1vw,3.3rem); line-height:1.16; }
.phone-view .begin { margin-top:clamp(30px,4.4svh,46px); }
.phone-view .example { padding-bottom:clamp(64px,10svh,110px); }
.phone-view .example:focus-visible { outline:none; }
.phone-view .example:focus-visible .eyebrow { text-decoration:underline; text-underline-offset:5px; }
.phone-view .example-tools {
  position:relative; justify-content:center; min-height:44px;
  margin:clamp(16px,3.6svh,36px) 0 12px;
}
.phone-view .example-tools .eyebrow {
  color:var(--accent-ink); font-size:.9rem; max-width:calc(100% - 90px);
  text-align:center; text-wrap:balance;
}
.phone-view .example-tools .again {
  position:absolute; right:0; justify-content:center; width:44px;
  font-size:1.08rem; color:var(--ink-2); border-radius:50%;
}
.phone-view .again span,.phone-view .scenarios,.phone-view .scope:not([hidden]),
.phone-view .group-labels { display:none; }
.phone-view .example-q {
  text-align:center; font-size:clamp(1.55rem,6.9vw,2.22rem);
  line-height:1.19; letter-spacing:-.035em;
}
.phone-view .example-q > span { text-wrap:balance; align-self:center; }
.phone-view:not(.phone-sideways) .chart-slot { margin:12px 0 8px; }
.phone-view .responses {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0;
  margin:0; max-width:none; text-align:center;
  opacity:var(--share-opacity,0);
}
.phone-view .response { gap:4px; }
.phone-view .response .n { font-size:clamp(1.85rem,8.3vw,2.6rem); }
.phone-view .response .k { justify-content:center; font-size:clamp(.8rem,3.55vw,1rem); }
.phone-view .response .k::before { display:none; }
.phone-view .phone-controls {
  opacity:var(--share-opacity,0);
  display:flex; justify-content:center; align-items:center; gap:10px;
  flex-wrap:wrap; margin:clamp(26px,4.2svh,44px) 0 clamp(36px,5.4svh,52px);
}
.phone-controls button,.phone-fold {
  display:inline-flex; align-items:center; justify-content:center; min-height:46px;
  gap:12px; padding:10px 16px; font:500 .93rem/1.3 var(--font-body);
  border:1px solid var(--line-2); border-radius:24px; color:var(--accent-ink);
  background:none; cursor:pointer;
}
.phone-controls .pick-scenario { display:inline-block; }
.phone-controls .pick-scenario span { display:none; }
.phone-controls .pick-scenario::first-letter { text-transform:uppercase; }
.pick-scenario::after { display:inline-block; margin:0 2px 1px 12px; }
.phone-controls button::after,.phone-fold::after {
  content:''; flex:none; width:7px; height:7px; border:solid currentColor;
  border-width:0 1.5px 1.5px 0; transform:translateY(-2px) rotate(45deg);
}
.phone-view .reading { border-block:1px solid var(--line); }
.phone-view .reading summary {
  align-items:center; padding:20px 4px 20px 0; color:var(--ink);
  font:520 1.08rem/1.45 var(--font-body); letter-spacing:-.015em;
}
.phone-view .reading summary i { color:var(--accent-ink); flex:none; }
.phone-view .reading .interpretation { margin:0; line-height:1.65; font-size:1rem; text-wrap:pretty; }
.phone-view .reading .next-links { padding-bottom:18px; }
.phone-view .policy-link:not([hidden]) { padding:0; margin:14px 0 0; border:0; border-radius:0; }
.phone-view .example-note { margin-top:24px; font-size:.9rem; line-height:1.6; }
.phone-view .example-copy .next-links { margin-top:8px; }
html:has(.phone-view) { scrollbar-gutter:stable; }
html:has(#simPicker[open]) { overflow:hidden; }
#simPicker {
  width:min(100%,540px); max-width:none; max-height:90vh; max-height:90dvh;
  margin:auto auto 0; padding:0 25px calc(22px + env(safe-area-inset-bottom));
  background:var(--surface); color:var(--ink); border:0; border-radius:24px 24px 0 0;
  overscroll-behavior:contain; scroll-padding-top:80px;
}
#simPicker::backdrop { background:rgb(4 15 25 / .45); }
.picker-head {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  position:sticky; top:0; z-index:1; background:var(--surface); padding:18px 0;
}
.picker-head h2 { font-size:1.44rem; }
.picker-head button { flex:none; }
.picker-list button {
  display:grid; width:100%; grid-template-columns:1fr auto; gap:4px 12px;
  text-align:left; padding:17px 4px; cursor:pointer; border:0;
  border-top:1px solid var(--line); background:none; color:var(--ink);
  font:480 1.07rem/1.35 var(--font-body);
}
.picker-list button span { grid-column:1; color:var(--ink-2); font-size:.89rem; font-weight:400; }
.picker-list button[aria-pressed=true] { color:var(--accent-ink); font-weight:650; }
.picker-list button[aria-pressed=true]::after {
  content:''; grid-column:2; grid-row:1/-1; width:8px; height:15px; align-self:center;
  margin-right:6px; border:solid currentColor; border-width:0 2px 2px 0; transform:rotate(43deg);
}
@media(max-width:385px), (min-width:560px) and (max-width:960px) and (max-height:560px) {
  .phone-controls button { font-size:.88rem; padding-inline:12px; gap:9px; }
  .phone-controls .pick-scenario { text-transform:capitalize; }
  .pick-scenario span { display:none; }
  .pick-scenario::after { margin-left:9px; }
}
/* On a sideways phone the three numbers share the sticky plot. */
.population.phone-sideways .opening { padding:10px 0 18px; }
.population.phone-sideways .opening h1 { font-size:clamp(1.65rem,min(4.3vw,9.5svh),2.65rem); line-height:1.14; }
.population.phone-sideways .begin { margin-top:16px; }
.phone-sideways .example-tools { justify-content:flex-start; margin:0 0 8px; }
.phone-sideways .example-tools .eyebrow { font-size:.79rem; text-align:left; max-width:calc(100% - 48px); }
.population.phone-sideways .example-q { font-size:clamp(1.18rem,2.8vw,1.6rem); text-align:left; }
.phone-sideways .example-q > span { text-wrap:pretty; }
.phone-sideways .phone-controls { justify-content:flex-start; margin:20px 0 34px; gap:6px; }
.phone-sideways .phone-controls button { padding-inline:10px; }
@media(max-width:599px){
  .phone-sideways .phone-controls button { padding-inline:6px; gap:6px; }
  .phone-sideways .pick-scenario::after { margin-left:6px; }
}
.population.phone-sideways .responses { position:absolute; inset:60% 0 auto; margin:0; gap:0; pointer-events:none; }
.phone-sideways .response .n { font-size:clamp(1.48rem,3.7vw,2rem); }
.population.phone-sideways .response .k { font-size:clamp(.72rem,1.6vw,.88rem); }
.phone-sideways .interpretation { font-size:.98rem; }
@media(max-height:500px){
  #simPicker { max-height:96dvh; }
  .picker-head { padding:7px 0; }
  .picker-list button { padding-block:13px; }
}
@media(prefers-reduced-motion:no-preference) {
  #simPicker[open] { animation:picker-rise .24s var(--ease) both; }
  @keyframes picker-rise { from { transform:translateY(35px); opacity:0; } }
}
