/*
 * Course player — Calm Workspace / "Focus Flow" skin.
 *
 * Single-layer rewrite (previously two stacked layers: an original pass and
 * a later visual-parity override pass re-declaring roughly 16 selectors).
 * Every rule below references canonical tokens.css custom properties only
 * (--blue, --ink, --card-border, --r-card, --shadow-soft, etc.) — no legacy
 * compat-bridge aliases, no hardcoded hex/px-token duplication.
 *
 * Structural sizing (header height, sidebar width, content width, type
 * scale) is written as plain values on a 4px spacing grid — the former
 * player-specific size custom properties were this file's only consumer and
 * have been removed from the compat bridge (assets/css/tokens.css keeps the
 * shared player text-scale variables and the control-min-height variable,
 * which other screens still reference).
 *
 * Buttons: primary controls (Mark complete, step nav, celebration next/stop,
 * worksheet download, notes/Q&A submit, practice restart/to-card) carry the
 * shared .btn / .btn-primary / .btn-ghost / .btn-sm classes from
 * components.css. Only small positional/margin rules remain here for those
 * elements. Because this stylesheet is enqueued ahead of components.css in
 * the focus-mode template's dependency order, any player-specific override
 * that must beat a .btn-primary/.btn-ghost declaration on the SAME element
 * (e.g. the lesson bar's buttons) is written as a compound selector
 * (.player__lesson-bar .btn) so it wins on specificity rather than relying
 * on source order.
 *
 * @package Soofos
 */

/* --------------------------------------------------------------------------
 * Page shell
 * -------------------------------------------------------------------------- */
.soofos-player {
    /* Constant brand navy (--ink is re-pointed to light text in dark mode). */
    --pl-navy: var(--player-dark);

    background: var(--white);
    color: var(--ink);
    min-height: 100vh;
}

.player,
.player * {
    box-sizing: border-box;
}

/* Player surface tokens (2026-10, L1/L2). Light = the shared brand tokens;
   dark mode re-points them (and the text/border/fill tokens) below. Surfaces
   use --pl-surface instead of --white because --white is also the "text on
   blue" colour (buttons, avatar) and must stay white in dark mode. */
.player {
    --pl-surface: var(--white);
    --pl-sidebar: var(--canvas);
    --pl-chapter: color-mix(in srgb, var(--ink) 5%, var(--pl-sidebar));
    --pl-sidebar-shadow: inset -1px 0 0 var(--card-border), 4px 0 14px color-mix(in srgb, var(--ink) 6%, transparent);

    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--pl-surface);
    position: relative;
}

/* --------------------------------------------------------------------------
 * Dark mode — the site-wide theme (tokens.css :root[data-theme="dark"],
 * set before first paint by inc/theme-mode.php; the top-bar moon toggles
 * the same global preference). The global block already re-points text,
 * borders, fills and --white (= surface); the player only adds its own
 * layered surfaces, derived from the constant brand navy.
 * -------------------------------------------------------------------------- */
:root[data-theme="dark"] body.soofos-player {
    background: color-mix(in srgb, var(--pl-navy) 55%, black);
}

:root[data-theme="dark"] .player {
    --pl-base: color-mix(in srgb, var(--pl-navy) 55%, black);
    --pl-surface: color-mix(in srgb, var(--pl-navy) 72%, black);
    --pl-sidebar: color-mix(in srgb, var(--pl-navy) 48%, black);
    --pl-raised: color-mix(in srgb, var(--pl-navy) 88%, black);
    --pl-chapter: color-mix(in srgb, var(--blue) 9%, var(--pl-sidebar));
    --pl-sidebar-shadow: inset -1px 0 0 var(--card-border), 4px 0 14px color-mix(in srgb, var(--pl-base) 70%, transparent);

    --canvas: var(--pl-raised);
    --strip: var(--pl-raised);

    color: var(--ink);
}

/* Shared components that paint their own light surface (components.css,
   questions.css — not player files) follow the player surface in dark. */
:root[data-theme="dark"] .player :is(.btn-ghost, .question-card, .question-card__upvote, .question-card__action, .questions-filter, .questions-chip, .player__qa-textarea, .player__notes-input, .player__note-editarea) {
    background-color: var(--pl-surface);
    color: var(--ink);
}

:root[data-theme="dark"] .player .btn-ghost {
    border-color: var(--card-border);
}

/* Instructor-written lesson HTML (Overview): inline colours were picked for
   white paper — let them follow the theme so text stays readable, and give
   images (often transparent PNGs with dark lines) a light backing. */
:root[data-theme="dark"] .player :is(.player__overview-content, .player__worksheet) :is([style*="color"], font[color]) {
    color: inherit !important;
}

:root[data-theme="dark"] .player :is(.player__overview-content, .player__worksheet) [style*="background"] {
    background-color: transparent !important;
}

:root[data-theme="dark"] .player .player__overview-content :is(img, svg, video):not(.sf-icon) {
    background: var(--on-navy); /* literal white paper (--white is the dark surface here) */
    border-radius: var(--r-btn);
}

:root[data-theme="dark"] .player .player__overview-content a {
    color: var(--deep-blue);
}

/* --------------------------------------------------------------------------
 * Top bar
 * -------------------------------------------------------------------------- */
/* Height is not hardcoded: it is derived the same way portal's #sf-nav
   derives its 75px (shell.css:51-57) — 14px top/bottom padding plus the
   tallest child (the 46px logo, matching #sf-nav .nv-logo img) plus the
   1px border-bottom = 75px total. J6 (2026-10): same 40px side inset as
   #sf-nav on desktop, so the logo does not jump between the site header
   and the player. */
.player__topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 40px;
    background: var(--pl-surface);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Admin-bar offset: WP core's fixed #wpadminbar sits at viewport top:0,
   which collides with this sticky topbar's own top:0 once scrolled (the
   html { margin-top: 32px } WP core adds only offsets the initial paint,
   not a sticky element's stuck position). No portal precedent existed for
   this — shell.css/portal-shell.css never sticky-offset for the admin bar
   either — so this pairs the topbar's sticky top with the admin bar's own
   height. WP core switches the admin bar to 46px tall below 783px
   viewports (twenty-nineteen/wp-admin/css/admin-bar.min.css breakpoint);
   the 782px query below matches that exactly.

   Verified rest-state math (2026-09-04 audit, corrected same day): WP core
   injects `@media screen{html{margin-top:32px!important}}` (46px <=782px)
   via wp_enqueue_admin_bar_bump_styles() in wp-includes/admin-bar.php,
   printed as an inline style on the 'admin-bar' handle in wp_head() —
   unconditional unless a theme calls add_theme_support('admin-bar', [...])
   with a custom callback (soofos does not; grepped, none found). .player
   is the first element after <body> on this focus-mode template
   (learndash/ld30/focus/content.php calls wp_body_open() then
   get_template_part('parts/player/shell') immediately — the only
   wp_body_open listener in the codebase, Commerce\Offers\QuietBanner,
   gates on is_portal/is_singular(sfwd-courses) and never fires here).
   So this sticky top:32/46 rule is itself correct: it exactly matches
   WP core's html margin-top, so at scroll 0 the clamp is a no-op (no
   gap, no overlap) and the SCROLLED state also lands flush — that part
   of the original audit held up (isolated Chromium repro confirmed
   getBoundingClientRect().top === 32 at scroll 0 and after scrolling
   500px, same at 46px <=782px).

   What the isolated repro missed, caught via live DOM measurement on
   dev (32px gap at rest): LearnDash's own front-end stylesheet — ld30/
   assets/css/learndash.css:6303-6305 (learndash.min.css, the actually-
   enqueued handle, carries the same rule) — ships
   `body.ld-in-focus-mode.admin-bar { padding-top: 32px; }`, a
   compensation LD's *own* focus-mode header/sidebar relies on. Our
   template's body carries the 'ld-in-focus-mode' class too (content.php:
   body_class('soofos-player ld-in-focus-mode'), kept so LearnDash's own
   quiz/focus JS still recognizes the page) even though we render none of
   LD's focus markup — so LD's padding-top:32px silently stacks with WP
   core's html margin-top:32px, pushing the topbar's real natural
   position to 64px while this rule only compensates 32, leaving a
   genuine 32px gap. LD self-neutralizes its own rule to padding-top:0,
   but only <=768px (learndash.css:6306-6309) — narrower than our own
   900px (56.25rem) drawer breakpoint, so 769-900px would still be
   affected by an approach that only mirrors LD's breakpoint. Neutralized
   unconditionally (all widths) via higher specificity below instead. */
body.admin-bar .player__topbar {
    top: 32px;
}

/* Neutralizes LearnDash's own body.ld-in-focus-mode.admin-bar{padding-top:
   32px} (ld30/assets/css/learndash.css:6303-6305 / learndash.min.css —
   see the audit note above). LD's selector specificity is 0-2-1 (body +
   2 classes); adding our own .soofos-player class here makes this 0-3-1,
   so it wins over LD's rule regardless of stylesheet print order —
   deliberately unconditional (no media query) rather than mirroring LD's
   own <=768px self-zero, since that breakpoint doesn't line up with our
   900px (56.25rem) drawer breakpoint (see above). Sets padding-top back
   to the 0 the rest of this file's admin-bar math already assumes. */
