/**
 * Blinklink Super Feed - Main CSS file
 * 
 * This file contains all the CSS styles for the application,
 * organized in a modular way for better maintainability.
 */

:root {
    --primary-color: #E1251B;
    --primary-color-light: color-mix(in srgb, var(--primary-color) 10%, white);
    /* The page surface (.main and anything that must read as the same sheet, e.g.
       .feeds-end-loader) — fainter than -light, which stays the hover/badge tint. */
    /* !!! EVERY MIX IN THIS BLOCK IS RE-DECLARED INLINE ON <body> (layout.html) !!!
       A color-mix custom property is computed at its DECLARATION scope, so the copies here
       resolve against the default red above, not against the tenant's --primary-color — and
       descendants inherit that computed value. The <body> copies are what make a token
       tenant-aware; these are the fallback for a page that somehow renders without them.
       ADDING A DERIVED TOKEN HERE MEANS ADDING IT THERE TOO. --primary-soft shipped to :root
       alone and painted the default red's tint on every dynamic-primary tenant until a client
       reported it. test_every_primary_derived_root_token_is_redeclared_on_body now fails the
       build on the next one, so this comment explains the rule rather than being the only
       thing enforcing it. */
    --main-surface-color: color-mix(in srgb, var(--primary-color) 4%, white);
    /* One more rung on the same tint ladder: light enough to read as a kicker on
       top of a dark image (Figma paints it #FFD9C2 on the Talabat primary), yet
       tenant-derived, so a non-red primary tints it too. */
    --primary-mid: color-mix(in srgb, var(--primary-color) 24%, white);
    /* 8% — the sidebar's active header box (Figma "Skills LMS Today version" 35094:56421 +
       the prototype's .side .snav.act). Distinct from --primary-color-light's 10%, which is
       the fill every other active row in the app uses. */
    --primary-soft: color-mix(in srgb, var(--primary-color) 8%, white);
    --course-completion-color: #008000;
    /* The player card's portrait width — the video container and the quiz
       question card both use it, and so do the two side panels that are meant to
       read as their twin (.quiz-result-panel statically, .concept-track-list as a
       pre-JS fallback before alignPanel() measures the real video box). */
    --player-card-width: 50dvh;
    /* Width of the FEED's docked side panels (comments, description) and the
       space a landscape video track reserves beside itself for one. The course
       tracker no longer uses it: alignPanel() sizes that panel from the video's
       measured box so it twins the player at any aspect ratio. */
    --course-panel-width: 55dvh;
    /* Ceiling on the course player's card + panel PAIR. Both cards are sized from
       viewport height (50dvh), so on a tall screen the pair grows without limit and
       runs to the edges — at 2560x1440 it would want 1456px, and on a square-ish
       1440x1440 it would overflow entirely. Capping the pair's container and
       centring it keeps symmetric gutters and lets the cards flex down together.
       1200px keeps the pair near the design's proportions (its frames are ~798px
       of player+panel at 610px tall, i.e. pair ≈ 1.3x height; 1200 is that ratio at
       a ~920px-tall window, which is where most desktops sit) while still leaving
       real breathing room at 1920 and 2560.
       The 10rem subtrahend is the side gutter, sized to clear the up/down arrows
       (.tracks-navigation: right 1rem + a 3rem button = 64px) with margin to spare
       on narrow-but-tall windows, where the pair is widest relative to the screen.
       On 1440 and above the 1200px term wins and the subtrahend never binds. */
    --course-pair-max-width: min(100vw - 10rem, 1200px);
    font-size: 16px;
}

/* Carries the vh fallbacks for the tokens above, so their consumers no longer
   each need their own @supports override. */
@supports not (height: 1dvh) {
    :root {
        --player-card-width: 50vh;
        --course-panel-width: 55vh;
    }
}

/* Globally allow panning but block pinch-zoom */
html, body {
    touch-action: pan-x pan-y;
}

/* ===== RESET AND BASE STYLES ===== */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
body {
    min-height: 100vh;
    min-height: 100dvh;
    /*font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;*/
    line-height: 1.5;
    font-size: 1rem;
    color: #333;
    background-color: #fff;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    font-family: 'Lato', sans-serif;
}
img { max-width: 100%; display: block; height: auto; }
a { color: #000; text-decoration: none; }
a:hover { text-decoration: none; }

/* ===== SHARED COMPONENTS ===== */

/* === Close button ===
   The one close ("X") affordance for every panel header, modal, drawer and
   sheet. Rendered by the close_button() macro in templates/components/
   close_button.html — call sites add their own class for JS/tracking hooks but
   must not restate any of the visuals below.

   Deliberately placed above the feature sections: several call sites are hidden
   by default and revealed in a media query (.sidebar-close,
   .quiz-result-dismiss). Those are single-class selectors like .app-close-btn,
   so only source order keeps their `display: none` winning over the
   `inline-flex` here. */
/* ── .visually-hidden ────────────────────────────────────────────────────────
 * Off-screen for sight, present for assistive tech AND still focusable.
 *
 * THIS RULE WAS MISSING, and three templates already used the class — so a
 * `<span class="visually-hidden">` rendered as ordinary visible text and a
 * `<input type="file" class="visually-hidden">` drew the browser's native
 * "Choose File / No file chosen" chrome. In the Edit Profile modal that put a
 * stray label and a file picker in the middle of the sheet, and the input's
 * in-flow box overlapped the "Bio" label below it. (Client screenshot review,
 * 2026-09-15.) A comment near .you-edit-label already described the class as
 * though it existed; only the rule was absent.
 *
 * The clip technique, NOT `display: none` and NOT `visibility: hidden`: both of
 * those drop the element from the accessibility tree and make it unfocusable,
 * which would break the camera badge — the file input must still be reachable
 * by keyboard for the badge's `for=` association to mean anything.
 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.app-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 24px icon + 10px on each side = a 44x44 pointer target without scaling
       the glyph. */
    padding: 0.625rem;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

/* Attribute-sized already; restated so a container's `svg { width: … }` cannot
   shrink the glyph. pointer-events keeps the button itself the click target,
   which the delegated handlers rely on. */
.app-close-btn svg {
    width: 1.5rem;
    height: 1.5rem;
    pointer-events: none;
}

.app-close-btn:hover {
    opacity: 0.7;
}

/* Canonical focus ring — every close button in the app gets this one. */
.app-close-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .app-close-btn {
        transition: none;
    }
}

/* ===== LAYOUT ===== */
.layout {
    display: grid;
    /*grid-template-columns: minmax(200px, 1fr) 4fr;*/
    /*grid-template-areas: */
    /*    "sidebar header"*/
    /*    "sidebar main"*/
    /*    "sidebar footer";*/
    grid-template-columns: 260px 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #ffffff;
}

/* ===== SIDEBAR ===== */
/* Sidebar Styles */
.sidebar {
    display: flex;
    flex-direction: column;
    /* Figma 35094:56421: 16 top / 12 bottom / 8 sides. The narrower sides are what let the
       header boxes read as boxes rather than as a column inset from the panel. */
    padding: 16px 8px 12px;
    background-color: #ffffff;
    /*border-right: 1px solid #f0f0f0;*/
    /*width: 240px;*/
    overflow-y: auto;
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.brand-logo {
    height: 32px;
    margin-right: 8px;
}

.brand-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    /*margin-bottom: 8px;*/
}

/* ── Header ↔ submenu separation ──
   Figma 35094:56421 wraps each section in a flex column with `gap: 4px` ("Skills Container"
   and "Feed Contaner" both), whose two children are the header box and the Sub-Container of
   rows. Without it the active row's highlight touched the header box above it and the two
   read as one welded shape — the client's report.

   MARGIN-TOP ON THE SUBMENU, not a gap on .sidebar, and the difference matters:
   - `.sidebar` is one flat flex column of headers, submenus, dividers, the mobile-only Login
     <ul> and .sidebar-version. A `gap` there would space ALL of those, including the
     divider that is supposed to sit tight between sections — Figma's gap is scoped to the
     inside of a section, and so is this.
   - Every `.sidebar-section` in layout.html is emitted directly after its own header <ul>
     (Skills' two rows, the Feed filters via nav_submenu(), the You section's My Skills +
     Logout), so "top margin on the submenu" and "gap after the header" are the same 4px in
     this DOM, in one declaration, with no :has() and no per-section rule.

   Both bands that show submenus get it from this one rule — the desktop sidebar and the
   phone drawer render the same markup. The 769-1270 card rail is untouched BY CONSTRUCTION:
   it sets `.sidebar-section { display: none }` (~5345), and a display:none box contributes
   no margin, so the rail's own `.sidebar > .nav { margin-top: 8px }` rhythm is unchanged. */
.sidebar-section {
    margin-top: 4px;
}

/* A SUBMENU row (Figma 35094:56421 "Skills Sub-Container" etc.): 32px tall, 16px inline
   padding, 16px icon-to-label gap. Deliberately UN-BOXED — no border, no fill until hover or
   active — which is what makes the three section headers below read as the boxes.
   The section headers match this selector too and override the geometry; their rules follow
   this one in source order, which is what decides it (both are one class deep).

   RADIUS 8px — SETTLED, and this comment is the definitive version because the question
   flipped once already. Read this before changing it.

   In Figma a submenu row is TWO nodes: an outer container, and a nested "Hovar" layer
   (`absolute inset-0 overflow-clip rounded-[8px]`) holding the fill. **The container has no
   fill in any state — the Hovar layer is the entire visible highlight.** So the container's
   radius is unobservable, which is exactly why nobody noticed it is inconsistent between rows
   (mostly `rounded-[70px]`, but the Feed "All" row is `rounded-[4px]`).

   An earlier pass read the containers, counted 11 pills against 1, and shipped a 70px capsule.
   That was measuring the wrong element. The ACTIVE-STATE variant of the same frame settles it:
   node **35094:53627**, whose selected Feed "All" row (`I35094:53627;35166:41969;35166:41602`)
   carries no fill on the container while its Hovar (`;35166:41603`) paints
   `bg-black opacity-5` at **`rounded-[8px]`, `inset-0`** — a full-width, 8px-cornered slab.
   Every Hovar in that node is `rounded-[8px]`: both Skills rows, all four Feed rows, the
   "Show more" toggle and all six Following rows. There is no 11:1 vote to take; the painted
   state layer is 8px, unanimously.

   We have no separate overlay element — the row paints its own background — so this radius IS
   the highlight's radius, and it must match the Hovar, not the container. 8px also matches the
   section header boxes, which is the design's own family resemblance.
   DO NOT re-derive this from the containers' `rounded-[70px]`; that value never paints. */
.nav-link {
    display: flex;
    align-items: center;
    height: 32px;
    padding: 0.5rem 1rem;
    gap: 1rem;
    border-radius: 8px;
    /*color: #666;*/
    text-decoration: none !important;
    transition: all 0.2s;
}

/* THE LABEL. Bare-element selector, so it also matches any other <span> a row contains —
   which is how it swallowed the emoji icon span (see the `.nav-link span.nav-icon` exception
   at ~595, and keep the two in step). `.nav-link-count`'s pill needed re-scoping to (0,2,0)
   for the same reason; this rule is the one to look at whenever something in a row is
   mysteriously full-width, faded to 60%, or ellipsized. */
.nav-link span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;

    /* 12px/400 at 60% — the Figma row's "Caption Regular". The section headers restate
       this at 14/600 in full black. */
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    opacity: 0.6;
}

.nav-link svg {
    opacity: 0.6;
}

/* Neutral grey, not a brand tint: the prototype reserves the primary colour for the ACTIVE
   item, so a primary-tinted hover made every hovered row look selected. */
.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
    text-decoration: none !important;
}

/* THE SELECTED ROW — NEUTRAL, not branded (client issue #16).
   The sidebar's selection model is ADDITIVE: on a bucket page the section HEADER is lit as
   the tinted box AND this row is lit as well. They must not look alike, or two lit things
   read as two competing claims instead of "you are here, inside this section". So the
   brand belongs to the header and the row gets a neutral slab.
   Figma 35094:53627's selected Feed "All" row is exactly this: its Hovar layer paints
   `bg-black opacity-5` at r8, and its label is "Caption Semibold" 12/600 in FULL black —
   dropping the 60% opacity every unselected row carries. That weight-and-opacity change is
   the row's own signal, doing the job the brand tint used to do.
   It used to be `--primary-color-light` behind primary ink; see the header rule below for
   the treatment that survives. */
.nav-link.active {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-link.active svg {
    opacity: 1;
}

/* Full black at 600 — the selected row's whole distinction from its siblings now that it
   carries no colour. `.nav-link span` sets 0.6/400; this is (0,2,1) and beats it. */
.nav-link.active span {
    opacity: 1;
    font-weight: 600;
    color: #000;
}

/* Bucket total at the end of a Skills submenu row (Figma "Side Bar" 22012:25601, pill nodes
   34068:28700/28707/28714). GREY — rgba(0, 0, 0, 0.1) — deliberately NOT the tab strip's
   white .skills-tab-count: that one sits on the tinted page sheet, this one sits on the
   sidebar's white surface, and on an active row's tinted background a white pill would read
   as a second selection.

   SCOPED AS `.nav-link .nav-link-count` (0,2,0), not the bare class (0,1,0), because
   `.nav-link span` (0,1,1) already claims every span in a row — flex: 1, 0.875rem,
   opacity: .6. A bare rule loses to it, and the pill then stretches to half the row and
   renders at label size. (Same re-scoping the shared progress-pie rules needed.)

   opacity stays 1 with the 60% in `color`: element opacity fades the BACKGROUND too, which
   would turn the design's 10% grey into 6%. `.nav-link.active span { opacity: 1 }` outranks
   this on that property alone and agrees with it, so the active row changes nothing — Figma
   draws no active variant for the pill and it stays grey.

   SELF-CENTRING, not padding-tuned. Figma's padding (4px 7px 4px 8px) assumes TT Commons
   metrics; against the fallback stack the client's screenshot caught it. MEASURED (QA,
   dsf=8): the digit's advance box sat 0.50px RIGHT of the pill's centre (the 8/7 asymmetry
   — sub-pixel, but it reads because the pill is only 20px across), and the pill itself was
   20.625px wide, not a circle. Flex-centring + symmetric padding takes the horizontal to
   exactly 0 and makes one digit a true 20x20 circle. The VERTICAL was ~centred before and
   after (both recipes centre the line box; the ~0.06px residual is the font's own ink
   offset in its em box) — do not add padding to chase it.
   So the box centres its own content instead: a flex centre on both axes, line-height 1 so
   the line box is the em box and `align-items: center` has the whole 20px to work with, and
   SYMMETRIC horizontal padding so dx is 0 by construction. min-width 20 + height 20 keeps the
   rendered size the padding recipe produced (~20.6 x 20) while making one digit a true circle;
   two and three digits grow past the min-width on the padding alone.
   The 20px box is still under the row's own 21px label line box, so the 40px row is unchanged.
   .skills-tab-count in the tab bar is the same construction with a white fill — keep them in
   step. */
.nav-link .nav-link-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.625rem;
    font-weight: 400;
    line-height: 1;
    opacity: 1;
}

/* ── Section header: the BOX ──
   Figma 35094:56421 ("Skills  Tab" / "Feed Tab" / "You Tab"): 40px tall, r8, a 1px
   rgba(0,0,0,.1) hairline, 8px inline padding, 8px gap, icon + label + a chevron pinned to
   the right edge. This is the client's "main menu as a box".
   Geometry only — every active/aria/htmx behaviour is unchanged, and the classes the active
   state keys on (.active here, .is-section-active in the rail) are the same ones.
   The r8 here now AGREES with the row rule above (both 8px — see the settled radius note
   there), so the radius no longer depends on the cascade. SOURCE ORDER is still load-bearing
   for everything else this rule overrides: height 40 vs 32, `0 8px` vs `0.5rem 1rem`, gap 8
   vs 16, and the border the rows do not have. Both selectors are one class deep, so this rule
   must stay BELOW `.nav-link` in the file. */
.nav-link--skills {
    justify-content: flex-start;
    height: 40px;
    padding: 0 8px;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
/* 14/600 in full black — the box's own label, a step up from the 12/400/60% rows. */
.nav-link--skills span {
    flex: none;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 1;
}
/* Pinned right whatever the label's width, which is what `flex: none` on the label leaves
   room for. 16px, overriding the SVG's own 20px width/height attributes. */
.nav-link--skills-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-inline-start: auto;
}
/* Scoped to (0,2,0) ON PURPOSE: the bare class is (0,1,0) and loses the resting value to
   `.nav-link svg { opacity: 0.6 }` at (0,1,1) — the .55 never rendered until this rule
   outranked it. The active/hover variants below are (0,2,0)+ and always won. */
.nav-link .nav-link--skills-arrow {
    opacity: 0.55;
}
.nav-link--skills.active .nav-link--skills-arrow,
.nav-link--skills:hover .nav-link--skills-arrow { opacity: 1; }

/* REQUIRED, and it is the F2 regression: the selected ROW's label rule
   `.nav-link.active span { color: #000 }` is (0,2,1), which out-ranks the brand ink this
   box passes down through `color` on the <a>. So the header rendered as a tinted box with a
   brand icon and chevron and a BLACK label — on /course/all/ and /course/completed/ too,
   where no row is even lit. (0,3,1) puts it back. The row's black label is right for the
   row; it must not reach the header.
   BOTH CLASSES in the selector, which is not redundant: `.nav-link--skills.active span` is
   (0,2,1) — the SAME specificity as the row rule — so it would win only by sitting later in
   the file, and this sheet has already been bitten twice by equal-specificity pairs settled
   by source order (the drawer's radius, the count pill). Every header carries
   `class="nav-link nav-link--skills"`, so naming both makes it (0,3,1) and it wins
   wherever either rule moves. */
.nav-link.nav-link--skills.active span {
    color: var(--primary-color);
}

/* ACTIVE box: the 8% tint inside a 24% border, with the label, icon and chevron all taking
   the brand colour through currentColor. The generic .nav-link.active rule above is one
   class deep too, so it is SOURCE ORDER that puts this in front — keep it below that rule. */
.nav-link--skills.active {
    background-color: var(--primary-soft);
    border-color: var(--primary-mid);
    color: var(--primary-color);
}
/* Hover, non-active: neutral, with the hairline darkening just enough to read as a lift. */
.nav-link--skills:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.18);
}
/* Hover ON the active box keeps its tint and firms the border to the full brand colour,
   rather than falling back to the neutral hover above. */
.nav-link--skills.active:hover {
    background-color: var(--primary-soft);
    border-color: var(--primary-color);
}

/* === Collapsible submenu ("View N more") ===
   Rendered by components/nav_submenu.html. One mechanism for every sidebar
   submenu; a new menu opts in purely by calling the macro.

   The collapse animates grid-template-rows 0fr -> 1fr on the wrapper. That is
   the one technique that eases to the content's OWN height without JS measuring
   it or a max-height guess that clips long course titles. Browsers that cannot
   interpolate fr (pre-Chrome 107 / Safari 16.4) simply snap open — the row still
   gets its full height, so the feature degrades to an instant toggle. */
.nav-submenu-tail {
    display: grid;
    grid-template-rows: 0fr;
    /* Collapse is the faster direction — see the opening override below. */
    transition: grid-template-rows 0.16s ease;
}

.nav-submenu-tail.is-open {
    grid-template-rows: 1fr;
    transition-duration: 0.24s;
}

/* The single grid child. Both are required for the 0fr row to actually clip:
   min-height:0 lets the track go below content height, overflow hides the
   remainder while it does. */
.nav-submenu-tail > ul {
    overflow: hidden;
    min-height: 0;
}

/* Reveal: each row fades and settles down into place. Base state is also the
   COLLAPSE state, so it carries the quick duration and no delay — closing should
   feel like a dismissal, not a reversed performance. */
