/* Components of the design system: page frames and app components on top of Basecoat (shadcn/ui as plain HTML).
   Needs tokens.css and type.css. Load order: basecoat.css, tokens.css, type.css, components.css.
   The app uses only these classes; it defines no colors, fonts or components of its own. */

body { background: var(--background); color: var(--foreground); font-family: var(--font-sans); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-24); }
.muted { color: var(--muted-foreground); }
::placeholder { color: var(--placeholder); opacity: 1; }
.stack > * + * { margin-top: var(--space-16); }
.row { display: flex; gap: var(--space-12); align-items: center; flex-wrap: wrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.reading { max-width: 680px; }
.note { font-size: var(--text-14); color: var(--muted-foreground); }
/* A note under a table, list, grid or form keeps a gap to it (0.45.1); form sections keep their own 20px. */
:where(table, ul, ol, dl, pre, figure, form, .medal-grid, .prompt, .data-table) + p.note { margin-top: var(--space-12); }

/* ---- Button: the brand call to action (one per view). Other buttons use Basecoat variants. ---- */
.btn[data-variant="brand"], .btn-brand { background: var(--brand); color: var(--brand-foreground); border: 1px solid transparent; }
.btn[data-variant="brand"]:hover, .btn-brand:hover { background: color-mix(in srgb, var(--brand) 88%, var(--foreground)); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* Form fields (0.58): one calm focus edge. The outline above and Basecoat's 3px ring stacked into a thick double
   frame; a field now shows only its border in the ring colour plus 1px of the same colour. Checkboxes and radios keep
   the outline. */
:is(.input:not([type="checkbox"], [type="radio"]), .select, .textarea, select, textarea, .input-group > :is(input, textarea, select)):focus-visible {
  outline: none; border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring); }

/* ---- Site frame (guests) ---- */
/* ---- Wordmark with the mark (0.23.0): a.wordmark > svg.mark (dist/img/brand/mark.svg, inline) + span.wordmark-name.
   The mark takes the colour of the text, so it follows light, dark and the header over an image. */
.wordmark { display: inline-flex; align-items: center; gap: .6em; white-space: nowrap; }
.wordmark .mark { height: 1.45em; width: auto; flex: none; }
.site-footer .wordmark, .app-footer .wordmark { color: var(--foreground); font-size: var(--text-13); }
/* Mask mark (0.36.0): the mark of another instance, from an image file (SVG or transparent PNG) as a CSS mask filled with
   the text colour, so it follows light, dark and the header over an image like the inline mark. The file must come from
   the same origin (a mask needs CORS otherwise). Markup: span.mark.mark-mask[style="--mark: url(/brand/mark); --mark-ratio: 1.58"]
   with aria-hidden; --mark-ratio is width / height of the file. Sizes come from .mark in every place. */
.mark-mask { display: inline-block; aspect-ratio: var(--mark-ratio, 1); background: currentColor;
  -webkit-mask: var(--mark) center / contain no-repeat; mask: var(--mark) center / contain no-repeat; }
/* Small screens: the header shows the mark only; the name stays for screen readers (.visually-hidden rules). */
@media (max-width: 520px) {
  .site-header .wordmark .wordmark-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .site-header .wordmark .mark { height: 28px; }
}
/* Stacked variant (.wordmark-stacked, and always in the app sidebar): one word per line, the mark as high as the
   three lines (cap top to baseline). */
.app-sidebar .wordmark, .wordmark-stacked { white-space: normal; line-height: 1.3; gap: var(--space-12); }
.app-sidebar .wordmark .mark, .wordmark-stacked .mark { height: 3.3em; }
.wordmark-stacked .wordmark-name { width: min-content; }
.site-header { position: absolute; inset: 0 0 auto 0; z-index: 10; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.site-header .wordmark { color: var(--on-image); }
.site-header .btn { color: var(--on-image); }
.site-header-solid { position: static; border-bottom: 1px solid var(--border); }
.site-header-solid .wordmark, .site-header-solid .btn { color: var(--foreground); }
.site-footer { border-top: 1px solid var(--border); margin-top: var(--space-96); }
.site-footer-inner { display: flex; justify-content: space-between; gap: var(--space-24); flex-wrap: wrap; padding-top: var(--space-32); padding-bottom: var(--space-48); font-size: var(--text-13); color: var(--muted-foreground); }
.site-footer a { color: var(--muted-foreground); text-decoration: none; }
.site-footer a:hover { color: var(--foreground); }

.section { padding: var(--space-96) 0; border-top: 1px solid var(--border); }
.hero-slider + .section { border-top: 0; }
.section-head { display: grid; gap: var(--space-12); margin-bottom: var(--space-48); max-width: 680px; }
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-32); }
.pillar { padding-top: var(--space-16); border-top: 1px solid var(--primary); }
.pillar h3 { font: 400 var(--head-24)/1.25 var(--font-subtitle); margin: var(--space-12) 0 var(--space-8); }
.pillar p { margin: 0; font-size: var(--text-15); line-height: 1.6; color: var(--muted-foreground); }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

/* ---- Hero slider: dark photo, display title, lead, one brand call to action ----
   Markup: section.hero-slider > .hero-slide[data-active] (img.hero-image + .hero-copy) + nav.hero-dots.
   Motion: slow cross-fade with a gentle zoom; the copy rises 12 px. hero-slider.js turns the slides. */
/* 0.57.17: the slides share one grid cell instead of sitting absolute, so the slider grows with its tallest slide. On a
   low screen (a tablet across) the copy no longer runs up under the header or down over the dots. */
.hero-slider { position: relative; display: grid; min-height: min(92svh, 860px); overflow: hidden; background: var(--image-scrim); color: var(--on-image); isolation: isolate; }
.hero-slide { position: relative; grid-area: 1 / 1; opacity: 0; visibility: hidden;
              transition: opacity 1400ms cubic-bezier(.4, 0, .2, 1), visibility 0s linear 1400ms; }
.hero-slide[data-active] { opacity: 1; visibility: visible; transition: opacity 1400ms cubic-bezier(.4, 0, .2, 1), visibility 0s; }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06);
              filter: grayscale(.35) contrast(1.02); transition: transform 9000ms linear; }
.hero-slide[data-active] .hero-image { transform: scale(1); }
.hero-slide::after { content: ""; position: absolute; inset: 0;
                     background: linear-gradient(90deg, color-mix(in srgb, var(--image-scrim) 82%, transparent) 0%,
                     color-mix(in srgb, var(--image-scrim) 55%, transparent) 45%, color-mix(in srgb, var(--image-scrim) 15%, transparent) 100%); }
/* Film grain: the touch of retro */
.hero-slider::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* 0.57.18: the hero fits the screen. Sizes and gaps follow the screen height; the copy sits at the bottom, just above
   the slide numbers, and the free space goes above the title. */
.hero-copy { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
             max-width: 1200px; margin: 0 auto; padding: clamp(88px, 14svh, 120px) var(--space-24) calc(clamp(20px, 4svh, 40px) + 50px);
             min-height: min(92svh, 860px); box-sizing: border-box; }
.hero-copy > * { max-width: 760px; opacity: 0; transform: translateY(12px);
                 transition: opacity 900ms ease-out, transform 900ms cubic-bezier(.2, .7, .2, 1); }
.hero-slide[data-active] .hero-copy > * { opacity: 1; transform: none; }
.hero-slide[data-active] .hero-copy > :nth-child(2) { transition-delay: 250ms; }
.hero-slide[data-active] .hero-copy > :nth-child(3) { transition-delay: 400ms; }
.hero-slide[data-active] .hero-copy > :nth-child(4) { transition-delay: 550ms; }
.hero-copy .eyebrow { color: color-mix(in srgb, var(--on-image) 72%, transparent); }
.hero-copy .display { margin-top: clamp(10px, 1.8svh, 20px); font-size: calc(clamp(34px, min(6vw, 8.5svh), 72px) * var(--text-scale) * var(--heading-scale)); line-height: 1.05; color: var(--on-image); }
.hero-copy .lead { margin-top: clamp(12px, 2.4svh, 24px); max-width: 600px; font-size: calc(clamp(16px, min(1.8vw, 2.7svh), 21px) * var(--text-scale)); color: color-mix(in srgb, var(--on-image) 78%, transparent); }
.hero-copy .row { margin-top: clamp(18px, 3.4svh, 40px); }
.hero-copy .btn[data-variant="brand"] { border-color: color-mix(in srgb, var(--on-image) 22%, transparent); }
.hero-copy .btn[data-variant="ghost"] { color: var(--on-image); }
.hero-copy .btn[data-variant="ghost"]:hover { background: color-mix(in srgb, var(--on-image) 10%, transparent); }
.hero-dots { position: absolute; z-index: 3; left: 0; right: 0; bottom: clamp(20px, 4svh, 40px); max-width: 1200px; margin: 0 auto; padding: 0 var(--space-24);
             display: flex; align-items: center; gap: var(--space-20); }
.hero-dots button { all: unset; cursor: pointer; display: flex; align-items: center; gap: var(--space-10);
                    font: 500 var(--text-14) var(--font-sans);
                    color: color-mix(in srgb, var(--on-image) 55%, transparent); }
.hero-dots button::after { content: ""; width: 48px; height: 1px; background: color-mix(in srgb, var(--on-image) 30%, transparent); }
.hero-dots button[aria-current="true"] { color: var(--on-image); }
.hero-dots button[aria-current="true"]::after { background: var(--on-image); }
.hero-dots button:focus-visible { outline: 2px solid var(--on-image); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-image, .hero-copy > * { transition: none !important; transform: none !important; }
}
@media (max-width: 700px) { .hero-dots button::after { width: 24px; } }

/* ---- Auth pages ---- */
.auth { max-width: 440px; margin: var(--space-96) auto; padding: 0 var(--space-24); }
.auth .display { margin: var(--space-12) 0 var(--space-8); }
.auth form { margin-top: var(--space-28); display: grid; gap: var(--space-16); }
/* After the form (0.99.3): the help note and the way back (a.btn, e.g. "Use another address") each get room, so
   they do not stick to the submit button. */
.auth > form ~ .note, .auth > form ~ .btn { margin-top: var(--space-24); }
.auth > form ~ .note + .btn { margin-top: var(--space-16); }
/* Sign-in page of a product (0.52): .auth-split > .auth-media (img, one or up to three) + .auth. One image is a still;
   with data-gallery the images change slowly (dist/auth-gallery.js moves data-active). On a phone the image is a band
   above the form. */
.auth-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 0;
  min-height: calc(100vh - 160px); }
.auth-split .auth { margin: var(--space-64) auto; }
.auth-media { position: relative; align-self: stretch; min-height: 420px; overflow: hidden; border-radius: var(--radius); margin: var(--space-24) 0 var(--space-24) var(--space-24);
  background: var(--muted); }
.auth-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; }
.auth-media img[data-active] { opacity: 1; }
@media (max-width: 860px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-media { min-height: 0; aspect-ratio: 16 / 9; margin: var(--space-16) var(--space-16) 0; }
  .auth-split .auth { margin: var(--space-40) auto var(--space-64); }
}
@media (prefers-reduced-motion: reduce) { .auth-media img { transition: none; } }
.code-input { font: 500 var(--head-24) var(--font-mono); letter-spacing: .4em; text-align: center; height: 52px; }

/* ---- App shell (members): sidebar, header, content, footer ---- */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.app-sidebar { border-right: 1px solid var(--border); padding: var(--space-20) var(--space-14); display: flex; flex-direction: column; gap: 2px;
               position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--background); box-sizing: border-box; }
.app-sidebar .wordmark { padding: 6px var(--space-10) var(--space-20); color: var(--foreground); }
.app-sidebar .eyebrow { padding: var(--space-18) var(--space-10) 6px; }
.nav-link { display: flex; align-items: center; gap: var(--space-10); font-size: var(--text-14); padding: 7px var(--space-10); border-radius: 6px;
            text-decoration: none; color: var(--muted-foreground); }
.nav-link:hover { background: var(--accent); color: var(--foreground); }
.nav-link[aria-current="page"] { background: var(--accent); color: var(--foreground); }
.nav-link svg { width: 16px; height: 16px; flex: none; }
/* Sidebar groups (0.103.0): long navigations (admin) in groups the reader can scan. .app-sidebar > a.nav-switch (the way
   to the other area) + details.nav-group[open] > summary (span + optional .nav-count, the sum while closed) + a.nav-link …
   The title is the strongest text of the sidebar, the links hang from a guide line; nav-group.js remembers open groups. */
.nav-switch { display: flex; align-items: center; gap: var(--space-8); margin: 0 0 var(--space-8); padding: var(--space-8) var(--space-10);
  border: 1px solid var(--border); border-radius: var(--radius); font: 500 var(--text-14)/1.3 var(--font-sans); color: var(--foreground); text-decoration: none; }
.nav-switch:hover { background: var(--accent); }
.nav-switch::after { content: "→"; margin-left: auto; color: var(--muted-foreground); }
.nav-switch[data-back]::after { content: none; }
.nav-switch[data-back]::before { content: "←"; color: var(--muted-foreground); }
.nav-switch > .nav-count { margin-left: auto; }
.nav-switch:has(.nav-count)::after { margin-left: var(--space-8); }
.nav-group { margin-top: var(--space-8); padding-top: var(--space-8); border-top: 1px solid var(--border); }
.nav-group > summary { display: flex; align-items: center; gap: var(--space-8); padding: 6px var(--space-10); border-radius: 6px; list-style: none; cursor: pointer;
  font: 600 var(--text-14)/1.3 var(--font-sans); color: var(--foreground); }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ""; width: 7px; height: 7px; margin-left: auto; border: solid var(--muted-foreground); border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease-out; }
.nav-group[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-group > summary > .nav-count { margin-left: auto; }
.nav-group > summary > .nav-count + * { margin-left: 0; }
.nav-group[open] > summary > .nav-count { display: none; }
.nav-group > summary:hover { background: var(--accent); }
.nav-group > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.nav-group > .nav-link { margin: 1px 0 1px var(--space-14); padding-left: var(--space-12); border-left: 1px solid var(--border); border-radius: 0 6px 6px 0; }
.nav-group > .nav-link[aria-current="page"] { border-left: 2px solid var(--primary); padding-left: calc(var(--space-12) - 1px); font-weight: 500; }
.nav-group > .nav-link:last-child { margin-bottom: 4px; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); height: 60px; padding: 0 var(--space-32);
              border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
              background: color-mix(in srgb, var(--background) 88%, transparent); backdrop-filter: blur(10px); }
.app-header .crumbs { font-size: var(--text-14); color: var(--muted-foreground); display: flex; gap: var(--space-8); align-items: center; }
.app-header .crumbs a { color: inherit; text-decoration: none; }
.app-header .crumbs a:hover { color: var(--foreground); }
.app-header .crumbs > * { white-space: nowrap; }
.app-header .crumbs > :last-child { color: var(--foreground); overflow: hidden; text-overflow: ellipsis; }
.app-header .crumbs { min-width: 0; }
/* 0.78.0: a long title no longer breaks the header. The left row shrinks, so the last step ends in "…"; a step before it
   ends in "…" past 20em; the right row (search, bookmarks, user menu) keeps one line. */
.app-header > .row { flex-wrap: nowrap; }
.app-header > .row:first-child { min-width: 0; }
.app-header > .row:last-child { flex: none; }
.app-header .crumbs > a { max-width: 20em; overflow: hidden; text-overflow: ellipsis; }
.app-user { display: flex; align-items: center; gap: var(--space-12); font-size: var(--text-13); color: var(--muted-foreground); }
.app-content { padding: var(--space-40) var(--space-32) var(--space-64); flex: 1; }
/* Flow (0.66.0, 0.90.0): the reset of Basecoat sets every margin to 0, so blocks touched unless a component had its own
   margin. 0.66 spaced only a fixed list of parents, and every new wrapper (a tab panel in a section, a form in a tab)
   fell out of it. Since 0.90 the contract is by markup, at any depth inside .app-content:
   - A flow container is .app-content, a tab panel, a .form-section, the section of a card, or any wrapper without a
     class (div, section, article, form, fieldset, details). A wrapper with a class is a component: it lays out its
     own children (gap or its own rules) and is never a flow container.
   - In a flow container a block keeps 24 px to the block before it, a heading (h2 to h4) 32 px, and the block right
     after a heading 8 px. Hidden things (input[type=hidden], [hidden], template, script) never count as the block before.
   Zero specificity: a component's own margin wins (.block-head 48 px, .qa 64 px), so components must not reset their
   outer margin to 0 (bin/check-flow.py checks this). */
:where(.app-content, .app-content [role="tabpanel"], .app-content .form-section, .app-content .card > section,
  .app-content :is(div, section, article, form, fieldset, details):not([class])) > :where(:not(.block-head, .greeting, h1, h2, h3, h4, .eyebrow, input[type="hidden"], [hidden], template, script, style, summary)) + :where(:not(.form-section)) { margin-top: var(--space-24); }
:where(.app-content, .app-content [role="tabpanel"], .app-content .form-section, .app-content .card > section,
  .app-content :is(div, section, article, form, fieldset, details):not([class])) > :where(:not(h1, h2, h3, h4, .eyebrow, input[type="hidden"], [hidden], template, script, style, summary)) + :where(h2, h3, h4) { margin-top: var(--space-32); }
:where(.app-content, .app-content [role="tabpanel"], .app-content .form-section, .app-content .card > section,
  .app-content :is(div, section, article, form, fieldset, details):not([class])) > :where(h2, h3, h4) + :where(:not(h1, h2, h3, h4)) { margin-top: var(--space-8); }
.app-footer { border-top: 1px solid var(--border); padding: var(--space-20) var(--space-32); display: flex; justify-content: space-between; gap: var(--space-16); flex-wrap: wrap;
              font-size: var(--text-13); color: var(--muted-foreground); }
.app-footer a { color: var(--muted-foreground); text-decoration: none; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; position: fixed; inset: 0 30% 0 0; z-index: 20; height: auto; box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--image-scrim) calc(30% * var(--shadow)), transparent); }
  .app-shell[data-menu="open"] .app-sidebar { display: flex; }
  .menu-toggle { display: inline-flex; }
  .app-header, .app-content, .app-footer { padding-left: var(--space-20); padding-right: var(--space-20); }
  /* Breadcrumbs: a small strip under the header border that stays with the sticky header. Only the last two steps
     show; "…" stands for the steps before them. */
  .app-header .crumbs { position: absolute; top: 100%; left: 0; right: 0; height: 28px; padding: 0 var(--space-20); gap: 6px;
                        font-size: var(--text-12); border-bottom: 1px solid var(--border);
                        background: color-mix(in srgb, var(--background) 88%, transparent); backdrop-filter: blur(10px); }
  .app-header .crumbs > :not(:nth-last-child(-n+3)) { display: none; }
  .app-header .crumbs:has(> :nth-child(4))::before { content: "…"; }
  .app-content { padding-top: var(--space-60); }
}

/* ---- Dashboard ---- */
.greeting { margin-bottom: var(--space-40); }
.greeting .display { margin-top: var(--space-8); }
.greeting .lead { margin-top: var(--space-16); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-40); align-items: start; }
/* Even split (0.45): two equal columns, e.g. the rules and the recent list of the progress page. */
.split[data-even] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* A split after a grid or table keeps the section gap of a block head (0.45.2). */
:where(.medal-grid, .data-table, .card-grid) + .split { margin-top: var(--space-48); }
/* Stacked, the aside comes last: it keeps a distance to the block after the split. */
@media (max-width: 1100px) { .split, .split[data-even] { grid-template-columns: 1fr; } .split > aside:last-child { margin-bottom: var(--space-40); } }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin: var(--space-48) 0 var(--space-16); }
.block-head:first-child { margin-top: 0; }
.block-head a { font-size: var(--text-13); color: var(--muted-foreground); }

/* ---- Product grid and cards ---- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-16); }
/* The grid follows the number of products (0.15, data-count on .product-grid): 1 is one wide horizontal card,
   2 two columns, 3 three, 4 two by two; 5 and more flow. On a phone always one column, cards vertical. */
.product-grid[data-count="1"] { grid-template-columns: 1fr; }
.product-grid[data-count="2"], .product-grid[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-grid[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-grid[data-count="1"] .product-card { justify-content: center; gap: var(--space-10); padding: var(--space-32); min-height: clamp(240px, 26vw, 380px); }
.product-grid[data-count="1"] .product-card:has(.cover) { position: relative; padding-left: calc(50% + 32px); }
.product-grid[data-count="1"] .product-card .cover { position: absolute; inset: 0 50% 0 0; margin: 0; aspect-ratio: auto;
                                                     border-bottom: 0; border-right: 1px solid var(--border); }
.product-grid[data-count="1"] .product-card h3 { font-size: var(--head-32); line-height: 1.15; }
.product-grid[data-count="1"] .product-card p { font-size: var(--text-16); }
.product-grid[data-count="1"] .product-card .meta { margin-top: var(--space-8); }
@media (max-width: 900px) { .product-grid[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .product-grid[data-count] { grid-template-columns: 1fr; }
  .product-grid[data-count="1"] .product-card:has(.cover) { position: relative; padding: var(--space-20); min-height: 0; }
  .product-grid[data-count="1"] .product-card .cover { position: relative; inset: auto; aspect-ratio: 16 / 9; margin: -20px -20px var(--space-8);
                                                       border-right: 0; border-bottom: 1px solid var(--border); }
  .product-grid[data-count="1"] .product-card h3 { font-size: var(--head-24); }
}
.product-card { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-20); text-decoration: none; color: inherit; overflow: hidden;
                border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); transition: border-color .15s ease-out; }
.product-card:hover { border-color: var(--muted-foreground); }
.product-card .cover { aspect-ratio: 16 / 9; margin: -20px -20px var(--space-8); background: var(--muted) center / cover no-repeat;
                       border-bottom: 1px solid var(--border); filter: grayscale(.35); }
/* Price: the current price, optionally a struck-through one before it and a note after it. */
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-10); margin-top: 4px; color: var(--primary); }
.price-now { font: 400 var(--head-24)/1.2 var(--font-subtitle); }
.price-was { font-size: var(--text-16); color: var(--muted-foreground); text-decoration: line-through; }
.price-note { font-size: var(--text-14); color: var(--muted-foreground); }
.product-card h3 { font: 400 var(--text-22)/1.25 var(--font-subtitle); margin: 0; color: var(--primary); }
.product-card p { margin: 0; font-size: var(--text-14); line-height: 1.55; color: var(--muted-foreground); }
/* The description on a card (0.46.1): cut off with an ellipsis, three lines, more where the card is wider. */
.product-card .card-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.product-grid[data-count="2"] .card-description { -webkit-line-clamp: 4; line-clamp: 4; }
.product-grid[data-count="1"] .card-description { -webkit-line-clamp: 6; line-clamp: 6; }
.product-card .meta { display: flex; gap: var(--space-8); flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: var(--space-8); font-size: var(--text-13); color: var(--muted-foreground); }
/* Continue (0.27): a card with its own button. The card is a div; the title link stretches over the whole card, the
   Continue button sits above it. Markup: div.product-card > ... h3 > a.card-link ... + .meta + a.btn.card-continue */
div.product-card { position: relative; }
.product-card .card-link { color: inherit; text-decoration: none; }
.product-card .card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.product-card .card-link:focus-visible { outline: none; }
.product-card:has(.card-link:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
div.product-card:has(.card-link:hover) { border-color: var(--muted-foreground); }
.product-card .card-continue { position: relative; z-index: 1; align-self: flex-start; margin-top: 4px; }
/* Continue in the product header: a brand button and the lesson it opens, both on the right edge (0.56).
   Markup: .stats > .continue > a.btn + small */
.product-header .continue { display: grid; gap: 6px; justify-items: end; justify-self: end; text-align: right; }
.product-header .continue small { font-size: var(--text-12); color: inherit; opacity: .85; }
/* A video with a saved position (0.32): an overlay on the player blurs the thumbnail and replaces its play button.
   Markup: .video > iframe + div.video-resume > button.video-resume-play (svg + span "Continue at 12:34") + button.link */
.video { position: relative; }
.video-resume { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--space-14);
  background: color-mix(in oklab, var(--image-scrim) 45%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: var(--on-image); transition: opacity .2s ease-out; }
.video-resume[data-leaving] { opacity: 0; pointer-events: none; }
.video-resume-play { display: inline-flex; align-items: center; gap: var(--space-12); padding: var(--space-10) var(--space-22) var(--space-10) var(--space-12); border: 0; border-radius: 999px;
  background: var(--on-image); color: var(--image-scrim); font: inherit; font-size: var(--text-15); font-weight: 500; line-height: 1; cursor: pointer; box-shadow: 0 8px 30px rgb(0 0 0 / calc(.25 * var(--shadow)));
  transition: transform .15s ease-out; }
.video-resume-play:hover { transform: scale(1.03); }
.video-resume-play svg { width: 36px; height: 36px; padding: var(--space-10); border-radius: 50%; background: var(--brand); color: var(--on-image); }
.video-resume .link { padding: 0; border: 0; background: none; font: 400 var(--text-13)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: color-mix(in oklab, currentColor 50%, transparent); text-underline-offset: 3px; }
.video-resume .link:hover { text-decoration-color: currentColor; }
.progress { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); }

/* ---- Product page ---- */
.product-header { padding-bottom: var(--space-32); margin-bottom: var(--space-40); border-bottom: 1px solid var(--border);
                  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-32); align-items: end; }
.product-header .display { margin: var(--space-10) 0 0; }
.product-header .lead { margin-top: var(--space-16); }
/* The description inside the header (0.46): p.product-intro after the lead, on a cover too. */
.product-header .product-intro { margin: var(--space-12) 0 0; font-size: var(--text-15); line-height: 1.55; color: var(--muted-foreground); }
.product-header .stats { min-width: 220px; display: grid; gap: var(--space-8); font-size: var(--text-13); color: var(--muted-foreground); }
.product-header .cover { grid-column: 1 / -1; aspect-ratio: 21 / 7; border-radius: var(--radius); border: 1px solid var(--border);
                         background: var(--muted) center / cover no-repeat; order: -1; filter: grayscale(.35); }
