/* Readable defaults that also respect the reader's browser font preference. */
html { font-size: 100%; }
body, body[data-mode="self"] {
  --type-reading: 1rem;
  --type-label: 1rem;
  --type-support: .875rem;
  --type-control: 1rem;
  --type-section: 1.25rem;
  --type-card-title: 1.125rem;
  --type-input: 1.25rem;
  --type-chart: .875rem;
  --type-chapter: 2rem;
  --fs: var(--type-reading);
}
body[data-mode="meeting"] {
  --type-reading: 1.125rem;
  --type-label: 1.125rem;
  --type-support: 1rem;
  --type-control: 1.125rem;
  --type-section: 1.375rem;
  --type-card-title: 1.25rem;
  --type-input: 1.375rem;
  --type-chart: 1rem;
  --type-chapter: 2.125rem;
  --fs: var(--type-reading);
}
body { font-size: var(--type-reading); line-height: 1.6; }
button, input, textarea, summary { font-family: inherit; }
button, a, summary, p, dt, dd, th, td { overflow-wrap: break-word; }
.wstory, .chapter-note, .result-status, .cgrow, .tnline, .why p,
.wrow, .gl dd, .sharing-note, dialog > p:not(.eyebrow) {
  font-size: var(--type-reading);
  line-height: 1.65;
}
.wstory { max-width: 50ch; }
.bs, .tiny-trust, .path-heading > p, .pathbtn small, .how, .wnote,
.site-footer, .inputs > .help, .field .help, .more .help, .help,
.inflnote, .field-error, .warnline, .err, .result-for, .result-assumptions,
.result-eyebrow, .result-metrics span, .cgsub, .tnbox small, .tnfut em,
.lg, .assump, .help.howto, .disc, .own, .status, .scroll-hint, .sumt small,
.chapter-intro .trust, .chapter-intro .eyebrow {
  font-size: var(--type-support);
  line-height: 1.6;
}
.help, .assump, .inflnote, .sharing-note, .chapter-note, .chapter-intro .trust,
.disc p, .gl dd { max-width: 68ch; }
body[data-mode="meeting"] .help, body[data-mode="meeting"] .howto { display: block; }
.eyebrow, .chapter-intro .eyebrow { font-size: var(--type-support); letter-spacing: .06em; }
.result-eyebrow { letter-spacing: .06em; }
.pathbtn b, .scenario-heading h3 { font-size: var(--type-card-title); line-height: 1.4; }
.pathbtn { gap: 1rem; min-height: 11rem; }
.pathbtn small { max-width: 26ch; }
.pathbtn > span, .chapter-heading { min-width: 0; }
.path-arrow { font-size: 1.25rem; }
.h2, .inputs .h2, .rowh .h2 { font-size: var(--type-section); line-height: 1.4; }
.gl dt, .sumt b { font-size: var(--type-label); line-height: 1.5; }
.field label, .ctacard .field label {
  font-size: var(--type-label);
  line-height: 1.5;
  align-items: baseline;
  flex-wrap: wrap;
}
.field label > span { min-width: 0; }
.field label output { flex: none; }
.field { margin-bottom: 1.5rem; }
.field .help, .inflnote { margin-top: .5rem; }
.inp, .txt { min-height: 3.5rem; }
.inp input, .txt {
  font-size: var(--type-input);
  line-height: 1.4;
  min-height: 3.25rem;
}
.inp input { padding: .625rem 0; }
.inp span { font-size: var(--type-label); }
::placeholder { color: var(--ink2); opacity: 1; }
.check-label { min-height: 2.75rem; }
.check-label input { width: 1.25rem; height: 1.25rem; }
input[type="range"] { height: 2.75rem; }
.btn, .btns .btn, .ctacard .btn, .chip, .seg button, .ctl .seg button,
.homebtn, .ctl .homebtn, .tabs button, .rowh .seg button, .linkbtn,
.chapter-intro #btnPath {
  font-size: var(--type-control);
  line-height: 1.4;
  min-height: 3rem;
  white-space: normal;
  max-width: 100%;
}
.btn, .btns .btn, .ctacard .btn { padding: .625rem 1rem; }
.btns .btn { flex: 1 1 12rem; min-width: 0; }
.chip { padding: .625rem .75rem; }
.seg { max-width: 100%; min-width: 0; }
.seg button, .ctl .seg button { padding: .5rem .75rem; min-width: 0; }
.tabs { display: inline-flex; flex-wrap: wrap; }
.tabs button { flex: 1 1 auto; }
#segReal { display: flex; flex-wrap: wrap; }
#segReal button { flex: 1 1 auto; }
.linkbtn, .chapter-intro #btnPath { min-height: 2.75rem; }
.more summary, details summary { font-size: var(--type-label); min-height: 3rem; line-height: 1.5; }
.result-value { overflow-wrap: anywhere; }
.result-value small { font-size: var(--type-label); line-height: 1.5; white-space: normal; }
.result-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
.result-metrics strong { font-size: var(--type-card-title); line-height: 1.5; }
.tnbox b { font-size: var(--type-input); line-height: 1.4; }
.result-assumptions { padding-top: 1rem; }
.cgnum { font-size: var(--type-support); min-width: 2rem; width: 2rem; height: 2rem; }
.cgrow { align-items: start; }
.cgsub { margin-top: .3rem; }
.wrow { align-items: baseline; }
.wrow em { font-size: var(--type-support); }
.tw table, .tw th, .tw td { font-size: var(--type-support); line-height: 1.6; }
.tw th { font-weight: 600; }
.tw td, .tw th { padding: .75rem .5rem; }
#cases th:first-child, #cases td:first-child { min-width: 6rem; }
#cases th:nth-child(2), #cases td:nth-child(2) { left: 6rem; min-width: 4rem; }
.scenario-heading { flex-wrap: wrap; }
.scenario-heading > span { font-size: var(--type-support); line-height: 1.5; }
.scenario dl > div { font-size: var(--type-support); line-height: 1.6; gap: .75rem; align-items: baseline; }
.scenario dt { flex: 1 1 45%; min-width: 0; max-width: none; }
.scenario dd { flex: 1 1 55%; min-width: 0; }
.g-txt, .g-lbl { font-size: var(--type-chart); }
.lg { gap: .75rem 1rem; }
.disc .h2 { font-size: var(--type-label); }
.disc p { margin-bottom: .75rem; }
.site-footer { flex-wrap: wrap; }
.art-note { font-size: 1.125rem; line-height: 1.4; max-width: calc(100% - 1.5rem); text-align: right; }
.chapter-intro { row-gap: .5rem; }
.chapter-intro h1 { font-size: var(--type-chapter); }
.chapter-intro #btnPath { white-space: normal; }
.chapter-intro .trust { margin: 0; }
dialog { width: min(42rem, calc(100% - 2rem)); }
dialog h2 { font-size: 1.875rem; line-height: 1.3; padding-right: 1.5rem; }
dialog textarea { font-size: var(--type-reading); line-height: 1.6; }
.dialog-close { width: 3rem; height: 3rem; font-size: 1.75rem; }
.view-controls { display: flex; align-items: center; gap: .75rem; min-width: 0; }
#segMode { min-width: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible,
.txt:focus-visible, input:focus-visible, textarea:focus-visible, .inp:focus-within {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
@media (max-width: 1100px) and (min-width: 760px) {
  .pathbtn { flex-direction: column-reverse; align-items: start; }
  .pathbtn img { width: 6rem; height: 6rem; }
}
@media (max-width: 959px) {
  .chapter-intro { grid-template-columns: 96px minmax(0,1fr); }
  .chapter-image { grid-column: 1; grid-row: 1 / 4; width: 96px; height: 96px; }
  .chapter-intro #btnPath { grid-column: 2; grid-row: 4; justify-self: start; padding-left: 0; }
}
@media (max-width: 759px) {
  body, body[data-mode="self"] { --type-chapter: 1.625rem; }
  body[data-mode="meeting"] { --type-chapter: 1.75rem; }
  .top-in { grid-template-columns: minmax(0,1fr) auto; }
  .ctl { display: contents; }
  .view-controls { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
  body[data-welcome="1"] .view-controls { display: none; }
  #btnHome { flex: 0 0 auto; padding: .5rem 0; }
  #segMode { flex: 0 1 auto; max-width: 100%; }
  #segMode button { flex: 1 1 auto; }
  .ctl .seg button { padding: .5rem .625rem; }
  .brand { min-width: 0; }
  .pathbtn { padding: 1.25rem; min-height: 9rem; }
  .pathbtn img { width: 5.25rem; height: 5.25rem; }
  .pathbtn b { margin-bottom: .5rem; }
  .chapter-intro { grid-template-columns: 64px minmax(0,1fr); padding: 1.125rem; row-gap: .75rem; }
  .chapter-image { grid-column: 1; grid-row: 1; width: 64px; height: 64px; }
  .chapter-heading { grid-column: 2; grid-row: 1; }
  .chapter-note { grid-column: 1 / -1; grid-row: 2; }
  .chapter-intro .trust { grid-column: 1 / -1; grid-row: 3; }
  .chapter-intro #btnPath { grid-column: 1 / -1; grid-row: 4; }
  .chapter-intro .eyebrow { letter-spacing: .025em; }
  .hero, .card { padding: 1.25rem; }
  .tn { gap: .75rem; }
  .tnbox { flex-basis: 100%; }
  .tnarrow { display: none; }
  .result-metrics { gap: .75rem; }
  .result-metrics > div + div { padding-left: .75rem; }
  .result-value small { display: inline-block; }
  .sharing-note { padding: .875rem; }
}
@media (max-width: 359px) {
  .chapter-intro { padding: 1rem; }
  .pathbtn { gap: .75rem; padding: 1rem; }
  .pathbtn img { width: 4rem; height: 4.5rem; }
  .scenario dl > div { display: block; }
  .scenario dd { text-align: left; margin-top: .25rem; }
  .result-metrics { grid-template-columns: 1fr; gap: 1rem; }
  .result-metrics > div + div { border-left: 0; padding-left: 0; }
}
@media print {
  body { --type-reading: 1rem; --type-support: .875rem; --type-label: 1rem; }
  .view-controls { display: none; }
  .chapter-intro { display: block; }
}
/* Tables and charts keep their own scrolling when enlarged text needs it. */
#cases th:nth-child(-n+2), #cases td:nth-child(-n+2) {
  position: static;
  left: auto;
  background: inherit;
  box-shadow: none;
}
.chartbox { overflow-x: auto; }
.why summary { font-size: var(--type-label); line-height: 1.5; min-height: 3rem; }
.facil { font-size: var(--type-support); line-height: 1.6; }

/* Header utilities stay compact even when the planner uses Meeting text sizes. */
.ctl { gap: .75rem; }
.view-controls { gap: .5rem; }
#segLang, #segMode { padding: .125rem; border-radius: .5rem; }
.ctl #segLang button, .ctl #segMode button, .ctl #btnHome {
  font-size: .875rem;
  line-height: 1.4;
  min-height: 2.5rem;
  padding: .375rem .625rem;
  white-space: nowrap;
}
.ctl #segLang button { min-width: 2.5rem; }
@media (max-width: 759px), (pointer: coarse) {
  .ctl #segLang button, .ctl #segMode button, .ctl #btnHome { min-height: 2.75rem; }
  .ctl #segLang button { min-width: 2.75rem; }
}
