/* ============================================================
   Crossdeck University — designed like Pulse.

   One philosophy governs every rule: the CONTENT is the hero, the
   design is the frame. The film is to a University page what the
   live map / the $84.11 number is to Pulse — the one beautiful
   thing. The chrome goes quiet around it.

   Steal from Pulse, exactly: light warm paper, one coral accent used
   sparingly, clean type sized with PURPOSE (small uppercase tracked
   labels; quiet headings; never theatrical), full-width COMPOSED
   grids that each do a job, whitespace organised around content.

   No dark dramatic stage. No display serif. No oversized headline in
   a void. Quiet, confident, full-width — like Pulse.
   ============================================================ */

:root {
  --ds-bg: #f7f3ec;
  --ds-bg-soft: #faf7f0;
  --ds-canvas: #fbfaf6;
  --ds-surface: #ffffff;
  --ds-surface-soft: #fafaf6;
  --ds-border: rgba(23, 19, 17, 0.09);
  --ds-border-strong: rgba(23, 19, 17, 0.16);
  --ds-divider: rgba(23, 19, 17, 0.06);
  --ds-text: #14110f;
  --ds-text-soft: #2a2421;
  --ds-muted: #6b6259;
  --ds-muted-soft: #948a7e;
  --ds-accent: #ff6e45;
  --ds-accent-strong: #ee4f25;
  --ds-accent-soft: rgba(255, 110, 69, 0.1);
  --ds-success: #0e7a52;
  --ds-shadow-sm: 0 1px 2px rgba(20, 17, 15, 0.04);
  --ds-shadow-md: 0 10px 36px -18px rgba(20, 17, 15, 0.22);
  --ds-radius: 10px;
  --ds-radius-sm: 6px;
  --ds-radius-lg: 16px;
  --ds-radius-pill: 999px;

  /* Inter, self-hosted from our own origin (see /fonts/inter.css) — the
     brand typeface, identical on every OS and unbreakable (no CDN to be
     blocked or go down). System fonts only as a last-resort fallback. */
  --ds-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --ds-mono: "SF Mono", "JetBrains Mono", "Menlo", ui-monospace, monospace;

  /* Page gutter — full width with intentional room, never a hard cap. */
  --gutter: clamp(20px, 4.4vw, 96px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ds-sans);
  background: var(--ds-bg);
  color: var(--ds-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  font-size: 16px;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
::selection { background: var(--ds-accent-soft); }
:focus-visible { outline: 2px solid var(--ds-accent-strong); outline-offset: 3px; border-radius: 4px; }

/* Small uppercase tracked label — the Pulse "BY RAIL" / "APP" device.
   This is the workhorse; the page speaks in quiet labels, not headlines. */
.uni-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ds-muted-soft);
}
.uni-label .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ds-accent); margin-right: 7px; vertical-align: 1px;
}

/* ------------------------------------------------------------
   Header — floats quietly over the page (like Pulse's chrome)
   ------------------------------------------------------------ */
/* IDENTICAL to the Docs header (.docs-header) — same bar, different menu
   items. This is the handshake that says "same platform"; values copied
   verbatim from docs.css so the two chromes can't drift. */
.uni-header {
  position: sticky; top: 0; z-index: 50; width: 100%;
  padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--ds-bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--ds-border);
}
.uni-header-inner { height: 56px; display: flex; align-items: center; gap: 24px; }
.uni-brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.uni-brand img { display: block; height: 22px; width: auto; }
/* The Docs brand-tag pill, exactly */
.uni-brand-tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 20px; padding: 0 10px 0 9px;
  font-size: 10.5px; font-weight: 600; line-height: 1;
  letter-spacing: 0.10em; text-transform: uppercase; color: var(--ds-text-soft);
  border: 1px solid var(--ds-border); border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
/* Right side = the Docs .docs-header-actions, exactly: buttons only, no
   bare text links. margin-left:auto + 8px gap, matching docs.css. */
.uni-header-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------
   Buttons — quiet. One subtle bordered pill; coral used rarely.
   ------------------------------------------------------------ */
/* The nav button — IDENTICAL to the Docs .btn (the "Dashboard" button) */
.uni-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--ds-radius-sm);
  border: 1px solid var(--ds-border); background: var(--ds-surface); color: var(--ds-text);
  font: inherit; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: border-color 140ms, transform 140ms, box-shadow 140ms;
}
.uni-btn:hover { border-color: var(--ds-border-strong); transform: translateY(-1px); box-shadow: var(--ds-shadow-sm); }
/* Hero CTA — a quiet usher beside the film, not a billboard */
.uni-btn-primary {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 18px;
  border-radius: var(--ds-radius-pill); background: var(--ds-text); color: var(--ds-bg);
  font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none;
  transition: background 0.16s ease, transform 0.16s ease;
}
.uni-btn-primary:hover { background: #000; transform: translateY(-1px); }
.uni-btn-quiet { background: transparent; border-color: transparent; color: var(--ds-muted); padding-inline: 4px; }
.uni-btn-quiet:hover { background: transparent; color: var(--ds-text); }
.uni-link { color: var(--ds-accent-strong); font-weight: 600; font-size: 14px; text-decoration: none; }
.uni-link:hover { color: var(--ds-accent); }

/* ============================================================
   THE FILM PLAYER — the hero element, framed cleanly.
   Quiet light frame; the video (or its poster) is the content.
   ============================================================ */
.film {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--ds-radius-lg); overflow: hidden;
  background: #ece7de; border: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow-md); isolation: isolate;
}
.film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0c0a08; display: block; }