.terms { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--space-16); }
@media (max-width: 900px) { .product-header { grid-template-columns: 1fr; } }
/* Cover header (0.25): the texts, terms and progress sit on the cover, bottom-aligned, to save height.
   Markup: header.product-header[data-cover][data-tone] > .cover (img) + div (texts) + .stats.
   data-tone is the measured brightness of the lower part of the image (the app measures it at upload):
   dark (default) = light text on a dark scrim, light = dark text on a light scrim. The scrim keeps the text
   readable when the image is mixed. Without a cover the header stays as above. */
.product-header[data-cover] { position: relative; isolation: isolate; overflow: hidden; min-height: max(300px, calc((min(100vw, 1200px) - 64px) / 3));
  padding: var(--space-32); border: 1px solid var(--border); border-radius: var(--radius); color: var(--on-image); --scrim: var(--image-scrim); --scrim-mid: 62%; }
.product-header[data-cover][data-tone="light"] { color: var(--foreground); --scrim: var(--background); --scrim-mid: 84%; }
.product-header[data-cover] > .cover { position: absolute; inset: 0; z-index: -2; grid-area: auto; aspect-ratio: auto; border: 0; border-radius: 0; }
.product-header[data-cover]::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--scrim) 90%, transparent) 0%, color-mix(in srgb, var(--scrim) var(--scrim-mid), transparent) 45%, transparent 90%); }
.product-header[data-cover] .display { color: inherit; }
.product-header[data-cover] .eyebrow, .product-header[data-cover] .eyebrow.brand { color: color-mix(in srgb, currentColor 74%, transparent); }
.product-header[data-cover] .lead, .product-header[data-cover] .product-intro, .product-header[data-cover] .stats { color: color-mix(in srgb, currentColor 84%, transparent); }
.product-header[data-cover] .badge[data-variant="outline"] { color: inherit; border-color: color-mix(in srgb, currentColor 40%, transparent); }
.product-header[data-cover] .progress { background: color-mix(in srgb, currentColor 28%, transparent); }
.product-header[data-cover] .progress > span { background: currentColor; }
@media (max-width: 900px) { .product-header[data-cover] { grid-template-columns: minmax(0, 1fr); gap: var(--space-20); min-height: 360px; padding: var(--space-24); } }
.module { margin-bottom: var(--space-40); }
.module-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-16); padding-bottom: var(--space-10); }
.module-head h2 { font: 400 var(--head-24)/1.25 var(--font-subtitle); margin: 4px 0 0; color: var(--primary); }
.module-head p { margin: 6px 0 0; font-size: var(--text-14); color: var(--muted-foreground); }
/* A module title that links to its lessons or its lesson index (0.47). */
.module-head h2 a, .index-module h2 a { color: inherit; text-decoration: none; }
.module-head h2 a:hover, .index-module h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.unit-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.unit-list li { border-bottom: 1px solid var(--border); }
.unit-list a, .unit-list .locked { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-12); align-items: center;
                                   padding: var(--space-12) 4px; text-decoration: none; color: inherit; font-size: var(--text-15); }
.unit-list a:hover { background: var(--accent); }
.unit-list .locked { color: var(--muted-foreground); }
.unit-list .device { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-12); align-items: center; padding: var(--space-12) 4px; font-size: var(--text-15); }
.unit-list .check { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; box-sizing: border-box; }
.unit-list .check[data-done] { background: var(--brand); border-color: var(--brand); color: var(--brand-foreground); }
.unit-list .check svg { width: 12px; height: 12px; }
.unit-list .info { font-size: var(--text-13); color: var(--muted-foreground); }
/* In a module card (narrow) the info (length, opening date) goes under the title, so a long title keeps its width (0.50). */
.module-card .unit-list a, .module-card .unit-list .locked { grid-template-columns: 28px minmax(0, 1fr); row-gap: 2px; }
.module-card .unit-list .info { grid-column: 2; }
.module-card .unit-list .info:empty { display: none; }

/* Module layouts (0.34): .modules[data-layout] wraps the module index of a product page.
   list (default): .module sections as above. compact: the same markup, tighter, without module texts and with small
   headings. cards: .module-cards > a.module-card or div.module-card[data-locked] (cover, eyebrow, h3, p, .meta, .progress);
   the card opens the next lesson of the module. timeline: .module-timeline > .timeline-item (.timeline-date + .timeline-body
   with the module head and a compact unit list); items alternate left and right of the line, one side on a phone.
   The eyebrow "Module 01" is optional in every layout. */
.modules[data-layout="compact"] .module { margin-bottom: var(--space-24); }
.modules[data-layout="compact"] .module-head { padding-bottom: 6px; }
.modules[data-layout="compact"] .module-head h2 { font-size: var(--text-18); }
.modules[data-layout="compact"] .module-head p { display: none; }
.modules[data-layout="compact"] .unit-list a, .modules[data-layout="compact"] .unit-list .locked { padding: 7px 4px; font-size: var(--text-14); grid-template-columns: 22px minmax(0, 1fr) auto; }
.modules[data-layout="compact"] .unit-list .check { width: 14px; height: 14px; }
.modules[data-layout="compact"] .unit-list .check svg { width: 9px; height: 9px; }
.module-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-16); margin-bottom: var(--space-40); }
.module-card { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-20); text-decoration: none; color: inherit; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); transition: border-color .15s ease-out; }
a.module-card:hover { border-color: var(--muted-foreground); }
.module-card .cover { aspect-ratio: 16 / 9; margin: -20px -20px var(--space-8); background: var(--muted); border-bottom: 1px solid var(--border); overflow: hidden; filter: grayscale(.35); }
.module-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.module-card h3 { font: 400 var(--text-22)/1.25 var(--font-subtitle); margin: 0; color: var(--primary); }
.module-card p { margin: 0; font-size: var(--text-14); line-height: 1.55; color: var(--muted-foreground); }
.module-card .meta { display: flex; gap: var(--space-8); flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: var(--space-8); font-size: var(--text-13); color: var(--muted-foreground); }
.module-card[data-locked] { color: var(--muted-foreground); background: var(--muted); }
.module-card[data-locked] h3 { color: var(--muted-foreground); }
.module-timeline { position: relative; display: grid; gap: var(--space-32); margin: var(--space-8) 0 var(--space-48); }
.module-timeline::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 50%; width: 1px; background: var(--border); }
.timeline-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-56); }
.timeline-item::before { content: ""; position: absolute; top: 6px; left: calc(50% - 6px); width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid var(--brand); background: var(--background); box-sizing: border-box; }
.timeline-item[data-open]::before { background: var(--brand); }
.timeline-date { justify-self: end; text-align: right; font: 400 var(--text-13)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); padding-top: 2px; }
.timeline-date strong { display: block; font: 400 var(--text-22)/1.2 var(--font-subtitle); color: var(--primary); }
.timeline-item:nth-child(even) .timeline-date { order: 2; justify-self: start; text-align: left; }
.timeline-body .module-head { padding-bottom: var(--space-8); }
.timeline-body .module-head h2 { margin-top: 0; }
.timeline-body .unit-list a, .timeline-body .unit-list .locked { padding: 7px 4px; font-size: var(--text-14); grid-template-columns: 22px minmax(0, 1fr) auto; }
.timeline-body .unit-list .check { width: 14px; height: 14px; }
.timeline-body .unit-list .check svg { width: 9px; height: 9px; }
/* Milestones (0.40): the timeline as a release history. .module-timeline[data-milestones] > .timeline-item#<anchor>
   (.timeline-date with strong date and area, .timeline-body with .title-row > h2 + the icon button
   button.btn[data-variant=ghost][data-size=icon][data-copy-text] (svg.icon-copy + svg.icon-done), then p).
   The item in the URL hash gets a ring on its dot. */
.module-timeline[data-milestones] .timeline-item { scroll-margin-top: 96px; }
.module-timeline[data-milestones] .timeline-body h2 { margin: 4px 0 var(--space-8); font: 400 var(--head-26)/1.25 var(--font-subtitle); color: var(--primary); }
.module-timeline[data-milestones] .timeline-body p { margin: 0 0 var(--space-12); font-size: var(--text-15); line-height: 1.6; }
.module-timeline[data-milestones] .timeline-body .row { gap: var(--space-8); }
/* A page title with icon actions on the right (0.40.2): .greeting > .title-row > h1 + .row of
   a.btn[data-variant=ghost][data-size=icon] with aria-label and title. */
.greeting > .title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); margin-top: var(--space-8); }
.greeting > .title-row .display { margin-top: 0; }
.greeting > .title-row .row { flex: none; gap: 4px; }
.greeting > .title-row .btn { color: var(--muted-foreground); }
.greeting > .title-row .btn:hover { color: var(--foreground); }
/* Click-to-edit title (0.51): .greeting > .title-row > form.inline-title[data-inline-save] > input.display.display-lg
   + .inline-status. The input reads as the heading; hover and focus show its edge. inline-save.js saves on leave
   (change) or Enter. A main action of the page (Publish: .btn[data-variant=brand]; Unpublish:
   .btn[data-variant=secondary]) sits in the .row with the icon buttons and keeps its own colours. */
.greeting > .title-row .inline-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-12); }
.inline-title > input.display { flex: 1; min-width: 0; width: 100%; padding: 2px var(--space-8); margin: 0 0 0 -8px; border: 1px solid transparent;
  border-radius: var(--radius); background: none; color: inherit; font: inherit; font-family: var(--font-display);
  font-size: calc(clamp(36px, 4.5vw, 48px) * var(--text-scale) * var(--heading-scale)); line-height: 1.08; cursor: text; }
.inline-title > input.display:hover { border-color: var(--border); }
.inline-title > input.display:focus { border-color: var(--ring, var(--brand)); outline: none; background: var(--background); }
.greeting > .title-row .row .btn[data-variant="brand"] { color: var(--brand-foreground, #fff); }
.greeting > .title-row .row .btn[data-variant="secondary"] { color: var(--secondary-foreground, var(--foreground)); }
.module-timeline[data-milestones] .title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-8); }
.module-timeline[data-milestones] .title-row .btn { flex: none; margin-top: 2px; color: var(--muted-foreground); }
.module-timeline[data-milestones] .title-row .btn:hover { color: var(--foreground); }
button[data-copy-text] .icon-done, button[data-copy-text][data-done] .icon-copy,
button[data-copy-url] .icon-done, button[data-copy-url][data-done] .icon-copy { display: none; }
button[data-copy-text][data-done] .icon-done, button[data-copy-url][data-done] .icon-done { display: inline; }
.module-timeline[data-milestones] .timeline-item:target::before { background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); }
@media (max-width: 760px) {
  .module-timeline::before { left: 5px; }
  .timeline-item, .timeline-item:nth-child(even) { grid-template-columns: minmax(0, 1fr); padding-left: var(--space-28); row-gap: 6px; }
  .timeline-item::before { left: 0; }
  .timeline-date, .timeline-item:nth-child(even) .timeline-date { order: 0; justify-self: start; text-align: left; }
}

/* Welcome block (0.34): shown at the top of a product page. .product-welcome[data-columns="1|2"] > .video (optional) +
   .prose. Two columns put the video left and the text right; one column stacks them. A phone always stacks. */
.product-welcome { display: grid; gap: var(--space-24); margin-bottom: var(--space-48); }
.product-welcome[data-columns="2"] { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: var(--space-32); }
/* data-split (0.49.4): the widths of video and text side by side; 1-2 = video 1/3, 1-1 = halves, 2-1 = video 2/3. */
.product-welcome[data-columns="2"][data-split="1-2"] { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.product-welcome[data-columns="2"][data-split="1-1"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.product-welcome[data-columns="2"][data-split="2-1"] { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.product-welcome .prose > :first-child { margin-top: 0; }
@media (max-width: 900px) { .product-welcome[data-columns="2"], .product-welcome[data-columns="2"][data-split] { grid-template-columns: minmax(0, 1fr); } }

/* Links (0.34): entry points on a product page: a module, a lesson, another product, an external page.
   .link-section > .block-head + .links[data-style="list|buttons|cards"] > a.link-item (span.link-title,
   small.link-text; a download adds svg.file-icon and small.link-meta, see below). list: rows with an arrow; buttons: a row of outline buttons (the first may be
   brand); cards: a grid of small cards. An external link carries target="_blank" and data-external (the arrow turns). */
.link-section { margin-bottom: var(--space-48); }
/* Link search (0.58): form.link-search[data-live-search] above .link-results (resources). The search field takes the
   room, the category select its own width, on one line; on a phone the select goes below. .link-results > .note
   (the hit count, the empty state, the affiliate note) keeps a gap to the list. */
.link-search { display: flex; gap: var(--space-12); align-items: center; margin-bottom: var(--space-24); }
.link-search .input { flex: 1 1 auto; min-width: 0; width: auto; }
.link-search .select { flex: 0 1 auto; width: auto; max-width: 50%; }
@media (max-width: 560px) { .link-search { flex-wrap: wrap; } .link-search .select { flex: 1 1 100%; max-width: none; } }
.link-results > .note { margin: 0 0 var(--space-24); }
.links[data-style="list"] { display: grid; border-top: 1px solid var(--border); }
/* 0.58.1: 16px at the sides, so the text and the arrow keep room inside the hover background. */
.links[data-style="list"] .link-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-16); align-items: center; padding: var(--space-14) var(--space-16);
  border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.links[data-style="list"] .link-item:hover { background: var(--accent); }
.links[data-style="list"] .link-item::after { content: "→"; grid-column: 2; grid-row: 1 / span 2; color: var(--muted-foreground); }
.links[data-style="list"] .link-item[data-external]::after { content: "↗"; }
.link-title { font-size: var(--text-15); color: var(--primary); }
.link-text { font-size: var(--text-13); color: var(--muted-foreground); }
/* Search hits (0.72.0): the words that matched, in a result title or text (mark inside .link-item, or mark.hit
   anywhere): the soft brand colour behind the text, no colour change of the letters. */
.link-item mark, mark.hit { background: var(--brand-soft); color: inherit; border-radius: 2px; padding: 0 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.links[data-style="buttons"] { display: flex; flex-wrap: wrap; gap: var(--space-10); }
.links[data-style="buttons"] .link-text { display: none; }
.links[data-style="buttons"] .link-title { font-size: inherit; color: inherit; }
.links[data-style="cards"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-12); }
/* Cards with a fixed column count (0.58): data-columns="2|3|4"; without it the grid fills by width. Below 900px at
   most two, below 560px one. */
.links[data-style="cards"][data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.links[data-style="cards"][data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.links[data-style="cards"][data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .links[data-style="cards"]:is([data-columns="3"], [data-columns="4"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .links[data-style="cards"][data-columns] { grid-template-columns: minmax(0, 1fr); } }
.links[data-style="cards"] .link-item { display: grid; gap: 4px; align-content: start; padding: var(--space-16) var(--space-18); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); text-decoration: none; color: inherit; transition: border-color .15s ease-out; }
.links[data-style="cards"] .link-item:hover { border-color: var(--muted-foreground); }
.links[data-style="cards"] .link-title { font: 400 var(--text-19)/1.3 var(--font-subtitle); }
.links[data-style="cards"] .link-item[data-external] .link-title::after { content: " ↗"; font-size: var(--text-14); color: var(--muted-foreground); }
/* Download links (0.54): a.link-item[data-download] starts with svg.file-icon (the type of the file) and ends with
   small.link-meta ("PDF · 2.4 MB"). list: the icon left of title and text, the arrow points down; buttons: icon and
   title only; cards: the icon above the title, the meta line at the bottom. Without the icon (a switch of the section)
   a download link lines up with the other links and keeps its meta line and down arrow (0.55). */
.link-item[data-download] .file-icon { color: var(--primary); }
.links[data-style="list"] .link-item[data-download] { grid-template-columns: auto minmax(0, 1fr) auto; }
.links[data-style="list"] .link-item[data-download] .file-icon { grid-row: 1 / span 3; width: 22px; height: 22px; }
.links[data-style="list"] .link-item[data-download] > :not(.file-icon) { grid-column: 2; }
.links[data-style="list"] .link-item[data-download]::after { content: "↓"; grid-column: 3; grid-row: 1 / span 3; }
.links[data-style="list"] .link-item[data-download]:not(:has(> .file-icon)) { grid-template-columns: minmax(0, 1fr) auto; }
.links[data-style="list"] .link-item[data-download]:not(:has(> .file-icon)) > * { grid-column: 1; }
.links[data-style="list"] .link-item[data-download]:not(:has(> .file-icon))::after { grid-column: 2; }
.link-meta { font: 400 var(--text-13)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); white-space: nowrap; }
.links[data-style="buttons"] .link-item[data-download] { gap: var(--space-8); }
.links[data-style="buttons"] .link-item[data-download] .file-icon { color: inherit; }
.links[data-style="buttons"] .link-meta { display: none; }
.links[data-style="cards"] .link-item[data-download] .file-icon { width: 28px; height: 28px; stroke-width: 1.25; margin-bottom: 6px; }
.links[data-style="cards"] .link-item[data-download] .link-meta { margin-top: 6px; }

/* Audio player (0.34, dist/audio-player.js): an MP3 or M4A in a lesson or page. Markup: figure.audio-player > audio[controls]
   [src] + .audio-ui (button.audio-play, .audio-body > strong.audio-title + input.audio-seek[type=range] + .audio-meta >
   span.audio-time + button.audio-rate) + a.audio-download[download] (optional). Without the script the native player shows;
   the script hides it and turns the UI on (data-ready). data-playing switches the play icon. */
.audio-player { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-12); margin: var(--space-24) 0; padding: var(--space-14) var(--space-16);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.audio-player audio { width: 100%; }
.audio-player[data-ready] audio { display: none; }
.audio-ui { display: none; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-14); }
.audio-player[data-ready] .audio-ui { display: grid; }
.audio-play { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--brand); color: var(--brand-foreground); transition: transform .15s ease-out; }
.audio-play:hover { transform: scale(1.05); }
.audio-play:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.audio-play svg { width: 18px; height: 18px; }
.audio-play .icon-pause, .audio-player[data-playing] .audio-play .icon-play { display: none; }
.audio-player[data-playing] .audio-play .icon-pause { display: block; }
.audio-body { display: grid; gap: 4px; min-width: 0; }
.audio-title { font: 400 var(--text-17)/1.3 var(--font-subtitle); color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-seek { width: 100%; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.audio-meta { display: flex; justify-content: space-between; gap: var(--space-12); font: 400 var(--text-12)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.audio-rate { padding: 0 4px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.audio-rate:hover { color: var(--foreground); background: var(--accent); }
.audio-download { align-self: center; }
@media (max-width: 520px) { .audio-player { grid-template-columns: minmax(0, 1fr); } .audio-download { justify-self: start; } }
@media print { .audio-player { display: none; } }
/* Audio lesson (0.67): the main medium of a lesson as audio. figure.audio-player[data-lesson] gets a cover
   (img.audio-cover, square), skip buttons (button.audio-skip[data-skip="-15|30"] in .audio-controls), the playing chapter
   (span.audio-chapter, filled by the script from data-chapters) and marks of the chapters over the seek range
   (.audio-track > .audio-marks, made by the script). p.audio-resume says where it goes on, with "Start over". While it
   plays out of view, .audio-mini (made by the script) sticks to the bottom: play, title, time; a click on the title
   scrolls back. Speed 0.8× to 2×, kept in the browser; the lock screen, headphones and car get title, cover and the
   controls (Media Session). */
.audio-player[data-lesson] { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-18); margin: 0; padding: var(--space-18); }
.audio-player[data-lesson] audio { grid-column: 1 / -1; }
.audio-player[data-lesson][data-ready] audio { display: none; }
.audio-cover { width: 128px; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--radius) - 2px); background: var(--muted); display: block; }
.audio-player[data-lesson] .audio-ui { gap: var(--space-16); }
.audio-player[data-lesson] .audio-play { width: 52px; height: 52px; }
.audio-player[data-lesson] .audio-title { font-size: var(--text-19); }
.audio-chapter { font: 400 var(--text-13)/1.4 var(--font-sans); color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.4em; }
.audio-track { position: relative; }
.audio-marks { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.audio-marks > li { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--background); opacity: .9; }
.audio-controls { display: inline-flex; align-items: center; gap: 2px; }
.audio-skip { min-width: 34px; padding: 0 4px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.audio-skip:hover { color: var(--foreground); background: var(--accent); }
.audio-skip:focus-visible, .audio-rate:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.audio-player[data-lesson] .audio-download { grid-column: 2; justify-self: start; }
.audio-player[data-lesson]:not(:has(> .audio-cover)) { grid-template-columns: minmax(0, 1fr); }
.audio-player[data-lesson]:not(:has(> .audio-cover)) .audio-download { grid-column: 1; }
/* 0.81.0: a tidier audio lesson. The cover stays left; next to it a small label (strong.audio-title, the artist), the
   playing chapter as the line in the serif, then the play button beside the seek bar and the meta row, which it spans.
   The download is a quiet item of the meta row (.audio-controls > a.audio-download: icon and type), not a row of its
   own. The chapter marks are as high as the bar. Markup as 0.67; .audio-body lays out with the play button. */
.audio-player[data-lesson] { align-items: center; }
.audio-player[data-lesson] .audio-ui { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "title title" "chapter chapter" "play seek" "play meta";
  column-gap: var(--space-14); row-gap: 2px; align-items: center; }
.audio-player[data-lesson] .audio-body { display: contents; }
.audio-player[data-lesson] .audio-play { grid-area: play; width: 44px; height: 44px; }
.audio-player[data-lesson] .audio-title { grid-area: title; font: 500 var(--text-13)/1.4 var(--font-sans);
  color: var(--muted-foreground); }
.audio-player[data-lesson] .audio-chapter { grid-area: chapter; margin-bottom: var(--space-8); font: 500 var(--text-16)/1.35 var(--font-sans); color: var(--foreground); min-height: 0; }
.audio-player[data-lesson] .audio-chapter:empty { display: none; }
.audio-player[data-lesson] .audio-title:has(+ .audio-chapter:empty) { margin-bottom: var(--space-8); }
.audio-player[data-lesson] .audio-seek, .audio-player[data-lesson] .audio-track { grid-area: seek; }
.audio-player[data-lesson] .audio-meta { grid-area: meta; align-items: center; }
.audio-marks > li { top: 50%; bottom: auto; height: 6px; transform: translateY(-50%); }
.audio-controls .audio-download { display: inline-flex; align-items: center; gap: 4px; min-width: 34px; padding: 0 4px; border-radius: 4px; color: inherit;
  text-decoration: none; }
.audio-controls .audio-download svg { width: 12px; height: 12px; }
.audio-controls .audio-download:hover { color: var(--foreground); background: var(--accent); }
.audio-controls .audio-download:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.audio-resume { margin: var(--space-8) 0 0; font: 400 var(--text-13)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.audio-resume .link { padding: 0; border: 0; background: none; font: inherit; color: var(--foreground); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.audio-resume .link:hover { text-decoration-color: currentColor; }
.audio-mini { position: fixed; left: 50%; bottom: 16px; z-index: 30; width: min(560px, calc(100vw - 24px)); transform: translateX(-50%);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-12); padding: var(--space-8) var(--space-14) var(--space-8) var(--space-8);
  border: 1px solid var(--border); border-radius: 999px; background: var(--card); box-shadow: 0 8px 24px rgb(0 0 0 / calc(.12 * var(--shadow))); }
.audio-mini[hidden] { display: none; }
.audio-mini .audio-play { width: 36px; height: 36px; }
.audio-mini .audio-play svg { width: 14px; height: 14px; }
.audio-mini .audio-play .icon-pause, .audio-mini[data-playing] .audio-play .icon-play { display: none; }
.audio-mini[data-playing] .audio-play .icon-pause { display: block; }
.audio-mini-title { padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font: 400 var(--text-15)/1.3 var(--font-subtitle); color: var(--primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-mini-time { font: 400 var(--text-12)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
@media (max-width: 520px) {
  .audio-player[data-lesson] { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-12); padding: var(--space-14); }
  .audio-cover { width: 72px; }
  .audio-player[data-lesson] .audio-play { width: 44px; height: 44px; }
}
@media (max-width: 400px) {
  .audio-player[data-lesson] { grid-template-columns: minmax(0, 1fr); }
  .audio-cover { display: none; }
  .audio-player[data-lesson] .audio-download { grid-column: 1; }
}
@media print { .audio-mini { display: none; } }

/* ---- Unit page ---- */
.unit-page { max-width: 820px; }
.unit-page .display { margin: var(--space-10) 0 var(--space-24); }
.video { aspect-ratio: 16 / 9; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--muted); }
.video iframe { width: 100%; height: 100%; border: 0; }
.unit-page .lead { margin-top: var(--space-32); }
.unit-body { margin-top: var(--space-32); }
.unit-actions { margin-top: var(--space-32); }
.unit-nav { display: flex; justify-content: space-between; gap: var(--space-16); margin-top: var(--space-48); padding-top: var(--space-24); border-top: 1px solid var(--border); }
/* A long lesson title in the pager stays on one line and ends in an ellipsis, so it never widens the page (0.57.24).
   Markup: a.btn > span (the title). */
.unit-nav .btn { min-width: 0; max-width: 100%; }
.unit-nav .btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Q&A under a unit (0.20): threads of a question and its replies, editorial and quiet.
   Markup: section.qa > .block-head + form.qa-form + .qa-thread* (+ a.btn "Older questions")
           .qa-thread[id=q-<id>][data-new][data-hidden] > .qa-post (the question) + .qa-replies > .qa-post* + form.qa-form
           .qa-post[data-hidden][data-deleted] > .avatar + div > .qa-meta (strong name, .badge, time) + .qa-body (+ .qa-actions)
   .qa-new marks a thread with unread posts; .nav-count is a small count after a sidebar link. ---- */
/* My notes (0.26): a private note under the lesson. details.notes-card[open when a note exists] > summary (title + hint)
   + form.notes-form (textarea.textarea.notes-input + .notes-foot: .notes-status aria-live; the script removes the Save button, kept for use without
   JavaScript) + .notes-print (the saved text as plain lines; shown only in print, where a textarea would be cut). */
.notes-card { margin-top: var(--space-40); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.notes-card > summary { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); padding: var(--space-14) var(--space-18); cursor: pointer;
  list-style: none; font: 500 var(--text-15)/1.3 var(--font-sans); color: var(--foreground); }
.notes-card > summary::-webkit-details-marker { display: none; }
.notes-card > summary::after { content: "+"; font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-size: var(--text-16); color: var(--muted-foreground); }
.notes-card[open] > summary::after { content: "−"; }
.notes-card > summary small { margin-left: auto; font: 400 var(--text-12)/1.4 var(--font-sans); color: var(--muted-foreground); }
.notes-card .notes-body { padding: 0 var(--space-18) var(--space-16); }
.notes-input { width: 100%; min-height: 160px; resize: vertical; font: 400 var(--text-17)/1.6 var(--font-subtitle); }
.notes-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); margin-top: var(--space-10); }
.notes-status { font: 400 var(--text-12)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.notes-status[data-state="error"] { color: var(--destructive); }
.notes-print { display: none; }
/* The notes overview and the [notes] list in a lesson: product > module > note. */
.notes-list { display: grid; gap: 0; }
.notes-list > h2 { margin: var(--space-32) 0 4px; }
.notes-list > .eyebrow { display: block; margin: var(--space-20) 0 6px; }
.note-item { padding: var(--space-16) 0; border-top: 1px solid var(--border); break-inside: avoid; }
.note-item h3 { margin: 0; font: 400 var(--text-17)/1.3 var(--font-subtitle); color: var(--primary); }
.note-item h3 a { color: inherit; }
.note-item time { font: 400 var(--text-12)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.note-item p { margin: var(--space-8) 0 0; white-space: pre-line; font: 400 var(--text-17)/1.6 var(--font-subtitle); }
.qa { margin-top: var(--space-64); padding-top: var(--space-32); border-top: 1px solid var(--primary); }
.qa .block-head { margin-top: 0; }
.qa-thread { padding: var(--space-24) 0; border-top: 1px solid var(--border); scroll-margin-top: 96px; }
/* 0.60.0: in the questions stream a thread starts with p.qa-context: where it was asked (program · lesson, a link to the
   lesson, or "General question"). The stream page uses .link-search for search, program and filter in one row. */
.qa-context { margin: 0 0 var(--space-10); font: 500 var(--text-13)/1.4 var(--font-sans); color: var(--muted-foreground); }
.qa-context a { color: inherit; text-decoration: none; }
.qa-context a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
.qa-thread:first-of-type { border-top: 0; }
.qa-post { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-14); align-items: start; }
.qa-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); font-size: var(--text-13); line-height: 28px; color: var(--muted-foreground); }
.qa-meta strong { color: var(--foreground); font-weight: 500; }
.qa-body { margin-top: 2px; font-size: var(--text-16); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
/* 0.61.0: one family in a thread: the question is sans 17 px, a little heavier than the replies */
.qa-thread > .qa-post .qa-body { font-size: var(--text-17); font-weight: 500; }
.qa-actions { margin-top: 6px; display: flex; gap: var(--space-12); font-size: var(--text-13); }
.qa-actions button, .qa-actions a { padding: 0; border: 0; background: none; color: var(--muted-foreground); font: inherit; cursor: pointer; text-decoration: none; }
.qa-actions button:hover, .qa-actions a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
/* 0.61.0: a badge in a post (Team, Mentor, group, Hidden) is a quiet sans tag, not the label-font pill */
.qa-meta .badge { padding: 2px var(--space-8); border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted-foreground);
                  font: 500 var(--text-12)/18px var(--font-sans); letter-spacing: 0; text-transform: none; text-box: none; }
.qa-meta .badge[data-variant="primary"] { border-color: transparent; background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--primary); }
/* 0.61.0: the questions page (section.qa.qa-page) has no rule above it; the ask form and the search row keep apart */
.qa.qa-page { margin-top: 0; padding-top: 0; border-top: 0; }
.qa-form + .link-search, .qa-form + script + .link-search { margin-top: var(--space-40); }
.qa-replies { margin: var(--space-18) 0 0 var(--space-42); padding-left: var(--space-20); border-left: 1px solid var(--border); display: grid; gap: var(--space-18); }
.qa-replies .qa-form { margin-top: 0; }
.qa-post[data-deleted] .qa-body { font-style: italic; color: var(--muted-foreground); }
.qa-post[data-hidden], .qa-thread[data-hidden] > .qa-post { opacity: .55; }
.qa-form { margin-top: var(--space-20); display: grid; gap: var(--space-10); }
.qa-form .textarea { min-height: 96px; }
.qa-replies .qa-form .textarea { min-height: 64px; }
.qa-form .row { justify-content: space-between; }
.qa-new { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
             background: var(--brand); color: var(--brand-foreground); font-size: var(--text-11); font-weight: 600; line-height: 1; }
@media (max-width: 700px) { .qa-replies { margin-left: var(--space-14); padding-left: var(--space-14); } }

/* ---- Schedule: a list, not a month grid ---- */
.schedule-month { margin-bottom: var(--space-40); }
.schedule-month > .eyebrow { display: block; margin-bottom: var(--space-8); }
.schedule-item { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: var(--space-24); align-items: center;
                 padding: var(--space-16) 0; border-top: 1px solid var(--border); }
.schedule-item:last-child { border-bottom: 1px solid var(--border); }
.schedule-item h3 { margin: 0; font: 400 var(--text-19)/1.3 var(--font-subtitle); color: var(--primary); }
.schedule-item p { margin: 4px 0 0; font-size: var(--text-14); color: var(--muted-foreground); }
/* 0.57.8: one sans line for when (date, time, the New or Rescheduled word), the title in the serif, the kind as a word in
   the meta line p (no pill). Markup: .when > text + small (time, live signal) + span.date-flag. */
.schedule-item .when { font: 500 var(--text-14)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--foreground); }
.schedule-item .when small { display: block; color: var(--muted-foreground); font-size: var(--text-13); font-weight: 400; }
.schedule-item .when .date-flag { display: block; margin: 4px 0 0; vertical-align: baseline; }
/* Dates (0.26): a row with more information links its title to the date page; the room link shows only in its window.
   Markup: .schedule-item h3 > a; before the window .join-later ("Room from 13:45") instead of the Join button. */
.schedule-item h3 a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 4px; }
.schedule-item h3 a:hover { text-decoration-color: currentColor; }
/* 0.80.0: an admin sees a small edit icon at the end of a date (a.btn.item-edit, ghost, icon size). It shows while the
   pointer is over the row or the icon has keyboard focus; on touch screens it always shows. */