body.soofos-player.ld-in-focus-mode.admin-bar {
    padding-top: 0;
}

.player__origin,
.player__utilities {
    display: flex;
    align-items: center;
}

.player__origin {
    flex: none;
    min-width: 0;
    gap: 12px;
}

/* Top-bar icon buttons: sidebar collapse, dark mode, fullscreen. */
.player__bar-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    color: var(--muted);
    background: var(--pl-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.player__bar-btn:hover {
    color: var(--ink);
    border-color: var(--blue);
}

.player__bar-btn[hidden] {
    display: none;
}

.player__bar-btn .sf-icon {
    width: 20px;
    height: 20px;
}

/* .player__bar-btn prefix: beats the later .player__icon-wrap display rule. */
.player__bar-btn .player__theme-icon--sun,
:root[data-theme="dark"] .player .player__bar-btn .player__theme-icon--moon,
.player__bar-btn .player__fullscreen-icon--exit,
.player.is-fullscreen .player__bar-btn .player__fullscreen-icon--enter {
    display: none;
}

:root[data-theme="dark"] .player .player__bar-btn .player__theme-icon--sun,
.player.is-fullscreen .player__bar-btn .player__fullscreen-icon--exit {
    display: inline-flex;
}

.player[data-sidebar="collapsed"] .player__sidebar-toggle {
    color: var(--deep-blue);
    background: var(--blue-fill);
}

.player__brand {
    display: inline-flex;
    flex: none;
    color: var(--blue);
    text-decoration: none;
}

/* Matches #sf-nav .nv-logo img exactly (shell.css:57: height: 46px). */
.player__brand-logo {
    display: block;
    height: 46px;
    overflow: hidden;
}

.player__brand-logo img {
    display: block;
    height: 46px;
    width: auto;
    object-fit: contain;
}

.player__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding-left: 12px;
    border-left: 1px solid var(--card-border);
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
}

.player__back:hover {
    color: var(--ink);
}

.player__back .sf-icon {
    width: 16px;
    height: 16px;
}

.player__course-info {
    flex: 1 1 auto;
    min-width: 0;
}

.player__course-title {
    overflow: hidden;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player__progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.player__progress-track {
    flex: 1;
    max-width: 260px;
    height: 6px;
    background: var(--card-border);
    border-radius: 8px;
    overflow: hidden;
}

.player__progress-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 8px;
    transition: width 0.4s ease;
}

.player__progress-label {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
}

.player__utilities {
    flex: none;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}

/* Streak chip — styled like the portal home streak badge. */
.player__streak {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 7px 14px;
    border-radius: 8px;
    color: var(--amber-text-2);
    background: var(--amber-fill);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.player__streak .player__icon-wrap {
    color: var(--amber-text-2);
}

/* User avatar — matches .portal__avatar (38px, blue fill, no border). */
.player__avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--blue);
    color: var(--on-navy);
    font-weight: 900;
    font-size: 15px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.player__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.player__curriculum-open,
.player__curriculum-close {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--ink);
    background: var(--pl-surface);
    font: 800 13px var(--font);
    cursor: pointer;
}

.player__curriculum-open:hover,
.player__curriculum-close:hover {
    border-color: var(--blue);
}

/* --------------------------------------------------------------------------
 * Main content: curriculum sidebar (left) + lesson content (right).
 * -------------------------------------------------------------------------- */
.player__content {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 75px);
}

/* Orphan-step fix: when the curriculum has no chapters/steps (e.g. a quiz
   with no parent course), shell.php omits the sidebar aside + scrim + open
   buttons entirely rather than rendering an empty white column. The content
   panel is .player__content's only flex child at that point and already
   fills the row via flex:1 1 auto below — this modifier makes that explicit
   so the full-width intent survives even if a sibling is reintroduced. */
.player__content--no-sidebar .player__video-panel {
    flex: 1 1 100%;
}

/* L1 B (2026-10, .nl-style): a tinted sidebar with a soft shadow instead
   of a white column with a hairline; the whole sidebar collapses (top-bar
   toggle, remembered — assets/js/player-layout.js) instead of the old
   drag-resize. Fullscreen hides it too, like .nl. */
.player__sidebar {
    display: flex;
    flex-direction: column;
    width: 300px;
    flex: 0 0 auto;
    height: calc(100vh - 75px);
    overflow-y: auto;
    position: sticky;
    top: 75px;
    z-index: 1;
    background: var(--pl-sidebar);
    box-shadow: var(--pl-sidebar-shadow);
}

@media (min-width: 56.3125rem) {
    .player[data-sidebar="collapsed"] .player__sidebar,
    .player.is-fullscreen .player__sidebar {
        display: none;
    }
}

/* Touch tablets (sidebar mode >900px): an 8px strip is nearly impossible
   to hit. 24px covers only the sidebar's own right padding; the 2px
   visual line stays at the edge. */
@media (pointer: coarse) {
    .player__avatar {
        width: 44px;
        height: 44px;
    }

    /* Notes / Q&A inputs: 16px stops iOS focus zoom. Width-based phone
       rules stop at 900px, but a 1024px touch tablet needs the same
       (R2: M5-r2-4, M5-r2-9). The .player prefix beats the base rules,
       which are declared further down this file. */
    .player :is(.player__notes-input, .player__qa-textarea, .player__note-editarea, .player__ask-input) {
        font-size: 16px;
    }

    .player__qa .player__qa-filters .questions-filter,
    .player__qa .question-card__upvote {
        min-height: 44px;
    }
}

/* Admin-bar offset — sidebar sticks below both the topbar (75px) and the
   admin bar (32px desktop / 46px below 783px, handled in the 782px query
   further down). See the .player__topbar admin-bar note above. */
body.admin-bar .player__sidebar {
    top: calc(75px + 32px);
    height: calc(100vh - 75px - 32px);
}

.player__curriculum-scrim {
    display: none;
}

.player__video-panel {
    flex: 1 1 auto;
    min-width: 0;
    padding: 28px clamp(16px, 4vw, 48px) 48px;
    background: var(--pl-surface);
}

/* J11 (2026-10): content centred in the column, max 960px with the
   sidebar open and 1000px when it is collapsed (Joris: 900-1000px keeps
   lines readable). */
.player__video-panel > * {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
}

.player[data-sidebar="collapsed"] .player__video-panel > *,
.player.is-fullscreen .player__video-panel > * {
    max-width: 1000px;
}

/* --------------------------------------------------------------------------
 * Video shell
 * -------------------------------------------------------------------------- */
.player__video {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-card);
    background: var(--player-dark);
    box-shadow: var(--shadow-card);
}

.player__video-inner {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 0;
    display: grid;
    place-items: center;
}

.player__video-iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none;
}

/* State panels (unavailable / processing / not ready) have nothing to
   play: drop the 16:9 box so the title and Mark complete move up. */
.player__video--state .player__video-inner {
    aspect-ratio: auto;
    min-height: 120px;
}

.player__video-placeholder {
    padding: 28px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}

.player__video-placeholder strong,
.player__video-placeholder span {
    display: block;
}

/* Secondary line on the navy video panel: --muted is 2.3:1 on
   --player-dark; the on-navy muted token is the AA-safe equivalent. */
.player__video-placeholder span {
    color: var(--on-navy-muted);
}

.player__video-placeholder strong {
    margin-bottom: 4px;
    color: var(--on-navy);
}

.player__caption-languages {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--player-dark) 56%, transparent);
    color: var(--on-navy);
    font-size: 11px;
}

.player__caption-languages span {
    margin-left: 4px;
    font-weight: 800;
}

/* --------------------------------------------------------------------------
 * Transcript tab
 * -------------------------------------------------------------------------- */
.player__transcript {
    display: block;
}

.player__transcript-languages {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.player__transcript-languages button {
    min-height: 44px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--pl-surface);
    padding: 4px 8px;
    font: 700 13px var(--font);
    color: var(--ink);
    cursor: pointer;
}

.player__transcript-languages button[aria-selected="true"] {
    border-color: var(--blue);
    color: var(--deep-blue);
}

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

.player__transcript-cues button {
    display: grid;
    grid-template-columns: 54px 1fr;
    width: 100%;
    min-height: 44px;
    border: 0;
    border-bottom: 1px solid var(--card-border);
    background: transparent;
    padding: 8px;
    text-align: left;
    color: inherit;
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
}

.player__transcript-cues button:hover,
.player__transcript-cues button:focus-visible {
    background: var(--blue-tint);
}

.player__transcript-cues time {
    color: var(--deep-blue);
    font-weight: 800;
}