.film-poster {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 18px; text-align: center;
  background:
    radial-gradient(120% 100% at 50% 38%, transparent 40%, rgba(12, 10, 8, 0.42)),
    linear-gradient(0deg, rgba(12, 10, 8, 0.5), rgba(12, 10, 8, 0.05) 55%),
    var(--poster, linear-gradient(135deg, #efe9df, #ded7ca));
  background-size: cover; background-position: center; cursor: pointer; z-index: 2; transition: opacity 0.45s ease;
}
.film.is-playing .film-poster { opacity: 0; pointer-events: none; }

/* Cold-start bridge: a quiet spinner over the crisp poster while the player
   buffers real quality, so the viewer never sees the low-bitrate climb. */
.film-spinner { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.28); border-top-color: var(--ds-accent); animation: film-spin 0.8s linear infinite; opacity: 0; pointer-events: none; z-index: 3; transition: opacity 0.25s ease; }
.film.is-loading .film-spinner { opacity: 1; }
.film.is-loading .film-play { opacity: 0; transform: scale(0.9); }
.film.is-loading .film-poster { cursor: default; }
@keyframes film-spin { to { transform: rotate(360deg); } }

/* Confident, inviting, coral — the one action you want is unmissable */
.film-play {
  width: clamp(66px, 5.4vw, 88px); height: clamp(66px, 5.4vw, 88px); margin: 0 auto; border-radius: 50%;
  display: grid; place-content: center; border: 0; cursor: pointer;
  background: var(--ds-accent-strong); color: #fff;
  box-shadow: 0 16px 44px -8px rgba(238, 79, 37, 0.55), 0 0 0 8px rgba(255, 110, 69, 0.14);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.film-poster:hover .film-play { transform: scale(1.07); background: var(--ds-accent); box-shadow: 0 20px 52px -8px rgba(238, 79, 37, 0.6), 0 0 0 10px rgba(255, 110, 69, 0.18); }
.film-play svg { width: 38%; height: 38%; fill: currentColor; margin-left: 8%; }
.film-poster-cap { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, 0.95); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }

/* Muted-autoplay → an obvious, inviting unmute control */
.film-unmute {
  position: absolute; top: 14px; right: 14px; z-index: 4; display: none;
  align-items: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--ds-radius-pill);
  background: rgba(20, 17, 15, 0.62); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background 0.16s ease;
}
.film.is-playing.is-muted .film-unmute { display: inline-flex; }
.film-unmute:hover { background: var(--ds-accent-strong); }
.film-unmute svg { width: 15px; height: 15px; fill: currentColor; }

/* Empty state — quiet, light, never a broken-looking black box */
.film.is-empty { background: linear-gradient(135deg, #f3eee5, #e8e2d7); }
.film.is-empty video { display: none; } /* no source → hide the dark <video> so the light placeholder shows, not a black box */
.film.is-empty .film-poster { cursor: default; background: none; }
.film.is-empty .film-play { background: rgba(20, 17, 15, 0.05); color: var(--ds-muted-soft); box-shadow: none; cursor: default; }
.film.is-empty .film-poster-cap { display: none; }
.film.is-empty .film-controls { display: none; }
.film-empty-tag { display: none; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ds-muted-soft); }
.film.is-empty .film-empty-tag { display: inline-flex; }
.film-empty-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ds-accent); }

.film-controls {
  position: absolute; inset: auto 0 0 0; z-index: 3; display: flex; align-items: center; gap: 13px;
  padding: 13px 16px; background: linear-gradient(0deg, rgba(8, 6, 5, 0.78), transparent);
  opacity: 0; transform: translateY(6px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.film.is-playing:hover .film-controls, .film.is-playing.is-paused .film-controls, .film.is-playing:focus-within .film-controls { opacity: 1; transform: none; }
.film-ctl { flex: none; display: grid; place-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.film-ctl:hover { background: rgba(255, 255, 255, 0.16); }
.film-ctl svg { width: 17px; height: 17px; fill: currentColor; }
.film-scrub { flex: 1; appearance: none; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.28); cursor: pointer; outline-offset: 4px; }
.film-scrub::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--ds-accent); }
.film-scrub::-moz-range-thumb { border: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--ds-accent); }
.film-time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.82); min-width: 80px; text-align: center; }

/* ============================================================
   HERO — the film IS the hero. Quiet supporting text, full width.
   Composed like Pulse: a slim meta row, then the content fills.
   ============================================================ */
/* NOTHING above the film. It is the first thing under the menu bar — it
   autoplays on arrival, the way Pulse's map is alive the moment you land.
   A small seam under the header, then a tight, deliberate gap to the courses
   (no cavernous void — Pulse/Stripe spacing is intentional, not drifting). */