.schedule-item .item-edit { color: var(--muted-foreground); opacity: 0; transition: opacity .15s ease-out; }
.schedule-item:hover .item-edit, .schedule-item .item-edit:focus-visible { opacity: 1; }
.schedule-item .item-edit:hover { color: var(--foreground); }
@media (hover: none) { .schedule-item .item-edit { opacity: 1; } }
.join-later { font: 400 var(--text-12)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); white-space: nowrap; }
/* The date page: header like a lesson, a join panel with the state of the room, then the details.
   Markup: article.date-page > .eyebrow + h1.display + .date-when + .join-panel[data-state=open|later|over] + .prose */
.date-page { max-width: 820px; }
.date-page .display { margin: var(--space-10) 0 var(--space-12); }
.date-when { font: 400 var(--text-14)/1.5 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--foreground); }
.date-when span { color: var(--muted-foreground); }
.join-panel { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); flex-wrap: wrap; margin: var(--space-28) 0 var(--space-32);
  padding: var(--space-16) var(--space-20); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--text-14); color: var(--muted-foreground); }
.join-panel[data-state="open"] { border-color: var(--brand); background: var(--brand-soft); color: var(--foreground); }
.join-panel strong { display: block; font: 400 var(--text-17)/1.3 var(--font-subtitle); color: var(--primary); }
.date-page .prose + .row { margin-top: var(--space-28); }
/* Live now (0.26): no "Live" pill; while a date runs, a small broadcast signal sits next to its time.
   Markup: <span class="live-signal" role="img" aria-label="Live now"><svg ...two arcs + dot...></svg></span> in .when or .date-when.
   The arcs pulse gently; with reduced motion they stay still. */
.live-signal { display: inline-block; width: 16px; height: 16px; margin-left: 6px; vertical-align: -3px; color: var(--brand); }
.live-signal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.live-signal .wave { animation: live-wave 2.4s ease-in-out infinite; }
.live-signal .wave + .wave { animation-delay: .4s; }
@keyframes live-wave { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .live-signal .wave { animation: none; opacity: .8; } }
/* New and rescheduled dates (0.26): a small word in small caps before the title, no pill. It goes away by itself
   after some days (the app decides). Markup: <h3><span class="date-flag">New</span>Title</h3>;
   rescheduled: <span class="date-flag" data-flag="moved" title="Was Mon 2 Nov, 18:00">Rescheduled</span>. */
.date-flag { display: inline-block; margin-right: var(--space-10); font: 600 10.5px/1 var(--font-sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand); vertical-align: 3px; }
.date-flag[data-flag="moved"] { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--brand);
  text-underline-offset: 3px; }
/* Phone: one column; the date and time on one line, then the title, then the badge or button. */
@media (max-width: 700px) {
  .schedule-item { grid-template-columns: minmax(0, 1fr); gap: 6px; align-items: start; }
  .schedule-item .when { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-10); }
  .schedule-item .when small { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-13); }
  .schedule-item .when .date-flag { display: inline-block; margin: 0; }
  .schedule-item > .row:not(:empty) { margin-top: 4px; }
}
/* Compact date (0.47): .schedule-item[data-compact] for a narrow column. Date and action share the first line; the title
   takes the whole width and ends with an ellipsis after two lines, the note after one. The full text goes into title. */
.schedule-item[data-compact] { grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--space-12); align-items: center; }
.schedule-item[data-compact] .when { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-10); }
.schedule-item[data-compact] .when small { display: inline-flex; align-items: center; gap: 6px; }
.schedule-item[data-compact] .when .date-flag { display: inline-block; margin: 0; }
.schedule-item[data-compact] > .row { grid-column: 2; grid-row: 1; margin-top: 0; }
.schedule-item[data-compact] > .schedule-text { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
.schedule-item[data-compact] h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: var(--text-17); }
.schedule-item[data-compact] p { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---- Labels on badges: Latin Modern small caps, as in print (\badge{}) ---- */
.badge { font-family: var(--font-sans); font-weight: 500; font-size: var(--text-12); }
/* Optical centring of short labels (badges, keys, avatar): the line box of a serif holds its deep descender, so the
   letters sit low. text-box trims the box to the letters (labels and keys reach the cap height), and
   equal padding centres them. Browsers without text-box get a small lift instead. A badge is an inline-block with
   its own height: Basecoat's inline-flex and fixed 20 px height left text-box without effect (the letters sat low).
   One rule for every label in a box (0.41.3): a new pill, tab or chip joins this list,
   so each one centres the same way. */
.badge, .lang-switch a { line-height: 1; text-box: trim-both cap alphabetic; }
.badge { display: inline-block; height: auto; vertical-align: middle; padding-block: 6px; }
.lang-switch a { display: inline-block; padding-block: 6px; }
.lang-float a { padding-block: var(--space-8); }
.kbd { line-height: 1; padding-block: 5px; text-box: trim-both cap alphabetic; }
@supports not (text-box: trim-both cap alphabetic) {
  .badge, .lang-switch a { padding-block: 3px 5px; }
  .lang-float a { padding-block: 5px 7px; }
  .kbd { padding-block: 2px 4px; }
}

/* ---- Lesson content: the handout components on screen (same names as in the handout class in latex/) ---- */
.callout, .caution { border-radius: 0 var(--radius) var(--radius) 0; padding: var(--space-16) var(--space-20); font-size: var(--text-15); font-family: var(--font-sans); }
.callout { background: var(--brand-soft); border-left: 2px solid var(--brand); }
.callout .eyebrow { color: var(--brand); }
.caution { background: var(--warning-soft); border-left: 2px solid var(--warning); }
.caution .eyebrow { color: var(--warning); }
.callout p, .caution p { margin: 4px 0 0; }
/* A status box (0.90): a callout or caution with one sentence (p) and its action (form.row or .row) below. */
:is(.callout, .caution) > :is(form, .row) { margin-top: var(--space-12); }
:is(.callout, .caution) > p:first-child { margin-top: 0; }
:is(.callout, .caution) strong { font-weight: 600; }
.prompt { position: relative; background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-16) var(--space-20); }
.prompt pre { margin: var(--space-8) 0 0; white-space: pre-wrap; font: 400 var(--text-13)/1.7 var(--font-mono); color: var(--foreground); }
.prompt .btn { position: absolute; top: 10px; right: 10px; }
/* Prompt with a title row (0.69): .prompt-head holds .prompt-title and .prompt-actions (open links, copy, download);
   the buttons sit in the row instead of the corner. [data-scroll]: a long text scrolls inside the box. */
.prompt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-8) var(--space-12); }
.prompt-title { font: 600 var(--text-14)/1.4 var(--font-sans); color: var(--foreground); }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-head .btn { position: static; }
.prompt-head + pre { margin-top: var(--space-12); }
.prompt[data-scroll] pre { max-height: 320px; overflow: auto; }
/* Prompt without a title row (0.70): the copy button sits in the top right corner, on the first line of the text;
   the text keeps clear of it. Markup: .prompt > button[data-copy] + pre. */
.prompt > .btn + pre { margin-top: 0; padding-right: var(--space-72); }
.prompt:has(> .btn + pre) { padding: var(--space-12) var(--space-16); }
.prompt:has(> .btn + pre) > .btn { top: 7px; right: 8px; }
.pullquote { border-left: 1.5px solid var(--brand); padding: 4px 0 4px var(--space-24); margin: 0; max-width: 760px;
             font: italic 400 var(--head-28)/1.35 var(--font-subtitle); color: var(--primary); }
.pullquote cite { display: block; margin-top: var(--space-12); font-style: normal; }
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; align-items: baseline; padding: var(--space-14) 0; border-top: 1px solid var(--border); }
.steps li::before { content: counter(step) "."; font: 700 var(--text-16)/1.5 var(--font-serif); color: var(--brand); }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: var(--space-12); align-items: center; padding: 6px 0; font-size: var(--text-15); }
.checklist input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-14); font-family: var(--font-sans); }
.data-table th { text-align: left; padding: var(--space-10) var(--space-12) var(--space-10) 0; border-bottom: 1px solid var(--primary); }
.data-table td { padding: var(--space-12) var(--space-12) var(--space-12) 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose .callout, .prose .caution, .prose .prompt, .prose .steps, .prose .checklist, .prose .data-table, .prose .pullquote { margin: 1.5em 0; }
/* A button in text keeps the button face, not the serif of the text around it */
.prose .btn { font-family: var(--font-sans); font-style: normal; text-decoration: none; }

/* ---- Downloads (0.24): a file behind the app's proxy link (/download/<name>). Three templates for lesson text and
   pages, plus the list under a unit. The icon names the file type (dist/img/icons/files.svg: file, file-doc,
   file-image, file-archive, file-sheet, file-slides, file-audio, file-video, lock); it is a label, not decoration.
   The meta line is type and size in small caps, "PDF · 2.4 MB". Without access: data-locked, the lock icon and the
   reason instead of the download. ---- */
.file-icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.download-size { font: 400 var(--text-13)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); white-space: nowrap; }
.download-card { display: grid; grid-template-columns: 112px 1fr; gap: var(--space-20); align-items: start; margin: var(--space-24) 0; padding: var(--space-20);
                 border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); font-family: var(--font-sans); }
.download-media { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: calc(var(--radius) - 2px); background: var(--muted); color: var(--primary); }
.download-media img { width: 100%; height: 100%; object-fit: cover; }
.download-media .file-icon { width: 40px; height: 40px; stroke-width: 1.25; }
.download-card h3 { margin: 2px 0 6px; font: 400 var(--text-21)/1.3 var(--font-subtitle); color: var(--primary); }
.download-card p { margin: 0 0 var(--space-14); font-size: var(--text-15); line-height: 1.55; color: var(--muted-foreground); }
.download-card[data-locked] .download-media { color: var(--muted-foreground); }
.download-locked { display: inline-flex; align-items: center; gap: var(--space-8); font-size: var(--text-14); color: var(--muted-foreground); }
@media (max-width: 520px) { .download-card { grid-template-columns: 64px 1fr; gap: var(--space-14); padding: var(--space-16); } .download-media .file-icon { width: 28px; height: 28px; } }
.btn.download-button { gap: var(--space-8); }
.btn.download-button .download-size { font-size: var(--text-12); }
/* 0.62.0: the card in one row: .download-media (72 px) + div.download-body (h3, p, .download-size last) + the button or
   .download-locked on the right, centered. Under 640 px the button goes under the text. The lesson text (.prose) does
   not space the title and the text of a card. */
.download-card:has(> .download-body) { grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: var(--space-20); padding: var(--space-16) var(--space-20); }
.download-card .download-body h3, .prose .download-card .download-body h3 { margin: 0 0 4px; font: 400 var(--text-19)/1.3 var(--font-subtitle); color: var(--primary); }
.download-card .download-body p, .prose .download-card .download-body p { margin: 0 0 6px; font-size: var(--text-15); line-height: 1.5; color: var(--muted-foreground); }
.download-card .download-body .download-size { display: block; font-size: var(--text-12); }
.download-card:has(> .download-body) .file-icon { width: 30px; height: 30px; }
@media (max-width: 640px) {
  .download-card:has(> .download-body) { grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-14); padding: var(--space-14) var(--space-16); }
  .download-card > .download-button, .download-card > .download-locked { grid-column: 2; justify-self: start; }
}
.download-link { display: inline-flex; align-items: baseline; gap: 6px; color: var(--primary); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.download-link:hover { text-decoration-color: currentColor; }
.download-link .file-icon { align-self: center; width: 1.05em; height: 1.05em; }
.download-link[data-locked] { color: var(--muted-foreground); text-decoration: none; }
.download-list { list-style: none; margin: var(--space-32) 0 0; padding: 0; border-top: 1px solid var(--border); font-family: var(--font-sans); }
.download-list li > a, .download-list li > span { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-12); padding: var(--space-14) 4px;
                 border-bottom: 1px solid var(--border); color: var(--foreground); text-decoration: none; }
.download-list li > a:hover .download-title { text-decoration: underline; text-underline-offset: 3px; }
.download-list .file-icon { color: var(--primary); }
.download-list li > span { color: var(--muted-foreground); }
.download-list li > span .file-icon { color: inherit; }

/* Download menu (0.24): all downloads of a lesson or module in one dropdown, on the product page, so a member does
   not open each lesson. <details class="download-menu"> in .module-head or after the link of a .unit-list row; the
   summary is a small ghost button (archive icon and the count), the panel the .menu-panel of the user menu with one
   .menu-item per file. dist/menu.js closes it on an outside click and Escape. */
.download-menu { position: relative; flex: none; }
.download-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px var(--space-8); cursor: pointer; user-select: none;
                           border: 1px solid transparent; border-radius: calc(var(--radius) - 2px); font-size: var(--text-13); color: var(--muted-foreground); }
.download-menu > summary::-webkit-details-marker { display: none; }
.download-menu > summary:hover, .download-menu[open] > summary { border-color: var(--border); background: var(--card); color: var(--foreground); }
.download-menu .menu-panel { min-width: 340px; max-width: min(420px, calc(100vw - 32px)); }
.download-menu .menu-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-10); }
.download-menu .menu-item .file-icon { color: var(--primary); }
.download-menu .menu-item > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-list li:has(> .download-menu) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-8); }
.unit-list li > .download-menu { margin-right: 4px; }

/* ---- Window frame for product shots and page previews ---- */
.frame { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.frame-bar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--space-14); border-bottom: 1px solid var(--border); background: var(--muted); }
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.frame-bar span { margin-left: var(--space-12); font: 400 var(--text-12) var(--font-mono); color: var(--muted-foreground); }
.frame-body { background: var(--background); }

/* ---- Empty state ---- */
.empty { padding: var(--space-32); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted-foreground); font-size: var(--text-14); text-align: center; }

/* ---- Images: uploads as <img srcset> in covers, figures in lesson text ---- */
.cover { position: relative; overflow: hidden; }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.unit-body img { max-width: 100%; height: auto; }
.figure { margin: 1.5em 0; }
.figure img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.figure figcaption { margin-top: var(--space-8); font-size: var(--text-13); color: var(--muted-foreground); }

/* ---- Admin: the same app shell; toolbar, numbers, forms, tables, media library ---- */
.toolbar { display: flex; gap: var(--space-12); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--space-24); }
.toolbar form { display: flex; gap: var(--space-8); align-items: center; flex-wrap: wrap; }
.toolbar .input { width: 260px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-24); margin-bottom: var(--space-48); }
.stat { border-top: 1px solid var(--primary); padding-top: var(--space-12); }
.stat strong { display: block; font: 400 var(--head-40)/1.1 var(--font-display); color: var(--primary); }
.stat span { font-size: var(--text-13); color: var(--muted-foreground); }
/* Integrations (0.9): one tile per service, a rule on top as .stat, linking to its section below.
   Markup: .integration-grid > a.integration[data-on] > strong (name) + span.integration-state (.input-state + text) + p */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-24); margin-bottom: var(--space-48); }
.integration { display: block; border-top: 1px solid var(--primary); padding-top: var(--space-12); color: inherit; text-decoration: none; }
.integration strong { display: block; font: 400 var(--text-22)/1.25 var(--font-subtitle); color: var(--primary); }
.integration-state { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--text-13); color: var(--muted-foreground); }
.integration-state .input-state { width: 16px; height: 16px; }
.integration[data-on] .integration-state { color: var(--foreground); }
.integration p { margin: 6px 0 0; font-size: var(--text-13); line-height: 1.5; color: var(--muted-foreground); }
.integration:hover strong { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.integration:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
.form-section { padding: var(--space-28) 0; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
/* 0.100.1: a form right under a page header (the gift form): the header's rule is the divider, so no second line. */
.product-header + .form-section { border-top: 0; padding-top: 0; }
/* 0.100.1: date and time fields on iOS Safari keep their native width and height and stick out of the form; without
   the native look they take the size of every other input (the picker still opens). */
.input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"]) { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; }
.input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
.form-section > h2 { font: 400 var(--text-22)/1.3 var(--font-subtitle); margin: 0 0 4px; color: var(--primary); }
.form-section > p { margin: 0 0 var(--space-20); font-size: var(--text-14); color: var(--muted-foreground); }
/* Parts after the heading and note (copy box, table, field grid, buttons) keep 20 px between them */
.form-section > :not(h2, p) + * { margin-top: var(--space-20); }
/* Sections as cards (0.94.0): in a tab panel of the app, each .form-section is its own card (border, card colour,
   padding), so a long tab reads as separate blocks instead of one column. Outside tab panels nothing changes. */
.app-content [role="tabpanel"] > .form-section { padding: var(--space-24) var(--space-28); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.app-content [role="tabpanel"] > .form-section + .form-section { margin-top: var(--space-16); }
.app-content [role="tabpanel"] > .form-section.danger-zone { border-color: var(--destructive); }
@media (max-width: 640px) { .app-content [role="tabpanel"] > .form-section { padding: var(--space-18) var(--space-16); } }
/* Danger area (0.92.0): the last section of an edit page, for the trash or a deletion. Red heading, a red rule above,
   and the button that opens the confirmation (summary.btn of a details) in red outline, so it cannot be missed.
   Markup: section.form-section.danger-zone > h2 + p + details > summary.btn + form > .note + button.btn[data-variant=destructive] */
.form-section.danger-zone { border-top-color: var(--destructive); }
.form-section.danger-zone > h2 { color: var(--destructive); }
.danger-zone details > summary.btn { color: var(--destructive); border: 1px solid var(--destructive); background: transparent; }
.danger-zone details > summary.btn:hover, .danger-zone details[open] > summary.btn { background: color-mix(in oklab, var(--destructive) 10%, transparent); }
.danger-zone details > form { margin-top: var(--space-12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16) var(--space-24); }
.form-grid .wide { grid-column: 1 / -1; }
/* Stored secret: the masked value as placeholder in ink, and a check (or a cross) right of the field */
.input-secret { display: flex; align-items: center; gap: var(--space-10); }
.input-secret .input { flex: 1; min-width: 0; }
.input-secret[data-set] .input::placeholder { color: var(--muted-foreground); font-family: var(--font-mono); letter-spacing: .08em; }
/* Remove a stored secret: an icon button right of the field. It opens a small confirmation; its button submits a
   form outside the settings form (form="..."), so the forms do not nest.
   Markup: details.input-remove > summary.btn[data-variant=ghost][data-size=icon] svg + .confirm > .note + button.btn[data-variant=destructive][form] */
.input-remove { position: relative; flex: none; }
.input-remove > summary { list-style: none; color: var(--muted-foreground); }
.input-remove > summary::-webkit-details-marker { display: none; }
.input-remove > summary svg { width: 16px; height: 16px; }
.input-remove[open] > summary, .input-remove > summary:hover { color: var(--destructive); }
/* A confirmation that deletes nothing (0.44.2): data-tone="neutral" keeps the ink colour; data-active marks the current state. */
.input-remove[data-tone="neutral"][open] > summary, .input-remove[data-tone="neutral"] > summary:hover { color: var(--foreground); }
.input-remove[data-active] > summary { color: var(--brand); }
.input-remove .confirm { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: var(--space-10); justify-items: start;
                         width: max-content; max-width: 300px; padding: var(--space-12); background: var(--popover); color: var(--popover-foreground);
                         border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / calc(.08 * var(--shadow))); }
.input-state { flex: none; display: inline-flex; width: 20px; height: 20px; color: var(--success); }
/* 0.90.2: a secret that saves in place carries its check and its remove button from the start; both show once the
   field is stored (data-set, set by inline-save.js after a save) or cannot be read (data-state=error). */
.input-secret:not([data-set], [data-state="error"]) > :is(.input-state, .input-remove) { display: none; }
.input-secret[data-state="error"] .input-state { color: var(--destructive); }
.input-state svg { width: 100%; height: 100%; }
.form-grid .check-field { display: flex; gap: var(--space-10); align-items: center; font-size: var(--text-14); }
.form-grid .check-field input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: var(--space-12); align-items: center; margin-top: var(--space-24); }
/* 0.75.0: a row of short settings under the main fields of an editor (category, URL name, order, a draft check). Each
   field takes only the width it needs: a select its longest option, a text field 260 px, a number 96 px; a check sits
   on the line of the inputs. The row wraps on narrow screens. Markup: div.form-meta > .field (any of them) + .check-field */
.form-meta { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-16) var(--space-24); }
.form-grid + .form-meta, .form-meta + .form-grid { margin-top: var(--space-16); }
.form-meta > .field { flex: 0 1 auto; min-width: 0; }
.form-meta .select { width: auto; min-width: 160px; max-width: 100%; }
.form-meta .input { width: 260px; max-width: 100%; }
.form-meta .input[type="number"] { width: 96px; }
.form-meta .check-field { display: flex; gap: var(--space-10); align-items: center; min-height: 36px; font-size: var(--text-14); }
.form-meta .check-field input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
/* 0.63.0: a form as a card on a member page (the contact form of Help and contact): form.card.form-card (Basecoat card)
   > header (h2 + p) + section (.form-grid, fields .wide) + footer (the submit button, right). The border and radius of
   the link cards, space above it, and selects as wide as their field. */