.nav-submenu-tail .nav-item {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

/* Opening: 30ms per row. Putting the delay on the .is-open state is what makes
   the asymmetry work — adding the class introduces the stagger, removing it
   reverts to the undelayed base above, so the collapse snaps shut together. */
.nav-submenu-tail.is-open .nav-item {
    opacity: 1;
    transform: none;
    transition-duration: 0.2s;
    transition-delay: calc(var(--nav-submenu-i, 0) * 0.03s);
}

/* Aligned with the rows it controls and deliberately quieter than them: this is
   an affordance, not a destination. */
.nav-submenu-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    /* Matches .nav-link's box exactly so the row sits on the same rhythm. */
    padding: 0.5rem 1rem;
    border: none;
    /* Matches .nav-link's 8px — this IS a submenu row in the design, and its own Hovar layer
       (35094:53627 "Filter 3" / "Show more", node `;35166:41670`) is `rounded-[8px]` like
       every other row's. Its :hover below paints a real fill, so this radius is visible and
       has to agree with the rows it sits under. */
    border-radius: 8px;
    background: none;
    color: rgba(0, 0, 0, 0.55);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 150%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Logout lives in the You submenu below desktop; above 1270px the header's user menu is
   the logout home. Hidden by default and turned on inside the <=1270px header-chrome
   block, mirroring how .bottom-nav owns its own visibility — one query decides, and no
   other rule needs to know about this row.
   Deliberately NOT .mobile-only: that helper's display:flex !important is pinned to
   <=768px and would both fight the band and force the wrong display type on an <li>. */
.nav-item--logout {
    display: none;
}

/* The sidebar's own hover language, so the row reads as part of the nav. */
.nav-submenu-toggle:hover {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
}

.nav-submenu-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Rotate rather than swap glyphs — the chevron is the same object throughout,
   which is what makes the state change legible. Driven off aria-expanded so the
   accessible state is the single source of truth. */
.nav-submenu-toggle-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-submenu-toggle[aria-expanded="true"] .nav-submenu-toggle-chevron {
    transform: rotate(180deg);
}

.nav-submenu-toggle-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Tablet rail (769-1270px): labels are hidden throughout the sidebar, so this
   row becomes its chevron alone, centred on the icon column like every rail
   item. It still reads as an expand affordance, and the chevron still rotates. */
@media (min-width: 769px) and (max-width: 1270px) {
    .nav-submenu-toggle {
        justify-content: center;
        padding: 0.5rem;
        gap: 0;
    }

    .nav-submenu-toggle-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-submenu-tail,
    .nav-submenu-tail.is-open,
    .nav-submenu-tail .nav-item,
    .nav-submenu-tail.is-open .nav-item,
    .nav-submenu-toggle,
    .nav-submenu-toggle-chevron {
        transition: none;
    }

    /* No stagger to wait on — rows are simply there. */
    .nav-submenu-tail.is-open .nav-item {
        transition-delay: 0s;
    }
}
/* 16px in the new design (was 24). OUR artwork, scaled by CSS — the glyphs are the
   client-approved ones and their viewBoxes are untouched; only the rendered box shrinks.
   margin-right is gone: .nav-link's 16px gap is the one thing spacing icon from label. */
.nav-icon {
    width: 1rem;
    height: 1rem;
    stroke: black;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* An icon must never flex. `.nav-link span { flex: 1 }` (~262) is written for the LABEL, but
   it is a bare-element selector and the EMOJI branch of components/filter_icon.html renders
   its icon as `<span class="nav-icon">` — so the label rule claimed the icon, gave it
   `flex: 1`, and the 16px box stretched across the row: the label got shoved to the right
   behind a huge gap and then ellipsized. Live client bug on /course/all/ for emoji tenants.
   The other three branches (<img>, <i>, <svg>) were immune only because nothing matched them,
   NOT because they were protected — they still carried the initial `flex-shrink: 1` and could
   squeeze in a tight row. This rule is deliberately broad enough to cover all four: no icon,
   in any branch, should ever grow or shrink. */
.nav-link .nav-icon {
    flex: 0 0 auto;
}

/* The emoji box itself — the only branch that is TEXT, so the only one whose glyph is sized
   by font-size rather than by the 16px box `.nav-icon` gives it. Same construction the home
   filter bar already uses for the identical markup (`.filter-btn-icon`, ~1369: a flex-centred
   box whose font-size equals its own size), so the two call sites of one macro stay in step.
   Both of these undo the label rule, and both are load-bearing:
   - `overflow: visible` — an emoji's advance is wider than its em square, so under the label
     rule's `overflow: hidden` + `text-overflow: ellipsis` a clipped glyph can render as "…".
   - `line-height: 1` — the label's 150% would build a 24px line box inside a 16px-tall box
     and the glyph would sit off-centre and overhang.

   0.8rem = 12.8px, and it is MEASURED, not derived by dividing: colour-emoji ink runs about
   1.25x the font-size, and it does not scale linearly (these fonts snap to bitmap strikes),
   so the size that fills a 16px box had to be swept. Rasterised ink, four glyphs, this
   stack: 11px -> 14x14, 12px -> 15x15, **12.8px -> 16x16**, 14px -> 18x18, 16px -> 20x20.
   So `font-size: 1rem` — the obvious guess, and what the box is — renders 20px of ink: 25%
   bigger than the 16x16 svg icons in the same column, overflowing the box on all four sides.
   12.8px lands the ink on exactly 16x16, matching those siblings.
   The emoji resolves through font FALLBACK (the app's stack has no emoji glyphs), so the
   actual face is Apple Color Emoji / Noto Color Emoji / Segoe UI Emoji by platform. Those
   agree closely on the 1.25x ratio, and any residual difference only makes the glyph a
   fraction larger or smaller INSIDE a flex-centred box — it cannot move the label or the row.
   Opacity is deliberately NOT touched: the emoji inherits the label rule's .6, which is what
   `.nav-link svg` gives every sibling icon, and `.nav-link.active span` takes it to 1 on the
   active row exactly as `.nav-link.active svg` does. */
.nav-link span.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    font-size: 0.8rem;
    line-height: 1;
}
/* The section headers' 24px icon. It used to be hidden everywhere except the 769-1270px
   card rail, because the desktop header was text + chevron only; the new design
   (Figma 35094:56421) puts an icon in every header box, at every width, so it is simply
   visible now. The rail band restates the size and takes it to full opacity — there the icon
   is the whole card. Its 60% resting opacity comes from .nav-link svg. */
.nav-card-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* .nav-icon--thumb removed with its only consumer: the Skills submenu's course rows, which
   put a course thumbnail where a glyph normally goes. That submenu is now two fixed rows with
   line glyphs (layout.html ~:343) and no nav row anywhere renders an <img> any more. */

.nav-divider {
    background: rgba(0, 0, 0, 0.10);
    padding: 0.5px 0;
    margin: 0.5rem 0;
}

.section-title {
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    color: #333;
    margin: 0 0 0.25rem 1rem
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-item {
    margin-bottom: 8px;
}

.user-link {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    color: #666;
    text-decoration: none !important;
    transition: all 0.2s;
}

.user-link:hover {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    text-decoration: none !important;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

.user-link:hover .user-name {
    color: var(--primary-color);
}

/* ===== MAIN CONTENT ===== */
.main {
    grid-area: main;
    /* 1rem = the design's 16px gap between the tinted sheet's top edge and the first
       content (Figma 378-7556 / 378-30754). One shorthand covers every breakpoint — the
       old mobile override here is commented out — so both web and mobile get it from this
       single declaration. Pages must NOT add their own top padding on top of it. */
    padding: 1rem;
    overflow-y: auto; /* Enable scrolling for main content */
    position: relative;
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
    /* Tinted content sheet rounding against the white header (Figma 378-7556 web,
       378-30754 mobile). From the token, never a literal, so it follows the tenant's
       primary — .layout behind it is #fff, which is what the rounded corners reveal.
       24px matches the app's existing sheet radius (the mobile bottom sheets, ~6527);
       there is no radius token yet, so the value is stated once here.
       overflow-y: auto already forces clipping on both axes, so children are held
       inside the corners with no extra rule.

       EVERY page gets this, players included. The feed (#000) and track (#FFF) containers
       fill .main's content box exactly — its 1rem padding plus the 56px header allowance
       equals their calc(100dvh - 88px) — so the tint reads as a 16px frame around the
       player: the player as a card on the app's surface. Neither container carries a
       radius of its own, so the tint also fills the gap inside .main's rounded top
       corners, which is the same surface-behind-card effect.
       At <=768px both containers go position: fixed / 100dvh and cover the viewport
       entirely, so the frame is a desktop-only treatment and mobile is unchanged.

       RADIUS IS ASYMMETRIC ON DESKTOP ONLY — see the min-width override below. This base
       value (both top corners) is what mobile AND tablet resolve. */
    background: var(--main-surface-color);
    border-radius: 24px 24px 0 0;
}

/* DESKTOP rounds the top-LEFT corner ONLY. This is the design, not an oversight: with the
   sidebar present, the sheet butts against it on the left and runs to the viewport edge on
   its right, so a right-hand arc would round against nothing. Please do NOT "restore"
   symmetry here.
   A happy side effect: nothing has to defend a right-hand arc from the scrollbar gutter,
   which is why this file carries no custom scrollbar styling for .main.

   THE BOUND IS 769px: the rule keys on the one thing it was ever really about — whether
   a sidebar column sits to the left — which is true for both the tablet rail (769-1270)
   and the full desktop sidebar. (During the 2026-08 dock experiment the tablet had no
   sidebar column and this bound briefly moved to 1271; it moved back with the rail.)
   Both top corners resolve from the base rule only at <=768, where the sheet spans the
   full width.
   Slave mode is unaffected: `.layout--hide-header .main { border-radius: 0 }` is a
   top-level two-class rule, so it outranks this one at every width. */
@media (min-width: 769px) {
    .main {
        border-radius: 24px 0 0 0;
    }
}



/* ===== HEADER ===== */
.header {
    grid-area: header;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* FIX: was `0.5rem 1.5rem 0 1.5rem` — 8px top, 0 bottom. align-items: center was
       already here, but it centres children in the CONTENT box, and asymmetric vertical
       padding moves that box's centre off the header's: content box 48px starting 8px
       down puts its centre at 32px against the header's 28px, so EVERY child — logo,
       search bar, profile menu — sat 4px low. That is what read as the search bar
       sitting close to the main surface.
       Zero vertical padding lets the 56px height be the whole box, so `center` means the
       header's actual centre. It also leaves more headroom than a symmetric 0.5rem would:
       the content box stays 56px rather than 40px, which matters because the tenant logo
       height is configurable (config.global_theme.logoHeight) and could exceed 40px.
       Mobile already had symmetric padding (0.5rem 1rem) and was correctly centred — it
       is deliberately left alone. */
    padding: 0 1.5rem;
    /* Minimum breathing room between neighbours (logo / search / account menu):
       space-between only distributes LEFTOVER space, so on narrow tablets the
       flex:1 search bar could butt against the account menu without this. Inert
       when there is slack — the gap only binds once space-between hits zero. */
    gap: 1rem;
    width: 100vw;
    height: 56px;
    /*border-bottom: 1px solid #dee2e6;*/
    background-color: #fff;
    z-index: 1000;
    font-size: 0.75rem; /* Reduced font size to match height reduction */
}
.header h4 {
    font-size: 0.875rem; /* Smaller heading size to match reduced height */
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #F9F9F9;
    border-radius: 2.5rem;
    /*padding: 8px 16px;*/
    flex: 1;
    max-width: 31.25rem;
    height: 2.5rem;
    padding: 0.5rem 0.25rem 0.5rem 0.75rem;
    gap: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.10);
}


.search-icon {
    /*margin-right: 8px;*/
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0.6;
}

/* Vertical centring for EVERY search field's clear-X — the header's and the mobile
   overlay's — in one rule, so the two cannot drift apart.
   ROOT CAUSE this replaces: `align-self: start`. An absolutely-positioned child of a
   flex container is not a flex item, but its STATIC POSITION still resolves through the
   container's alignment, so align-self:start pinned the icon to the TOP of the content
   box rather than the centre — 2px high in the 40px header, 11px high in the 44px
   overlay field, which is why the overlay looked far worse.
   top:50% + translateY(-50%) centres against whatever height the field happens to be,
   so a future field needs no new numbers.
   The horizontal inset genuinely differs (each field has its own padding), so it is a
   token with the header's value as the default rather than a second hardcoded rule. */
.search-clear-icon {
    position: absolute;
    right: var(--search-clear-inset, 16px);
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.search-clear-icon:hover {
    opacity: 1;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding-right: 30px; /* Space for clear icon */

    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    opacity: 0.7;
}

.search-title-container {
    color: #000;
    font-size: 1rem;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    padding-top: 4px;
    padding-bottom: 1rem;
}

.search-text {
    color: var(--primary-color);
    font-weight: 700;
}

/* Sidebar close button (mobile only) */
.sidebar-version {
    padding: 0.75rem 0;
    font-size: 0.7rem;
    color: #888;
    text-align: center;
    opacity: 0.6;
}

/* Visuals come from .app-close-btn; only placement and the mobile-only
   visibility toggle live here. */
/* Pinned to the drawer's top-right corner. Only ever visible inside the drawer (the
   <=768px responsive block turns it on), so these offsets are drawer geometry.

   6px, NOT 16px, and the difference is the whole fix: .app-close-btn carries 0.625rem
   (10px) of padding to reach a 44x44 pointer target, so its 24px glyph sits 10px inside
   its own box. 6 + 10 puts the GLYPH on the 16px optical inset the design asks for, while
   the transparent remainder of the target overhangs into the drawer's padding where it
   costs nothing. Setting top/right to 16 directly would read as ~26px of air.

   WHY IT USED TO COLLIDE: at top 0.5rem/right 0.75rem the 44px box spanned y 8-52px,
   straight through the first nav row, which the drawer's 20px padding starts at y 20.
   Two earlier changes compounded — the close-button unification grew this control from a
   bare glyph to a 44px target, and the drawer kept a uniform 20px padding with no room
   reserved for it. The drawer's padding-top now reserves that room; the two values are a
   pair and must move together. */
.sidebar-close {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
}

.mobile-buttons {
    display: none;
    align-items: center;
    gap: 1rem;
}

.search-mobile {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.125rem;
}

.login-btn {
    display: flex;
    padding: 0.5rem;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid rgba(0, 0, 0, 0.10);
    background-color: #ffffff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 6rem;
}

/* === Header user pill: avatar badge ========================================= */
/*
 * Figma 32323-27836. Same initial-badge family as .bottom-nav-avatar and .you-avatar;
 * the family rule is that the badge contrasts with ITS OWN ground, so the variant is
 * chosen per surface rather than copied. The pill is #ffffff, so this takes the bottom
 * nav's orientation — tint circle, primary letter — because the You page's white-on-tint
 * inversion would be invisible here.
 */
.user-pill-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color-light);
    color: var(--primary-color);
    font-family: "TT Commons", sans-serif;
    /* 14px on a 28px circle is the 1:2 ratio .bottom-nav-avatar uses at 12/24. */
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    /* Decorative: the label beside it is the accessible identity. */
    user-select: none;
}

/* Proportional, like .you-avatar svg — the glyph's own viewBox carries its padding, so a
   percentage keeps the figure's weight right without a second size to maintain. */
.user-pill-avatar svg {
    width: 68%;
    height: 68%;
}

/* Keep the pill at its existing ~40px height. .login-btn's 0.5rem vertical padding plus a
   28px badge and the 2px borders would make it 48px and visibly re-weight the header, so a
   pill that CONTAINS a badge tightens vertically only: 4 + 28 + 4 + 4px of border = 40px,
   exactly what the text-only pill measured.
   :has() rather than a modifier class or #user-menu-button, because the padding follows
   from the content — the anonymous "Login" button shares .login-btn, has no badge, and
   must keep its original padding. */
.login-btn:has(.user-pill-avatar) {
    padding: 4px 0.5rem;
}

.login-btn:hover {
    background-color: #f9fafb;
    border-color: rgba(0, 0, 0, 0.15);
}

.login-btn:active {
    background-color: #f3f4f6;
    transform: translateY(1px);
}

.logout-btn {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1100;
    padding: 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    border-radius: 0.75rem;
    background: #FFF;
    box-shadow: 0 8px 24px 0 rgba(0, 0, 0, 0.10);
}

.logout-btn a {
    width: 12.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display:flex;
    align-items:center;
    gap:0.5rem;
    padding:0.375rem 0.25rem;
    border-radius:0.5rem;
    color:#000;
    text-decoration:none;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.25rem; /* Reduced by 50% to match header height */
    font-size: 0.6rem; /* Reduced from 0.75rem to match header height */
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background-color: #0d6efd;
    border-radius: 0.125rem; /* Reduced from 0.25rem */
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.1875rem 0.25rem; /* Reduced by 75% from 0.75rem 1rem */
    margin-bottom: 0.25rem; /* Reduced by 75% from 1rem */
    border-radius: 0.0625rem; /* Reduced by 75% from 0.25rem */
}
.alert-success { background-color: #d1e7dd; color: #0f5132; }
.alert-info { background-color: #cff4fc; color: #055160; }
.alert-danger { background-color: #f8d7da; color: #842029; }

/* ===== FOOTER ===== */
.footer {
    grid-area: footer;
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem; /* Reduced by 75% from 1rem */
    border-top: 1px solid #dee2e6;
    font-size: 0.65rem; /* Reduced from 0.875rem to match height reduction */
    color: #6c757d;
    background-color: #fff;
    z-index: 1000;
}
.footer p {
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
}

.footer-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-nav-item {
    margin-left: 0.25rem; /* Reduced by 75% from 1rem to match footer height */
}
.footer-nav-link {
    color: #6c757d;
    font-size: 0.65rem; /* Match footer font size */
    margin: 0 0.25rem; /* Added margin with 75% reduction (from 1rem) */
    padding: 0.125rem; /* Added padding with 75% reduction (from 0.5rem) */
}

/* ===== MOBILE TOGGLE (removed) =====
   The .mobile-toggle hamburger and its .mobile-toggle-icon bar styling were deleted
   along with the button. The bottom nav's "More" tab is the sidebar trigger now; see
   .bottom-nav-tab--menu. (The icon rules were already dead — the button rendered an
   inline SVG, not the CSS bars.) */

/* ===== HEADER CHROME ON MOBILE (<=768px) =====
 * What the HEADER gives up on the phone, where the dock's search circle and the
 * drawer replace it: the search field and the account menu go, and the sidebar's
 * You section grows the Logout row that the account menu used to own.
 *
 * MOBILE ONLY since the tablet rail returned (2026-08-21): the rail shows just the
 * three main cards, so the tablet band needs the header's search field and account
 * menu — without them it would have neither search nor logout. The bound therefore
 * matches the drawer's, not "below desktop". */
@media (max-width: 768px) {
    /* The header's search field gives way below desktop; on mobile the dock's search
       circle opens the full-screen overlay in its place.
       `width: 100%` is carried over verbatim from the original rule. It is inert on a
       display:none box; kept so nothing changes on mobile. */
    .search-container {
        display: none;
        width: 100%;
    }
    /* list-item, not block: it restores an <li>'s own default rather than changing what
       kind of box the row is, so it lays out identically to its .nav-item siblings.
       (.nav sets list-style: none, so there is no marker either way.) */
    .nav-item--logout {
        display: list-item;
    }
    /* The header's account control gives way to the sidebar's You section, which now
       carries the Logout row. The WRAPPER, not #user-menu-button: the wrapper also
       contains the dropdown panel, so hiding the button alone would leave an openable
       menu behind an invisible trigger.
       Mobile already hid the button via `.login-btn { display: none }` in the <=768px
       block; that rule stays, because .login-btn is ALSO the anonymous "Login" button and
       narrowing it here would strip the only sign-in affordance at tablet widths. This
       rule is scoped to the authenticated control alone. */
    .user-menu-wrapper {
        display: none;
    }
}

/* ===== RESPONSIVE STYLES (<=768px) =====
 * The SIDEBAR-AS-DRAWER set lives here, and only here. At 769-1270px the sidebar is an
 * in-layout card rail (see the tablet rail block), so the three rules below — the
 * single-column grid, the fixed off-canvas sidebar and the loader's dropped offset
 * (.spinner-overlay, in its own <=768 query further down) — are phone-only.
 *
 * OFF-CANVAS, NOT display:none. The drawer has to slide, and `display` is not an
 * animatable property: from display:none there is no start frame to transition from, so
 * .active would pop in. Keeping it laid out and translated off-screen is what makes the
 * 0.3s slide work, and the single-column grid is what takes it out of the layout — so it
 * occupies no space either way.
 *
 * PAIRED WITH THE GRID: the sidebar is position:fixed here, so it is out of flow and a
 * sidebar grid column would leave an empty gutter. Both rules must stay in this same
 * query — moving one without the other reintroduces the gutter or overlaps the content.
 */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }
    .sidebar {
        display: block; /* Always visible for animation */
        position: fixed;
        top: 0;
        right: 0; /* Position at right edge */
        left: auto; /* Override any left positioning */
        width: 250px;
        height: 100vh;
        height: 100dvh;
        z-index: 1001; /* Higher than header and footer */
        box-shadow: -2px 0 10px rgba(0,0,0,0.1); /* Shadow on the left side */
        transform: translateX(100%); /* Start off-screen to the right */
        transition: transform 0.3s ease-in-out; /* Smooth slide animation */
        /* Maintain existing sidebar styling */
        flex-direction: column;
        /* 52px top reserves the close button's corner. Its box ends at 6 + 44 = 50px and
           its glyph at 6 + 10 + 24 = 40px, so the first nav row starting at 52 clears the
           box entirely and leaves 12px of air below the glyph. Paired with
           .sidebar-close's top/right — changing one without the other puts the button back
           on top of the first menu item. Sides and bottom stay at the original 20px. */
        padding: 52px 8px 20px;
        background-color: #ffffff;
        overflow-y: auto;
    }

    /* Drawer rhythm (fix list H). The rows were carrying 16px of their own side padding
       INSIDE the drawer's 20px, so a label started 36px from the panel edge and the
       highlight was inset by the same amount on both sides — the "excessive
       padding" the fix list names. The 16px now lives on the row (which is what the
       design's side-bar rhythm specifies) and the drawer keeps only the 8px that lets
       the highlight breathe against the panel edge; the label lands at 24px, and the
       highlight is a full-width row rather than a floating capsule.
       Vertical goes the other way, 8 -> 12px: with the horizontal slack gone the rows
       needed a real touch target.
       Phone-only, deliberately: >=769px the sidebar is in-layout (card rail, then the
       full sidebar) and neither wants a drawer's proportions.

       `height: auto` RELEASES the 32px the in-layout sidebar's rows now take from Figma
       35094:56421. That height is right for a pointer at 1400px and too small for a thumb:
       12 + an 18px label + 12 gives this band a ~42px row, which is the touch target this
       block was written to buy in the first place. Both numbers are deliberate; neither is
       a default. */
    .sidebar .nav-link {
        height: auto;
        /* min-height, not padding arithmetic: a row with no COUNT pill (18px label line box)
           came out at 42px — under the 44px this band exists to buy. Rows that do carry a
           count pill were already 44; this floors every row without inflating them. The
           header box below re-caps itself at 40. ("pill" here is `.nav-link-count`, the
           bucket total — not the row highlight, which is an 8px slab.) */
        min-height: 44px;
        padding: 12px 16px;
        /* Restates the base row's 8px (~245) rather than inheriting it, because this rule
           exists to re-tune the row for this band and the radius belongs with the rest of
           that geometry. Same value at both bands: 8px is the painted Hovar layer's radius in
           the design, and unlike a capsule it does not need to track the row's height. */
        border-radius: 8px;
    }

    /* The section header keeps its own box geometry here — a fixed 40px and the design's 8px
       inline padding — because the rule above is (0,2,0) and would otherwise hand the header
       the ROW's padding and a content-driven height. The 8-vs-16 difference is the design's:
       rows are indented under the header they belong to.

       NO `border-radius` here, DELIBERATELY. This rule used to restate 8px as a guard, back
       when the row above was a 70px capsule: the row rule is (0,2,0) and the header's own
       `.nav-link--skills` is (0,1,0), so the row was winning the radius and every drawer
       header rounded off into a pill. Now that both rows and headers are 8px the guard would
       be a declaration identical to what already cascades — untestable, and a comment
       explaining a no-op. The mechanism is still live though: IF the row radius above ever
       diverges from the header's again, this rule must restate the header's value or every
       drawer header silently takes the row's shape. The drawer test resolves the cascade
       rather than reading a declaration, so it fails loudly in exactly that case. */
    .sidebar .nav-link--skills {
        height: 40px;
        /* Un-floor the row rule's 44px: min-height beats height when larger, and the
           header box is the design's fixed 40. A 40px header remains a legal tap target
           here because the box spans the full drawer width. */
        min-height: 0;
        padding: 0 8px;
    }
    .sidebar.active {
        transform: translateX(0); /* Slide in from the right */
    }
    .sidebar-close {
        display: flex;
    }
    .header {
        padding: 0.5rem 1rem; /* Reduced by 75% from 0.75rem */
    }
    .footer {
        padding: 0.1875rem; /* Reduced by 75% from 0.75rem */
    }
    .main {
        /*padding: 0.1875rem; !* Reduced by 75% from 0.75rem *!*/
    }
    .login-btn {
        display: none;
    }
    .search-mobile {
        /*display: block;*/
        display: none;
    }
    .mobile-buttons {
        display: flex;
        gap: 1rem;
    }

    .course-card {
        min-height: 158px;
        display: grid;
        grid-template-columns: 4.31594rem 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 0 0.75rem;
        grid-template-areas:
            "image header"
            "description description"
            "meta meta"
            "actions actions";
    }

    .course-image-stack {
        width: 3.80594rem;
        height: 6rem;
        grid-area: image;
        align-self: start;
    }

    .course-content {
        display: contents; /* Let children participate in parent grid */
    }

    /* Header row with title and concepts stacked */
    .course-header-row {
        grid-area: header;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        align-self: start;
    }

    .course-card-title {
        margin: 0;
        font-size: 1rem;
        line-height: 1.2;
    }

    .concepts-box {
        align-self: flex-start;
    }

    /* Description spans full width below */
    .course-card-description {
        grid-area: description;
        /* Keeps the 4px down to the concept chips that the base rule sets. */
        margin: 0 0 4px;
        font-size: 0.875rem;
        line-height: 1.5;
    }

    /* Actions span full width at bottom */
    .course-actions {
        grid-area: actions;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
}

/* ===== FILTER BUTTONS ===== */
.filter-buttons-container {
    display: flex;
    justify-content: start;
    align-items: center;
    gap: 0.5rem;

    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* smooth on iOS */
    scrollbar-width: none;              /* Firefox */
    -ms-overflow-style: none;           /* IE/old Edge */
    width: 100%;
    /* Row spacing lives on the row, not on .filter-btn. The buttons used to be shared
       with the skills page's filter bar, where a per-button bottom margin inflated the bar
       and broke its 16px gap to the first section; that bar is now the .skills-tabs strip
       and this is the home page's row alone, but the spacing still belongs to the row. */
    margin-bottom: .75rem;
}

.filter-buttons-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Ensure buttons don't shrink; they should scroll horizontally */
.filter-buttons-container .filter-btn {
    flex: 0 0 auto;
}

/* The HOME feed's filter chips — the only consumer of this class left (the Skills page's
   old filter dropdowns were deleted; its trigger is the separate .skills-filter-btn).

   UNSELECTED CHIPS ARE TRANSPARENT (issue #15), keeping their border. They used to paint
   #ffffff, which on the redesign's tinted .main read as a row of white tablets floating on
   a coloured sheet; the outline alone is enough to say "chip", and the page surface now
   runs behind them unbroken. The BORDER is what carries the shape, so it stays — see
   `.filter-btn.border` below, which is the variant the home bar actually renders. */
.filter-btn {
    display: flex;
    padding: 0.3125rem 0.5rem 0.375rem 0.5rem;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.filter-btn.border {
    border-radius: 0.5rem;
    border: 1px solid rgba(182, 182, 182, 0.30);
}

.filter-btn.underline {
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    color: rgba(0, 0, 0, 0.60);
}

.filter-btn.vertical {
    flex-direction: column;
}

.filter-btn.horizontal {
    flex-direction: row;
}

/* Hover had to change with the fill: #f9fafb was a near-white wash that, now the resting
   chip is transparent, would have read as the white fill APPEARING on hover — the exact
   thing issue #15 removed. A translucent black tint darkens the page surface showing
   through instead of covering it, and it is the same neutral hover the sidebar rows use. */
.filter-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-color: rgba(182, 182, 182, 0.50);
}

.filter-btn.border.active {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

.filter-btn.underline.active {
    border-bottom: 1px solid rgba(0, 0, 0);
    color: rgba(0, 0, 0);
}

.filter-btn.underline.active {
    /*background-color: #000000;*/
    /*border-color: #000000;*/
    color: #000000;
}

.filter-btn-icon {
    display: flex;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.25rem;
    justify-content: center;
    align-items: center;
}

.filter-btn.border.active img.filter-btn-icon {
    filter: invert(1);
}

.filter-btn-text {
    color: #000;
    text-align: center;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%; /* 1.3125rem */
}

.filter-btn.border.active .filter-btn-text {
    color: #ffffff;
}

/* ===== VIDEO GRID STYLES ===== */
.video-grid-container {
    width: 100%;
    height: auto;
    margin: 0 auto;
    position: relative;
}

.swiper {
    width: 100%;
    height: 100%;
}

/* Grid layout for videos when Swiper is not initialized or not working properly */
.video-grid-fallback {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
    gap: 0.75rem 0.5rem;
    margin-bottom: 20px;
}

.swiper-slide {
    text-align: center;
    /*background: #f8f9fa;*/
    /*border-radius: 8px;*/
    background: #fff;
    overflow: hidden;
    height: auto;
    display: flex;
    flex-direction: column;
}

.video-card {
    display: flex;
    /*width: 11.25rem;*/
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    /*box-shadow: 0 2px 5px rgba(0,0,0,0.1);*/
    /* FIX: was `background: white`. The card has NO radius of its own — the rounded
       surface is .video-thumbnail inside it — so the white body was a square block that
       showed around the thumbnail's curve and, below it, as a white band behind
       .video-title. Invisible while .main was white; a visible artefact on the tint.
       Transparent lets the tinted sheet read straight through, which is what the design
       shows: rounded thumbnails and their titles sitting directly on the surface. */
    background: none;
    aspect-ratio: 186/330;
}

@media (hover: hover) {
    .video-card {
        /* easeOutQuint — strong 5th-order decel. Fast take-off, soft landing.
           400ms lets the curve's gentle tail actually unfold (at 250ms it
           was being clipped short before the deceleration could breathe). */
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .video-card:hover {
        transform: translateY(-3px);
        z-index: 2;
    }
}

/* ── Grid / card entrance animations ──────────────────────────────
   Shared fade+slide; matches thewtimes.com gridItemIn. `backwards`
   (not `both`) so post-animation transform is released back to the
   cascade and the hover lift keeps working. Even-child +60ms stagger. */
@keyframes videoCardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.video-grid-fallback--animated .video-card {
    animation: videoCardIn 0.4s ease-out backwards;
}
.video-grid-fallback--animated .video-card:nth-child(even) {
    animation-delay: 60ms;
}

.course-grid--animated .course-card {
    animation: videoCardIn 0.4s ease-out backwards;
}
.course-grid--animated .course-card:nth-child(even) {
    animation-delay: 60ms;
}

.cl-grid--animated .cl-grid-item {
    animation: videoCardIn 0.4s ease-out backwards;
}
.cl-grid--animated .cl-grid-item:nth-child(even) {
    animation-delay: 60ms;
}

/* Skills carousels are Swiper-driven: animate the INNER card, never
   the slide/wrapper (Swiper owns their transform).
   .cl-ccard-slide and .cl-ocard-slide are the only two carousel slide shapes left:
   the skills page uses both, and the You page now uses .cl-ocard-slide for all
   three of its sections, so it inherits this entrance for free. */
.cl-ccard-slide .cl-ccard,
.cl-ocard-slide .cl-ocard {
    animation: videoCardIn 0.4s ease-out backwards;
}
.cl-ccard-slide:nth-child(even) .cl-ccard,
.cl-ocard-slide:nth-child(even) .cl-ocard {
    animation-delay: 60ms;
}

/* Feed slides are Swiper too — opacity-only fade on the container, no transform. */
@keyframes feedFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.feeds-container--animated {
    animation: feedFadeIn 0.4s ease-out backwards;
}

@media (prefers-reduced-motion: reduce) {
    .video-grid-fallback--animated .video-card,
    .video-grid-fallback--animated .video-card:nth-child(even),
    .course-grid--animated .course-card,
    .course-grid--animated .course-card:nth-child(even),
    .cl-grid--animated .cl-grid-item,
    .cl-grid--animated .cl-grid-item:nth-child(even),
    .cl-ccard-slide .cl-ccard,
    .cl-ccard-slide:nth-child(even) .cl-ccard,
    .cl-ocard-slide .cl-ocard,
    .cl-ocard-slide:nth-child(even) .cl-ocard,
    .feeds-container--animated {
        animation: none;
    }
}

.video-thumbnail {
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #000;
    border-radius: 0.5rem;
    width: 100%;
    height: 100%;
}

.video-thumbnail .thumbnail-img {
    /*position: absolute;*/
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    display: block;
}

.video-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10; /* Further increased z-index to ensure video appears above other elements */
    pointer-events: none; /* Allow clicks to pass through to elements below */
}

/* Animated frame canvas — sits between the static thumbnail and the
   live <video>. Immune to autoplay policy; works in LPM/Energy Saver. */
.video-thumbnail .preview-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 15;
    pointer-events: none;
}

.video-thumbnail .hover-video.playing {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 20 !important;
    /* black background only while playing — needed for letterbox bars on portrait/landscape
       videos. Keeping it on the default state caused a visible black flash between
       play().then() and the first decoded frame. */
    background-color: #000;
}

/* Hide thumbnail when video is playing */
.video-thumbnail:has(.hover-video.playing) .thumbnail-img {
    opacity: 0 !important;
}

/* Thumbnail is hidden only when video is actively playing (.playing class).
   Removed the :has([src]) rule that was hiding the thumbnail as soon as src was
   set, before the video had decoded any frames — causing a black flash. */

/* Safari Low Power Mode tap-to-play button.
   Shown when programmatic play() is blocked; hidden once the user taps and playback starts. */
.video-thumbnail .lpm-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.video-thumbnail .lpm-play-btn svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    /*margin-left: 3px; !* optical centering of the play triangle *!*/
    pointer-events: none;
}

.video-info {
    /*padding: 0.75rem;*/
    /*text-align: left;*/
    /*flex-grow: 1;*/
    /*display: flex;*/
    /*flex-direction: column;*/
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    align-self: stretch;
    padding: 0;
}

.video-title {
    display: flex;
    width: 11.25rem;
    max-height: 3rem;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #000;
}

.video-author {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.video-stats {
    /*display: flex;*/
    /*justify-content: space-between;*/
    /*font-size: 0.75rem;*/
    /*color: #888;*/
    /*margin-top: auto;*/
    color: #000;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    opacity: 0.6;
    display: flex;
    justify-content: flex-start;
    margin-top: 0;
}

.video-stats span {
    margin-right: 0.5rem;
}

.video-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.7rem;
}

/* Infinite scroll trigger styles */
.infinite-scroll-trigger {
    /* Outside grid - just needs to be invisible */
    height: 1px;
    width: 100%;
    opacity: 0;
}

/* Loading spinner styles */
.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .swiper-slide {
        width: 100%;
    }
}

/* ===== COURSES PAGE STYLES ===== */

/* Course Header Section */
/* The content-page back affordance. .content-back-btn's ONLY consumer is now the mobile
   search overlay (components/bottom_nav.html), where it is an icon-only 36x36 square in a
   row beside the search field — see .search-overlay-back, which supplies the rest of that
   layout. The search RESULTS page used to use it too and now carries .back-chip below
   (client: "way too small and not noticeable"), which is why this rule keeps its 36px
   min-* pair but no longer has a labelled consumer.
   The players' circular .video-control-btn.back-btn is a different thing — an over-video
   control, not a page-level link. */
/* Issue #3: 36px was still "too small". Now 44x44 — 44 is the platform touch-target floor
   (the drawer rows are floored at the same number), and the glyph grew with the box because a
   16px arrow rattling around 44px of padding reads as smaller than it is, which was the
   complaint. That round set the glyph to 20; the client's later ruling took it to 24 (see the
   next block), which is a bigger mark in the SAME target and so does not walk issue #3 back.
   Icon-only is kept deliberately: this one sits INSIDE the search overlay next to the field,
   where a label would crowd the input — content pages use the labelled .back-chip instead. */
/* Client 2026-09-16, "use the same back arrow as the filter sheet's": the ARTWORK already
   matched (both sites render components/back_icon.html), so what the screenshot showed was
   this rule's `opacity: 0.6` — the overlay's arrow painted grey where the sheet's .sfp-back
   paints solid #000. The fade is REMOVED rather than overridden at the call site, because the
   overlay button is the only element carrying this class app-wide (asserted in
   test_search_back_control_is_the_house_chip), so a 0.6 that every consumer immediately
   cancels is just a trap for the next one.
   Its `transition: opacity` and the `:hover { opacity: 1 }` that partnered it go with it —
   they had nothing left to animate. The overlay keeps a real hover affordance of its own:
   .search-overlay-back's 5% background, inside @media (hover: hover), which a touch device
   correctly never applies.
   The client then ruled on the last delta too: the glyph is 24px, matching the sheet's, which
   equalises the ink weight at 1.5px (20px struck only 1.25 through the 24 viewBox). The two
   controls now differ in nothing but their box — 24-in-44 here, a bare 24 in the sheet. */
.content-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    /* Used on a <button> in the search overlay, so undo the UA button chrome an <a>
       never had. Harmless on anchors. */
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    /* 44px of tappable area (issue #3, was 36). A bare icon at the top of a full-screen
       overlay is the hardest kind of control to hit, and 44 is the floor every other
       touch target in this app is held to. */
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
}

/* The house BACK CHIP (fix list I, then the search page's own note). A LABELLED chip, not
   a bare glyph: on the phone an icon alone sits in the top-left with nothing to say where
   it goes, and 16px of glyph is not a touch target. Figma has no frame for this control
   (the designer's note says it is still to be added), so the geometry came from the Tabs
   chip spec.

   NEUTRAL, AND A FULL PILL (issue #6a — "pill shape with black color (10% opacity)").
   It used to be primary-10% behind primary ink, one of the app's family of tinted
   controls. The client asked for the course-details chip specifically; it is deliberately
   applied to BOTH consumers, because the search chip was only ever styled to match this
   one — splitting them would put two different back chips two taps apart. Raised with the
   coordinator rather than assumed.
   The 999px radius is a pill at this fixed 36px height and would stay one if the height
   ever moved; black 10% over the page's own tint stays legible without borrowing the
   brand, which the client is reserving for the primary actions.

   TWO consumers, one rule: `.back-chip` is the general name (the search results page) and
   `.course-back-btn` is the skills-details page's original class, kept so that page's
   markup and its tests are untouched. Add the general class to new pages; do not grow
   this list. */
.back-chip,
.course-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 36px;
    padding: 0 0.75rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.1);
    color: #000;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease;
}
.back-chip svg,
.course-back-btn svg { flex-shrink: 0; }
@media (hover: hover) {
    .back-chip:hover,
    .course-back-btn:hover {
        background: rgba(0, 0, 0, 0.18);
    }
}

/* The course-details top row: back chip at the start edge, Share at the END edge
   (client #6 alignment; they used to sit adjacent). A flex row, because the two chips were
   siblings in a BLOCK container where no alignment property could reach them.

   `margin-inline-start: auto` on the share chip rather than `justify-content: space-between`
   on the row: with exactly two children the two look identical, but the auto margin says
   "everything left, this one right", so a third control added later joins the left group
   instead of being spread across the row. INLINE-start, so it flips for the RTL tenants
   without a second rule.
   The chips keep their own 1rem bottom margin — they are equal, so the row's bottom edge
   stays flat and the spacing below is unchanged from before the wrapper existed. */
.course-detail-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.course-detail-top .course-share-btn {
    margin-inline-start: auto;
}

/* Skills-details page body (fix list J). Figma puts the content column at x=24 with a
   16px top inset; .main already supplies 16px on all four sides at every width, so this
   only tops the SIDES up to 24 and only from 769px. On the phone .main's 16px is the
   spec, so there is nothing to add and no rule fires. */
@media (min-width: 769px) {
    .course-detail-page {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* A light tint, not white (fix list K): the top card is the page's summary and must read
   as distinct from the white track cards below it.
   #DEE1F7 is a CLIENT LITERAL (issue #14) and deliberately tenant-agnostic — it replaces
   the primary-at-10%-alpha tint this card used to carry, so this card no longer tracks the
   tenant's brand colour at all. It is opaque, so unlike the alpha tint it does not
   composite with .main's own 4% surface; that is intended — the client picked the exact
   colour they want to see. Do not "restore" the token here without a new instruction. */
.course-header {
    display: flex;
    /*width: 72rem;*/
    padding: 1rem;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: #DEE1F7;
    margin-bottom: 1rem;
}

.course-info {
    flex: 1;
}

.course-header-meta {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.course-header-img {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.course-header-text {
    display: flex;
    flex-direction: column;
}

.course-header-tutor {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

/* Solid white disc + hairline, the light-surface half of the creator-chip treatment in
   fix list E: an uploaded logo with a transparent or near-white field would otherwise
   dissolve into the tinted card. `scale-down` keeps a wordmark whole. */
.course-tutor-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: scale-down;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.course-tutor-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.08);
    color: rgba(0,0,0,0.4);
}
.course-tutor-avatar--placeholder svg {
    width: 1rem;
    height: 1rem;
}

.course-tutor-name {
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    color: #000;
}

.course-header-lang {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    margin-left: 1.625rem;
    padding: 0.2rem;
    border-radius: 2rem;
    background: linear-gradient(0deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.10) 100%), rgba(0,0,0,0.20);
    backdrop-filter: blur(4.5px);
    flex-shrink: 0;
}

.course-title {
    color: #000;
    font-size: 1.25rem;
    font-style: normal;
    font-weight: 600;
    line-height: 120%;
    margin: 0 0 0.5rem 0;
}

.course-description {
    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    margin: 0;
    width: 42.5rem;
}

.progress-chart {
    width: 7.25rem;
    height: 7.25rem;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-pie {
    width: 100%;
    height: 100%;
}

.progress-text {
    font-size: 1.6rem;
    font-weight: 600;
    fill: #22c55e;
    color: #000;
}

/* Course Grid */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34rem, 1fr));
    gap: 1rem;
    /*max-width: 72rem;*/
}

/* min-height, not height: the footer separator below is a real border in the flow, so
   the card has to be free to take the height its content asks for. Grid stretch still
   levels the cards within a row. */
.course-card {
    display: flex;
    /*width: 35.5rem;*/
    min-height: 158px;
    padding: 0.75rem;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: #FFF;
}

.course-image-stack {
    position: relative;
    width: 4.75744rem;
    height: 7.5rem;
    flex-shrink: 0;
    margin-right: 0.51rem; /* Compensate for rightward layer offset */
}

.image-layer {
    position: absolute;
    border-radius: 0.14275rem;
}

.image-layer.layer-1 {
    width: 4.24775rem;
    height: 5.5rem;
    background: #F2F2F2;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    z-index: 1;
}

.image-layer.layer-2 {
    width: 4.24775rem;
    height: 6.16669rem;
    background: #E4E4E4;
    top: 50%;
    transform: translateY(-50%);
    left: 0.17rem;
    z-index: 2;
}

.image-layer.layer-3 {
    width: 4.24775rem;
    height: 6.83331rem;
    background: #CECECE;
    top: 50%;
    transform: translateY(-50%);
    left: 0.34rem;
    z-index: 3;
}

.image-layer.layer-4 {
    width: 4.75744rem;
    height: 7.5rem;
    border-radius: 0.25rem;
    overflow: hidden;
    top: 50%;
    transform: translateY(-50%);
    left: 0.51rem;
    z-index: 4;
}

.image-layer.layer-4 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* gap: 0. The four blocks below want FOUR different distances (title->description 0,
   description->chips 4, chips->separator 8, separator->footer 8), so each one carries
   its own margin and there is no shared row gap to fight (fix list L). */
.course-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Course header row with title and concepts count. Flush against the description —
   title and description are one text block, spaced by line-height alone. */
.course-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin: 0;
}

.course-card-title {
    color: #000;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 150%;
    margin: 0;
    font-style: normal;
    flex: 1;
}

/* Track meta chips (Figma 33373-20006): concepts-learned + video-count pills under
   the description. The 10% ALPHA of the primary (not a white mix — same mapping as
   the resume CTA) so the pill reads correctly on the white card; the Figma paints
   rgba(245,89,5,.1), Talabat's primary. grid-area only binds inside the <=968px
   course-card grids, where the row gets its own "meta" track; on desktop the card
   is a normal flow column and the area name is inert. */
.track-meta-row {
    grid-area: meta;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.track-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 2px 8px 2px 4px;
    border: 0;
    border-radius: 30px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: #000;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
}