.uni-hero { width: 100%; padding: clamp(12px, 1.4vw, 18px) var(--gutter) clamp(18px, 2vw, 28px); }

/* ============================================================
   SECTIONS + COURSES — full-width composed, like the revenue ledger
   ============================================================ */
.uni-section { width: 100%; padding: clamp(24px, 2.6vw, 40px) var(--gutter) clamp(40px, 4.6vw, 76px); }
.uni-section.alt { background: var(--ds-surface); border-top: 1px solid var(--ds-divider); border-bottom: 1px solid var(--ds-divider); }
.uni-section-head { margin-bottom: clamp(20px, 2.2vw, 34px); }
.uni-section-head h2 { font-size: clamp(1.3rem, 1.8vw, 1.7rem); font-weight: 600; letter-spacing: -0.018em; line-height: 1.16; margin: 10px 0 0; }
/* run across the width — short copy earns no right-hand void (cap only so it
   doesn't sprawl on an ultra-wide monitor) */
.uni-section-head p { font-size: 1rem; color: var(--ds-muted); margin: 10px 0 0; max-width: 95ch; }

.uni-course { margin-top: clamp(30px, 3.2vw, 52px); }
.uni-course:first-of-type { margin-top: 0; }
/* Course header — composed across the width: title+desc left, progress right
   (the revenue-ledger move: a thing on the left, a measure on the right). */