.form-card { margin-top: var(--space-56); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift); background: var(--card); scroll-margin-top: 96px; }
.form-card > header h2 { margin: 0; font: 400 var(--head-24)/1.3 var(--font-subtitle); color: var(--primary); }
.form-card > header p { margin: 0; font-size: var(--text-14); color: var(--muted-foreground); }
.form-card > section > .alert { margin-bottom: var(--space-16); }
.form-card .select { width: 100%; }
.form-card > footer { justify-content: flex-end; }
/* 0.91.1: a form-card without Basecoat's .card (the admin forms: form.form-card > .form-section …) pads itself, so
   the fields never touch the border. With .card, the card's header, section and footer pad as before. */
.form-card:not(.card) { padding: var(--space-32); }
.form-card:not(.card) > .form-section:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 640px) { .form-card:not(.card) { padding: var(--space-20); } }
/* 0.90.1: every card footer spaces its buttons (Basecoat's footer is a flex row without a gap). */
.card > footer { gap: var(--space-12); flex-wrap: wrap; }
/* An action column (0.90.1): td.action-cell holds one action of the row (form > button) and, below it, its state or
   deadline (p.note). One column per kind of action, so each button stands in the same place in every row; a row
   without the action shows only the state. */
.data-table .action-cell { white-space: nowrap; }
.data-table .action-cell .note { margin: 4px 0 0; font-size: var(--text-13); }
.data-table .action-cell form + .note { margin-top: 6px; }
.code-area { font: 400 var(--text-13)/1.6 var(--font-mono); min-height: 280px; }
.data-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions form { display: inline; }
/* Icon actions of a row (0.44.2): .actions > .row of ghost icon buttons and details.input-remove, on one line. */
.data-table .actions > .row { justify-content: flex-end; flex-wrap: nowrap; gap: 2px; }
/* Quiet row actions (icon, ghost, outline). 0.90.1: a strong button (brand, destructive, primary) keeps its own colours. */
.data-table .actions > .row > .btn:not([data-variant="brand"], [data-variant="destructive"], [data-variant="primary"]), .data-table .actions .input-remove > summary { color: var(--muted-foreground); }
.data-table .actions > .row > .btn:not([data-variant="brand"], [data-variant="destructive"], [data-variant="primary"]):hover { color: var(--foreground); }
.data-table .actions .input-remove .confirm { text-align: left; white-space: normal; }
.data-table .actions > .row form > .btn:not([data-variant="brand"], [data-variant="destructive"], [data-variant="primary"]) { color: var(--muted-foreground); }
.data-table .actions > .row form > .btn:not([data-variant="brand"], [data-variant="destructive"], [data-variant="primary"]):hover { color: var(--foreground); }
/* Row title, text and meta in the first cell (0.70): a.row-title (medium weight) + span.row-text (muted, two lines at
   most) + span.row-meta (small, e.g. the date). .data-table[data-fixed] keeps the action column at one width in
   every row and in every table of the page (th.actions), so the buttons line up. */
.data-table .row-title { font-weight: 500; font-size: var(--text-15); color: var(--foreground); }
.data-table .row-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  margin-top: 2px; font-size: var(--text-13); line-height: 1.5; color: var(--muted-foreground); }
.data-table .row-text a { font-size: var(--text-13); }
.data-table .row-meta { display: block; margin-top: 4px; font-size: var(--text-12); color: var(--muted-foreground); }
.data-table[data-fixed] { table-layout: fixed; }
.data-table[data-fixed] th.actions { width: 16rem; }
@media (max-width: 640px) { .data-table[data-fixed] th.actions { width: 9rem; } .data-table[data-fixed] .actions > .row { flex-wrap: wrap; } }
/* A tab panel as a stack (0.70): .tabs > div[role=tabpanel].stack puts the normal gap between text, buttons and boxes. */
.tabs > [role="tabpanel"].stack { padding-top: var(--space-8); }
/* A data value (0.90.3): dates, amounts, numbers, IDs and event names in a table or a meta line. Calm type (0.89):
   the font and size of the text around it, with tabular figures, so columns of numbers line up without a third
   family. The name stays for the templates that use it; real code is <code> or a .prompt. */
.data-table .mono, .mono { font: inherit; font-variant-numeric: tabular-nums; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-16); }
.media-tile { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); display: flex; flex-direction: column; }
.media-tile .thumb { aspect-ratio: 4 / 3; background: var(--muted); position: relative; display: grid; place-items: center;
                     font: 400 var(--text-13) var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.media-tile .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-tile .meta { padding: var(--space-10) var(--space-12); display: grid; gap: 6px; font-size: var(--text-12); color: var(--muted-foreground); }
.media-tile .meta strong { font-weight: 500; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tile .meta input { font: 400 var(--text-11) var(--font-mono); height: 28px; }
/* Media library (0.14): a tile is a link to the detail page; badges name issues (no alt text, unused, in the trash) */
a.media-tile { color: inherit; text-decoration: none; transition: border-color .15s ease-out; }
a.media-tile:hover { border-color: var(--muted-foreground); }
.media-tile .badges { display: flex; flex-wrap: wrap; gap: 4px; }
.media-tile[data-trashed] .thumb { opacity: .45; }
/* Media detail: the preview left, the facts right; variants and uses below as data tables.
   Markup: .media-detail > .media-preview (img or file type) + aside > dl.facts + forms */
.media-detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-32); align-items: start; }
.media-preview { border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); min-height: 200px;
                 display: grid; place-items: center; overflow: hidden; font: 500 var(--text-14) var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.media-preview img { display: block; width: 100%; height: auto; }
.media-detail aside { display: grid; gap: var(--space-20); }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-8) var(--space-16); margin: 0; font-size: var(--text-14); }
dl.facts dt { color: var(--muted-foreground); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 800px) { .media-detail { grid-template-columns: 1fr; } }

/* ---- Modal (0.29): Basecoat dialog.dialog with its backdrop, opened by dist/dialog.js ([data-dialog="<id>"]).
        Live search: form[data-live-search="<results id>"] (dist/live-search.js) shimmers its input while it loads.
        .btn-label: the text of a button that has an icon; on small screens only the icon shows ---- */
.dialog > * { max-width: min(560px, calc(100% - 2rem)); }
.dialog[data-wide] > * { max-width: min(860px, calc(100% - 2rem)); }
.dialog > * > section { overflow-y: auto; }
.dialog::backdrop { background-color: color-mix(in oklab, var(--foreground) 35%, transparent); }
form[data-live-search][aria-busy] .input { background-image: linear-gradient(90deg, transparent, var(--muted), transparent);
                                          background-size: 200% 100%; animation: live-search 1s linear infinite; }
@keyframes live-search { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { form[data-live-search][aria-busy] .input { animation: none; } }
.btn > svg { width: 16px; height: 16px; flex-shrink: 0; }
@media (max-width: 640px) { .btn .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }

/* ---- Page drop (0.30): files dragged over a page with form[data-drop-upload] show this target over the whole
        window (dist/drop-upload.js); the text is the form's data-drop-upload ---- */
.drop-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--space-24);
                background: color-mix(in oklab, var(--background) 80%, transparent); backdrop-filter: blur(2px); pointer-events: none; }
.drop-overlay > div { width: min(640px, 100%); aspect-ratio: 16 / 7; display: grid; place-content: center; gap: var(--space-8); text-align: center;
                      border: 2px dashed var(--brand); border-radius: var(--radius); background: var(--brand-soft); }
.drop-overlay strong { font: 400 var(--head-28)/1.2 var(--font-subtitle); color: var(--primary); }
.drop-overlay span { font-size: var(--text-13); color: var(--muted-foreground); min-height: 1.4em; }
.drop-overlay[data-busy] > div { border-style: solid; }

/* ---- Sort list (0.28): rows in their order; a drag handle shows on hover and moves a row. dist/sort-list.js saves
        the new order on drop. Arrow keys on the handle move a row too.
   Markup: ol.sort-list[data-sort-url][data-csrf] > li[data-id] > button.sort-handle + .sort-main (link, mono slug)
           + .sort-meta (cells) ---- */
.sort-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--primary); font-size: var(--text-14); }
.sort-list > li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--space-12); align-items: center;
                  padding: var(--space-12) var(--space-12) var(--space-12) 0; border-bottom: 1px solid var(--border); background: var(--background); }
.sort-list .sort-main a { color: var(--primary); text-decoration: none; }
.sort-list .sort-main a:hover { text-decoration: underline; }
.sort-list .sort-meta { display: flex; gap: var(--space-24); align-items: center; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
/* 0.79.0: a number cell (.num, a duration or a count) has a fixed width and sits right, also when it is empty, so the
   cells of every row line up in columns. */
.sort-list .sort-meta > .num { min-width: 5em; text-align: right; }
.sort-handle { display: grid; place-items: center; width: 24px; height: 28px; padding: 0; border: 0; border-radius: calc(var(--radius) - 4px);
               background: none; color: var(--muted-foreground); cursor: grab; touch-action: none; opacity: 0; transition: opacity .15s ease-out; }
.sort-handle svg { width: 16px; height: 16px; }
.sort-list > li:hover .sort-handle, .sort-handle:focus-visible, .sort-list > li[data-dragging] .sort-handle { opacity: 1; }
.sort-handle:hover { background: var(--muted); color: var(--foreground); }
@media (hover: none) { .sort-handle { opacity: 1; } }
.sort-list > li[data-dragging] { position: relative; z-index: 1; box-shadow: 0 8px 24px -12px rgb(0 0 0 / calc(.35 * var(--shadow))); cursor: grabbing; }
.sort-list > li[data-dragging] .sort-handle { cursor: grabbing; }
.sort-list[data-busy] { opacity: .6; pointer-events: none; }
/* 0.57.6: on a phone the meta cells go under the title, so a long opening rule does not squeeze it. */
@media (max-width: 700px) {
  .sort-list > li { grid-template-columns: 24px minmax(0, 1fr); row-gap: 4px; }
  .sort-list .sort-meta { grid-column: 2; flex-wrap: wrap; gap: 4px var(--space-16); font-size: var(--text-13); }
  .sort-list .sort-meta > .num { min-width: 0; text-align: left; }
  .sort-list .sort-meta > .num:empty { display: none; }
}
/* Row actions (0.93.0): a ⋯ button at the end of a sort-list row; it opens a panel of quick forms (rename, schedule,
   publish) and, last, the trash in red. dist/menu.js closes it on an outside click and Escape.
   Markup: li > … + details.row-actions > summary.btn[data-variant=ghost][data-size=icon][aria-label] (svg)
           + div.row-actions-panel > (form.row-actions-form > label.label + div.row-actions-field > input.input + button.btn)*
           + div.row-actions-danger > details (F::danger) */
.sort-list > li:has(> .row-actions) { grid-template-columns: 24px minmax(0, 1fr) auto auto; }
.row-actions { position: relative; }
.row-actions > summary { list-style: none; }
.row-actions > summary::-webkit-details-marker { display: none; }
.row-actions > summary svg { width: 16px; height: 16px; }
.row-actions[open] > summary { background: var(--muted); }
.row-actions-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; display: grid; gap: var(--space-16); width: min(360px, calc(100vw - 32px));
  padding: var(--space-16); background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 16px 40px -16px rgb(0 0 0 / calc(.35 * var(--shadow))); font-size: var(--text-14); }
.row-actions-form { display: grid; gap: 6px; margin: 0; }
.row-actions-field { display: flex; gap: var(--space-8); align-items: center; }
.row-actions-field > .input, .row-actions-field > .select { flex: 1; min-width: 0; }
.row-actions-danger { padding-top: var(--space-12); border-top: 1px solid var(--destructive); }
.row-actions-danger details > summary.btn { color: var(--destructive); border: 1px solid var(--destructive); background: transparent; }
.row-actions-danger details > form { margin-top: var(--space-10); display: grid; gap: var(--space-8); }
@media (max-width: 700px) {
  .sort-list > li:has(> .row-actions) { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .sort-list > li:has(> .row-actions) > .row-actions { grid-column: 3; grid-row: 1; }
}
/* Table rows in a form (0.50): tbody[data-sort-rows] > tr > td > button.sort-handle. Without data-sort-url the rows
   only move; the form saves them in their new order. */
[data-sort-rows] > tr:hover .sort-handle, [data-sort-rows] > tr[data-dragging] .sort-handle { opacity: 1; }
[data-sort-rows] > tr[data-dragging] { position: relative; z-index: 1; background: var(--background); box-shadow: 0 8px 24px -12px rgb(0 0 0 / calc(.35 * var(--shadow))); }
[data-sort-rows] > tr[data-dragging] .sort-handle { cursor: grabbing; }
[data-sort-rows] > tr > td:has(> .sort-handle) { width: 24px; padding-right: 0; }
/* On a phone (0.57.4) a row of fields becomes a card: the handle on the left, every field below the other with its
   label from td[data-label]. The table head hides. */
@media (max-width: 700px) {
  table:has(> [data-sort-rows]) > thead { display: none; }
  [data-sort-rows] > tr { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: var(--space-8); row-gap: var(--space-10); padding: var(--space-14) 0; border-bottom: 1px solid var(--border); }
  [data-sort-rows] > tr > td { display: block; grid-column: 2; padding: 0; border: 0; width: auto; }
  [data-sort-rows] > tr > td:has(> .sort-handle) { grid-column: 1; grid-row: 1 / span 20; width: 28px; }
  [data-sort-rows] > tr > td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: var(--text-12); color: var(--muted-foreground); }
  [data-sort-rows] .sort-handle { opacity: 1; }
  [data-sort-rows] > tr:has(select[data-target]):not(:has(select[data-target] option[value="url"]:checked)) > td:has(> [data-url-field]) { display: none; }
}
/* A row with a target select (0.50.1): select[data-target] picks a module, a lesson, a product or "url"; the field
   [data-url-field] of the row shows only for "url". */
tr:has(select[data-target]):not(:has(select[data-target] option[value="url"]:checked)) [data-url-field] { visibility: hidden; }

/* ---- Image field and media picker (0.28): a form field that shows the chosen image; "Choose" opens one shared
        dialog with upload, the library and a detail pane (alt text, open in the library, move to trash).
   Field: .image-field > .image-field-preview (img or .empty) + .image-field-body (strong name, span note,
          .row of buttons) + input[type=hidden]
   Dialog: dialog.dialog.media-picker > div > header + section.media-picker-body (.media-picker-main: .drop-zone,
           .picker-grid > button.picker-item[aria-pressed] > img + span) + aside.media-picker-detail) + footer ---- */
.image-field { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--space-16); align-items: center;
               padding: var(--space-12); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.image-field-preview { aspect-ratio: 16 / 9; border-radius: calc(var(--radius) - 4px); overflow: hidden; background: var(--muted);
                       display: grid; place-items: center; color: var(--muted-foreground); font-size: var(--text-12); }
.image-field[data-square] .image-field-preview { aspect-ratio: 1; width: 90px; }
.image-field-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-field-body { display: grid; gap: 4px; min-width: 0; font-size: var(--text-14); }
.image-field-body strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-field-body span { color: var(--muted-foreground); font-size: var(--text-12); }
.image-field-body .row { margin-top: 6px; }

.media-picker > * { max-width: min(1080px, calc(100% - 2rem)); height: min(760px, calc(100% - 2rem)); }
.media-picker-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-24); min-height: 0; overflow: hidden; }
.media-picker-main { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--space-16); min-height: 0; }
.drop-zone { display: flex; gap: var(--space-12); align-items: center; justify-content: center; padding: var(--space-18); font-size: var(--text-14);
             border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted-foreground); background: var(--muted);
             transition: border-color .15s ease-out, background-color .15s ease-out; }
.drop-zone[data-over] { border-color: var(--brand); background: var(--brand-soft); color: var(--foreground); }
.drop-zone[data-busy] { opacity: .6; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--space-12); align-content: start;
               overflow-y: auto; padding: 2px; }
.picker-item { display: grid; gap: 6px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font-size: var(--text-12);
               color: var(--muted-foreground); min-width: 0; }
.picker-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--radius) - 4px); background: var(--muted);
                   outline: 1px solid var(--border); outline-offset: -1px; transition: outline-color .15s ease-out; }
.picker-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item:hover img { outline-color: var(--muted-foreground); }
.picker-item[aria-pressed="true"] img { outline: 2px solid var(--brand); outline-offset: 2px; }
.picker-item[aria-pressed="true"] span { color: var(--foreground); }
.media-picker-detail { display: grid; align-content: start; gap: var(--space-14); overflow-y: auto; padding-left: var(--space-24); border-left: 1px solid var(--border); font-size: var(--text-14); }
.media-picker-detail img { width: 100%; border-radius: calc(var(--radius) - 4px); background: var(--muted); }
.media-picker-detail .empty { padding: var(--space-32) 0; }
/* 0.31: dist/media-picker.js. The body keeps its own scroll areas; the error line sits above the grid. */
.media-picker .media-picker-body { overflow: hidden; }
.media-picker [hidden] { display: none; }
.media-picker-detail [data-detail="body"]:not([hidden]), .media-picker-detail [data-detail="library"]:not([hidden]) { display: grid; gap: var(--space-14); }
.drop-zone input[type=file] { display: none; }
@media (max-width: 800px) {
  .media-picker .media-picker-body { grid-template-columns: 1fr; overflow-y: auto; }
  .media-picker-detail { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); padding-top: var(--space-16); }
  .image-field { grid-template-columns: 112px minmax(0, 1fr); }
}

/* ---- Language switch: "EN | DE" in small caps. Inline in footers; as .lang-float a pill bottom right until the
        visitor chooses (the app then sets a cookie and shows only the footer switch) ---- */
.lang-switch { display: inline-flex; align-items: center; gap: 0; font-family: var(--font-sans);
               font-size: var(--text-13); font-weight: 500; line-height: 1; }
.lang-switch a { color: var(--muted-foreground); text-decoration: none; padding-inline: var(--space-8); border-radius: calc(var(--radius) - 2px);
                 transition: color .15s ease-out; }
.lang-switch a + a { border-left: 1px solid var(--border); border-radius: 0; }
.lang-switch a:hover { color: var(--foreground); }
.lang-switch a[aria-current="true"] { color: var(--primary); }
.lang-switch a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.site-footer .lang-switch a, .app-footer .lang-switch a { color: var(--muted-foreground); }
.site-footer .lang-switch a[aria-current="true"], .app-footer .lang-switch a[aria-current="true"] { color: var(--foreground); }
.lang-float { position: fixed; z-index: 30; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
              padding: 6px var(--space-8); background: var(--card); border: 1px solid var(--border); border-radius: 999px;
              box-shadow: 0 6px 24px -10px color-mix(in srgb, var(--image-scrim) calc(45% * var(--shadow)), transparent);
              animation: lang-float-in .4s cubic-bezier(.2, .7, .2, 1) .6s both; }
.lang-float a { padding-inline: var(--space-10); }
@keyframes lang-float-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .lang-float { animation: none; } }
/* Document logo (0.87.0): the logo on an invoice page or another document, kept small whatever the file's size.
   Markup: img.doc-logo in the .greeting of the document. */
.doc-logo { display: block; width: auto; height: auto; max-height: 56px; max-width: 200px; object-fit: contain; margin-bottom: var(--space-16); }
@media print { .doc-logo { max-height: 16mm; max-width: 55mm; } }
/* Print (0.26): lessons, dates and notes print like a handout: black on white, Latin Modern, no app frame, no controls.
   A .print-button (window.print) sits in the page; it does not print itself. */
@page { size: A4; margin: 20mm 22mm; }
@media print {
  :root, .dark { --background: #fff; --foreground: #000; --primary: #000; --muted-foreground: #333; --border: #999; --brand: #000; --brand-soft: #fff; --card: #fff; }
  html, body { background: #fff !important; color: #000; font-size: 11pt; }
  .lang-float, .app-sidebar, .app-header, .app-footer, .crumbs, .menu-toggle, .user-menu, .site-header, .site-footer,
  .btn, button, form:not(.notes-form), .notes-input, .qa, .download-menu, .video, .video-resume, iframe, video, .unit-nav, .unit-actions, .alert, .print-button, .notes-foot,
  .notes-card > summary::after, .notes-card > summary small { display: none !important; }
  .app-shell { display: block; }
  .app-content { padding: 0; }
  .unit-page, .date-page { max-width: none; }
  .prose, .note-item p { color: #000; }
  .notes-card { border: 0; margin-top: 24pt; }
  .notes-card > summary { padding: 0 0 6pt; }
  .notes-card .notes-body { padding: 0; }
  .notes-print { display: block; white-space: pre-line; font: 400 11pt/1.5 var(--font-subtitle); }
  .notes-card:not([open]) { display: none; }
  .callout, .caution, .prompt, .join-panel { background: #fff !important; border-color: #000; }
  a { color: #000; text-decoration: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  h1, h2, h3 { break-after: avoid; }
  figure, table, .prompt, .callout, .note-item { break-inside: avoid; }
}

/* ---- User menu: top right. Guests see the sign-in button; members a <details> menu with monogram, name and the
        account links; "Sign out" is its last item. Works without JavaScript; dist/menu.js closes it on an outside
        click and Escape ---- */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: var(--space-10); cursor: pointer; user-select: none;
                       padding: 4px var(--space-12) 4px 4px; border: 1px solid transparent; border-radius: 999px; font-size: var(--text-14);
                       color: var(--foreground); transition: border-color .15s ease-out, background-color .15s ease-out; }
.user-menu > summary::-webkit-details-marker { display: none; }
/* 0.60.0: questions stream. span.menu-count after the avatar in the summary: the number of threads with something new
   (a small brand pill on the avatar's corner); in the panel a.menu-item may end with .nav-count. */
.user-menu > summary { position: relative; }
.user-menu .menu-count { position: absolute; top: -2px; left: 22px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--brand); color: var(--brand-foreground); font: 600 var(--text-11)/1 var(--font-sans);
  box-shadow: 0 0 0 2px var(--background); pointer-events: none; }
.menu-item > .nav-count { margin-left: auto; }
.user-menu > summary:hover, .user-menu[open] > summary { border-color: var(--border); background: var(--card); }
.user-menu .chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
                      transform: translateY(-2px) rotate(45deg); opacity: .55; transition: transform .2s ease-out; }
.user-menu[open] .chevron { transform: translateY(2px) rotate(-135deg); }
.avatar { width: 28px; height: 28px; flex: none; border-radius: 999px; display: inline-grid; place-items: center;
          background: var(--primary); color: var(--primary-foreground); font-family: var(--font-serif);
          font-size: var(--text-12); letter-spacing: .06em; line-height: 1; text-box: trim-both cap alphabetic; }
/* Without text-box the serif's deep descender pulls the capitals down: lift them a little */
@supports not (text-box: trim-both cap alphabetic) { .avatar { padding-bottom: 2px; } }
.menu-panel { position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); min-width: 248px; padding: 6px;
              background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius);
              box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--image-scrim) calc(40% * var(--shadow)), transparent);
              animation: menu-in .16s ease-out both; transform-origin: top right; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-head { padding: var(--space-10) var(--space-10) var(--space-12); margin-bottom: 6px; border-bottom: 1px solid var(--border); display: grid; gap: 2px; }
.menu-head strong { font-weight: 500; font-size: var(--text-14); }
.menu-head span { font-size: var(--text-12); color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; width: 100%; padding: var(--space-8) var(--space-10); border: 0; border-radius: calc(var(--radius) - 2px);
             background: none; color: var(--foreground); font: inherit; font-size: var(--text-14); text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--accent-foreground); outline: none; }
.menu-sep { height: 1px; margin: 6px 0; background: var(--border); }
.menu-panel form { margin: 0; }
.site-header:not(.site-header-solid) .user-menu > summary { color: var(--on-image); }
.site-header:not(.site-header-solid) .user-menu > summary:hover, .site-header:not(.site-header-solid) .user-menu[open] > summary {
  background: color-mix(in srgb, var(--on-image) 10%, transparent); border-color: color-mix(in srgb, var(--on-image) 25%, transparent); }
@media (max-width: 640px) { .user-menu .user-name { display: none; } .user-menu > summary { padding-right: var(--space-10); } }
@media (prefers-reduced-motion: reduce) { .menu-panel { animation: none; } }

/* ---- Hamburger: the menu button of the app shell on small screens (.menu-toggle > .hamburger). Three rules that
        turn into a cross while the sidebar is open (aria-expanded="true", set by dist/app-shell.js) ---- */
.menu-toggle { width: 36px; height: 36px; padding: 0; justify-content: center; align-items: center; }
.hamburger { position: relative; display: block; width: 18px; height: 12px; }
.hamburger::before, .hamburger::after, .hamburger > span { content: ""; position: absolute; left: 0; right: 0; height: 1.5px;
  background: currentColor; border-radius: 1px; transition: transform .22s cubic-bezier(.2, .7, .2, 1), opacity .15s ease-out, top .22s ease-out; }