/* Only the concepts chip is a <button> (it opens the concepts modal). */
button.track-chip {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

button.track-chip:hover {
    opacity: 0.8;
}

.track-chip-icon {
    flex-shrink: 0;
    color: var(--primary-color);
}

.track-chip b {
    font-weight: 700;
}

.course-card-description {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    /* 4px down to the concept chips (Figma 33373:20013 gap-4); nothing above it. */
    margin: 0 0 4px;
    /* Two lines (was three), then ellipsis; the <p> carries title="" so hover
       shows the rest. The responsive course-card bands restyle size/margins only
       and never set display, so the clamp holds at every width. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Footer. The separator is a border on this row, so the 8px above it is this row's
   margin and the 8px below it is its padding — "8px both sides" with one box (fix list
   L). margin-top: auto is gone: it made the distance depend on whatever slack the card
   happened to have, which is the opposite of a specified gap. */
.course-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-watch-all {
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    min-width: 7.5rem;
    height: 36px;
    padding: 0.4375rem 1rem 0.5rem 1rem;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.5rem;
    /* 10% ALPHA of the primary, matching the concept chips on the same card and the
       back chip above it — not the opaque --primary-color-light mix, which was a
       different shade of the same idea. */
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
}

.btn-play-remaining {
    background: var(--primary-color);
    /* White, not the 10% tint: this is the solid CTA of the pair, so its ink is the
       page background colour. The tint here rendered as pale-on-primary. */
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.4375rem 1rem 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    gap: 0.625rem;

    display: flex;
    justify-content: center;
    align-items: center;
    height: 36px;
}

/* Derived from the token: the previous #9d7c56 was a hardcoded brown left over from an
   earlier tenant, so every tenant's hover went olive. */
@media (hover: hover) {
    .btn-watch-all:hover {
        background: color-mix(in srgb, var(--primary-color) 18%, transparent);
    }

    .btn-play-remaining:hover {
        background: color-mix(in srgb, var(--primary-color) 88%, #000);
    }
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.progress-label {
    color: #666;
    font-size: 0.75rem;
    font-weight: 400;
}

.progress-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    border: 2px solid #e5e5e5;
    color: #666;
}

.progress-circle.complete {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.progress-circle.partial {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* Home-only: cap video tile height on very small screens */
@media (max-width: 412px) {
    /* Keep at least 2 tiles per row */
    .video-grid-fallback {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Allow content to shrink within grid cells */
    .video-card { min-width: 0; }
    .video-info, .video-title { min-width: 0; }
    .video-title { width: 100%; }

    .banner-actions {
        flex-direction: column;
    }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .course-header {
        width: 100%;
        margin-bottom: 0.75rem;
        /*max-width: 72rem;*/
    }

    .course-grid {
        max-width: 100%;
    }

    .course-card {
        width: 100%;
        /*max-width: 35.5rem;*/
    }
}

@media (max-width: 768px) {
    .course-header {
        flex-direction: column;
        align-items: flex-start; /* Align to left instead of center */
        text-align: left; /* Align text to left instead of center */
        gap: 1rem; /* Reduced gap */
    }

    .course-description {
        width: unset;
    }

    .progress-chart {
        order: -1; /* Move progress chart to top */
        align-items: start;
        justify-content: start;
        width: 4rem;
        height: 4rem;
    }

    .progress-text {
        font-size: 1.6rem;
        font-style: normal;
        font-weight: 400;
        line-height: 150%;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .course-card {
        min-height: 158px;
        display: grid;
        grid-template-columns: 4.31594rem 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 0 0.75rem;
        grid-template-areas:
            "image header"
            "description description"
            "meta meta"
            "actions actions";
    }

    .course-image-stack {
        width: 3.80594rem;
        height: 6rem;
        grid-area: image;
        align-self: start;
    }

    .course-content {
        display: contents; /* Let children participate in parent grid */
    }

    /* Header row with title and concepts stacked */
    .course-header-row {
        grid-area: header;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        align-self: center;
    }

    .course-card-title {
        margin: 0;
        font-size: 1rem;
        line-height: 1.2;
    }

    .concepts-box {
        align-self: flex-start;
    }

    /* Description spans full width below */
    .course-card-description {
        grid-area: description;
        /* Keeps the 4px down to the concept chips that the base rule sets. */
        margin: 0 0 4px;
        font-size: 0.875rem;
        line-height: 1.5;
    }

    /* Actions span full width at bottom */
    .course-actions {
        grid-area: actions;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }

    /* Mobile Layer Styles */
    .image-layer.layer-1 {
        width: 3.39819rem;
        height: 4.4rem;
    }

    .image-layer.layer-2 {
        width: 3.39819rem;
        height: 4.93331rem;
    }

    .image-layer.layer-3 {
        width: 3.39819rem;
        height: 5.46669rem;
    }

    .image-layer.layer-4 {
        width: 3.80594rem;
        height: 6rem;
    }
}

/* ===== TRACKS PAGE STYLES ===== */

/* Tracks Header */
.tracks-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 100;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 5.625rem;
    border: 1.5px solid rgba(0, 0, 0, 0.10);
    background: #FFF;
}

/* Tracks Container
   This #FFF is the layer directly under the (now transparent) track slides — see
   `.tracks-swiper .swiper-slide` (~3504). At >=769 the players block (~4322) zeroes it so
   .main's tint reads through; in the phone band it stands, so it is what a white pixel
   around the video below 769px is now coming from, not the slide. */
.tracks-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    overflow: hidden;
    background: #FFF;
}

.tracks-swiper {
    width: 100%;
    height: 100%;
    touch-action: pan-x; /* tell browser: JS owns vertical touch, don't compete */
}

.track-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.track-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
}

/* Video Track Styles */
.video-track .video-container {
    position: relative;
    width: var(--player-card-width);
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Poster image: absolutely positioned to match background-image geometry exactly,
   eliminating any sub-pixel shift when the img paints over the container background.
   background-image on the container handles Safari GPU compositing during animation. */
.video-track img.track-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video: absolutely positioned so it overlays the poster without displacing it
   when moved into the container after the slide animation completes */
.video-track video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

/* Desktop landscape layout: actions below the video */
@media (min-width: 769px) {
    .track-content.video-track.landscape {
        flex-direction: column;
        align-items: start;
        gap: 0.5rem;
    }

    .track-content.video-track.landscape .video-container {
        width: 89%;
        height: auto;              /* let aspect-ratio define height */
        max-height: calc(100vh - 88px);
        margin-left: 3rem;
    }

    .track-content.video-track.landscape video,
    .track-content.video-track.landscape img.track-poster {
        object-fit: contain;       /* show full video in landscape */
        background: #000;
    }

    .track-content.video-track.landscape .track-actions {
        position: relative;
        width: 70vw;          /* match the video width */
        margin: 0 auto;       /* center the row under the video */
        display: flex;
        flex-direction: row;  /* row layout */
        justify-content: flex-end; /* align to end of video */
        gap: 0.75rem;
        /*margin-top: 0.5rem;*/
    }
}

@media (min-width: 769px) {
    /* When inline panel is open, keep column layout, reserve right space for panel */
    .track-content.video-track.landscape.has-progress-open {
        position: relative;
        /* Reserved space for the docked panel: its width + a 0.5rem gap. Reads the
           same token the panel does, so the two cannot drift apart (the token also
           carries the vh fallback this rule used to repeat by hand). */
        padding-right: calc(var(--course-panel-width) + 0.5rem);
    }

    /* Shrink video width so actions remain below it and don't fall under the panel */
    .track-content.video-track.landscape.has-progress-open .video-container {
        width: 72vw; /* keep your landscape width baseline */
        max-width: calc(100% - 3rem - 5rem);
        height: calc(100vh - 88px);
        height: calc(100dvh - 88px);
        max-height: none;
    }
    @supports not (height: 1dvh) {
        .track-content.video-track.landscape.has-progress-open .video-container {
            max-width: calc(100% - 55vh - 3rem - 5rem);
        }
    }

    /* Place panel on the right, under tracks-navigation (z-index: 100) */
    .track-content.video-track.landscape.has-progress-open .track-progress-panel {
        position: absolute;
        top: 0;
        right: auto;
        z-index: 90;
        height: auto; /* let JS set exact height */
    }
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1rem 0.75rem;
    color: white;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.author-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

.follow-btn {
    background: transparent;
    border: 1px solid white;
}

/* ===== LENOVO BANNER STYLES ===== */
.lenovo-banner {
    background: var(--primary-color);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(225, 37, 27, 0.15);
}

.banner-content {
    /* display: flex;
    align-items: center; */
    justify-content: space-between;
    padding: 1rem;
    gap: 2rem;
}

.banner-text {
    flex: 1;
    color: white;
    padding-bottom: 1rem;
}

.banner-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    color: white;
}

.banner-description {
    width: 42.5rem;
    font-size: 00.875rem;
    line-height: 1.5;
    margin: 0;
    opacity: 0.8;
    color: white;
}

.banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.banner-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.banner-btn.primary {
    background-color: white;
    color: var(--primary-color);
}
.banner-btn.primary a {
    background-color: white;
    color: var(--primary-color);
}

.banner-btn.primary:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.banner-btn.secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}
.banner-btn.secondary a {
    background-color: transparent;
    color: white;
}

.banner-btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Responsive banner styles */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
        gap: 1.25rem;
    }
    
    .banner-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .banner-description {
        font-size: 0.875rem;
        width: 100%;
    }
    
    .banner-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .banner-btn {
        /*flex: 1;*/
        min-width: auto;
    }
}

.follow-btn:hover {
    background: white;
    color: black;
}

.video-description {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.video-description p {
    text-align: left;
}

.download-app {
    width: 100%;
}

.download-app-btn {
    display: flex;
    height: 2.25rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: none;
    /* Was #B49164 / #9E9268 — a tan-gold and olive left over from an EARLIER
       TENANT's brand, so this painted the same foreign colour on every tenant.
       Converted to the token (client issue #9). The hover at ~2241 had the identical
       problem with #9d7c56 and was fixed once already; these are the rest of that
       palette. */
    background: var(--primary-color);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-app-btn img {
    height: 24px;
    width: 24px;
}

/* Feed (landscape): make the download CTA hug its content */
.feed-content.video-feed.landscape .download-app {
    display: inline-block;        /* shrink wrapper to content */
    width: auto;                  /* override 100% */
    max-width: 100%;              /* safety */
}

.feed-content.video-feed.landscape .download-app-btn {
    display: inline-flex;         /* size to content; keep icon+text aligned */
    width: auto;                  /* override 100% */
    white-space: nowrap;          /* keep on one line */
    padding: 0.375rem 2rem;
}

.feed-content.video-feed.landscape .download-app-btn img {
    flex: 0 0 auto;               /* don’t shrink the icon */
}

/* Track (landscape): make the download CTA hug its content */
.track-content.video-track.landscape .download-app {
    display: inline-block;   /* shrink wrapper to content */
    width: auto;             /* override 100% */
    max-width: 100%;         /* safety */
}

.track-content.video-track.landscape .download-app-btn {
    display: inline-flex;    /* size to content; keep icon+text aligned */
    width: auto;             /* override 100% */
    white-space: nowrap;     /* keep on one line */
    padding: 0.375rem 2rem;  /* match the feed landscape padding you added */
}

.track-content.video-track.landscape .download-app-btn img {
    flex: 0 0 auto;          /* don’t shrink the icon */
}

/* Questionnaire Track Styles */
.questionnaire-track .questionnaire-container {
    position: relative;
    width: var(--player-card-width);
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    background: linear-gradient(180deg, #3D3D3D 0%, #000 100%);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    color: white;
    overflow: hidden;
}

.questionnaire-header {
    margin-bottom: 2rem;
}

.progress-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/*.progress-text {*/
/*    font-size: 0.75rem;*/
/*    opacity: 0.8;*/
/*}*/

.questionnaire-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0 0 2rem 0;
    text-align: start;
    color: #FFF;
    font-style: normal;
    line-height: 120%; /* 1.5rem */
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.10);
    color: #FFF;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.10);
    font-style: normal;
    font-weight: 600;
    line-height: 150%; /* 1.5rem */
}

/* RTL support — driven by data-direction="rtl" on .questionnaire-content
   (set from content.direction in tracks/fragments/quizz.html). Flipping
   `direction` enables Unicode bidi handling (punctuation, embedded Latin /
   numbers, mixed content render correctly) and auto-mirrors flex axes.
   `.question-title` already uses text-align: start and `.option-btn` /
   `.answer-icon` use logical properties below, so the layout mirrors with
   no further per-element overrides. LTR is the default and unchanged. */
.questionnaire-content[data-direction="rtl"] {
    direction: rtl;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.option-btn.selected {
    background: rgba(255, 255, 255, 0.9);
    /* Was #B49164 / #9E9268 — a tan-gold and olive left over from an EARLIER
       TENANT's brand, so this painted the same foreign colour on every tenant.
       Converted to the token (client issue #9). The hover at ~2241 had the identical
       problem with #9d7c56 and was fixed once already; these are the rest of that
       palette. */
    color: var(--primary-color);
    border-color: white;
}

.option-btn.correct {
    display: flex;
    padding: 0.75rem;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
    border-radius: 0.5rem;
    border-bottom: 2px solid #FFF;
    background: #05B502;
    box-shadow: 0 4px 24px 0 rgba(5, 181, 2, 0.65);
    color: white;
    justify-content: space-between;
}

.option-btn.wrong {
    display: flex;
    padding: 0.75rem;
    align-items: center;
    gap: 0.5rem;
    align-self: stretch;
    border-radius: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.7);
    justify-content: space-between;
}

.option-btn.correct .answer-icon,
.option-btn.wrong .answer-icon {
    flex-shrink: 0;
    margin-inline-start: auto;
}

.option-btn.answered {
    pointer-events: none;
    cursor: default;
}

/* Track Actions (Right Side) */
.track-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
    flex-shrink: 0;
    width: 3rem;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding-bottom: 0.2rem;
}

.action-btn {
    background: rgba(0, 0, 0, 0.10);
    border: none;
    border-radius: 0.75rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.1);
}

.action-count {
    text-align: center;
    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%; /* 1.3125rem */
}

/* Navigation Controls */
.tracks-navigation {
    position: absolute;
    right: 1rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 5.6rem;
    z-index: 100;
}

.nav-btn {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 5.625rem;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    background: #FFFFFF;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn:disabled:hover {
    transform: none;
    background: rgba(0, 0, 0, 0.5);
}

/* Inline Progress panel */
.track-progress-panel {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    /*box-shadow: 0 8px 24px rgba(0,0,0,0.12);*/

    width: var(--course-panel-width);
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    border: 1px solid rgba(0, 0, 0, 0.10);
}

/* Hide the panel until the body has content */
.track-progress-panel:not(:has(.track-progress-body > *)) {
    display: none;
}

.track-progress-panel .track-progress-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Hide by default, but show when 'open' */
.track-progress-panel { display: none; }
.track-progress-panel.open { display: flex !important; }

/* Header */
.track-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,.1);
    font-weight: 600;
}

/* .track-progress-close carries no styles of its own — .app-close-btn covers
   it. The class is kept in the markup because app.js resolves the panel's close
   button by it. */

/* Body scroll region */
.track-progress-body {
    padding: .5rem 1rem 1rem;
    overflow: auto;
    max-height: 100%;
}

.track-progress-panel .concept-text {
    text-align: left;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Tracks mobile styles - following feeds pattern */
    .tracks-container {
        height: 100vh;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
    }

    /* Full-screen video and questionnaire on mobile */
    .video-track .video-container,
    .questionnaire-track .questionnaire-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        max-width: none;
        max-height: none;
    }

    .video-track video,
    .video-track img.track-poster {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Show full landscape video on mobile (letterboxed if needed) */
    .track-content.video-track.landscape video,
    .track-content.video-track.landscape img.track-poster {
        object-fit: contain;
        /*object-position: center center;*/
    }

    .track-content.video-track:not(.landscape).has-progress-open {
        padding-right: 0; /* no reserved right space */
    }
    .track-content.video-track:not(.landscape).has-progress-open .track-progress-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        z-index: 2000;

        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: 85vh;  /* scroll if tall */
        overflow: auto;

        /* same corner treatment as mobile */
        border-radius: 12px 12px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Use modal on mobile; no right-side reservation */
    .track-content.video-track.landscape.has-progress-open {
        padding-right: 0;
    }

    /* Center the progress panel as a modal over the video */
    .track-content.video-track.landscape.has-progress-open .track-progress-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        z-index: 2000;

        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: 85vh;         /* scroll if tall */
        overflow: auto;

        /* Corner treatment: keep top corners, remove bottom corners */
        border-radius: 12px 12px 0 0;

        /* Optional: avoid iOS home-indicator overlap */
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Removed: .track-progress-panel .track-progress-body { max-height: 34vh }.
       Obsolete now that mobile bodies flex-grow inside a panel floored at 50vh and
       capped at 85vh (see the "Mobile Bottom Sheets" block). Deleted rather than
       overridden because it had the same (0,2,0) specificity as the growth rule, so
       the outcome would have rested purely on source order — a tie a later edit or a
       bundler reorder could silently flip. */

    /* Hide desktop navigation */
    .tracks-navigation {
        display: none;
    }

    /* Reposition track-actions to bottom-right with 1rem padding */
    .track-actions {
        position: absolute;
        bottom: 1rem;
        right: 1rem;
        z-index: 30;
        background: none;
        gap: 1rem;
    }

    /* Adjust video-overlay width to accommodate track-actions */
    .video-overlay {
        padding-right: 5rem; /* Make space for track-actions */
    }

    /* Ensure track-content takes full space */
    .track-content {
        gap: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Fix mobile Swiper slide positioning */
    .tracks-swiper {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .track-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        position: relative;
        overflow: hidden;
    }

    .tracks-swiper .swiper-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translateZ(0); /* Force hardware acceleration */
        position: relative;      /* ← NEW: Proper positioning */
        flex-shrink: 0;         /* ← NEW: Prevent shrinking */
    }

    /* Ensure proper slide stacking and prevent overlap */
    .tracks-swiper .swiper-wrapper {
        height: 100vh;
        height: 100dvh;
        transform: translateZ(0); /* Force hardware acceleration */
        display: flex;           /* ← NEW: Flex layout */
        flex-direction: column;  /* ← NEW: Vertical stacking */
    }

    /* Action buttons styling for mobile */
    .track-actions .action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .track-actions .action-btn {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(4px);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .track-actions .action-btn:hover {
        background: rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }

    .track-actions .action-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .track-actions .action-count {
        color: white;
        font-size: 0.75rem;
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* Mobile Mute Toggle Styling for Tracks */
    .mobile-mute-toggle.persistent {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        animation: mute-hint-pulse 1.8s ease-in-out infinite;
    }

    .mobile-mute-toggle,
    .mobile-play-toggle {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 25;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
    }

    .mobile-mute-toggle.show,
    .mobile-play-toggle.show {
        opacity: 1;
        visibility: visible;
    }

    .mute-icon-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 4rem;
        height: 4rem;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(8px);
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .mute-icon-container svg {
        width: 2rem;
        height: 2rem;
    }
}

/* Desktop styles remain unchanged for tracks */
@media (min-width: 769px) {
    .tracks-container {
        height: calc(100vh - 88px);
        height: calc(100dvh - 88px);
        position: relative;
    }

    .track-actions {
        position: relative;
        bottom: auto;
        right: auto;
    }

    .video-overlay {
        padding-right: 1rem;
    }
}

/* Feeds Container (similar to tracks but for feed page) */
.feeds-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    overflow: hidden;
    background: #000;
}

.feeds-swiper {
    width: 100%;
    height: 100%;
    touch-action: pan-x; /* tell browser: JS owns vertical touch, don't compete */
}

/* YouTube-style end-of-feed loader. Sits below the swiper in DOM order so it
   is visually hidden behind the swiper at rest. When the swiper translates up
   by a full slide height (peek), this skeleton fills the revealed viewport
   with a placeholder of the video + action buttons so the user has something
   to see while waiting for SSE to deliver the next slide. */
.feeds-end-loader {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    /* The page tint, not #fff, so a legitimate peek reads as the app surface continuing
       rather than a white slab appearing. The TOKEN and not `background: none` here,
       unlike the container and slide above it: this sheet has to COVER something —
       at <=768px the container behind it is #000 fullscreen — so it must paint, and the
       surface token is what makes it paint the same colour .main does. */
    background: var(--main-surface-color);
    opacity: 0;
    pointer-events: none;
}

.feeds-end-loader.show {
    opacity: 1;
}

/* Stage mirrors .feed-content layout (video + actions side-by-side). */
.feeds-end-loader-stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
}

/* Video skeleton — matches .video-feed .video-container portrait dimensions.
   A narrow bright band sweeps across a darker base so even the shimmer peak
   stays visibly gray (otherwise on a full-viewport mobile area the highlight
   looks white). */
.feeds-end-loader-video {
    position: relative;
    width: 50vh;
    width: 50dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    border-radius: 12px;
    background-color: #dcdcdc;
    background-image: linear-gradient(
        90deg,
        #dcdcdc 0%,
        #dcdcdc 40%,
        #ececec 50%,
        #dcdcdc 60%,
        #dcdcdc 100%
    );
    background-size: 200% 100%;
    animation: feedSkeletonShimmer 1.6s linear infinite;
    overflow: hidden;
}

/* Inner placeholders inside the video skeleton — mirror the live slide's
   bottom-left CTA + title row so the area looks like a real video card. */
.feeds-end-loader-video-overlay {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    pointer-events: none;
}

.feeds-end-loader-video-cta {
    width: 9rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background-color: #c6c6c6;
    background-image: linear-gradient(
        90deg,
        #c6c6c6 0%,
        #c6c6c6 40%,
        #d8d8d8 50%,
        #c6c6c6 60%,
        #c6c6c6 100%
    );
    background-size: 200% 100%;
    animation: feedSkeletonShimmer 1.6s linear infinite;
}

.feeds-end-loader-video-title {
    width: 65%;
    max-width: 18rem;
    height: 0.875rem;
    border-radius: 4px;
    background-color: #c6c6c6;
    background-image: linear-gradient(
        90deg,
        #c6c6c6 0%,
        #c6c6c6 40%,
        #d8d8d8 50%,
        #c6c6c6 60%,
        #c6c6c6 100%
    );
    background-size: 200% 100%;
    animation: feedSkeletonShimmer 1.6s linear infinite;
}

/* Action column — matches .feed-actions. */
.feeds-end-loader-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
    padding-bottom: 0.2rem;
}

.feeds-end-loader-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

/* Action button placeholder — matches .action-btn (3rem rounded square). */
.feeds-end-loader-action-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background-color: #ebebeb;
    background-image: linear-gradient(
        90deg,
        #ebebeb 0%,
        #f5f5f5 50%,
        #ebebeb 100%
    );
    background-size: 200% 100%;
    animation: feedSkeletonShimmer 1.4s linear infinite;
}

/* Count placeholder below each action button. */
.feeds-end-loader-action-count {
    width: 1.5rem;
    height: 0.875rem;
    border-radius: 4px;
    background-color: #ebebeb;
    background-image: linear-gradient(
        90deg,
        #ebebeb 0%,
        #f5f5f5 50%,
        #ebebeb 100%
    );
    background-size: 200% 100%;
    animation: feedSkeletonShimmer 1.4s linear infinite;
}

@keyframes feedSkeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile: video skeleton fills the viewport (no rounded corners), and the
   actions column overlays in the bottom-right — same as the live slide. */
@media (max-width: 768px) {
    .feeds-end-loader-stage {
        position: relative;
    }
    .feeds-end-loader-video {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }
    .feeds-end-loader-actions {
        position: absolute;
        bottom: 1rem;
        right: 1rem;
        gap: 1rem;
    }
    /* Push the inner overlay left of the action column. */
    .feeds-end-loader-video-overlay {
        right: 5rem;
        bottom: 1.5rem;
    }
}

/* THE FEED PLAYER'S WHITE SLAB — the fix is the .feeds-swiper rule below, NOT this one.
   Read both together.

   Swiper renders these slides through its VIRTUAL module, and its virtual params carry no
   renderSlide (video-shared.js's createVerticalSwiperConfig sets virtual:{enabled, slides,
   addSlidesBefore, addSlidesAfter, cache} and nothing else; the vendored bundle defaults
   `renderSlide: null`). Its null path is:
       i = createElement('div', params.slideClass);  i.innerHTML = <our slide string>
   so every rendered slide is DOUBLE-WRAPPED — a BARE outer `div.swiper-slide` carrying
   `data-swiper-slide-index`, containing this `.swiper-slide.feed-slide` as its innerHTML.
   The generic `.swiper-slide { background: #fff }` (~1318) paints that OUTER wrapper, at
   every width, and that is the white the client reported. Making THIS class transparent (as
   a first attempt did) changes only the inner element, which sits invisibly on top of a
   white parent — the client's devtools showed rgba(0,0,0,0) here while the eye still saw
   white.
   This declaration is kept because it is correct on its own terms (a slide should not paint)
   and because it is what the layout wants if the double-wrap is ever removed. */
.feed-slide {
    text-align: center;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* THE FIX for the client's white feed slide. Descendant selector on purpose: it is (0,2,0),
   so it outranks the generic `.swiper-slide { background: #fff }` (0,1,0) wherever either
   sits in the file, and it matches BOTH slide elements of the double-wrap described above —
   the bare outer wrapper Swiper's virtual module creates AND our inner .feed-slide.
   Scoped to .feeds-swiper, so the generic white is untouched for every other carousel.
   What shows through: .main's tint at >=769 (what the client asked for) and
   .feeds-container's #000 at <=768, where the player is a fullscreen fixed layer and .main
   is not behind it at all.
   The tracks swiper had the identical double-wrap and the identical outer white; it is now
   fixed the same way, one rule down. */
.feeds-swiper .swiper-slide {
    background: transparent;
}

/* THE SAME FIX for the course-TRACK player. Same double-wrap, same cause, same shape of
   selector: (0,2,0) beats the generic `.swiper-slide { background: #fff }` (0,1,0)
   order-independently, and it matches BOTH halves — Swiper's bare outer wrapper AND our own
   `.swiper-slide.track-slide` from tracks/fragments/video.html.
   Unbanded on purpose. The >=769 block at ~4322 already zeroes .tracks-container and
   .track-slide, but it never reached the outer wrapper (its comment claimed the generic rule
   did; it does not), so the white was live in BOTH bands — the client happened to report the
   phone one.
   What shows through, measured through a real Swiper instance:
     >=769  .tracks-container is `background: none` there, so .main's tint reads through —
            the tint frame the player is supposed to sit in.
     <=768  .tracks-container's own `background: #FFF` (~2325) is the next layer down and is
            NOT overridden in the phone band, so removing the slide's white uncovers an
            identical white. Harmless while the video fills the screen (100vw/100dvh, its own
            #000 + thumbnail behind any letterbox), but it means this rule alone does not make
            the phone band black the way .feeds-container does. Left as-is deliberately:
            repainting .tracks-container is a visual decision for the client, not a
            consequence of this bug. */
.tracks-swiper .swiper-slide {
    background: transparent;
}

.feed-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem;
}

/* Video Feed Styles */
.video-feed .video-container {
    position: relative;
    width: 50vh;
    width: 50dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Poster image: absolutely positioned to match background-image geometry exactly,
   eliminating any sub-pixel shift when the img paints over the container background.
   background-image on the container handles Safari GPU compositing during animation. */
.video-feed .video-container img.track-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video: absolutely positioned so it overlays the poster without displacing it
   when moved into the container after the slide animation completes */
.video-feed video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

/* Optional: overlay shown when autoplay is blocked */
/* Tap-to-play: invisible full-cover hit area; shows a centred play button */
.tap-to-play-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 25;
}
.tap-to-play-overlay.show { display: flex; }

/* === First-run "swipe up" hint ===
   components/swipe_hint.html, shown once per user by maybeShowSwipeHint() in
   video-shared.js. It ships as a child of .feeds-container / .tracks-container
   (outside the swiper, so slide rendering cannot race it) and is reparented at
   show time onto the active slide's .video-container — the player box itself.

   That reparenting is what makes `inset: 0` mean "exactly the player": on desktop
   the player is a 50dvh-wide centred column, far narrower than the container.
   .video-container's own overflow: hidden clips the wash to its 12px corners, and
   at <=768px it goes 100vw/100dvh so mobile is full-bleed as before.

   z-index 26 sits at the top of the player's own ladder — .video-overlay (10),
   .video-controls (20), .video-scrubber (24), .tap-to-play-overlay (25). Being
   inside .video-container also means the docked .track-progress-panel (z 90, a
   sibling of the player box) correctly paints above the hint, so the panel guard
   below is now belt-and-braces rather than the only thing holding it back. */
.swipe-hint {
    /* One source of truth for the arrow's geometry. The arrowhead numbers are the
       export's own box (src/static/images/swipe-arrowhead.svg), whose 90deg
       chevron's stroked ink fills it exactly — there is no padding to discount. */
    --swipe-hint-arrowhead-w: 28.2775px;
    --swipe-hint-arrowhead-h: 15.3102px;
    /* Pulls the shaft up into the chevron so the two read as one drawn arrow
       rather than two stacked pieces. Straight from the design, which carries
       mb-[-9.999px] on the arrowhead. At this offset the shaft's top corners meet
       the inside of both 45deg legs; without it there is an 11.31px void between
       the shaft's top and the apex. */
    --swipe-hint-arrow-overlap: -9.999px;
    --swipe-hint-arrow-short: 47px;
    --swipe-hint-arrow-long: 94px;
    /* The arrow's box: tall enough for frame 2 *including* the overlap. Sizing it
       to --swipe-hint-arrow-long alone left frame 2's content 15.31px over the
       box, and since the shaft is the only flexible item there, it silently
       shrank to ~78.7px — a frame-2 arrow 16% shorter than designed. */
    --swipe-hint-arrow-box: calc(var(--swipe-hint-arrowhead-h)
                                 + var(--swipe-hint-arrow-overlap)
                                 + var(--swipe-hint-arrow-long));
    --swipe-hint-hand-drop: 12px;

    position: absolute;
    inset: 0;
    display: none;
    /* The user's first gesture must reach the video underneath — the hint only
       observes it (document-level listeners) and disappears. */
    pointer-events: none;
    z-index: 26;
    /* Soft dark wash over the lower two thirds, clear by 68% up the player. */
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.50) 0%,
        rgba(0, 0, 0, 0.45) 35%,
        rgba(0, 0, 0, 0) 68%);
    color: #fff;
}

/* An animation, not a transition: the element goes display:none -> block in the
   same frame, and a transition cannot start from a display:none base style.
   Fill mode is `backwards`, never `forwards`/`both` — a forwards fill would hold
   opacity 1 at animation origin, which outranks .is-leaving's declared opacity 0
   in the cascade and would stop the exit fade from ever running. */
.swipe-hint.is-visible {
    display: block;
    animation: bl-swipe-hint-in 0.3s ease-out backwards;
}

/* Exit. Keep in step with SWIPE_HINT_FADE_MS in video-shared.js, which waits out
   this duration before removing the element. */
.swipe-hint.is-leaving {
    opacity: 0;
    transition: opacity 0.48s ease-out;
    /* Ends the entry animation so its base value stops competing with opacity 0
       above (see the fill-mode note). */
    animation: none;
}

@keyframes bl-swipe-hint-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Never compete with the things that own the surface: the tap-to-play button (the
   only way to start playback when autoplay is blocked), the persistent
   tap-to-unmute pulse, and any open side panel or bottom sheet.

   The unmute pulse matters most: _showTapToUnmuteHint() fires on the
   autoplay-fell-back-to-muted path, so it appears WITHOUT any user interaction —
   the one case where it and this hint are on screen together, both centred. It
   already stands down for .tap-to-play-overlay.show (app.js ~3482); this joins
   the same mutual exclusion from the other side. Yielding is the right direction:
   the pulse is an action the user must take, this is only a suggestion.

   These are live selectors, so removing .persistent (on unmute, or via
   _hideTapToUnmuteHint) restores the hint if it is still mounted and
   undismissed.

   :not(.is-leaving) matters: display:none kills a running transition outright, so
   without it a tap that both dismisses the hint AND raises one of these (tapping
   a muted video unmutes it, adding .persistent) would make the hint disappear
   instantly instead of fading. The guards suppress the hint; they must never
   interrupt its exit. */
.feeds-container:has(.tap-to-play-overlay.show) .swipe-hint:not(.is-leaving),
.tracks-container:has(.tap-to-play-overlay.show) .swipe-hint:not(.is-leaving),
.feeds-container:has(.mobile-mute-toggle.persistent) .swipe-hint:not(.is-leaving),
.tracks-container:has(.mobile-mute-toggle.persistent) .swipe-hint:not(.is-leaving),
.feeds-container:has(.track-progress-panel.open) .swipe-hint:not(.is-leaving),
.tracks-container:has(.track-progress-panel.open) .swipe-hint:not(.is-leaving) {
    display: none;
}

/* Lower third, per the design (Figma 310x600 frame) — NOT centred.
   Anchored by the arrow box's BOTTOM edge at 72.5% of player height, which is
   what translating up by exactly one arrow-box height achieves. Measured against
   the design's 600px frame, frame 1 lands at
     arrow top    435 - 52.3     = 382.7 -> 63.8%  (design 64.5%)
     cluster mid  (382.7 + 435)/2 = 408.8 -> 68.1% (design 66-69%)
     text centre  435 + 12 + 9   = 456   -> 76.0%  (design ~75%)
   and frame 2's arrow grows up from the same anchor to
     435 - 99.3 = 335.7 -> 55.9%                   (design ~55%)
   Every figure moved closer to the design once the shaft overlap was restored,
   which is a good independent check that the overlap belongs there.
   Percentages, not pixels, so it holds at every player size. */