.uni-course-head {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px;
  padding-bottom: 18px; border-bottom: 1px solid var(--ds-border);
}
.uni-course-title { display: flex; align-items: center; gap: 12px; }
.uni-course-title h3 { font-size: clamp(1.15rem, 1.5vw, 1.4rem); font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.uni-course-flag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ds-accent-strong); background: var(--ds-accent-soft); padding: 3px 9px; border-radius: var(--ds-radius-pill); }
.uni-course-desc { color: var(--ds-muted); font-size: 14.5px; margin: 7px 0 0; }
.uni-progress { min-width: 180px; text-align: right; }
.uni-progress-row { font-size: 12.5px; font-weight: 600; color: var(--ds-muted); margin-bottom: 8px; }
.uni-progress-row b { color: var(--ds-text); }
.uni-progress-bar { height: 5px; border-radius: 5px; background: var(--ds-border); overflow: hidden; }
.uni-progress-fill { height: 100%; width: 0%; border-radius: 5px; background: var(--ds-accent-strong); transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Lesson cards — a clean grid that uses the width. Quiet white cards;
   the poster thumbnail showcases the film, the chrome whispers. */
.uni-lessons { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(14px, 1.2vw, 20px); }
.uni-lcard { position: relative; display: flex; flex-direction: column; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); text-decoration: none; color: inherit; overflow: hidden; transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
a.uni-lcard:hover { transform: translateY(-2px); box-shadow: var(--ds-shadow-md); border-color: var(--ds-border-strong); }
.uni-lcard-thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #f2ede4, #e6e0d5); display: grid; place-content: center; overflow: hidden; }
.uni-lcard-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.uni-lcard-glyph { width: 26%; max-width: 54px; color: rgba(20, 17, 15, 0.16); }
.uni-lcard-glyph svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.uni-lcard-num { position: absolute; top: 11px; left: 13px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ds-muted-soft); }
.uni-lcard-tiny-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.95); color: var(--ds-text); display: grid; place-content: center; opacity: 0; transition: opacity 0.2s ease; }
.uni-lcard-tiny-play svg { width: 16px; height: 16px; fill: currentColor; margin-left: 2px; }
a.uni-lcard:hover .uni-lcard-tiny-play { opacity: 1; }
/* When a card carries a real poster (data-poster), drop the placeholder glyph. */
.uni-lcard.has-poster .uni-lcard-glyph { display: none; }
.uni-lcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; gap: 7px; }
.uni-lcard-body h4 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.3; }
.uni-lcard-out { font-size: 13.5px; color: var(--ds-muted); margin: 0; flex: 1; }
.uni-lcard-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--ds-muted-soft); font-weight: 500; }
.uni-lcard-dur { display: inline-flex; align-items: center; gap: 6px; }
.uni-lcard-dur svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.uni-lcard.is-soon { opacity: 0.6; }
.uni-tag { margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--ds-radius-pill); }
.uni-tag.soon { color: var(--ds-muted); background: var(--ds-border); }
.uni-lcard.is-done .uni-lcard-thumb::after {
  content: ""; position: absolute; top: 11px; right: 11px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ds-success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4L19 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* ============================================================
   LESSON PAGE — the film is the hero of the page (light, like Pulse)
   ============================================================ */
/* ============================================================
   COURSE BAR — the lesson's navigation module. A thin, sticky,
   Stripe-grade bar at the very top of the page: where you are in the
   course (progress), back/forward through it, a link deeper (Reference),
   and mark-complete. Every pixel earns its place — 52px tall, compact
   controls, no fat buttons.
   ============================================================ */
.uni-coursebar {
  position: sticky; top: 56px; z-index: 40; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 52px; padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--ds-bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--ds-border);
}
.uni-cb-right { display: flex; align-items: center; gap: 10px; flex: none; }
.uni-cb-course { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 13px; font-weight: 600; color: var(--ds-text); text-decoration: none; white-space: nowrap; }
.uni-cb-course svg { width: 14px; height: 14px; fill: none; stroke: var(--ds-muted); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.uni-cb-course:hover svg { stroke: var(--ds-text); }
/* progress — ONE continuous wide bar in the middle that fills as you complete */
.uni-cb-mid { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.uni-cb-bar { flex: 1; height: 6px; min-width: 60px; border-radius: var(--ds-radius-pill); background: var(--ds-border); overflow: hidden; }
.uni-cb-bar-fill { display: block; height: 100%; width: 0%; border-radius: var(--ds-radius-pill); background: linear-gradient(90deg, var(--ds-accent-warm), var(--ds-accent-strong)); transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.uni-cb-count { flex: none; font-size: 12px; color: var(--ds-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Reference — a real button, same treatment as the others (was an unstyled link) */
.uni-cb-link { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm); background: var(--ds-surface); color: var(--ds-text); font: inherit; font-size: 12.5px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: border-color 140ms, background 140ms; }
.uni-cb-link:hover { border-color: var(--ds-border-strong); background: var(--ds-bg-soft); }
.uni-cb-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* mark complete — compact, NOT a fat pill */
.uni-cb-complete {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-sm);
  background: var(--ds-surface); color: var(--ds-text); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.uni-cb-complete svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.3; opacity: 0.45; }
.uni-cb-complete:hover { border-color: var(--ds-text); }
.uni-cb-complete.is-done { background: color-mix(in srgb, var(--ds-success) 10%, var(--ds-surface)); border-color: color-mix(in srgb, var(--ds-success) 40%, transparent); color: var(--ds-success); }
.uni-cb-complete.is-done svg { opacity: 1; }
/* back / forward through the course */
.uni-cb-arrow {
  display: grid; place-content: center; width: 32px; height: 32px; flex: none;
  border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm);
  color: var(--ds-text); text-decoration: none; transition: border-color 0.16s ease, background 0.16s ease;
}
.uni-cb-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.uni-cb-arrow:hover { border-color: var(--ds-border-strong); background: var(--ds-bg-soft); }
.uni-cb-arrow.is-disabled { color: var(--ds-muted-soft); border-color: var(--ds-divider); pointer-events: none; opacity: 0.5; }
.uni-cb-nav { display: flex; align-items: center; gap: 6px; }

.uni-lesson-film { width: 100%; padding: clamp(16px, 1.8vw, 26px) var(--gutter) clamp(28px, 3vw, 48px); }
.uni-lesson-film .film { max-width: 1320px; margin: 0 auto; }

.uni-lesson-grid {
  width: 100%; padding: 0 var(--gutter) clamp(48px, 5vw, 88px);
  display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(200px, 280px);
  gap: clamp(26px, 3.4vw, 60px); align-items: start;
}
.uni-rail { position: sticky; top: 80px; }
.uni-rail-label { margin-bottom: 14px; }
.uni-rail-course { display: flex; flex-direction: column; gap: 2px; }
.uni-rail-step { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: var(--ds-radius); text-decoration: none; color: var(--ds-muted); font-size: 13.5px; font-weight: 500; transition: background 0.15s ease, color 0.15s ease; }
.uni-rail-step:hover { background: var(--ds-surface); color: var(--ds-text); }
.uni-rail-step.is-current { background: var(--ds-surface); color: var(--ds-text); font-weight: 600; box-shadow: var(--ds-shadow-sm); border: 1px solid var(--ds-border); }
.uni-rail-step.is-soon { color: var(--ds-muted-soft); pointer-events: none; }
.uni-rail-dot { flex: none; width: 21px; height: 21px; border-radius: 50%; display: grid; place-content: center; border: 1.5px solid var(--ds-border-strong); font-size: 10.5px; font-weight: 700; color: var(--ds-muted-soft); font-variant-numeric: tabular-nums; }
.uni-rail-step.is-current .uni-rail-dot { border-color: var(--ds-accent-strong); color: var(--ds-accent-strong); }
.uni-rail-step.is-done .uni-rail-dot {
  border-color: var(--ds-success); background: var(--ds-success); font-size: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4L19 7'/%3E%3C/svg%3E");
  background-position: center; background-size: 12px; background-repeat: no-repeat;
}

.uni-lesson-head { margin-bottom: clamp(24px, 2.6vw, 38px); }
.uni-lesson-pos { display: inline-block; margin-bottom: 12px; }
/* Anchor link — appears on heading hover, copies a deep link to the section */
.uni-anchor {
  display: inline-grid; place-content: center; width: 24px; height: 24px; margin-left: 8px; vertical-align: middle;
  border: 0; background: transparent; color: var(--ds-muted-soft); cursor: pointer;
  opacity: 0; transition: opacity 0.14s ease, color 0.14s ease;
}
.uni-anchor svg { width: 15px; height: 15px; }
.uni-body h2:hover .uni-anchor, .uni-anchor:focus-visible { opacity: 1; }
.uni-anchor:hover { color: var(--ds-accent-strong); }
.uni-anchor.is-copied { opacity: 1; color: var(--ds-success); }
.uni-lesson-head h1 { font-size: clamp(1.5rem, 2.2vw, 2.1rem); font-weight: 600; letter-spacing: -0.022em; line-height: 1.1; margin: 0; }
.uni-lesson-desc { font-size: clamp(1.02rem, 1.2vw, 1.15rem); color: var(--ds-muted); margin: 14px 0 0; max-width: 64ch; }
.uni-lesson-meta { display: flex; gap: 16px; margin-top: 16px; font-size: 13px; color: var(--ds-muted-soft); font-weight: 500; }
.uni-lesson-meta span { display: inline-flex; align-items: center; gap: 6px; }
.uni-lesson-meta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
/* outcome promise — what you'll have when you're done (expectation-setting) */
.uni-outcome { display: flex; align-items: flex-start; gap: 8px; margin: 16px 0 0; font-size: 14px; color: var(--ds-success); font-weight: 500; }
.uni-outcome svg { width: 15px; height: 15px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Four-part body — quiet small-caps part labels, well-organised */
.uni-body { max-width: 72ch; }
.uni-part { margin-top: clamp(30px, 3vw, 48px); scroll-margin-top: 80px; }
.uni-part:first-child { margin-top: 0; }
.uni-part-tag { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ds-muted-soft); }
.uni-part-tag i { font-style: normal; font-weight: 700; color: var(--ds-accent-strong); font-variant-numeric: tabular-nums; }
.uni-body h2 { font-size: clamp(1.2rem, 1.6vw, 1.5rem); font-weight: 600; letter-spacing: -0.016em; line-height: 1.2; margin: 0; }
.uni-body p { font-size: 1.04rem; color: var(--ds-text-soft); margin: 14px 0 0; }
.uni-body strong { font-weight: 650; color: var(--ds-text); }
.uni-list { margin: 14px 0 0; padding-left: 20px; }
.uni-list li { font-size: 1.04rem; color: var(--ds-text-soft); margin: 8px 0 0; padding-left: 4px; }
.uni-list li::marker { color: var(--ds-muted); }

/* ===== The doorway — stack chooser ==========================================
   The rich entry that routes a visitor to their curated path. Deliberately NOT
   a hollow dropdown — three confident cards, "Both" as the hero (the
   cross-platform moat). Typographic + structural, no decorative icons; the
   per-card path preview reads as substance, Stripe-grade restraint. */
.uni-doorway { max-width: 1140px; margin: 0 auto; padding: 60px 28px 4px; }
.uni-door-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px;
}
.uni-door-card {
  display: flex; flex-direction: column; min-height: 262px;
  background: var(--ds-surface); border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg); padding: 26px 26px 22px;
  text-decoration: none; color: var(--ds-text);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.uni-door-card:hover {
  transform: translateY(-3px); border-color: var(--ds-border-strong); box-shadow: var(--ds-shadow-md);
}
.uni-door-kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ds-muted);
}
.uni-door-title {
  font-size: 1.5rem; font-weight: 640; letter-spacing: -0.01em; line-height: 1.14;
  margin: 14px 0 0; color: var(--ds-text);
}
.uni-door-desc {
  font-size: 0.96rem; line-height: 1.55; color: var(--ds-text-soft);
  margin: 11px 0 0; flex: 1 1 auto;
}
.uni-door-path {
  display: flex; flex-wrap: wrap; gap: 7px 8px;
  margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--ds-divider);
}
.uni-door-path span {
  font-size: 12px; font-weight: 500; color: var(--ds-muted);
  background: var(--ds-surface-soft); border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-pill); padding: 4px 11px; white-space: nowrap;
}
.uni-door-go {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  font-size: 14px; font-weight: 600; color: var(--ds-accent-strong);
}
.uni-door-go svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; transition: transform 0.16s ease;
}
.uni-door-card:hover .uni-door-go svg { transform: translateX(3px); }