.hamburger::before { top: 0; }
.hamburger > span { top: 5.25px; }
.hamburger::after { top: 10.5px; }
.menu-toggle[aria-expanded="true"] .hamburger::before { top: 5.25px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .hamburger > span { opacity: 0; }
.menu-toggle[aria-expanded="true"] .hamburger::after { top: 5.25px; transform: rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .hamburger::before, .hamburger::after, .hamburger > span { transition: none; } }

/* ---- Site navigation: menu "site-header" between the wordmark and the user menu. On small screens one row that
        scrolls sideways ---- */
.site-header-inner { gap: var(--space-24); }
.site-nav { display: flex; align-items: center; gap: var(--space-28); margin-left: auto; font-size: var(--text-14); }
.site-nav a { color: var(--on-image); opacity: .78; text-decoration: none; white-space: nowrap; transition: opacity .15s ease-out; }
.site-nav a:hover, .site-nav a[aria-current="page"] { opacity: 1; }
.site-header-solid .site-nav a { color: var(--foreground); opacity: .7; }
.site-header-solid .site-nav a:hover, .site-header-solid .site-nav a[aria-current="page"] { opacity: 1; }
@media (max-width: 720px) { .site-nav { gap: var(--space-18); overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(to right, #000 85%, transparent); }
  .site-nav::-webkit-scrollbar { display: none; } }

/* ---- Page: a free page (/<slug>), one reading column. .page-frame: the space below the solid site header ---- */
.page-frame { padding-top: var(--space-72); }
.page { max-width: 760px; }
.page > .display { margin: 0 0 var(--space-20); }
/* Unit teaser (0.10): the public face of a unit, for sharing. Product and module as eyebrow, title, summary, the
   image (or a preview video in .video), then, as a paywall, a preview text that fades out above a brand call to
   action (.block-cta[data-tone="brand"]). Markup: article.page.teaser > .eyebrow + h1 + .lead + .teaser-media + .paywall-preview */
.teaser .teaser-media { margin: var(--space-32) 0 0; aspect-ratio: 16 / 9; }
.teaser .teaser-media.cover { border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); }
.paywall-preview { position: relative; margin-top: var(--space-32); max-height: 420px; overflow: hidden;
                   -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.teaser + .block-cta { margin-top: var(--space-24); }
.page > .lead { margin: 0 0 var(--space-40); }
.page > .alert { margin-bottom: var(--space-32); }

/* ==== Blocks: the parts a page is built from (app: src/Blocks.php, one template per type). Every block is a
   section.block with three presets that map to tokens, never to raw values:
     data-tone    light (default) | muted | brand (brand-soft paper) | dark (the .dark tokens inside the block)
     data-width   reading (760) | wide (1200, default) | full (edge to edge)
     data-spacing compact | normal (default) | spacious
     data-show    mobile | desktop (see Show below; also on single links and buttons)
   Markup: section.block.block-<type>[data-*] > .block-inner > content ==== */
.block { padding-block: var(--space-80); background: var(--background); color: var(--foreground); }
.block[data-spacing="compact"] { padding-block: var(--space-40); }
.block[data-spacing="spacious"] { padding-block: var(--space-128); }
.block[data-tone="muted"] { background: var(--muted); }
.block[data-tone="brand"] { background: var(--brand-soft); }
/* 0.98.0: tone deep, the deep brand colour (--brand-deep) with a slight gradient to the bottom right; the app renders it with .dark */
.block[data-tone="deep"] { background: linear-gradient(135deg, var(--brand-deep) 0%, color-mix(in oklab, var(--brand-deep) 70%, black) 100%); }
.block-inner { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-24); }
.block[data-width="reading"] .block-inner { max-width: 808px; }
.block[data-width="full"] .block-inner { max-width: none; padding: 0; }
/* Two blocks of the same tone in a row share one gap */
.block[data-tone="light"] + .block[data-tone="light"], .block[data-tone="muted"] + .block[data-tone="muted"],
.block[data-tone="brand"] + .block[data-tone="brand"], .block[data-tone="dark"] + .block[data-tone="dark"], .block[data-tone="deep"] + .block[data-tone="deep"] { padding-top: 0; }
.block .eyebrow + .display { margin-top: var(--space-14); }
.block .display + .lead { margin-top: var(--space-18); }
.block .block-head { display: block; margin: 0 0 var(--space-40); max-width: 760px; }
/* Inside the members' app the content column frames the blocks: tinted blocks become panels */
.app-content .block { padding-block: var(--space-48); }
.app-content .block .block-inner { padding: 0; }
.app-content .block:not([data-tone="light"]) { padding-inline: var(--space-32); border-radius: var(--radius); margin-block: var(--space-16); }
.app-content .block[data-tone="light"]:first-child { padding-top: 0; }

/* Page header: title and summary, when the page does not start with a hero */
.block-title .display { margin: 0; }
.block-title .lead { margin-top: var(--space-18); max-width: 680px; }

/* Hero: a dark photograph with scrim (image given) or a quiet typographic opening (no image) */
.block-hero { position: relative; overflow: hidden; }
.block-hero[data-image] { min-height: min(78vh, 760px); display: flex; align-items: flex-end; padding-block: var(--space-120) var(--space-88);
                          background: var(--image-scrim); color: var(--on-image); }
.block-hero[data-image] .block-inner { position: relative; z-index: 1; width: 100%; }
.block-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.block-hero[data-image]::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--image-scrim) 82%, transparent), transparent 70%); }
.block-hero[data-image] .eyebrow { color: color-mix(in srgb, var(--on-image) 72%, transparent); }
.block-hero[data-image] .display { color: var(--on-image); }
.block-hero[data-image] .lead { color: color-mix(in srgb, var(--on-image) 80%, transparent); }
.block-hero[data-align="center"] { text-align: center; padding-block: var(--space-168); }
.block-hero[data-align="center"] .display, .block-hero[data-align="center"] .lead { margin-inline: auto; }
.block-hero[data-align="center"] .row { justify-content: center; }
.block-hero[data-image] .btn[data-variant="ghost"] { color: var(--on-image); }
.block-hero .display { max-width: 880px; }
.block-hero .lead { max-width: 620px; }
.block-hero .row { margin-top: var(--space-36); }

/* Text: prose from the editor (lesson components allowed) */
.block-text .prose > :first-child { margin-top: 0; }
.block-text .prose > :last-child { margin-bottom: 0; }

/* Callout: the lesson callout in a reading column */
.block-callout .callout, .block-callout .caution { margin: 0; }
.block-callout h3 { margin: 0 0 6px; font-family: var(--font-sans); font-size: var(--text-15); font-weight: 600; }

/* Image */
.block-image figure { margin: 0; }
.block-image img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.block-image[data-width="full"] img { border-radius: 0; border-inline: 0; }
.block-image figcaption { margin-top: var(--space-12); font-size: var(--text-13); color: var(--muted-foreground); }
.block-image[data-width="full"] figcaption { padding: 0 var(--space-24); }

/* Columns: two to four short items with a rule on top, as in print */
.block-columns .cols { display: grid; gap: var(--space-40) var(--space-32); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.block-columns .col { border-top: 1px solid var(--primary); padding-top: var(--space-18); }
.block-columns .col h3 { margin: var(--space-10) 0 var(--space-8); font-family: var(--font-subtitle); font-weight: 400; font-size: var(--text-22); line-height: 1.25; }
.block-columns .col p { margin: 0; font-size: var(--text-15); line-height: 1.6; color: var(--muted-foreground); }
.block-columns .col:has(> .col-image) { border-top: 0; padding-top: 0; }
.block-columns .col-image { display: block; width: 100%; max-width: 320px; aspect-ratio: 1; object-fit: cover; object-position: center 20%; border-radius: var(--radius); margin-bottom: var(--space-18); }
.block-columns .col a { display: inline-block; margin-top: var(--space-12); font-size: var(--text-14); color: var(--primary); }

/* Quote: a citation with its author, an optional portrait and an optional source.
   Markup: section.block.block-quote[data-layout] > .block-inner > figure.citation >
           blockquote + figcaption > (img.citation-portrait) + .citation-by > strong + .citation-role + cite (> a)
   data-layout  simple (default): the quote mark above, the author below
                editorial: the quote mark hangs in the margin, a rule over the author, the portrait larger */
.block-quote figure { margin: 0; }
.block-quote blockquote { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: calc(clamp(24px, 3vw, 32px) * var(--text-scale) * var(--heading-scale)); line-height: 1.35; text-wrap: pretty; }
.block-quote blockquote::before { content: "“"; display: block; height: .5em; font-size: 2.4em; line-height: 1; color: var(--brand); font-style: normal; }
.block-quote figcaption { display: flex; align-items: center; gap: var(--space-14); margin-top: var(--space-24); font-size: var(--text-14); line-height: 1.45; color: var(--muted-foreground); }
.block-quote figcaption strong { color: var(--foreground); font-weight: 500; }
.citation-by { display: flex; flex-direction: column; }
.citation-by cite { font-style: italic; }
.citation-by cite a { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.citation-by cite a:hover { text-decoration-color: currentColor; }
.citation-portrait { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: center 20%; }
/* 0.57.7: no photo of the person: span.citation-portrait[data-empty] shows a neutral silhouette in the muted tones. */
.citation-portrait[data-empty] { display: block; position: relative; overflow: hidden; background: var(--muted); }
.citation-portrait[data-empty]::after { content: ""; position: absolute; inset: 0; background: var(--muted-foreground); opacity: .4;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='25' r='11'/%3E%3Cpath d='M10 64c0-13 10-22 22-22s22 9 22 22z'/%3E%3C/svg%3E") center / 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='25' r='11'/%3E%3Cpath d='M10 64c0-13 10-22 22-22s22 9 22 22z'/%3E%3C/svg%3E") center / 100% no-repeat; }

.block-quote[data-layout="editorial"] blockquote { position: relative; font-family: var(--font-subtitle); font-size: calc(clamp(26px, 3.6vw, 40px) * var(--text-scale) * var(--heading-scale)); line-height: 1.28; }
.block-quote[data-layout="editorial"] blockquote::before { position: absolute; right: 100%; top: -.12em; height: auto; margin-right: .12em; font-size: 2.6em; line-height: .9; }
.block-quote[data-layout="editorial"] figcaption { margin-top: var(--space-32); padding-top: var(--space-18); border-top: 1px solid var(--primary); gap: var(--space-18); font-size: var(--text-15); }
.block-quote[data-layout="editorial"] .citation-portrait { width: 72px; height: 72px; }
@media (max-width: 900px) {
  .block-quote[data-layout="editorial"] blockquote::before { position: static; display: block; height: .5em; margin: 0; }
}

/* FAQ: questions as <details>, no JavaScript */
.block-faq .faq { border-top: 1px solid var(--border); }
.block-faq details { border-bottom: 1px solid var(--border); }
.block-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--space-24); padding: var(--space-20) 0;
                     font-family: var(--font-subtitle); font-size: var(--text-20); line-height: 1.35; }
.block-faq summary::-webkit-details-marker { display: none; }
.block-faq summary::after { content: "+"; font-family: var(--font-sans); font-weight: 300; color: var(--muted-foreground); transition: transform .2s ease-out; }
.block-faq details[open] summary::after { transform: rotate(45deg); }
.block-faq .answer { padding: 0 0 var(--space-22); max-width: 680px; }

/* Call to action: one decision, centred */
.block-cta { text-align: center; }
.block-cta .lead { margin-inline: auto; }
.block-cta .row { justify-content: center; margin-top: var(--space-32); }

/* Reveal on scroll: blocks below the fold fade in and rise 12 px as they come into view. dist/reveal.js sets
   html.reveal and data-revealed; without the script (or with reduced motion) every block shows at once. */
@media (prefers-reduced-motion: no-preference) {
  html.reveal .block:not([data-revealed]) { opacity: 0; transform: translateY(12px); }
  html.reveal .block { transition: opacity 800ms ease-out, transform 800ms cubic-bezier(.2, .7, .2, 1); }
}

/* Zigzag: big image rows with little text, sides swap per row (0.11).
   Markup: .zigzag > .zigzag-row > .zigzag-copy (h3, p, a) + .zigzag-media (img) */
.zigzag { display: grid; gap: var(--space-72); }
.zigzag-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); padding: var(--space-14); background: var(--muted); border-radius: var(--radius); }
.zigzag-row:nth-child(even) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.zigzag-row:nth-child(even) .zigzag-copy { order: 2; }
.zigzag-copy { align-self: center; padding: var(--space-24) var(--space-32); }
.zigzag-copy h3 { margin: 0 0 6px; font-family: var(--font-subtitle); font-weight: 400; font-size: var(--head-26); line-height: 1.25; }
.zigzag-copy p { margin: 0; font-family: var(--font-subtitle); font-size: var(--text-20); line-height: 1.45; color: var(--muted-foreground); }
.zigzag-copy a { display: inline-block; margin-top: var(--space-16); font-size: var(--text-15); color: var(--brand); }
.zigzag-media img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: calc(var(--radius) - 2px); }
.block[data-tone="muted"] .zigzag-row { background: var(--background); }
.zigzag-copy .eyebrow { display: block; margin-bottom: var(--space-8); }
/* Image left in every row, no swap */
.zigzag[data-sides="left"] .zigzag-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.zigzag[data-sides="left"] .zigzag-copy { order: 2; }
/* Small: square 240 px images without a card, for portraits */
.zigzag[data-size="small"] { gap: var(--space-56); }
.zigzag[data-size="small"] .zigzag-row { grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-40); align-items: center; padding: 0; background: none; }
.zigzag[data-size="small"] .zigzag-row:nth-child(even) { grid-template-columns: 240px minmax(0, 1fr); }
.zigzag[data-size="small"][data-sides="left"] .zigzag-row { grid-template-columns: 240px minmax(0, 1fr); }
.zigzag[data-size="small"] .zigzag-copy { padding: 0; }
.zigzag[data-size="small"] .zigzag-copy p { font-size: var(--text-18); }
.zigzag[data-size="small"] .zigzag-media img { height: auto; aspect-ratio: 1; object-position: center 20%; border-radius: var(--radius); }

/* Product grid: the catalogue grid inside a block */
.block-products .product-grid { margin-top: 0; }

@media (max-width: 900px) {
  .zigzag { gap: var(--space-32); }
  .zigzag-row, .zigzag-row:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
  .zigzag-row .zigzag-copy, .zigzag-row:nth-child(even) .zigzag-copy { order: 2; padding: var(--space-20) var(--space-10) var(--space-10); }
  .zigzag-media img { height: auto; }
  .zigzag[data-size="small"] .zigzag-row, .zigzag[data-size="small"] .zigzag-row:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: var(--space-16); }
  .zigzag[data-size="small"] .zigzag-row .zigzag-copy { padding: 0; }
  .zigzag[data-sides="left"] .zigzag-row, .zigzag[data-size="small"][data-sides="left"] .zigzag-row { grid-template-columns: minmax(0, 1fr); }
  .zigzag[data-size="small"] .zigzag-media { max-width: 240px; }
}

@media (max-width: 720px) {
  .block { padding-block: var(--space-56); }
  .block[data-spacing="spacious"] { padding-block: var(--space-80); }
  .block-hero[data-image] { min-height: 70vh; padding-block: var(--space-96) var(--space-56); }
}

/* Show: an element for one screen size only. The edge is the app menu's 900 px: at or below it counts as mobile.
   Works on any element: a block (section.block[data-show]), a link of a column or zigzag item, a link or button in text. */
@media (min-width: 901px) { [data-show="mobile"] { display: none !important; } }
@media (max-width: 900px) { [data-show="desktop"] { display: none !important; } }

/* ---- Save in place and tag input (0.33): dist/inline-save.js, dist/tag-input.js.
   Row form: form[data-inline-save] (data-saving, data-saved, data-failed) > fields + .inline-status (+ .inline-submit
   without JS). Tag input: .tag-input[data-name] > .tag (span + button.tag-remove + input[type=hidden]) + input.tag-entry[list] ---- */
.inline-form { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }
.inline-form .select { height: 32px; padding-block: 0; font-size: var(--text-13); }
.inline-status { font: 400 var(--text-12)/1.3 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); white-space: nowrap; }
.inline-status[data-state="saved"] { color: var(--brand); }
.inline-status[data-state="error"] { color: var(--destructive); white-space: normal; }
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 32px; padding: 3px 6px; min-width: 180px;
  border: 1px solid var(--input, var(--border)); border-radius: calc(var(--radius) - 2px); background: var(--background); cursor: text; }
.tag-input:focus-within { outline: 2px solid var(--ring, var(--brand)); outline-offset: 1px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px var(--space-8); border-radius: 999px; font-size: var(--text-12); line-height: 1.4;
  background: var(--brand-soft); color: var(--foreground); }
.tag-remove { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--muted-foreground); font-size: var(--text-14); line-height: 1; cursor: pointer; }
.tag-remove:hover { background: color-mix(in oklab, var(--foreground) 10%, transparent); color: var(--foreground); }
.tag-entry { flex: 1 1 80px; min-width: 80px; height: 24px; padding: 0 2px; border: 0; outline: 0; background: none; font: inherit; font-size: var(--text-13); color: var(--foreground); }

/* ---- Lessons in the module index (0.37): .modules[data-lessons="shown|collapsed|hidden"], in every layout.
   collapsed: details.module-units > summary (the lesson count) + ul.unit-list, closed until a member opens it.
   Cards with lessons: div.module-card[data-units] > a.module-card-link (cover, eyebrow, h3, p, .meta, .progress) and
   below it the compact .unit-list or the details.module-units; without lessons the whole card stays one link. ---- */
.module-units > summary { list-style: none; display: inline-flex; align-items: center; gap: var(--space-8); padding: 6px 0; cursor: pointer; user-select: none;
  font-size: var(--text-13); color: var(--muted-foreground); }
.module-units > summary::-webkit-details-marker { display: none; }
.module-units > summary::after { content: ""; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease-out, margin .15s ease-out; }
.module-units[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.module-units > summary:hover, .module-units > summary:focus-visible { color: var(--foreground); }
.module-units[open] > summary { margin-bottom: 6px; }
.module-card[data-units] { gap: var(--space-12); }
.module-card-link { display: flex; flex-direction: column; gap: var(--space-8); color: inherit; text-decoration: none; }
.module-card[data-units]:has(> .module-card-link:hover) { border-color: var(--muted-foreground); }
.module-card .unit-list a, .module-card .unit-list .locked { padding: 6px 2px; gap: var(--space-8); font-size: var(--text-13); grid-template-columns: 16px minmax(0, 1fr) auto; }
.module-card .unit-list .check { width: 12px; height: 12px; }
.module-card .unit-list .check svg { width: 8px; height: 8px; }
.module-card .module-units > summary { padding: 0; }

/* ---- Shortcode menu (0.37): every shortcode an admin can place, grouped, with the live names of downloads, audio
   files and products. details.shortcode-menu > summary + .menu-panel.shortcode-panel > input.shortcode-filter +
   .shortcode-group (.menu-label + .shortcode-item: button.menu-item[data-insert] with strong + code, and
   button.shortcode-copy[data-copy]). In the editor a click inserts the shortcode; the copy button puts it on the
   clipboard for any other field. dist/html-editor.js runs both, dist/menu.js closes the panel. ---- */
.shortcode-menu { position: relative; }
.shortcode-menu > summary { list-style: none; }
.shortcode-menu > summary::-webkit-details-marker { display: none; }
.shortcode-panel { left: 0; right: auto; width: min(440px, calc(100vw - 32px)); max-height: min(420px, 70vh); overflow: auto; transform-origin: top left; }
.shortcode-filter { width: 100%; height: 32px; margin-bottom: 6px; font-size: var(--text-13); }
.shortcode-group + .shortcode-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.menu-label { display: block; padding: 6px var(--space-10) 2px; font: 400 var(--text-11)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.shortcode-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px; }
.shortcode-item .menu-item { display: grid; gap: 2px; padding-block: 6px; }
.shortcode-item .menu-item strong { font-weight: 500; font-size: var(--text-13); }
.shortcode-item .menu-item code { font: 400 var(--text-12)/1.4 var(--font-mono); color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcode-copy { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: calc(var(--radius) - 2px);
  background: none; color: var(--muted-foreground); cursor: pointer; }
.shortcode-copy:hover, .shortcode-copy:focus-visible { background: var(--accent); color: var(--foreground); outline: none; }
.shortcode-copy svg { width: 15px; height: 15px; }
.shortcode-copy[data-copied] { color: var(--brand); }
.shortcode-item[hidden], .shortcode-group[hidden] { display: none; }

/* ---- HTML editor (0.37): a lean visual editor over a textarea, without outside code. dist/html-editor.js.
   .html-editor > .html-editor-bar[role=toolbar] (select.html-editor-block, button.tool[data-cmd] with an icon,
   .tool-sep, the .shortcode-menu, .html-editor-link (input + apply button), spacer, button.tool[data-cmd=source]) +
   .html-editor-surface.prose[contenteditable] + the textarea (the field that is sent; the HTML view) and, with an image
   picker on the page, a hidden .image-field. Without JavaScript only the textarea shows. HTML the toolbar does not know
   (figures, classes, iframes, shortcodes) stays as it is. ---- */
.html-editor { border: 1px solid var(--input, var(--border)); border-radius: var(--radius); background: var(--background); }
.html-editor:focus-within { outline: 2px solid var(--ring, var(--brand)); outline-offset: 1px; }
.html-editor-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px;
  border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; background: var(--card); }
.html-editor-bar[hidden] { display: none; }
.html-editor-bar .select { height: 30px; width: auto; padding-block: 0; font-size: var(--text-13); }
.html-editor-bar .tool { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: calc(var(--radius) - 2px);
  background: none; color: var(--foreground); font: 500 var(--text-12)/1 var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.html-editor-bar .tool:hover, .html-editor-bar .tool:focus-visible { background: var(--accent); outline: none; }
.html-editor-bar .tool[aria-pressed="true"] { background: var(--brand-soft); color: var(--primary); }
.html-editor-bar .tool:disabled { opacity: .4; cursor: default; background: none; }
.html-editor-bar .tool svg { width: 16px; height: 16px; }
.html-editor-bar .tool-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--border); }
.html-editor-bar .tool-space { flex: 1; }
.html-editor-bar .shortcode-menu > summary { display: inline-flex; align-items: center; gap: 6px; width: auto; font: 400 var(--text-13)/1 var(--font-sans); }
.html-editor-link { display: flex; flex-basis: 100%; gap: 6px; padding: 4px 2px 2px; }
.html-editor-link[hidden] { display: none; }
.html-editor-link .input { flex: 1; height: 30px; font-size: var(--text-13); }
.html-editor-surface { min-height: 10em; max-height: 70vh; overflow: auto; padding: var(--space-14) var(--space-16); outline: none; }
.html-editor-surface[hidden] { display: none; }
.html-editor-surface > :first-child { margin-top: 0; }
.html-editor-surface:empty::before { content: attr(data-placeholder); color: var(--muted-foreground); }
.html-editor-surface img { max-width: 100%; height: auto; }
.html-editor-surface iframe { max-width: 100%; pointer-events: none; }
.html-editor > .textarea { display: block; width: 100%; border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.html-editor > .textarea:focus { outline: none; box-shadow: none; }
.html-editor > .image-field { display: none; }

/* ---- Side tabs (0.37): one choice of several, when a reader needs only one of them (the shop of a product, say).
   Basecoat tabs with a vertical tablist: .tabs.side-tabs > nav[role=tablist][aria-orientation=vertical] >
   button[role=tab] (span + optional .tab-count) + div[role=tabpanel]. A tab with content carries data-set: its count
   shows in the brand colour. On a phone the tabs sit in one row above the panel. ---- */
.side-tabs { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); gap: var(--space-24); align-items: start; }
.side-tabs > [role="tablist"] { display: flex; flex-direction: column; gap: 2px; width: auto; height: auto; padding: 0 var(--space-12) 0 0; margin: 0;
  border: 0; border-right: 1px solid var(--border); border-radius: 0; background: none; }
.side-tabs > [role="tablist"] > [role="tab"] { display: flex; justify-content: space-between; align-items: center; gap: var(--space-8); width: 100%; height: auto;
  padding: var(--space-8) var(--space-10); border: 0; border-radius: calc(var(--radius) - 2px); background: none; box-shadow: none; cursor: pointer;
  font: 400 var(--text-14)/1.3 var(--font-sans); color: var(--muted-foreground); text-align: left; }
.side-tabs > [role="tablist"] > [role="tab"]:hover { color: var(--foreground); background: var(--accent); }
.side-tabs > [role="tablist"] > [role="tab"][aria-selected="true"] { color: var(--foreground); background: var(--accent); font-weight: 500;
  box-shadow: inset 2px 0 0 var(--primary); }
.side-tabs .tab-count { font: 400 var(--text-12)/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.side-tabs [role="tab"][data-set] .tab-count { color: var(--brand); }
.side-tabs > [role="tabpanel"] { padding: 0; min-width: 0; }
.side-tabs > [role="tabpanel"] > :first-child { margin-top: 0; }
/* 0.51: the parts of a side-tab panel and a nested row of tabs keep a gap above and below. */
.side-tabs > [role="tabpanel"] > * + * { margin-top: var(--space-16); }
.side-tabs > [role="tabpanel"] .tabs:not(.side-tabs) { margin-block: var(--space-8); }
.side-tabs > [role="tabpanel"] > .tabs:not(.side-tabs):first-child { margin-top: 0; }
@media (max-width: 700px) {
  .side-tabs { grid-template-columns: minmax(0, 1fr); gap: var(--space-16); }
  .side-tabs > [role="tablist"] { flex-direction: row; overflow-x: auto; padding: 0 0 var(--space-8); border-right: 0; border-bottom: 1px solid var(--border); }
  .side-tabs > [role="tablist"] > [role="tab"] { width: auto; flex: none; }
  .side-tabs > [role="tablist"] > [role="tab"][aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--primary); }
}
/* A field's description (0.37): .field > label + control + p.note, one short line under the control. */
.field > .note { margin: 2px 0 0; font-size: var(--text-13); line-height: 1.45; }

/* ---- Disclosure (0.37.3): optional settings, closed until someone wants them. details.disclosure > summary (the
   topic and a count) + content. The same chevron as the lesson list of a module. A shortcode menu outside the editor
   bar is a small outlined button. ---- */
.disclosure { margin: var(--space-8) 0; }
.disclosure > summary { list-style: none; display: inline-flex; align-items: center; gap: var(--space-8); padding: 6px 0; cursor: pointer; user-select: none;
  font-size: var(--text-14); color: var(--muted-foreground); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: ""; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease-out, margin .15s ease-out; }
.disclosure[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.disclosure > summary:hover, .disclosure > summary:focus-visible { color: var(--foreground); }
.disclosure[open] > summary { margin-bottom: var(--space-10); }
.shortcode-menu > summary { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--space-10); cursor: pointer;
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); font: 400 var(--text-13)/1 var(--font-sans); color: var(--muted-foreground); background: none; }
.shortcode-menu > summary:hover, .shortcode-menu[open] > summary { color: var(--foreground); background: var(--accent); }
.shortcode-menu > summary svg { width: 15px; height: 15px; }