.swipe-hint-inner {
    position: absolute;
    top: 72.5%;
    left: 50%;
    transform: translate(-50%, calc(-1 * var(--swipe-hint-arrow-box)));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.swipe-hint-icon {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

/* Fixed to the TALL frame's height so the outer layout never reflows as the line
   grows; flex-end anchors the group at the bottom so the arrowhead travels up. */
.swipe-hint-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: var(--swipe-hint-arrow-box);
}

/* Size restated in CSS so no layout or inherited rule can alter the box — the
   chevron's legs only stay at 45deg (a 90deg apex) while the box keeps the
   export's exact 28.2775 x 15.3102 ratio. The negative bottom margin is the
   join: it lifts the shaft into the chevron. */
.swipe-hint-arrowhead {
    display: block;
    flex-shrink: 0;
    width: var(--swipe-hint-arrowhead-w);
    height: var(--swipe-hint-arrowhead-h);
    margin-bottom: var(--swipe-hint-arrow-overlap);
}

.swipe-hint-line {
    /* Within 1/2500 px of the chevron's 3.99964 stroke, so head and shaft read as
       one weight. */
    width: 4px;
    height: var(--swipe-hint-arrow-short);
    /* The shaft's length IS the animation — never let a tight flex box shorten it
       (which is exactly what the old 94px box did to frame 2). */
    flex-shrink: 0;
    border-radius: 80px;
    background: #fff;
    animation: bl-swipe-hint-line 1s ease-in-out infinite alternate;
}

/* The design hangs the hand well below the arrow's baseline, overlapping the
   label's row. Clamped to the gap above the label instead: our players are fluid,
   and at narrow widths the full drop would collide with the centred text. */
.swipe-hint-hand {
    display: block;
    /* translate BEFORE rotate: transform functions apply right-to-left, so the
       hand rises straight up the screen instead of along its own tilted axis. */
    transform: translateY(var(--swipe-hint-hand-drop)) rotate(-45deg);
    animation: bl-swipe-hint-hand 1s ease-in-out infinite alternate;
}

.swipe-hint-text {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

/* Frame 1 -> Frame 2: the line roughly doubles and the hand rides up with it.
   `alternate` returns to Frame 1, so the two-frame design loops as drawn. */
@keyframes bl-swipe-hint-line {
    from { height: var(--swipe-hint-arrow-short); }
    to   { height: var(--swipe-hint-arrow-long); }
}

/* The hand rises by exactly the length the line gains, so the two read as one
   gesture rather than two things moving at different speeds. */
@keyframes bl-swipe-hint-hand {
    from {
        transform: translateY(var(--swipe-hint-hand-drop)) rotate(-45deg);
    }
    to {
        transform: translateY(calc(var(--swipe-hint-hand-drop)
                                   - var(--swipe-hint-arrow-long)
                                   + var(--swipe-hint-arrow-short)))
                   rotate(-45deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Hold Frame 1 — a static short arrow still reads as "swipe up". */
    .swipe-hint-line,
    .swipe-hint-hand {
        animation: none;
    }

    /* Instant in both directions. The removal timer still runs, so the element is
       cleaned up either way — it just has nothing to wait for. */
    .swipe-hint.is-visible {
        animation: none;
    }

    .swipe-hint.is-leaving {
        transition: none;
    }
}

.tap-to-play-btn {
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tap-to-play-btn svg {
    width: 26px;
    height: 26px;
    fill: #fff;
    margin-left: 3px; /* optical centering of the play triangle */
    pointer-events: none;
}

/* Desktop landscape layout for feeds: actions below video aligned to right edge */
@media (min-width: 769px) {
    .feed-content.video-feed.landscape {
        display: flex;            /* ensure layout control on parent */
        flex-direction: column;   /* stack video then actions row */
        align-items: flex-start;
        gap: 0.5rem;
    }

    .feed-content.video-feed.landscape .video-container {
        width: 75vw;
        height: auto;                     /* follow aspect-ratio */
        max-height: calc(100vh - 145px);
    }

    .feed-content.video-feed.landscape video,
    .feed-content.video-feed.landscape img.track-poster {
        object-fit: contain;              /* show full frame */
        background: #000;
    }

    .feed-content.video-feed.landscape .feed-actions {
        position: relative;
        width: 70vw;                      /* match video width */
        margin: 0 auto;
        display: flex;
        flex-direction: row;              /* horizontal row */
        justify-content: flex-end;        /* align to video right edge */
        gap: 0.75rem;
    }

    .feed-content.video-feed.landscape .action-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
    }
}

/* Feed Actions (Right Side) */
.feed-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

/* Feeds Navigation */
.feeds-navigation {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 30;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn:hover {
    background: white;
    transform: scale(1.05);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* Video Controls */
.video-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 20;
    width: calc(100% - 2rem);
    justify-content: space-between;
}

.video-control-btn {
    display: inline-flex;
    padding: 0.5rem;
    gap: 0.625rem;
    border-radius: 1.5625rem;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(4.5px);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 2.5rem;
    min-height: 2.5rem;
    justify-content: center;
    align-items: center;
}

.video-control-btn:hover {
    background: rgba(0, 0, 0, 0.50);
    transform: scale(1.05);
}

.video-control-btn:active {
    transform: scale(0.95);
}

/* Responsive Control Visibility */
.mobile-only {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

.mobile-hidden {
    display: none !important;
}

/* Icon visibility states */
.video-control-btn .play-icon,
.video-control-btn .pause-icon,
.video-control-btn .mute-icon,
.video-control-btn .unmute-icon {
    transition: opacity 0.2s ease;
}

/* Fix click event bubbling - SVG icons should pass clicks through to button */
.video-control-btn svg {
    pointer-events: none;
}

/* Video Overlay and Description */
.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 2rem 1rem 0.75rem;
    z-index: 10;
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-description {
    color: white;
    text-align: left;
}

.video-description p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 400;
}

/* Hint that the description is interactive (opens the description side-panel). */
.video-description--clickable {
    cursor: pointer;
    /* Light feedback on touch — brief opacity flash when the area is tapped. */
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s ease;
}

.video-description--clickable:active {
    opacity: 0.7;
}

/* Title with chevron hint — the chevron-down indicates "more available".
   Block layout so multi-line titles wrap naturally and the chevron flows
   inline after the last word (rather than sticking out at the bottom-right
   of a 3-line text block, which would happen with inline-flex). */
.video-title-with-hint {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 400;
    color: white;
}

/* Glue the title's last word + chevron together so the chevron never wraps
   onto a new line alone (orphan). The preceding words (.video-title-text)
   wrap normally; only the tail is held together as a single unit. */
.video-title-tail {
    white-space: nowrap;
}

.video-title-hint-icon {
    display: inline-block;
    vertical-align: -2px;
    margin-left: 0.3rem;
    color: white;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Desktop hover affordance — chevron brightens and title gains an underline,
   reinforcing that the area is clickable. No-op on touch devices. Target the
   whole .video-title-with-hint so both the leading text and the trailing
   "last word + chevron" tail are underlined together. */
@media (hover: hover) and (pointer: fine) {
    .video-description--clickable:hover .video-title-with-hint {
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .video-description--clickable:hover .video-title-hint-icon {
        opacity: 1;
        transform: translateY(1px);
        text-decoration: none;
    }
}

.download-app {
    margin-bottom: 0.5rem;
}

/* Description side-panel content (opened on click of .video-description).
   The panel is a flex column: header (fixed), title section (fixed), then
   the body — which alone scrolls when the description overflows. text-align:
   left overrides the .feed-slide center-align that would otherwise cascade
   into the panel content. */

/* Fixed title section — stays put while the description below scrolls.
   Separator between title and description will return alongside the
   likes/views/date boxes in a later iteration. */
.feed-description-fixed {
    flex: 0 0 auto;
    padding: 1rem 1.25rem 0;
    text-align: left;
}

.feed-description-title {
    margin: 0;
    text-align: left;
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    color: #000;
}

/* Scrollable body — grows to fill remaining space; only the description
   inside scrolls when it exceeds the available height. */
.description-panel .track-progress-body {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    padding: 0.5rem 1.25rem 1.25rem;
    text-align: left;
    overflow-y: auto;
}

.feed-description-text {
    margin: 0;
    text-align: left;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    color: #555;
    /* Preserve manual line breaks authored in the description while still
       wrapping naturally on long lines. */
    white-space: pre-wrap;
    word-break: break-word;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    /* Hide header on mobile for full-screen experience */
    .main-header {
        display: none !important;
    }

    /* Full-screen container on mobile */
    .feeds-container {
        height: 100vh;
        height: 100dvh;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
    }

    /* Full-screen video on mobile */
    .video-feed .video-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .video-feed video,
    .video-feed img.track-poster {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Show full landscape video on mobile (letterboxed if needed) */
    .feed-content.video-feed.landscape video,
    .feed-content.video-feed.landscape img.track-poster {
        object-fit: contain;
        /*object-position: center center;*/
    }

    /* Hide desktop navigation */
    .feeds-navigation {
        display: none;
    }

    /* Mobile Control Visibility */
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    /* Reposition feed-actions to bottom-right with 1rem padding */
    .feed-actions {
        position: absolute;
        bottom: 1rem;
        right: 1rem;
        z-index: 30;
        background: none;
        gap: 1rem;
    }

    /* Adjust video-description width to accommodate feed-actions */
    .video-overlay {
        padding-right: 5rem; /* Make space for feed-actions */
    }

    .video-description {
        /*max-width: calc(100% - 4rem);*/
    }

    /* Ensure feed-content takes full space */
    .feed-content {
        gap: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Fix mobile Swiper slide positioning to prevent overlap */
    .feeds-swiper {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .feed-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        position: relative;
        overflow: hidden;
    }

    .feeds-swiper .swiper-slide {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translateZ(0); /* Force hardware acceleration */
    }

    /* Ensure proper slide stacking and prevent overlap */
    .feeds-swiper .swiper-wrapper {
        height: 100vh;
        height: 100dvh;
        transform: translateZ(0); /* Force hardware acceleration */
    }

    /* Action buttons styling for mobile */
    .action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }

    .action-btn {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(4px);
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .action-btn:hover {
        background: rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
    }

    .action-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .action-count {
        color: white;
        font-size: 0.75rem;
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* Video controls positioning on mobile */
    .video-controls {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        justify-content: space-between;
    }

    .back-btn {
        /* Position on left */
        margin-right: auto;
    }

    .search-btn {
        /* Position on right */
        margin-left: auto;
    }
}

/* Desktop styles remain unchanged */
/* === Players: let .main's tint read through, >=769px ========================= */
/*
 * The player's box painted a solid colour inside .main's tinted 16px frame, so the video
 * read as sitting on a white (course) or black (feed) slab rather than as a card on the
 * app's surface. Four surfaces stack between .main and the video; this is the whole
 * composite in one place, at the altitude that covers EVERY variant — portrait,
 * landscape, has-progress-open or not — instead of one rule per combination:
 *
 *   .main                  var(--main-surface-color)    <- the only thing that should paint
 *   .feeds/.tracks-container  #000 / #FFF               -> transparent here
 *   .swiper-slide (Swiper's own outer wrapper — see the double-wrap note at ~3445)
 *                             #fff  -> NOT handled here, and an earlier version of this
 *                             comment wrongly said the generic rule handled it. It is killed
 *                             at EVERY width by the two descendant rules `.feeds-swiper
 *                             .swiper-slide` (~3482) and `.tracks-swiper .swiper-slide`
 *                             (~3504), which is the only shape that outranks the generic
 *                             single-class white.
 *   .feed-slide               transparent in its own rule (~3445) at EVERY width, since the
 *                             client reported the white it used to paint below 769px
 *   .track-slide              #fff                      -> transparent here, and also by the
 *                             .tracks-swiper descendant rule at every width
 *   .feed-content/.track-content   (never painted)
 *   .video-container          #000                      <- KEPT: the letterbox behind the
 *                                                          video's own aspect ratio
 *
 * WHY background: none AND NOT var(--main-surface-color): the token is an opaque
 * white-mix, so on .main the two are pixel-identical — and transparent is the honest
 * statement. None of these elements paints over anything except .main, so re-declaring
 * the tint on four nested boxes would be four places to update when the token changes,
 * and would hide the fact that they are panes rather than surfaces. The token is right
 * only where an element must cover something else (see .track-progress-panel, which
 * stays a real white card floating over the tint).
 *
 * >=769px ONLY, and that bound is not arbitrary: at <=768px both containers go
 * position: fixed / 100dvh / z-index 1000 and cover the viewport entirely (~2616, ~3689),
 * so there is no tint frame to reveal and the fullscreen players are left exactly as they
 * are — black feed, white track, both hidden behind a video that fills the screen.
 *
 * Placed after .swiper-slide (~1318) and .feed-slide (~3462) on purpose: all three are
 * single-class selectors, so source order is what settles the cascade. Scoped to the two
 * PLAYER slide classes, never to .swiper-slide itself — not because another carousel needs
 * that generic white (nothing does; the audit is at ~7169) but because nobody has
 * established that deleting it is safe.
 */
@media (min-width: 769px) {
    .feeds-container,
    .tracks-container,
    .feed-slide,
    .track-slide {
        background: none;
    }
}

@media (min-width: 769px) {
    .main-header {
        display: flex !important;
    }

    .feeds-container {
        height: calc(100vh - 88px);
        height: calc(100dvh - 88px);
        position: relative;
    }

    .feed-actions {
        position: relative;
        bottom: auto;
        right: auto;
    }

    .video-overlay {
        padding-right: 1rem;
    }
}

@media (min-width: 769px) {
    /*.feed-content.video-feed.landscape.has-progress-open {*/
    /*    position: relative;*/
    /*    padding-right: calc(55dvh + 0.5rem);*/
    /*}*/
    /*@supports not (height: 1dvh) {*/
    /*    .feed-content.video-feed.landscape.has-progress-open {*/
    /*        padding-right: calc(55vh + 0.5rem);*/
    /*    }*/
    /*}*/
    /*.feed-content.video-feed.landscape.has-progress-open .video-container {*/
    /*    width: 72vw;*/
    /*    max-width: calc(100% - 3rem - 5rem);*/
    /*}*/
    /*.feed-content.video-feed.landscape.has-progress-open .track-progress-panel {*/
    /*    position: absolute;*/
    /*    top: 0;*/
    /*    right: auto;*/
    /*    z-index: 90;*/
    /*    height: auto;*/
    /*}*/
}

@media (max-width: 768px) {
    .feed-content.video-feed.has-progress-open {
        padding-right: 0;
    }
    .feed-content.video-feed.has-progress-open .track-progress-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        z-index: 2000;
        width: 100vw;
        max-width: 100vw;
        height: auto;
        max-height: 85vh;
        overflow: auto;
        border-radius: 12px 12px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    /* Two rules removed here, both mobile-scoped only, so the desktop feed
       side-panels are untouched:
         - .comments-progress-body { min-height: 50vh } — every mobile sheet now
           presents at one standard height, governed by the panel-level
           min-height: 50vh in the "Mobile Bottom Sheets" block.
         - .track-progress-body { max-height: 34vh } — at (0,4,0) it outranked the
           body-growth rule in that block and pinned the comments and description
           bodies to 34vh inside a >=50vh panel, leaving dead space. Obsolete now
           that all three bodies flex-grow and the panel's 85vh cap bounds them. */
}

/* ===== COMPLETION SLIDE STYLES ===== */

/* Completion Track Styles */
.completion-track .completion-container {
    position: relative;
    width: 50vh;
    width: 50dvh;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    background: linear-gradient(180deg, #3D3D3D 0%, #000 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    overflow: hidden;
    text-align: center;
}

.completion-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.completion-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.completion-tags .tag {
    background: rgba(255, 255, 255, 0.20);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.30);
}

.completion-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.completion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.completion-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 120%;
}

.completion-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 150%;
}

.completion-subtitle strong {
    font-weight: 600;
    color: white;
}

.completion-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 280px;
}

.completion-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    min-height: 48px;
}

.completion-btn.primary-btn {
    background: white;
    /* Was #B49164 / #9E9268 — a tan-gold and olive left over from an EARLIER
       TENANT's brand, so this painted the same foreign colour on every tenant.
       Converted to the token (client issue #9). The hover at ~2241 had the identical
       problem with #9d7c56 and was fixed once already; these are the rest of that
       palette. */
    color: var(--primary-color);
    border: 1px solid white;
}

.completion-btn.primary-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.completion-btn.secondary-btn {
    background: rgba(255, 255, 255, 0.10);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.30);
}

.completion-btn.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.50);
    transform: translateY(-1px);
}

/* Responsive Design for Completion Slide */
@media (max-width: 768px) {
    .completion-track .completion-container {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        padding: 2rem 1.5rem;
    }

    .completion-title {
        font-size: 1.25rem;
    }

    .completion-subtitle {
        font-size: 0.875rem;
    }

    .completion-actions {
        max-width: 100%;
    }
}

/* ===== CONCEPTS MODAL STYLES ===== */

/* Modal overlay */
.concepts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.concepts-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    /* Injected via HTMX already carrying .active, so the transition above
       never fires (no post-insert property change) — animate on insertion. */
    animation: conceptsOverlayIn 0.3s ease;
}

@keyframes conceptsOverlayIn {
    from { opacity: 0; }
}

/* Modal container */
.concepts-modal {
    display: flex;
    padding-bottom: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 0.75rem;
    background: #FFF;
    max-width: 32rem;
    width: 90%;
    max-height: 80vh;
    max-height: 80dvh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.concepts-modal-overlay.active .concepts-modal {
    transform: scale(1);
    animation: conceptsModalIn 0.3s ease;
}

@keyframes conceptsModalIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* Animated close: closeConceptsModal() adds .closing and removes the element only
   after the exit finishes, so the overlay fades and the modal scales back down
   (desktop) / slides down (mobile) instead of popping out of existence. .closing
   sits after the .active rules on purpose — same specificity, source order wins. */
.concepts-modal-overlay.closing {
    opacity: 0;
}

.concepts-modal-overlay.closing .concepts-modal {
    transform: scale(0.9);
}

/* Mobile: the modal is a BOTTOM SHEET, matching the course player's concept
   tracker (.track-progress-panel) — same --sheet-duration/--sheet-ease tokens,
   same slide-up/slide-down, same 24px top-only radius. Injected via HTMX already
   carrying .active, so entry is an insertion animation, like the desktop scale. */
@media (max-width: 768px) {
    .concepts-modal-overlay {
        align-items: flex-end;
    }

    .concepts-modal {
        width: 100vw;
        max-width: none;
        border-radius: 24px 24px 0 0;
        /* Same half-screen floor as the player's sheets (.track-progress-panel,
           ~7706): a track with two concepts would otherwise open a sheet a couple
           of rows tall. The base 80dvh max-height stays the ceiling. */
        min-height: 50vh;
        min-height: 50dvh;
        transform: translateY(100%);
        transition: transform var(--sheet-duration) var(--sheet-ease);
    }

    /* Fill the floored sheet instead of hugging content; the base rule's 60vh cap
       gives way to the modal's own ceiling + overflow:hidden, and the base
       overflow-y:auto keeps long concept lists scrolling inside the sheet. */
    .concepts-modal-body {
        flex: 1;
        max-height: none;
    }

    .concepts-modal-overlay.active .concepts-modal {
        transform: translateY(0);
        animation: conceptsSheetIn var(--sheet-duration) var(--sheet-ease);
    }

    .concepts-modal-overlay.closing .concepts-modal {
        transform: translateY(100%);
    }
}

@keyframes conceptsSheetIn {
    from { transform: translateY(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .concepts-modal-overlay.active,
    .concepts-modal-overlay.active .concepts-modal {
        animation: none;
    }
}

/* Modal header */
.concepts-modal-header {
    display: flex;
    padding: 1rem;
    align-items: center;
    gap: 1rem;
    align-self: stretch;
    background: var(--primary-color-light);
    justify-content: space-between;
    /* Same reason as the in-player panel header: .concepts-modal is a flex column
       with a scrolling body, and the header now contains a fixed 48px thumbnail
       that must not be compressed. */
    flex-shrink: 0;
}

/* .concepts-modal-title removed — the header now renders .concepts-header-info
   (card-stack thumbnail + course name over track title). See that rule below. */

/* .concepts-modal-close needs no rules of its own: .app-close-btn supplies the
   sizing, the centring and the flex-shrink: 0 that stops a long track title
   squeezing the X. */

/* Modal body */
.concepts-modal-body {
    display: flex;
    padding: 0 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    align-self: stretch;
    overflow-y: auto;
    max-height: 60vh;
    max-height: 60dvh;
}

/* Concept row */
.concept-row {
    display: flex;
    padding: 0.25rem 0;
    align-items: center;
    gap: 0.625rem;
    align-self: stretch;
    border-radius: 0.5rem;
}

.concept-tick-icon {
    display: flex;
    width: 1.5rem;
    height: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.concept-tick {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.concept-text {
    color: #000;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    flex: 1;
}

/* Make concepts-box clickable */
.concepts-box {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.concepts-box:hover {
    opacity: 0.8;
}

/* ===== PROGRESS PIE COMPONENT ===== */
.progress-pie {
    transform: rotate(0deg); /* Reset any rotation, we handle it in SVG */
}

.progress-pie circle {
    transition: stroke-dasharray 0.3s ease; /* Smooth progress animation */
}

.progress-text {
    font-size: 1.6rem;
    font-weight: 600;
    fill: #000;
    dominant-baseline: middle; /* Better vertical centering */
}

/* Video controls positioning on mobile */
.video-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 20;
}

/* Mobile Mute Toggle (Center Screen) */
/* .mobile-play-toggle is the tracks player's play/pause flash — same centre
   position and show/hide mechanics as the mute flash; it never gets .persistent. */
.mobile-mute-toggle,
.mobile-play-toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-mute-toggle.show,
.mobile-play-toggle.show {
    opacity: 1;
    visibility: visible;
}

/* Persistent tap-to-unmute hint — shown when video autoplays muted.
   pointer-events: none so taps fall through to the <video> underneath,
   keeping handleMobileVideoClick as the single consistent handler. */
@keyframes mute-hint-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.9; }
    50%       { transform: translate(-50%, -50%) scale(1.15); opacity: 1;   }
}

.mobile-mute-toggle.persistent {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    cursor: pointer;
    animation: mute-hint-pulse 1.8s ease-in-out infinite;
}

/* Desktop mute button — brief pulse when autoplay falls back to muted */
@keyframes mute-btn-attention {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.6; transform: scale(1.2);  }
}

.mute-unmute-btn.muted-hint {
    animation: mute-btn-attention 0.6s ease-in-out 3;
}

.mute-icon-container {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(4.5px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mute-icon-container svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

/*.like-btn {*/
/*    !*background: transparent;*!*/
/*    border: none;*/
/*    cursor: pointer;*/
/*    padding: 0;*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*}*/

.like-btn svg path {
    transition: fill 0.3s ease, stroke 0.3s ease;
}

/* THE LIKED HEART IS A SEMANTIC RED — client ruling 2026-09-16, which REVERSES the sheet-2
   audit that had tokenised it.

   The audit's reasoning was "a literal that agrees with one tenant is still a literal": the
   hex below is also the DEMO tenant's primary, so hardcoding it looked invisible here and
   would have painted a red heart on every other tenant's brand. That reasoning is sound for a
   BRAND AFFORDANCE, and wrong about what this is. The client has ruled the liked heart is
   semantic — a heart means "liked" the way a red verdict means "wrong", and a heart that
   turns teal on a teal tenant has stopped saying it. Same category as .option-btn.wrong.selected
   and --quiz-incorrect below, whose comment already argues this exact tension from the other
   side; that comment has been corrected to match.

   THE COINCIDENCE IS JUST A COINCIDENCE: this being the demo tenant's primary is why the
   original hardcoding went unnoticed, not why the value is right. On a teal-branded tenant the
   heart stays red — verified in a browser with --primary-color overridden, which is the whole
   point of the ruling.

   VALUE PROVENANCE: no liked-heart colour was reachable in Figma (see the round report — the
   design-system index returns nothing for either file), and the standalone prototype carries
   THREE different liked reds (#ff5a5f player, #e0245e feed tile, #ff5c76 feed over-video), so
   adopting one would have been a choice, not a reading. Per the coordinator's instruction the
   ORIGINAL #E1251B is restored rather than a new red invented. Replace it only with a value
   someone has actually specified.

   ONE RULE FOR BOTH PLAYERS: the feed and the course/track player render the same
   `.like-btn.liked` markup (feed/_feed_content.html, feed/_feed_recommendation_content.html,
   tracks/fragments/video.html, fragments/like.html), so the two cannot drift apart — a test
   asserts that single-rule fact rather than comparing two copies. */
.like-btn.liked svg path {
    fill: #E1251B;
    stroke: #E1251B;
}

/*.share-btn {*/
/*    background: transparent;*/
/*    border: none;*/
/*    cursor: pointer;*/
/*    padding: 0;*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*}*/

/* Share Modal (prefixed classes) */
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease
}

.share-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5)
}

.share-sheet {
    position: relative;
    background: #fff;
    color: #0F172A;
    transform: scale(.98);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
    overflow: hidden;
    outline: none;
    width: 31.1875rem;
    border-radius: 0.75rem;
    box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.05);
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    gap: 1rem;
    align-self: stretch;
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    background: #FFF;
}

.share-title {
    color: #000;
    text-align: center;
    font-size: 1rem;
    font-style: normal;
    font-weight: 600;
    line-height: 150%; /* 1.5rem */
}

/* .share-closeBtn is styling-free: the shared .app-close-btn supplies the icon
   box, the hover fade and the canonical focus ring (which replaces this sheet's
   old bespoke primary-colour ring). The glyph inherits the sheet's text colour
   on its white header, so no explicit colour is needed either. */

.share-appsWrap {
    position: relative;
    padding: 10px 10px 2px
}

.share-appsRow {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    align-items: flex-start;
    gap: 0.75rem;
}

.share-appsRow::-webkit-scrollbar {
    display: none
}

.share-socialBtn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 86px;
    text-decoration: none;
    color: #0F172A
}

.share-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center
}

.share-label {
    font-size: 13px
}

.share-socialBtn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 10px
}

.share-leftArrow, .share-rightArrow {
    position: absolute;
    top: calc(50% + 4px);
    transform: translateY(-50%);
    background: #fff;
    color: var(--primary-color);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;

    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 2.90063rem;
    border: 1px solid rgba(182, 182, 182, 0.10);
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.05) 100%), rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.share-leftArrow {
    left: 6px
}

.share-rightArrow {
    right: 6px
}

.share-leftArrow.show, .share-rightArrow.show {
    opacity: 1;
    pointer-events: auto
}

@keyframes shareNudgeLeft {
    from {
        transform: translate(-2px, -50%)
    }
    to {
        transform: translate(0, -50%)
    }
}

@keyframes shareNudgeRight {
    from {
        transform: translate(2px, -50%)
    }
    to {
        transform: translate(0, -50%)
    }
}

.share-nudgeLeft {
    animation: shareNudgeLeft .15s ease
}

.share-nudgeRight {
    animation: shareNudgeRight .15s ease
}

.share-copyRow {
    display: grid;
    grid-template-columns:auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin: 1rem;
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    background: #F8FAFC
}

.share-linkIcon {
    color: #6B7280;
    display: grid;
    place-items: center
}

.share-urlText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0F172A;
    font-size: 14px
}

.share-copyBtn {
    border: 0;
    background: var(--primary-color);
    width: 5rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    color: #FFF;
    text-align: center;
    font-size: 1rem;
    font-style: normal;
    font-weight: 600;
    line-height: 150%; /* 1.5rem */
}

.share-copyBtn:hover {
    filter: brightness(.95)
}

.share-copyBtn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px
}

/* Open state */
.share-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto
}

.share-open .share-sheet {
    opacity: 1;
    transform: scale(1)
}

/* Mobile bottom sheet */
@media (max-width: 768px) {
    .share-modal {
        align-items: end
    }

    .share-sheet {
        width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        transform: translateY(100%)
    }

    .share-open .share-sheet {
        transform: translateY(0)
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .share-modal, .share-sheet, .share-leftArrow, .share-rightArrow {
        transition: none !important
    }

    .share-nudgeLeft, .share-nudgeRight {
        animation: none !important
    }
}

/* The popup's dismiss target (client issue #2a: "tapping the background must close it").
   A REAL ELEMENT rather than a document listener, because on touch the player owns the
   video surface: handleMobileVideoClick and the tracks sheet's capture-phase guard both
   run first, and the latter calls stopImmediatePropagation() — which cancels the bubble
   phase outright, so the document-level outside-click close never fires while a sheet is
   open. A full-viewport layer under the menu receives the tap itself, so "outside" stops
   depending on who else is listening.
   Transparent on purpose — a dismiss target, not a dimming scrim; the design shows no
   dimming behind this popover. z-index sits one under .more-menu's 1000 so the menu stays
   clickable, and above the player's own chrome so nothing else can take the tap. */
.more-menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: transparent;
}

.more-menu {
    position: absolute;
    right: 0;
    bottom: 3.1rem;
    margin-bottom: 0.5rem;
    display: inline-flex;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    border-radius: 0.75rem;
    background: #FFF;
    box-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 17.5rem;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem;
    width: 100%;
    transition: opacity 0.2s;
}

.more-menu-item:hover {
    opacity: 0.7;
}

.more-menu-item span {
    color: #000;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 150%;
}

.more-menu-divider {
    width: 17.5rem;
    height: 0.0625rem;
    opacity: 0.1;
    background: #000;
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* background-color: rgba(0, 0, 0, 0.2); */ /* 10% black — hidden so only the spinner shows, no full-screen backdrop */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* Ensures it appears above everything */
  padding-left: 240px;
}

/* No sidebar in the flow at phone widths — the drawer is position: fixed — so the
   loader centres on the full width. Third member of the drawer set (single-column grid
   + fixed sidebar + this), and it must stay on the same <=768px bound as the other two.
   The tablet band keeps its rail, and the rail block sets its own 88px offset; above
   1270px the base rule's 240px desktop offset applies. */
@media (max-width: 768px) {
    .spinner-overlay {
        padding-left: 0;
    }
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(173, 103, 103, 0.1); /* Light outer ring */
  border-top-color: var(--primary-color); /* Dark top segment (like a pie slice) */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#global-loader {
    display: none;
}

#global-loader.htmx-request {
    display: flex;
}

/* TABLET RAIL (769-1270px) — the sidebar stays in the layout as an 88px card rail.
 *
 * This band has no bottom-nav dock and no overlay drawer: the dock is pinned to <=768px
 * (see the bottom-nav section) and the drawer/single-column rules live in the <=768px
 * block, so nothing below competes with the rail. The three main menus are the whole
 * rail; every submenu is hidden.
 *
 * THE WHOLE BAND IS ONE BLOCK on purpose: the phone drawer reuses this same .sidebar
 * subtree, so a rail rule that leaked below 769px would turn the opened mobile drawer
 * into icon cards.
 */
@media (min-width: 769px) and (max-width: 1270px) {
    /* === Tablet rail: main menus as cards =================================
     * This band used to render the WHOLE sidebar tree as bare icons — chevron-only
     * headers, course thumbnails, filter icons, dividers — which was unreadable. It now
     * shows ONLY the three main menus (Skills, Feed, You) as labelled cards, and hides
     * every submenu.
     *
     * Dimensions are the prototype's, not invented: rail 88px with 6px/6px/12px padding,
     * so the card is 88 - 6 - 6 = 76px wide and its height comes from its content (~63px),
     * NOT a square. .spinner-overlay is kept in step with the rail width below.
     */
    .layout {
        grid-template-columns: 88px 1fr; /* card rail + main */
    }

    .sidebar {
        padding: 6px 6px 12px;
        /* No align-items override: the default stretch is what makes each card fill the
           76px content box, matching the prototype's width: 100% on the card. */
    }

    /* Gap between cards. The prototype spaces its groups with margin-top: 4px +
       padding-top: 4px on every group after the first (= 8px); expressed here as one
       margin because our cards are <ul class="nav"> siblings with no padding of their own.
       :first-of-type keeps the top card flush with the rail padding — the hidden
       mobile-only <ul>s in between are display: none, so their margin never applies. */
    .sidebar > .nav {
        margin-top: 8px;
    }

    .sidebar > .nav:first-of-type {
        margin-top: 0;
    }
    .sidebar-brand .brand-name { display: none; }
    .section-title { margin-left: 0}

    /* Submenus, dividers and the headers' chevrons are all gone in this band.
       .sidebar-section wraps ONLY submenus now (the Skills bucket rows, the filter list and
       the My Skills row) — the three headers are bare <ul class="nav">, which is why this one
       selector can hide every submenu without touching them. */
    .sidebar-section,
    .nav-divider,
    .nav-link--skills-arrow {
        display: none;
    }

    /* The card itself. Inactive: white with a hairline border.
       Height is deliberately unset — 12px + 24px icon + 6px gap + ~11.5px label + 10px
       lands on the prototype's ~63px, and letting content decide it keeps the card honest
       if the label ever wraps to a second line.
       1.5px border is the prototype's weight (its .side .snav rule); rgba(0,0,0,.10) is
       this app's hairline, the equivalent of the prototype's --line token. */
    .nav-link--skills {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        /* Explicitly released: the desktop header box is a fixed 40px, and this card's
           height is deliberately content-driven (see the note above). */
        height: auto;
        gap: 6px;
        padding: 12px 4px 10px;
        border-radius: 14px;
        background: #fff;
        border: 1.5px solid rgba(0, 0, 0, 0.10);
        color: #000;
    }

    /* Full opacity, unlike the sidebar's .nav-link svg default of .6, because on a card
       the icon is the primary signal. (The base rule now shows the icon at every width —
       the boxed headers carry it too; this band only re-tunes it.) */
    .nav-link--skills .nav-card-icon {
        display: block;
        width: 24px;
        height: 24px;
        opacity: 1;
        margin: 0;
    }

    /* The label is shown here (the old rail hid every nav label) and is the card's
       caption, so it drops the sidebar's .6 label opacity and centres. */
    .nav-link--skills span {
        display: block;
        flex: none;
        opacity: 1;
        font-size: 10.5px;
        font-weight: 700;
        line-height: 1.1;
        text-align: center;
        /* The prototype pins the label to one line; the rail is too narrow to wrap
           gracefully and "My Skills"-length labels would otherwise break mid-word. */
        white-space: nowrap;
    }

    /* ACTIVE = the whole section, not just this URL. Driven by .is-section-active, which
       layout.html renders and updateNavActive() maintains — a separate class from .active
       precisely so the desktop never-highlight-header + proxy machinery is untouched. */
    .nav-link--skills.is-section-active {
        background: var(--primary-color-light);
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .user-link { justify-content: center; }
    .user-name { display: none; }

    /* Keep the loader centred against the rail — same value as the grid column. */
    .spinner-overlay { padding-left: 88px; }

    /* Closed panel */
    .track-content.video-track.landscape .video-container {
        width: 88%; /* 3rem = left margin */
        max-width: none; /* drop earlier max-width caps on tablet */
    }

    /* Panel open: parent already has padding-right for panel; do NOT subtract again */
    .track-content.video-track.landscape.has-progress-open .video-container {
        width: 88%;
        max-width: none;
        /* keep your tablet height rules as-is */
    }

    /* Do not reserve right-side space on tablet; we show a modal instead */
    .track-content.video-track.landscape.has-progress-open {
        padding-right: 0;
    }

    /* Center the progress panel as a modal */
    .track-content.video-track.landscape.has-progress-open .track-progress-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        right: auto;
        z-index: 200;             /* above .tracks-navigation (100) */
        width: min(90vw, 560px);  /* responsive modal width */
        max-width: 90vw;
        height: auto;
        max-height: min(80vh, 720px);
        overflow: auto;           /* scroll body if content longer */
    }
}

/* ===== Onboarding Modal ===== */
.ob-modal {
    position: fixed;
    inset: 0;
    z-index: 10005;
    display: grid;
    place-items: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.ob-modal.ob-open { visibility: visible; opacity: 1; pointer-events: auto; }

.ob-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }

.ob-sheet {
    position: relative;
    max-width: 54.5625rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #6AA7F4 0%, #6b72f6 100%);
    color: #FFF;
    box-shadow: 0 12px 36px rgba(0,0,0,.1);
    overflow: hidden;
}

.ob-body { padding: 1.5rem; }
.ob-swiper {
    width: 100%;
    overflow: hidden;
}

.ob-swiper .swiper-slide {
    background: transparent !important;
    background-color: transparent !important;
}

.ob-slide {
    display: flex;
    align-items: center;
    gap: 3rem; /* gap between image and text */
}

.ob-media { flex: 0 0 auto; }

.ob-image {
    width: 29.125rem;
    height: 22.75rem;
    flex-shrink: 0;
    border-radius: 1.01869rem;
    border: 1.358px solid #FFF;
    background: lightgray -5.413px -6.5px / 102.323% 103.571% no-repeat;
    background-size: cover;
    background-position: center;
}

.ob-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1 0 0;
}

.ob-title {
    color: #FFF;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 120%;
}

.ob-desc {
    color: #FFF;
    font-size: 1rem;
    font-weight: 400;
    line-height: 150%;
    opacity: .95;
}

/* Onboarding: force left-aligned text for title and description */
.ob-title,
.ob-desc {
    text-align: left;
    width: 100%;     /* ensures full line width for proper alignment */
}

/* Safety: keep text container left-aligned across breakpoints */
.ob-text { align-items: flex-start; }

/* Footer: Back | bullets | Next */
.ob-footer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem 1rem 1.5rem;
}

.ob-footer .ob-pagination {
    position: absolute;             /* keep centered regardless of button widths */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Allow buttons to be clickable even under pagination container */
.ob-footer .ob-pagination { pointer-events: none; }
.ob-footer .ob-pagination .swiper-pagination-bullet { pointer-events: auto; }

.ob-back {
    justify-self: start;
    display: flex;
    width: 4.9375rem;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    justify-content: center;
    align-items: center;
    gap: 18.125rem; /* requested even if not used visually */
    border-radius: 0.5rem;
    border: 1.5px solid #FFF;
    background: transparent;
    color: #FFF;
}
.ob-back.is-disabled { opacity: .5; pointer-events: none; }

.ob-next {
    justify-self: end;
    display: flex;
    height: 2.5rem;
    padding: 0.5rem 1.5rem;
    justify-content: center;
    align-items: center;
    gap: 18.125rem; /* requested even if not used visually */
    border-radius: 0.5rem;
    background: #FFF;
    color: #0F172A;
    border: none;
}

.ob-pagination { justify-self: center; }
.ob-footer .swiper-pagination-bullet { background: rgba(255,255,255,.6); opacity: 1; }
.ob-footer .swiper-pagination-bullet-active { background: #FFF; width: 10px; height: 10px; }

/* Onboarding: disallow horizontal touch gestures; allow vertical scroll in text */
.ob-swiper { touch-action: pan-y !important; }

/* ===== Onboarding choices grid ===== */
.ob-choices {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;                 /* horizontal first; wraps when needed */
    gap: 0.5rem;                     /* requested gap */
    justify-content: flex-start;
    align-content: flex-start;
    align-items: stretch;
    max-height: 100%;
    overflow-y: auto;                /* vertical scroll if many tiles */
    padding-right: 0.25rem;
}

.ob-choice {
    position: relative;
    display: flex;                   /* requested styles */
    width: 8.125rem;
    height: 6.625rem;
    min-width: 6.875rem;
    padding: 0.75rem 1rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.20);
    background: linear-gradient(97deg, rgba(255, 255, 255, 0.00) 1.04%, rgba(255, 255, 255, 0.30) 98.96%);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    color: #FFF;
    cursor: pointer;
    user-select: none;
}

.ob-choice-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.ob-choice-title {
    font-size: 0.875rem;
    line-height: 1.2;
    text-align: center;
    display: none;
}

/* Selected state: green tick at top-right */
.ob-choice.is-selected::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Make the choices area truly scrollable when inside a flex column */
.ob-text { min-height: 0; }

/* Use concepts tick inside onboarding choices */
.ob-choice { position: relative; } /* already set, keep it */

.ob-choice .concept-tick-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;          /* hidden until selected */
    z-index: 2;
}
.ob-choice.is-selected .concept-tick-icon { display: flex; }