/* The moat — the hero card */
.uni-door-card.is-hero {
  border-color: var(--ds-accent);
  background: color-mix(in srgb, var(--ds-accent) 4%, var(--ds-surface));
}
.uni-door-card.is-hero:hover {
  border-color: var(--ds-accent-strong); box-shadow: var(--ds-shadow-md);
}
.uni-door-flag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; background: var(--ds-accent-strong); border-radius: var(--ds-radius-pill);
  padding: 3px 8px;
}

@media (max-width: 860px) {
  .uni-door-grid { grid-template-columns: 1fr; }
  .uni-door-card { min-height: 0; }
}

/* Curation — the JS sets this on lessons/sections/the doorway/the continue bar
   to swap the doorway for the continue bar and trim the courses to the stack. */
.is-stack-hidden { display: none !important; }

/* The quiet returning-visitor bar that replaces the doorway once a stack is set. */
.uni-continue-bar { max-width: 1140px; margin: 0 auto; padding: 40px 28px 4px; }
.uni-continue-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--ds-surface); border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg); padding: 20px 24px;
}
.uni-continue-kicker {
  font-size: 11px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ds-muted);
}
.uni-continue-line { font-size: 1.05rem; color: var(--ds-text); margin: 5px 0 0; }
.uni-continue-line strong { font-weight: 640; }
.uni-continue-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.uni-continue-go {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ds-text); color: var(--ds-bg); text-decoration: none;
  font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: var(--ds-radius-pill);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.uni-continue-go:hover { transform: translateY(-1px); box-shadow: var(--ds-shadow-md); }
