/* Shared type roles: editorial headings grow; interface text stays predictable. */
:root {
  --font-text:Sohne,Arial,sans-serif;
  --weight-text:400;
  --weight-emphasis:600;
  --text-meta:.75rem;
  --text-caption:.875rem;
  --text-body:1rem;
  --text-lead:1.25rem;
  --text-ui-label:1.125rem;
  --text-ui-subheading:1.265625rem;
  --text-ui-heading:1.601807rem;
  --text-ui-title:2.027287rem;
  --text-ui-display:2.280697rem;
  --text-editorial-subheading:clamp(1.25rem,1.1rem + .65vw,1.5625rem);
  --text-editorial-heading:clamp(1.5625rem,1.375rem + .8125vw,1.953125rem);
  --text-reading-title:clamp(1.953125rem,1.71875rem + 1.015625vw,2.441406rem);
  --text-display:clamp(2.441406rem,1.4rem + 3.75vw,4.768372rem);
  --leading-text:1.65;
  --leading-control:1.45;
  --leading-heading:1.18;
  --tracking-heading:-.025em;
}
body {font-family:var(--font-text);font-size:var(--text-body);font-weight:var(--weight-text);line-height:var(--leading-text);letter-spacing:.005em;font-kerning:normal}
:is(h1,h2,h3,h4,h5,h6) {font-weight:var(--weight-emphasis);text-wrap:balance}
:is(button,input,textarea,select,summary) {font-family:var(--font-text);letter-spacing:0}
:is(p,dd) {text-wrap:pretty}
:is(code,kbd,pre) {font-variant-ligatures:none}

/* Opening and section hierarchy use the same major-third editorial ramp. */
.focused-journey .opening-definition h1 {font-size:var(--text-display);line-height:1.08;letter-spacing:-.04em;white-space:normal;text-wrap:balance}
.focused-journey .opening-definition .hero-intro {font-size:var(--text-lead);line-height:1.6;max-width:40ch}
.focused-journey .opening-definition .opening-kicker {font-size:var(--text-caption);line-height:1.5}
.hero-explanation,.hero-author-note,.landing-resource-grid p,.landing-chapter-heading p,.landing-example-context,.role-flow-heading p {font-size:var(--text-body);line-height:var(--leading-text)}
.landing-contents h2,.landing-chapter-heading h2,.role-flow-heading h2 {font-size:var(--text-editorial-heading);line-height:var(--leading-heading);letter-spacing:var(--tracking-heading);text-wrap:balance}
.landing-resource-grid h3 {font-size:var(--text-ui-label);line-height:1.4;letter-spacing:-.01em}
.role-flow-explanation h3 {font-size:var(--text-editorial-subheading);line-height:1.2;letter-spacing:var(--tracking-heading)}
.role-flow-explanation>p,.role-flow-explanation .role-flow-feedback,.role-flow-caption,.role-flow-agents p,.role-flow-perimeter>p {font-size:var(--text-body);line-height:var(--leading-text)}
.role-flow-tab {font-size:var(--text-body);line-height:var(--leading-control)}
.role-flow-tab small,.role-flow-eyebrow,.role-flow-example-label,.role-flow-target>span,.role-flow-perimeter-label {font-size:var(--text-caption);line-height:1.5}
.role-flow-caption {max-width:65ch}
.role-flow-target strong,.role-flow-order>strong {font-size:var(--text-ui-label);line-height:1.4}
.role-flow-actions button,.role-flow-test,.role-flow-back {font-size:var(--text-caption);line-height:var(--leading-control)}
.focused-journey .opening-definition .opening-actions>a {font-size:var(--text-body);line-height:var(--leading-control);white-space:normal}