.player__transcript-vtt {
    display: inline-block;
    margin-top: 12px;
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
 * Lesson meta (chapter label + title + complete button)
 * -------------------------------------------------------------------------- */
.player__lesson-meta {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 0;
    border-bottom: 1px solid var(--card-border);
}

.player__lesson-info {
    flex: 1;
    min-width: 0;
}

/* Sentence case at every width, and no "Unit N of M" suffix: the h1 carries
   the unit's own number, and the course-contents button / sidebar show the
   position (a second, differently numbered "UNIT 6 OF 20" confused learners). */
.player__chapter-label {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;
    color: var(--deep-blue);
}

.player__chapter-label-pos {
    display: none;
}

.player__lesson-title {
    margin: 4px 0 0;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 900;
    letter-spacing: -0.4px;
    line-height: 1.2;
    color: var(--ink);
}

/* Programmatic focus target after the celebration closes (tabindex=-1). */
.player__lesson-title:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 4px;
    border-radius: var(--r-btn);
}

.player__lesson-detail {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
}

/* Goal-gradient chapter-proximity nudge — quiet, non-alarming, no icon. */
.player__chapter-proximity {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

/* Failed save (player-completion.js): server message or the generic
   connection message, announced via role="alert". Same error treatment as
   .player__notes-status.is-error. */
.player__complete-error {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--error);
}

.player__complete-error[hidden] {
    display: none;
}

/* Inline completion bar (workspace rework): replaces the centred pop-up for
   a normal lesson. The region is an always-present polite live region
   (empty = no box); player-completion.js fills it from the completion
   response. Green = success (same treatment as .player__review-thanks and
   the done complete button). */
.player__complete-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 12px;
    padding: 4px 4px 4px 16px;
    border: 1px solid var(--green);
    border-radius: var(--r-card-sm);
    color: var(--ink);
    background: var(--green-fill);
    font-size: 14px;
    font-weight: 700;
}

.player__complete-bar-icon {
    color: var(--green-ink);
}

.player__complete-bar-text {
    flex: 1 1 12rem;
    min-width: 0;
    margin: 0;
}

.player__complete-bar-skipped {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--deep-blue);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.player__complete-bar-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: var(--r-btn);
    color: var(--muted);
    background: none;
    cursor: pointer;
}

.player__complete-bar-dismiss:hover {
    color: var(--ink);
}

.player__complete-bar-dismiss:focus-visible,
.player__complete-bar-skipped:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * Study tools row ("Add to study guide" / lesson summary / practice quiz)
 * -------------------------------------------------------------------------- */
.player__study-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 20px 0;
    border-bottom: 1px solid var(--card-border);
}

/* No study tool rendered (legitimate empty state from soofos-study): drop
   the blank 41px band and its second hairline. :has() rather than :empty
   because the hook leaves whitespace text nodes. Hook point + aria-label
   stay in the markup. */
.player__study-tools:not(:has(*)) {
    display: none;
}

.player__study-cards,
.player__unit-summary,
.player__unit-practice {
    min-width: 0;
    margin: 0;
}

/* No compiled cards yet (transcript not ready): one quiet line across the
   strip (soofos-study PlayerTrigger, parts/player/study-cards.php). */
.player__study-tools-note {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.player__study-cards-trigger,
.player__unit-summary-trigger,
.player__unit-practice-trigger {
    min-width: 0;
}

.player__study-cards-btn,
.player__study-cards-upsell,
.player__unit-summary-btn,
.player__unit-summary-upsell-link,
.player__unit-practice-btn,
.player__unit-practice-upsell-link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--ink);
    background: var(--pl-surface);
    font-family: var(--font);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.player__study-cards-btn:hover:not(:disabled),
.player__study-cards-upsell:hover,
.player__unit-summary-btn:hover,
.player__unit-summary-upsell-link:hover,
.player__unit-practice-btn:hover,
.player__unit-practice-upsell-link:hover {
    color: var(--ink);
    border-color: var(--blue);
    background: var(--blue-tint);
}

.player__study-cards-btn:disabled {
    color: var(--muted);
    cursor: default;
}

.player__study-tool-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--deep-blue);
    background: var(--blue-fill);
}

/* J7 (2026-10): the shared .player__icon-wrap rule further down (inline-flex
   without justify-content) won the cascade and pinned the glyph to the left
   of its 34px box. Compound selector: the glyph is centred in its box and
   the box on the text (grid row align-items: center above). */
.player__study-tool-icon.player__icon-wrap {
    display: grid;
    place-items: center;
}

.player__study-tool-copy {
    display: block;
    min-width: 0;
}

.player__study-tool-copy strong,
.player__study-tool-copy > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player__study-tool-copy strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
}

.player__study-tool-copy > span {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

/* Small "Pro" chip — a genuine badge, not a button, so the pill radius
   reserved for chips/tags applies here. */
.player__study-tool-pro {
    padding: 2px 8px;
    border-radius: var(--r-pill);
    color: var(--deep-blue);
    background: var(--blue-fill);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
}

.player__study-cards-status,
.player__unit-summary-status,
.player__unit-practice-status {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.player__study-cards-status a,
.player__study-cards-upsell {
    color: inherit;
}

.player__unit-summary:has(.player__unit-summary-panel:not([hidden])),
.player__unit-practice:has(.player__unit-practice-panel:not([hidden])) {
    grid-column: 1 / -1;
}

.player__unit-summary-panel,
.player__unit-practice-panel {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-card);
    background: var(--blue-tint);
}

.player__unit-summary-header,
.player__unit-practice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.player__unit-summary-dismiss,
.player__unit-practice-dismiss {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--ink);
    background: var(--pl-surface);
    cursor: pointer;
}

/* EU AI Act disclosure line — shared by the practice-quiz and lesson-summary
   panels. Token-only. */
.player__unit-ai-note {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
 * Tab strip
 * -------------------------------------------------------------------------- */
.player__tabs {
    display: flex;
    gap: 20px;
    min-height: 44px;
    margin-top: 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--card-border);
    scrollbar-width: none;
}