.uni-continue-go svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.uni-continue-switch {
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 500; color: var(--ds-muted);
}
.uni-continue-switch:hover { color: var(--ds-accent-strong); text-decoration: underline; }
@media (max-width: 700px) {
  .uni-continue-inner { flex-direction: column; align-items: flex-start; }
}
.uni-body code { font-family: var(--ds-mono); font-size: 0.88em; background: var(--ds-surface-soft); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm); padding: 1px 6px; }

.uni-code { margin-top: 20px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); overflow: hidden; background: var(--ds-bg-soft); }
.uni-code-head { display: flex; align-items: center; gap: 4px; padding: 7px 9px; background: var(--ds-surface); border-bottom: 1px solid var(--ds-border); }
.uni-code-tab { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ds-muted); padding: 5px 12px; border-radius: var(--ds-radius-sm); cursor: pointer; }
.uni-code-tab[aria-selected="true"] { background: var(--ds-text); color: var(--ds-bg); }
.uni-code-copy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ds-border); background: var(--ds-surface); color: var(--ds-muted); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: var(--ds-radius-sm); cursor: pointer; }
.uni-code-copy:hover { color: var(--ds-text); border-color: var(--ds-border-strong); }
.uni-code-copy.is-copied { color: var(--ds-success); border-color: color-mix(in srgb, var(--ds-success) 40%, transparent); }
.uni-code pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.uni-code code { font-family: var(--ds-mono); font-size: 13px; line-height: 1.7; background: none; border: 0; padding: 0; color: var(--ds-text); white-space: pre; }
.uni-code-name { font-size: 12.5px; font-weight: 600; color: var(--ds-muted); padding: 5px 7px; }

/* ============================================================
   THE INTERACTIVE DEMO — an Arcade walkthrough, framed like the
   film. For onboarding / do-it lessons (set up, make selections).
   Drop the Arcade embed inside .demo-frame and it auto-takes over,
   hiding the placeholder. No JS, no per-lesson CSS.
   ============================================================ */
.uni-lesson-demo { width: 100%; padding: clamp(16px, 1.8vw, 26px) var(--gutter) clamp(28px, 3vw, 48px); }
.uni-lesson-demo .demo-frame { max-width: 1320px; margin: 0 auto; }
.demo-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--ds-radius-lg); overflow: hidden; background: #ece7de; border: 1px solid var(--ds-border); box-shadow: var(--ds-shadow-md); isolation: isolate; }
.demo-frame:has(iframe) { aspect-ratio: auto; background: transparent; }
.demo-frame:has(iframe) .demo-empty { display: none; }
.demo-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 15px; text-align: center; padding: 24px; background: linear-gradient(135deg, #f3eee5, #e8e2d7); }
.demo-empty-badge { justify-self: center; display: grid; place-content: center; width: 60px; height: 60px; border-radius: 50%; background: rgba(20, 17, 15, 0.05); color: var(--ds-muted-soft); }
.demo-empty-badge svg { width: 26px; height: 26px; }
.demo-empty-cap { font-size: 13px; font-weight: 500; color: var(--ds-muted); max-width: 40ch; }
.demo-empty-tag { display: inline-flex; align-items: center; gap: 7px; justify-self: center; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ds-muted-soft); }
.demo-empty-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ds-accent); }

/* ============================================================
   THE ONBOARDING STEPPER — walks the real signup flow, step by
   step. Each step quotes the actual screen/button and explains it.
   .uni-ui chips quote real UI labels; the note calls out the moat.
   ============================================================ */
.uni-steps { display: grid; gap: 14px; margin-top: 22px; }
.uni-step { display: grid; grid-template-columns: 34px 1fr; gap: 15px; padding: 18px 20px; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); }
.uni-step-n { display: grid; place-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ds-accent); color: #fff; font-size: 13.5px; font-weight: 700; }
.uni-step-b > h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; color: var(--ds-text); }
.uni-step-b > p { margin: 0; font-size: 14px; line-height: 1.62; color: var(--ds-text-soft); }
.uni-step-b > p + p { margin-top: 9px; }
.uni-ui { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ds-text); background: var(--ds-bg-soft); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-sm); padding: 1px 8px; }
.uni-ui-accent { color: #fff; background: var(--ds-accent); border-color: transparent; }
.uni-step-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.uni-onboard-note { margin-top: 22px; border: 1px solid color-mix(in srgb, var(--ds-accent) 30%, var(--ds-border)); border-left: 3px solid var(--ds-accent); border-radius: var(--ds-radius-lg); background: var(--ds-accent-soft); padding: 18px 22px; }
.uni-onboard-note h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--ds-text); }
.uni-onboard-note p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ds-text-soft); }