/* Remove old pseudo-element tick, if still present */
.ob-choice.is-selected::after { content: none; }

/* Mobile: ensure grid fits width and tiles stretch nicely */
@media (max-width: 769px) {
    /*.ob-choices {*/
    /*    display: flex;*/
    /*    flex-wrap: wrap;*/
    /*    gap: 0.5rem;*/
    /*}*/
    /*.ob-choice {*/
    /*    width: 8.125rem;      !* keep fixed tile width *!*/
    /*    min-width: 6.875rem;*/
    /*    height: 5.125rem;*/
    /*}*/

    /* Make sure the text area and grid span full width */
    .ob-text { width: 100%; }

    .ob-choices {
        width: 100%;                                /* fill available width */
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        justify-items: stretch;                     /* stretch items to column width */
        align-items: stretch;
        flex: 1 1 auto;
        overflow-y: auto;
        margin-top: 0.5rem;
    }

    .ob-choice {
        width: auto;                                /* let grid control width */
        min-width: 0;                               /* allow shrinking within column */
        height: 5.125rem;                           /* as requested */
        box-sizing: border-box;                     /* include padding in width */
    }
}

/* Responsive */
@media (max-width: 1270px) {
    .ob-sheet { width: min(92vw, 56rem); }
    .ob-image { width: 24rem; height: 18rem; }
}
/*@media (max-width: 900px) {*/
/*    .ob-slide { flex-direction: column; gap: 1rem; }*/
/*    .ob-image { width: 100%; height: auto; aspect-ratio: 29.125 / 22.75; }*/
/*}*/

/* Desktop: center text + choices vertically within the slide */
@media (min-width: 770px) {
    /* Ensure slides have enough height to allow vertical centering,
       even on slides without an image */
    .ob-slide {
        min-height: 22.75rem; /* match image height for visual balance */
    }

    /* Vertically center the title + description + choices as a group */
    .ob-text {
        justify-content: center;   /* center content vertically */
        align-items: flex-start;    /* keep left-aligned text */
    }
}

/* Mobile bottom-sheet style for Onboarding */
@media (max-width: 769px) {
    /* Sheet becomes a bottom sheet */
    .ob-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;                      /* ensure above overlay */
        width: 100%;
        max-width: 100%;
        border-radius: 1rem 1rem 0 0;    /* round only top corners */
        max-height: 88vh;                /* bottom sheet height */
        display: flex;
        flex-direction: column;
        overflow: hidden;                /* keep rounded corners clean */
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    /* Body scrolls if content exceeds available height */
    .ob-body {
        padding: 1rem 1rem 0;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .ob-swiper {
        flex: 1 1 auto;
        min-height: 0;             /* important for iOS/Safari flexbox */
    }

    /* Slides stack vertically: image first, then text */
    .ob-slide {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        height: 100%;
        min-height: 0;
    }

    .ob-media {
        width: 100%;
        flex: 1 1 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ob-image {
        width: 100%;
        height: auto;                 /* don't stretch vertically */
        aspect-ratio: 29.125 / 22.75; /* preserve original card ratio */
        background-size: contain;     /* show full artwork without cropping */
        background-position: center;
        background-repeat: no-repeat;
        max-height: 100%;
    }

    .ob-text {
        flex: 1 1 50%;
        overflow-y: auto;          /* scroll text if it exceeds its half */
        padding-bottom: 0.25rem;   /* small spacing before footer */
    }

    /* Footer stays inside sheet with safe area for iOS */
    .ob-footer {
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)) 1rem;
    }

    /* Improve transform stability and prevent tiny offsets */
    .ob-swiper .swiper-wrapper { transform: translateZ(0); will-change: transform; }
    .ob-swiper .swiper-slide { flex-shrink: 0; } /* explicit, though Swiper sets it */
    .ob-swiper { overflow: hidden; }

    /* If no image, don’t reserve space at the top */
    .ob-media:empty { display: none; }

    /* Text block at top; let choices own the scrollable area */
    .ob-text {
        flex: 1 1 auto;
        overflow: hidden;        /* stop scrolling the whole text block */
        /* optional: small top padding if you want breathing room */
        /* padding-top: 0.5rem; */
    }

    /* Choices take the remaining space and scroll vertically */
    .ob-choices {
        flex: 1 1 auto;
        overflow-y: auto;
        margin-top: 0.5rem;
    }

}

.comments-list {
    display: flex;
    flex-direction: column;
}

.comment-item { padding-bottom: 0.75rem; }

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    flex-shrink: 0;
    /* Center the initial */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Visuals */
    background: #E9EEF5;       /* soft background */
    color: #3070CB;            /* brand-ish blue for the initial */
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.comment-name {
    color: #000;
    font-weight: 600;
}

.comment-text {
    color: #000000;
    opacity: 0.6;
    margin: 0.25rem 0 0.5rem;
    text-align: left;

    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #000;
    opacity: 0.6;
    font-size: 0.75rem;
}

.comment-reply-btn {
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
    color: #000;
    cursor: pointer;
}

.comment-replies-toggle {
    display: flex;                /* block-level */
    align-items: center;
    justify-content: flex-start;  /* left align */
    gap: 0.5rem;
    background: none;
    border: none;
    color: #0d6efd;
    cursor: pointer;
    font-weight: 500;
    width: fit-content;           /* shrink to content */
    margin: 0.5rem 0 0;           /* no side margins */
    padding: 0;
}

.comment-replies-toggle .chevron {
    transition: transform 0.2s ease;
    transform: rotate(0deg);
}

.comment-replies-toggle.expanded .chevron {
    transform: rotate(180deg);
}

.replies-list {
    display: none;
    margin: 0.5rem 0 0.25rem 1rem;
}

/* Hide the Reply button for comments rendered as replies */
.replies-list .comment-meta .comment-reply-btn:not(.comment-delete-btn) {
    display: none;
}

/* Hide the divider on the bottom-most reply within a replies list */
.replies-list > .comment-item:last-child > .comment-divider {
    display: none;
}

.comment-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0.5rem 0 0;
}

.track-progress-panel .track-progress-body {
    flex: 1 1 auto;
}

.comments-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
}

.comment-input {
    flex: 1 1 auto;
    height: 3rem;
    border: none;
    outline: none;
    background: #F9F9F9;
    border-radius: 0.5rem;
    padding: 0 1rem;
    font-size: 0.95rem;
    color: #000;
}

.comment-input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.comment-submit-btn {
    display: inline-flex;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

.comment-submit-btn:active {
    transform: scale(0.98);
}

/* Feed (landscape) with comments panel open */
@media (min-width: 769px) {
    .feed-content.video-feed.landscape.has-progress-open {
        position: relative;
        /* Same token as the panel it reserves room for — see :root. */
        padding-right: calc(var(--course-panel-width) + 0.5rem);
    }

    .feed-content.video-feed.landscape.has-progress-open .video-container {
        width: 72vw;
        max-width: calc(100% - 3rem - 5rem);
        height: 80vh;
        max-height: calc(100vh - 145px);
        max-height: calc(100dvh - 145px);
    }
    @supports not (height: 1dvh) {
        .feed-content.video-feed.landscape.has-progress-open .video-container {
            max-width: calc(100% - 55vh - 3rem - 5rem);
        }
    }

    .feed-content.video-feed.landscape.has-progress-open .feed-actions {
        position: relative;
        width: 72vw;
        max-width: calc(100% - 3rem - 5rem);
        margin: 0 auto;
    }
    @supports not (height: 1dvh) {
        .feed-content.video-feed.landscape.has-progress-open .feed-actions {
            max-width: calc(100% - 55vh - 3rem - 5rem);
        }
    }

    .feed-content.video-feed.landscape.has-progress-open .track-progress-panel {
        position: absolute;
        top: 0;
        right: auto;
        z-index: 90;
        height: auto;
    }
}

/* ===== Comments Auth Modal (inline, themed) ===== */
.comments-auth-modal {
    padding: 8px 12px 0;
}

.comments-auth-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    overflow: hidden;
}

.comments-auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.comments-auth-title {
    margin: 0;
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.comments-auth-close {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    background: transparent;
    color: #000;
    cursor: pointer;
    opacity: 0.7;
}
.comments-auth-close:hover { opacity: 0.9; }

.comments-auth-body {
    padding: 0 1rem 0.75rem;
    color: #333;
    font-size: 0.92rem;
}

.comments-auth-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.comments-auth-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    line-height: 1;
}
.comments-auth-actions .btn-primary:hover {
    filter: brightness(1.05);
}

.comments-empty {
    padding: 12px;
    color: rgba(0,0,0,0.6);
    text-align: center;
}

/* src/static/css/app.css */

/* ===== SLAVE MODE / LAYOUT TOGGLES =====
   Why: Use container-scoped classes to reshape the grid without JS, preventing layout flashes and keeping logic centralized.
*/

/* Hide chrome when toggled */
.layout--hide-header .header {
    display: none !important;
}
.layout--hide-sidebar .sidebar {
    display: none !important;
}

/* Only sidebar hidden: make it a single-column stack of header + main */
.layout.layout--hide-sidebar:not(.layout--hide-header) {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr; /* keep header row height consistent */
    grid-template-areas:
    "header"
    "main";
}

/* Only header hidden: keep two columns, single row (sidebar | main) and let both span full height */
.layout.layout--hide-header:not(.layout--hide-sidebar) {
    grid-template-columns: 260px 1fr;
    grid-template-rows: 1fr;
    grid-template-areas: "sidebar main";
}

/* Both hidden: full-bleed main taking entire viewport */
.layout.layout--hide-header.layout--hide-sidebar {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    grid-template-areas: "main";
}

/* When header is hidden, let main own vertical space and remove previous height constraint */
.layout--hide-header .main {
    height: 100vh;
    height: 100dvh;  /* mobile-friendly viewport */
    max-height: none;
    /* No header above to round against — the arc would only clip the viewport's own top
       edge. The tint stays; the radius goes. */
    border-radius: 0;
}

/* When header is hidden and sidebar is shown, sidebar should match full viewport height */
.layout--hide-header .sidebar {
    height: 100vh;
    height: 100dvh;
}

/* ===== COURSES / SKILLS LIST PAGE ===== */

/* Filter bar — mirrors .filter-buttons-container */
/* === Skills page salutation ================================================= */
/*
 * Figma 33234-19019. Greeting heading + static subtitle, above the filter bar. The
 * heading's text is written by the inline script in courses/_skills_content.html (the
 * time-of-day word depends on the viewer's clock), so it is empty at parse time — hence
 * no min-height games: the subtitle holds the block's shape and the heading fills in on
 * the same frame the script runs.
 */
.skills-intro {
    /* No margin of its own: .courses-list-page is a flex column whose 16px gap is the
       ONE thing that spaces this block from the filter row (fix list A). A margin here
       stacked on top of that gap and made the real distance 40px. */
    margin: 0;
}

.skills-intro-title {
    margin: 0;
    /* One step up from the You page's 1.25rem identity heading: this is the page's
       opening line, not a card header. */
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: #000;
}

.skills-intro-subtitle {
    /* Flush against the heading — the two lines are one block, separated by their own
       line-heights only (fix list A). */
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    /* Same secondary ink as .you-username, so the two pages' sub-lines read alike. */
    color: rgba(0, 0, 0, 0.55);
}

/* The phone gets the heading a step down — 1.5rem next to a horizontally scrolling
   tab strip crowds the viewport at 375px. */
@media (max-width: 768px) {
    .skills-intro-title {
        font-size: 1.25rem;
    }
}

/* ── Skills tab bar ──
   components/skills_tabs.html. Replaced .cl-filter-bar, which was an "All" chip followed
   by four .cl-dropdown triggers: the four buckets are now their own pages reached through
   this strip, and every filter moved into the .sfp-* side panel below. The HOME page's own
   .filter-buttons-container / .filter-btn row is a different component and is untouched.

   Sticky at the top of .main's scrollport. .main carries 1rem of padding on all four sides,
   and the bar has to get out from under every bit of it or content scrolls visibly past the
   bar instead of under it:
     - horizontally, a negative inline margin pulls it to the sheet's edges and its own
       padding re-insets the tabs, or cards would show through the 16px side gutters;
     - vertically, `top: -1rem` rather than 0, because Chrome resolves a sticky offset
       against the scroll container's CONTENT box, not its padding box — at top: 0 the bar
       parks 16px down and card edges slide through the strip above it. The negative offset
       makes it stick flush under the header, which is where the design puts it.

   BACKGROUND: this must be the page sheet's own colour or content would show through the
   bar while scrolling under it — that is --main-surface-color (the 4% tint), NOT
   --primary-color-light (10%). Figma paints the bar #fff8f5, and on Talabat's primary
   (#F55905) the 4% mix resolves to exactly #FFF8F5 where the 10% mix is #FEEEE6 — so the
   token below is the one the design is actually showing. */
.skills-tabs {
    position: sticky;
    top: -1rem;
    /* Above the cards, which set none, and below the header (1100) and the panel (1200). */
    z-index: 5;
    display: flex;
    align-items: center;
    margin: 0 -1rem;
    padding: 0 1rem;
    background: var(--main-surface-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* ONLY the tabs scroll. The overflow chip and the funnel are siblings of this strip, so they
   are always visible however far the tabs have been scrolled — but they are NOT pushed to the
   bar's right edge: they hug the strip, so with room to spare the row reads
   [All][Recommended][In Progress][Completed][divider][funnel] with the empty bar space AFTER
   the funnel. Matches the prototype's .tabs.

   `flex: 0 1 auto` is what produces that, and the shrink half is as load-bearing as the grow
   half:
     - flex-grow 0 — the strip takes only the width its tabs need, so it never stretches and
       never pushes the funnel away from Completed. (It was `1 1 auto` for one round, which
       parked the funnel at x≈1264 on a 1280 viewport, a screen-width away from the tabs.)
     - flex-shrink 1 + min-width: 0 — when the bar is too narrow the strip is the item that
       gives way, which is what makes the tabs clip and scroll instead of squeezing the chip
       and the funnel (both flex-shrink: 0) or overflowing the bar.
   Nothing may separate the three: no margin-left: auto, no justify-content on .skills-tabs.

   Same hidden-scrollbar recipe .cl-filter-bar used, kept on the strip rather than on the bar
   so the bar itself stays a plain sticky box with a background and a bottom border — and so
   the chip and funnel cannot be scrolled out of view. */
.skills-tabs-strip {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.skills-tabs-strip::-webkit-scrollbar { display: none; }

/* A flex chip rather than a bare inline link: Figma pairs each label with a count pill, and
   the 0.25rem gap below is the design's 4px label-to-pill distance. The All tab has no pill
   (by design) and so renders as a one-child chip. */
.skills-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
    padding: 5px 8px 6px;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #000;
    white-space: nowrap;
    text-decoration: none;
}
.skills-tab.is-active { color: var(--primary-color); }

/* The 2px rule sits ON the bar's own bottom border (hence bottom: -1px) and spans the
   label's width, which is what the chip's 8px side padding makes the inset. Drawn on the
   chip, not on the label span, so its geometry does not move with the text's line box. */
.skills-tab.is-active::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 2px;
    border-radius: 4px;
    background: var(--primary-color);
}

/* The count pill (Figma 33363:34335 and siblings): white on the tinted bar, 10px/400 ink at
   60% black, radius 20px.

   SAME CONSTRUCTION AS .nav-link-count in the sidebar (see its note for the measurements) —
   only the fill differs, white here because this pill sits on the tinted page sheet where the
   sidebar's sits on white. Audited alongside it after the client's screenshot: same 0.50px
   horizontal offset (the 8/7 padding asymmetry), and this pill was also a different SIZE —
   18px tall vs the sidebar's 20 — so the two never matched. Flex-centred with symmetric
   padding: horizontal exactly 0 by construction, both pills 20x20 for one digit.

   height: 20px and line-height: 1 — NOT the bar's inherited 1.5, and not a taller box. The
   label's own line box is 21px, so a 20px pill leaves the label setting the row's height and
   the sticky bar measures the same with pills as without. At line-height 1.5 the pill would be
   23px and the whole bar would grow 2px taller than the design.

   The ACTIVE tab keeps this exact pill. Figma's active tab is All, which carries no pill, so
   the design says nothing about an active variant — white on the tint reads correctly on both
   states and a primary-filled variant would be invented, not specified. */
.skills-tab-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 20px;
    background: #fff;
    font-size: 0.625rem;
    font-weight: 400;
    line-height: 1;
    color: rgba(0, 0, 0, 0.6);
}

/* ── Tab-strip overflow chip ──
   The affordance for a scroll container with no scrollbar: while any tab is still hidden to
   the right, a chevron chip appears between the strip and the funnel, and tapping it scrolls
   the strip along. Sits OUTSIDE the strip, so it never scrolls away itself.

   Adapted from the prototype's .tab-more (27px circle, 1.5px hairline, soft drop shadow, muted
   chevron). Deliberately neutral chrome — white and black-alpha, no tenant colour: it is a
   scrollbar substitute, not a brand or state control, and next to the primary-tinted active
   tab a coloured chip would read as a fifth tab.

   Visibility is class-driven — display: none until the bar carries .has-more-tabs — so the
   script only ever toggles one class and the chip can live in the markup permanently. It is
   display: none rather than [hidden]/opacity because that is also what takes it out of the tab
   order and out of the accessibility tree when there is nothing to scroll to. */
/* THE SHARED OVERFLOW CHEVRON (client issue #4, RULE 2). Keyed off [data-strip-more], not
   a class, so both consumers get one identical affordance from one rule: the Skills tab
   strip (.skills-tabs-more) and the home filter row (.strip-more).
   DELIBERATELY THE ONLY AFFORDANCE — no gradient edge-fade on either strip. The client
   asked for one affordance, and a fade plus a chevron read as two different promises about
   the same overflow. The state class `has-more-tabs` keeps its tab-strip name so the CSS,
   the tests and the swapped-in markup stay in step; it now means "this strip has more",
   tabs or chips. */
[data-strip-more] {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    /* The prototype's own asymmetry: 2px off the clipped strip, 4px before the funnel (whose
       own 4px margin makes 8px, enough that the chip's shadow never touches the divider). */
    margin: 0 4px 0 2px;
    padding: 0;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31, 32, 36, 0.1);
    color: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}
[data-strip].has-more-tabs [data-strip-more] { display: inline-flex; }
[data-strip-more] svg { display: block; }

/* The bar the home row needed: the tab strip already had .skills-tabs playing this part
   (a flex row holding the scroller and the controls that hug its end). The scroller keeps
   flex: 0 1 auto so it takes only the width its chips need and the chevron sits beside the
   last one rather than out at the page edge — same arrangement as the tab strip. */
.strip-bar {
    display: flex;
    align-items: center;
}
.strip-bar > [data-strip-track] {
    flex: 0 1 auto;
    min-width: 0;
}

[data-strip-more]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.skills-filter-btn {
    position: relative;
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 2rem;
    /* A FIXED 4px (never auto — an auto inline-start margin is what would push the button back
       out to the bar's edge): it holds the divider off whatever ends to its left, matching the
       prototype's `.funnel { margin-left: 4px }`. The 10px from divider to glyph is the 40px
       box centring the 20px icon. */
    margin-left: 4px;
    padding: 0;
    background: none;
    border: 0;
    color: #000;
    cursor: pointer;
}
/* The rule separating the funnel from everything left of it — the tabs, or the overflow chip
   when that is showing. Drawn by the button as a pseudo-element rather than as a border-left,
   so it is the design's 18px centred tick instead of a full-height line. */
.skills-filter-btn::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 18px;
    background: rgba(0, 0, 0, 0.1);
}
.skills-filter-btn svg { display: block; }
.skills-filter-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* ── Skills filter side panel ──
   components/skills_filter_panel.html. The single home of every Skills filter since the
   .cl-dropdown triggers left the tab bar. ONE panel, ONE set of markup and behaviour, in two
   presentations over a scrim: ≥769 it slides in from the RIGHT, full height, 375px wide;
   ≤768 the same element is the app's standard half-screen BOTTOM SHEET (the phone band at the
   end of this block). The dropdown it replaces also had two presentations, but as two
   separate implementations — a desktop popover and a mobile bottom sheet, the .cl-dd-* block
   and its @media override, both deleted with it.

   Two views share the shell — the menu of filters, and one sub-page per filter sliding in
   over it from the right — so both are absolutely positioned: the shell's height is then
   fixed and only the option list scrolls, which is what keeps the footer buttons on screen
   above a phone keyboard. */
.sfp {
    position: fixed;
    inset: 0;
    /* Above the header (1100) and the sidebar drawer (1001); below the share/quiz overlays
       at 2000+, which are full-screen takeovers and outrank a filter panel. */
    z-index: 1200;
}
.sfp[hidden] { display: none; }

.sfp-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    opacity: 0;
    transition: opacity 0.26s ease;
}
.sfp.is-open .sfp-scrim { opacity: 1; }

/* DESKTOP presentation (the phone band at the end of this block re-anchors it to the bottom):
   anchored to the RIGHT edge, so the closed state is translateX(+100%) — parked one panel
   width PAST the viewport's right edge — and open is 0. (Client's call; it entered from the
   left in the first cut, which is the only reason to double-check the sign here.) The
   sub-page slide inside the shell is a separate transform on .sfp-view--sub and keeps its own
   direction in BOTH bands: sub-pages come in horizontally from the right over the menu, which
   still reads correctly in a bottom sheet. */
.sfp-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(375px, 100vw);
    overflow: hidden;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.26s ease;
}
.sfp.is-open .sfp-panel { transform: translateX(0); }
/* Focused on open so Esc and Tab start inside the dialog; the ring would be noise on a
   container the user never navigated to deliberately. */
.sfp-panel:focus { outline: none; }

.sfp-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    background: #fff;
}
.sfp-view[hidden] { display: none; }
.sfp-view--sub {
    transform: translateX(100%);
    transition: transform 0.26s ease;
}
.sfp-view--sub.is-in { transform: translateX(0); }

.sfp-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 16px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.sfp-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: #000;
}
/* A sub-page's title is centred between the back arrow and the close button. It is NOT a step
   down from the panel's own heading any more: Figma 32005:83281 types it "Heading Medium 16"
   — 16px / 600 / 1.5, the same as .sfp-title above — so the font-size override is gone and the
   size is inherited.
   The 0.875rem that used to be here came from the OLDER Talabat-file sub-page frame
   (33152:32410, a 14/600 title). The client pointed at 32005:83280, which is the authority,
   and 16 also happens to be this app's own sheet-title convention — the two sources disagreed
   and the newer one agrees with the house. Both bands take it: the node is a 375-wide frame,
   but nothing in the >=769 side panel ever specified 14, and its main view is already 16, so
   leaving the sub-views at 14 there would keep an inconsistency the node just removed. */
.sfp-view--sub .sfp-title {
    text-align: center;
}
.sfp-back {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: 0;
    color: #000;
    cursor: pointer;
}

.sfp-rows {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 16px;
}
.sfp-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 12px 0;
    background: none;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
    cursor: pointer;
}
.sfp-row:last-child { border-bottom: 0; }
/* The row icons are neutral-black Figma exports, dimmed here rather than re-coloured —
   they are category glyphs, not the tenant's brand. */
.sfp-row-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    opacity: 0.6;
}
.sfp-row-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    color: #000;
}
.sfp-row-value {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.6);
}
.sfp-row-chev {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    color: rgba(0, 0, 0, 0.6);
}

.sfp-search {
    position: relative;
    flex: 0 0 auto;
    padding: 12px 16px;
}
.sfp-search-input {
    width: 100%;
    height: 36px;
    padding: 0 2.25rem 0 0.75rem;
    font: inherit;
    font-size: 0.875rem;
    color: #000;
    background: #fff;
    border: 1px solid rgba(182, 182, 182, 0.3);
    border-radius: 8px;
    /* Safari gives type=search its own inset shadow and pill shape; the appearance reset is
       what makes it the design's plain 8px field. */
    -webkit-appearance: none;
    appearance: none;
}
.sfp-search-input::placeholder { color: rgba(0, 0, 0, 0.38); }
/* Native clear glyph suppressed in favour of the design's own button, which is the one the
   script wires. */
.sfp-search-input::-webkit-search-cancel-button { display: none; }
.sfp-search-input:focus-visible {
    outline: none;
    border-color: var(--primary-color);
}
.sfp-search-clear {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: none;
    border: 0;
    color: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}
.sfp-search-clear[hidden] { display: none; }

.sfp-opts {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 8px;
}
.sfp-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 8px;
    cursor: pointer;
}
.sfp-opt[hidden],
.sfp-group[hidden] { display: none; }
.sfp-opt-label {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #000;
}
/* The real checkbox, parked under the drawn box rather than display:none — it stays
   focusable and keyboard-operable, and the <label>'s native click-to-toggle is the only
   thing that changes it. pointer-events: none so the label, not the invisible input, is
   what a click lands on. */
.sfp-opt-input {
    position: absolute;
    left: 8px;
    width: 24px;
    height: 24px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}
.sfp-check {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid #bebebe;
    border-radius: 5px;
    background: #fff;
    /* The tick inherits this, so the glyph is white against the filled box. */
    color: #fff;
}
.sfp-check svg { opacity: 0; }
/* Checked fill comes from the token, never the design's orange literal, so the box is the
   tenant's colour. Drawn in CSS + inline SVG rather than as an exported asset for the same
   reason. */
.sfp-opt-input:checked ~ .sfp-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
}
.sfp-opt-input:checked ~ .sfp-check svg { opacity: 1; }
.sfp-opt-input:focus-visible ~ .sfp-check {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Subject is the only grouped list: the subject itself is selectable (subject_id) and its
   sections are indented beneath it (section_id). Unlike the old subject dropdown, which
   hid the sections until their subject was ticked, both levels are always visible and
   unticking a subject leaves its sections alone — the two params filter independently
   server-side, so coupling them in the UI only hid reachable options. */
.sfp-group + .sfp-group { margin-top: 4px; }
.sfp-opt--group .sfp-opt-label { font-weight: 600; }
.sfp-opt--sub { padding-left: 28px; }
.sfp-opt--sub .sfp-opt-input { left: 28px; }

.sfp-opts-empty {
    margin: 0;
    padding: 12px 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.55);
}
.sfp-opts-empty[hidden] { display: none; }

.sfp-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 12px 16px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.sfp-btn-text {
    flex: 0 0 auto;
    padding: 0 4px;
    background: none;
    border: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
}
.sfp-btn-primary {
    flex: 1 1 auto;
    height: 32px;
    padding: 0 0.75rem;
    background: var(--primary-color);
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.sfp-btn-text:hover,
.sfp-btn-primary:hover { opacity: 0.88; }

.sfp-back:focus-visible,
.sfp-row:focus-visible,
.sfp-btn-text:focus-visible,
.sfp-btn-primary:focus-visible,
.sfp-search-clear:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ── Phone band (≤768): the same panel presents as a BOTTOM SHEET ──
   Presentation only. Every child, every behaviour and the #sfp-submit-trigger wiring are
   shared with the desktop side panel; what changes is the edge it is anchored to and the
   transform that brings it in.

   It is the house sheet contract, not a new one — the same values as the concepts modal's
   mobile branch (.concepts-modal, ~4422) and the player's .track-progress-panel: full width,
   24px top-only radius, translateY(100%) → 0 on --sheet-duration/--sheet-ease, half-screen
   height. Neither of those sheets has a drag handle, so this one has none either.

   WHY the phone gets a different edge at all: at exactly 375px the side panel is
   min(375px, 100vw) = the whole viewport, so it covered the scrim completely and the only way
   out was the X or Esc — a dead end for a tap-outside-to-dismiss reflex. A half-screen sheet
   always leaves the scrim reachable above it.

   `height` is explicit (not the concepts sheet's min-height + content) because every
   .sfp-view is position: absolute — the shell has no in-flow content to be sized by, so a
   min-height would collapse to the minimum. 50dvh is the same half-screen floor the house
   sheets use; below that (short phones, landscape) .sfp-rows / .sfp-opts already scroll
   internally, which is why the footer buttons stay on screen. */
@media (max-width: 768px) {
    .sfp-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        /* Overrides the desktop min(375px, 100vw); left+right own the width now. */
        width: auto;
        height: 50vh;
        height: 50dvh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform var(--sheet-duration) var(--sheet-ease);
    }
    .sfp.is-open .sfp-panel { transform: translateY(0); }

    /* Safe area on the VIEW, not the shell: an absolutely positioned child resolves inset: 0
       against its container's padding box, so padding on .sfp-panel would not move the views
       off the home indicator — only the view's own padding can. */
    .sfp-view {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* AFTER the phone band on purpose: both queries can match at once, and this one has to win so
   the sheet's slide-up is suppressed too, not just the desktop slide-in. */
@media (prefers-reduced-motion: reduce) {
    .sfp-scrim,
    .sfp-panel,
    .sfp-view--sub {
        transition: none;
    }
}

/* ── Carousel sections ── */
/* 16px between the three page bands (greeting / tab bar / sections) — fix list A.
   Neither the greeting nor the tab bar carries a margin of its own, so this gap is
   the only thing setting either distance. */
.courses-list-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
}

/* gap: 0, not a shared row gap. The section's header is two lines that must sit flush
   (kicker over title, line-height only) while the header-to-cards distance is 8px, and
   one flex gap cannot be both. The 8px therefore lives on .cl-carousel-title's
   margin-bottom below, and the kicker keeps margin: 0. */
.cl-carousel-section { display: flex; flex-direction: column; gap: 0; margin-top: 1.5rem; }
.cl-carousel-section:first-child { margin-top: 0; }

/* Kicker line above each section title (Figma 33152:34170: 12px regular, black at
   60%, stacked flush on the 16px title — the design's header frame has no gap). */
.cl-sec-kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.6);
}

/* Gotham Medium 16/24 in Figma; 600 is this sheet's DemiBold weight. The 8px bottom
   margin IS the section-header-to-cards distance (fix list A) — see .cl-carousel-section. */
.cl-carousel-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: #000;
    margin: 0 0 8px;
}

.cl-swiper-wrap {
    position: relative;
    overscroll-behavior-x: contain;
}

/* Carousel Swiper */
.cl-carousel {
    overflow: hidden;
    width: 100%;
}
.cl-carousel .swiper-wrapper { align-items: stretch; }

/* Nav buttons */
.cl-swiper-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 2.90063rem;
    border: 1px solid rgba(182, 182, 182, 0.10);
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.05) 100%), rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    display: grid;
    place-items: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
    cursor: pointer;
    transition: opacity .15s ease;
}
.cl-swiper-prev { left: 6px; }
.cl-swiper-next { right: 6px; }
.cl-swiper-btn.swiper-button-disabled { opacity: 0.2; pointer-events: none; }

/* ── All Skills grid ──
   Skills-page only (#skills-all-grid is the sole .cl-grid in the app).
   Was a wrap-flex of fixed 17.25rem items; the redesigned .cl-ocard is fluid, so
   the track count is now what's fixed and the card sizes itself to the column:
   2-up below the tablet band, 4-up from 769px. The empty state is a sibling
   layout (.cl-empty-state), not a child, so it is unaffected. */
/* One card per line on the phone (fix list F). The card then spans the page column —
   .main's 1rem padding is the 16px inset on either side — so the grid needs no gutter
   of its own and only a row gap. Two-up at 169px was what made the CTA labels collide
   with the card edge; the single column removes that pressure entirely. */
.cl-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Fixed 276px tracks, not 1fr: the grid's cards must match the Continue rail's
   (.cl-ocard-slide, same 276px — see its note). auto-fill lets the column count
   follow the viewport instead of pinning 4; Figma's 16px column gap is what makes
   its 1152px content fit 4 exactly. */
@media (min-width: 769px) {
    .cl-grid {
        grid-template-columns: repeat(auto-fill, 276px);
        gap: 24px 16px;
    }

    /* The Recommended bucket page (/course/recommended/) renders the full-bleed .cl-ccard in
       this grid instead of the .cl-ocard, on the client's instruction to use "the same card"
       as the rail on /all/. So the track is that card's own width — 398px, the same value
       .cl-ccard-slide pins for the rail — not the ocard's 276.

       AFTER the base rule, and only a class deeper: same (0,1,0) specificity, so source order
       is what decides it. auto-fill still picks the column count, which at Figma's 1152px
       content is 2 up (2*398 + 16 = 812; a third needs 3*398 + 2*16 = 1226).

       No phone override: .cl-grid is one column below 769px for every kind of card (client
       rule, fix list F), and .cl-ccard is width:100%, so it simply fills the column there. */
    .cl-grid--wide {
        grid-template-columns: repeat(auto-fill, 398px);
    }
}