.player__tab {
    min-width: 44px;
    padding: 8px 6px;
    border: none;
    background: none;
    font: 800 14px var(--font);
    color: var(--muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.player__tab:hover {
    color: var(--ink);
}

/* Overflow cue: player-tabs.js adds --more while tabs are cut off on the
   right. Opaque token used only for the mask's alpha channel. */
.player__tabs--more {
    mask-image: linear-gradient(to right, var(--ink) calc(100% - 32px), transparent);
}

.player__tab--active {
    color: var(--ink);
    border-bottom-color: var(--blue);
}

/* --------------------------------------------------------------------------
 * Tab panels
 * -------------------------------------------------------------------------- */
.player__tab-panels {
    min-height: 132px;
}

.player__tab-panel {
    padding: 20px 2px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.player__tab-panel--active {
    display: block;
}

.player__tab-panel[hidden] {
    display: none;
}

.player__tab-placeholder {
    max-width: 640px;
    padding: 28px 16px;
    text-align: center;
}

.player__tab-placeholder p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
 * Overview tab
 * -------------------------------------------------------------------------- */
.player__overview {
    max-width: 640px;
}

.player__overview-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
}

/* Embeds the unit text keeps (EmbedPolicy: extra Bunny videos, H5P, and
 * YouTube/Vimeo already stored before native media only …). Video players fill the column at 16:9; other embeds keep
 * their authored size but never overflow. */
.player__overview-content iframe {
    display: block;
    max-width: 100%;
    border: 0;
}

.player__overview-content :is(iframe[src*="mediadelivery.net"], iframe[src*="youtube"], iframe[src*="vimeo.com"]) {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.player__overview-empty {
    font-size: 14px;
    color: var(--muted);
}

/* Staff/author notice in place of an external video/audio player once
 * soofos_hide_external_media is on (EmbedPolicy::removed_media_notice()).
 * Learners get nothing in its place. Amber = flagged. */
.soofos-media-removed {
    display: block;
    margin: 12px 0;
    padding: 12px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    background: var(--amber-fill);
    color: var(--amber-text);
    font-size: 14px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
 * Worksheet tab
 * -------------------------------------------------------------------------- */
.player__worksheet {
    max-width: 520px;
}

.player__worksheet-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--pl-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    padding: 16px 20px;
}

.player__worksheet-icon {
    flex-shrink: 0;
}

.player__worksheet-info {
    flex: 1;
    min-width: 0;
}

.player__worksheet-title {
    font-size: 14px;
    font-weight: 900;
    color: var(--ink);
}

.player__worksheet-meta {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.player__worksheet-download {
    flex-shrink: 0;
}

.player__worksheet-note {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.player__worksheet-empty {
    font-size: 14px;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
 * Curriculum sidebar
 * -------------------------------------------------------------------------- */
.player__curriculum {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    padding: 16px 16px 12px;
}

.player__curriculum-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: var(--ink);
}

/* "Back to course page" — small outlined button (.nl), course page has the
   reviews, description and certificate. */
.player__course-back {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 4px;
    min-height: 44px;
    padding: 0 12px 0 8px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    color: var(--muted);
    background: var(--pl-surface);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.player__course-back:hover {
    color: var(--ink);
    border-color: var(--blue);
}

.player__course-back .sf-icon {
    width: 16px;
    height: 16px;
}

.player__sidebar-course {
    padding: 8px 8px 16px;
}

.player__sidebar-course-title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.25;
    color: var(--ink);
}

.player__sidebar-progress {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.player__sidebar-progress-track {
    display: block;
    height: 6px;
    margin-top: 8px;
    border-radius: 8px;
    background: var(--card-border);
    overflow: hidden;
}

.player__sidebar-progress-fill {
    display: block;
    height: 100%;
    border-radius: 8px;
    background: var(--blue);
    transition: width 0.4s ease;
}

/* L3 A + footer: quiet links, always at the bottom of the sidebar. */
.player__sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.player__sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: var(--r-card-sm);
    color: var(--muted);
    background: none;
    font: 700 14px var(--font);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

button.player__sidebar-link:hover {
    color: var(--ink);
    background: var(--pl-chapter);
}

.player__sidebar-link .sf-icon {
    width: 18px;
    height: 18px;
}

.player__sidebar-link--static {
    cursor: default;
}

/* The phone drawer carries the dark-mode switch (no room in its top bar). */
.player__sidebar-link--theme {
    display: none;
}

.player__curriculum-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.player__curriculum-chapter {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Heading wrapper only — the interactive element is the <button> inside it
   (WAI-ARIA disclosure pattern: <h3><button aria-expanded aria-controls>),
   so screen-reader heading navigation still lands on a real h3 while the
   toggle itself is a real button. Reset browser default h3 margin; the
   button below carries the actual spacing. */
.player__curriculum-chapter-heading {
    margin: 0;
}

/* The chapter disclosure toggle. Was a plain <h3> — now a <button> so the
   collapse/expand control is keyboard-operable (Enter/Space) and exposes
   aria-expanded; all the layout rules below are unchanged from the h3. */
.player__curriculum-chapter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin: 0 0 4px;
    padding: 8px 12px 8px 8px;
    border: 0;
    border-radius: var(--r-card-sm);
    background: var(--pl-chapter);
    font-family: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

/* L1 B: chapters are tinted rows (.nl) so they read as groups; the tint,
   not a bigger font, carries the hierarchy (J10). */
.player__curriculum-chapter-title:hover {
    background: var(--blue-fill);
}

.player__curriculum-chapter:first-child .player__curriculum-chapter-heading .player__curriculum-chapter-title {
    margin-top: 0;
}

.player__curriculum-chapter-chevron {
    display: inline-flex;
    flex: none;
    transform: rotate(-90deg);
    transition: transform 0.15s ease;
}

.player__curriculum-chapter-chevron .sf-icon {
    width: 16px;
    height: 16px;
}

.player__curriculum-chapter-title[aria-expanded="true"] .player__curriculum-chapter-chevron {
    transform: rotate(0deg);
}

/* Collapsed panel — author-level display:flex below (for the topics/quizzes
   list gap) has equal specificity to and would otherwise beat the UA
   [hidden]{display:none} default (author normal-priority rules always win
   over UA normal-priority ones regardless of selector specificity), so
   [hidden] must be declared explicitly here. */
.player__curriculum-chapter-panel {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player__curriculum-chapter-panel[hidden] {
    display: none;
}

/* Sentence case, not the uppercase/wide-tracking treatment
   .player__curriculum-header strong above uses for the short static
   "Course contents" label — real chapter titles are long (Dutch course
   content especially) and read as shouting in all-caps (2026-09-04,
   Klaas). Sized/weighted to still read as a group header above the
   14.5px/700 unit rows (.player__curriculum-topic-title) without the
   caps doing that work. Scoped to the title's own span (not the
   button/h3) so it doesn't inherit into the sibling
   .player__curriculum-chapter-count badge below. */
/* J10 (2026-10): same 13.5px as the unit rows; weight 800 + the row tint
   mark the chapter. */
.player__curriculum-chapter-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: var(--ink);
}

.player__curriculum-chapter-count {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.player__curriculum-topics {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.player__curriculum-topic {
    border-radius: var(--r-card-sm);
    background: transparent;
}

.player__curriculum-topic:hover {
    background: color-mix(in srgb, var(--pl-surface) 60%, transparent);
}

/* Current unit: a white raised card on the tinted sidebar (L1 B). */
.player__curriculum-topic--current,
.player__curriculum-topic--current:hover {
    background: var(--pl-surface);
    box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--card-border);
}

.player__curriculum-topic--current .player__curriculum-topic-title {
    font-weight: 800;
    color: var(--deep-blue);
}

/* Completed unit: subtle green success tint + solid check badge. */
.player__curriculum-topic--done {
    background: var(--green-fill);
}

/* Revisiting a completed unit: it is both done and current. Keep the blue
   "you are here" tint (and rail) over the green done tint. */
.player__curriculum-topic--done.player__curriculum-topic--current {
    background: var(--pl-surface);
}

.player__curriculum-topic--done .player__curriculum-topic-icon--done {
    background: var(--green);
    border-color: var(--green);
    color: var(--on-navy);
}

.player__curriculum-topic--done .player__curriculum-topic-title--done {
    font-weight: 700;
    color: var(--ink);
}

.player__curriculum-topic-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    color: inherit;
    text-decoration: none;
}

.player__curriculum-topic-link:hover .player__curriculum-topic-title {
    color: var(--deep-blue);
}

/* Fixed-size flex circle so the badge's own box is never at the mercy of
   content sizing (icon markup here is either server-rendered — check/play/
   list-checks — or swapped in client-side by player-completion.js's
   SVG_CHECK_ICON; both land as a plain <svg class="sf-icon"> child, so the
   same descendant rule below covers both). flex:none stops the badge from
   being squeezed by its row (.player__curriculum-topic-link is a flex row). */
.player__curriculum-topic-icon {
    width: 22px;
    height: 22px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--pl-surface);
}

/* soofos_icon()'s <svg> ships with width="20" height="20" HTML attributes
   (viewBox 0 0 24 24) — constrain via CSS width/height (which always beats
   presentation attributes) so it never stretches to fill/overflow the
   badge; flex:none keeps the icon itself from being stretched by the
   badge's own flex centering. */
.player__curriculum-topic-icon .sf-icon {
    width: 14px;
    height: 14px;
    flex: none;
}

.player__curriculum-topic-icon--current {
    color: var(--on-navy);
    background: var(--blue);
    border-color: var(--blue);
}

/* Solid play triangle (fill, not outline) inside the blue badge. No
   margin nudge: measured via getBoundingClientRect() on the rendered,
   stroked path (2026-09-04 audit), the un-nudged triangle's own visual
   center already sits under 0.5px from the badge's true center at this
   size — a prior "optical centering" margin-left:1px here actually
   doubled that offset (measured ~0.94px) instead of correcting it, so it
   is removed rather than tuned. */
.player__curriculum-topic-icon--current .sf-icon {
    fill: currentColor;
    stroke: none;
}

.player__curriculum-topic-icon--upcoming {
    background: var(--pl-surface);
    color: var(--faint);
}

/* Unit rows sit one step below the chapter header (14px/900 ink, above):
   14px/600, with the --current (800) and --done (700) modifiers keeping
   their emphasis. The full title is also in the link's title attribute
   because rows are clamped to two lines in drawer mode. */
.player__curriculum-topic-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
}

.player__curriculum-topic-duration {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
 * Celebration overlay
 * -------------------------------------------------------------------------- */
.player__celebration {
    /* Fixed to the viewport (not the document) and above the sticky topbar
       (z-index 50) so the aria-modal dialog dims everything behind it; it
       scrolls internally on short phones instead of growing the page. */
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--overlay);
}

/* Page scroll lock while the celebration is open (player-completion.js). */
body.player-celebration-open {
    overflow: hidden;
}

.player__celebration[hidden] {
    display: none;
}

.player__celebration-overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 16px 0;
}

/* One-shot confetti burst (course-complete variant only). Pieces are
   spawned/cleared by player-completion.js; the global reduced-motion
   rule at the bottom of this file zeroes the fall animation for
   prefers-reduced-motion, and the JS also skips spawning them entirely
   in that case. */
.player__celebration-confetti {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.player__celebration-confetti-piece {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
    animation-name: player-celebration-confetti-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}

.player__celebration-confetti-piece--blue {
    background: var(--blue);
}

.player__celebration-confetti-piece--deep-blue {
    background: var(--blue);
}

.player__celebration-confetti-piece--purple {
    background: var(--purple);
}

.player__celebration-confetti-piece--amber {
    background: var(--amber);
}

@keyframes player-celebration-confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(240px) rotate(360deg);
        opacity: 0;
    }
}

.player__celebration-modal {
    /* min-width:0 + an explicit min() width: as a grid item the modal would
       otherwise size to the Next button's min-content and overflow phones. */
    width: min(460px, calc(100% - 32px));
    min-width: 0;
    padding: 40px 42px;
    background: var(--pl-surface);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.player__celebration-emoji {
    font-size: 40px;
    line-height: 1;
}

/* Both soofos_icon() variants (streak flame / plain check) are always in
   the markup; only the one matching the server's semantic icon key is
   shown (toggled via .is-active — see parts/player/celebration.php and
   player-completion.js showCelebration()). */
.player__celebration-emoji-icon {
    display: none;
}

.player__celebration-emoji-icon.is-active {
    display: inline-flex;
}

.player__celebration-emoji-icon .sf-icon {
    width: 40px;
    height: 40px;
}

.player__celebration-emoji-icon--streak {
    color: var(--amber-text-2);
}

.player__celebration-emoji-icon--course {
    color: var(--deep-blue);
}

.player__celebration-emoji-icon--complete {
    color: var(--green);
}

.player__celebration-title {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 900;
    color: var(--ink);
}

.player__celebration-subtitle {
    margin: 8px 0 20px;
    font-size: 14px;
    color: var(--muted);
}

.player__celebration-streak {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.player__celebration-flame {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--strip);
    display: grid;
    place-items: center;
    font-size: 14px;
}

.player__celebration-flame .sf-icon {
    width: 14px;
    height: 14px;
}

.player__celebration-flame--filled {
    background: var(--amber-fill);
    color: var(--amber-text-2);
}

.player__celebration-flame--current {
    background: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-fill);
    color: var(--on-navy);
}

.player__celebration-next {
    display: flex;
    align-items: center;
    width: 100%;
    line-height: 1.3;
}

/* Two-line clamp: a long unit title must not turn the primary button into
   a text block (full title is in the link's title attribute). */
.player__celebration-next-label {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    text-align: left;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.player__celebration-next-duration {
    flex: none;
    font-weight: 700;
    opacity: 0.85;
    /* Keep "· 12m" together: without this, a long unit title wraps the flex
       row and squeezes this span, letting the separator dot break onto its
       own line away from the duration. */
    white-space: nowrap;
}

.player__celebration-next-icon {
    margin-left: auto;
    flex-shrink: 0;
}

.player__celebration-next-icon .sf-icon {
    width: 18px;
    height: 18px;
}

/* Course-complete primary CTA: leads with the review ask ("Rate this
   course") instead of the certificate link, per Klaas feedback that
   neither existing button asked for a review. Stacks the decorative
   star row above the label inside the same .btn.btn-primary.lg used
   elsewhere in the modal. */
.player__celebration-review-cta {
    flex-direction: column;
    width: 100%;
    gap: 6px;
    line-height: 1.3;
}

.player__celebration-review-stars {
    display: flex;
    gap: 4px;
}

.player__celebration-review-star {
    display: inline-flex;
    color: var(--star);
}

.player__celebration-review-star .sf-icon {
    width: 22px;
    height: 22px;
}

/* Course-complete secondary CTA: demoted from primary to a quieter
   .btn-ghost now that the review ask (above) leads. */
.player__celebration-cert-cta {
    margin-top: 10px;
}

/* J9 (2026-10): "That's enough for today" is a quiet text link so "Next"
   is the obvious choice. Still a <button> (it closes the dialog). */
.player__celebration-stop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 8px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-btn);
    color: var(--muted);
    background: none;
    font: 700 14px var(--font);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.player__celebration-stop:hover {
    color: var(--ink);
}

/* R1-D11: "You skipped N units" hint under the Next button — a quiet text
   link back to the first unfinished unit (not a warning, not a button). */
.player__celebration-skipped {
    margin: 12px 0 0;
}

.player__celebration-skipped[hidden] {
    display: none;
}

.player__celebration-skipped-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 8px;
    border-radius: var(--r-btn);
    font-size: 14px;
    font-weight: 700;
    color: var(--deep-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.player__celebration-skipped-link:hover {
    color: var(--ink);
}

.player__celebration-skipped-link:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.player__celebration-skipped-link .sf-icon {
    width: 16px;
    height: 16px;
}

/* --------------------------------------------------------------------------
 * Q&A tab
 * -------------------------------------------------------------------------- */
.player__qa {
    max-width: 640px;
}

.player__qa .player__qa-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* The shared filter pill (portal-shell.css .sf-filters, as on the Questions
   screen). That file is not loaded in the player, so the pill is repeated
   here for these chips only: round, navy when on. */
.player__qa .player__qa-filters .questions-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    box-sizing: border-box;
    min-height: 36px;
    padding: 6px 14px;
    border: 1.5px solid var(--blue-border);
    border-radius: var(--r-pill);
    background: var(--white);
    color: var(--body-2);
    font-size: 13px;
    font-weight: 800;
    line-height: 20px;
    white-space: nowrap;
    box-shadow: none;
    transform: none;
}

.player__qa .player__qa-filters .questions-filter:hover {
    border-color: var(--blue);
    color: var(--deep-blue);
}

.player__qa .player__qa-filters .questions-filter[aria-pressed="true"] {
    background: var(--player-dark);
    border-color: var(--player-dark);
    color: var(--on-navy);
}

.player__qa .player__qa-filters .questions-filter .sf-icon {
    width: 14px;
    height: 14px;
}

.player__qa-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.player__qa-empty {
    font-size: 14px;
    color: var(--muted);
}

.player__qa-item {
    border: 1px solid var(--card-border);
    border-radius: var(--r-card);
    padding: 12px 16px;
}

.player__qa-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.player__qa-item-author {
    font-size: 14px;
    font-weight: 900;
    color: var(--ink);
}

.player__qa-item-date {
    font-size: 13px;
    color: var(--muted);
}

.player__qa-item-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
}

.player__qa-item-content p {
    margin: 0 0 4px;
}

.player__qa-item-content p:last-child {
    margin-bottom: 0;
}

/* Optimistic card (player-qa.js): shown while the question is being stored
   and Sophie is answering in the background. */
.player__qa-item.is-sending {
    border-style: dashed;
}

.player__qa-answering {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player__qa-answering::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    animation: player-qa-answering 1.2s ease-in-out infinite;
}

@keyframes player-qa-answering {
    50% { opacity: .3; }
}

@media (prefers-reduced-motion: reduce) {
    .player__qa-answering::before {
        animation: none;
    }
}

.player__qa-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 900;
    color: var(--ink);
}

.player__qa-textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid var(--card-border);
    border-radius: var(--r-card);
    padding: 12px;
    font: 14px/1.5 var(--font);
    color: var(--ink);
    resize: vertical;
    outline: none;
}