/* Left-rail cross-link to the other onboarding stacks (web / iOS / both) */
.uni-rail-switch { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ds-border); display: grid; gap: 7px; }
.uni-rail-altlink { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ds-muted); text-decoration: none; padding: 6px 10px; border-radius: var(--ds-radius); transition: background 0.15s ease, color 0.15s ease; }
.uni-rail-altlink::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ds-border-strong); }
.uni-rail-altlink:hover { background: var(--ds-surface-soft); color: var(--ds-text); }
.uni-rail-altlink:hover::before { background: var(--ds-accent); }

/* The green dashboard result — Pulse's clean green, restrained */
.uni-result { margin-top: 20px; border: 1px solid color-mix(in srgb, var(--ds-success) 26%, var(--ds-border)); border-radius: var(--ds-radius-lg); background: var(--ds-surface); overflow: hidden; }
.uni-result-head { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-bottom: 1px solid var(--ds-border); font-size: 12px; color: var(--ds-muted); }
.uni-result-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ds-success); }
.uni-result-body { padding: 16px; display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.uni-result-badge { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ds-success); background: color-mix(in srgb, var(--ds-success) 11%, transparent); padding: 6px 12px; border-radius: var(--ds-radius-pill); }
.uni-result-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.uni-result-body p { margin: 0; font-size: 14px; color: var(--ds-text-soft); }
.uni-result-foot { padding: 0 16px 14px; }
.uni-result-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ds-accent-strong); text-decoration: none; }
.uni-result-link:hover { color: var(--ds-accent); }
.uni-result-link svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Reference rail */
.uni-toc { display: flex; flex-direction: column; gap: 1px; }
.uni-toc a { font-size: 13px; color: var(--ds-muted); text-decoration: none; padding: 6px 11px; border-left: 2px solid var(--ds-border); transition: color 0.15s, border-color 0.15s; }
.uni-toc a:hover, .uni-toc a.is-active { color: var(--ds-text); border-color: var(--ds-accent-strong); }
/* Related docs — the set of docs this lesson touches (a lesson talks to more
   than one). Lives in the rail, not the top bar. */
.uni-rail-docs { margin-top: 26px; }
.uni-rail-doclist { display: flex; flex-direction: column; margin-top: 12px; }
.uni-rail-doclist a { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ds-muted); text-decoration: none; padding: 9px 0; border-top: 1px solid var(--ds-divider); transition: color 0.15s ease; }
.uni-rail-doclist a:hover { color: var(--ds-accent-strong); }
.uni-rail-doclist svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--ds-muted-soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.uni-rail-doclist a:hover svg { stroke: var(--ds-accent-strong); }
.uni-rail-ref { margin-top: 24px; padding: 15px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); }
.uni-rail-ref small { display: block; font-size: 11.5px; color: var(--ds-muted-soft); margin-bottom: 5px; }
.uni-rail-ref a { font-size: 13.5px; font-weight: 600; color: var(--ds-text); text-decoration: none; }
.uni-rail-ref a:hover { color: var(--ds-accent-strong); }

/* Advance-the-course footer */
.uni-lesson-foot { grid-column: 2; margin-top: clamp(34px, 3.4vw, 56px); padding-top: clamp(24px, 2.6vw, 38px); border-top: 1px solid var(--ds-border); }
.uni-recap { font-size: 1rem; color: var(--ds-text-soft); max-width: 70ch; margin: 0 0 22px; }
/* Was this lesson helpful? — quiet, end of lesson; the one signal CI can't give us */
/* Rail affordances — copied VERBATIM from docs.css so they're identical to
   the dev docs: Was this page helpful + Download PDF / Ask Claude / ChatGPT. */
.doc-rail-helpful { padding: 14px 0; border-top: 1px solid rgba(23, 19, 17, 0.08); }
.doc-rail-helpful-q { display: block; font-size: 12.5px; font-weight: 600; color: var(--ds-text-soft); margin-bottom: 8px; }
.doc-rail-helpful-btns { display: flex; gap: 8px; }
.doc-rail-helpful-btn {
  flex: 1; height: 30px;
  border: 1px solid var(--ds-border); border-radius: var(--ds-radius-sm);
  background: var(--ds-surface); color: var(--ds-text-soft);
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: border-color 120ms, color 120ms;
}
.doc-rail-helpful-btn:hover { border-color: var(--ds-accent); color: var(--ds-accent-strong); }
.doc-rail-helpful-btn:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 1px; }
.doc-rail-helpful-thanks { display: block; font-size: 12.5px; line-height: 1.5; color: var(--ds-muted); }
.doc-rail-actions { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid rgba(23, 19, 17, 0.08); }
.doc-rail-btn {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  font-size: 12.5px; font-weight: 550; color: var(--ds-text); background: #fff;
  border: 1px solid rgba(23, 19, 17, 0.12); border-radius: 8px;
  text-decoration: none; cursor: pointer; text-align: left;
}
.doc-rail-btn:hover { border-color: var(--ds-accent); color: var(--ds-accent-strong); }
.doc-rail-btn svg { width: 14px; height: 14px; flex: none; }

