/* css/podcasts.css — the Podcast section.
   Built from the app's design tokens only (--bg/--surface/--border/--accent/
   --text*), so all five themes and the admin design settings apply without
   any per-theme rules here. The activity panels get their look from
   css/activity.css; this file owns the library, the player, the transcript
   and the printable worksheet. */

.tool-body { max-width: 940px; }

/* ── Gamified Pilot Spotlight Banner ─────────────────────────────────────── */
.pilot-banner-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding: .9rem 1.35rem;
    margin-bottom: 1.5rem;
}
.pilot-banner-content {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.pilot-spark-tag {
    font-size: .7rem;
    font-weight: 800;
    color: var(--accent-text);
    letter-spacing: .5px;
    text-transform: uppercase;
}
.pilot-banner-content strong {
    font-size: 1.05rem;
    color: var(--text);
    font-family: var(--font-display);
}
.pilot-banner-desc {
    font-size: .82rem;
    color: var(--text-muted);
}
/* ── Library ────────────────────────────────────────────────────────────── */
.pod-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.4rem; }

/* Free-text search over title / topic / level / category / speakers. Sits above
   the chip rows; typing narrows both the cards and every chip's count. */
.pod-search {
    display: flex; align-items: center; gap: .55rem;
    max-width: 30rem; margin-bottom: 1rem;
    padding: .1rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    transition: border-color .15s;
}
.pod-search:focus-within { border-color: var(--accent); }
.pod-search-icon { font-size: .9rem; opacity: .7; line-height: 1; }
.pod-search-input {
    flex: 1; min-width: 0;
    font-family: var(--font-body); font-size: .9rem;
    padding: .5rem 0;
    border: none; background: transparent; color: var(--text);
    outline: none;
}
.pod-search-input::placeholder { color: var(--text-dim); }
/* Hide the browser's own clear glyph — we render our own for every theme. */
.pod-search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.pod-search-clear {
    flex: none;
    font-size: 1.2rem; line-height: 1;
    width: 1.5rem; height: 1.5rem;
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 99px;
    background: var(--accent-soft); color: var(--accent-text);
    cursor: pointer;
}
.pod-search-clear:hover { background: var(--accent); color: var(--accent-ink); }
.pod-search-clear[hidden] { display: none; }

#podCats { margin-bottom: .6rem; }
#podCats[hidden] { display: none; }
.pod-chip-n { font-size: .68rem; }

.pod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 1.1rem; }

/* Pager — the library is 189 episodes, so it pages (M437). */
.pod-pager { margin-top: 1.6rem; display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.pod-pager-count { font-family: var(--font-body); font-size: .8rem; color: var(--text-muted); margin: 0; }
.pod-pager-count strong { color: var(--text); }
.pod-pager-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem; }
.pod-pager-n, .pod-pager-step {
    font-family: var(--font-body);
    font-size: .8rem; font-weight: 700;
    min-width: 2.1rem;
    padding: .35rem .7rem;
    border-radius: 99px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.pod-pager-n:hover:not(.active), .pod-pager-step:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.pod-pager-n.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); cursor: default; }
.pod-pager-step:disabled { opacity: .35; cursor: default; }
.pod-pager-gap { color: var(--text-muted); padding: 0 .15rem; user-select: none; }
@media (max-width: 480px) {
    /* Prev/Next carry the phone; the numbers stay for orientation. */
    .pod-pager-n, .pod-pager-step { padding: .3rem .55rem; min-width: 1.9rem; }
}
.pod-card {
    position: relative;
    display: flex; flex-direction: column;
    text-align: left;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    padding: 1.15rem;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s, transform .15s, box-shadow .2s;
}
.pod-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
/* A thin level stripe down the left edge — it makes a mixed-level grid
   scannable without adding another badge to every card. */