/* ---- Lesson page (0.38): video first, then a short head, then the lesson in tabs. ----
   Head: .lesson-head > .eyebrow + h1.display + .lesson-meta (spans; a .btn may close the row). ---- */
.lesson-head { margin: var(--space-20) 0 var(--space-24); }
.lesson-head .display { margin: 6px 0 0; }
.lesson-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-14); margin-top: var(--space-12); font-size: var(--text-13); color: var(--muted-foreground); }
.lesson-meta > span + span::before { content: "·"; margin-right: var(--space-14); }
.lesson-meta > .btn { margin-left: auto; }
.lesson-meta > .btn + .btn { margin-left: 0; }
.lesson-head .lead { margin: var(--space-20) 0 0; }
@media (max-width: 640px) { .lesson-meta > .btn { margin-left: 0; } }

/* Chapters (0.38): a bar under the video, one segment per chapter, as wide as the chapter is long. A segment seeks the
   video. ol.chapter-bar > li[data-current]? (flex-grow from the length, data-driven) > button[data-seek="197"] >
   span.chapter-track > span.chapter-fill (width set by dist/lesson.js) + span.chapter-label > b (a, b, c) + span.chapter-clock + span.chapter-title. */
.chapter-bar { list-style: none; display: flex; gap: 6px; margin: var(--space-10) 0 0; padding: 0; }
.chapter-bar > li { flex: 1 1 0; min-width: 26px; overflow: hidden; container-type: inline-size; }
.chapter-bar button { display: grid; gap: 7px; width: 100%; padding: 4px 0; border: 0; background: none; color: var(--muted-foreground); cursor: pointer; text-align: left; font: inherit; }
.chapter-track { display: block; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.chapter-fill { display: block; width: 0; height: 100%; background: var(--primary); transition: width .3s linear; }
.chapter-label { display: flex; align-items: center; gap: 6px; min-width: 0; font: 400 var(--text-12)/1.2 var(--font-sans); font-variant-numeric: tabular-nums; }
.chapter-label b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border: 1px solid transparent;
  border-radius: 4px; font-weight: 500; color: inherit; }
.chapter-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-sans); }
.chapter-bar button:hover .chapter-label, .chapter-bar li[data-current] .chapter-label { color: var(--foreground); }
.chapter-bar li[data-current] .chapter-label b { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
@media (max-width: 640px) { .chapter-title { display: none; } }
/* 0.57.10: a segment drops its parts by its own width, never cut mid-word: under 150px no title, under 72px no time,
   only the letter. The button title keeps time and title for hover. The time is span.chapter-clock. */
.chapter-clock { white-space: nowrap; }
@container (max-width: 150px) { .chapter-title { display: none; } }
@container (max-width: 72px) { .chapter-clock { display: none; } }

/* Lesson tabs (0.38): Basecoat tabs with pill tabs in one scrollable row. .tabs.lesson-tabs > nav[role=tablist] >
   button[role=tab] (text + optional .tab-count) + div[role=tabpanel]. Empty tabs are left out. */
.lesson-tabs { margin-top: var(--space-28); }
.lesson-tabs > [role="tablist"] { display: flex; width: 100%; max-width: 100%; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.lesson-tabs > [role="tablist"] > [role="tab"] { flex: none; gap: 6px; }
.lesson-tabs .tab-count { font: 400 var(--text-12)/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.lesson-tabs > [role="tabpanel"] { padding-top: var(--space-24); min-width: 0; }
/* 0.77: the panel already spaces the text from the tabs, so the lesson text adds no gap of its own; tighter on a phone. */
.lesson-tabs > [role="tabpanel"] > .clamp:first-child .unit-body, .lesson-tabs > [role="tabpanel"] > .unit-body:first-child { margin-top: 0; }
@media (max-width: 640px) { .lesson-tabs { margin-top: var(--space-20); } .lesson-tabs > [role="tabpanel"] { padding-top: var(--space-16); } }

/* Lesson parts (0.38): the fixed end of a lesson. section.lesson-part > h3.lesson-part-label (Do, Think, Land on) +
   content: a .task-list, a list of questions, or p.takeaway, the one sentence to keep. Parts sit between thin lines. */
.lesson-part { padding: var(--space-24) 0; border-top: 1px solid var(--border); }
.lesson-part-label { margin: 0 0 var(--space-12); font: 500 var(--text-13)/1.3 var(--font-sans); color: var(--muted-foreground); }
.lesson-part ol, .lesson-part ul:not(.task-list) { margin: 0; padding-left: 1.3em; list-style: decimal; display: grid; gap: var(--space-8); font: 400 var(--text-19)/1.55 var(--font-serif); }
.lesson-part :is(ol, ul):not(.task-list) > li::marker { color: var(--muted-foreground); }
.takeaway { margin: 0; font: 400 var(--text-21)/1.5 var(--font-subtitle); color: var(--primary); }

/* Task list (0.38): things a member ticks off, saved per member. A box with rows: .task-list-box > .task-list-head
   (h2 + span "1 of 2") + ul.task-list > li > label.task (input[type=checkbox] + span) + optional a.task-go (arrow
   or text link). A ticked task is struck through. Inside a lesson part the box has no head. */
.task-list-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.task-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-12); padding: var(--space-14) var(--space-18); border-bottom: 1px solid var(--border); }
.task-list-head h2 { margin: 0; font: 500 var(--text-15)/1.3 var(--font-sans); color: var(--foreground); }
.task-list-head span { font: 400 var(--text-13)/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.task-list { list-style: none; padding: 0; }
.task-list > li { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--space-18); }
.task-list > li + li { border-top: 1px solid var(--border); }
.task { display: flex; align-items: flex-start; gap: var(--space-12); flex: 1; min-width: 0; cursor: pointer; font-size: var(--text-15); line-height: 1.5; }
.task input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; border-radius: 50%; accent-color: var(--brand); cursor: pointer; }
.task input:checked + span { color: var(--muted-foreground); text-decoration: line-through; text-decoration-color: color-mix(in oklab, currentColor 60%, transparent); }
.task-go { flex: none; display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 var(--space-8); box-sizing: border-box; border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px); font-size: var(--text-13); color: var(--foreground); text-decoration: none; }
.task-go:hover { background: var(--accent); }
.task-go svg { width: 15px; height: 15px; }

/* Long text (0.38): a lesson text taller than about one screen folds to that height with a fade and a button.
   div.clamp > div.clamp-body + button.clamp-toggle (hidden until dist/lesson.js measures; data-open unfolds). */
.clamp-body { position: relative; }
.clamp[data-clamped]:not([data-open]) .clamp-body { max-height: 30rem; overflow: hidden; }
.clamp[data-clamped]:not([data-open]) .clamp-body::after { content: ""; position: absolute; inset: auto 0 0; height: 6rem; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--background)); }
.clamp-toggle { margin-top: var(--space-12); }
.clamp:not([data-clamped]) .clamp-toggle { display: none; }

/* Transcript (0.38): .transcript > .transcript-tools (label with a switch "Follow along" + download links) +
   ol.transcript-lines > li[data-current]? > button.transcript-time[data-seek] + p. With Follow along the line that
   plays stays in view and the other lines step back. Without times the lines are plain paragraphs. */
.transcript-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-10) var(--space-20); margin-bottom: var(--space-20); font-size: var(--text-14); }
.transcript-tools label { display: inline-flex; align-items: center; gap: var(--space-10); color: var(--muted-foreground); cursor: pointer; }
.transcript-tools a { display: inline-flex; align-items: center; gap: 6px; color: var(--foreground); font-weight: 500; text-decoration: none; }
.transcript-tools a:hover { text-decoration: underline; text-underline-offset: 3px; }
.transcript-tools svg { width: 16px; height: 16px; }
.transcript-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-14); }
.transcript-lines > li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--space-12); align-items: baseline; scroll-margin: 30vh 0; }
.transcript-lines > li:not(:has(.transcript-time)) { grid-template-columns: minmax(0, 1fr); }
.transcript-lines p { margin: 0; font: 400 var(--text-17)/1.6 var(--font-serif); transition: color .2s ease-out; }
.transcript-time { padding: 0; border: 0; background: none; font: 400 var(--text-12)/1.6 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); cursor: pointer; text-align: left; }
.transcript-time:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }
.transcript[data-follow] .transcript-lines p { color: var(--muted-foreground); }
/* 0.57.9: with Follow along the lines scroll in their own box, so the page and the video stay in place. */
.transcript[data-follow] .transcript-lines { position: relative; max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; padding-right: var(--space-8); }
.transcript[data-follow] .transcript-lines > li[data-current] p { color: var(--foreground); }
/* 0.57.16: phrases inside a passage (span.transcript-phrase[data-at], from times in brackets in the transcript): the phrase
   that plays gets a highlighter mark; the passage keeps its block. Background only, so no line moves. */
.transcript-phrase { border-radius: 3px; transition: background-color .2s ease-out; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.transcript-phrase[data-current] { background: color-mix(in srgb, var(--brand) 16%, transparent); }
/* 0.57.22: the text of a timed line is a target: a click plays from the phrase (or the line). */
.transcript-lines > li:has(button[data-seek]) > p { cursor: pointer; }
.transcript-lines > li:has(button[data-seek]) > p:not(:has(.transcript-phrase)):hover, .transcript-phrase:not([data-current]):hover {
  background: color-mix(in srgb, var(--foreground) 5%, transparent); border-radius: 3px; }
/* 0.57.21: with phrases the phrase carries the emphasis; the passage around it steps back to a light gray and a gray bar. */
.transcript-lines > li[data-current]:has(.transcript-phrase) { border-left-color: color-mix(in srgb, var(--foreground) 18%, transparent);
  background: color-mix(in srgb, var(--foreground) 3%, transparent); }
.transcript-lines > li[data-current] .transcript-time { color: var(--brand); }
/* 0.57.15: the passage that plays is a marked block (a brand bar and a light tint), not bolder type: bold text
   is wider, rewraps and makes the lines jump. Every timed line keeps the same padding, so nothing moves. */
.transcript-lines > li:has(.transcript-time) { padding: var(--space-8) var(--space-12) var(--space-8) var(--space-10); border-left: 3px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
  transition: background-color .25s ease-out, border-color .25s ease-out; }
.transcript-lines > li[data-current] { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.transcript-lines > li[data-current] p { color: var(--foreground); }

/* Up next (0.38): a card at the end of a lesson. a.up-next > small "Up next" + span.up-next-title (span.num + text) + span.up-next-meta. */
.up-next { display: grid; gap: 4px; margin-top: var(--space-32); padding: var(--space-16) var(--space-20); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  color: inherit; text-decoration: none; transition: border-color .15s ease-out; }
.up-next:hover { border-color: var(--muted-foreground); }
.up-next small { font-size: var(--text-13); color: var(--muted-foreground); }
.up-next-title { font: 500 var(--text-17)/1.35 var(--font-sans); }
.up-next-title .num { margin-right: var(--space-10); font: inherit; font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.up-next-meta { font-size: var(--text-13); color: var(--muted-foreground); }
.up-next-meta::after { content: " →"; }

/* ---- Product page parts (0.38) ----
   Start card: the lesson to start or continue. .start-card > a.start-cover (img or empty + span.start-play) +
   .start-body > .eyebrow + h2 (span.num + text) + .start-meta + a.btn[data-variant=primary] (span.dot + text). */
.start-card { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); margin-bottom: var(--space-32); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); overflow: hidden; }
.start-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--muted); }
.start-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.start-play { position: absolute; left: 16px; bottom: 16px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--card); color: var(--foreground); box-shadow: 0 6px 20px rgb(0 0 0 / calc(.18 * var(--shadow))); }
.start-play svg { width: 20px; height: 20px; margin-left: 3px; }
.start-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-8); padding: var(--space-24); }
.start-body h2 { margin: 0; font: 500 var(--text-22)/1.3 var(--font-sans); color: var(--foreground); }
.start-body h2 .num { margin-right: var(--space-8); color: var(--muted-foreground); font-weight: 400; }
.start-meta { font-size: var(--text-13); color: var(--muted-foreground); }
.start-body .btn { margin-top: var(--space-12); gap: var(--space-10); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.btn[data-variant="primary"] .dot, .btn:not([data-variant]) .dot { background: var(--brand-soft); }
@media (max-width: 760px) { .start-card { grid-template-columns: minmax(0, 1fr); } }

/* Author note (0.38): a short personal line from the author; a member closes it for good. aside.author-note >
   span.author-mark (img or initials) + div (p + strong) + button.author-note-close[aria-label]. */
.author-note { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-16); margin-bottom: var(--space-32); padding: var(--space-20) var(--space-48) var(--space-20) var(--space-20);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.author-note[hidden] { display: none; }
.author-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: calc(var(--radius) - 2px); overflow: hidden; background: var(--brand); color: var(--brand-foreground);
  font: 500 var(--text-14)/1 var(--font-sans); }
.author-mark img { width: 100%; height: 100%; object-fit: cover; }
.author-note p { margin: 0; font-size: var(--text-17); line-height: 1.55; }
.author-note strong { display: block; margin-top: var(--space-10); font-weight: 500; font-size: var(--text-15); }
.author-note-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: var(--muted-foreground); cursor: pointer; }
.author-note-close:hover { background: var(--accent); color: var(--foreground); }
.author-note-close svg { width: 14px; height: 14px; }

/* Index layout of the module list (0.38): a numbered table of contents. .modules[data-layout="index"] >
   .index-head (h2 + span "29 lessons · 4 h 20 min") + details.index-module[data-locked]? (open when its lessons
   show) > summary (span.index-num "01" + div > h2 + p + small.index-opens + the chevron) + ol.index-lessons >
   li[data-current]? > a or div.locked (span.check + span.num "1.2" + span title + span.info).
   A module with one lesson: div.index-module[data-single] with a.index-single (thumbnail, title, length) instead of the list.
   Not yet open: the module steps back, its lessons are titles only. */
.index-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-16); padding-bottom: var(--space-12); border-bottom: 1px solid var(--border); }
.index-head h2 { margin: 0; font: 400 var(--head-26)/1.2 var(--font-subtitle); color: var(--primary); }
.index-head span { font-size: var(--text-13); color: var(--muted-foreground); }
.index-module { border-bottom: 1px solid var(--border); }
.index-module > summary, .index-module > .index-summary { list-style: none; display: grid; grid-template-columns: 52px minmax(0, 1fr) 16px; gap: 4px; align-items: start; padding: var(--space-20) 0; cursor: pointer; }
.index-module > .index-summary { cursor: default; grid-template-columns: 52px minmax(0, 1fr); }
.index-module > summary::-webkit-details-marker { display: none; }
.index-module > summary::after { content: ""; width: 7px; height: 7px; margin-top: var(--space-8); border-right: 1.5px solid var(--muted-foreground); border-bottom: 1.5px solid var(--muted-foreground);
  transform: rotate(45deg); transition: transform .15s ease-out, margin .15s ease-out; }
.index-module[open] > summary::after { margin-top: var(--space-12); transform: rotate(-135deg); }
.index-num { font: 400 var(--text-22)/1.2 var(--font-subtitle); color: var(--muted-foreground); }
.index-module h2 { margin: 0; font: 500 var(--text-17)/1.35 var(--font-sans); color: var(--foreground); }
.index-module summary p, .index-module .index-summary p { margin: 6px 0 0; font-size: var(--text-15); line-height: 1.55; color: var(--muted-foreground); }
.index-opens { display: block; margin-top: 6px; font-size: var(--text-13); color: var(--muted-foreground); }
.index-module[data-locked] h2, .index-module[data-locked] .index-num { color: var(--muted-foreground); }
.index-lessons { list-style: none; margin: 0 0 var(--space-16); padding: 0; }
.index-lessons > li > a, .index-lessons > li > .locked { display: grid; grid-template-columns: 22px 36px minmax(0, 1fr) auto; gap: var(--space-8); align-items: baseline; padding: var(--space-10) var(--space-8) var(--space-10) 0;
  border-radius: calc(var(--radius) - 2px); color: inherit; text-decoration: none; font-size: var(--text-16); line-height: 1.45; }
.index-lessons > li > a:hover { background: var(--accent); }
.index-lessons > li[data-current] > a { background: var(--accent); }
.index-lessons .check { align-self: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); box-sizing: border-box; display: grid; place-items: center; }
.index-lessons .check[data-done] { background: var(--brand); border-color: var(--brand); color: var(--brand-foreground); }
.index-lessons .check svg { width: 10px; height: 10px; }
.index-lessons li[data-current] .check:not([data-done]) { border: 0; background: radial-gradient(circle, var(--brand) 0 3.5px, transparent 4px); }
.index-lessons .num { font: 400 var(--text-13)/1.45 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
/* 0.88.0: ol.index-lessons[data-unnumbered]: no span.num, the title moves into its column. */
.index-lessons[data-unnumbered] > li > a, .index-lessons[data-unnumbered] > li > .locked { grid-template-columns: 22px minmax(0, 1fr) auto; }
.index-lessons .info { font-size: var(--text-13); color: var(--muted-foreground); white-space: nowrap; }
.index-lessons .locked { color: var(--muted-foreground); }
.index-lessons .locked .check { border-color: transparent; }
.index-single { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--space-16); align-items: center; margin: 0 0 var(--space-20) var(--space-52); color: inherit; text-decoration: none; }
.index-single .cover { aspect-ratio: 16 / 9; border-radius: calc(var(--radius) - 2px); overflow: hidden; background: var(--muted); }
.index-single .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.index-single span { display: block; font-size: var(--text-13); color: var(--muted-foreground); }
.index-single strong { font-weight: 500; }
.index-single:hover strong { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .index-single { margin-left: 0; grid-template-columns: 120px minmax(0, 1fr); } }

/* Product sections (0.38): a membership shows each included product as a section of its own page, under its title
   (Welcome, the main course, Bonus). section.product-section > .block-head (h2) + the module list of that product. */
.product-section { margin-top: var(--space-56); }
.product-section > .block-head h2 { margin: 0; font: 400 var(--head-28)/1.2 var(--font-display); color: var(--primary); }
/* On a product page the checklist keeps the same distance to the module list as the start card. */
.product-header ~ .task-list-box { margin-bottom: var(--space-40); }

/* ---- Progress and game (0.39): points, level, a weekly streak and badges. Calm, not loud: no confetti, no ranking.
   Progress card: .game-card > .game-level (span.eyebrow "Level 3" + strong points + .progress + small "60 to level 4") +
   .game-streak (svg + strong "3 weeks in a row" + .week-dots) + optional .medal-row. On the dashboard it sits in the aside. ---- */
.game-card { display: grid; align-self: start; align-content: start; gap: var(--space-18); padding: var(--space-20); margin-bottom: var(--space-32); border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
/* Below other content (the dates of the dashboard aside) the card keeps a section gap (0.45.3). */
* + .game-card { margin-top: var(--space-32); }
.game-card > * + * { padding-top: var(--space-18); border-top: 1px solid var(--border); }
.game-level { display: grid; gap: 6px; }
.game-level strong { font: 400 var(--head-30)/1.1 var(--font-display); color: var(--primary); }
.game-level small, .game-streak small { font-size: var(--text-13); color: var(--muted-foreground); }
.game-level .progress { height: 4px; margin-top: 4px; }
.game-streak { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px var(--space-10); align-items: center; }
.game-streak > svg { width: 22px; height: 22px; color: var(--brand); }
.game-streak strong { font-weight: 500; font-size: var(--text-15); }
.game-streak .week-dots, .game-streak small { grid-column: 2; }
.game-card a.game-more { font-size: var(--text-13); color: var(--muted-foreground); }
/* Week dots: Monday to Sunday of this week. ol.week-dots > li[data-active]? [data-today]? > span (the letter, visually hidden text in title). */
.week-dots { list-style: none; display: flex; gap: 6px; margin: 4px 0 0; padding: 0; }
.week-dots li { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); font: 400 var(--text-11)/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.week-dots li[data-active] { background: var(--brand); border-color: var(--brand); color: var(--brand-foreground); }
.week-dots li[data-today]:not([data-active]) { border-color: var(--brand); color: var(--brand); }

/* Medals (badges): a round mark with the brand colour; a medal not earned yet is an outline and shows how to earn it.
   .medal[data-locked]? > span.medal-mark (svg) + strong + small. .medal-grid holds many, .medal-row a few small ones. */
.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-12); }
.medal { display: grid; justify-items: center; gap: 6px; padding: var(--space-18) var(--space-12); text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.medal-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: var(--brand-foreground);
  box-shadow: inset 0 0 0 3px color-mix(in oklab, var(--brand-foreground) 30%, transparent); }
.medal-mark svg { width: 24px; height: 24px; }
.medal strong { font-weight: 500; font-size: var(--text-14); line-height: 1.3; }
.medal small { font-size: var(--text-12); line-height: 1.4; color: var(--muted-foreground); }
.medal[data-locked] { background: none; }
.medal[data-locked] .medal-mark { background: none; color: var(--muted-foreground); box-shadow: inset 0 0 0 1.5px var(--border); }
.medal[data-locked] strong { color: var(--muted-foreground); }
.medal-row { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.medal-row .medal-mark { width: 34px; height: 34px; }
.medal-row .medal-mark svg { width: 16px; height: 16px; }
/* Compact medals (0.45): .medal-grid[data-compact] puts the mark left of the text, for a full-width list of badges. */
.medal-grid[data-compact] { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-8); }
.medal-grid[data-compact] .medal { grid-template-columns: 36px minmax(0, 1fr); justify-items: start; align-items: center; align-content: center; gap: 2px var(--space-12); padding: var(--space-12) var(--space-14); text-align: left; }
.medal-grid[data-compact] .medal-mark { grid-row: span 2; width: 36px; height: 36px; }
.medal-grid[data-compact] .medal-mark svg { width: 18px; height: 18px; }
/* Wide progress card (0.45): .game-card[data-wide] runs across the page with its parts side by side. */
.game-card[data-wide] { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-24); }
.game-card[data-wide] > * + * { padding-top: 0; border-top: 0; padding-left: var(--space-24); border-left: 1px solid var(--border); }
@media (max-width: 720px) { .game-card[data-wide] > * + * { padding: var(--space-18) 0 0; border-left: 0; border-top: 1px solid var(--border); } }

/* Activity: what earned points lately. ul.activity-list > li > span (text) + small (when) + span.points "+10". */
.activity-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.activity-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-16); padding: var(--space-10) 0; border-bottom: 1px solid var(--border); font-size: var(--text-15); }
.activity-list small { grid-column: 1; font-size: var(--text-12); color: var(--muted-foreground); }
.activity-list .points { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: 500 var(--text-13)/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--brand); }

/* Earned (toast): one short sentence after an action, plus the points when there are any; bottom centre, gone after a
   few seconds (dist/game.js). div.earned-toast[role=status] > span.medal-mark (small) + div (strong + small, the points;
   an empty small hides). */
.earned-toast { position: fixed; left: 50%; bottom: 20px; z-index: 60; display: flex; gap: var(--space-10); align-items: center;
  width: max-content; max-width: calc(100vw - 32px); padding: var(--space-8) var(--space-16) var(--space-8) var(--space-8); border: 1px solid var(--border); border-radius: 999px; background: var(--popover);
  color: var(--popover-foreground); box-shadow: 0 10px 30px rgb(0 0 0 / calc(.12 * var(--shadow))); transform: translate(-50%, 12px); opacity: 0; transition: transform .25s ease-out, opacity .25s ease-out; }
.earned-toast[data-show] { transform: translate(-50%, 0); opacity: 1; }
.earned-toast .medal-mark { flex: none; width: 28px; height: 28px; }
.earned-toast .medal-mark svg { width: 14px; height: 14px; }
.earned-toast > div { display: flex; gap: var(--space-8); align-items: baseline; min-width: 0; }
.earned-toast strong { font-weight: 500; font-size: var(--text-14); }
.earned-toast small { flex: none; font-size: var(--text-13); font-weight: 500; color: var(--brand); font-variant-numeric: tabular-nums; }
.earned-toast small:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .earned-toast { transition: none; } }

/* Connection box (0.39): how a member connects an own AI agent. Uses .prompt for the command. */
.connect-steps { margin: 0; padding-left: var(--space-20); display: grid; gap: 6px; font-size: var(--text-15); list-style: decimal; }

/* Block editor (0.41): the blocks of a page as cards (dist/block-editor.js). ol.block-list > li.block-card >
   .block-card-head (sort handle, type, preview, icon buttons) + .block-card-body (.form-grid, details.block-card-more
   with the settings every block has). A closed card [data-closed] shows only its head. List fields: .block-items >
   .block-item cards inside the body. The foot holds the button that opens the type dialog (.block-types). */
.block-editor { display: grid; gap: var(--space-12); }
.block-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-12); }
.block-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.block-card[data-dragging] { position: relative; z-index: 2; box-shadow: 0 8px 24px rgb(0 0 0 / calc(.12 * var(--shadow))); }
.block-card-head { display: grid; grid-template-columns: 24px auto minmax(0, 1fr) auto; gap: var(--space-10); align-items: center; padding: var(--space-8) var(--space-8) var(--space-8) var(--space-12); }
.block-card-head strong { font: 400 var(--text-18)/1.3 var(--font-subtitle); color: var(--primary); }
.block-card-preview { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--text-14); color: var(--muted-foreground); }
.block-card-head .row { gap: 2px; flex-wrap: nowrap; }
.block-card-head .btn { color: var(--muted-foreground); }
.block-card-head .btn:hover { color: var(--foreground); }
.block-card .sort-handle { opacity: 1; cursor: grab; }
.block-card .sort-handle { touch-action: none; }
.block-card[data-dragging] { user-select: none; }
.block-card-head strong, .block-card-preview { cursor: pointer; }
.block-card-body { padding: 4px var(--space-16) var(--space-16); border-top: 1px solid var(--border); display: grid; gap: var(--space-16); padding-top: var(--space-16); }
.block-card[data-closed] .block-card-body { display: none; }
.block-card[data-closed] [data-act="toggle"] svg { transform: rotate(-90deg); }
.block-card-more > summary { cursor: pointer; font-size: var(--text-13); color: var(--muted-foreground); }
.block-card-more[open] > summary { margin-bottom: var(--space-12); }
.block-items-wrap { display: grid; gap: var(--space-8); justify-items: start; }
.block-items { display: grid; gap: var(--space-8); width: 100%; }
.block-item { border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); padding: var(--space-8) var(--space-12) var(--space-12); background: var(--muted); }
.block-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-8); font-size: var(--text-12); color: var(--muted-foreground); }
.block-item-head .row { gap: 2px; }
.block-item-head { justify-content: flex-start; gap: 6px; }
.block-item-head .mono { flex: 1; }
.block-item[data-dragging] { position: relative; z-index: 2; user-select: none; box-shadow: 0 8px 24px rgb(0 0 0 / calc(.12 * var(--shadow))); }
.block-editor-foot { display: flex; gap: var(--space-12); align-items: center; }
/* Export and import (0.42): icon buttons top right of the editor. .block-editor-tools > button.btn[data-variant=ghost]
   [data-size=icon] (download, copy, import); after an export the button shows a check for a moment (svg.icon-done). */