.player__qa-textarea:focus {
    border-color: var(--blue);
}

.player__qa-form-actions {
    scroll-margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.player__qa-submit {
    min-height: 44px;
}

.player__qa-form-status {
    font-size: 14px;
    color: var(--muted);
}

.player__qa-form-status.is-error,
.player__notes-status.is-error {
    color: var(--error);
    font-weight: 700;
}

.player__qa-textarea::placeholder,
.player__notes-input::placeholder {
    color: var(--muted);
    opacity: 1;
}

.player__qa-textarea[aria-invalid="true"] {
    border-color: var(--error);
}

/* Q&A badges/upvote come from the shared questions.css at 10.5px; raise
   them to the 12px floor inside the player only. */
.player__qa .question-card__badge,
.player__qa .question-card__upvote {
    font-size: 13px;
}

.player__qa .question-card__upvote:not(.is-on) {
    color: var(--muted);
}

/* Sophie's "waiting" note: questions.css sets --muted-2 at 11.5px (3.5:1).
   Player-scoped because that file is shared with the Questions screen. */
.player__qa .question-card__note {
    color: var(--muted);
    font-size: 13px;
}

/* Filter with no matching question (player-qa.js toggles [hidden]); the
   chips themselves are hidden while the unit has no questions at all. */
.player__qa-filter-empty {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--muted);
}

.player__qa-filter-empty[hidden],
.player__qa .player__qa-filters[hidden] {
    display: none;
}

/* R1-D12: "Ask a question" jump link above the list — moves to (and
   focuses) the ask form at the bottom of the panel. */
.player__qa-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-bottom: 8px;
    padding: 0 4px;
    border-radius: var(--r-btn);
    font-size: 14px;
    font-weight: 700;
    color: var(--deep-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.player__qa-jump:hover {
    color: var(--ink);
}

.player__qa-jump:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.player__qa-jump .sf-icon {
    width: 16px;
    height: 16px;
}

.player__qa-login-prompt {
    font-size: 14px;
    color: var(--muted);
}

.player__qa-login-prompt a {
    color: var(--deep-blue);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
 * Notes tab — add-note bar + note list
 * -------------------------------------------------------------------------- */
.player__notes {
    max-width: 640px;
}

.player__notes-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--pl-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    padding: 8px 12px;
}

/* Visible focus for the borderless note input: the whole bar takes the
   focus ring (the input's own outline would sit inside the bar). */
.player__notes-form:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-fill);
}

.player .player__notes-form .player__notes-input:focus-visible {
    outline: none;
}

.player__notes-form:has(.player__notes-input[aria-invalid="true"]) {
    border-color: var(--error);
}

.player__notes-submit {
    min-height: 44px;
}

/* A genuine timestamp chip — pill radius is appropriate here. */
.player__notes-moment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--blue-fill);
    color: var(--deep-blue);
    font-size: 13px;
    font-weight: 900;
}

/* The author-level inline-flex above beats the UA [hidden] rule, which
   showed a "0:00" chip on units without a video. */
.player__notes-moment[hidden] {
    display: none;
}

.player__notes-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font: 14px var(--font);
    color: var(--ink);
}