/* Each lesson keeps a distinct title, readable explanation, and quiet controls. */
.focused-journey .idea-heading h3 {font-size:var(--text-reading-title);line-height:var(--leading-heading);letter-spacing:var(--tracking-heading);text-wrap:balance;max-width:30ch}
.focused-journey .idea-heading .idea-explanation {font-size:var(--text-body);line-height:var(--leading-text);max-width:65ch}
.focused-journey .lesson-scene-body :is(p,dd),.focused-journey .intent-path li {font-size:var(--text-body);line-height:var(--leading-text)}
.focused-journey .lesson-scene-body :is(.diagram-caption,.context-note,.small-intro,.model-note) {max-width:70ch}
.focused-journey .lesson-scene-body :is(.section-context,.mini-label) {font-size:var(--text-caption);line-height:1.5}
.focused-journey .interactive-panel h4,.focused-journey .environment-branch h5,.focused-journey .packet-title h4 {font-size:var(--text-ui-subheading);line-height:1.3;letter-spacing:-.015em}
.focused-journey :is(.concept-step,.slice-node,.mobile-flow-node,.production-step>span,.workflow-card) {font-size:var(--text-body);line-height:var(--leading-control)}
.focused-journey .flow-svg :is(text,.small,.label) {font-size:var(--text-body)}
.review-strip>span {color:var(--muted);font-size:var(--text-caption);letter-spacing:.05em}
.review-strip small {font-size:var(--text-caption);line-height:1.5}
.focused-journey .lesson-previous,.focused-journey .lesson-controls .source-detail summary,.focused-journey .idea-next {font-size:var(--text-caption);line-height:var(--leading-control);min-height:44px}
.focused-journey .lesson-position {font-size:var(--text-meta);line-height:1.5;font-variant-numeric:tabular-nums}
.focused-journey .mobile-chapter-menu summary,.focused-journey[data-view=skills]>header #mobile-chapter-menu>summary {font-size:var(--text-caption);line-height:var(--leading-control)}
.focused-journey .chapter-utilities>a {font-size:var(--text-caption)!important}
.focused-journey .segmented button,.incident-demo-controls button,.focused-journey .check-options button {font-size:var(--text-caption);line-height:var(--leading-control);min-height:44px}
.focused-journey :is(.inline-skills .skill-chip,.inline-skills>span) {font-size:var(--text-caption);line-height:1.5}
.focused-journey .lesson-controls .notes-body p {font-size:var(--text-body);line-height:var(--leading-text);max-width:65ch}
:is(.quota-numbers,.lesson-position,.library-categories small,.role-flow-tab small,.production-step small) {font-variant-numeric:tabular-nums}

/* Skills: fixed UI scale, full-size descriptions, secondary metadata. */
.focused-journey .skills-chapter .library-heading h2 {font-size:var(--text-ui-title);line-height:var(--leading-heading);letter-spacing:var(--tracking-heading)}
.library-intro,.library-row-use,.library-use p,.library-setup p,.library-credit p+p,.library-empty p {font-size:var(--text-body);line-height:var(--leading-text)}
.library-row-top strong {font-size:var(--text-ui-label);line-height:1.4;font-weight:var(--weight-emphasis)}
.library-results-heading h3,.library-inspector h3,#library-dialog-body h3 {font-size:var(--text-ui-heading);line-height:1.3;letter-spacing:var(--tracking-heading);text-wrap:balance;overflow-wrap:anywhere}
.library-row-meta,.library-source-label,.library-credit+.library-source-label,#library-results-count,.library-total {font-size:var(--text-caption);line-height:1.5}
.library-credit,.library-detail-category,.library-use h4,.library-lessons h4 {font-size:var(--text-caption);line-height:1.5}
.library-primary,.library-secondary,.library-text-button,.library-source-links a,.library-setup summary,.library-setup>a,.library-lessons a,#library-copy-category,#library-view-category {font-size:var(--text-caption);line-height:1.5;min-height:44px}
.library-category-actions {max-width:100%}
.library-results-heading {flex-wrap:wrap;row-gap:12px}
.library-categories button,.library-categories .library-shortcuts button {font-size:var(--text-caption);line-height:var(--leading-control)}
.library-categories small {font-size:var(--text-meta)}
.library-source-links a {overflow-wrap:anywhere}
.library-setup p {overflow-wrap:anywhere}
.library-dialog-bar {font-size:var(--text-caption);line-height:1.5}
#skill-install-dialog h2 {font-size:var(--text-ui-heading);line-height:1.3;letter-spacing:var(--tracking-heading);overflow-wrap:anywhere}
#skill-install-help,#skill-install-text {font-size:var(--text-body);line-height:var(--leading-text)}