.block-editor-tools { display: flex; justify-content: flex-end; gap: 2px; margin-bottom: -4px; }
.block-editor-tools .btn { color: var(--muted-foreground); }
.block-editor-tools .btn:hover { color: var(--foreground); }
.block-editor-tools .icon-done, .block-editor-tools [data-done] .icon-main { display: none; }
.block-editor-tools [data-done] .icon-done { display: inline; }
/* 0.52: an editor with tabs (Text, Blocks, Source) puts the tools on the right of its tab row:
   .tabs.editor-tabs > nav[role=tablist] + .block-editor-tools#<id>, the editor root with data-tools="<id>". The tab
   row keeps a larger gap to the fields above, so it reads as the head of the content below. */
.tabs.editor-tabs { position: relative; margin-top: var(--space-32); }
.tabs.editor-tabs > .block-editor-tools { position: absolute; top: 0; right: 0; height: 36px; align-items: center; margin: 0; }
.import-dialog textarea { width: 100%; min-height: 220px; }
.import-dialog .drop-line { display: flex; gap: var(--space-12); align-items: center; margin-top: var(--space-12); font-size: var(--text-14); color: var(--muted-foreground); }
/* Lock (0.44): the text editor of a page while the page has blocks. .blocks-lock > .alert (with
   button[data-blocks-clear]) + .blocks-lock-body; data-locked dims the body, block-editor.js makes it inert. */
.blocks-lock > .alert { margin-bottom: var(--space-16); }
.blocks-lock > .alert .btn { margin-top: var(--space-10); justify-self: start; width: fit-content; grid-column: 1 / -1; }
.blocks-lock[data-locked] .blocks-lock-body { opacity: .45; }
.block-editor[data-empty] .block-list::before { content: attr(data-empty-text); font-size: var(--text-14); color: var(--muted-foreground); }
.block-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
.block-type { display: grid; gap: 2px; align-content: start; text-align: left; padding: var(--space-10) var(--space-12); border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
  background: var(--card); color: inherit; font: inherit; cursor: pointer; }
.block-type:hover { border-color: var(--muted-foreground); }
.block-type strong { font-size: var(--text-14); font-weight: 500; color: var(--primary); }
.block-type span { font-size: var(--text-12); line-height: 1.45; color: var(--muted-foreground); }
@media (max-width: 700px) {
  .block-types { grid-template-columns: 1fr; }
  .block-card-head { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .block-card-preview { display: none; }
}

/* Install banner (0.48): mobile only, fixed above the bottom edge. .install-banner[hidden] > p + .row (button.btn + close icon button). */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 15; display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12) var(--space-14);
                  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg, 10px); box-shadow: 0 8px 24px color-mix(in srgb, var(--foreground) calc(14% * var(--shadow)), transparent); }
.install-banner[hidden] { display: none; }
.install-banner p { flex: 1; min-width: 0; margin: 0; font-size: var(--text-14); line-height: 1.35; }
.install-banner .row { flex: none; flex-wrap: nowrap; }
@media (min-width: 901px) { .install-banner { display: none; } }

/* Lesson on a phone held upright (0.48): the video and the tab row stay on screen while the panel scrolls. */
@media (max-width: 640px) and (orientation: portrait) {
  .unit-page { --lesson-top: 89px; }
  .unit-page:has(> .video) { --lesson-tabs-top: calc(var(--lesson-top) + 100vw * 9 / 16); }
  /* The pinned video runs edge to edge (0.57.25): no side gap and no round corners for the text to show through. */
  .unit-page > .video { position: sticky; top: var(--lesson-top); z-index: 4; background: var(--background);
                        margin-inline: -20px; border-inline: 0; border-radius: 0; }
  .lesson-tabs > [role="tablist"] { position: sticky; top: var(--lesson-tabs-top, var(--lesson-top)); z-index: 3; background: var(--background); padding-block: var(--space-8);
                                    box-shadow: -20px 0 0 var(--background), 20px 0 0 var(--background); }
}
/* A lesson title on a phone (0.57.25): smaller than the page display size. */
@media (max-width: 640px) { .lesson-head .display { font-size: calc(clamp(26px, 7.5vw, 30px) * var(--text-scale) * var(--heading-scale)); } }

/* Video overlays (0.49). Chapters: .video > button.chapter-toggle + div.chapter-panel[hidden] > button[data-seek] (span title +
   small length + time). End screen: .video > div.video-end[hidden] > small + strong + .row. Both sit on a dark scrim, so
   they read over any picture. */
.chapter-toggle { position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0;
                  border-radius: 50%; background: color-mix(in srgb, var(--image-scrim) 72%, transparent); color: var(--on-image); cursor: pointer; }
.chapter-toggle svg { width: 18px; height: 18px; }
.chapter-panel { position: absolute; top: 54px; right: 10px; bottom: 10px; z-index: 3; width: min(340px, calc(100% - 20px)); overflow-y: auto; padding: 6px; border-radius: 10px;
                 background: color-mix(in srgb, var(--image-scrim) 92%, transparent); color: var(--on-image); }
.chapter-panel[hidden] { display: none; }
.chapter-panel button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-12); width: 100%; padding: var(--space-8) var(--space-10); border: 0; border-radius: 6px; background: none;
                        color: inherit; font: inherit; font-size: var(--text-14); line-height: 1.3; text-align: left; cursor: pointer; }
.chapter-panel button:hover, .chapter-panel button[data-current] { background: color-mix(in srgb, var(--on-image) 14%, transparent); }
.chapter-panel small { grid-column: 1; font-size: var(--text-12); opacity: .7; }
.chapter-panel .num { grid-column: 2; grid-row: 1; font: 400 var(--text-12)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; opacity: .8; }
.video-end { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: var(--space-10); padding: var(--space-16); text-align: center;
             background: color-mix(in srgb, var(--image-scrim) 86%, transparent); color: var(--on-image); }
.video-end[hidden] { display: none; }
.video-end small { font: 400 var(--text-12)/1.4 var(--font-sans); font-variant-numeric: tabular-nums; opacity: .8; }
.video-end strong { max-width: 34em; font-size: var(--text-17); font-weight: 500; line-height: 1.3; }
.video-end .num { margin-right: var(--space-8); opacity: .7; }
.video-end .btn[data-variant="ghost"] { color: inherit; }

/* Sources of a lesson (0.49): ol.lesson-sources of plain links, numbered, like a bibliography. */
.lesson-sources a { overflow-wrap: anywhere; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* Lesson head (0.49.2): a draft pill sits inline with the title; div.lesson-step keeps back and next together, right of the facts. */
.lesson-head h1 .badge { margin-left: var(--space-10); vertical-align: middle; }
/* 0.57.23: the head line names the module only (the outline already shows the lesson number); a draft pill sits
   inline at its end, in the badge's own type. */
.lesson-head .eyebrow .badge { margin-left: var(--space-10); vertical-align: middle; letter-spacing: normal; text-transform: none; }
.lesson-meta > .lesson-step { display: flex; flex-wrap: nowrap; gap: var(--space-8); margin-left: auto; }
@media (max-width: 640px) { .lesson-meta > .lesson-step { margin-left: 0; width: 100%; } }
/* 0.59.1: bookmark a lesson. div.lesson-step starts with form[data-bookmark] > button.btn.bookmark-toggle[aria-pressed]
   (outline, sm, the bookmark icon only); pressed, the icon fills in the brand color. In the app header a ghost icon link
   left of the user menu opens the bookmarks; on that page it carries aria-current. */
.lesson-step > form { display: flex; margin: 0; }
.bookmark-toggle { padding-inline: var(--space-8); }
.bookmark-toggle svg { width: 16px; height: 16px; transition: fill .15s ease-out; }
.bookmark-toggle[aria-pressed="true"] { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.bookmark-toggle[aria-pressed="true"] svg { fill: currentColor; }
.app-header a.btn[aria-current="page"] { background: var(--accent); color: var(--foreground); }

/* ---- Course outline (0.53): the sidebar of a lesson. .app-shell[data-outline] > .app-sidebar > .wordmark +
   nav.course-outline > .outline-head (a.outline-product + button.outline-collapse[data-sidebar-toggle]) +
   .outline-progress (span with strong + .progress) + details.outline-module (summary > .outline-module-text (small,
   strong, small) + .outline-count; ol.outline-units > li > a.outline-unit[aria-current][data-done] or
   span.outline-unit[data-locked] (.check, .num, .title, .meta) + ol.outline-chapters > li > button[data-seek]
   (.letter, .title, .meta)). The playing chapter carries data-current (lesson.js). On a wide screen the toggle hides
   the sidebar (.app-shell[data-sidebar-closed], app-shell.js) and the menu button brings it back. ---- */
/* Only on a wide screen: below 901px the shell has one column, and the outline opens from the menu button. */
@media (min-width: 901px) { .app-shell[data-outline] { grid-template-columns: 300px minmax(0, 1fr); } }
.app-shell[data-outline] .app-sidebar { padding: var(--space-20) var(--space-12) var(--space-32); gap: 0; }
.course-outline { display: flex; flex-direction: column; gap: 4px; }
.outline-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding: 0 4px 0 var(--space-10); }
.outline-product { font: 500 var(--text-16)/1.3 var(--font-sans); color: var(--foreground); text-decoration: none; }
.outline-product:hover { text-decoration: underline; text-underline-offset: 3px; }
.outline-collapse { flex: none; color: var(--muted-foreground); }
.outline-progress { display: grid; gap: var(--space-8); padding: var(--space-8) var(--space-10) var(--space-16); margin-bottom: var(--space-8); border-bottom: 1px solid var(--border);
  font-size: var(--text-13); color: var(--muted-foreground); }
.outline-progress strong { color: var(--foreground); font-weight: 500; }
.outline-progress .progress { height: 4px; }
.outline-module > summary { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-8); padding: var(--space-10);
  border-radius: 6px; cursor: pointer; list-style: none; }
.outline-module > summary::-webkit-details-marker { display: none; }
.outline-module > summary:hover { background: var(--accent); }
.outline-module > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 6px 2px 0 0; border: solid var(--muted-foreground);
  border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .15s; }
.outline-module[open] > summary::after { transform: rotate(-135deg); margin-top: var(--space-9); }
.outline-module-text { display: grid; gap: 2px; min-width: 0; }
.outline-module-text small { font-size: var(--text-12); color: var(--muted-foreground); }
.outline-module-text strong { font-weight: 500; font-size: var(--text-14); line-height: 1.35; color: var(--foreground); }
.outline-count { margin-left: auto; font: 400 var(--text-12)/1.6 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.outline-units, .outline-chapters { list-style: none; margin: 0; padding: 0; }
.outline-units { display: grid; gap: 1px; padding-bottom: var(--space-8); }
.outline-unit { display: grid; grid-template-columns: 18px 30px minmax(0, 1fr) auto; align-items: start; gap: var(--space-8); padding: 7px var(--space-10);
  border-radius: 6px; font-size: var(--text-13); line-height: 1.4; color: var(--muted-foreground); text-decoration: none; }
a.outline-unit:hover { background: var(--accent); color: var(--foreground); }
.outline-unit[aria-current="page"] { background: var(--accent); color: var(--foreground); font-weight: 500; }
.outline-unit[data-locked] { opacity: .55; }
/* 0.53.1: a product without progress (.course-outline[data-plain]) has no done marks; its lessons have no .check. */
.course-outline[data-plain] .outline-unit { grid-template-columns: 30px minmax(0, 1fr) auto; }
.course-outline[data-plain] .outline-chapters { margin-left: var(--space-10); }
/* 0.88.0: lessons without numbers (a product setting): [data-unnumbered] drops the column of span.num "1.2". */
.course-outline[data-unnumbered] .outline-unit { grid-template-columns: 18px minmax(0, 1fr) auto; }
.course-outline[data-unnumbered][data-plain] .outline-unit { grid-template-columns: minmax(0, 1fr) auto; }
.outline-unit .check { width: 16px; height: 16px; margin-top: 1px; border: 1px solid var(--border); border-radius: 50%; box-sizing: border-box; position: relative; }
.outline-unit[data-done] .check { background: var(--brand); border-color: var(--brand); }
.outline-unit[data-done] .check::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 3.5px; height: 7px;
  border: solid var(--brand-foreground); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.outline-unit .num, .outline-unit .meta, .outline-chapters .meta { font: 400 var(--text-12)/1.6 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.outline-unit .meta, .outline-chapters .meta { white-space: nowrap; }
.outline-chapters { display: grid; gap: 1px; margin: 2px 0 6px var(--space-19); padding-left: var(--space-12); border-left: 1px solid var(--border); }
.outline-chapters button { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: start; gap: var(--space-8); width: 100%; padding: 6px var(--space-8);
  border: 0; border-radius: 6px; background: none; font: inherit; font-size: var(--text-13); line-height: 1.4; color: var(--muted-foreground); text-align: left; cursor: pointer; }
.outline-chapters button:hover { background: var(--accent); color: var(--foreground); }
.outline-chapters .letter { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--muted);
  font: 500 var(--text-11)/1 var(--font-sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.outline-chapters button[data-current] { color: var(--foreground); }
.outline-chapters button[data-current] .letter { background: var(--primary); color: var(--primary-foreground); }
@media (min-width: 901px) {
  .app-shell[data-sidebar-closed] { grid-template-columns: minmax(0, 1fr); }
  .app-shell[data-sidebar-closed] .app-sidebar { display: none; }
  .app-shell[data-sidebar-closed] .menu-toggle { display: inline-flex; }
}
@media (max-width: 900px) { .outline-collapse { display: none; } }

/* ---- Keyboard shortcuts (0.53): .shortcut-legend under the lesson (dl > div > dt + dd > kbd.kbd, then
   button.shortcut-all) and dl.shortcut-list in dialog#shortcuts. Hidden on touch screens. dist/shortcuts.js. ---- */
.shortcut-legend { margin-top: var(--space-24); max-width: 360px; font-size: var(--text-14); }
.shortcut-legend dl, .shortcut-list { display: grid; gap: var(--space-10); margin: 0; }
.shortcut-legend dl > div, .shortcut-list > div { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); }
.shortcut-legend dt, .shortcut-list dt { color: var(--muted-foreground); }
.shortcut-legend dd, .shortcut-list dd { display: flex; gap: 4px; margin: 0; }
.shortcut-all { display: inline-flex; align-items: center; gap: var(--space-8); margin-top: var(--space-14); padding: 0; border: 0; background: none;
  font: inherit; color: var(--foreground); cursor: pointer; }
.shortcut-all:hover { text-decoration: underline; text-underline-offset: 3px; }
/* 0.57.13: beside the video the legend is details.shortcut-legend[data-at-video] > summary ("Shortcuts" + chevron) +
   div.shortcut-row > dl + button.shortcut-all, placed in the free space right of the lesson column, top-aligned with
   the video. Folded, only the summary stays, so a member who knows the keys can still look again; the app keeps the
   state. Where that space is missing it is hidden: "?" still opens the full list. Since 0.57.23 a lesson without a
   video shows it too, beside its head, with the lesson keys only. */
.shortcut-legend[data-at-video] { display: none; }
@media (min-width: 1480px) and (hover: hover) {
  .unit-page:has(> .shortcut-legend[data-at-video]) { position: relative; }
  .shortcut-legend[data-at-video] { display: block; position: absolute; top: 0; left: calc(100% + 40px); width: 220px; margin: 0; font-size: var(--text-13); }
  .shortcut-legend[data-at-video] > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border); color: var(--muted-foreground); font-weight: 500; cursor: pointer; list-style: none; }
  .shortcut-legend[data-at-video] > summary::-webkit-details-marker { display: none; }
  .shortcut-legend[data-at-video] > summary::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border: solid currentColor;
    border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .15s ease-out; }
  .shortcut-legend[data-at-video][open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
  .shortcut-legend[data-at-video] > summary:hover { color: var(--foreground); }
  .shortcut-legend[data-at-video] .shortcut-row { margin-top: var(--space-12); }
}
@media (hover: none) { .shortcut-legend { display: none; } }
/* 0.59.0: div.unit-side > div.unit-side-inner holds the legend and the notes card, at the place of the notes under the
   lesson. Where the legend shows (1480px and a mouse) the side sits right of the lesson column, top-aligned with the
   video, and its content stays in view below the header while the lesson scrolls: the notes are always at hand. Elsewhere
   it is a plain block, so the notes stay under the lesson. */
@media (min-width: 1480px) and (hover: hover) {
  .unit-page:has(> .unit-side) { position: relative; }
  .unit-side { position: absolute; top: 0; bottom: 0; left: calc(100% + 40px); width: 260px; }
  .unit-side-inner { position: sticky; top: 84px; display: grid; gap: var(--space-28); }
  .unit-side .shortcut-legend[data-at-video] { position: static; width: auto; }
  .unit-side .notes-card { margin-top: 0; }
  .unit-side .notes-card > summary { flex-wrap: wrap; padding: var(--space-12) var(--space-14); font-size: var(--text-14); }
  .unit-side .notes-card .notes-body { padding: 0 var(--space-14) var(--space-14); }
  .unit-side .notes-input { min-height: 220px; max-height: calc(100vh - 300px); font-size: var(--text-15); }
}

/* Glossary (0.55): terms in a lesson text and the glossary page.
   In a text: dfn.gloss[data-gloss=slug][tabindex=0][aria-describedby] marks the first mention of a term; a dotted line
   under it. Its card sits in .gloss-cards[data-theme="card|compact|brand"] > .gloss-card[role=tooltip][hidden] >
   span.gloss-group + strong.gloss-title + span.gloss-aliases + p.gloss-text + p.gloss-example + a.gloss-more.
   dist/glossary.js shows the card on hover, focus or tap, below the word (above it when there is no room).
   card: the full card with group and example; compact: a small dark tooltip with the text only; brand: the soft brand
   colour with a brand rule on the left.
   The page: .glossary-nav (letters and groups as a.badge, the chosen one data-active) + section.glossary-letter >
   h2.display + dl.glossary-list > div[id] > dt (strong + small aliases + span.badge group) + dd (p + p.gloss-example). */
dfn.gloss { font-style: inherit; text-decoration: underline dotted var(--muted-foreground); text-decoration-thickness: 1.5px;
  text-underline-offset: 3px; cursor: help; border-radius: 2px; }
dfn.gloss:hover, dfn.gloss[aria-expanded="true"] { text-decoration-color: var(--primary); background: var(--accent); }
dfn.gloss:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.gloss-card { position: fixed; z-index: 60; width: min(340px, calc(100vw - 24px)); padding: var(--space-16) var(--space-18); border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--popover); color: var(--popover-foreground); box-shadow: 0 12px 32px -12px rgb(0 0 0 / calc(.25 * var(--shadow)));
  font: 400 var(--text-14)/1.55 var(--font-sans); text-align: left; }
.gloss-card[hidden] { display: none; }
.gloss-group { display: block; margin-bottom: 4px; font: 500 var(--text-13)/1.4 var(--font-sans); color: var(--muted-foreground); }
.gloss-title { font: 400 var(--text-19)/1.3 var(--font-subtitle); color: var(--primary); }
.gloss-aliases { margin-left: 6px; font-size: var(--text-13); color: var(--muted-foreground); }
.gloss-text { margin: 6px 0 0; }
.gloss-example { margin: var(--space-8) 0 0; font-style: italic; color: var(--muted-foreground); }
.gloss-more { display: inline-block; margin-top: var(--space-10); font-size: var(--text-13); color: var(--primary); }
.gloss-cards[data-theme="compact"] .gloss-card { width: min(280px, calc(100vw - 24px)); padding: var(--space-10) var(--space-12); border-color: transparent;
  background: var(--foreground); color: var(--background); font-size: var(--text-13); line-height: 1.5; }
.gloss-cards[data-theme="compact"] :is(.gloss-group, .gloss-aliases, .gloss-example) { display: none; }
.gloss-cards[data-theme="compact"] .gloss-title { font: 600 var(--text-13)/1.4 var(--font-sans); color: inherit; }
.gloss-cards[data-theme="compact"] .gloss-text { margin-top: 2px; }
.gloss-cards[data-theme="compact"] .gloss-more { margin-top: 6px; font-size: var(--text-12); color: inherit; opacity: .8; }
.gloss-cards[data-theme="brand"] .gloss-card { border-color: transparent; border-left: 3px solid var(--brand); background: var(--brand-soft); }
.glossary-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-12); }
.glossary-nav a.badge { text-decoration: none; }
.glossary-nav a.badge[data-active] { background: var(--primary); color: var(--primary-foreground); }
.glossary-nav + .glossary-nav { margin-bottom: var(--space-32); }
.glossary-letter { margin-bottom: var(--space-32); scroll-margin-top: 80px; }
.glossary-letter > h2 { margin: 0 0 var(--space-8); padding-bottom: 6px; border-bottom: 1px solid var(--primary); }
.glossary-list { margin: 0; }
.glossary-list > div { padding: var(--space-14) 0; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
.glossary-list > div:target { background: var(--accent); }
.glossary-list dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-10); }
.glossary-list dt strong { font: 400 var(--text-20)/1.3 var(--font-subtitle); color: var(--primary); }
.glossary-list dt small { font-size: var(--text-13); color: var(--muted-foreground); }
.glossary-list dt .badge { margin-left: auto; }
.glossary-list dd { margin: 6px 0 0; }
.glossary-list dd p { margin: 0; }
.glossary-list dd .gloss-example { margin-top: 6px; }

/* ---- Testimonials (0.57): a lean slider of client voices with portrait, name and context ----
   Markup: section.block.block-testimonials > .block-inner > (.block-head) + .testimonials[data-interval] >
           .testimonials-track > figure.testimonial[data-active] (blockquote + figcaption > img.citation-portrait or span.citation-portrait[data-empty] +
           .citation-by > strong + .citation-role) + nav.testimonials-dots > button[aria-current]
   All slides share one grid cell, so the block keeps the height of the longest voice and nothing jumps.
   testimonials.js turns them every data-interval ms; hover and focus pause it, reduced motion stops it. */
.testimonials { max-width: 760px; }
.testimonials-track { display: grid; }
/* The change goes through nothing: the old voice fades out (400 ms), then the new one fades in, so no text overlaps. */
.testimonial { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease, visibility 0s linear 400ms; }
.testimonial[data-active] { opacity: 1; visibility: visible; transform: none;
  transition: opacity 600ms ease 450ms, transform 700ms cubic-bezier(.2, .7, .2, 1) 450ms, visibility 0s linear 450ms; }
.testimonial blockquote { margin: 0; font-family: var(--font-serif); font-style: italic; font-size: calc(clamp(18px, 2vw, 21px) * var(--text-scale)); line-height: 1.55; text-wrap: pretty; }
.testimonial blockquote::before { content: "“"; display: block; height: .55em; font-size: 2.6em; line-height: 1; color: var(--brand); font-style: normal; }
.testimonial figcaption { display: flex; align-items: center; gap: var(--space-14); margin-top: var(--space-24); padding-top: var(--space-16); border-top: 1px solid var(--primary);
  font-size: var(--text-14); line-height: 1.45; color: var(--muted-foreground); }
.testimonial figcaption strong { color: var(--foreground); font-weight: 500; }
.testimonial .citation-portrait { width: 56px; height: 56px; }
.testimonials-dots { display: flex; gap: var(--space-10); margin-top: var(--space-28); }
.testimonials-dots button { all: unset; cursor: pointer; width: 28px; height: 20px; display: grid; align-items: center; }
.testimonials-dots button::after { content: ""; height: 2px; border-radius: 1px; background: var(--border); transition: background 300ms ease; }
.testimonials-dots button[aria-current="true"]::after { background: var(--primary); }
.testimonials-dots button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 2px; }
/* Wide (0.57.2): the box of the page; the person stands in a left column, the voice runs beside it. */
.block-testimonials[data-width="wide"] .testimonials { max-width: none; }
.block-testimonials[data-width="wide"] .testimonial { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: var(--space-56); align-items: start; }
.block-testimonials[data-width="wide"] .testimonial blockquote { grid-column: 2; grid-row: 1; font-size: calc(clamp(19px, 1.9vw, 23px) * var(--text-scale)); }
.block-testimonials[data-width="wide"] .testimonial figcaption { grid-column: 1; grid-row: 1; margin-top: 0; flex-direction: column; align-items: flex-start; gap: var(--space-12); }
.block-testimonials[data-width="wide"] .testimonial .citation-portrait { width: 88px; height: 88px; }
.block-testimonials[data-width="wide"] .testimonials-dots { margin-left: var(--space-276); }
@media (max-width: 800px) {
  .block-testimonials[data-width="wide"] .testimonial { grid-template-columns: minmax(0, 1fr); }
  .block-testimonials[data-width="wide"] .testimonial blockquote, .block-testimonials[data-width="wide"] .testimonial figcaption { grid-column: 1; grid-row: auto; }
  .block-testimonials[data-width="wide"] .testimonial figcaption { margin-top: var(--space-24); flex-direction: row; align-items: center; }
  .block-testimonials[data-width="wide"] .testimonial .citation-portrait { width: 56px; height: 56px; }
  .block-testimonials[data-width="wide"] .testimonials-dots { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .testimonial { transition: none !important; transform: none !important; } }

/* ---- Categories and topics (0.64): pages that list lessons by term. ----
   Overview: .greeting + .toolbar with form.view-switch (two button.btn[data-variant=ghost][data-size=sm], the current one
   aria-pressed="true") + either .module-cards > a.module-card (optional .cover, h3, p, .meta with the lesson count) or
   .links[data-style=list] > a.link-item. A term page lists its lessons as .module-cards > a.module-card (.eyebrow program
   and module, h3, .meta: minutes, done, opening date); a lesson not open yet is .module-card[data-locked], a link only when
   it leads to the program page. Under a lesson title: .term-pills > a.term-pill, one per term. */
.view-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--card); }
.view-switch .btn { color: var(--muted-foreground); }
.view-switch .btn[aria-pressed="true"] { background: var(--muted); color: var(--foreground); }
/* 0.76.0: a segmented choice inside a form, radios that look like the view switch: every option visible, one chosen.
   Markup: fieldset.segmented > legend.label + div > label > input[type=radio] + text. Works with show-when.js. */