.cl-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 1rem;
    width: 100%;
    min-height: 60vh;
    margin: auto;
    text-align: center;
}
.cl-empty-icon-wrap {
    width: 5.75rem;
    height: 5.75rem;
    border-radius: 7.5rem;
    background: #EBEBEB;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.125rem;
    color: #000;
    opacity: 1;
    flex-shrink: 0;
}
.cl-empty-icon-wrap svg {
    width: 3.5rem;
    height: 3.5rem;
    opacity: 0.6;
    flex-shrink: 0;
}
.cl-empty-text { display: flex; flex-direction: column; gap: 0.25rem; }
.cl-empty-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 150%;
    letter-spacing: 0;
    text-align: center;
    color: #000;
}
.cl-empty-subtitle {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 150%;
    letter-spacing: 0;
    text-align: center;
    color: #555;
}
.cl-empty-clear-btn {
    margin-top: 0.25rem;
    height: 2.25rem;
    padding: 0 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    /* Was #B49164 / #9E9268 — a tan-gold and olive left over from an EARLIER
       TENANT's brand, so this painted the same foreign colour on every tenant.
       Converted to the token (client issue #9). The hover at ~2241 had the identical
       problem with #9d7c56 and was fixed once already; these are the rest of that
       palette. */
    background: var(--primary-color);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.cl-empty-clear-btn:hover { opacity: 0.88; }

/* The item is the filter/animation hook (data-language, data-status, …) and now
   also the grid cell. min-width: 0 so a long, unbreakable course title cannot
   blow the 1fr track out past its share of the row. */
.cl-grid-item {
    min-width: 0;
}

/* ── Course card ──
   NOTE: this whole .cl-card* block is currently UNRENDERED. Its only markup is
   components/course_card.html, which no page imports any more (/course/all and
   /user/skills both render components/skill_cards.html `ocard` instead). The block
   is kept only so the template file and its styles stay deletable as one unit —
   delete both together, not one without the other.
   The slide rule that used to sit here went with the You page's switch to
   .cl-ocard-slide: it styled a slide class that no template emits. */
.cl-card {
    display: flex;
    width: 100%;
    padding-bottom: 0.75rem;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: #fff;
    overflow: hidden;
}

.cl-card-thumb-wrap {
    position: relative;
    height: 10.5rem;
    align-self: stretch;
    background: lightgray 50% / cover no-repeat;
    overflow: hidden;
    flex-shrink: 0;
}
.cl-card-thumb-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: cl-thumb-shimmer 1.4s infinite;
    z-index: 0;
    transition: opacity 0.2s ease;
}
.cl-card-thumb-wrap.cl-thumb-loaded::before {
    opacity: 0;
    pointer-events: none;
}
@keyframes cl-thumb-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.cl-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

/* Badges on thumbnail */
.cl-badge {
    position: absolute;
    display: flex;
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    border-radius: 2.125rem;
    z-index: 2;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.10) 100%), rgba(0, 0, 0, 0.20);
    backdrop-filter: blur(4.5px);
    color: #fff;
}

.cl-badge-lang {
    right: 0.5rem;
    top: 0.5rem;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
}

.cl-badge-speed {
    right: 0.5rem;
    top: 0.5rem;
}

/* Card body */
.cl-card-body {
    display: flex;
    padding: 0 0.75rem;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.4rem;
    align-self: stretch;
}

.cl-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    align-self: stretch;
    overflow: hidden;
    color: #000;
    text-align: left;
    text-overflow: ellipsis;
    font-family: "TT Commons", sans-serif;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    margin: 0;
}

.cl-card-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
}
.cl-card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: scale-down;
    flex-shrink: 0;
}
.cl-card-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.08);
    color: rgba(0,0,0,0.38);
}
.cl-card-avatar--placeholder svg {
    width: 12px;
    height: 12px;
}
.cl-card-instructor {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #000;
    text-align: left;
    text-overflow: ellipsis;
    font-family: "TT Commons", sans-serif;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
}
.cl-card-instructor-wrap {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    overflow: hidden;
}
.cl-card-progress {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

/* Action buttons */
.cl-card-btn {
    display: flex;
    height: 2.25rem;
    padding: 0.4375rem 0.75rem 0.5rem 0.75rem;
    justify-content: center;
    align-items: center;
    gap: 0.625rem;
    align-self: stretch;
    border-radius: 0.5rem;
    background: var(--primary-color-light);
    color: var(--primary-color);
    border: none;
    text-align: center;
    font-family: "TT Commons", sans-serif;
    font-size: 0.875rem;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    cursor: pointer;
}
.cl-card-btn:hover { opacity: 0.88; }
.cl-card-btn--start {}
/* Resume takes the brand tint from the token. It was a hardcoded orange
   rgba(255, 141, 34, 0.1) — a literal that ignored the tenant's primary, so every
   non-orange tenant got an off-brand pill. The base .cl-card-btn already pairs
   var(--primary-color-light) with `color: var(--primary-color)`, which is the app's
   standing convention for primary-light surfaces, so removing this override inherits
   both halves and the contrast pairing stays correct.
   Declared explicitly rather than deleted, so the state's intent stays readable next to
   its two siblings. */
.cl-card-btn--resume { background: var(--primary-color-light); }
.cl-card-btn--completed {
    cursor: pointer;
    background: rgba(2, 193, 33, 0.1);
}


/* === Skills page cards (/course/all) ======================================
 *
 * Two card shapes ported from the domain-platform prototype. Markup lives in
 * templates/components/skill_cards.html and is rendered ONLY by
 * courses/_skills_content.html, courses/_course_cards_partial.html and user/you.html:
 *
 *   .cl-ccard  "Recommended" carousel — 16:10 media card. The image IS the card;
 *              creator pill, language circle, title block and CTA float on it.
 *   .cl-ocard  "Continue Skills" carousel and the "All Skills" grid — a white
 *              card clipping a 276:168 image, with a progress ring + title /
 *              counts row and the CTA stacked underneath it. Also every section of
 *              the You page (/user/skills), whose Completed cards render the
 *              CTA-less `plain` variant (no .cl-oc-cta, no .cl-ochip).
 *
 * .cl-card and friends above are the older shape these replaced. It started as a
 * parallel class set so the two could coexist; nothing renders .cl-card any more.
 *
 * Both roots are a <button> (see the note in skill_cards.html), so each one has
 * to reset the UA button styling — padding, border, background, font-family,
 * text-align, color — before it can be laid out.
 *
 * Literal values, not tokens: the .cl-ccard hairline (#ececee), its muted ink
 * (#6f7075) and the Figma success green (#02C121) have no counterpart in this
 * stylesheet, and the radii (14 / 12 / 8px) are literal too.
 *
 * CTA colours are now MIXED, and the split is the client's (issue #12), not an
 * inconsistency to tidy up. The old rule recorded here — "both cards' CTAs are
 * tenant-derived, because Figma's #F55905 / #FF8D22 are just Talabat's brand" — is
 * SUPERSEDED: the client asked for Resume #FF8D22 and Completed #02C121 as fixed
 * colours for every tenant. What remains tenant-derived is Start (the ccard's .cl-ccta
 * and the ocard's .cl-oc-cta--start), which the client did not name. See the colour
 * policy note above .cl-oc-cta for the per-state breakdown.
 */

/* ── Slides ──
 * Trap: the generic `.swiper-slide { background: #fff }` (~line 1318) paints a
 * SQUARE white slab, and `@media (max-width: 768px) { .swiper-slide { width: 100% } }`
 * overrides any plain width. Both slide classes therefore carry the fix themselves:
 * transparent background so the card's 14px/12px corners don't sit on white, and
 * !important widths so the mobile rule can't flatten them.
 *
 * WHO ACTUALLY DEPENDS ON THAT GENERIC WHITE — verified consumer by consumer, and the
 * answer is nobody. Two earlier versions of this comment got it wrong; this is the one to
 * trust, and the reason it took three passes is worth knowing:
 *   - the ONBOARDING modal does the opposite — `.ob-swiper .swiper-slide` forces
 *     `background: transparent !important` (~5353);
 *   - the home/You carousels are .cl-ocard-slide / .cl-ccard-slide, both `background: none`;
 *   - the FEED player needs transparent, and needed a DESCENDANT selector to get it:
 *     `.feeds-swiper .swiper-slide` (~3482). Its slides are rendered by Swiper's virtual
 *     module with no `virtual.renderSlide`, whose null path does
 *     `createElement('div', slideClass)` + `innerHTML = slideString` — so each slide is a
 *     BARE outer `div.swiper-slide` wrapping our own `.swiper-slide.feed-slide`. The generic
 *     rule paints that outer wrapper. A class-scoped fix on `.feed-slide` alone therefore
 *     changed the invisible inner element and the client still saw white;
 *   - the TRACK player had the same double-wrap and the same outer white, and is now fixed
 *     the same way: `.tracks-swiper .swiper-slide { background: transparent }` (~3504), the
 *     rule directly below the feed one. Both players are therefore off the generic rule
 *     entirely. Note the track player's phone band still lands on `.tracks-container`'s own
 *     `background: #FFF` one layer down — a separate surface, not this generic rule.
 * The generic rule survives only because nothing has established that removing it is safe —
 * NOT because a consumer needs it. Anything measuring these slides must go through a real
 * Swiper instance: a hand-built DOM has no outer wrapper and will report a false pass.
 */
/* Mobile: the card fills the page column and is capped at Figma's 398px so it never
   outgrows the design on a tablet-sized phone. The old 76vw left a half-card peeking,
   which is what made the taller Figma card read as congested (fix list B).
   100%, NOT calc(100vw - 32px): the column is not always the viewport less .main's two
   16px insets — the You page nests its own 16px gutter inside them, so a
   viewport-derived width overflowed that page by 32px. A percentage resolves against
   the swiper wrapper, i.e. whatever column the rail is actually in, and is therefore
   correct on both pages. Swiper's slidesPerView:'auto' measures the rendered box, so a
   percentage is as valid to it as a pixel width. */
.cl-ccard-slide {
    width: 100% !important;
    max-width: 398px !important;
    flex-shrink: 0;
    height: auto;
    background: none;
}

.cl-ocard-slide {
    width: 58vw !important;
    max-width: 276px !important;
    flex-shrink: 0;
    height: auto;
    background: none;
}

/* 276px is Figma's optional-card width, and it is shared with .cl-grid's fixed
   columns below so the Continue rail and the All Skills grid render the SAME
   card size (user request 2026-08-20; the grid's 1fr columns used to outgrow
   the rail's cards on wide screens). Change both together or they drift. */
@media (min-width: 769px) {
    .cl-ccard-slide {
        width: 398px !important;
        max-width: 398px !important;
    }
    .cl-ocard-slide {
        width: 276px !important;
        max-width: 276px !important;
    }
}

/* ── Recommended card ── */
/* 16:10, r12, no border (the image runs to the corner). aspect-ratio, not a fixed height, so
   the same ratio holds at every width.

   THE PROTOTYPE'S RATIO, NOT FIGMA'S. Figma 33363:33761 draws 398 x 348 (1.14:1); the HTML
   prototype's `.ccard` is `aspect-ratio: 16 / 10`, and the client chose the prototype — a
   ~99px shorter card at our 398px width (398/1.6 = 248.75, which is the ~247 they measured
   there; their card carries a 1.5px border on each side and ours deliberately carries none,
   which is the whole of the difference).

   Every overlay inside is anchored to an edge — the creator pill and language circle to the
   top, .cl-ccard-foot and .cl-ccta to the bottom — so shortening the card closes the empty
   middle and clips nothing. The tightest case is IN_PROGRESS, whose CTA is the tallest: at
   248.75 the bottom stack (36px CTA + 12px inset + 16px gap + a 60px foot) ends 125px down
   and the 32px top pill ends at 40, leaving 85px of image between them. Re-measure both if
   the ratio, the foot's `bottom: 64px` or the CTA height ever move. */
.cl-ccard {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    padding: 0;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    /* Stands in for the image until the lazy loader swaps data-src in, so the
       card is never a white hole on the tinted page surface. */
    background: #e9e9ec;
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: transform 0.14s ease;
}
.cl-ccard:active {
    transform: scale(0.972);
}

.cl-ccard-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* DARKER, AND STARTING HIGHER (issue #13 — "so the text is properly visible").
   The bottom ramp used to be flat black-0% until 48% and only reached 0.6 at the very
   bottom edge, which put the 16px white title on about **0.16 alpha**: over a light or
   busy thumbnail it disappeared. The stack it has to carry sits well above the card's
   foot — .cl-ccard-foot is anchored `bottom: 64px`, so on the 398x248.75 mobile card the
   kicker/title/counts occupy roughly 50-74% of the height, not the last quarter.
   So the ramp now leaves zero at 42% and is already at 0.62 by 62%, which is where the
   title's centre line falls on the worst-case card. (The title sits at 62.21% when the
   card shows counts and 69.45% when it does not — an empty .cl-ccard-counts contributes no
   line box, so the foot is 42px rather than 60 and the stack drops 18px. Higher up is
   lighter, so the counts-present card is the one to design for.)
   0.62 is DERIVED, not taste: white text needs a background luminance <= 0.1833 for
   4.5:1, which against a worst-case pure-white frame means at least 0.535 of black.
   0.62 clears it with margin and still lets the artwork read. Against a pure-#ffffff frame:
   title 1.47:1 -> 6.24:1 at 62.21%, and 1.82:1 -> 7.58:1 at 69.45%. Both are asserted in
   test_ccard_shade_is_dark_enough_for_the_title_over_a_light_frame, which derives the
   positions from this sheet rather than restating them.
   The TOP stop is deliberately left where it was: the creator pill and language circle
   carry their own glass backgrounds, and darkening the top would only mute the image. */
.cl-ccard-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 26%, rgba(0, 0, 0, 0.18) 42%, rgba(0, 0, 0, 0.62) 62%, rgba(0, 0, 0, 0.88) 100%);
}

/* Same pill as the ocard's .cl-ocrt, to the pixel: 8px inset, p4/gap4, r34, glass, and
   a 12px Regular name (fix list D — the two cards were 11/7/12.5/600 vs 8/4/12/400). */
.cl-ccard-creator {
    position: absolute;
    top: 8px;
    left: 8px;
    /* Keeps a long instructor name clear of the language circle
       (32px wide + its 8px inset + an 8px gap). */
    max-width: calc(100% - 56px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 34px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)),
                rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(4.5px);
    backdrop-filter: blur(4.5px);
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}
/* === Creator avatar chip (both cards) =====================================
 * Tenant logos arrive as transparent PNGs and as artwork with its own white field,
 * and both used to be dropped straight onto the pill's dark glass — where a dark or
 * transparent logo disappeared outright. A SOLID white disc behind the artwork is what
 * makes any uploaded logo legible, and `contain` (not cover) is what keeps a wide
 * wordmark whole instead of cropping it to its middle.
 * The rule is written once for the two cards so the ccard and ocard chips cannot drift
 * apart again — that drift is exactly what fix list D was raised about.
 * The initial-fallback variants keep their gradient: they are type on a disc, not
 * artwork, and white-on-white would erase the letter.
 */
img.cl-ccard-avatar,
img.cl-oav {
    background: #fff;
    object-fit: contain;
}

/* The name is its own element rather than a bare text node: ellipsis needs a
   block-ish box, and an anonymous flex item can't be given one. */