.player__notes-hint {
    margin: 8px 0 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.player__notes-hint a {
    color: var(--deep-blue);
    font-weight: 800;
    text-decoration: none;
}

.player__notes-hint a .sf-icon {
    width: 12px;
    height: 12px;
}

/* Sits directly under the add-note bar (above the hint) so the required /
   error message is next to the field, not under the on-screen keyboard. */
.player__notes-status {
    display: block;
    margin-top: 0;
    font-size: 13px;
    color: var(--muted);
}

.player__notes-status:not(:empty) {
    margin-top: 8px;
}

.player__notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player__notes-empty {
    font-size: 14px;
    color: var(--muted);
}

.player__note {
    background: var(--pl-surface);
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    padding: 12px 16px;
}

.player__note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.player__note-time {
    padding: 0;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 900;
    color: var(--deep-blue);
    cursor: pointer;
}

.player__note-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

/* The separator dot only exists between the timestamp chip and the date;
   notes without a video moment start with the date. */
.player__note-time + .player__note-date::before {
    content: "\00b7\00a0";
}

.player__note-actions {
    margin-left: auto;
    display: inline-flex;
    gap: 4px;
}

.player__note-btn {
    position: relative;
    padding: 4px 10px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--pl-surface);
    font: 800 13px var(--font);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

/* Invisible tap-target expansion to >=44px without inflating the visible
   chip (which stays small by design inside the note action row). */
.player__note-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max(44px, 100%);
    height: max(44px, 100%);
}

.player__note-btn:hover {
    border-color: var(--blue);
    color: var(--deep-blue);
}

.player__note-btn--card {
    color: var(--deep-blue);
    border-color: var(--blue);
}

.player__note-btn--card.is-carded {
    color: var(--green);
    border-color: var(--green);
    cursor: default;
}

.player__note-content {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
    white-space: pre-wrap;
}

.player__note-editbox {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.player__note-editbox .player__note-btn {
    min-height: 36px;
    padding: 6px 14px;
}

.player__note-editarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    padding: 8px;
    font: 14px/1.5 var(--font);
    color: var(--ink);
    resize: vertical;
    outline: none;
}

.player__note-editarea:focus {
    border-color: var(--blue);
}

.player__note-btn--save {
    color: var(--on-navy);
    background: var(--blue);
    border-color: var(--blue);
}

/* Visually hidden, screen-reader accessible label (add-note input) and
   generic screen-reader-only text throughout the player. */
.player .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
 * Icon wrapper — inline SVG icons (Calm Workspace)
 * -------------------------------------------------------------------------- */
.player__icon-wrap {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
 * Practice quiz option buttons
 * -------------------------------------------------------------------------- */
.player__unit-practice-option-btn {
    width: 100%;
    margin-bottom: 4px;
    padding: 8px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    background: var(--pl-surface);
    font: 700 14px var(--font);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.player__unit-practice-option-btn--correct {
    background: var(--green-fill);
    border-color: var(--green);
    color: var(--green);
}

.player__unit-practice-option-btn--incorrect {
    background: color-mix(in srgb, var(--error) 10%, transparent);
    border-color: var(--error);
    color: var(--error);
}

/* Feedback row: soofos_icon('check')/('x') swapped in for the old ✓/✗
   glyphs — icon inherits color from these semantic-color modifiers. */
.player__unit-practice-result {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    font: 800 14px var(--font);
}

.player__unit-practice-result .sf-icon {
    width: 16px;
    height: 16px;
}

.player__unit-practice-result--correct {
    color: var(--green);
}

.player__unit-practice-result--incorrect {
    color: var(--error);
}

.player__unit-practice-moment-link .sf-icon {
    width: 14px;
    height: 14px;
}

.player :is(a, button, textarea, input):focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * Responsive
 * -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
 * "Ask about this lesson" (L4 A + L5 B) — parts/player/ask.php
 * -------------------------------------------------------------------------- */
.player__ask {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    background: var(--blue-tint);
}

.player__ask-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
}

.player__ask-title .sf-icon {
    width: 18px;
    height: 18px;
    color: var(--deep-blue);
}

.player__ask-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player__ask-form[hidden],
.player__ask-limit[hidden] {
    display: none;
}

.player__ask-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    color: var(--ink);
    background: var(--pl-surface);
    font: 600 14px var(--font);
}

.player__ask-input::placeholder {
    color: var(--muted-2);
}

.player__ask-input:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
}

.player__ask-input[aria-invalid="true"] {
    border-color: var(--red-ink);
}

.player__ask-quota {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.player__ask-submit {
    flex: none;
    min-height: 44px;
}

.player__ask-note {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.player__ask-status {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.player__ask-status:empty {
    display: none;
}

/* --------------------------------------------------------------------------
 * Course rating (L3) — parts/player/review.php
 * -------------------------------------------------------------------------- */
.player__review-prompt {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 20px;
    margin-top: 24px;
    padding: 16px 20px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    background: var(--pl-surface);
    box-shadow: var(--shadow-soft);
}

.player__review-prompt[hidden] {
    display: none;
}

.player__review-prompt-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
}

.player__review-prompt-text {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.player__review-prompt-stars {
    display: flex;
    gap: 2px;
}

.player__review-prompt-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-btn);
    color: var(--muted-2);
    background: none;
    cursor: pointer;
}

/* Outline stars (3:1 non-text contrast); hovering one fills it and every
   star before it. */
.player__review-prompt-star .sf-icon {
    width: 26px;
    height: 26px;
    fill: none;
}

.player__review-prompt-stars:hover .player__review-prompt-star,
.player__review-prompt-star:focus-visible {
    color: var(--star);
}

.player__review-prompt-stars:hover .player__review-prompt-star .sf-icon,
.player__review-prompt-star:focus-visible .sf-icon {
    fill: currentColor;
}

.player__review-prompt-stars .player__review-prompt-star:hover ~ .player__review-prompt-star {
    color: var(--muted-2);
}

.player__review-prompt-stars .player__review-prompt-star:hover ~ .player__review-prompt-star .sf-icon {
    fill: none;
}

.player__review-prompt-dismiss {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 44px;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: none;
    font: 700 14px var(--font);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.player__review-prompt-dismiss:hover {
    color: var(--ink);
}

.player__review-thanks {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 0;
    padding: 12px 16px;
    border-radius: var(--r-card-sm);
    color: var(--green-ink);
    background: var(--green-fill);
    font-size: 14px;
    font-weight: 700;
}

/* Native <dialog>: top layer, so it always sits above the top bar. */
.player__review-dialog {
    width: min(520px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    padding: 24px;
    border: 0;
    border-radius: var(--r-card);
    color: var(--ink);
    background: var(--pl-surface);
    box-shadow: var(--shadow-card);
}

.player__review-dialog::backdrop {
    background: var(--overlay);
}

.player__review-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.player__review-dialog-title {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
}

.player__review-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--r-btn);
    color: var(--muted);
    background: none;
    cursor: pointer;
}

.player__review-dialog-close:hover {
    color: var(--ink);
    background: var(--blue-tint);
}

.player__review-dialog-text {
    margin: 8px 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}

.player__review-form .comment-respond,
.player__review-form form {
    margin: 0;
}

/* Stars first, then the text (the ACF field renders after the textarea). */
.player__review-form .comment-form {
    display: flex;
    flex-direction: column;
}

.player__review-form .acf-comment-fields {
    order: -1;
}

.player__review-form .acf-field,
.player__review-form .acf-comment-fields {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
}

.player__review-form .acf-label label {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
}

.player__review-field {
    margin: 0 0 12px;
}

.player__review-field textarea {
    width: 100%;
    min-height: 96px;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-btn);
    color: var(--ink);
    background: var(--pl-surface);
    font: 600 14px/1.5 var(--font);
    resize: vertical;
}

.player__review-field textarea:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
}

.player__review-form .form-submit {
    margin: 0;
}

/* Star picker (soofos-portal LearnDashRatingsField::render_field()), same
   CSS-only technique as certificates.css on /course-complete/. */
.player .soofos-learndash-ratings-input-container {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 2px;
}

.player .soofos-learndash-ratings-input-container input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.player .soofos-learndash-ratings-input-container label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 0;
    line-height: 0;
    color: var(--muted-2);
    cursor: pointer;
}

.player .soofos-learndash-ratings-input-container label::before {
    content: "\2605";
    font-size: 30px;
    line-height: 1;
}

.player .soofos-learndash-ratings-input-container input:checked ~ label,
.player .soofos-learndash-ratings-input-container label:hover,
.player .soofos-learndash-ratings-input-container label:hover ~ label {
    color: var(--star);
}

.player .soofos-learndash-ratings-input-container input:focus-visible + label {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
    border-radius: var(--r-btn);
}