.segmented { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--space-8); }
.segmented > legend { padding: 0; margin-bottom: var(--space-8); }
.segmented > div { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; justify-self: start; max-width: 100%;
                   border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--card); }
.segmented label { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 6px var(--space-14); font-size: var(--text-14); cursor: pointer;
                   border-radius: var(--radius); color: var(--muted-foreground); transition: background-color .15s ease-out, color .15s ease-out; }
.segmented label:hover { color: var(--foreground); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--muted); color: var(--foreground); font-weight: 500; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
/* 0.99.4: the options sit in a row. The inner div has no class, so the flow rule (24 px between blocks) would push
   every option after the first down; the row lays its options out with its own gap. */
.segmented > div > label { margin-top: 0; }
.module-card .meta .done { color: var(--foreground); }
.module-card[data-locked] .meta { color: var(--muted-foreground); }
.term-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-12); }
.term-pill { display: inline-flex; align-items: center; padding: 2px var(--space-10); border: 1px solid var(--border); border-radius: 999px;
             font: 500 var(--text-12)/18px var(--font-sans); color: var(--muted-foreground); text-decoration: none; background: transparent; }
.term-pill:hover, .term-pill:focus-visible { border-color: var(--muted-foreground); color: var(--foreground); }
.term-pill[data-taxonomy="category"] { border-color: transparent; background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--primary); }


/* ---- Live navigation and the selected term (0.65): [data-live-nav] swaps its content without a reload (live-nav.js);
   while it loads it carries aria-busy. On a categories or topics page the chosen term is a.module-card or a.link-item
   with aria-current="true"; a.btn[data-variant=outline][data-size=sm] in the .toolbar clears the choice. */
[data-live-nav] { transition: opacity .15s ease-out; }
[data-live-nav][aria-busy="true"] { opacity: .6; }
a.module-card[aria-current="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
/* 0.83.0: categories and topics as cards with a square image on the left (.module-cards[data-cover="square"] >
   .module-card > .cover + h3 + p + .meta). A card without an image is text only. On a terms page the description of a
   card ends in "…" after three lines; in the list (.links[data-terms]) it stays on one line after the lesson count. */
.module-cards[data-cover="square"] { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.module-cards[data-cover="square"] > .module-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: var(--space-16); row-gap: 6px;
  align-content: start; padding: var(--space-16); }
.module-cards[data-cover="square"] > .module-card > .cover { grid-column: 1; grid-row: 1 / span 3; align-self: start; aspect-ratio: 1; margin: 0;
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); }
.module-cards[data-cover="square"] > .module-card > :not(.cover) { grid-column: 2; }
.module-cards[data-cover="square"] > .module-card:not(:has(> .cover)) { grid-template-columns: minmax(0, 1fr); }
.module-cards[data-cover="square"] > .module-card:not(:has(> .cover)) > * { grid-column: 1; }
.module-cards[data-cover="square"] > .module-card h3 { font-size: var(--text-20); }
.module-cards[data-cover="square"] > .module-card .meta { margin-top: 0; padding-top: 2px; }
.module-cards[data-terms] > .module-card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.links[data-terms] .link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 0.84.0: the list of categories and topics with a small square image left and the lesson count right, before the
   arrow: .links[data-style=list][data-thumbs] > a.link-item > span.link-thumb (img, or empty: a muted square) +
   span.link-title + small.link-text (the description, one line) + span.link-count. The image is 40 px but takes the room
   of one title line (it reaches into the padding), so a row is no higher than before. */
.links[data-style="list"][data-thumbs] .link-item { grid-template-columns: 40px minmax(0, 1fr) auto auto; }
.links[data-style="list"][data-thumbs] .link-item::after { grid-column: 4; }
.links[data-thumbs] .link-thumb { grid-column: 1; grid-row: 1 / span 2; width: 40px; height: 40px; margin-block: -9px; overflow: hidden;
  border-radius: calc(var(--radius) - 6px); background: var(--muted); }
.links[data-thumbs] .link-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.links[data-thumbs] .link-title, .links[data-thumbs] .link-text { grid-column: 2; }
.links[data-thumbs] .link-count { grid-column: 3; grid-row: 1 / span 2; font-size: var(--text-13); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
@media (max-width: 520px) {
  .module-cards[data-cover="square"] > .module-card { grid-template-columns: 72px minmax(0, 1fr); column-gap: var(--space-12); padding: var(--space-14); }
}
.links[data-style="list"] .link-item[aria-current="true"] { background: var(--accent); box-shadow: inset 3px 0 0 var(--primary); }
@media (prefers-reduced-motion: reduce) { [data-live-nav] { transition: none; } }

/* One line per item (0.71): ul.row-list > li > .row-main (a.row-title with an optional marker icon
   svg.row-mark[aria-label] + span.row-text, one line with an ellipsis and the full text in its title) + .row-actions.
   The actions are ghost icon buttons in fixed 36 px slots; span.row-slot keeps the place of an action that does not
   apply, so the icons line up from row to row. A form in a slot holds one icon button. On a phone the text wraps under
   the title (two lines at most). li[data-muted] dims a row (e.g. hidden). */
.row-list { list-style: none; padding: 0; border-top: 1px solid var(--primary); font-family: var(--font-sans); }
.row-list > li { display: flex; align-items: center; gap: 4px var(--space-16); padding: 6px 0; border-bottom: 1px solid var(--border); }
.row-list > li[data-muted] .row-main { opacity: .55; }
.row-list .row-main { display: flex; align-items: baseline; gap: 4px var(--space-12); flex: 1; min-width: 0; }
.row-list .row-title { display: inline-flex; align-items: center; gap: 6px; flex: none; font-weight: 500; font-size: var(--text-15); color: var(--foreground); text-decoration: none; white-space: nowrap; }
.row-list a.row-title:hover { text-decoration: underline; }
.row-list .row-mark { display: inline-flex; color: var(--muted-foreground); }
.row-list .row-mark svg { width: 14px; height: 14px; }
.row-list .row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-13); color: var(--muted-foreground); }
.row-list .row-text .badge { margin-right: 6px; }
.row-list .row-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 36px; gap: 2px; flex: none; justify-items: center; }
.row-list .row-actions > form { display: contents; }
.row-list .row-actions .btn, .row-list .row-actions .input-remove > summary { color: var(--muted-foreground); }
.row-list .row-actions .btn:hover, .row-list .row-actions .input-remove > summary:hover { color: var(--foreground); }
.row-list .row-actions .input-remove .confirm { text-align: left; white-space: normal; }
@media (max-width: 640px) {
  .row-list > li { align-items: flex-start; }
  .row-list .row-main { flex-wrap: wrap; padding-top: 6px; }
  .row-list .row-text { flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .row-list .row-actions { grid-auto-columns: 32px; gap: 0; }
}

/* Tabs and title on small screens (0.73): a horizontal tab row never widens the page, it scrolls sideways (the cut-off
   tab shows there is more); in .greeting > .title-row the click-to-edit title takes the full width below 640px and
   the actions wrap under it. */
.tabs { min-width: 0; max-width: 100%; }
.tabs > [role="tablist"]:not([aria-orientation="vertical"]) { max-width: 100%; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.tabs > [role="tablist"]:not([aria-orientation="vertical"])::-webkit-scrollbar { display: none; }
.tabs > [role="tablist"]:not([aria-orientation="vertical"]) > [role="tab"] { flex: none; }
@media (max-width: 640px) {
  .greeting > .title-row { flex-wrap: wrap; }
  .greeting > .title-row .inline-title { flex: 1 1 100%; }
}

/* Checkout (0.91.0): Stripe's embedded Checkout on a sales page or /buy, the part of the page that sells. Markup:
   div.checkout.dark > div.checkout-info (nav.checkout-plans of other plans + label.checkout-consent; 0.96.0: no price here)
   + div.checkout-frame[data-state] + div.checkout-fineprint. The card always carries the .dark palette, so it stands out on any page; the app
   gives Stripe the same card colour, the brand colour for the button and the sans font, so the form reads as part of
   the card, not as a frame. data-state="waiting" (the buyer has not ticked the consent yet) shows a blurred silhouette
   of the form (.checkout-ghost) with the hint (p.checkout-hint) on top; the script removes both when the form mounts. */
/* 0.98.0: the card in one tone of the deep brand colour (--brand-deep: the light-theme brand, kept inside .dark), 82 % of it
   mixed with black, so it stands out lightly on a deep block; the app gives Stripe the same tone (Brand::stripeCheckout).
   1200px: below a frame width of about 1000px Stripe's Embedded Checkout falls back to one column. */
:root { --brand-deep: var(--brand); }
.checkout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-24); width: 100%; max-width: 1200px; margin-inline: auto;
  padding: var(--space-48); border: 1px solid rgb(255 255 255 / .12); border-radius: calc(var(--radius) * 2); color: var(--card-foreground);
  background: color-mix(in oklab, var(--brand-deep) 82%, black);
  box-shadow: 0 30px 80px rgb(0 0 0 / calc(.35 * var(--shadow))); }
.checkout-info { display: flex; flex-direction: column; gap: var(--space-12); }
.checkout .checkout-price { margin: 0; font: 400 var(--head-34)/1.2 var(--font-display); text-wrap: balance; }
/* 0.96.0: the price and the terms in small text under the form (div.checkout-fineprint > p); Stripe's form shows the
   amount and the subscription terms itself, so this is only the reference. Above the form stay the plan choice and the consent. */
/* 0.96.1: one running line, the parts separated by a middle dot */
.checkout-fineprint { font: 400 var(--text-15)/1.55 var(--font-sans); color: var(--muted-foreground); }
.checkout-fineprint p { display: inline; margin: 0; }
.checkout-fineprint p + p::before { content: "\00a0·\0020"; }
.checkout-fineprint a { color: var(--foreground); }
.checkout .checkout-terms { margin: 0; font-size: var(--text-17); line-height: 1.6; color: var(--muted-foreground); }
.checkout .checkout-terms a { color: var(--foreground); }
/* Other plans (0.92.1): one option per line, text wraps inside the left column; the current one in brand. */
.checkout-plans { display: grid; gap: var(--space-8); }
.checkout-plans > .btn { height: auto; min-height: 40px; padding: var(--space-10) var(--space-14); white-space: normal; text-align: left; justify-content: flex-start; line-height: 1.4; }
.checkout-plans > .btn[data-variant="outline"] { background: transparent; color: var(--foreground); border: 1px solid var(--border); }
.checkout-plans > .btn[data-variant="outline"]:hover { border-color: var(--brand); }
.checkout-consent { display: flex; gap: var(--space-14); align-items: flex-start; margin-top: auto; padding: var(--space-18) var(--space-20); border: 1px solid var(--border);
  border-radius: var(--radius); background: rgb(0 0 0 / .2); font-size: var(--text-16); line-height: 1.55; cursor: pointer; transition: border-color .15s; }
.checkout-consent input { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--brand); cursor: pointer; }
.checkout-consent:hover, .checkout-consent:has(input:checked) { border-color: var(--brand); }
.checkout-consent:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.checkout-frame { position: relative; min-height: 620px; }
.checkout-frame > .note { padding: var(--space-24) 0; }
.checkout-ghost, .checkout-hint { display: none; }
.checkout-frame[data-state="waiting"] .checkout-ghost { display: grid; align-content: start; gap: var(--space-18); filter: blur(2.5px); opacity: .8; }
.checkout-ghost span { display: block; height: 48px; border-radius: var(--radius); background: rgb(255 255 255 / .1); }
.checkout-ghost .pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); height: auto; background: none; }
.checkout-ghost [data-kind="title"] { width: 40%; height: 20px; margin-top: var(--space-8); }
.checkout-ghost [data-kind="button"] { height: 54px; margin-top: var(--space-16); background: var(--brand); opacity: .55; }
.checkout-frame[data-state="waiting"] .checkout-hint { display: block; position: absolute; inset: 0; width: fit-content; max-width: min(32ch, 90%); height: fit-content;
  margin: auto; padding: var(--space-16) var(--space-22); border: 1px solid var(--border); border-radius: var(--radius); background: var(--popover); color: var(--popover-foreground);
  box-shadow: 0 12px 40px rgb(0 0 0 / calc(.4 * var(--shadow))); font: 500 var(--text-17)/1.5 var(--font-sans); text-align: center; }
/* 0.94.1: while Stripe loads, its form mounts hidden in .checkout-mount behind the silhouette (data-state="loading");
   public/js/checkout.js shows it in one step once its height has settled, so the page does not grow piece by piece. */
.checkout-frame[data-state="loading"] .checkout-ghost { display: grid; align-content: start; gap: var(--space-18); opacity: .5; }
.checkout-frame[data-state="loading"] > .checkout-mount { position: absolute; inset: 0 0 auto; opacity: 0; pointer-events: none; }
.checkout-mount { transition: opacity .3s ease-out; }
/* 0.99.0: the own checkout form with Stripe Elements (div.checkout-frame[data-ui="elements"] > form.checkout-form). It keeps the
   order of Stripe's hosted Checkout: on the left the summary (aside.checkout-summary: p.checkout-summary-name, the amount due
   today in p.checkout-summary-total, the next charges in p.checkout-summary-then, details.checkout-details with
   dl.checkout-lines, div.checkout-promo), on the right the fields (div.checkout-fields: one div.checkout-step per part with
   an optional h3 and the Stripe mount, label.checkout-consent, the pay button, p.checkout-error). Stripe's fields get the
   card colours through the Appearance API (public/js/checkout.js of the app). Two columns from a form width of 760px,
   below one column with the summary on top and its details folded. */
.checkout-form { container-type: inline-size; }
.checkout-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-32); }
@container (min-width: 760px) {
  .checkout-form-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-56); align-items: start; }
  .checkout-summary { position: sticky; top: 24px; }
}
.checkout-summary { display: grid; gap: 6px; }
.checkout-summary-name { margin: 0; font: 500 var(--text-17)/1.4 var(--font-sans); color: var(--muted-foreground); }
.checkout-summary-total { margin: 0; font: 600 var(--head-36)/1.15 var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.checkout-summary-then { margin: 0; font: 400 var(--text-15)/1.5 var(--font-sans); color: var(--muted-foreground); }
.checkout-details { margin-top: var(--space-18); }
.checkout-details > summary { display: inline-flex; align-items: center; gap: 6px; font: 500 var(--text-15)/1.4 var(--font-sans); color: var(--foreground);
  cursor: pointer; list-style: none; }
.checkout-details > summary::-webkit-details-marker { display: none; }
.checkout-details > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.checkout-details[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
@container (min-width: 760px) {
  .checkout-details > summary { display: none; }
}
.checkout-lines { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-10) var(--space-16); margin: var(--space-16) 0 0; font: 400 var(--text-15)/1.45 var(--font-sans); }
.checkout-lines dt { margin: 0; color: var(--muted-foreground); }
.checkout-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.checkout-lines [data-kind="item"] { color: var(--foreground); font-weight: 500; }
.checkout-lines [data-kind="sum"] { padding-top: var(--space-12); border-top: 1px solid var(--border); color: var(--foreground); font-weight: 600; }
.checkout-lines [data-kind="discount"] { color: var(--foreground); }
.checkout-promo { display: flex; gap: var(--space-8); margin-top: var(--space-16); }
.checkout-promo .input { flex: 1 1 auto; min-width: 0; }
.checkout-promo > .note { margin: 0; }
.checkout-fields { display: grid; gap: var(--space-22); }
.checkout-step { display: grid; gap: var(--space-10); }
.checkout-step > h3 { margin: 0; font: 600 var(--text-16)/1.4 var(--font-sans); }
.checkout-step:empty { display: none; }
.checkout-fields > .btn { width: 100%; height: 52px; font-size: var(--text-17); }
.checkout-fields > .checkout-consent { margin-top: 0; }
.checkout-error { margin: 0; color: var(--destructive); font: 500 var(--text-15)/1.5 var(--font-sans); }
.checkout-error:empty { display: none; }
.checkout-frame[data-ui="elements"] { min-height: 0; }
.checkout-frame[data-ui="elements"][data-state="loading"] > .checkout-form { position: absolute; inset: 0 0 auto; opacity: 0; pointer-events: none; }
.checkout-form { transition: opacity .3s ease-out; }
.checkout-frame[data-ui="elements"][data-state="waiting"] > .checkout-form { display: none; }
@media (max-width: 900px) {
  .checkout { grid-template-columns: minmax(0, 1fr); gap: var(--space-32); padding: var(--space-28) var(--space-20); }
  .checkout .checkout-price { font-size: var(--head-28); }
  .checkout-consent { margin-top: 0; }
  .checkout-frame { min-height: 560px; }
}
/* 0.101.0: the checkout in two steps, one form for every payment method (Stripe and PayPal).
   The card sets the sans font, so text of a sales page (.prose, serif) does not reach the form.
   Own fields in the checkout (div.checkout-fields .field > label.label + .input/.select) look like Stripe's fields
   (public/js/checkout.js of the app gives Stripe the same colours): sans label in the muted colour, 44px field.
   A step: div.checkout-step > h3 + div.checkout-step-body + div.checkout-step-recap (p + button.btn[data-variant=ghost]).
   [data-done]: the body folds, the recap shows (what the buyer entered, "Change"). [data-locked]: a later step, only its
   heading in the muted colour. The payment methods: div.checkout-methods > the Stripe mount + label.checkout-method
   (input[type=radio] + span), drawn like Stripe's accordion items; the chosen one has the brand border. */
.checkout { font-family: var(--font-sans); }
.checkout-fields .field { display: grid; gap: 6px; min-width: 0; }
.checkout-fields .label { font: 400 var(--text-14)/1.4 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--muted-foreground); }
.checkout-fields :is(.input, .select) { width: 100%; height: 44px; font: 400 var(--text-16)/1.3 var(--font-sans); color: var(--foreground);
  background-color: rgba(0, 0, 0, .2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; }
.checkout-fields :is(.input, .select):focus-visible { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); outline: none; }
.checkout-fields .form-grid { gap: var(--space-14); }
.checkout-fields details > summary { cursor: pointer; font: 500 var(--text-15)/1.4 var(--font-sans); color: var(--foreground); }
.checkout-fields details[open] > summary { margin-bottom: var(--space-14); }
.checkout-step-body { display: grid; gap: var(--space-16); }
.checkout-step-body > .btn { width: 100%; height: 48px; font-size: var(--text-16); }
.checkout-step-recap { display: none; }
.checkout-step[data-done] > .checkout-step-body { display: none; }
.checkout-step[data-done] > .checkout-step-recap { display: flex; gap: var(--space-12); align-items: flex-start; justify-content: space-between; }
.checkout-step-recap > p { margin: 0; font: 400 var(--text-15)/1.5 var(--font-sans); color: var(--muted-foreground); overflow-wrap: anywhere; }
.checkout-step[data-locked] > h3 { color: var(--muted-foreground); }
.checkout-step[data-locked] > .checkout-step-body { display: none; }
.checkout-methods { display: grid; gap: var(--space-12); }
.checkout-method { display: flex; gap: var(--space-12); align-items: center; padding: var(--space-16) var(--space-18); font: 500 var(--text-16)/1.4 var(--font-sans); cursor: pointer;
  background-color: rgba(0, 0, 0, .2); border: 1px solid var(--border); border-radius: var(--radius); }
.checkout-method input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.checkout-method:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.checkout-method:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
/* 0.101.0: the segmented choice on a dark card: a border that shows and a clearly lighter chosen option. */
.dark .segmented > div { border-color: color-mix(in srgb, var(--foreground) 28%, transparent); }
.dark .segmented label:has(input:checked) { background: var(--foreground); color: var(--background); }
/* 0.101.1: one look for the choices in the checkout: Stripe's radios (the app passes the same colours through the
   Appearance API), the own payment methods (label.checkout-method) and the consent box (label.checkout-consent).
   A thin ring in the muted colour; chosen: a brand ring with a brand dot, or a brand box with a tick. The label text is
   muted until its option is chosen, as in Stripe's accordion. */
.checkout-method { padding: var(--space-18) var(--space-20); font-weight: 500; color: var(--muted-foreground); }
.checkout-method:has(input:checked) { color: var(--foreground); }
.checkout-method input, .checkout-consent input { -webkit-appearance: none; appearance: none; display: grid; place-content: center;
  margin: 0; background: transparent; border: 1.5px solid var(--muted-foreground); transition: background-color .12s ease-out, border-color .12s ease-out; }
.checkout-method input { width: 18px; height: 18px; border-radius: 50%; }
.checkout-method input::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); transform: scale(0);
  transition: transform .12s ease-out; }
.checkout-method input:checked { border-color: var(--brand); }
.checkout-method input:checked::before { transform: scale(1); }
.checkout-consent input { width: 20px; height: 20px; margin-top: 2px; border-radius: 4px; }
.checkout-consent input::before { content: ""; width: 10px; height: 5px; border: solid var(--brand-foreground, #fff); border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .12s ease-out; }
.checkout-consent input:checked { background: var(--brand); border-color: var(--brand); }
.checkout-consent input:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }

/* Look knobs (0.102.0): the app's design studio sets --density, --text-scale, --heading-scale, --shadow and --radius
   (tokens.css). Above shadow 1 the cards lift; at 1 or below they stay as designed, at 0 every shadow is gone. */
.card { --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / calc(.05 * var(--shadow))), var(--shadow-lift); }
.notes-card, .frame, .task-list-box, .up-next, .game-card, .block-card { box-shadow: var(--shadow-lift); }

/* Design studio (0.102.0): controls on the left, the live preview on the right; one column on small screens.
   .studio > form.studio-panel (h2 + .studio-control (label > span + output) + input[type=range|color] … + .studio-actions)
   + .studio-stage > .studio-bar (.segmented + .row) + .studio-frame[data-width="phone|desktop"] > iframe */
.studio { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: var(--space-24); align-items: start; }
.studio-panel { position: sticky; top: 16px; display: grid; max-height: calc(100vh - 32px); overflow: auto; padding: var(--space-16) var(--space-16) 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.studio-panel h2 { font: 500 var(--text-13)/1.4 var(--font-sans); color: var(--muted-foreground); margin: var(--space-20) 0 var(--space-8); }
.studio-panel h2:first-of-type { margin-top: 0; }
.studio-control { display: grid; gap: 6px; margin-bottom: var(--space-14); font-size: var(--text-14); }
.studio-control > label { display: flex; justify-content: space-between; gap: var(--space-8); align-items: baseline; }
.studio-control output { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.studio-control input[type="range"] { width: 100%; accent-color: var(--brand); }
.studio-control .select { width: 100%; }
.studio-colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); margin-bottom: var(--space-14); }
.studio-colors label { display: grid; gap: 4px; font-size: var(--text-12); color: var(--muted-foreground); }
.studio-colors input[type="color"] { width: 100%; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px);
  background: var(--background); cursor: pointer; }
.studio-file { display: flex; align-items: center; gap: var(--space-12); margin-bottom: var(--space-14); font-size: var(--text-14); }
.studio-file img { width: 40px; height: 40px; object-fit: contain; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); background: var(--background); }
.studio-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: var(--space-8); margin: var(--space-8) calc(-1 * var(--space-16)) 0;
  padding: var(--space-12) var(--space-16) var(--space-16); border-top: 1px solid var(--border); background: var(--card); }
.studio-actions .btn:first-child { flex: 1; }
/* Guided setup in the studio (0.104.0): ol.studio-steps (li > button, the current one aria-current="step", done ones
   data-done) above one section.studio-step at a time; .studio-choices holds radio cards (label > input + strong + span),
   .studio-suggest a colour swatch button taken from the logo. */
.studio-steps { display: flex; gap: 4px; margin: 0 0 var(--space-16); padding: 0; list-style: none; counter-reset: studio-step; }
.studio-steps li { flex: 1; counter-increment: studio-step; }
.studio-steps button { display: grid; justify-items: center; gap: 4px; width: 100%; padding: 6px 2px; border: 0; border-radius: 6px; background: none;
  font: 500 var(--text-12)/1.2 var(--font-sans); color: var(--muted-foreground); cursor: pointer; }
.studio-steps button::before { content: counter(studio-step); display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--border);
  border-radius: 50%; font-size: var(--text-12); background: var(--background); }
.studio-steps li[data-done] button::before { content: "✓"; border-color: var(--brand); color: var(--brand); }
.studio-steps button[aria-current="step"] { color: var(--foreground); }
.studio-steps button[aria-current="step"]::before { border-color: var(--brand); background: var(--brand); color: var(--brand-foreground); }
.studio-steps button:hover { background: var(--accent); }
.studio-step[hidden] { display: none; }
.studio-step > p:first-of-type { margin-top: 0; font-size: var(--text-14); color: var(--muted-foreground); }
.studio-step .field { margin-bottom: var(--space-12); }
.studio-choices { display: grid; gap: var(--space-8); margin-bottom: var(--space-14); }
.studio-choices label { position: relative; display: grid; gap: 2px; padding: var(--space-10) var(--space-12); border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px); cursor: pointer; font-size: var(--text-14); }
.studio-choices label:hover { background: var(--accent); }
.studio-choices label:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.studio-choices label:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
.studio-choices input { position: absolute; opacity: 0; pointer-events: none; }
.studio-choices span { color: var(--muted-foreground); font-size: var(--text-13); }
.studio-suggest { display: inline-flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-14); }
.studio-suggest i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: var(--swatch, transparent); }
.studio-suggest[hidden] { display: none; }
.studio-stage { position: sticky; top: 16px; display: grid; gap: var(--space-12); }
.studio-bar { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; justify-content: space-between; }
.studio-frame { width: 100%; height: calc(100vh - 120px); margin-inline: auto; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--background); transition: width .2s ease-out; }
.studio-frame[data-width="phone"] { width: 390px; max-width: 100%; }
.studio-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 900px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-panel, .studio-stage { position: static; max-height: none; }
  .studio-frame { height: 70vh; }
}