.cl-ccard-creator-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-ccard-avatar {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
}
.cl-ccard-avatar--fallback {
    background: linear-gradient(135deg, #8e8f96, #55565c);
    text-transform: uppercase;
}

/* 32x32 glass circle at the same 8px inset as the ocard's .cl-olang (fix list D). */
.cl-ccard-lang {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)),
                rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(4.5px);
    backdrop-filter: blur(4.5px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

/* Figma bodies the card at p12 with a 16px gap between the text block and the CTA. The
   CTA is absolutely positioned at bottom 12px and is 36px tall, so the text block's own
   bottom edge is 12 + 36 + 16 = 64px. */
.cl-ccard-foot {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 64px;
}

/* Kicker -> title -> meta are one flush stack: the design's frame has no gaps and the
   line-heights do the spacing (fix list A/B). */
.cl-ccard-why {
    display: block;
    margin: 0;
    color: var(--primary-mid);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cl-ccard-name {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-ccard-counts {
    display: block;
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* h36 / r8 / DemiBold 14 — the same button as the ocard's .cl-oc-cta and the track
   card's Watch All, so every CTA in the redesign is one object (fix list B/D). */
.cl-ccta {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    height: 36px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    padding: 5px 8px 6px;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    transition: transform 0.14s ease;
}
.cl-ccta:active {
    transform: scale(0.97);
}
/* Extra bottom padding so the label stays optically centred above the 2px
   progress strip that only the resume state carries (Figma: border-b-2 white). */
.cl-ccta--resume {
    padding-bottom: 8px;
}
.cl-ccta-pct {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.92;
}
.cl-ccta-prog {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
}
.cl-ccta-prog i {
    display: block;
    height: 100%;
    background: #fff;
}

/* ── Continue / All Skills card ──
 * Figma "Optional" card (33160:35046; completed variant 33152:34633). Measured at
 * the design's 276px card width; our widths stay responsive (58vw capped 250px in
 * the carousel, auto in the grid), so every value below is a fixed inset/size and
 * never a width the card depends on.
 *
 * Shape: a white 12px card that CLIPS a full-bleed image (no border, no radius on
 * the image itself — the root's overflow does the corner), then a 16px-padded body
 * holding the progress ring + title/counts row and the CTA.
 */
.cl-ocard {
    display: flex;
    flex-direction: column;
    row-gap: 12px;
    width: 100%;
    padding: 0 0 16px;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    font-family: inherit;
    text-align: start;
    color: inherit;
    cursor: pointer;
    transition: transform 0.14s ease;
}
.cl-ocard:active {
    transform: scale(0.965);
}

.cl-othumb {
    display: block;
    position: relative;
    aspect-ratio: 276 / 168;
    overflow: hidden;
    background: #e9e9ec;
}
.cl-othumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Glass badges on the image (creator pill, language circle). Figma stacks a 10%
   white wash over a 20% black fill behind a 4.5px blur; the two-layer background
   below IS that stack — the gradient is the constant-color white wash, painted
   over the black background-color. */
.cl-ocrt,
.cl-olang {
    position: absolute;
    z-index: 2;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)),
                rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(4.5px);
    backdrop-filter: blur(4.5px);
    color: #fff;
}

.cl-ocrt {
    left: 8px;
    top: 8px;
    /* 8px inset each side + the 32px language circle + an 8px gap to it, so a long
       instructor name ellipses instead of sliding under the circle. */
    max-width: calc(100% - 56px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 34px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}
/* Completed cards: the chip takes the top-left, so the creator pill drops to the
   bottom-left. Driven off the chip's presence rather than a state class — the chip
   is the only thing that ever contends for that corner. */
.cl-ochip ~ .cl-ocrt {
    top: auto;
    bottom: 8px;
}
.cl-ocrt-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-oav {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
.cl-oav--fallback {
    background: linear-gradient(135deg, #8e8f96, #55565c);
    text-transform: uppercase;
}

.cl-olang {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

.cl-ochip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-radius: 34px;
    /* Figma's chip is white with a 10% overlay of its success green (#02C121)
       and the green as ink — stated here as the composited color-mix. */
    background: color-mix(in srgb, #02c121 10%, white);
    -webkit-backdrop-filter: blur(4.5px);
    backdrop-filter: blur(4.5px);
    color: #02c121;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}
.cl-ochip-tick {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cl-obody {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    min-width: 0;
    padding: 0 16px;
}

.cl-oinfo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
/* Trap: the unscoped `.progress-pie { width: 100%; height: 100% }` further up this
   sheet beats the SVG's own width/height attributes, so an unpinned ring would
   stretch to fill this flex row. Pin it back to the macro's size=36. */
.cl-oinfo .progress-pie {
    flex: none;
    width: 36px;
    height: 36px;
}
/* The shared .progress-text is 1.6rem inside a 116-unit viewBox — about 8px once
   scaled down to 36px, which is under-set for a "100%" label. 32 user units lands
   near 10px rendered and still clears the 88-unit inner circle. */
.cl-oinfo .progress-text {
    font-size: 32px;
}

.cl-otext {
    display: block;
    flex: 1;
    min-width: 0;
}

.cl-oname {
    display: block;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-ocounts {
    display: block;
    color: rgba(0, 0, 0, 0.6);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Button geometry is Figma's (Talabat-Skills-in-Seconds 32323-23633).
   COLOUR POLICY, REVISED BY THE CLIENT (issue #12) — this supersedes the note that used
   to stand here. That note said Figma's #F55905 / #FF8D22 were "Talabat's own brand
   oranges, so the primary stands in for both and every tenant gets its own accent". The
   client has since specified the literals directly: Resume is #FF8D22 and Completed is
   #02C121 for EVERY tenant. So:
     --start   still tenant-derived (var(--primary-color)). The client did not name it,
               and it is the card's one solid brand action.
     --resume  literal #FF8D22 on its own 10% alpha. No longer tracks the tenant.
     --retake  literal #02C121 (unchanged — it was already semantic, not brand).
   The base class keeps the SHARED geometry and a tenant-token default, which is now only
   a fallback: all three rendered states name themselves (see skill_cards.html), so no
   card relies on the base's palette.
   No margin-top: the 16px row-gap on .cl-obody is the only spacing here. */
.cl-oc-cta {
    display: block;
    height: 36px;
    padding: 7px 12px 8px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    /* The 36px height is fixed, so a wrapped label would spill out of the pill.
       Keep it on one line; ellipsis is the graceful floor if a font ever renders
       wider than measured. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.14s ease;
}
.cl-oc-cta:active {
    transform: scale(0.97);
}
/* Start is the one solid CTA on the card (Figma: primary fill, white ink). */
.cl-oc-cta--start {
    background: var(--primary-color);
    color: #fff;
}
/* Resume. CLIENT LITERAL #FF8D22 (issue #12) — tenant-agnostic, on its own 10% alpha so
   the construction still matches the family (a 10% wash behind full-strength ink) and
   still composites correctly over .main's tint. Declared explicitly rather than left to
   the base class, which is what lets it hold a literal while the base keeps the token. */
.cl-oc-cta--resume {
    background: rgba(255, 141, 34, 0.1);
    color: #FF8D22;
}
/* A finished skill: the success green, not the brand. #02C121 is semantic here (it is
   the same green as the .cl-ochip tick badge on the thumbnail), so it stays a literal
   while every brand-coloured state goes through the token. */
.cl-oc-cta--retake {
    background: rgba(2, 193, 33, 0.1);
    color: #02c121;
}

/* Hover is a pointer-only affordance — on a touch device :hover sticks after a tap and
   would leave a card looking permanently pressed. Each state deepens its OWN fill rather
   than sharing an opacity fade: the two tinted states are already 10% alpha, so fading
   them would wash them out instead of reinforcing them. */
@media (hover: hover) {
    .cl-oc-cta:hover {
        background: color-mix(in srgb, var(--primary-color) 18%, transparent);
    }
    .cl-oc-cta--start:hover {
        background: color-mix(in srgb, var(--primary-color) 88%, #000);
    }
    /* REQUIRED, not decorative: the base :hover above is (0,2,0) and so is this, so
       without it the base's primary-18% would win on source order and a hovered Resume
       would flick from #FF8D22 to the tenant's colour. Deepens its OWN literal instead,
       exactly as --retake does with the green. */
    .cl-oc-cta--resume:hover {
        background: rgba(255, 141, 34, 0.18);
    }
    .cl-oc-cta--retake:hover {
        background: rgba(2, 193, 33, 0.18);
    }
    .cl-ccta:hover {
        background: color-mix(in srgb, var(--primary-color) 88%, #000);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cl-ccard,
    .cl-ccta,
    .cl-ocard,
    .cl-oc-cta {
        transition: none;
    }
    .cl-ccard:active,
    .cl-ccta:active,
    .cl-ocard:active,
    .cl-oc-cta:active {
        transform: none;
    }
}


/* === Video Scrubber (seek bar) ============================================ */
/*
 * Shared by the feed player and the course/track player. Markup lives in
 * templates/components/video_scrubber.html, behaviour in js/video-scrubber.js.
 *
 * Layout: an invisible hit strip pinned to the bottom of .video-container, with
 * the visual track sitting at the bottom of the strip's content box. The strip is
 * what the user actually has to hit, which is why it is much taller than the bar
 * it contains, and it reaches all the way to the container's bottom edge so the
 * dead space below the track is grabbable too.
 *
 * Placement differs by breakpoint — both come from the Figma "Scrubbing" node:
 *   desktop  8px side insets, track near-flush with the bottom edge
 *   mobile   12px left / 64px right, track bottom 9px above the bottom edge.
 *            The right inset stops the bar before the vertical action rail
 *            (.feed-actions / .track-actions, bottom 1rem right 1rem), matching
 *            the design where the bar spans the same column as the CTA/title.
 *
 * --video-scrubber-lift is the gap between the track's bottom edge and the
 * container's bottom edge. It carries a hard constraint on desktop, where it is
 * small: the thumb is centred on the track and .video-container sets
 * overflow: hidden, so lift + (track height / 2) >= thumb size / 2 or the bottom
 * of the circle is sliced off. Recheck both breakpoints if you change any of the
 * three values.
 *   desktop  4 + 6/2 = 7 >= 12/2 = 6   (1px clear; 4 + 4/2 = 6 >= 6 unexpanded)
 *   mobile   9 + 6/2 = 12 >= 12/2 = 6  (6px clear — the design offset makes
 *                                       clipping impossible here)
 *
 * Progress is driven by a single custom property so the fill width and the
 * time-pill offset stay in sync from one style write.
 *
 * Do NOT add a transition to the fill's width or the time pill's offset: those
 * are rewritten every animation frame by video-scrubber.js, and easing them
 * would animate backwards on a seek and on feed loop-wraparound. The only
 * transitions here are for the hover/drag expand and the thumb's appearance.
 */

.video-scrubber {
    --video-scrubber-progress: 0%;
    --video-scrubber-fill-color: #dbdbdb;
    --video-scrubber-track-color: rgba(255, 255, 255, 0.2);
    --video-scrubber-track-color-active: rgba(255, 255, 255, 0.32);
    --video-scrubber-height: 4px;
    --video-scrubber-height-active: 6px;
    --video-scrubber-thumb-size: 12px;
    /* Gap between the visual track and .video-container's bottom edge — see the
       clipping invariant in the block comment above. */
    --video-scrubber-lift: 4px;
    /* Clamps how close the time pill can get to either end. Comfortably more
       than half the widest pill ("12:05 / 12:34"), so it never gets clipped by
       .video-container's overflow: hidden. */
    --video-scrubber-time-inset: 2.75rem;

    position: absolute;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0;
    /* Generous invisible hit area; the visual track is the flex child below.
       box-sizing is border-box globally, so the padding lifts the track without
       shortening the strip — the bottom edge stays grabbable. */
    height: 1.25rem;
    padding-bottom: var(--video-scrubber-lift);
    display: flex;
    align-items: flex-end;
    /* Above .video-overlay (10) and .video-controls (20), but deliberately
       BELOW .tap-to-play-overlay (25): that overlay is inset:0 and is the only
       way to start playback when autoplay is blocked, so it must keep the whole
       surface — including this strip — while it is visible. */
    z-index: 24;
    cursor: pointer;
    /* Pointer Events drive the drag, so tell the browser not to also pan/zoom. */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.video-scrubber:focus,
.video-scrubber:focus-visible {
    outline: none;
}

/* Ring on the track rather than the strip: the strip reaches .video-container's
   bottom edge, where overflow: hidden would slice the ring off. At lift 4px and
   offset 1px the ring occupies 1–3px above the edge. */
.video-scrubber:focus-visible .video-scrubber-track {
    outline: 2px solid #ffffff;
    outline-offset: 1px;
}

/* === Video Scrubber: track & fill === */

.video-scrubber-track {
    position: relative;
    width: 100%;
    height: var(--video-scrubber-height);
    border-radius: 30px;
    background: var(--video-scrubber-track-color);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: height 0.15s ease, background-color 0.15s ease;
}

.video-scrubber-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--video-scrubber-progress);
    border-radius: 30px;
    background: var(--video-scrubber-fill-color);
}

/* Centred on the fill's leading edge; hidden until hover/drag. */
.video-scrubber-thumb {
    position: absolute;
    right: 0;
    top: 50%;
    width: var(--video-scrubber-thumb-size);
    height: var(--video-scrubber-thumb-size);
    margin-right: calc(var(--video-scrubber-thumb-size) / -2);
    border-radius: 50%;
    background: var(--video-scrubber-fill-color);
    transform: translateY(-50%) scale(0);
    transition: transform 0.15s ease;
    pointer-events: none;
}

/* === Video Scrubber: time indicator === */

.video-scrubber-time {
    position: absolute;
    bottom: calc(100% + 0.375rem);
    /* Track the playhead, but never let the pill hang outside the track. */
    left: clamp(
        var(--video-scrubber-time-inset),
        var(--video-scrubber-progress),
        calc(100% - var(--video-scrubber-time-inset))
    );
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 4px;
    border-radius: 8px;
    /* Layered per design: white 10% wash over black 10%. */
    background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)),
                rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

/* === Video Scrubber: hover & drag states === */

/* Expanded state shared by hover and drag. Hover is gated on a real pointer so
   it does not stick after a tap on touch devices. */
@media (hover: hover) and (pointer: fine) {
    .video-scrubber:hover .video-scrubber-track {
        height: var(--video-scrubber-height-active);
        background: var(--video-scrubber-track-color-active);
    }

    .video-scrubber:hover .video-scrubber-thumb {
        transform: translateY(-50%) scale(1);
    }

    .video-scrubber:hover .video-scrubber-time {
        opacity: 1;
        visibility: visible;
    }
}

.video-scrubber.is-dragging .video-scrubber-track,
.video-scrubber:focus-visible .video-scrubber-track {
    height: var(--video-scrubber-height-active);
    background: var(--video-scrubber-track-color-active);
}

.video-scrubber.is-dragging .video-scrubber-thumb,
.video-scrubber:focus-visible .video-scrubber-thumb {
    transform: translateY(-50%) scale(1);
}

.video-scrubber.is-dragging .video-scrubber-time,
.video-scrubber:focus-visible .video-scrubber-time {
    opacity: 1;
    visibility: visible;
}

/* Lift overlay content (CTA button, title) clear of the scrubber's hit strip so
   the strip never swallows a tap meant for the overlay. Keep this padding >= the
   strip's height at each breakpoint (1.25rem desktop / 1.75rem mobile).

   Applied to every .video-container for simplicity. The three live players
   (feed, feed recommendations, course tracks) all render a scrubber; the only
   container without one is the dead, unreferenced templates/fragments/
   feed-slides.html, where the extra padding is harmless. */
.video-container .video-overlay {
    padding-bottom: 1.25rem;
}

@media (max-width: 768px) {
    /* Mobile placement, from the Figma mobile reel — NOT full-bleed. The bar
       spans the same column as the CTA/title (12px in from the left) and stops
       64px short of the right edge, clear of the vertical action rail
       (.feed-actions / .track-actions at bottom 1rem / right 1rem). On a 375px
       viewport that is the design's 299px-wide bar.

       The thumb stays 12px as designed: touch comfort comes from the hit strip,
       not from a fatter thumb. Strip geometry, from the container's bottom edge:
         0–9px    grabbable dead space below the track
         9–13px   track (9–15px while expanded to 6px)
         13–28px  grabbable space above the track
       Expanded thumb spans 6–18px, so nothing can clip. There is no :hover here,
       so the expanded state comes from .is-dragging. */
    .video-scrubber {
        --video-scrubber-lift: 9px;
        left: 0.75rem;
        right: 4rem;
        height: 1.75rem;
    }

    /* Match the strip height so the title/CTA sit just above the bar, as in the
       design, and never inside the strip's touch area. */
    .video-container .video-overlay {
        padding-bottom: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-scrubber-track,
    .video-scrubber-thumb,
    .video-scrubber-time {
        transition: none;
    }
}

/* === Quiz Answer Result Panel ============================================== */
/*
 * Shown 500ms after a quiz answer. Markup: templates/tracks/fragments/quizz.html,
 * behaviour: the quiz-result block in js/app.js.
 *
 * Desktop (>768px): a 400px white panel docked beside the question, as a flex
 * sibling of .questionnaire-container inside .track-content (which is display:flex).
 * Mobile (<=768px): a bottom sheet over a scrim, matching the track-progress sheet.
 *
 * State classes drive all the colour: .is-correct (green) / .is-incorrect (red).
 * Namespaced .quiz-result-* so nothing here can collide with .track-progress-panel.
 */

.quiz-result-panel {
    --quiz-correct: #05B502;
    --quiz-correct-btn: #05B501;
    --quiz-incorrect: #E1251B;

    display: none;
    flex-direction: column;
    /* Twins its sibling .questionnaire-container, which is the same token wide.
       Static is right here: a quiz slide has no video, and the question card is a
       fixed-size box, so there is nothing to measure. (Was 400px, then briefly the
       55dvh panel width.) */
    width: var(--player-card-width);
    max-width: 100%;
    height: calc(100vh - 88px);
    height: calc(100dvh - 88px);
    padding-bottom: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: #fff;
    overflow: hidden;
    /* .swiper-slide sets text-align: center (app.css ~757) and every slide is one,
       so this panel inherits centring unless it opts out — the same reason
       .question-title and .option-btn both declare text-align: start. Declared on
       the root so the header, labels, answers and the future explanation block are
       all left-aligned regardless of what any ancestor does. */
    text-align: left;
}

.quiz-result-panel.open {
    display: flex;
}

/* === Quiz Answer Result: header === */

.quiz-result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    flex-shrink: 0;
}

.quiz-result-icon {
    display: inline-flex;
    flex-shrink: 0;
}

/* Only the icon matching the current state is shown. */
.quiz-result-icon-correct,
.quiz-result-icon-incorrect {
    display: none;
}

.quiz-result-panel.is-correct .quiz-result-icon-correct,
.quiz-result-panel.is-incorrect .quiz-result-icon-incorrect {
    display: block;
}

/* Feeds the solid disc (fill="currentColor" in quizz.html). Sourced from the same
   tokens as .quiz-result-title below, so the icon and the heading can never drift
   apart — the icons used to hardcode these two hexes. */
.quiz-result-icon-correct {
    color: var(--quiz-correct);
}

.quiz-result-icon-incorrect {
    color: var(--quiz-incorrect);
}

.quiz-result-title {
    margin: 0;
    font-family: "TT Commons", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 150%;
}

.quiz-result-panel.is-correct .quiz-result-title {
    color: var(--quiz-correct);
}

.quiz-result-panel.is-incorrect .quiz-result-title {
    color: var(--quiz-incorrect);
}

/* Dismiss button — mobile only. Appearance is the shared .app-close-btn; this
   rule only keeps it out of the desktop panel and pushes it to the trailing
   edge of the result header. */
.quiz-result-dismiss {
    display: none;
    margin-inline-start: auto;
}

/* === Quiz Answer Result: body === */

/* Grows to fill the panel and scrolls internally, which is what keeps the footer
   pinned to the bottom edge rather than floating under short content.
   min-height: 0 is required — without it a flex child refuses to shrink below its
   content size and the overflow never engages. */
.quiz-result-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* The two boxes butt together into a single rounded group, so the radius lives on
   the group and each box only rounds the edge it owns. */
.quiz-result-answers {
    display: flex;
    flex-direction: column;
}

.quiz-result-answer {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
}

.quiz-result-answer-label {
    font-family: "TT Commons", sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 150%;
}

.quiz-result-answer-text {
    font-family: "TT Commons", sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 150%;
}

/* The user's own answer is a VERDICT surface, so it is tinted by the verdict — green when
   they were right, red when they were wrong — in the same 10% literals the correct-answer
   box below already uses.
   It used to be var(--primary-color-light) in both states, on the argument that the box was
   tenant chrome and the icon/title/ink carried right-vs-wrong on their own. The client
   overruled that ("a dull irrelevant colour — if it's the primary colour it should not be
   here"), and they are right for a reason worth recording: this tenant's --primary-color is
   #E1251B, so a CORRECT answer rendered as a pale RED box with green text inside it. Brand
   tint cannot appear on a surface whose whole job is right-vs-wrong.
   Per the repo's convention these are literal, never tenant-mixed — same rule as the
   #02C121 chip and .cl-oc-cta's completed state. Only the corners depend on whether the
   correct-answer box is stacked below. */
.quiz-result-answer--yours {
    /* Tint is per state, on the two rules below that already own this box's corners. */
    background: transparent;
}

/* Correct: a single box, tinted green. */
.quiz-result-panel.is-correct .quiz-result-answer--yours {
    border-radius: 12px;
    background: rgba(5, 181, 2, 0.1);
}

.quiz-result-panel.is-correct .quiz-result-answer--yours .quiz-result-answer-label {
    color: rgba(5, 181, 2, 0.6);
}

.quiz-result-panel.is-correct .quiz-result-answer--yours .quiz-result-answer-text {
    color: var(--quiz-correct);
}

/* The correct-answer box is redundant when the user was right. */
.quiz-result-panel.is-correct .quiz-result-answer--correct {
    display: none;
}

/* Incorrect: their answer, tinted red, stacked on the green correct-answer box. */
.quiz-result-panel.is-incorrect .quiz-result-answer--yours {
    border-radius: 12px 12px 0 0;
    background: rgba(225, 37, 27, 0.1);
}

.quiz-result-panel.is-incorrect .quiz-result-answer--yours .quiz-result-answer-label {
    color: rgba(225, 37, 27, 0.6);
}

.quiz-result-panel.is-incorrect .quiz-result-answer--yours .quiz-result-answer-text {
    color: var(--quiz-incorrect);
}

.quiz-result-panel.is-incorrect .quiz-result-answer--correct {
    border-radius: 0 0 12px 12px;
    background: rgba(5, 181, 2, 0.1);
}

.quiz-result-panel.is-incorrect .quiz-result-answer--correct .quiz-result-answer-label {
    color: rgba(5, 181, 2, 0.6);
}

.quiz-result-panel.is-incorrect .quiz-result-answer--correct .quiz-result-answer-text {
    color: var(--quiz-correct);
}

/* === Quiz Answer Result: footer === */

.quiz-result-footer {
    margin-top: auto;
    padding: 0 1rem;
    flex-shrink: 0;
}

.quiz-result-got-it {
    display: flex;
    width: 100%;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #fff;
    font-family: "TT Commons", sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 150%;
    /* Explicit: the panel root sets text-align: left, but this is a centred button
       label. */
    text-align: center;
    cursor: pointer;
}

.quiz-result-panel.is-correct .quiz-result-got-it {
    background: var(--quiz-correct-btn);
}

.quiz-result-panel.is-incorrect .quiz-result-got-it {
    background: var(--quiz-incorrect);
}

.quiz-result-got-it:hover {
    opacity: 0.9;
}

.quiz-result-got-it:active {
    transform: scale(0.99);
}

/* === Quiz Answer Result: scrim (mobile only) === */

.quiz-result-scrim {
    display: none;
}

/* === Quiz Answer Result: post-answer option states === */
/*
 * The existing .option-btn.correct / .wrong styling already matches the design for
 * the correct option and for unchosen wrong options, so it is left alone. Only the
 * user's OWN wrong pick was missing its red treatment — .selected marks it, since
 * the answer handler keeps that class on the clicked button.
 */
/* #E1251B STAYS LITERAL — coordinator decision, issue #9. It is the semantic WRONG half of
   a verdict pair whose correct half is #05B502, and a quiz verdict must not change meaning
   with the tenant's brand: on a red-branded tenant a tokenised "wrong" would be
   indistinguishable from the brand, and on a green-branded one it would read as correct.
   Same rule that keeps #02C121 and the quiz-result surfaces literal.
   THE LIKED HEART IS NOW ON THIS SIDE OF THE LINE TOO (client ruling 2026-09-16). This
   comment used to cite it as the counter-example — "converted FROM this exact hex because a
   like is a brand affordance, not a verdict". The client ruled otherwise: a heart means
   "liked" the way this red means "wrong", so both are semantic and both stay literal. See
   .like-btn.liked for the full trail.
   What has NOT changed is why the audit's test is written the way it is:
   test_no_foreign_tenant_colour_literals_on_selection_states asserts the absence of the
   LEFTOVER palette (#B49164 / #9E9268) and never of #E1251B — the hex was never the problem,
   the role it is painting is, and that distinction is exactly what let this decision be
   reversed without touching the audit. */
.option-btn.wrong.selected {
    border-bottom: 2px solid #FFF;
    background: #E1251B;
    color: #fff;
    box-shadow: 0 4px 24px 0 rgba(225, 37, 27, 0.65);
}

/* Unchosen wrong options keep their muted treatment; dim their icon to match. */
.option-btn.wrong:not(.selected) .answer-icon {
    opacity: 0.4;
}

@media (max-width: 768px) {
    /* Bottom sheet: full width, rounded top corners, over a scrim. Mirrors the
       track-progress sheet so both mobile overlays behave the same way. */
    .quiz-result-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 2000;
        width: 100vw;
        max-width: 100vw;
        height: auto;
        /* Present tall by default rather than hugging the (currently short) content.
           50vh is now the standard default height for every mobile sheet in both
           players — see the panel floor in the "Mobile Bottom Sheets" block, which
           applies the same value to the progress, comments and description sheets.
           Cap and internal scroll match them too: max-height 85vh, body scrolls. */
        min-height: 50vh;
        max-height: 85vh;
        /* hidden, not auto: the body is the scroll region, so the footer stays
           pinned to the sheet's bottom edge instead of scrolling away with it. */
        overflow: hidden;
        border: none;
        border-radius: 24px 24px 0 0;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .quiz-result-body {
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .quiz-result-dismiss {
        display: inline-flex;
    }

    /* Visual only — pointer-events: none keeps the X the single dismiss
       affordance, matching the existing mobile track-progress sheet. */
    .quiz-result-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1999;
        background: rgba(0, 0, 0, 0.3);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        pointer-events: none;
    }

    .track-content:has(.quiz-result-panel.open) .quiz-result-scrim {
        opacity: 1;
        visibility: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quiz-result-scrim {
        transition: none;
    }
}

/* === Mobile Bottom Sheets: slide-up / slide-down ========================== */
/*
 * ONE mechanism for every display-gated mobile sheet: the feed comments and
 * description panels, the course progress panel, and the quiz result sheet (all
 * .track-progress-panel / .quiz-result-panel).
 *
 * Mechanism: visibility + transform transition, NOT a keyframe + .closing class.
 * `display` cannot transition, so something had to change — and gating on
 * visibility means every existing code path that adds or removes .open gets both
 * directions of the animation for free, with no JS, no animationend listener and
 * no transient class. That matters here specifically: a .closing class that failed
 * to clear (element recycled out of a virtual slide mid-animation) would leave the
 * panel permanently unopenable, which is exactly the failure mode this player has
 * already been bitten by. There is no state to get stuck.
 *
 * Consequences, all deliberate:
 *  - Side effects (localStorage writes, trackProgressPanelClosed, acknowledge
 *    deferral) still fire exactly where they do today. Nothing is deferred to an
 *    animation callback, so the animation is purely visual.
 *  - Navigation-driven closes (slideChange, _closeOpenTrackPanel,
 *    _closeQuizResultPanels) animate too rather than being special-cased instant.
 *    Harmless: sheets are position: fixed so they slide down the viewport while the
 *    slide moves, and if the element is removed mid-transition nothing is pending.
 *  - Panels are rendered-but-hidden on mobile instead of display:none. They are
 *    position: fixed, so they cost no layout, and visibility: hidden means no paint.
 *
 * Timing came from .cl-dropdown-menu, the skills filter dropdown's mobile bottom sheet —
 * the one sheet in this codebase that already slid up. That dropdown has since been
 * replaced by the .sfp-* filter panel (which slides in from the right on its own 0.26s
 * transition), so these tokens are now the sole definition of the value: 0.28s on an
 * iOS-style ease-out curve. The share
 * modal already animates on its own transform transition (~0.22s) and is left
 * alone. .more-menu is a popover anchored to its button, not a sheet — idiom
 * untouched. Desktop (>768px) is entirely unaffected: everything here is inside the
 * mobile media query.
 */

:root {
    --sheet-duration: 0.28s;
    /* Decelerating curve — inherited from the .cl-dd-slide-up keyframes this outlived. */
    --sheet-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (max-width: 768px) {
    .track-progress-panel,
    .quiz-result-panel {
        /* Rendered so transform can animate; visibility is what gates paint.
           !important is required, not stylistic: the blank-body rule at ~2213,
           .track-progress-panel:not(:has(.track-progress-body > *)) { display: none },
           is specificity (0,2,0) — :not()/:has() take the weight of their most
           specific argument — so it outranks this selector's (0,1,0) no matter the
           source order. All three .track-progress-body sheets render EMPTY
           (video.html:230, _feed_content.html:272, _feed_recommendation_content.html:217)
           and virtual slides mount fresh empty panels on every visit, so without
           this the first open of a slide — usually the only open — would go straight
           from display:none and pop instead of sliding.
           A never-populated panel still cannot be seen: the visibility:hidden below
           governs paint, and .open (2224, also flex !important) is what reveals it.
           Scoped inside the mobile media query, so desktop keeps the :has()
           blank-body hiding exactly as it is. */
        display: flex !important;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 2000;
        width: 100vw;
        max-width: 100vw;
        visibility: hidden;
        /* !important: the per-panel mobile rules above are ancestor-scoped
           (.has-progress-open ...) and set `transform: none`, which would
           otherwise cancel the slide. Those ancestor classes are also removed at
           the same moment as .open, so the geometry above is repeated here to keep
           the sheet in place for the duration of the slide-down. */
        transform: translateY(100%) !important;
        /* visibility flips only after the slide-down finishes, so the sheet stays
           painted while it animates out. */
        transition: transform var(--sheet-duration) var(--sheet-ease),
                    visibility 0s linear var(--sheet-duration);
    }

    /* Sheet geometry, repeated at panel-level specificity so it survives the close.
       The existing rules that supply it are ancestor-scoped on .has-progress-open,
       which JS removes at the same instant as .open — without this the panel would
       snap back to its desktop box (55dvh wide, near-full height) and jump for the
       280ms it spends sliding out. Values are identical to those rules
       (app.css ~2298 / ~2324 / ~3311), so nothing changes while open.
       .quiz-result-panel is excluded: it has its own taller sheet geometry
       (min-height 50vh, 24px radius, internal body scroll) set above. */
    .track-progress-panel {
        height: auto;
        /* Present at a consistent height instead of hugging content — a course with
           three concepts produced a sheet only a couple of rows tall. 50vh matches
           .quiz-result-panel and the comments body floor, so every mobile sheet in
           both players opens to the same size. Panel-scoped like the rest of this
           block so the floor survives the close and the sheet keeps its shape all
           the way down. */
        min-height: 50vh;
        max-height: 85vh;
        overflow: auto;
        border-radius: 12px 12px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* With a 50vh panel floor, a fixed vh cap on the body would leave dead space
       under short content — which is why the two 34vh caps that used to sit at
       ~2346 and ~3327 were removed. Let the body grow into the sheet instead:
       header stays pinned at the top, content stays top-anchored, and the body is
       the scroll region once it exceeds the 85vh cap. min-height: 0 is what allows
       a flex child to shrink below its content size so overflow actually engages.
       Applies to all three bodies — progress, description and comments — so every
       mobile sheet presents at the same height. The comments body's former 50vh
       floor was removed for this (see the note at ~3330). */
    .track-progress-panel .track-progress-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }

    /* Header and the comments input row must keep their size while the body grows:
       they are siblings in the panel's flex column, and the default flex-shrink of 1
       would let a tall body squeeze them. Mobile-scoped, so desktop is untouched. */
    .track-progress-panel .track-progress-header,
    .track-progress-panel .comments-footer {
        flex-shrink: 0;
    }

    /* The comments sheet no longer needs a body-level floor of its own: the panel's
       min-height: 50vh above holds the sheet's shape through the slide-down (it is
       panel-scoped, so unlike the ancestor-scoped rule it survives .has-progress-open
       being dropped on close), and the body flex-grows to fill it.
       Checked for the same class of issue: .description-progress-body has no CSS rule
       at all, so it has nothing to lose; and both 34vh body caps have been removed
       outright rather than overridden. */

    .track-progress-panel.open,
    .quiz-result-panel.open {
        visibility: visible;
        transform: translateY(0) !important;
        /* Visible immediately on the way in, so the slide-up is seen. */
        transition: transform var(--sheet-duration) var(--sheet-ease),
                    visibility 0s linear 0s;
    }

    /* Scrims fade on the same clock as the sheet they belong to. */
    .quiz-result-scrim {
        transition: opacity var(--sheet-duration) var(--sheet-ease),
                    visibility 0s linear var(--sheet-duration);
    }

    .track-content:has(.quiz-result-panel.open) .quiz-result-scrim {
        transition: opacity var(--sheet-duration) var(--sheet-ease),
                    visibility 0s linear 0s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .track-progress-panel,
    .track-progress-panel.open,
    .quiz-result-panel,
    .quiz-result-panel.open,
    .quiz-result-scrim,
    .track-content:has(.quiz-result-panel.open) .quiz-result-scrim {
        transition: none;
    }
}

/* === Learning Now concept bar (over video, above the CTA) === */
.learning-now {
    position: relative;
    width: 100%;
}

/* Offset pills stacked behind the bar for the layered depth effect. height: 100% of
   .learning-now, so they follow the bar's height with no second value to keep in step.
   DARK like the bar (they were white-10%): a white halo behind a dark pill reads as a
   glow rather than a stack, and 42% against the bar's 62% is what makes them recede. */
.learning-now-layer {
    position: absolute;
    height: 100%;
    border-radius: 62px;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.learning-now-layer-1 { left: 4px; right: 4px; top: -2px; }
.learning-now-layer-2 { left: 8px; right: 8px; top: -4px; }

.learning-now-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    /* 10px vertical (was 3.5px) — the client's "way too thin and does not read clearly".
       Against the 20px icon (the tallest thing in the row) that measures a 42px pill: a real
       target, and enough height that the ink is not crowded by the rounded ends.
       Symmetric, not the Figma 4/3 split: that asymmetry compensated for TT Commons'
       metrics, but no @font-face for TT Commons exists anywhere in this codebase (the only
       webfont loaded is Lato, layout.html:134), so every "TT Commons" declaration silently
       falls back — and against the fallback's metrics the heavier top padding pushed the
       text visibly below centre. */
    padding: 10px 12px;
    border-radius: 62px;
    /* CONTRAST, both ways — the other half of "does not read clearly". The pill used to be
       white ink on white-10%: over a bright frame there was nothing behind the text, and the
       .video-overlay gradient only darkens the very bottom of the video. Dark glass gives
       the white ink a constant backing whatever is playing behind it, and the brighter
       hairline keeps the pill's edge visible on a dark frame, which 10% white did not.

       0.62, not the 0.45 this was first written at: MEASURED, by compositing the label
       colour over the bar over the worst-case frame. At 0.45 the label came out at ~3.1:1
       against a blown-out white frame — below WCAG AA, and exactly the complaint. At 0.62
       it is 5.6:1 over white and 17.6:1 over black, so it passes whatever is playing.
       Still glass (the blur stays), so the layered-deck look is intact. */
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    /* button reset — opens the track concepts panel */
    font: inherit;
    color: #fff;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* 20px and full strength: at 16px/60% the bulb was a smudge on the one control that has to
   say "there are concepts here". The glyph is a flat white SVG, so opacity was the only
   thing dimming it. */
.learning-now-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }

.learning-now-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 0.875rem;
    /* 1.3 (18.2px) around 14px glyphs: 1.5's 21px leading was the bulk of the old vertical
       offset, and 1.2 crowded the descenders under the ellipsis overflow now that the label
       beside it is the same size. */
    line-height: 1.3;
    font-weight: 500;
}

/* The legibility complaint, precisely: 12px at 60% white over moving video. Now the same
   14px as the concept it introduces, at 85% — still a step down from the concept's full
   white, so the label/value hierarchy survives, but it is readable ink rather than a hint.
   font-weight 600 gives it the weight difference the opacity used to carry. */
.learning-now-label {
    /* 0.92, not 0.85: the last of the contrast margin over a blown-out frame — see the
       measured figures in .learning-now-bar's note. */
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.875rem;
    font-weight: 600;
}

/* === Concepts header info (concepts modal + in-player progress panel) === */
/* Header info: card-stack thumbnail + course name over track title.
   Shared by the concepts modal and the in-player progress panel (app.js copies
   .concepts-header-info into .track-progress-header-info). */
.concepts-header-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }

.concepts-header-thumb { position: relative; width: 34px; height: 48px; flex-shrink: 0; }
.concepts-header-thumb .thumb-layer { position: absolute; width: 27px; border-radius: 3px; }
.concepts-header-thumb .thumb-layer-3 { background: #f2f2f2; height: 35px; left: 0; top: 6px; }
.concepts-header-thumb .thumb-layer-2 { background: #e4e4e4; height: 39px; left: 1px; top: 4px; }
.concepts-header-thumb .thumb-layer-1 { background: #cecece; height: 44px; left: 2px; top: 2px; }
.concepts-header-thumb img { position: absolute; left: 3px; top: 0; width: 30px; height: 48px; object-fit: cover; border-radius: 4px; }

/* text-align: left is load-bearing, not decoration. The in-player panel renders
   inside .swiper-slide { text-align: center } (app.css:756), which both title lines
   inherit — the same trap that required an explicit opt-out on .quiz-result-panel,
   .question-title and .option-btn. The long course name hides it (it fills or
   ellipsises the column, so there is no slack to centre within) while the shorter
   track title below visibly floats to the middle. Declared on the column so it
   covers both lines by inheritance, and applies in the concepts modal too — which
   never showed the bug only because it renders outside any slide. */
.concepts-header-titles { display: flex; flex-direction: column; justify-content: center; min-width: 0; text-align: left; }
.concepts-header-course { color: rgba(0,0,0,0.6); font-size: 0.75rem; font-weight: 400; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Single-line ellipsis, matching .concepts-header-course above. Relies on the
   min-width: 0 chain (header-info > concepts-header-info > concepts-header-titles);
   without it a flex item refuses to shrink below its content and nothing clips. */
.concepts-header-track { color: #000; font-size: 0.875rem; font-weight: 600; line-height: 1.5; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The concept tracker is meant to read as the video player's twin card, so its
   real width is written inline by alignPanel() in app.js from the video's measured
   box — that is what makes it track any aspect ratio (portrait column, landscape
   wide) without a CSS rule per case.
   This is only the PRE-JS fallback: without it the panel would paint one frame at
   the feed's 55dvh (the .track-progress-panel base) and visibly jump. 50dvh is the
   portrait video width, i.e. correct for the common case before JS runs.
   Deliberately inside min-width: 769px — the mobile bottom-sheet block later in
   this file sets width: 100vw at the same specificity, and an unscoped rule here
   would win on source order and break the sheet. */
@media (min-width: 769px) {
    .concept-track-list {
        width: var(--player-card-width);
    }

    /* Cap the pair's footprint on big screens so the player and its panel keep
       symmetric gutters instead of reaching for the edges. .track-content is
       already justify-content: center, so capping the CARDS both bounds the pair
       and centres it — no container max-width needed.
       Each card gets half the budget minus half the 1rem row gap.

       Capping the cards rather than the container is load-bearing, not a style
       choice. With a container cap the row over-constrains and flexbox shrinks
       both items — but alignPanel() then re-bases the panel off the ALREADY
       SHRUNK video while the video keeps its 50dvh basis, so each pass feeds the
       next. That loop is stable but settles off-target: at 2560x1440 it lands on
       708/484 instead of twins. Capping the cards makes 2*card + gap == the
       budget by construction, so flex never shrinks anything, alignPanel measures
       a video that is already final, and the panel matches it in ONE pass.

       Landscape is excluded on purpose — a landscape video is legitimately wide
       (72vw/89% by its own rules) and has its own reservation; forcing it into a
       portrait-shaped budget would shrink it ~40% on an ordinary laptop. It stays
       bounded by the room clamp in alignPanel(). */
    .track-content.video-track:not(.landscape) .video-container,
    .track-content.video-track:not(.landscape) .concept-track-list,
    .track-content.questionnaire-track .questionnaire-container,
    .track-content.questionnaire-track .quiz-result-panel {
        max-width: calc(
            (var(--course-pair-max-width, min(100vw - 10rem, 1200px)) - 1rem) / 2
        );
    }
}

/* Track-player progress panel only (.concept-track-list) — feed panels reuse
   .track-progress-header and must keep the plain style. */
.concept-track-list .track-progress-header {
    padding: 1rem;
    background: var(--primary-color-light);
    border-bottom: none;
    /* ROOT CAUSE of the header misalignment: the panel is a flex column and
       .track-progress-panel .track-progress-body carries flex: 1 1 auto GLOBALLY
       (app.css ~4705), not just on mobile. The header's default flex-shrink of 1
       therefore let a tall concepts list compress it — and because
       .concepts-header-thumb is a fixed 48px with flex-shrink: 0, the thumbnail
       kept its size while its parent shrank, so it overflowed the band and the
       course/track text and close X stopped reading as vertically centred.
       This was invisible before: the header used to be a single line of text with
       nothing fixed-height inside it. */
    flex-shrink: 0;
}

/* align-items: center so BOTH header states sit centred in the band: the lifted
   .concepts-header-info and the pre-fetch "Progress" fallback span, which would
   otherwise be stretched to full height by the default align-items: stretch and
   render its text against the top edge. */
.track-progress-header-info { display: flex; align-items: center; min-width: 0; flex: 1; }

/* The X must stay vertically centred against this header's 48px-tall lifted
   .concepts-header-info, and must not be squeezed by a long track title.
   .app-close-btn already declares all three properties; they are repeated here
   at higher specificity because this header is the one place where losing them
   is visible, and .app-close-btn's `display` is deliberately overridable by
   single-class rules (see its comment). */
.concept-track-list .track-progress-close {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* === Quiz result: concept pill + explanation box === */
/* Concept pill — same frosted pill as the video's Learning Now bar, on light bg */
/* NEUTRAL, not the brand tint (client: "a dull irrelevant colour — if it's the primary
   colour it should not be here"). The concept row is information, not a verdict: it names
   what the question was about and carries no right-vs-wrong, so it takes the same
   black-5% surface as the explanation box below and the two read as one family. Tinting it
   with --primary-color also collided with the verdict — on this tenant (#E1251B) the row
   sat in the panel as a pale red band next to green "correct" ink.

   HEIGHT (the client's other note on this component): 10px vertical instead of 3.5px, with
   the 12px inline padding the rounded ends need — a 40px row, matching .learning-now-bar,
   which is the same pill in the player and drew the same complaint. */
.quiz-result-concept {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 62px;
    background: rgba(0, 0, 0, 0.05);
}

/* 20px at full strength: the dark bulb sits on a light surface here, so the 0.6 that dimmed
   it was only costing legibility. */
.quiz-result-concept-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }

.quiz-result-concept-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000;
    font-size: 0.875rem;
    line-height: 1.3;
}

/* Was 0.75rem at 60% black — the same too-small/too-faint label the player's
   "Learning Now:" carried. Same size as the value it introduces, separated by weight. */
.quiz-result-concept-label {
    color: rgba(0, 0, 0, 0.75);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Explanation box */
.quiz-result-explanation {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
}

.quiz-result-explanation-label { color: #000; opacity: 0.65; font-size: 0.75rem; line-height: 150%; }
.quiz-result-explanation-text { margin: 0; color: #000; font-size: 0.875rem; line-height: 150%; }

/* === Mobile bottom navigation (Skills / Feed / You / More + search) ======== */
/*
 * Floating glass pill bar plus a separate search circle, pinned to the bottom of the
 * viewport on <=768px only. Markup: templates/components/bottom_nav.html, included by
 * courses/_skills_content.html, home/_home_content.html and user/you.html from inside
 * their #content div so it survives HTMX navigation.
 *
 * Every rule here sits inside the mobile media query — at 769-1270px the sidebar is an
 * in-layout card rail and above that the full sidebar, and neither band renders a dock.
 *
 * VISIBILITY IS THIS BLOCK'S ALONE. The bar does not carry the legacy .mobile-only class
 * (a video-control helper that flips to display:flex !important under 769px): pinning
 * the dock's visibility to an unrelated rule's breakpoint is what made it drift before.
 * .bottom-nav is display:none at the top of this section and turned on inside the single
 * query below, so exactly one query decides where the dock appears.
 *
 * GLASS, from the HTML prototype's `.nav` / `.navpill` / `.nitem` (client's chosen design,
 * replacing the earlier Figma approximation): a translucent white fill over a heavy
 * blur+saturate, a 1px white hairline, and a three-layer shadow — ambient, contact, and an
 * inset top highlight. The fill is deliberately weak (.58) because the BLUR is what makes
 * the dock legible; an opaque bar would read as a solid footer and lose the page behind it.
 * Every white/black-alpha value here is neutral chrome and stays literal; only the active
 * tab's ink and the active avatar's ring are tenant-themed.
 *
 * Two glass surfaces, matching the prototype's structure and ours: .bottom-nav-bar is the
 * pill holding the four tabs (its `.navpill`) and .bottom-nav-search is a separate round
 * bubble beside it (its `.nitem.nbubble`). The outer .bottom-nav paints nothing — it only
 * positions the pair.
 */

.bottom-nav {
    /* Hidden by default at every width; the query below turns it on for the phone band
       alone. 769-1270px gets the card rail and >1270px the full sidebar — neither has a
       dock, so nothing above 768px may switch this on. */
    display: none;
}

/* <=768px, the phone band only: above it the sidebar itself is the navigation (card rail
   at 769-1270, full sidebar beyond), so the dock must not exist there — including the
   #content bottom padding below, which would otherwise reserve space for an absent bar.
   Every rule in this block is dock-only, which is what lets one query own the band. */
@media (max-width: 768px) {
    .bottom-nav {
        position: fixed;
        left: 1rem;
        right: 1rem;
        /* The prototype's own offset, safe area folded into the calc. */
        bottom: calc(18px + env(safe-area-inset-bottom));
        /* Cap the bar + search pair and centre it. Stretched edge-to-edge the pair
           looked stretched approaching the tablet band, and the Figma composition is
           ~373px wide (bar + 8px gap + 56px circle) in a 375px frame — a phone-width
           object, not a full-bleed one.

           WHY THIS CENTRES: with left, right and max-width all set, width resolves
           from the insets and is then clamped, which over-constrains the box; auto
           side margins absorb the leftover space equally, so the pair sits centred
           inside the 1rem insets. No transform, so it stays a clean containing block
           for the pill and does not disturb the view-transition snapshots.

           400px is chosen so the phone rendering is untouched: the cap only binds
           above 432px viewports (400 + the two 1rem insets), which is wider than
           every common phone in portrait — including the 430px iPhone Pro Max. Below
           that the insets still decide the width, exactly as before. The 8px gap and
           the 56px circle are fixed, so the bar alone absorbs the difference and the
           three tabs stay flex: 1. */
        max-width: 400px;
        margin-inline: auto;
        /* ONE height for both glass surfaces, so the round bubble always matches the pill
           beside it — the relationship the prototype hardcodes twice (.navpill and .nbubble
           are both 68px). 72 rather than 68 because our icons are 24px where the prototype's
           are 22: border-box, so this is 2px border + 14px pill padding + a 56px item, which
           is exactly what the item's own geometry needs (8 + 24 + 3 + 12.6 + 8). */
        --dock-surface: 72px;
        z-index: 900;      /* above page content, below the players' overlays */
        display: flex;
        align-items: center;
        gap: 8px;
        pointer-events: none;   /* the children opt back in */
    }

    /* === Bottom nav: glass surfaces ===
       The prototype's values verbatim. border-radius 100px on a box this short is simply
       "fully rounded"; it is kept as the prototype's number rather than 50% so the pill and
       the bubble round identically however tall they end up. */
    .bottom-nav-bar,
    .bottom-nav-search {
        border-radius: 100px;
        background: rgba(255, 255, 255, 0.58);
        backdrop-filter: blur(28px) saturate(190%);
        -webkit-backdrop-filter: blur(28px) saturate(190%);
        border: 1px solid rgba(255, 255, 255, 0.75);
        box-shadow: 0 10px 34px rgba(31, 32, 36, 0.16),
                    0 1px 2px rgba(31, 32, 36, 0.06),
                    inset 0 1px 0 rgba(255, 255, 255, 0.85);
        pointer-events: auto;
    }

    .bottom-nav-bar {
        flex: 1;
        min-width: 0;
        height: var(--dock-surface);
        display: flex;
        align-items: center;
        /* The prototype's container padding and inter-item gap. */
        gap: 4px;
        padding: 7px 9px;
    }

    .bottom-nav-search {
        flex-shrink: 0;
        /* A true circle the same size as the pill beside it, from the one shared height.
           NOT align-self: stretch + aspect-ratio — a flex item's main size resolves from its
           content before the cross axis stretches, which measured a 24px-wide, 72px-tall
           lozenge. */
        width: var(--dock-surface);
        height: var(--dock-surface);
        display: flex;
        align-items: center;
        justify-content: center;
        /* Now a real <button> (it opens the search overlay), so it needs the reset the
           anchor tabs get for free — but NOT `border: none`, which is what it used to
           carry: the shared glass rule above now sets the design's 1px white hairline, and
           this rule comes after it at equal specificity, so a reset here silently stripped
           the bubble's edge while the pill beside it kept one. The UA button border is
           overridden by that hairline, not by removing it. */
        padding: 0;
        color: #000;
        cursor: pointer;
    }

    .bottom-nav-search:active {
        transform: scale(0.96);
    }

    .bottom-nav-search svg {
        width: 24px;
        height: 24px;
        color: #000;
    }

    /* === Bottom nav: tabs === */
    .bottom-nav-tab {
        /* flex: 1 1 auto rather than the prototype's intrinsic width — the tabs grow from
           their own content so the active pill still hugs its label, and they SHRINK (with
           min-width: 0 and the label's ellipsis) so a 320px phone cannot overflow the bar. */
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        /* The prototype's .nitem: 3px icon-to-label, 8px/15px padding, fully rounded. */
        gap: 3px;
        padding: 8px 15px;
        border-radius: 100px;
        /* Secondary ink, the prototype's --ink-2. Our equivalent is the 60% black every
           other muted label in this stylesheet uses; the ACTIVE tab is what goes tenant. */
        color: rgba(0, 0, 0, 0.6);
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.18s ease, color 0.18s ease;
        /* Containing block for .bottom-nav-pill. */
        position: relative;
    }

    /* The two queries below are NESTED inside the dock's own band on purpose: this block
       documents that one query owns where the dock exists, and a top-level rule for a
       dock-only class would quietly break that. @media inside @media is plain CSS
       Conditional Rules 3 — supported everywhere this app runs. */
    @media (prefers-reduced-motion: reduce) {
        .bottom-nav-tab {
            transition: none;
        }
    }

    /* The narrowest phones still in use (<=360px) cannot afford the prototype's 15px item
       padding: with the 72px bubble beside it the pill has ~188px of content width for four
       labels, and 15px a side pushed every one of them into its ellipsis (measured at 320px).
       6px keeps all four labels whole and the items still read as pills. */
    @media (max-width: 360px) {
        .bottom-nav-tab {
            padding: 8px 6px;
        }
    }

    /* The selection highlight, as a discrete element rather than a background on the
       active tab, so it can be named for the view transition and glide between tabs
       (see the transition block below). This is now the ONE source of the highlight;
       .is-active only carries the colour.
       Sized to the whole tab and first in the DOM, with the icon and label made
       positioned so they paint above it — no z-index needed, since positioned
       siblings at auto paint in DOM order. */
    .bottom-nav-pill {
        position: absolute;
        inset: 0;
        border-radius: 100px;
        /* The prototype's active .nitem surface — a brighter pane of the same glass, lifted
           by a contact shadow and an inset top highlight. It was a 10% tenant-tint fill; the
           client's design carries the state in the INK (and the avatar's ring), so the fill
           is neutral white and every tenant gets the same lift.
           Still on this element rather than as a background on .is-active, which is what
           lets it be named for the view transition and glide between tabs. */
        background: rgba(255, 255, 255, 0.85);
        box-shadow: 0 2px 8px rgba(31, 32, 36, 0.10),
                    inset 0 1px 0 rgba(255, 255, 255, 0.95);
        /* Purely decorative: taps must reach the tab, not this. */
        pointer-events: none;
    }

    .bottom-nav-tab > .bottom-nav-icon,
    .bottom-nav-tab > .bottom-nav-label {
        position: relative;
    }

    /* "More" is a real <button> (it opens the sidebar), so it needs the reset the
       anchor tabs get for free. */
    .bottom-nav-tab--menu {
        appearance: none;
        -webkit-appearance: none;
        border: none;
        background: none;
        font: inherit;
        cursor: pointer;
    }

    .bottom-nav-tab.is-active {
        /* Tenant theming: the design's orange is Talabat's primary, so it must come from the
           variables or every other tenant gets Talabat orange. The pill's neutral fill lives
           on .bottom-nav-pill above — one visual source, so the highlight can be animated as
           a single object. */
        color: var(--primary-color);
    }

    /* The prototype's active weight, 700 against the resting 600 — the half of the state that
       survives a greyscale screenshot alongside the glyph swap. On the LABEL, not the tab:
       .bottom-nav-label sets its own 600, which would win over an inherited value. */
    .bottom-nav-tab.is-active .bottom-nav-label {
        font-weight: 700;
    }

    /* The prototype rings the You tab's avatar in the accent when that tab is current
       (.nitem.act .nav-avatar). Ours is an initial badge rather than a photo, so the ring
       reads against its own tinted fill. */
    .bottom-nav-tab.is-active .bottom-nav-avatar {
        box-shadow: 0 0 0 2px var(--primary-color);
    }

    .bottom-nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        flex-shrink: 0;
    }

    /* currentColor throughout, so the .is-active colour drives icon and label alike. */
    .bottom-nav-icon svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .bottom-nav-label {
        font-family: "TT Commons", sans-serif;
        /* The prototype's 10.5px/600. Slightly under the 11px this carried before, which
           the extra weight and the darker resting ink more than pay back. */
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1.2;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Initial badge stand-in — the User model has no avatar column. */
    .bottom-nav-avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-color-light);
        color: var(--primary-color);
        font-family: "TT Commons", sans-serif;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
    }

    /* Keep the last of the page's own content clear of the floating bar. Scoped with
       :has() so only the two pages that include the bar get the padding — no other
       page's spacing is touched. */
    #content:has(> .bottom-nav) {
        /* The dock's whole footprint plus breathing room: 18px offset + the 72px surface is
           90px, so 5.5rem (88px) — correct for the shorter bar this replaced — now left the
           last row a couple of pixels under the glass. 6.5rem clears it by 14px. */
        padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
    }

    /* === Bottom nav: direction-aware page slide =============================
     * Skills <-> Feed animate as a lateral push. The two tabs carry
     * hx-swap="… transition:true", so htmx runs the swap inside
     * document.startViewTransition(); app.js stamps data-nav-direction on <html>
     * from the tabs' DOM order, and the pairs below read it. Browsers without the
     * API never enter these rules — htmx feature-detects and swaps instantly.
     *
     * PINNING THE CHROME is what makes this read as navigation rather than the
     * whole screen lurching: a view-transition-name lifts an element out of the
     * root snapshot into its own group, so the bar and the search circle hold
     * still while the pages move underneath. Without it they would be part of the
     * root image and slide away with the outgoing page — the single detail this
     * effect lives or dies on. Both are single instances (names must be unique)
     * and both exist on either page, so each pairs old-to-new and simply sits. */
    .bottom-nav-bar {
        view-transition-name: bl-bottom-nav;
    }

    .bottom-nav-search {
        view-transition-name: bl-bottom-nav-search;
    }

    /* The loader is fixed and full-viewport, and htmx can still have it up when the
       snapshot is taken — baked into the root image it would slide out with the old
       page, dragging a spinner across the screen. Named, it leaves instantly. */
    #global-loader.htmx-request {
        view-transition-name: bl-global-loader;
    }

    /* The selection pill is the one element here we WANT to move. It exists in both
       snapshots — on the outgoing tab in the old, the incoming tab in the new — and a
       shared name makes the browser interpolate between the two boxes, so the pill
       glides across the bar while the bar holds still and the pages slide. No JS.

       NESTING: it lives inside .bottom-nav-bar, which is pinned with animation: none.
       That does not hold the pill still, because a named descendant is lifted OUT of
       its ancestor's snapshot into a transition group of its own — the groups are flat
       siblings under ::view-transition, not nested — so the bar's frozen image has a
       pill-shaped hole and the pill animates independently. Paint order follows the
       order names are discovered in the DOM, and the bar is the pill's ancestor, so
       the pill is discovered second and paints above it. */
    .bottom-nav-pill {
        view-transition-name: bl-nav-pill;
    }
}

/* Every rule that CHANGES a transition is scoped to the SAME query as the pins above.
 * The two halves must always carry the same bounds: the pins alone would freeze the
 * bar with no page slide behind it, and the slides alone would drag the bar off-screen
 * with the outgoing page.
 *
 * ::view-transition pseudo-elements are document-global, so unscoped these would reach
 * across the whole app: the root cross-fade suppression in particular would pre-empt
 * the browser default for any future view transition at any width, and a bottom nav
 * rendered outside its band would silently inherit the slide. Only the @keyframes
 * below stay top-level — they are inert definitions, referenced solely from here. */
@media (max-width: 768px) {
    /* Hold the pinned chrome perfectly still: no group animation, and no cross-fade
       between its two snapshots (which would flicker the frosted glass). */
    ::view-transition-group(bl-bottom-nav),
    ::view-transition-group(bl-bottom-nav-search),
    ::view-transition-group(bl-global-loader) {
        animation: none;
    }

    ::view-transition-old(bl-bottom-nav),
    ::view-transition-new(bl-bottom-nav),
    ::view-transition-old(bl-bottom-nav-search),
    ::view-transition-new(bl-bottom-nav-search),
    ::view-transition-old(bl-global-loader) {
        animation: none;
        /* The default plus-lighter would double-brighten the overlapping snapshots. */
        mix-blend-mode: normal;
    }

    /* Replace the UA's default cross-fade with the slide pairs below. */
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
        mix-blend-mode: normal;
    }

    /* The pill's group is deliberately NOT suppressed — its default animation is the
       geometry morph we want; we only retime it onto the app's sheet curve so it
       glides with the same weight as the page slide and the bottom sheets. */
    ::view-transition-group(bl-nav-pill) {
        animation-duration: 0.28s;
        animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
    }

    /* Image-pair recipe. The two tabs are both `flex: 1`, so the pill's old and new
       boxes are the SAME SIZE and the morph is a pure translate — the snapshots are
       never stretched, which is what makes a solid rounded rect safe to morph here.
       That leaves only the cross-fade, and fading between two identical images buys
       nothing while `plus-lighter` (the default, applied inside the image pair's
       isolated group) would visibly brighten the overlap. So: drop the isolation, take
       normal blending, and skip the fade — one opaque pill, gliding. */
    ::view-transition-image-pair(bl-nav-pill) {
        isolation: auto;
    }

    ::view-transition-old(bl-nav-pill),
    ::view-transition-new(bl-nav-pill) {
        animation: none;
        mix-blend-mode: normal;
    }

    /* Forward (Skills -> Feed): the outgoing page recedes left while the incoming
       one pushes in from the right. 0.28s on the app's sheet curve — the same
       duration and easing as the mobile bottom sheets, so the whole app moves in
       one vocabulary. */
    html[data-nav-direction="forward"]::view-transition-old(root) {
        animation: bl-nav-slide-out-left 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
    }

    html[data-nav-direction="forward"]::view-transition-new(root) {
        animation: bl-nav-slide-in-right 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
    }

    /* Back (Feed -> Skills): mirrored. */
    html[data-nav-direction="back"]::view-transition-old(root) {
        animation: bl-nav-slide-out-right 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
    }

    html[data-nav-direction="back"]::view-transition-new(root) {
        animation: bl-nav-slide-in-left 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
    }
}

/* The outgoing page travels less than the incoming one (30% vs 100%) and fades:
   the classic push, where the old view feels handed off rather than shoved. */
@keyframes bl-nav-slide-out-left {
    to { transform: translateX(-30%); opacity: 0; }
}

@keyframes bl-nav-slide-in-right {
    from { transform: translateX(100%); }
}

@keyframes bl-nav-slide-out-right {
    to { transform: translateX(30%); opacity: 0; }
}

@keyframes bl-nav-slide-in-left {
    from { transform: translateX(-100%); }
}

/* Combined rather than nested, and width-scoped for the same reason as the block
   above: an unscoped root override would have suppressed motion for any future
   transition anywhere in the app for reduced-motion users. */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    /* Both snapshots hold still and the new one paints over the old, which is an
       instant swap — the transition still runs, it just has no motion. */
    html[data-nav-direction="forward"]::view-transition-old(root),
    html[data-nav-direction="forward"]::view-transition-new(root),
    html[data-nav-direction="back"]::view-transition-old(root),
    html[data-nav-direction="back"]::view-transition-new(root) {
        animation: none;
    }

    /* The pill snaps to its new tab rather than gliding. */
    ::view-transition-group(bl-nav-pill) {
        animation: none;
    }
}

/* === Home filter row: the selected-chip-first glide =========================
 * home/_home_content.html renders the SELECTED chip at the head of the row, and each chip
 * carries `view-transition-name: vt-filter-<n>` plus `hx-swap="… transition:true"`. A name
 * that exists on both sides of the swap makes the browser interpolate the chip's old and new
 * boxes, so the row re-orders by gliding rather than snapping. Same mechanism as the dock's
 * pill, applied to a row.
 *
 * THERE IS NO POSITIVE RULE HERE ON PURPOSE. The browser's DEFAULT group animation is exactly
 * the geometry morph we want, and the names are generated per tenant config, so there is no
 * static selector that could name them anyway. Retiming them would mean
 * ::view-transition-group(*), which would also reach the dock's pill and the root — cross-talk
 * for a curve nobody asked to change.
 *
 * WHAT THE CHIPS DO NOT INHERIT is the reduced-motion release above: that block only stills
 * `root` (and only when data-nav-direction is stamped) and `bl-nav-pill`. Verified, not
 * assumed — the chips would have kept gliding for reduced-motion users. Hence the block below.
 *
 * UNSCOPED, unlike every other rule in this section, and that is the deliberate difference:
 * the dock exists only at <=768px so its rules carry that bound, while the filter row is on
 * the feed page at EVERY width. `*` is the only way to reach names that do not exist until a
 * tenant's config is rendered — and as a superset it is safe here: every other named group in
 * the app is already `animation: none` under this query or (root, above 768px) has only the
 * UA cross-fade, which a reduced-motion user should not be given either. */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*) {
        animation: none;
    }
}

/* === Mobile search overlay ================================================== */
/*
 * components/bottom_nav.html. Full-screen light surface that slides down from the top
 * when the bottom nav's search circle is tapped. Mobile only — the desktop header has
 * its own always-visible search field.
 *
 * [hidden] is the state: app.js flips the attribute and the rules below read it, so the
 * DOM and the animation cannot drift apart.
 */
/* No media query and no .mobile-only: the overlay is state-driven, not width-driven.
   It is only reachable from the dock's search circle, so it appears exactly where the
   dock does — the dock's own query is the only width gate either needs, and moving that
   query needs no change here. The class was removed from the markup because it was inert
   (its display:flex matched what these rules already set) while implying a width gate
   that does not exist. */
.search-overlay {
    position: fixed;
    inset: 0;
    /* Above the bottom nav (900) and the sidebar drawer (1001), below the players'
       mobile sheets (2000) and the share modal (10000) — it is a page-level surface,
       not a blocker over media. */
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: #fff;
    padding: 1rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    /* Slide in from the top on the app's sheet curve — same 0.28s and easing as the
       bottom sheets and the nav slide, so this is one more sentence in the same
       motion vocabulary rather than a new one. */
    transform: translateY(0);
    transition: transform var(--sheet-duration) var(--sheet-ease);
}

.search-overlay[hidden] {
    /* `hidden` alone would win with display:none and kill the transition; overriding it
       back to flex and moving the panel off-screen is what makes the slide possible in
       both directions. */
    display: flex;
    transform: translateY(-100%);
}

.search-overlay.is-leaving {
    transform: translateY(-100%);
}

.search-overlay-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* The back arrow keeps its own size; the field takes the rest of the row. */
/* 44x44 and centred, holding a 24px glyph (issue #3 took the box 36 -> 44 and the glyph
   16 -> 20; the client's later ruling took the glyph to 24, matching the filter sheet's). The
   width/height come from .content-back-btn's min-* pair; only the layout inside the overlay
   row is this rule's business. The row is `align-items: center`, so the taller button simply
   centres against the 44px field rather than pushing the overlay's top bar taller. */
.search-overlay-back {
    flex-shrink: 0;
    margin-bottom: 0;
    border-radius: 0.5rem;
}
@media (hover: hover) {
    .search-overlay-back:hover {
        background: rgba(0, 0, 0, 0.05);
    }
}

.search-overlay-field {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.75rem;
    padding: 0 0.875rem;
    /* Matches this field's own padding-right, so the X sits the same distance from the
       pill's edge as the header's does from its. Consumed by .search-clear-icon. */
    --search-clear-inset: 0.875rem;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 1000px;
    background: #fff;
}

.search-overlay-field:focus-within {
    border-color: var(--primary-color);
}

.search-overlay-icon {
    flex-shrink: 0;
    opacity: 0.6;
}

.search-overlay-input {
    flex: 1;
    min-width: 0;
    /* Keeps typed text clear of the absolutely-positioned X — the header input does the
       same with its own padding-right. */
    padding-right: 1.75rem;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: 0.875rem;
    color: #000;
}

/* Position, size and hover all come from the shared .search-clear-icon rule; the only
   thing left is the cursor. It is absolutely positioned, so it is out of the flex flow
   and the field's gap does not apply to it — hence the input's padding-right below. */
.search-overlay-clear {
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    /* Instant in both directions. app.js waits out a fixed timer rather than
       transitionend precisely because this rule removes the transition. */
    .search-overlay {
        transition: none;
    }
}

/* === "You" page: profile header ============================================ */
/*
 * user/you.html. The course sections below it reuse the skills page's
 * .cl-carousel-* classes wholesale, so the only new styling this page needs is its
 * identity block.
 */
/* No top padding: .main already supplies the design's 16px, and adding 1.5rem here made
   the gap 40px on web and 32px on mobile. Horizontal padding stays — it is this page's
   own gutter, inside .main's. */
/* THE PROFILE BLOCK IS A COLUMN, NOT THE PAGE (Figma 378:7432 -> instance 35074:38968).
   The frame draws it 688 wide inside a 1152 content area: a 72px avatar, a 16px gap, then a
   600px column carrying the name/username row, the Edit button at that column's END, and the
   bio beneath. The page is wider than the block, so capping the block is what puts the button
   and the bio's right edge on the same line — and it is what stops a long bio running the
   full width to the page's right edge (client review, 2026-09-15).
   Our avatar is 64px rather than the frame's 72 (pre-existing, left alone), so the internal
   split is 64 + 16 + 608; --you-avatar-size keeps the bio's indent tracking it rather than
   restating a number that can drift.
   The phone band releases all of this — see the <=768 block, which the mobile frame
   (378:30926) matches already: a 343 block in a 343 padded column, bio full width. */
.you-page {
    padding: 0 1rem;
    /* 72px on the web frame (35074:38968), 56 on the phone (35074:39160) — see the <=768
       block. Adopting the frame's 72 (it was 64) also makes the derived numbers land on the
       frame exactly: the bio's indent becomes 72 + 16 = 88, the frame's x for the identity
       column, and its max-width becomes 688 - 72 - 16 = 600, the frame's bio width. */
    --you-avatar-size: 72px;
    --you-block-max: 688px;
}

/* The frame's own three-part structure, read off 35074:38968's auto-layout rather than
   inferred from x/y: the block is `flex gap-[16px] items-start`, its second child is a 600px
   `flex-col gap-[8px]`, and inside that the name/button row is `flex items-center`.
   So: ITEMS-START here (the name's top meets the avatar's top — it was centre-aligned, which
   is the misalignment the client flagged), 8px inside the column, and the Edit button centred
   against the IDENTITY, not against the 72px avatar.
   `margin-bottom` is 1.5rem again and now means what it says: the gap BELOW the whole block
   (frame: block ends y=138, the tabs section starts y=162). It briefly carried the 8px
   intra-block gap, which was the wrong job for it — that gap belongs to the column. */
.you-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: var(--you-block-max);
}

/* The 600px column in the frame — here it simply takes the remaining width, which at the
   688px cap with a 72px avatar and a 16px gap IS 600. */
.you-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Name/username on one side, the Edit button pinned to the end. `align-items: center` is the
   frame's, and it is what puts the button's centre on the identity's centre instead of on the
   much taller avatar's. */
.you-idrow {
    display: flex;
    align-items: center;
    /* NO gap, in BOTH frames (web I35074:38968;35074:38756 and phone
       I35074:39160;35074:38646 are each a bare `flex items-center`). It carried 1rem by
       analogy with the header's gap, which quietly narrowed the name by 16px before it
       ellipsised. The button's own padding is what separates the glyph from the text, so
       flush here still reads as spaced. */
    gap: 0;
}

/* A ROUNDED SQUARE, NOT A CIRCLE — and this one site is deliberately unlike the others.
   Both You-page frames draw it as a 12px-radius square (web I35074:38968;35074:38754 and
   mobile I35074:39160;35074:38644 are both `rounded-[12px]`, 72 and 56 square), the same
   shape as the Edit Profile modal's 72x72 r12 photo slot. The dock badge (24px) and the
   header pill (28px) stay CIRCLES — they are spec'd that way by the prototype and their own
   Figma frames, so the family is intentionally mixed. A test pins the asymmetry so nobody
   "unifies" the three later.
   The photo takes this shape for free: the img carries `border-radius: inherit` and is a
   child of this box (see the photo-slot block near the end of the sheet). */
.you-avatar {
    flex-shrink: 0;
    width: var(--you-avatar-size);
    height: var(--you-avatar-size);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* White, not the primary tint: .main now carries that exact token, so the badge
       vanished into the page. Inverting to white-on-tint preserves the same
       figure/ground relationship the bottom nav's badge has (tint-on-white) — see
       .bottom-nav-avatar, still the same initial-badge family. */
    background: #fff;
    color: var(--primary-color);
    font-family: "TT Commons", sans-serif;
    /* 28px on the 72px box — the same ratio .epm-photo-initial uses on the modal's identical
       72x72 r12 slot, so the two renderings of one person's initial match. It was 1.5rem for
       the old 64px circle; leaving it there would have shrunk the letter optically as the box
       grew. Centring is the flex box's job and is unaffected by either value. */
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
    /* Decorative: the name beside it is the accessible identity. */
    user-select: none;
}

/* The unnamed-state person glyph. Proportional rather than fixed so it holds its
   relationship to the circle at both the 64px desktop and 56px mobile sizes; the glyph's
   own viewBox already carries padding, so 68% of the circle puts the figure at a
   comfortable weight. stroke="currentColor" picks up the avatar's primary colour, exactly
   as the bottom nav's badge does. */
.you-avatar svg {
    width: 68%;
    height: 68%;
}

.you-identity {
    /* min-width: 0 so a long name ellipsises instead of pushing the row wide; flex: 1 so it
       takes the row's slack, which is what leaves the button hard against the end. */
    flex: 1;
    min-width: 0;
}

.you-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: #000;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.you-username {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.55);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Empty state: text only. The skills page's .cl-empty-state pairs its copy with a large
   glyph; here there is no filter to clear and nothing to diagnose, so a quiet two-line
   message is the honest amount of interface. */
.you-empty {
    padding: 2.5rem 0;
    text-align: center;
}

.you-empty-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #000;
}

.you-empty-text {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.55);
}

/* One orchestrated arrival, rather than motion scattered over the page: the identity
   block settles first and the sections follow it in, ~70ms apart. `backwards` fill holds
   the from-state during the delay so nothing flashes at full opacity before its turn —
   the same fill mode and ease-out curve .feeds-container--animated already uses, so page
   entrances across the app share one vocabulary.

   Each section's delay comes from --you-section-i, an ordinal the template writes onto
   the element (user/you.html) counting only the sections it actually rendered — so an
   empty group that is skipped leaves no gap in the rhythm. Deliberately NOT :nth-of-type:
   that counts by TAG, so it would have been silently rewritten by any future <div> added
   among .you-page's children. Same inline-index approach as .nav-submenu-tail's reveal. */
.you-page > .you-header,
.you-page > .cl-carousel-section {
    animation: bl-you-rise 0.32s ease-out backwards;
}

.you-page > .cl-carousel-section {
    animation-delay: calc(var(--you-section-i, 0) * 0.07s);
}

@keyframes bl-you-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .you-page > .you-header,
    .you-page > .cl-carousel-section {
        animation: none;
    }
}

@media (max-width: 768px) {
    .you-page {
        padding: 0 1rem;
        /* 56px avatar (mobile frame 378:30926), and the block cap is released: the phone
           frame's block IS its padded column — 343 wide in a 375 viewport. */
        --you-avatar-size: 56px;
    }

    /* The header's phone rules are NOT here — .you-bio and .you-idrow are declared much
       further down the sheet (the "Edit Profile trigger + bio" section), so a rule in this
       block would lose to them on source order at equal specificity. It sits in one media
       query directly after those rules instead. Measured: put here, the phone kept the
       desktop treatment. `max-width: none` moved down with them, so there is one .you-header
       rule per band rather than two in different places. */

    .you-avatar {
        font-size: 1.25rem;
    }

    .you-name {
        font-size: 1.125rem;
    }
}

/* === Video Scrubber: scrub preview ========================================= */
/*
 * 80x126 live frame of the video at the pointed time, above the time pill.
 * video-scrubber.js moves ONE shared parked <video data-scrub-preview> per player
 * into the active slide's box, so there is nothing to see until a scrub begins and
 * nothing for virtual recycling to destroy.
 *
 * Collision decision: preview ABOVE, time pill below it, both following the pointer.
 * The pill keeps its existing geometry untouched; the preview derives its own offset
 * from the pill's height so the two can never overlap. The preview follows
 * --video-scrubber-cursor (the pointer) rather than --video-scrubber-progress,
 * because on hover the fill stays at the playback position while the preview tracks
 * the pointer.
 */

.video-scrubber-preview {
    /* Half the preview width — the clamp inset that keeps it inside the container,
       the same technique the time pill uses. */
    --video-scrubber-preview-inset: 40px;

    position: absolute;
    /* Clear the pill (its own bottom offset + its height + a gap). */
    bottom: calc(100% + 2.25rem);
    left: clamp(
        var(--video-scrubber-preview-inset),
        var(--video-scrubber-cursor, 0%),
        calc(100% - var(--video-scrubber-preview-inset))
    );
    transform: translateX(-50%);
    width: 80px;
    height: 126px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

/* The shared element only fills the box while it is mounted here. */
.video-scrubber-preview > video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Only ever visible once JS has actually attached a source: a slide with no usable
   mp4 leaves .has-preview off, so the box stays absent rather than showing empty. */
.video-scrubber.is-dragging .video-scrubber-preview.has-preview {
    opacity: 1;
    visibility: visible;
}

@media (hover: hover) and (pointer: fine) {
    .video-scrubber:hover .video-scrubber-preview.has-preview {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    /* Same size and behaviour while touch-dragging; only the clear-the-pill offset
       changes, because the mobile strip and pill sit slightly differently. */
    .video-scrubber-preview {
        bottom: calc(100% + 2.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .video-scrubber-preview {
        transition: none;
    }
}

/* === EDIT PROFILE (Figma 37005:41484 mobile, 33373:28936 web presentation) ==========
 *
 * ONE markup, TWO presentations — the house pattern the filter panel established:
 * <=768px a bottom SHEET (top corners 24px, rises from the bottom, grab handle);
 * >=769px the same panel CENTRED as a card with all four corners rounded, which is the
 * only thing the web frame changes.
 *
 * Figma's #F97316 is the "BL Skills" brand swatch, i.e. that tenant's primary — so every
 * use of it here goes through var(--primary-color). The greys (black 5% fields, black 10%
 * hairlines) are neutral and stay literal, as everywhere else in this sheet.
 */
.epm[hidden] { display: none; }
.epm {
    position: fixed;
    inset: 0;
    z-index: 1200;          /* over the player containers' 1000 and the dock */
    display: flex;
}
.epm-scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.24s ease;
}
.epm.is-open .epm-scrim { opacity: 1; }

/* THE PANEL. Phone first: a sheet pinned to the bottom, translateY off-screen until open.
   The shell carries the sheet's own transform and clips; nothing inside it is transformed,
   which is the lesson the filter sheet's own comment records. */
.epm-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: 90dvh;
    overflow: hidden;
    background: #fff;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.26s ease;
}
.epm.is-open .epm-panel { transform: translateY(0); }
.epm-panel:focus { outline: none; }

/* The sheet's drag affordance. Purely a signifier — the sheet is dismissed by the scrim or
   the ✕, so this is not a control and takes no pointer events. */
.epm-grab {
    flex: 0 0 auto;
    width: 36px;
    height: 4px;
    margin: 8px auto 0;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.18);
    pointer-events: none;
}

/* Header: 24px inline / 16px block padding and a hairline, per the frame. */
.epm-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.epm-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;        /* 16/600 */
    font-weight: 600;
    line-height: 1.5;
    color: #000;
}
/* The header X is components/close_button.html now, so every visual it needs — the 24px
   glyph, the 44x44 target, the hover fade, the focus ring — comes from .app-close-btn and
   must not be restated here (the macro says so). All that is left is absorbing the macro's
   own 10px padding, on BOTH axes:
   - inline, so the glyph sits on the head's 24px inset instead of 10px inside it;
   - block, so the HEADER'S HEIGHT is driven by its title rather than by the button's touch
     target. Without it the 44px target sets the content box and the head measures 77px;
     with it the content box is the title's 24px line box and the head measures 57px — the
     same as .sfp-header, which reaches ~56 the same way (it drops its top padding around
     the same 44px button). Measured across the house: sfp 57, description 69, concepts 80,
     and this was 77 — no shared number, so this aligns with the described 56px standard and
     its nearest real implementation rather than inventing a fifth value.
   The 44px target is unchanged; it simply overflows the header's padding box, which nothing
   clips. */
.epm-close {
    margin-inline-end: -0.625rem;
    margin-block: -0.625rem;
}

.epm-form {
    display: flex;
    flex-direction: column;
    min-height: 0;          /* lets .epm-body actually scroll inside the flex column */
}
.epm-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 16px 0;
    overflow-y: auto;
}

/* Figma's note banner: primary at 10%, r12, 12px copy with the label in 600. */
.epm-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
}
.epm-note p {
    flex: 1;
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.6);
}
.epm-note strong { font-weight: 600; color: #000; }
/* REQUIRED, not cosmetic: `.epm-note` sets `display: flex`, which beats the UA stylesheet's
   `[hidden] { display: none }` on specificity — so the dismiss handler set `hidden` and the
   banner stayed on screen. That is the whole reason "the X does nothing" (client review,
   2026-09-15); the JS was already correct. Same shape as `.epm-error[hidden]` below. */
.epm-note[hidden] { display: none; }
/* Also the shared close macro. Only the macro's 10px padding is absorbed, so the banner
   keeps the height the frame draws while the control keeps its 44px target. */
.epm-note-close { margin: -0.625rem -0.625rem -0.625rem 0; }

.epm-idrow { display: flex; align-items: center; gap: 16px; }

/* 72px square, r12 — Figma. `position: relative` is what the camera badge hangs off. */
.epm-photo { position: relative; flex-shrink: 0; width: 72px; height: 72px; }
.epm-photo-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--primary-color);
}
.epm-photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.epm-photo-slot svg { width: 32px; height: 32px; }
.epm-photo-initial { font-size: 1.75rem; font-weight: 600; line-height: 1; }

/* The camera badge: Figma puts it at -4px outside the photo's bottom-right corner. It is a
   <label> for the file input, so it is a real, focusable, keyboard-operable picker. */
.epm-upload {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
}
.epm-upload:focus-within { outline: 2px solid var(--primary-color); outline-offset: 2px; }

/* REMOVE PHOTO — the camera badge's twin at the opposite corner: same 24px box (4px padding
   round a 16px glyph), same r8, same -4px overhang, and now the SAME FILL.

   var(--primary-color), matching the add-image badge. An earlier cut used black-60% on the
   argument that two identical badges are hard to tell apart at a glance; the client chose
   MATCHING badges over that, so CORNER POSITION IS NOW THE ONLY DISCRIMINATOR between them —
   top-right removes, bottom-right uploads. Keep the two corners far apart and keep the glyphs
   distinct (X vs camera); do not add a third badge to this slot without revisiting that,
   because there is no colour left to tell it apart with.
   White glyph on the primary is the same pairing .cl-oc-cta--start and the You page's Edit
   button already ship, and it is contrast-checked on this tenant below.

   It is hidden by the `hidden` ATTRIBUTE, so it needs no display rule of its own; the button
   default is inline-flex here and [hidden] wins because nothing sets `display` on it. */
.epm-remove-photo {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
}
.epm-remove-photo[hidden] { display: none; }
.epm-remove-photo:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }

/* BOTH badges draw at 24px, under the house's 44px touch floor, so each grows its HIT AREA
   without changing the drawn box — the same ::before trick the You page's 36px edit button
   uses. -10px on every side takes 24 to 44.
   THE TWO EXPANSIONS DO NOT COLLIDE: on the 72px slot the remove badge occupies y -4..20 and
   the camera badge y 52..76, so expanded they run y -14..30 and y 42..86 — 12px of clear air
   between them. Verified by hit-testing all four corners in a browser; if the slot ever
   shrinks below ~56px these insets have to shrink with it or the two controls will start
   stealing each other's taps. */
.epm-remove-photo::before,
.epm-upload::before {
    content: '';
    position: absolute;
    inset: -10px;
}

.epm-identity { flex: 1; min-width: 0; }
.epm-name {
    margin: 0;
    font-size: 1.25rem;     /* 20/600, line-height 1.2 */
    font-weight: 600;
    line-height: 1.2;
    color: #000;
}
.epm-username {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #000;
    opacity: 0.6;
}
/* .epm-remove is gone with the "Remove photo" checkbox — the Figma frame has none. See the
   template for why the endpoint's remove_photo flag stays anyway. */

.epm-field { display: flex; flex-direction: column; gap: 4px; }
.epm-label { font-size: 0.875rem; font-weight: 600; line-height: 1.5; color: #000; }
/* Figma's field: black-5% fill, r8, 16/8 padding, 14/400 ink. */
.epm-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
    color: #000;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
}
.epm-textarea:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 1px; }
.epm-counter {
    margin: 0;
    align-self: flex-end;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.5);
}
.epm-error {
    margin: 0;
    font-size: 0.75rem;
    color: #C8102E;
}
.epm-error[hidden] { display: none; }

/* Actions sit OUTSIDE the scrolling body, so Save is reachable without scrolling the
   sheet — the frame draws it pinned under the content. */
.epm-actions { padding: 16px; }
.epm-save {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    padding: 7px 8px 8px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
}
.epm-save[disabled] { opacity: 0.6; cursor: default; }

/* WEB: the same panel, centred (Figma 33373:28936 — rounded-[24px] on all four corners). */
@media (min-width: 769px) {
    .epm { align-items: center; justify-content: center; }
    .epm-panel {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: min(480px, calc(100vw - 32px));
        max-height: min(90dvh, 720px);
        border-radius: 24px;
        /* A card scales in rather than rising: translateY would read as a sheet that
           stopped halfway. */
        transform: translateY(8px) scale(0.98);
        opacity: 0;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }
    .epm.is-open .epm-panel { transform: none; opacity: 1; }
    /* No drag affordance on something that cannot be dragged. */
    .epm-grab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .epm-scrim,
    .epm-panel { transition: none; }
}

/* === You page: Edit Profile trigger + bio ========================================= */
/* Figma web I35074:38968;35074:38768 — solid primary, r8, 8/16 padding, 4px gap, white
   14/600 label beside a 20px glyph. Pinned to the end of the identity row. */
.you-edit {
    flex-shrink: 0;
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px 7px 8px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
}
.you-edit svg { flex-shrink: 0; }

/* MOBILE (Figma 378:30926 -> I35074:39160;35074:38650): the trigger collapses to an
   icon-only square — `p-[8px]` around the 20px glyph, so 36x36, not the 40 this carried. The
   label is hidden with .visually-hidden rather than display:none, so the button keeps its
   accessible name — an icon-only control with no name is the usual regression here. */
@media (max-width: 768px) {
    .you-edit {
        gap: 0;
        width: 36px;
        height: 36px;
        padding: 0;
        position: relative;
    }
    /* The frame draws 36, and the house floor for a touch target is 44 — so the HIT AREA is
       grown 4px on every side while the drawn box stays exactly what the frame specifies.
       (It was 40x40, already under the floor; this keeps the design and fixes the target.) */
    .you-edit::before {
        content: '';
        position: absolute;
        inset: -4px;
    }
    .you-edit-label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
}

/* The bio is a child of .you-col now, so the column supplies BOTH the 8px above it and its
   width — the indent and max-width it used to carry by hand are gone, along with the
   source-order trap that came with undoing them per band. */
.you-bio {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.75);
}
/* PHONE: the bio drops BELOW the whole row and spans the padded column, flush to the page
   edge (mobile frame 35074:39160 — row h=56 at y=0, bio at y=64 x=0 w=343). The web frame
   keeps it beside the avatar inside the 600px column, so the two bands want genuinely
   different placements for the same element.
   A GRID is what expresses that without a second copy of the markup: the same three parts,
   re-placed. `display: contents` on .you-col dissolves the desktop column so its two children
   become grid items of the header itself — the row keeps column 2, the bio takes a full-width
   row of its own underneath. row-gap 8px is the frame's spacing at this band too.
   This lives directly after .you-bio, not in the You page's other <=768 block further up the
   sheet: same (0,1,0) specificity, so source order decides, and up there it lost — measured,
   the phone kept the desktop treatment. */
@media (max-width: 768px) {
    .you-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        /* 8px between the avatar and the column — the PHONE frame's row is
           `flex gap-[8px]` (I35074:39160;35074:38643), where the web block is gap-16. The
           two bands genuinely differ here; this carried the web's 16 until the phone frame
           was read directly. */
        column-gap: 8px;
        row-gap: 8px;
        /* The block cap is released here: the phone frame's block IS its padded column. */
        max-width: none;
    }

    .you-col { display: contents; }

    .you-avatar { grid-area: 1 / 1 / 2 / 2; }
    .you-idrow { grid-area: 1 / 2 / 2 / 3; }
    .you-bio { grid-area: 2 / 1 / 3 / 3; }
}