@media (max-width: 65.625rem) {
    /* No topbar/sidebar width override needed here anymore: the base
       268px (matching .portal__sidebar) is already narrower than the old
       310px this breakpoint used to squeeze down to. */
    .player__study-tools {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 56.25rem) {
    /* Drawer mode: no sidebar collapse or fullscreen (phones/tablets use
       the drawer and the OS); the drawer footer carries the dark switch. */
    .player__sidebar-toggle,
    .player__fullscreen-toggle {
        display: none;
    }

    .player__sidebar-link--theme {
        display: flex;
    }

    .player__topbar {
        gap: 8px;
        height: 60px;
        padding: 0 16px;
    }

    .player__origin {
        gap: 8px;
    }

    /* Visually hidden, not display:none: the label is the back link's
       only accessible name (the chevron is aria-hidden). Shown again on
       tablets in the 37.5rem block below. */
    .player__back-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .player__streak {
        display: none;
    }

    .player__back {
        position: relative;
        min-width: 44px;
        justify-content: center;
        padding: 0;
        border-left: 0;
    }

    .player__avatar {
        width: 44px;
        height: 44px;
    }

    .player__course-title {
        font-size: 13px;
    }

    .player__progress {
        gap: 4px;
    }

    .player__progress-track {
        max-width: 100px;
    }

    .player__utilities {
        gap: 4px;
    }

    .player__curriculum-open--header,
    .player__curriculum-open--content,
    .player__curriculum-close {
        display: inline-flex;
    }

    .player__content {
        display: block;
        min-height: calc(100vh - 60px);
        min-height: calc(100dvh - 60px);
    }

    /* Two-line clamp in the drawer; the full title is in the title attr. */
    .player__curriculum-topic-title {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .player__sidebar {
        width: min(88vw, 340px);
        min-width: 0;
        max-width: none;
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px);
        position: fixed;
        top: 60px;
        bottom: 0;
        left: 0;
        z-index: 90;
        visibility: hidden;
        transform: translateX(-105%);
        transition: transform 0.2s ease, visibility 0s linear 0.2s;
        box-shadow: var(--shadow-card);
    }

    /* Admin-bar offset for the mobile fixed drawer — topbar is 60px tall
       in this breakpoint, so the drawer starts below topbar + admin bar. */
    body.admin-bar .player__sidebar {
        top: calc(60px + 32px);
        height: calc(100vh - 60px - 32px);
        height: calc(100dvh - 60px - 32px);
    }

    .player__sidebar.is-open {
        visibility: visible;
        transform: translateX(0);
        transition-delay: 0s;
    }

    .player__curriculum-scrim:not([hidden]) {
        display: block;
        position: fixed;
        inset: 60px 0 0;
        z-index: 80;
        border: 0;
        background: var(--overlay);
    }

    /* Admin-bar offset: the scrim's z-index (80) sits above the topbar's
       (50), so without this it would dim the strip of topbar pushed down
       by the admin bar. */
    body.admin-bar .player__curriculum-scrim:not([hidden]) {
        inset: calc(60px + 32px) 0 0;
    }

    .soofos-player.player-curriculum-open {
        overflow: hidden;
    }

    .player__video-panel {
        width: 100%;
        padding: 12px 12px 48px;
    }

    .player__video {
        border-radius: 8px;
    }

    .player__curriculum-open--content {
        width: 100%;
        margin-top: 12px;
        gap: 8px;
    }

    .player__lesson-meta {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px 0;
    }

    .player__study-tools {
        grid-template-columns: 1fr;
    }

    .player__study-cards-btn,
    .player__study-cards-upsell,
    .player__unit-summary-btn,
    .player__unit-summary-upsell-link,
    .player__unit-practice-btn,
    .player__unit-practice-upsell-link {
        min-height: 60px;
    }

    .player__tabs {
        gap: 12px;
    }

    /* Notes: input gets its own full row (16px: no iOS focus zoom), the
       moment chip + Save sit below it. */
    .player__notes-form {
        flex-wrap: wrap;
        padding: 8px;
    }

    .player__notes-input {
        flex: 1 1 100%;
        order: -1;
        min-height: 44px;
        padding: 0 4px;
        font-size: 16px;
    }

    .player__notes-submit {
        margin-left: auto;
    }

    .player__qa-textarea {
        font-size: 16px;
    }

    /* Eyebrow: chapter name in sentence case (long names in tracked capitals
       are slow to read) and without the "Unit N of M" suffix — the "Course
       contents · Unit N of M" button right above already shows the position,
       and the h1 below carries the unit's own number. */
    .player__chapter-label {
        font-size: 14px;
        letter-spacing: 0;
        text-transform: none;
    }

    .player__chapter-label-pos {
        display: none;
    }

    /* Q&A status chips: one horizontally scrolling row instead of three
       wrapped rows. Scoped to the player (questions.css is shared with the
       Questions screen). The end padding keeps the fade over empty space
       once the row is scrolled to its end. */
    /* .player__qa prefix: questions.css (.questions-filters) loads after
       this file with equal specificity. */
    .player__qa .player__qa-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-bottom: 12px;
        padding-inline-end: 32px;
        scrollbar-width: none;
        mask-image: linear-gradient(to right, var(--ink) calc(100% - 32px), transparent);
    }

    .player__qa .player__qa-filters::-webkit-scrollbar {
        display: none;
    }

    .player__qa-filters .questions-filter {
        flex: none;
        min-height: 44px;
        font-size: 13px;
    }

}

/* Phones (<=480px): the 60px bar has to fit logo, back, course, progress,
   avatar and the contents toggle. Crop the wordmark to its round mark
   (link + aria-label unchanged), keep the course title on one line and put
   the progress label under its track so it never runs under the avatar. */
@media (max-width: 30rem) {
    .player__brand {
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    .player__brand-logo {
        width: 40px;
        height: 40px;
    }

    .player__brand-logo img {
        width: auto;
        max-width: none;
        height: 40px;
    }

    .player__origin {
        gap: 4px;
    }

    .player__progress {
        flex-wrap: wrap;
        row-gap: 2px;
        margin-top: 2px;
    }

    .player__progress-track {
        flex: 1 1 100%;
        max-width: none;
    }

    .player__progress-label {
        flex: 1 1 100%;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
    }

    .player__celebration-modal {
        padding: 28px 20px;
    }
}

/* Phones (<600px): M5-r2-10 / M5-r2-14 phone rules. */
@media not all and (min-width: 37.5rem) {
    /* Phones: the dark switch lives in the course-contents drawer. */
    .player__topbar .player__theme-toggle {
        display: none;
    }

    .player__ask-form {
        flex-wrap: wrap;
    }

    .player__ask-input {
        flex: 1 1 100%;
        font-size: 16px;
    }

    .player__ask-submit {
        margin-left: auto;
    }

    .player__review-prompt {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .player__qa-textarea {
        min-height: 76px;
    }

    /* Next unit button: title on two lines max, duration on its own line
       under it, arrow at the right. */
    .player__celebration-modal .player__celebration-next {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 12px;
        text-align: left;
    }

    .player__celebration-modal .player__celebration-next-label {
        grid-column: 1;
        grid-row: 1;
    }

    .player__celebration-modal .player__celebration-next-duration {
        grid-column: 1;
        grid-row: 2;
    }

    .player__celebration-modal .player__celebration-next-icon {
        grid-column: 2;
        grid-row: 1 / span 2;
        margin-left: 0;
    }
}

/* Tablet portrait (600-900px): still the drawer layout, but there is room
   for the back label, the streak chip (from 768) and the desktop-style
   title + Mark complete row instead of phone-width stretched bars. */
@media (min-width: 37.5rem) and (max-width: 56.25rem) {
    .player__back-label {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        clip-path: none;
    }

    .player__back {
        padding: 0 8px;
    }

    .player__video-panel {
        padding: 20px 24px 48px;
    }

    .player__curriculum-open--content {
        width: auto;
        justify-content: flex-start;
        padding: 8px 16px;
    }

    .player__lesson-meta {
        display: flex;
        gap: 20px;
    }

    .player__qa .player__qa-filters {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-inline-end: 0;
        mask-image: none;
    }
}

@media (min-width: 48rem) and (max-width: 56.25rem) {
    .player__streak {
        display: flex;
    }
}

/* WP core switches #wpadminbar from 32px to 46px tall below 783px
   viewports — this query mirrors that exact breakpoint (782px = "below
   783px"). Still inside the 56.25rem (900px) mobile-topbar regime, so the
   topbar is still 60px here; only the admin-bar height itself changes. */
@media (max-width: 782px) {
    body.admin-bar .player__topbar {
        top: 46px;
    }

    body.admin-bar .player__sidebar {
        top: calc(60px + 46px);
        height: calc(100vh - 60px - 46px);
        height: calc(100dvh - 60px - 46px);
    }

    body.admin-bar .player__curriculum-scrim:not([hidden]) {
        inset: calc(60px + 46px) 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .player *,
    .player *::before,
    .player *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* --------------------------------------------------------------------------
 * Lesson bar (16 Nov 2026): Previous lesson · Complete · Complete & continue
 * (open lesson) or Previous lesson · Completed · Next lesson (done lesson).
 * The last child of the lesson column: sticks to the bottom of the screen
 * while the lesson scrolls and rests at the end of the content, so it never
 * hides the last lines. The completion line ("Lesson completed · +N XP") and
 * a failed-save message show on top of the buttons, inside the bar.
 * .player__lesson-bar .btn: beats components.css, which loads after this file.
 * -------------------------------------------------------------------------- */
.player__video-panel:has(> .player__lesson-bar) {
    padding-bottom: 0;
}

.player__lesson-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 28px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--card-border);
    background: var(--pl-surface);
    box-shadow: 0 -10px 18px -16px color-mix(in srgb, var(--ink) 35%, transparent);
}

.player__lesson-bar [hidden] {
    display: none !important;
}

.player__lesson-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player__lesson-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.player__lesson-bar .btn {
    min-height: 44px;
    gap: 8px;
    white-space: nowrap;
}

.player__lesson-bar .btn[disabled] {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.player__lesson-bar .btn[aria-busy="true"] {
    opacity: 1;
    cursor: progress;
}

/* "Completed": a state, not a control. Green = completion. */
.player__lesson-bar-done {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--green);
    border-radius: var(--r-btn);
    color: var(--ink);
    background: var(--green-fill);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.player__lesson-bar-done .player__icon-wrap {
    color: var(--green-ink);
}

/* In-place lesson change (player-nav.js): the lesson column dims while the
   next lesson loads; the course contents stay as they are. */
.player__video-panel {
    transition: opacity 0.15s ease;
}

.player.is-navigating .player__video-panel {
    opacity: 0.55;
    cursor: progress;
}

/* Phones: the previous-lesson button shrinks to its arrow (the label stays
   for screen readers) so the two actions share one row; when even that does
   not fit, "Complete & continue" takes the full width above the others. */
@media not all and (min-width: 37.5rem) {
    .player__lesson-bar {
        margin-top: 20px;
        padding-top: 10px;
    }

    .player__lesson-bar-row,
    .player__lesson-bar-actions {
        gap: 8px;
    }

    .player__lesson-bar-actions {
        flex: 1 1 auto;
        flex-wrap: wrap-reverse;
        justify-content: flex-end;
        min-width: 0;
    }

    .player__lesson-bar .player__lesson-bar-prev {
        flex: 0 0 auto;
        width: 44px;
        padding: 0;
        justify-content: center;
    }

    .player__lesson-bar-prev-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .player__lesson-bar .player__lesson-bar-complete,
    .player__lesson-bar .player__lesson-bar-continue,
    .player__lesson-bar .player__lesson-bar-next {
        flex: 1 1 auto;
        justify-content: center;
        padding-inline: 14px;
    }
}

/* --------------------------------------------------------------------------
 * Attachments ("Bijlagen") at the end of the Content tab
 * (parts/player/attachments.php).
 * -------------------------------------------------------------------------- */
.player__attachments {
    margin-top: 28px;
}

.player__attachments:first-child {
    margin-top: 0;
}

.player__attachments-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 900;
    color: var(--ink);
}

.player__attachments-title .player__icon-wrap {
    color: var(--deep-blue);
}

.player__attachments-count {
    padding: 2px 8px;
    border-radius: var(--r-pill);
    color: var(--deep-blue);
    background: var(--blue-fill);
    font-size: 12px;
    font-weight: 800;
}

.player__attachments-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.player__attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    background: var(--pl-surface);
}

.player__attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--r-btn);
    color: var(--deep-blue);
    background: var(--blue-fill);
}