/* Download PDF → print just the lesson body (the print pipeline) */
@media print {
  .uni-header, .uni-coursebar, .uni-lesson-film, .uni-rail, .uni-footer, .doc-rail-actions, .doc-rail-helpful { display: none !important; }
  .uni-lesson-grid { display: block; padding: 0; }
  .uni-lesson-foot { display: none; }
  body { background: #fff; }
}
.uni-foot-actions { display: flex; align-items: stretch; gap: 14px; flex-wrap: wrap; }
.uni-complete { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--ds-border-strong); background: var(--ds-surface); color: var(--ds-text); font: inherit; font-size: 14px; font-weight: 600; padding: 11px 20px; border-radius: var(--ds-radius-pill); cursor: pointer; transition: all 0.18s ease; }
.uni-complete .check { width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid var(--ds-border-strong); display: grid; place-content: center; transition: all 0.18s ease; }
.uni-complete .check svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; opacity: 0; }
.uni-complete:hover { border-color: var(--ds-text); }
.uni-complete.is-done { background: color-mix(in srgb, var(--ds-success) 9%, var(--ds-surface)); border-color: color-mix(in srgb, var(--ds-success) 38%, transparent); color: var(--ds-success); }
.uni-complete.is-done .check { background: var(--ds-success); border-color: var(--ds-success); color: #fff; }
.uni-complete.is-done .check svg { opacity: 1; }
.uni-next { display: flex; flex-direction: column; gap: 2px; padding: 10px 20px; border-radius: var(--ds-radius); text-decoration: none; border: 1px solid var(--ds-border-strong); background: var(--ds-surface); color: var(--ds-text); transition: border-color 0.18s ease, background 0.18s ease; }
.uni-next small { font-size: 11px; color: var(--ds-muted-soft); font-weight: 600; }
.uni-next strong { font-size: 14px; font-weight: 600; }
.uni-next:hover { border-color: var(--ds-muted-soft); background: var(--ds-bg-soft); }
.uni-next.is-primary { background: var(--ds-text); color: var(--ds-bg); border-color: transparent; }
.uni-next.is-primary small { color: rgba(255, 255, 255, 0.65); }
.uni-next.is-primary:hover { background: #000; }
.uni-foot-spring { flex: 1; }

/* ------------------------------------------------------------ Footer ---- */
.uni-footer { width: 100%; padding: 26px var(--gutter); border-top: 1px solid var(--ds-border); background: var(--ds-bg-soft); }
.uni-footer-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--ds-muted); }
.uni-footer-inner a { color: var(--ds-muted); text-decoration: none; }
.uni-footer-inner a:hover { color: var(--ds-text); }
.uni-footer .sep { flex: 1; }

/* ------------------------------------------------------------ ⌘K palette ---- */
.uni-cmdk { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: clamp(60px, 14vh, 160px) 20px 20px; background: rgba(20, 17, 15, 0.32); backdrop-filter: blur(2px); }
.uni-cmdk[hidden] { display: none; }
.uni-cmdk-box { width: 100%; max-width: 560px; background: var(--ds-surface); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-lg); box-shadow: 0 24px 70px -20px rgba(20, 17, 15, 0.45); overflow: hidden; }
.uni-cmdk-head { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 50px; border-bottom: 1px solid var(--ds-border); }
.uni-cmdk-ic { width: 16px; height: 16px; color: var(--ds-muted-soft); flex: none; }
.uni-cmdk-input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ds-text); }
.uni-cmdk-input::placeholder { color: var(--ds-muted-soft); }
.uni-cmdk-esc { font-size: 10.5px; font-weight: 600; color: var(--ds-muted-soft); border: 1px solid var(--ds-border); border-radius: 5px; padding: 2px 6px; }
.uni-cmdk-list { max-height: min(50vh, 380px); overflow-y: auto; padding: 6px; }
.uni-cmdk-group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ds-muted-soft); padding: 12px 10px 5px; }
.uni-cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--ds-radius-sm); cursor: pointer; }
.uni-cmdk-item.is-active { background: var(--ds-bg-soft); }
.uni-cmdk-t { flex: 1; font-size: 14px; color: var(--ds-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uni-cmdk-go { font-size: 13px; color: var(--ds-muted-soft); opacity: 0; }
.uni-cmdk-item.is-active .uni-cmdk-go { opacity: 1; }
.uni-cmdk-soon { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ds-muted); background: var(--ds-border); padding: 2px 8px; border-radius: var(--ds-radius-pill); }
.uni-cmdk-empty { padding: 22px 12px; text-align: center; font-size: 13.5px; color: var(--ds-muted); }

/* ------------------------------------------------------------ Reveal ---- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ Responsive ---- */
@media (max-width: 1040px) {
  .uni-lesson-grid { grid-template-columns: minmax(0, 1fr) minmax(200px, 260px); }
  .uni-rail-left { display: none; }
  .uni-lesson-foot { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .uni-lesson-grid { grid-template-columns: minmax(0, 1fr); }
  .uni-rail-right { display: none; }
  .uni-course-head { grid-template-columns: 1fr; }
  .uni-progress { text-align: left; min-width: 0; }
}
@media (max-width: 520px) {
  .uni-foot-actions { flex-direction: column; }
  .uni-next, .uni-complete { width: 100%; }
  .uni-foot-spring { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  a.uni-lcard:hover, .film-poster:hover .film-play { transform: none; }
  .uni-progress-fill, .uni-cb-bar-fill, .film-poster { transition: none; }
}