/* The empty state is the client's exact sentence; italic + lighter marks it as a prompt
   rather than content the user wrote. */
.you-bio--empty {
    font-style: italic;
    color: rgba(0, 0, 0, 0.45);
}

/* === Profile photo in the avatar slots ============================================ */
/* `object-fit: cover` so a non-square upload is cropped rather than squashed. Shared by both
   photo elements; the RADIUS is not, and that is the whole point of the split below. */
.bottom-nav-avatar--photo,
.user-pill-photo {
    object-fit: cover;
}

/* `border-radius: inherit` IS ONLY CORRECT FOR A PHOTO THAT IS A CHILD OF ITS ROUND SLOT.
   .user-pill-photo is: it sits inside .user-pill-avatar (28px, 50%), so inherit resolves to
   the circle. Same for the You page, whose img carries an inline `border-radius: inherit`
   inside the 64px round .you-avatar. */
.user-pill-photo {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

/* THE DOCK IS THE EXCEPTION, and it shipped square because of it (client screenshot,
   2026-09-15). There the img IS the badge — `<img class="bottom-nav-avatar
   bottom-nav-avatar--photo">` — not a child of it, so `inherit` reached past the badge to
   .bottom-nav-icon, a plain 24px span with no radius, and resolved to 0. Worse, it WON:
   both selectors are (0,1,0) and this block sits after the dock's own rule, so an explicit
   `inherit` overrode the 50% the badge already had. The photo rendered square and the active
   tab's 2px ring, which follows the border-radius, boxed it.
   The fix is to declare nothing here: .bottom-nav-avatar's own `border-radius: 50%` (in the
   dock's <=768 band) then applies to the initial badge and the photo alike, so the two states
   and the ring can never disagree. Do not "restore" a radius on this selector. */