.player__attachment-info {
    flex: 1;
    min-width: 0;
}

.player__attachment-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.player__attachment-meta {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.player__attachment-notes {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.player__attachment-notes > :first-child {
    margin-top: 0;
}

.player__attachment-notes > :last-child {
    margin-bottom: 0;
}

.player__attachment .player__attachment-open {
    flex-shrink: 0;
    min-height: 44px;
}

@media not all and (min-width: 37.5rem) {
    .player__attachment {
        flex-wrap: wrap;
    }

    .player__attachment .player__attachment-open {
        flex: 1 1 100%;
        justify-content: center;
    }
}

/* --------------------------------------------------------------------------
 * About this lesson tab (parts/player/tab-about.php): the lesson's facts.
 * -------------------------------------------------------------------------- */
.player__about {
    display: grid;
    max-width: 640px;
    margin: 0;
    border: 1px solid var(--card-border);
    border-radius: var(--r-card-sm);
    background: var(--pl-surface);
}

.player__about-row {
    display: grid;
    grid-template-columns: minmax(96px, 30%) 1fr;
    gap: 12px;
    padding: 12px 16px;
}

.player__about-row + .player__about-row {
    border-top: 1px solid var(--card-border);
}

.player__about dt {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.player__about dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.player__about dd a {
    color: var(--deep-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
 * Calm lesson column (browser pass, 16 Nov 2026).
 * One left edge for the title, the tab labels and the tab content; one
 * hairline (under the tabs) instead of three stacked ones; one reading
 * measure in every tab; equal heights in the lesson bar.
 * -------------------------------------------------------------------------- */
.player__lesson-meta {
    padding: 24px 0 0;
    border-bottom: 0;
}

.player__study-tools {
    padding: 16px 0 0;
    border-bottom: 0;
}

.player__tabs {
    gap: 28px;
    margin-top: 20px;
}

.player__tab {
    padding-inline: 0;
}

.player__tab-panel {
    padding-inline: 0;
}

.player__attachments,
.player__transcript {
    max-width: 640px;
}

.player__lesson-bar .btn,
.player__lesson-bar-done {
    box-sizing: border-box;
    height: 44px;
    min-height: 44px;
}

@media (max-width: 56.25rem) {
    .player__lesson-meta {
        padding-top: 20px;
    }

    .player__tabs {
        gap: 20px;
    }
}

/* Notes hint: "View all notes →" never leaves its arrow alone on a line. */
.player__notes-hint a {
    white-space: nowrap;
}

/* Lesson bar on phones: one row (arrow · Complete · Complete & continue).
   The two labels fit a 360px screen without their icons; only narrower
   screens fall back to two rows. */
@media not all and (min-width: 37.5rem) {
    .player__lesson-bar .player__lesson-bar-complete .player__icon-wrap,
    .player__lesson-bar .player__lesson-bar-continue .player__icon-wrap {
        display: none;
    }

    .player__lesson-bar .player__lesson-bar-complete,
    .player__lesson-bar .player__lesson-bar-continue,
    .player__lesson-bar .player__lesson-bar-next {
        padding-inline: 12px;
    }

    .player__lesson-bar .player__lesson-bar-complete:not(:only-child),
    .player__lesson-bar .player__lesson-bar-done {
        flex: 0 1 auto;
    }
}

/* --------------------------------------------------------------------------
 * Plus Pro pop-up (parts/player/pro-upsell.php, player-upsell.js): opened by
 * the locked study tools so the learner stays in the lesson. A native
 * <dialog>; the plan box inside is styled by pro-landing.css. Tokens only.
 * -------------------------------------------------------------------------- */
.player__upsell {
    width: min(460px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 0;
    border-radius: var(--r-card);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow-pop);
    overflow: hidden auto;
    overscroll-behavior: contain;
}

.player__upsell::backdrop {
    background: var(--overlay);
}

.player__upsell[open] {
    animation: player-upsell-in .18s ease-out;
}

@keyframes player-upsell-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
}

@media (prefers-reduced-motion: reduce) {
    .player__upsell[open] {
        animation: none;
    }
}

.player__upsell-head {
    position: relative;
    padding: 20px 24px 18px;
    background: linear-gradient(160deg, var(--blue-fill), var(--white) 85%);
    border-bottom: 1px solid var(--card-border);
}

.player__upsell-plan {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    background: var(--player-dark);
    color: var(--on-navy);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
}

.player__upsell-plan .sf-icon {
    width: 13px;
    height: 13px;
}

.player__upsell-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.player__upsell-close:hover {
    background: var(--white);
    color: var(--ink);
}

.player__upsell-close:focus-visible {
    outline: 2px solid var(--deep-blue);
    outline-offset: -4px;
}

.player__upsell-tool {
    margin-top: 16px;
}

.player__upsell-tool[hidden] {
    display: none;
}

.player__upsell-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: var(--blue);
    color: var(--on-navy);
}

.player__upsell-icon .sf-icon {
    width: 24px;
    height: 24px;
}

.player__upsell-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--ink);
}

.player__upsell-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--body-2);
}

.player__upsell-body {
    padding: 18px 24px 20px;
}

.player__upsell-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}

.player__upsell-list {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--body-2);
}

.player__upsell-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.player__upsell-list li.is-current {
    color: var(--ink);
    font-weight: 900;
}

.player__upsell-tick {
    flex: none;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--green-fill);
    color: var(--green-ink);
}

.player__upsell-tick .sf-icon {
    width: 12px;
    height: 12px;
}

.player__upsell .coach-planbox,
.player__upsell .pro-landing__team-note {
    margin: 0 0 14px;
}

.player__upsell .coach-planbox__go {
    width: 100%;
    justify-content: center;
}

.player__upsell-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.player__upsell-more {
    font-size: 13px;
    font-weight: 800;
    color: var(--deep-blue);
}

/* The plan box is a card on the sales page; inside the pop-up it is a quiet
   bordered block with a full-width buy button. */
.player__upsell .coach-planbox {
    padding: 14px 16px;
    box-shadow: none;
}

.player__upsell .coach-planbox__go {
    align-self: stretch;
}