.pod-card::before {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
    background: var(--accent); opacity: .85;
}
.pod-card.lvl-A1::before { background: #3fb950; }
.pod-card.lvl-A2::before { background: #58a6ff; }
.pod-card.lvl-B1::before { background: #f0a500; }
.pod-card.lvl-B2::before { background: #d29922; }
.pod-card.lvl-C1::before { background: #f85149; }
.pod-card.lvl-C2::before { background: #a371f7; }
.pod-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.pod-card-emoji { font-size: 1.7rem; line-height: 1; }
.pod-card-title { font-family: var(--font-display); font-size: 1.06rem; font-weight: 800; line-height: 1.3; margin-bottom: .2rem; }
.pod-card-en { font-size: .78rem; color: var(--text-dim); font-style: italic; margin-bottom: .55rem; }
.pod-card-blurb { font-size: .82rem; line-height: 1.55; color: var(--text-muted); flex: 1; }
.pod-card-foot { display: flex; justify-content: space-between; gap: .6rem; margin-top: .9rem; font-size: .72rem; color: var(--text-dim); }
.pod-card-topic { font-weight: 600; }
.pod-card-prog { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--border); }
.pod-done { font-size: .68rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); }
.pod-empty { color: var(--text-dim); font-size: .9rem; padding: 2rem 0; }

/* Natural-pace episodes (M399) */
.pod-natural { display: inline-block; margin-top: .5rem; padding: .12rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 700; background: rgba(163,113,247,.14); color: #b58cf9; }
/* #a371f7 measured 4.1-4.3:1 on the dark cards; the light themes need a deep violet. */
[data-theme="light"] .pod-natural, [data-theme="paper"] .pod-natural, [data-theme="app"] .pod-natural { color: #6a3dc4; }
.pod-line.cont .pod-speaker { visibility: hidden; }
.pod-line.cont { margin-top: -.35rem; }
.pod-pace-lbl { align-self: center; font-size: .7rem; font-weight: 700; color: var(--text-dim); margin-right: .15rem; }
.pod-idioms-h { margin: 1.2rem 0 .3rem; font-size: .95rem; }
.pod-idioms-h span { font-weight: 400; font-size: .78rem; color: var(--text-dim); }

/* ── Episode header ─────────────────────────────────────────────────────── */
.pod-back {
    font-family: var(--font-body); font-size: .82rem; font-weight: 600;
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: .3rem 0; margin-bottom: 1rem;
}
.pod-back:hover { color: var(--accent-text); }
.pod-ep-head { display: flex; gap: 1.1rem; align-items: flex-start; margin-bottom: 1.3rem; }
.pod-ep-emoji { font-size: 2.8rem; line-height: 1; flex: none; }
.pod-ep-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.pod-topic, .pod-mins { font-size: .72rem; color: var(--text-dim); font-weight: 600; }
.pod-ep-meta h2 { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; margin-bottom: .3rem; }
.pod-ep-meta p { font-size: .86rem; color: var(--text-muted); line-height: 1.6; }
.pod-focus { font-size: .78rem !important; color: var(--accent-text) !important; margin-top: .4rem; font-weight: 600; }

/* ── Player ─────────────────────────────────────────────────────────────── */
.pod-player {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    padding: 1rem 1.15rem;
    margin-bottom: 1.2rem;
    position: sticky; top: .5rem; z-index: 5;
}
.pod-controls { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pod-play {
    flex: none; width: 44px; height: 44px;
    border-radius: 50%; border: none;
    background: var(--accent); color: var(--accent-ink);
    font-size: 1rem; cursor: pointer;
    display: grid; place-items: center;
    transition: filter .15s;
}
.pod-play:hover { filter: brightness(1.1); }
.pod-seek-wrap { flex: 1; min-width: 180px; }
.pod-seek {
    width: 100%; height: 5px; -webkit-appearance: none; appearance: none;
    background: var(--border); border-radius: 99px; cursor: pointer; outline: none;
}
.pod-seek::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); cursor: pointer; border: none;
}
.pod-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }
.pod-times { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-dim); margin-top: .3rem; font-variant-numeric: tabular-nums; }
.pod-rates { display: flex; gap: .3rem; }
/* Who performs the episode. Reuses .pod-rate's chrome deliberately: it sits in
   the same control row and does the same kind of job — pick one of a few — so
   giving it its own look would imply a difference that is not there. Wraps,
   because "Emily & James" is far wider than "1.25x". */
.pod-voices { display: flex; gap: .3rem; flex-wrap: wrap; }
.pod-voices .pod-rate { font-weight: 600; }
.pod-rate {
    font-family: var(--font-body); font-size: .7rem; font-weight: 700;
    padding: .25rem .5rem; border-radius: 7px;
    border: 1.5px solid var(--border); background: transparent;
    color: var(--text-muted); cursor: pointer;
}
.pod-rate:hover { border-color: var(--accent); color: var(--accent-text); }
.pod-rate.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pod-player-note { margin-top: .8rem; font-size: .8rem; line-height: 1.6; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: .8rem; }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.pod-tabs {
    display: flex; gap: .35rem; flex-wrap: wrap;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 1.3rem; padding-bottom: .1rem;
}
.pod-tab {
    font-family: var(--font-body); font-size: .8rem; font-weight: 600;
    padding: .55rem .85rem; border: none; background: none;
    color: var(--text-muted); cursor: pointer;
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
    display: inline-flex; align-items: center; gap: .35rem;
    transition: color .15s, border-color .15s;
}
.pod-tab:hover { color: var(--text); }
.pod-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.pod-tab-icon { font-size: .95em; }
.pod-panel-bar { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pod-gloss-hint { font-size: .72rem; color: var(--text-dim); }
.pod-follow-resume:not(.show) { visibility: hidden; }
.pod-follow-resume { font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent-text); cursor: pointer; }
.pod-toggle { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-muted); cursor: pointer; }
.pod-panel-intro { font-size: .84rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.1rem; }

/* ── Transcript ─────────────────────────────────────────────────────────── */
.pod-line {
    display: flex; gap: .7rem; align-items: flex-start;
    padding: .6rem .7rem; border-radius: 10px;
    border-left: 3px solid transparent;
    transition: background .18s, border-color .18s;
}
.pod-line:hover { background: var(--surface); }
.pod-line.active { background: var(--accent-soft); border-left-color: var(--accent); }
.pod-line-jump {
    flex: none; width: 24px; height: 24px; margin-top: .1rem;
    border-radius: 50%; border: 1.5px solid var(--border);
    background: transparent; color: var(--text-dim);
    font-size: .6rem; cursor: pointer;
    display: grid; place-items: center;
    opacity: 0; transition: opacity .15s, border-color .15s, color .15s;
}
.pod-line:hover .pod-line-jump, .pod-line.active .pod-line-jump { opacity: 1; }
.pod-line-jump:hover, .pod-line-jump.playing { border-color: var(--accent); color: var(--accent-text); opacity: 1; }
.pod-line.line-playing { background: var(--accent-soft, rgba(240,165,0,.08)); }
/* Always visible on touch, where there is no hover to reveal it. */
@media (hover: none) { .pod-line-jump { opacity: 1; } }
.pod-line-body { flex: 1; }
.pod-speaker {
    display: inline-block; margin-right: .5rem;
    font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    padding: .1rem .45rem; border-radius: 99px;
    background: var(--border); color: var(--text-dim);
    vertical-align: .12em;
}
.pod-line[data-speaker="Marie"] .pod-speaker  { background: rgba(88,166,255,.16); color: #58a6ff; }
.pod-line[data-speaker="Thomas"] .pod-speaker { background: rgba(240,165,0,.16);  color: #f0a500; }
.pod-line[data-seat="0"] .pod-speaker, .pod-seat[data-seat="0"] b { background: rgba(88,166,255,.16); color: #58a6ff; }
.pod-line[data-seat="1"] .pod-speaker, .pod-seat[data-seat="1"] b { background: rgba(240,165,0,.16);  color: #f0a500; }
.pod-line[data-seat="2"] .pod-speaker, .pod-seat[data-seat="2"] b { background: rgba(63,185,80,.16);  color: #3fb950; }
.pod-line[data-seat="3"] .pod-speaker, .pod-seat[data-seat="3"] b { background: rgba(219,97,162,.16); color: #db61a2; }
.pod-line[data-seat="4"] .pod-speaker, .pod-seat[data-seat="4"] b { background: rgba(163,113,247,.16); color: #a371f7; }
.pod-table { display: grid; gap: .35rem; margin-bottom: 1rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; font-size: .8rem; color: var(--text-dim); }
.pod-seat b { display: inline-block; margin-right: .4rem; padding: .05rem .45rem; border-radius: 99px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.pod-rt-note { font-size: .8rem; font-weight: 700; color: var(--text-dim); }
.pod-fr { font-size: .95rem; line-height: 1.6; }
.pod-en { display: none; font-size: .8rem; color: var(--text-dim); font-style: italic; line-height: 1.55; }
.pod-transcript.show-en .pod-en { display: block; margin-top: .2rem; }

/* ── Vocabulary ─────────────────────────────────────────────────────────── */
.pod-vocab { display: grid; gap: .5rem; }
.pod-vocab-row {
    display: grid;
    grid-template-columns: 32px minmax(120px, 1fr) minmax(120px, 1fr);
    align-items: center; gap: .8rem;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 12px; padding: .7rem .9rem;
}
.pod-vocab-say {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1.5px solid var(--border); background: transparent;
    cursor: pointer; font-size: .75rem; color: var(--text-muted);
    display: grid; place-items: center;
}
.pod-vocab-say:hover { border-color: var(--accent); color: var(--accent-text); }
.pod-vocab-fr { font-weight: 700; font-size: .92rem; }
.pod-vocab-en { font-size: .85rem; color: var(--text-muted); }
.pod-vocab-note { grid-column: 2 / -1; font-size: .76rem; color: var(--text-dim); font-style: italic; }

/* ── Result banners ─────────────────────────────────────────────────────── */
.pod-result { margin-top: 1.1rem; padding: .85rem 1rem; border-radius: 12px; font-size: .88rem; line-height: 1.6; border: 1.5px solid var(--border); }
.pod-result.good { border-color: #3fb950; background: rgba(63,185,80,.1); }
.pod-result.mid  { border-color: var(--accent); background: var(--accent-soft); }
.pod-result.low  { border-color: #f85149; background: rgba(248,81,73,.1); }

.pod-btn {
    font-family: var(--font-body); font-size: .82rem; font-weight: 700;
    padding: .5rem 1.1rem; border-radius: 99px; border: none;
    background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.pod-btn:hover { filter: brightness(1.08); }

/* ── Worksheet ──────────────────────────────────────────────────────────── */
.pod-ws-actions { margin-bottom: 1.2rem; }
.pod-worksheet { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg, 16px); padding: 1.6rem; }
.pod-ws-head h3 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: .25rem; }
.pod-ws-sub { font-size: .78rem; color: var(--text-dim); margin-bottom: .9rem; }
.pod-ws-name { font-size: .82rem; color: var(--text-muted); margin-bottom: 1.4rem; }
.pod-ws-sec { margin-bottom: 1.6rem; }
.pod-ws-sec h4 {
    font-family: var(--font-display); font-size: .95rem; font-weight: 800;
    margin-bottom: .6rem; padding-bottom: .25rem;
    border-bottom: 1.5px solid var(--border); color: var(--accent-text);
}
.pod-ws-sec ul, .pod-ws-sec ol { padding-left: 1.3rem; }
.pod-ws-sec li { font-size: .86rem; line-height: 1.7; margin-bottom: .35rem; }
.pod-ws-sec p { font-size: .86rem; line-height: 1.7; color: var(--text-muted); }
.pod-ws-table { width: 100%; border-collapse: collapse; }
.pod-ws-table td { padding: .35rem .5rem; font-size: .84rem; border-bottom: 1px solid var(--border); }
.pod-ws-table .fr { font-weight: 700; width: 34%; }
.pod-ws-table .en { color: var(--text-muted); width: 33%; }
.pod-ws-table .note { color: var(--text-dim); font-style: italic; font-size: .78rem; }
.pod-ws-q li { margin-bottom: .8rem; }
.pod-ws-rule { display: block; border-bottom: 1px solid var(--border); height: 1.5rem; margin-top: .2rem; }
.pod-ws-blank { display: inline-block; min-width: 6rem; border-bottom: 1px solid var(--text-dim); }
.pod-ws-lines { display: grid; gap: 1.3rem; margin-top: .8rem; }
.pod-ws-lines span { display: block; border-bottom: 1px solid var(--border); }
.pod-ws-script p { margin-bottom: .45rem; font-size: .84rem; }
.pod-ws-answers { border-top: 2px dashed var(--border); padding-top: 1rem; }
.pod-ws-answers ol { columns: 2; }
.pod-ws-answers-cloze { margin-top: .6rem; font-size: .82rem; }

/* ── Print: the worksheet, and only the worksheet ───────────────────────── */
@media print {
    /* Everything that isn't the worksheet is screen furniture — the nav, the
       player, the tabs, the other five panels. A printed page of tab buttons
       helps nobody. */
    #sidebar, #nav-bar, .page-header, .pod-tabs, .pod-player, .pod-back,
    .pod-ws-actions, .pod-filters, #library,
    #panel-transcript, #panel-vocab, #panel-quiz, #panel-puzzle, #panel-shadow {
        display: none !important;
    }
    body, #main-content, .tool-body { background: #fff !important; color: #000 !important; margin: 0; padding: 0; max-width: none; }
    .pod-ep-head { margin-bottom: 1rem; }
    .pod-worksheet { border: none; background: #fff; padding: 0; }
    .pod-ws-sec h4 { color: #000; border-bottom-color: #999; }
    .pod-ws-sec p, .pod-ws-table .en { color: #222; }
    .pod-ws-table td { border-bottom-color: #ccc; }
    .pod-ws-rule, .pod-ws-lines span { border-bottom-color: #999; }
    /* Keep a heading with the block it introduces, and don't split the
       transcript or answer key across pages if they fit whole. */
    .pod-ws-sec { break-inside: avoid; page-break-inside: avoid; }
    .pod-ws-script, .pod-ws-answers { break-before: page; page-break-before: always; }
    @page { margin: 1.6cm; }
}

/* ── Narrow screens ─────────────────────────────────────────────────────── */
@media (max-width: 620px) {
    .tool-body { padding: 1rem; }
    .pod-ep-head { gap: .8rem; }
    .pod-ep-emoji { font-size: 2rem; }
    .pod-ep-meta h2 { font-size: 1.2rem; }
    .pod-player { position: static; }
    .pod-controls { gap: .7rem; }
    .pod-rates { width: 100%; justify-content: space-between; }
    .pod-vocab-row { grid-template-columns: 28px 1fr; }
    .pod-vocab-en { grid-column: 2; }
    .pod-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    /* M410: the tabs follow the learner down the page on a phone. Pinned by
       JS (.pinned) rather than position: sticky, which the page's global
       body { overflow-x: hidden } disables. */
    .pod-tabs.pinned { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: var(--bg); padding: .4rem 1rem 0; margin: 0; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
    .pod-tabs::-webkit-scrollbar { display: none; }
}

/* Vocabulary game (M404, js/podcasts/vocab-game.js) */
.pvg-head { display: grid; gap: .5rem; margin-bottom: .9rem; }
.pvg-modes { display: flex; flex-wrap: wrap; gap: .35rem; }
.pvg-mode { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-weight: 700; font-size: .8rem; cursor: pointer; }
.pvg-mode.active { border-color: var(--accent); color: var(--accent-text); background: transparent; }
.pvg-stats { display: flex; gap: 1rem; font-size: .78rem; color: var(--text-dim); }
.pvg-stat b { color: var(--text); }
.pvg-bar { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pvg-bar span { display: block; height: 100%; background: #3fb950; transition: width .4s; }
.pvg-stars { color: #f0a500; font-size: .75rem; letter-spacing: 1px; margin-left: .3rem; }
.pvg-mastered .pod-vocab-fr { color: #3fb950; }
.pvg-speed { display: grid; gap: .75rem; max-width: 560px; }
.pvg-top { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-dim); font-weight: 600; }
.pvg-combo.hot { color: #f85149; }
.pvg-score { color: var(--text); }
.pvg-timer { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pvg-timer span { display: block; height: 100%; width: 100%; background: var(--accent); transition: width .1s linear; }
.pvg-prompt { display: flex; align-items: center; gap: .7rem; font-size: 1.1rem; font-weight: 700; min-height: 2.4rem; }
.pvg-hear { font-size: 1.3rem; border: 1px solid var(--border); background: var(--surface-2); border-radius: 50%; width: 2.6rem; height: 2.6rem; cursor: pointer; }
.pvg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
@media (max-width: 640px) { .pvg-opts { grid-template-columns: 1fr; } }
.pvg-opt { text-align: left; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: .88rem; }
.pvg-opt:hover:not(:disabled) { border-color: var(--accent); }
.pvg-opt.right { border-color: #3fb950; background: rgba(63,185,80,.14); }
.pvg-opt.wrong { border-color: #f85149; background: rgba(248,81,73,.12); }
.pvg-summary { text-align: center; padding: 1.2rem 0; }
.pvg-big { font-size: 2rem; font-weight: 800; }
.pvg-again { margin-left: .5rem; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent-text); font-weight: 700; cursor: pointer; }
.pvg-result { margin-top: .8rem; font-size: .9rem; }

/* Floating controls (M410) — above the bottom nav on a phone. */
.pod-mini { position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 40;
    display: flex; align-items: center; gap: .35rem; padding: .35rem .55rem .35rem .4rem;
    background: var(--surface); border: 1.5px solid var(--accent); border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.pod-mini[hidden] { display: none; }
.pod-mini-btn { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); font-size: .9rem; cursor: pointer; display: grid; place-items: center; }
.pod-mini-btn#miniStop, .pod-mini-btn#miniTop { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.pod-mini-time { font-size: .75rem; font-variant-numeric: tabular-nums; color: var(--text-muted); min-width: 2.6rem; }
@media (min-width: 621px) { .pod-mini { bottom: 20px; right: 20px; } }

/* Word search (M412, js/podcasts/wordsearch.js) */
.pws-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-bottom: .8rem; font-size: .82rem; color: var(--text-muted); }
.pws-count b { color: var(--text); }
.pws-time { font-variant-numeric: tabular-nums; }
.pws-btn { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .76rem; font-weight: 600; cursor: pointer; }
.pws-wrap { display: grid; grid-template-columns: minmax(0, 520px) 1fr; gap: 1.2rem; align-items: start; }
/* Solid blocks, no gutters (M415): the gaps between tiles made a
   "hole" pattern that fought the letters. One thin shared rule between
   cells, one frame around the grid, like a printed puzzle. */
.pws-grid { display: grid; gap: 0; touch-action: none; user-select: none; -webkit-user-select: none;
    border: 1.5px solid var(--text-dim); border-radius: 8px; overflow: hidden; background: var(--surface); }
.pws-cell { aspect-ratio: 1; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0;
    background: transparent; color: var(--text); font-weight: 700; font-size: clamp(.85rem, 3.8vw, 1.1rem); padding: 0; cursor: pointer; line-height: 1; }
.pws-cell.sel { background: rgba(88,166,255,.3); border-color: #58a6ff; }
.pws-cell.found { background: rgba(63,185,80,.25); border-color: #3fb950; color: #3fb950; }
.pws-cell.miss { background: rgba(248,81,73,.2); }
.pws-cell.hint { box-shadow: inset 0 0 0 2px #f0a500; }
.pws-cell.found.sel { background: rgba(88,166,255,.3); }
.pws-words { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; font-size: .9rem; }
.pws-word.found { text-decoration: line-through; color: #3fb950; }
.pws-word.hinted:not(.found) { color: #f0a500; }
.pws-result { margin-top: 1rem; font-size: .9rem; }
@media (max-width: 620px) {
    .pws-wrap { grid-template-columns: 1fr; }
    .pws-words { grid-template-columns: 1fr 1fr; font-size: .82rem; }
}

.pod-tab { white-space: nowrap; }

/* Puzzle accent bar (M413) — same look as Reading/Journal/Dictée's */
.pod-accent-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin-bottom: .8rem; }
.pod-accent-tools[hidden] { display: none; }
.accent-bar { display: flex; flex-wrap: wrap; gap: .3rem; }
.accent-btn { padding: .3rem .65rem; font-size: .88rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all .15s; font-family: var(--font-body); min-width: 2.1rem; }
.accent-btn:hover { background: var(--teal); color: var(--teal-ink); border-color: var(--teal); }
.accent-btn:active { transform: scale(0.92); }
@media (max-width: 620px) {
    /* On a phone the bar moves under the gap being typed in (app.js). */
    .pod-accent-tools.at-gap { margin: .3rem 0 .7rem; }
    .accent-btn { padding: .45rem .6rem; font-size: 1rem; }
}

/* Scores and sessions (M414) */
.pod-scorebar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .7rem; }
.pod-score-total { font-size: .95rem; color: #f0a500; margin-right: .3rem; }
.pod-score-total b { font-size: 1.15rem; }
.pod-score-total small { color: var(--text-dim); font-size: .7rem; }
.pod-score-chip.done { border-color: rgba(63,185,80,.5); color: var(--text-muted); }
.pod-score-chip b { color: var(--text); }
.pod-score-hist { font-size: .72rem; padding: .2rem .6rem; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent-text); cursor: pointer; font-weight: 700; }
.pod-score-hist:disabled { opacity: .4; cursor: default; }
.pod-summary { font-size: .82rem; color: var(--text-muted); margin: 0 0 .9rem; }
.pod-summary b { color: #f0a500; }
.pod-done-score { color: #f0a500; font-weight: 800; }
.pod-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.pod-sessions-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.pod-sessions-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.pod-sessions-list li { padding: .55rem .7rem; background: var(--surface-2); border-radius: 8px; }
.pod-sess-head { display: flex; justify-content: space-between; font-size: .82rem; color: var(--text-muted); }
.pod-sess-head b { color: #f0a500; }
.pod-sess-parts { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .76rem; color: var(--text-dim); margin-top: .25rem; }

/* Worksheet word search (M415) */
.pod-ws-search-wrap { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-start; }
.pod-ws-grid { border-collapse: collapse; border: 1.5px solid var(--text-muted); font-family: var(--font-body); }
.pod-ws-grid td { width: 1.75rem; height: 1.75rem; text-align: center; font-weight: 700; font-size: .95rem; border: 1px solid var(--border); padding: 0; }
.pod-ws-grid.solution td { width: 1.2rem; height: 1.2rem; font-size: .7rem; color: var(--text-dim); }
.pod-ws-grid.solution td.on { background: rgba(63,185,80,.3); color: var(--text); font-weight: 800; }
.pod-ws-search-words { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .88rem; }
.pod-ws-search-words .en { color: var(--text-dim); font-size: .8rem; }
.pod-ws-search-key { margin-top: .8rem; }
@media print {
    .pod-ws-grid, .pod-ws-grid td { border-color: #555 !important; color: #000 !important; }
    .pod-ws-grid.solution td.on { background: #ddd !important; }
    #panel-wordsearch { display: none !important; }
}

/* Card photos (M416) — cards only; the episode page is unchanged. */
.pod-card-img { position: relative; margin: -1.15rem -1.15rem .9rem; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.pod-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.pod-card:hover .pod-card-img img { transform: scale(1.04); }
.pod-card-credit { position: absolute; right: .4rem; bottom: .35rem; font-size: .6rem; color: #fff; background: rgba(0,0,0,.62); padding: .1rem .4rem; border-radius: 999px; }
.pod-card-img--none { display: grid; place-items: center; font-size: 2.4rem; background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.pod-card-img--none[data-cat="univers"] { background: linear-gradient(135deg, #1b2a4a, #0d1117); }
.pod-card-img--none[data-cat="corps"]   { background: linear-gradient(135deg, #3a1d2b, #0d1117); }
.pod-card-img--none[data-cat="musique"] { background: linear-gradient(135deg, #2e1f47, #0d1117); }
.pod-card-img--none[data-cat="cinema"]  { background: linear-gradient(135deg, #3b2a12, #0d1117); }
.pod-card-img--none[data-cat="sport"]   { background: linear-gradient(135deg, #14361f, #0d1117); }
.pod-card-img--none[data-cat="tech"]    { background: linear-gradient(135deg, #10323a, #0d1117); }
.pod-card-img--none[data-cat="cuisine"] { background: linear-gradient(135deg, #3d2410, #0d1117); }
.pod-card-img--none[data-cat="culture"] { background: linear-gradient(135deg, #2d2a14, #0d1117); }
.pod-card-img--none[data-cat="sante"]   { background: linear-gradient(135deg, #123730, #0d1117); }
.pod-card-img--none[data-cat="paranormal"] { background: linear-gradient(135deg, #1f2a3a, #0d1117); }
.pod-card-img--none[data-cat="antiquite"] { background: linear-gradient(135deg, #3d3012, #0d1117); }
.pod-card-img--none[data-cat="mythes"] { background: linear-gradient(135deg, #3a1a1a, #0d1117); }
.pod-card-img--none[data-cat="animaux"] { background: linear-gradient(135deg, #14361f, #0d1117); }
.pod-card-img--none[data-cat="pratique"] { background: linear-gradient(135deg, #10323a, #0d1117); }
.pod-card-img--none[data-cat="auto"] { background: linear-gradient(135deg, #2a2a2e, #0d1117); }
.pod-card-img--none span { filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }

/* Internal quality rating pill (M457) — distinct from the learner's own .pod-done-score */
.pod-quality { display: inline-block; align-self: flex-start; font-size: .68rem; font-weight: 800; padding: .12rem .55rem; border-radius: 99px; letter-spacing: .02em; margin: .1rem 0 .15rem; border: 1px solid currentColor; background: transparent; }
.pod-quality-hi { color: #1b8a4b; }
.pod-quality-mid { color: #8a6d00; }
.pod-quality-lo { color: #8a8f98; }
@media (prefers-color-scheme: dark) { .pod-quality-hi { color: #4cc982; } .pod-quality-mid { color: #e0b73c; } }

/* Card pills consolidated: format + quality share one row (the other pills moved to tooltips) */
.pod-card-pills { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .5rem; }
.pod-card-pills .pod-natural, .pod-card-pills .pod-quality { margin: 0; }

/* Star quality widget (replaces the "Quality n/10" text pill): 5 stars, half-step fill via clipped overlay */
.pod-stars { position: relative; display: inline-block; font-size: .85rem; line-height: 1; letter-spacing: 1px; white-space: nowrap; color: var(--border); cursor: help; }
.pod-stars::before { content: "★★★★★"; }
.pod-stars > i { position: absolute; left: 0; top: 0; overflow: hidden; font-style: normal; color: #f0a500; }
/* Filter toolbar polish */
.pod-filters { gap: .4rem; margin-bottom: .7rem; align-items: center; }
.pod-filter-sep { width: 1px; align-self: stretch; min-height: 1.4rem; background: var(--border); margin: 0 .25rem; }
.pod-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin: 0 0 1rem; }
.pod-sort { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.pod-sort select { font: inherit; font-weight: 600; padding: .3rem .6rem; border-radius: 99px; border: 1.5px solid var(--border); background: var(--bg-card, transparent); color: var(--text); }
.pod-clear { font: inherit; font-size: .78rem; font-weight: 700; padding: .3rem .8rem; border-radius: 99px; border: 1.5px dashed var(--border); background: transparent; color: var(--text-muted); cursor: pointer; }
.pod-clear:hover { border-color: var(--accent); color: var(--accent-text); }
.pod-clear[hidden] { display: none; }
@media (max-width: 600px) {
    .pod-chip { padding: .3rem .7rem; font-size: .76rem; }
    .pod-filter-sep { display: none; }
    .pod-tools { justify-content: flex-start; }
}

/* Voice + gender filter and "found in the script" badge (M458) */
.pod-filter-label { font-size: .75rem; font-weight: 700; color: var(--text-muted, #8b949e); align-self: center; margin-right: .15rem; }
.pod-voice-filter { max-height: none; }
.pod-found { display: inline-block; margin-top: .5rem; margin-left: .3rem; padding: .12rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 700; background: rgba(46,160,67,.16); color: #2ea043; }

/* ── Library polish (M459): fewer rows, 9 per page, swipe strip on phones ── */
.pod-search { margin-bottom: .8rem; }
/* Categories: ONE scrolling row instead of five wrapped rows */
.pod-cats { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .2rem;
    -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.pod-cats::-webkit-scrollbar { display: none; }
.pod-cats .pod-chip { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; }
.pod-tools { gap: .5rem; margin-bottom: .8rem; justify-content: flex-start; }
.pod-tools .pod-sort { margin-left: auto; }
.pod-advtoggle { font: inherit; font-size: .78rem; font-weight: 700; padding: .3rem .8rem; border-radius: 99px; border: 1.5px solid var(--border); background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
.pod-advtoggle:hover, .pod-advtoggle.open { border-color: var(--accent); color: var(--accent-text); }
.pod-advtoggle .pod-chip-n { background: var(--accent); color: var(--accent-ink); opacity: 1; border-radius: 99px; padding: 0 .4rem; }
.pod-adv-caret { transition: transform .15s; }
.pod-advtoggle.open .pod-adv-caret { transform: rotate(180deg); }
.pod-adv { border: 1.5px solid var(--border); border-radius: 14px; padding: .8rem .8rem .3rem; margin-bottom: 1rem; }
.pod-adv[hidden] { display: none; }
.pod-adv .pod-filters { margin-bottom: .6rem; }
.pod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pod-pager-of, .pod-swipe-hint { display: none; }
@media (max-width: 900px) { .pod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
    .pod-grid { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; gap: .8rem; overflow-x: auto;
        scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: .6rem; scrollbar-width: none; }
    .pod-grid::-webkit-scrollbar { display: none; }
    .pod-grid > .pod-card { scroll-snap-align: center; }
    .pod-grid > .pod-empty { grid-column: 1 / -1; }
    .pod-pager-n, .pod-pager-gap { display: none; }
    .pod-pager-of { display: inline; font-size: .8rem; font-weight: 700; color: var(--text-muted); min-width: 3.5rem; text-align: center; }
    .pod-swipe-hint { display: inline; color: var(--text-dim); }
}

/* ── Filters sheet (M470): phones get search + ONE Filters button; the level
   and topic rows move into a bottom sheet (see placeFilters in app.js). ── */
.pod-sheet-head, .pod-sheet-backdrop { display: none; }
@media (max-width: 620px) {
    .pod-cats { -webkit-mask-image: none; mask-image: none; flex-wrap: wrap; overflow: visible; }
    .pod-adv:not([hidden]) {
        display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
        max-height: 78vh; overflow-y: auto; margin: 0; border: 0; border-top: 1px solid var(--border);
        border-radius: 20px 20px 0 0; background: var(--surface); padding: 0 1rem calc(1rem + env(safe-area-inset-bottom));
        box-shadow: 0 -12px 40px rgba(0, 0, 0, .45);
    }
    .pod-adv .pod-sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1;
        background: var(--surface); padding: 1rem 0 .7rem; margin-bottom: .3rem; }
    .pod-sheet-done { font: inherit; font-weight: 700; font-size: .85rem; padding: .5rem 1rem; min-height: 40px; border: 0; border-radius: 99px;
        background: var(--accent); color: var(--accent-ink); cursor: pointer; }
    body.pod-sheet-open .pod-sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 290; background: rgba(0, 0, 0, .55); }
    body.pod-sheet-open { overflow: hidden; }
    body.pod-sheet-open #tab-bar { display: none; }
}

/* ── Freemium Roadmap CTA (M532; contrast fix M620) ─────────────────────
   The card is ALWAYS dark (fixed gradient), so it must not use theme text
   tokens: --text / --purple flip to dark ink in light themes and vanish on
   it. It carries its own palette instead; every pair below is >= 4.5:1 on
   the darkest/lightest point of the gradient (tools/audit/contrast-audit.js). */
.roadmap-podcast-banner {
  --rb-title: #ffffff;
  --rb-body: #cbd5e1;      /* slate-300: 11.9:1 on #1e1b4b */
  --rb-tag: #e9d5ff;       /* purple-200 */
  /* container recipe (dark gradient, flex, border, shadow): DS:HEROES .ds-hero--promo */
  margin-bottom: 1.25rem;
}
.roadmap-podcast-tag { margin-bottom: 0.35rem; }
.roadmap-podcast-body { flex: 1; min-width: 260px; }
/* Direct child only: the plan names inside the paragraph stay inline. */
.roadmap-podcast-body > strong { display: block; font-size: 1rem; color: var(--rb-title); margin-bottom: 0.2rem; }
.roadmap-podcast-body p { margin: 0; font-size: 0.84rem; color: var(--rb-body); line-height: 1.45; }
.roadmap-podcast-body p strong { color: var(--rb-title); font-weight: 700; }
.roadmap-podcast-btn:focus-visible { outline: 3px solid var(--rb-tag); outline-offset: 2px; }


/* Upgrade Preview Modal */
.podcast-upgrade-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.podcast-upgrade-card {
  max-width: 500px;
  width: 100%;
  background: #0f172a;
  border: 1.5px solid #8b5cf6;
  border-radius: 20px;
  padding: 1.75rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: pmFadeIn 0.2s ease-out;
}
@keyframes pmFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.podcast-upgrade-badge { margin-bottom:0.8rem; }
.podcast-upgrade-title { font-family: var(--font-display, serif); font-size: 1.35rem; color: #ffffff; margin: 0 0 0.5rem; }
.podcast-upgrade-desc { font-size: 0.88rem; color: var(--text); line-height: 1.55; margin-bottom: 1.25rem; }
.podcast-upgrade-perks { list-style: none; padding: 0; margin: 0 0 1.4rem; text-align: left; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.84rem; color: var(--text); }
.podcast-upgrade-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }


/* Phone: promo banners shrink to a headline + button so the library is above the fold */
@media (max-width: 620px) {
    .pilot-banner-box, .roadmap-podcast-banner { padding: .7rem .85rem; gap: .6rem; margin-bottom: .9rem; }
    .pilot-banner-desc, .roadmap-podcast-body p { display: none; }
    .roadmap-podcast-body { min-width: 0; flex: 1 1 100%; }
    .roadmap-podcast-body > strong, .pilot-banner-content strong { font-size: .92rem; }
    .roadmap-podcast-tag { font-size: .75rem; padding: .15rem .55rem; white-space: normal; }
    .pilot-launch-btn, .roadmap-podcast-btn { width: 100%; justify-content: center; text-align: center; padding: .55rem .9rem; font-size: .86rem; }
}
