.learning-article { max-width: 54rem; }
.learning-article h1 { max-width: 16ch; font-size: clamp(2.8rem, 7vw, 5.1rem); line-height: 1.02; }
.learning-article .lede { max-width: 42rem; font-size: 1.22rem; }
.learning-article .article-meta { font-weight: 500; font-size: .9rem; }
.article-jumps { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.7rem; font-size: .94rem; }
.article-jumps a { text-underline-offset: .3em; text-decoration-color: var(--gold); }
.learning-article .article-body { margin-top: 2.2rem; }
.learning-article section { scroll-margin-top: 2rem; }
.learning-article .article-body h2 { margin: 3rem 0 1rem; font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.2; }
.learning-article .article-body p { font-size: 1.075rem; }
.learning-article .article-body a { text-underline-offset: .2em; }
.learning-article code { font-family: ui-monospace, 'Cascadia Code', 'Liberation Mono', monospace; font-size: .9em; }
.learning-article p code { color: var(--ink); background: #eae5dc; padding: .1em .3em; border-radius: 2px; }
.code-example { margin: 1.4rem 0; border: 1px solid var(--line); background: var(--white); }
.code-caption { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: .7rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font: .875rem ui-monospace, monospace; }
.code-example pre { margin: 0; padding: 1.2rem; overflow-x: auto; line-height: 1.65; tab-size: 4; font-size: .94rem; }
.code-example code { font-size: inherit; }
.code-example .kw { color: #794044; }
.code-example .str { color: #3f6b57; }
.code-example .num { color: #8a5f2a; }
.code-example .comment { color: #526266; }
.code-result { padding: .9rem 1rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: #ede8df; font-size: .92rem; line-height: 1.6; }
.learning-article .aside-note { border-left: 2px solid var(--gold); margin: 1.5rem 0; padding: .3rem 0 .3rem 1.2rem; }
.learning-article .aside-note p { margin: 0; font-size: 1rem; }
.token-figure { margin: 2rem 0; padding: 1.5rem 0; border-block: 1px solid var(--line); }
.token-map { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; max-width: 27rem; margin: auto; text-align: center; }
.token-map div { display: grid; gap: .55rem; }
.token-map span { font: 1.5rem ui-monospace, monospace; padding: .7rem .25rem; background: var(--white); border: 1px solid var(--line); }
.token-map small { font-size: .8rem; color: var(--muted); }
.token-map strong { font: 1.2rem ui-monospace, monospace; color: var(--gold); }
.token-figure figcaption { color: var(--muted); text-align: center; font-size: .9rem; margin-top: 1.4rem; line-height: 1.5; }
.source-details { margin-top: 1.3rem; }
.source-details summary { cursor: pointer; font-weight: 650; padding: 1rem 0; border-block: 1px solid var(--line); }
.source-details .code-example { margin-top: 0; }
.source-details pre { max-height: 36rem; }
.download-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; font-size: .95rem; }
.demo { margin-top: 3rem; padding-top: .5rem; border-top: 2px solid var(--ink); }
.demo-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.6rem; }
.demo-layout > * { min-width: 0; }
.demo label { display: block; font-weight: 650; font-size: .93rem; margin-bottom: .6rem; }
.demo textarea, .demo select { width: 100%; font: 1rem ui-monospace, monospace; color: var(--ink); background: var(--white); border: 1px solid #a7aaa4; border-radius: 0; padding: .8rem; }
.demo textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.demo small { display: block; font-size: .85rem; line-height: 1.5; color: var(--muted); margin-top: .4rem; }
.demo-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.4rem; }
.demo input[type=range] { width: 100%; accent-color: var(--ink); margin: 1rem 0; }
.demo button { cursor: pointer; font: 650 .93rem system-ui, sans-serif; }
.demo .button { margin-top: 0; }
.demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.2rem; }
.text-button { border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: .2em; padding: .6rem 0; background: transparent; }
.demo :disabled { cursor: wait; opacity: .65; }
.demo-output { padding: 1.4rem; background: #14282d; color: #fffdf8; min-height: 18rem; }
.demo-output h3 { font: 500 .93rem system-ui, sans-serif; color: #cfdbd7; }
.demo-output pre { font: 1.6rem/1.5 ui-monospace, monospace; margin: 1.7rem 0; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 6rem; }
.demo-output pre.awaiting { font-size: 1.15rem; color: #cad3d0; }
.learning-article .demo-output p { color: #c8d3cf; font-size: .88rem; line-height: 1.55; }
.learning-article #demo-status { font-size: .95rem; min-height: 3.2rem; }
.learning-article .privacy-note { font-size: .9rem; line-height: 1.6; }
.model-inspector { padding-top: 1.5rem; margin-top: 1.5rem; border-top: 1px solid var(--line); }
.inspector-heading { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.inspector-heading h3 { font-size: 1.45rem; }
.inspector-heading label { margin-bottom: .4rem; }
.inspector-heading select { min-width: 7rem; width: auto; }
.model-inspector table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.model-inspector td, .model-inspector th { text-align: left; padding: .65rem .4rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
.model-inspector td:last-child, .model-inspector th:last-child { text-align: right; }
.model-inspector tbody { font-family: ui-monospace, monospace; }
.learning-article .closing { border-top: 1px solid var(--line); margin-top: 3rem; }
.learning-article :focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 40rem) {
  .demo-layout { grid-template-columns: 1fr; gap: 1.3rem; }
  .learning-article { padding-top: 2.5rem; }
  .learning-article .lede { font-size: 1.1rem; }
  .code-example pre { font-size: .85rem; padding: 1rem; }
  .demo-output { min-height: 13rem; }
  .demo .button { width: auto; }
}