/* Apply is a working interface, with fixed headings and readable results. */
.apply-heading h2 {font-size:var(--text-ui-display);line-height:var(--leading-heading);letter-spacing:var(--tracking-heading)}
.apply-heading>p,.apply-result>p,.apply-lesson p,.apply-result-skills small,.apply-service-note,.apply-status {font-size:var(--text-body);line-height:var(--leading-text);max-width:65ch}
.apply-result h3 {font-size:var(--text-ui-heading);line-height:1.3;letter-spacing:var(--tracking-heading)}
.apply-lesson h4 {font-size:var(--text-ui-subheading);line-height:1.35;letter-spacing:-.015em}
.apply-result-skills a {font-size:var(--text-body);line-height:1.5}
.apply-result-kicker,.apply-examples button {font-size:var(--text-caption);line-height:1.5}
#apply-project {font-size:var(--text-body);line-height:var(--leading-text)}
#apply-form label {font-size:var(--text-ui-label);line-height:1.4}
.focused-journey .sources h2,.focused-journey .glossary h3 {font-size:var(--text-reading-title);line-height:var(--leading-heading);letter-spacing:var(--tracking-heading)}
.focused-journey :is(.sources p,.glossary p,.glossary dd) {font-size:var(--text-body);line-height:var(--leading-text);max-width:65ch}

@media(max-width:720px) {
  .focused-journey .opening-definition h1 {max-width:none}
  .focused-journey .opening-definition .hero-intro {font-size:var(--text-ui-label)}
  .focused-journey .opening-definition .opening-actions>a {font-size:var(--text-caption)}
  .focused-journey .lesson-controls {flex-wrap:wrap;column-gap:8px;row-gap:4px}
  .focused-journey .lesson-controls .source-detail {flex:1 1 auto}
  .focused-journey .lesson-controls .source-detail summary {white-space:normal}
  .library-inspector h3,#library-dialog-body h3 {font-size:var(--text-ui-subheading)}
  .library-row-top strong {font-size:var(--text-ui-label)}
  .library-category-actions {flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px}
  #library-copy-category {white-space:normal;text-align:center}
  .role-flow-tab>span:last-child {min-width:0}
  .role-flow-tab:not(:last-child)::after {font-size:var(--text-caption)}
  .role-flow-perimeter-label {position:static;display:block;width:fit-content;margin:-10px 0 12px;padding:0}
}

/* Text enlargement can change the available measure without changing the window. */
.focused-journey>header,.focused-journey[data-view=skills]>header {height:auto;min-height:4.5rem}
.focused-journey header .brand {min-width:0;white-space:normal;line-height:1.2}
.focused-journey header .brand .mark {flex-shrink:0}
.focused-journey header .brand>span:last-child {min-width:0;overflow-wrap:anywhere}
.focused-journey .opening-chapters.system-map,.opening-chapters {grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr))}
.chapter-door>span {min-width:0;overflow-wrap:anywhere}
@media(max-width:720px) {
 .focused-journey>header,.focused-journey[data-view=skills]>header {min-height:4rem}
}
/* A long enlarged title must never make the rest of its idea unreachable. */
body.focused-journey.type-reader-reflow {height:auto;min-height:100dvh;overflow:visible}
.focused-journey.type-reader-reflow main {height:auto;overflow:visible}
.focused-journey.type-reader-reflow .chapter-layout {height:auto;min-height:calc(100dvh - var(--header-height));overflow:visible}
.focused-journey.type-reader-reflow .chapter-content {height:auto;overflow:visible}
.focused-journey.type-reader-reflow .idea:not([hidden]) {height:auto;min-height:calc(100dvh - var(--header-height) - 48px);grid-template-rows:auto auto auto;overflow:visible}
.focused-journey.type-reader-reflow .lesson-scene-body {overflow:visible}
.focused-journey.type-reader-reflow .lesson-controls {flex-wrap:wrap}

.library-results-heading p {font-size:var(--text-body);line-height:var(--leading-text)}
.apply-result .apply-result-kicker {font-size:var(--text-caption);line-height:1.5}
.copy-install-prompt,.view-install-prompt,.apply-lesson .primary,.apply-submit {font-size:var(--text-caption);line-height:var(--leading-control)}
