/* Canonical continuous deep-dive rhythm; colors and type come from the host. */
main[data-bw-lesson-template] { min-width: 0; }
/* Older published header bundles predate the shared skip-link repair. Keep
   the standard lesson's keyboard shortcut out of the reading flow at rest. */
body:has(main[data-bw-lesson-template]) > .skip-link:not(:focus) {
  position: fixed; width: 1px; height: 1px; padding: 0; margin: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
body:has(main[data-bw-lesson-template]) > .skip-link:focus {
  position: fixed; top: .5rem; left: .5rem; z-index: 10010;
  padding: .75rem 1rem; background: #fffefa; color: #191923;
}
/* Lesson figures are published with an inline content-visibility:auto. Without a
   matching contain-intrinsic-size the skipped box collapses to zero height while its
   caption, credit and report action keep their painted boxes, so the following
   paragraph draws over the figure. Every figure also re-expands as it scrolls into
   view, which pushes the rest of the lesson down under the reader. These figures are
   inline SVG with no subresource to defer, so render them normally. */
main[data-bw-lesson-template] figure { content-visibility: visible !important; }
main[data-bw-lesson-template] [data-bw-template-section] {
  margin-block: clamp(2.5rem, 6vw, 4rem);
  padding-block-start: clamp(1.5rem, 3vw, 2rem);
  border-block-start: 1px solid var(--bwcr-dk-line, var(--bw-line, rgba(128,128,128,.25)));
}
main[data-bw-lesson-template] [data-bw-template-section] > :is(h2,.bw-read > h2) {
  margin-block-start: 0;
  margin-block-end: .75rem;
  text-wrap: balance;
}
main[data-bw-lesson-template] .bwcr-intro {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
main[data-bw-lesson-template] .bwcr-intro .bwcr-eyebrow { color: inherit !important; opacity: .75; }
main[data-bw-lesson-template] .bw-template-opening {
  margin-block: 2rem 3rem;
  padding-block: 1rem;
  border-block: 1px solid var(--bwcr-dk-line, var(--bw-line, rgba(128,128,128,.25)));
}
main[data-bw-lesson-template] .bw-template-opening > article { border: 0; padding-block: 0; }
main[data-bw-lesson-template] :is(.bwcr-key,.bw-pearl,.lf-pearl) {
  border-radius: .5rem;
  max-width: 100%;
}
main[data-bw-lesson-template] :is(.bw-activity,.bw-question,.bw-op,.bw-reasoning-beats) { min-width: 0; }
main[data-bw-lesson-template] :is(button,input,select,textarea) { max-width: 100%; }
main[data-bw-lesson-template] [hidden] { display: none !important; }
main[data-bw-lesson-template] details { border-radius: .6rem; padding: .75rem 1rem; }
main[data-bw-lesson-template] details > summary { cursor: pointer; min-height: 44px; }
main[data-bw-lesson-template] [data-bw-template-contents] { margin-block: 1rem 2rem; border-radius: .6rem; padding: .75rem 1rem; }
main[data-bw-lesson-template] [data-bw-template-contents] > summary { min-height: 44px; cursor: pointer; font: 500 15px/1.5 "Space Grotesk", BWHeader, system-ui, sans-serif; }
main[data-bw-lesson-template] [data-bw-template-contents] a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; font: 400 15px/1.5 "Space Grotesk", BWHeader, system-ui, sans-serif; }
/* Hero: the box grows with its content and never draws a border through the description. */
main[data-bw-lesson-template] .bwcr-intro {
  border: 0 !important; outline: 0 !important; height: auto !important; min-height: 0 !important;
  max-height: none !important; overflow: visible !important;
}
/* Practice links read as two tidy pill links, not one underlined sentence. */
main[data-bw-lesson-template] .bw-lesson-practice-links {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem 1.25rem; max-width: none !important; max-inline-size: none !important; width: 100%; /* ch-based caps (Roomier reading) would collapse at font-size 0 */
  font-size: 0; color: transparent; /* hides the legacy text separator between the two links */
}
main[data-bw-lesson-template] .bw-lesson-practice-links a {
  display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: .5rem 1rem;
  border: 1px solid var(--bwcr-dk-rule, rgba(89,58,135,.3)); border-radius: 999px;
  color: light-dark(#593a87, #c4a7f5); text-decoration: none; overflow-wrap: anywhere;
  font: 500 15px/1.4 "Space Grotesk", BWHeader, system-ui, sans-serif;
}
main[data-bw-lesson-template] .bw-lesson-practice-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Lesson sections: one tidy disclosure row. */
main[data-bw-lesson-template] [data-bw-template-contents] { border: 1px solid var(--bwcr-dk-rule, rgba(89,58,135,.3)); background: transparent; }
main[data-bw-lesson-template] [data-bw-template-contents] > summary { display: flex; align-items: center; gap: .5rem; padding-block: 0; list-style: none; }
main[data-bw-lesson-template] [data-bw-template-contents] > summary::-webkit-details-marker { display: none; }
main[data-bw-lesson-template] [data-bw-template-contents] > summary::before { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; }
main[data-bw-lesson-template] [data-bw-template-contents][open] > summary::before { transform: rotate(45deg); }
/* Reading-surface tokens take precedence over the independent dark header. */
main.bwcr[data-bw-lesson-template] #bw-lesson-level-hint {
  --bwcr-dk-ink: var(--bwcr-ink);
  --bwcr-dk-ink2: var(--bwcr-ink);
  --bwcr-dk-violet-lt: var(--bwcr-purple);
}
main[data-bw-lesson-template] [data-bw-review-seal] a { color: inherit; }
/* Preserved review records must wrap with the lesson at enlarged text sizes. */
main[data-bw-lesson-template] [data-bw-review-seal] .bw-rseal-eyebrow {
  white-space: normal; flex-wrap: wrap;
}
main[data-bw-lesson-template] [data-bw-review-seal] time { white-space: normal; }
/* The compact header shows one measured title; its full name stays accessible. */
.bw26-content-breadcrumb .bw-lesson-title-full {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  main[data-bw-lesson-template] { scroll-behavior: auto; }
}
[data-bw-template-footer] {
  box-sizing: border-box; padding: 2.5rem 1.25rem 1.5rem; margin-block-start: 3rem;
  background: #10111b !important; color: #eef1f8 !important; font: 400 16px/1.6 "Space Grotesk", BWHeader, system-ui, sans-serif;
}
[data-bw-template-footer] * { box-sizing: border-box; min-width: 0; }
[data-bw-template-footer] > .container { width: min(100%, 75rem); margin-inline: auto; }
[data-bw-template-footer] .footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem),1fr)); gap: 1.5rem; }
[data-bw-template-footer] nav { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; }
[data-bw-template-footer] h2 { font: 500 15px/1.5 "Space Grotesk", BWHeader, system-ui, sans-serif; margin: 0 0 .5rem; color: inherit; }
[data-bw-template-footer] a { color: #c3cbdc !important; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; font-size: 15px; text-underline-offset: .2em; }
[data-bw-template-footer] .brand { gap: .75rem; font-weight: 650; }
[data-bw-template-footer] .brand small { display: block; font-size: 14px; letter-spacing: 0; }
[data-bw-template-footer] .footer-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.5rem; padding-block-start: 1.5rem; }
[data-bw-template-footer] .footer-bottom nav { flex-direction: row; flex-wrap: wrap; gap: 1rem; }
body.pro [data-bw-template-footer] .footer-grid { display: none; }
