/* Learn (inc/learn.php): /learn/, a course's landing page, its lessons and practice case, and the course box on an
   Insights article that opens a course. A lesson is a guided case workshop: the course outline in a left rail, a
   compact header with the assignment and one action, four named stages, and case material and exercises that look
   different from reading text, so a learner can tell when it's time to act.
   Case material (the assignment, notes, orders) sits on manila; practice (exercises, quizzes) on white with a red rule. */

.learn-lesson, .learn-course, .learn-article-entry { --manila: #efe6d3; --manila-edge: #d6c7a4; --card: #fffef9; --ok: #2f5d35; }

/* /learn/ (inc/learn.php, tgp_render_learn_index): the introduction and featured course beside a 60-second exercise on
   sand, with Sam's notes on sage; then "Explore more skills", the other courses. One column on phones, in that order. */
.learn-index-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(30px, 5.5vw, 88px); align-items: start; padding-block: clamp(36px, 5.6vw, 80px) clamp(36px, 5vw, 68px); }
.learn-index-hero.has-exercise { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.learn-index-intro > * { margin: 0; }
.learn-index-intro h1 { max-width: 15ch; margin-block: 14px 18px; font-size: clamp(2.75rem, 5.4vw, 5rem); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.learn-intro { max-width: 34rem; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.125rem); line-height: 1.6; }
.learn-featured { display: grid; gap: 9px; max-width: 34rem; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.learn-featured > * { margin: 0; }
.learn-featured h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
.learn-featured .learn-actions { margin-top: 6px; }
.learn-course-meta { color: var(--muted); font-size: var(--text-sm); }

.learn-exercise { display: grid; gap: 12px; padding: clamp(20px, 3vw, 34px); background: var(--sand); border: 1px solid var(--rule); border-top: 3px solid var(--ink); }
.learn-exercise > *, .learn-exercise form > *, .learn-exercise fieldset > * { margin: 0; }
.learn-exercise h2 { font-size: clamp(2rem, 3.3vw, 3rem); line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; }
.learn-exercise-setup { font-size: var(--text-md); line-height: 1.6; }
.learn-excerpts { display: grid; gap: 8px; }
.learn-excerpt { background: #fffef9; border: 1px solid var(--rule); }
.learn-excerpt.is-source { background: var(--sage); }
.learn-excerpt > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; font-size: var(--text-md); font-weight: 600; cursor: pointer; list-style: none; }
.learn-excerpt > summary::-webkit-details-marker { display: none; }
.learn-excerpt > summary:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.learn-excerpt-sign { display: grid; flex: none; place-items: center; width: 26px; height: 26px; border: 1px solid currentColor; border-radius: 50%; font-size: 1.0625rem; line-height: 1; }
.learn-excerpt-sign::before { content: "+"; }
.learn-excerpt[open] .learn-excerpt-sign::before { content: "\2212"; }
.learn-excerpt blockquote { margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--rule); }
.learn-excerpt blockquote p { margin: 0; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.45; }
.learn-exercise-check { display: grid; gap: 12px; justify-items: start; }
.learn-exercise fieldset { display: grid; gap: 8px; width: 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.learn-exercise legend { float: left; width: 100%; padding: 0; font-size: var(--text-md); font-weight: 600; }
.learn-exercise-options { display: grid; gap: 6px; }
.learn-exercise-option { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; background: var(--paper); border: 1px solid #b7b5a9; font-size: var(--text-md); cursor: pointer; }
.learn-exercise-option:has(input:checked) { background: #fffef9; border-color: var(--ink); }
.learn-exercise-option:focus-within { outline: 3px solid var(--red); outline-offset: 2px; }
.learn-exercise-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.learn-exercise-option input:focus-visible { outline: none; }
.learn-exercise-check .button { min-height: 48px; }
.learn-exercise-feedback { justify-self: stretch; padding: 10px 12px; background: var(--sage); border-left: 3px solid var(--ink); font-size: var(--text-md); line-height: 1.55; }
.learn-exercise-feedback:empty { display: none; }
.learn-exercise-feedback[data-tone="retry"], .learn-exercise-feedback[data-tone="empty"] { background: #fffef9; border-left-color: var(--red); }
.learn-exercise-question { font-size: var(--text-md); font-weight: 600; }
.learn-exercise-plain { display: grid; gap: 4px; }
.learn-exercise-plain[hidden] { display: none; }
.learn-teaser-reveal { border-top: 1px solid #cfc6b4; border-bottom: 1px solid #cfc6b4; }
.learn-teaser-reveal > summary { display: flex; align-items: center; min-height: 48px; color: var(--red); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.learn-teaser-reveal > p { margin: 0 0 14px; line-height: 1.6; }
.learn-exercise-link { justify-self: start; }

.learn-catalog { padding-block: clamp(26px, 3.6vw, 40px) clamp(44px, 5.4vw, 76px); border-top: 1px solid var(--ink); scroll-margin-top: 16px; }
.learn-catalog > h2 { margin: 0 0 20px; font-size: clamp(2.125rem, 4vw, 3.25rem); line-height: 1.05; letter-spacing: -0.03em; }
.learn-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; } /* three across on desktop, two on tablets */
.learn-course-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(18px, 2.2vw, 26px); background: #fffef9; border: 1px solid var(--rule); }
.learn-course-card:first-child { border-top: 3px solid var(--red); }
.learn-course-card > * { margin: 0; }
.learn-course-card h3 { font-size: clamp(1.5rem, 2.2vw, 1.875rem); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.learn-course-summary { color: #4b4d47; line-height: 1.6; }
.learn-course-makes { font-size: var(--text-sm); line-height: 1.5; }
.learn-course-open { min-height: 44px; margin-top: auto; }
.learn-index .button:focus-visible, .learn-excerpt > summary:focus-visible, .learn-teaser-reveal > summary:focus-visible { outline-offset: 3px; }

/* Shared pieces */
.learn-facts { color: var(--muted); font-size: var(--text-sm); }
.learn-facts strong { color: var(--ink); font-weight: 600; }
.learn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.button.learn-primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.button.learn-primary:hover { background: #8f1f19; border-color: #8f1f19; }
.learn-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--muted); font-size: var(--text-sm); }
.learn-progress[hidden] { display: none; }
.learn-progress p { margin: 0; }
.learn-reset { min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.learn-draft { color: var(--red); font-family: var(--sans); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0; }
.learn-download { background: none; }

/* A course's landing page: who it's for, what you'll be able to do, how to begin; then the six lessons */
.learn-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: start; padding-block: clamp(32px, 4.4vw, 60px) clamp(32px, 4vw, 52px); }
.learn-hero-main { display: grid; gap: 18px; align-content: start; }
.learn-hero-main > * { margin: 0; }
.learn-hero h1 { font-size: clamp(2.75rem, 5.2vw, 4.5rem); line-height: 1; letter-spacing: -0.035em; text-wrap: balance; }
.learn-hero-audience { max-width: 36rem; font-family: var(--serif); font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.4; }
.learn-hero .learn-actions { margin-top: 4px; }
.learn-hero-note { max-width: 34rem; color: #4b4d47; font-size: var(--text-sm); line-height: 1.55; }
.learn-hero-outcomes { padding: clamp(22px, 3vw, 32px); background: var(--manila); border-top: 3px solid var(--ink); }
.learn-hero-outcomes h2 { margin: 0 0 14px; font-family: var(--sans); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.learn-hero-outcomes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.learn-hero-outcomes li { position: relative; padding-left: 26px; line-height: 1.55; }
.learn-hero-outcomes li::before { content: "✓"; position: absolute; left: 0; color: var(--red); font-weight: 700; }
.learn-sequence { padding-top: clamp(24px, 3vw, 36px); }
.learn-sequence > h2 { padding-bottom: 12px; border-bottom: 1px solid var(--ink); font-family: var(--sans); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.learn-lesson-list { margin: 0; padding: 0; list-style: none; }
.learn-lesson-item { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) 6.5rem; gap: 16px; padding: 22px 0 24px; border-bottom: 1px solid var(--rule); }
.learn-lesson-number { color: var(--red); font-family: var(--serif); font-size: 2rem; line-height: 1; }
.learn-lesson-item.is-done .learn-lesson-number { color: var(--muted); }
.learn-lesson-level { margin: 0 0 4px; color: var(--red); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.learn-lesson-title { margin: 0; font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.learn-lesson-title a { text-decoration: none; }
.learn-lesson-title a:hover { text-decoration: underline; }
.learn-lesson-summary { max-width: 46rem; margin-top: 8px; color: #3d3f3a; line-height: 1.6; }
.learn-lesson-meta { margin-top: 8px; color: var(--muted); font-size: var(--text-sm); }
.learn-lesson-status { display: flex; justify-content: flex-end; align-self: start; margin: 4px 0 0; font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.learn-lesson-done, .learn-lesson-next { padding: 3px 10px; }
.learn-lesson-done { background: #e5f0e3; color: var(--ok); }
.learn-lesson-done::before { content: "✓ "; }
.learn-lesson-next { background: var(--ink); color: var(--paper); }
.learn-practice-card { display: grid; gap: 8px; margin-top: 28px; padding: 22px 24px; background: var(--manila); border-left: 3px solid var(--manila-edge); }
.learn-practice-card h3 { font-size: 1.25rem; line-height: 1.25; }
.learn-practice-card p:last-child { color: #4b4d47; line-height: 1.6; }
.learn-course-more { padding-top: clamp(40px, 5vw, 64px); }
.learn-course-about { max-width: 46rem; font-size: 1.0625rem; }
.learn-course-about > :first-child { margin-top: 0; }

/* A lesson: the course outline in a rail beside the lesson */
.learn-workshop { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: clamp(32px, 4.4vw, 72px); align-items: start; padding-top: clamp(24px, 3vw, 40px); }
.learn-rail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding-bottom: 16px; }
.learn-main { min-width: 0; max-width: 56rem; }
.learn-outline-toggle > summary { display: none; }
.learn-outline { padding-top: 14px; border-top: 1px solid var(--ink); }
.learn-outline-course { margin: 0 0 6px; }
.learn-outline-course a { color: var(--ink); text-decoration: none; }
.learn-outline-course a:hover { text-decoration: underline; }
.learn-outline ol, .learn-outline ul { margin: 6px 0 0; padding: 0; list-style: none; }
.learn-outline li { border-bottom: 1px solid var(--rule); }
.learn-outline li > a { display: grid; grid-template-columns: 1.625rem minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 6px; min-height: 44px; color: var(--ink); font-size: var(--text-sm); line-height: 1.4; text-decoration: none; }
.learn-outline a:hover .learn-outline-title, .learn-outline-extra a:hover { text-decoration: underline; }
.learn-outline-number { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border: 1px solid #b9b8ae; border-radius: 50%; color: var(--muted); font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.learn-outline li.is-current > a { background: var(--manila); font-weight: 600; box-shadow: inset 3px 0 0 var(--red); }
.learn-outline li.is-current .learn-outline-number { border-color: var(--red); background: var(--red); color: #fff; }
.learn-outline li.is-done .learn-outline-number { border-color: var(--ok); background: var(--ok); color: #fff; }
.learn-outline-done::before { content: "✓"; color: var(--ok); font-weight: 700; }
.learn-outline-done[hidden] { display: none; }
.learn-outline .learn-outline-extra li > a { grid-template-columns: minmax(0, 1fr); font-weight: 600; }
.learn-outline-extra a[aria-current="page"] { background: var(--manila); box-shadow: inset 3px 0 0 var(--red); }
.learn-outline-heading { margin-top: 22px; }
.learn-outline .learn-outline-materials li > a { font-weight: 400; }

/* The lesson header: where you are, what you'll make, how long, and how to start */
.learn-lesson-header { display: grid; gap: 14px; padding-bottom: 24px; }
.learn-lesson-header > * { margin: 0; }
.learn-kicker a { color: inherit; text-decoration: none; }
.learn-kicker a:hover { text-decoration: underline; }
.learn-lesson-header h1 { max-width: 44rem; font-size: clamp(2.125rem, 3.8vw, 3.25rem); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.learn-brief { max-width: 44rem; padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.4vw, 26px); background: var(--manila); border-left: 4px solid var(--ink); }
.learn-brief-label { margin: 0 0 6px; color: var(--red); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.learn-brief-text { margin: 0; font-family: var(--serif); font-size: clamp(1.1875rem, 1.9vw, 1.4375rem); line-height: 1.4; }
.learn-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.learn-header-actions .text-link { gap: 10px; }
.learn-quiet-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: var(--text-sm); }
.learn-lesson-details { color: var(--muted); font-size: var(--text-xs); }

/* The four stages, linked to their sections; the one in view is marked by learn.js */
.learn-stages ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); counter-reset: none; }
.learn-stages li { border-right: 1px solid var(--rule); }
.learn-stages li:last-child { border-right: 0; }
.learn-stages a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; color: var(--ink); font-size: var(--text-sm); font-weight: 600; text-decoration: none; }
.learn-stages a:hover { background: var(--manila); color: var(--ink); }
.learn-stages a[aria-current] { box-shadow: inset 0 3px 0 var(--red); background: var(--card); }
.learn-stage-number { display: inline-grid; place-items: center; flex: none; width: 1.625rem; height: 1.625rem; border: 1px solid var(--ink); border-radius: 50%; font-size: 0.6875rem; }
.learn-stages a[aria-current] .learn-stage-number { border-color: var(--red); background: var(--red); color: #fff; }
.learn-practice-toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: var(--text-sm); }
.learn-practice-toc li { break-inside: avoid; margin-bottom: 6px; }
.learn-lesson--practice .learn-lesson-header { border-bottom: 1px solid var(--rule); }

/* Lesson text: reading columns stay narrow; activities may use the full width */
.learn-prose { padding-top: 12px; }
.learn-prose [id] { scroll-margin-top: 16px; }
.learn-prose > :not(.tgp-stage), .tgp-stage > :not(.tgp-activity):not(.tgp-compare) { max-width: 42rem; }
.tgp-stage { padding-top: 24px; margin-bottom: 40px; border-top: 1px solid var(--ink); }
.insight-prose .tgp-stage-label { display: inline-block; margin: 0 0 16px; padding: 3px 10px; background: var(--ink); color: var(--paper); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; line-height: 1.6; text-transform: uppercase; }
.insight-prose .tgp-stage > h2:first-of-type { margin-top: 0; }
.insight-prose h3 { margin-top: 32px; }

/* Case material: the assignment, and the reference beside an activity */
.insight-prose .tgp-assignment { margin: 20px 0 24px; padding: 18px 22px; background: var(--manila); border-left: 4px solid var(--ink); font-size: 1.0625rem; }
.insight-prose .tgp-assignment > p { margin: 0 0 10px; }
.insight-prose .tgp-assignment > :last-child { margin-bottom: 0; }
.insight-prose .tgp-assignment-label, .insight-prose .tgp-compare-label { margin-bottom: 6px; color: var(--red); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; line-height: 1.6; text-transform: uppercase; }
.insight-prose .tgp-activity { display: grid; gap: 20px; margin: 24px 0 32px; }
.insight-prose .tgp-activity > * { margin-block: 0; }
.insight-prose .tgp-reference { margin: 0; padding: 0 18px 14px; background: var(--manila); border: 1px solid var(--manila-edge); border-top: 3px solid var(--manila-edge); }
.insight-prose .tgp-reference > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 48px; padding-block: 8px; color: var(--ink); font-size: var(--text-sm); font-weight: 600; line-height: 1.35; cursor: pointer; }
.insight-prose .tgp-reference > summary::before { content: "Case file"; padding: 2px 8px; background: var(--ink); color: var(--paper); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; }
.insight-prose .tgp-reference .wp-block-code { margin: 4px 0 10px; padding: 14px 16px; background: var(--card); border-color: var(--manila-edge); border-left: 3px solid var(--manila-edge); }
.insight-prose .tgp-reference .wp-block-code code { font-size: 0.8125rem; line-height: 1.55; }
.insight-prose .tgp-reference ul, .insight-prose .tgp-reference ol { margin: 4px 0 10px; padding-left: 20px; font-size: var(--text-md); line-height: 1.55; }
.insight-prose .tgp-reference > p { margin: 4px 0 10px; font-size: var(--text-md); line-height: 1.55; }
.insight-prose .tgp-case-notice { color: #5a4f3a; font-size: var(--text-sm); line-height: 1.5; }
.insight-prose .tgp-reference .tgp-case-notice { margin: 0; }
.insight-prose .tgp-stage > .tgp-case-notice { padding: 10px 14px; background: var(--manila); border-left: 3px solid var(--manila-edge); }
.insight-prose .tgp-steps > :first-child { margin-top: 0; }
.insight-prose .tgp-steps > :last-child { margin-bottom: 0; }
.insight-prose .tgp-steps ol > li { margin-bottom: 8px; }

/* A vague request beside a specific prompt */
.insight-prose .tgp-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0 24px; }
.insight-prose .tgp-compare-item { padding: 18px 20px; background: var(--card); border: 1px solid var(--rule); border-top: 3px solid #96988e; font-size: var(--text-md); line-height: 1.6; }
.insight-prose .tgp-compare-item + .tgp-compare-item { border-top-color: var(--ok); }
.insight-prose .tgp-compare-item + .tgp-compare-item .tgp-compare-label { color: var(--ok); }
.insight-prose .tgp-compare-item > * { margin: 0 0 10px; }
.insight-prose .tgp-compare-item > :last-child { margin-bottom: 0; }
.insight-prose .tgp-compare-label { color: var(--muted); }
.insight-prose .tgp-compare-prompt { font-family: var(--serif); font-size: 1.1875rem; line-height: 1.4; }
.insight-prose .tgp-compare-item ol, .insight-prose .tgp-compare-item ul { padding-left: 20px; }
.insight-prose .tgp-compare-item li { margin-bottom: 6px; }

/* The worked example to compare against */
.insight-prose .tgp-reveal { margin: 20px 0 32px; background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--ok); }
.insight-prose .tgp-reveal > summary { display: flex; align-items: center; min-height: 52px; padding: 8px 18px; font-weight: 600; cursor: pointer; }
.insight-prose .tgp-reveal > summary::after { content: "Show"; margin-left: auto; padding-left: 16px; color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
.insight-prose .tgp-reveal[open] > summary::after { content: "Hide"; }
.insight-prose .tgp-reveal[open] > summary { border-bottom: 1px solid var(--rule); }
.insight-prose .tgp-reveal > :not(summary) { margin-inline: 18px; }
.insight-prose .tgp-reveal .wp-block-code { background: #fff; border-left-color: var(--ok); }
.insight-prose .tgp-reveal .wp-block-code code { font-family: var(--sans); font-size: var(--text-md); line-height: 1.65; } /* an email reads as an email */
.insight-prose .tgp-reveal > :nth-child(2) { margin-top: 16px; }
.insight-prose .tgp-reveal > :last-child { margin-bottom: 18px; }

/* Prompts to copy, answers to reveal */
.insight-prose .wp-block-code { margin: 20px 0 28px; padding: 18px 20px; overflow-x: auto; background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--ink); }
.insight-prose .wp-block-code code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.learn-copy-bar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; }
.learn-copy-bar + .wp-block-code { margin-top: 6px; }
.learn-copy { min-height: 44px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; font-size: var(--text-xs); font-weight: 600; cursor: pointer; }
.learn-copy:hover { background: var(--ink); color: var(--paper); }
.learn-copy-status { margin-right: auto; color: var(--muted); font-size: var(--text-xs); }
.insight-prose .wp-block-details:not(.tgp-reference):not(.tgp-reveal) { margin: 8px 0 24px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.insight-prose .wp-block-details:not(.tgp-reference):not(.tgp-reveal) > summary { display: flex; align-items: center; min-height: 44px; color: var(--red); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.insight-prose .wp-block-details:not(.tgp-reference):not(.tgp-reveal)[open] > summary { margin-bottom: 4px; }
.insight-prose .wp-block-details > p { margin: 0 0 16px; }

/* Practice on the page: spot the errors, check yourself, checklists */
.insight-prose .tgp-exercise { margin: 32px 0; padding: clamp(20px, 3vw, 28px); background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--red); }
.insight-prose .tgp-activity > .tgp-exercise { margin: 0; }
.insight-prose .tgp-exercise > h2:first-child, .insight-prose .tgp-exercise > h3:first-child { margin-top: 0; }
.insight-prose .tgp-exercise > :is(h2, h3):first-child::before { content: "Practice"; display: block; margin-bottom: 8px; color: var(--red); font-family: var(--sans); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.tgp-exercise-form, .tgp-quiz-form { margin: 0; padding: 0; border: 0; min-width: 0; }
.tgp-exercise-lines, .tgp-quiz-options { margin: 12px 0 0; padding: 0; list-style: none; }
.tgp-exercise-lines > li, .tgp-quiz-options > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tgp-exercise-lines > li::before { content: none; }
.tgp-exercise-lines input, .tgp-quiz-options input, .tgp-checklist.is-interactive input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--ink); }
.tgp-exercise-lines label, .tgp-quiz-options label, .tgp-checklist.is-interactive label { cursor: pointer; line-height: 1.55; }
.tgp-feedback { grid-column: 2; margin: 4px 0 0; padding: 8px 12px; font-size: var(--text-md); line-height: 1.55; }
.tgp-feedback.is-right { background: #e5f0e3; }
.tgp-feedback.is-wrong { background: #f6e4e1; }
.tgp-feedback[hidden] { display: none; }
.tgp-exercise-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; }
.tgp-exercise-status { flex-basis: 100%; margin: 0; font-weight: 600; }
.tgp-exercise-status:empty { display: none; }
.learn-check-button { min-height: 44px; padding: 10px 18px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--ink); color: var(--paper); font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.learn-check-button:hover { background: var(--red); border-color: var(--red); }
.learn-reset[hidden] { display: none; }
.insight-prose .tgp-quiz { margin: 24px 0; padding: 18px 20px; background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--red); }
.tgp-quiz-form legend { padding: 0; font-weight: 600; line-height: 1.5; }
.tgp-quiz .learn-check-button { margin-top: 14px; }
.tgp-quiz > .tgp-feedback { margin-top: 12px; }
.tgp-quiz > .tgp-feedback:empty { display: none; }
.insight-prose .tgp-checklist.is-interactive { padding-left: 0; list-style: none; }
.insight-prose .tgp-checklist.is-interactive > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.insight-prose .tgp-checklist.is-interactive > li:has(input:checked) label { color: var(--muted); }

/* Finish: mark the lesson complete and go on */
.learn-finish { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; max-width: 42rem; margin-top: 8px; padding: clamp(20px, 3vw, 28px); background: var(--manila); border-top: 3px solid var(--ink); }
.learn-finish h2 { flex-basis: 100%; margin: 0; font-size: clamp(1.5rem, 2.2vw, 1.875rem); }
.learn-finish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.learn-done { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; flex-basis: 100%; }
.learn-done[hidden] { display: none; }
.learn-done-text { margin: 0; color: var(--ok); font-size: var(--text-sm); font-weight: 600; }
.learn-done-mark { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-right: 4px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 0.75rem; }
.learn-finish-status { flex-basis: 100%; margin: 0; color: var(--muted); font-size: var(--text-sm); }
.learn-finish-status:empty { display: none; }
.learn-article-course .learn-finish-actions { margin-top: 4px; }
.learn-article-course-all { margin: 0; }
.learn-done-button { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 18px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.learn-done-box { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 2px; }
.learn-done-button[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.learn-done-button[aria-pressed="true"] .learn-done-box { border-color: #fff; }
.learn-done-button[aria-pressed="true"] .learn-done-box::before { content: "✓"; font-size: 0.875rem; line-height: 1; }
.learn-done-status { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.learn-done-status:empty { display: none; }

/* Previous and next lesson */
.learn-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 42rem; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--ink); }
.learn-pager-link { display: grid; align-content: start; gap: 6px; padding: 12px 0; min-height: 44px; color: var(--ink); text-decoration: none; }
.learn-pager-next { grid-column: 2; text-align: right; }
.learn-pager-label { color: var(--red); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.learn-pager-title { font-family: var(--serif); font-size: clamp(1.125rem, 1.8vw, 1.375rem); line-height: 1.25; text-wrap: balance; }
.learn-pager-link:hover .learn-pager-title { text-decoration: underline; }
.learn-footer { padding-top: 32px; }

/* From Francheska's Desk: her own words, in a lesson */
.is-style-tgp-desk { margin: 0 0 32px; padding: 20px 24px; background: var(--sand); border-top: 3px solid var(--ink); }
.insight-prose .is-style-tgp-desk > h2:first-child { margin-top: 0; font-family: var(--sans); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.is-style-tgp-desk > :last-child { margin-bottom: 0; }

/* An Insights article that opens a course: where it sits, and the way on */
.learn-article-entry { display: inline-block; max-width: 100%; margin: 0 0 18px; padding: 8px 14px; background: var(--manila); border-left: 3px solid var(--red); font-size: var(--text-sm); line-height: 1.5; }
.insight-header .learn-article-entry + .insight-kicker { margin-top: 0; }
.learn-article-entry-where { font-weight: 600; }
.learn-article-course { display: grid; gap: 12px; margin-top: 48px; padding: clamp(24px, 3vw, 36px); background: var(--sand); }
.learn-article-course h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.learn-article-course p { color: #4b4d47; line-height: 1.6; }
.learn-article-course .learn-done { margin-top: 4px; }
.learn-article-course .learn-actions { margin-top: 4px; }

/* Narrower screens: a button that opens the case file in a dialog, kept at the bottom of the screen during the activity */
.learn-case-peek { display: flex; justify-content: flex-end; position: sticky; bottom: 12px; z-index: 5; margin-top: 12px; pointer-events: none; }
.learn-case-peek.is-idle { visibility: hidden; }
.learn-case-button { pointer-events: auto; min-height: 44px; padding: 10px 16px; border: 1px solid var(--ink); border-radius: 999px; background: var(--manila); color: var(--ink); font: inherit; font-size: var(--text-sm); font-weight: 600; box-shadow: 0 4px 14px rgb(32 34 31 / 0.18); cursor: pointer; }
.learn-case-button::before { content: "Case file · "; color: var(--muted); font-weight: 500; }
.learn-case-button:hover { background: var(--ink); color: var(--paper); }
.learn-case-button:hover::before { color: inherit; }
.insight-prose .tgp-activity.has-case-peek { display: block; }
.insight-prose .tgp-activity.has-case-peek > * + * { margin-top: 20px; }
.learn-case-dialog { width: min(640px, calc(100vw - 24px)); max-height: min(85vh, 900px); padding: 0; border: 1px solid var(--manila-edge, #d6c7a4); border-top: 3px solid var(--ink); background: #efe6d3; color: var(--ink); }
.learn-case-dialog::backdrop { background: rgb(32 34 31 / 0.45); }
.learn-case-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: #efe6d3; border-bottom: 1px solid #d6c7a4; }
.learn-case-head h2 { margin: 0; font-family: var(--sans); font-size: var(--text-sm); font-weight: 600; line-height: 1.35; }
.learn-case-chip { margin-right: 6px; padding: 2px 8px; background: var(--ink); color: var(--paper); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; }
.learn-case-body { padding: 12px 16px 16px; font-size: 1rem; }
.learn-case-body .wp-block-code { margin: 0 0 10px; padding: 14px 16px; background: #fffef9; border: 1px solid #d6c7a4; border-left: 3px solid #d6c7a4; }
.learn-case-body .wp-block-code code { font-size: 0.8125rem; line-height: 1.55; }
.learn-case-body .tgp-case-notice { margin: 0; color: #5a4f3a; font-size: var(--text-sm); }

/* Wide screens: the case file sits beside the activity that uses it, and stays in view */
@media (min-width: 1240px) {
    .learn-case-peek { display: none; }
    .insight-prose .tgp-activity, .insight-prose .tgp-activity.has-case-peek { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); align-items: start; gap: 28px; }
    .insight-prose .tgp-activity.has-case-peek > * + * { margin-top: 0; }
    .insight-prose .tgp-activity > .tgp-reference { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
    .insight-prose .tgp-activity > :not(.tgp-reference) { grid-column: 1; }
}

/* Phones and tablets: one column, the outline folded into a control above the lesson */
@media (max-width: 999px) {
    .learn-workshop { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 12px; }
    .learn-rail { position: static; max-height: none; overflow: visible; padding-bottom: 0; }
    .learn-outline-toggle { margin-bottom: 20px; border-bottom: 1px solid var(--rule); }
    .learn-outline-toggle > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; font-size: var(--text-sm); cursor: pointer; list-style: none; }
    .learn-outline-toggle > summary::-webkit-details-marker { display: none; }
    .learn-outline-summary-course { font-weight: 600; }
    .learn-outline-summary-where { flex: none; color: var(--muted); }
    .learn-outline-summary-where::after { content: "  ▾"; white-space: pre; }
    .learn-outline-toggle[open] .learn-outline-summary-where::after { content: "  ▴"; }
    .learn-outline-toggle .learn-outline { padding-top: 0; padding-bottom: 12px; border-top: 0; }
    .learn-outline-toggle .learn-outline-course { display: none; }
    .learn-hero, .learn-index-hero, .learn-index-hero.has-exercise { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .learn-hero { padding-top: 24px; }
    .learn-lesson-item { grid-template-columns: 2.5rem minmax(0, 1fr); gap: 4px 12px; }
    .learn-lesson-number { font-size: 1.625rem; }
    .learn-lesson-status { grid-column: 2; justify-content: flex-start; margin: 6px 0 0; }
    .learn-lesson-status:not(:has(:not([hidden]))) { display: none; }
    .learn-stages ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .learn-stages li:nth-child(2) { border-right: 0; }
    .learn-stages li:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
    .insight-prose .tgp-compare { grid-template-columns: minmax(0, 1fr); }
    .learn-pager { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .learn-pager-next { grid-column: 1; text-align: left; }
    .learn-actions .button, .learn-header-actions .button, .learn-finish .button { width: 100%; }
    .learn-practice-toc ol { columns: 1; }
    .learn-index-hero { padding-top: 26px; gap: 28px; }
    .learn-index-intro h1 { margin-bottom: 12px; }
    .learn-featured { margin-top: 20px; padding-top: 16px; }
    .learn-course-open { align-self: stretch; }
    .insight-prose .tgp-assignment, .insight-prose .tgp-exercise, .insight-prose .tgp-quiz { padding-inline: 16px; }
}
