/* One session, two views.
 *
 * overview  what the session covers, its chapters as an accordion, Get started.
 * watch     chapters rail (opens and closes) | the player | the bot.
 * The bot is on the right in both.
 *
 * Desktop (>= 1180px): one screen, no page scroll; each pane scrolls on its
 *   own and the player is sized by the screen height.
 * Tablet (900-1179px): content and the bot side by side, the page scrolls.
 * Phone (< 900px): one column; Chapters / Transcript / Ask are tabs.
 */

/* ================= layout ================= */
.ws { --railw: 300px; --askw: 400px; display: grid; grid-template-columns: var(--railw) minmax(0, 1fr) var(--askw); grid-template-areas: "rail center ask"; }
.ov { grid-area: ov; min-width: 0; }
.rail { grid-area: rail; min-width: 0; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); }
.center { grid-area: center; min-width: 0; padding: 16px clamp(14px, 1.6vw, 24px) 24px; }
.ask { grid-area: ask; min-width: 0; display: flex; flex-direction: column; background: var(--card); border-left: 1px solid var(--line); }
body.view-ov .rail, body.view-ov .center { display: none; }
body.view-watch .ov { display: none; }
body.view-ov .w-only { display: none; }
body.view-ov #crumbSession { pointer-events: none; }
body.view-watch #crumbSession { color: var(--muted); font-weight: 400; }
body.view-watch #crumbSession:hover { color: var(--ink); }

@media (min-width: 1180px) {
  body.app { height: 100svh; display: flex; flex-direction: column; overflow: hidden; }
  body.app .topbar { flex: none; border-bottom-color: var(--line); }
  body.app .topbar-in { max-width: none; padding: 0 20px; }
  body.app .ws { flex: 1; min-height: 0; transition: grid-template-columns .45s var(--e); }
  body.view-ov .ws { grid-template-columns: minmax(0, 1fr) var(--askw); grid-template-areas: "ov ask"; }
  body.view-watch.rail-closed .ws { grid-template-columns: 0px minmax(0, 1fr) var(--askw); }
  body.rail-closed .rail { border-right-color: transparent; }
  .rail > * { width: var(--railw); }
  .ov, .center { min-height: 0; overflow-y: auto; }
  .rail, .ask { min-height: 0; overflow: hidden; }
  /* The player takes every pixel of height left after the controls and the
     chapter bar; the bar shares its width so the edges line up. */
  .center-in { width: min(100%, calc((100svh - var(--chrome, 372px)) * 16 / 9)); min-width: min(100%, 520px); margin: 0 auto; }

}
/* On a 13-inch laptop the side panes give the player the room. */
@media (min-width: 1180px) and (max-width: 1439px) { .ws { --railw: 264px; --askw: 360px; } .chap { grid-template-columns: 72px minmax(0, 1fr); } }
@media (min-width: 1560px) { .ws { --railw: 320px; --askw: 440px; } }

@media (min-width: 900px) and (max-width: 1179px) {
  .ws { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "center ask" "rail ask"; padding: 0 0 40px; }
  body.view-ov .ws { grid-template-areas: "ov ask"; }
  .rail { border-right: 0; background: transparent; padding: 0 clamp(16px, 2vw, 28px); }
  .rail-tabs { padding-left: 0; padding-right: 0; }
  .ask { position: sticky; top: 76px; align-self: start; height: calc(100svh - 92px); margin: 16px 16px 0 0; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
  .tx { max-height: 520px; }
}

@media (max-width: 899px) {
  .ws { grid-template-columns: 1fr; grid-template-areas: "center" "rail" "ask"; padding-bottom: 32px; }
  body.view-ov .ws { grid-template-areas: "ov"; }
  body.view-ov .ask { display: none; }
  .center { padding: 12px var(--gutter) 0; }
  .rail { border-right: 0; background: transparent; padding: 0 var(--gutter); }
  .rail-tabs { padding-left: 0; padding-right: 0; }
  .tab.only-mobile { display: inline-flex; }
  .ask { margin: 8px var(--gutter) 0; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-height: 520px; overflow: hidden; }
  .ask[data-mobile-hidden="true"] { display: none; }
  .tx { max-height: 60svh; }
}
/* The bot hides where it is a side pane (900px and up); a phone has it as a tab. */
@media (min-width: 1180px) {
  body.view-watch.ask-closed .ws { grid-template-columns: var(--railw) minmax(0, 1fr) 0px; }
  body.view-watch.rail-closed.ask-closed .ws { grid-template-columns: 0px minmax(0, 1fr) 0px; }
  body.view-ov.ask-closed .ws { grid-template-columns: minmax(0, 1fr) 0px; }
  body.ask-closed .ask { border-left-color: transparent; }
  .ask > * { width: var(--askw); }
}
@media (min-width: 900px) and (max-width: 1179px) {
  body.ask-closed .ws { grid-template-columns: minmax(0, 1fr) 0px; }
  body.ask-closed .ask { display: none; }
}
@media (min-width: 900px) {
  .ask-head .ask-close { appearance: none; display: grid; place-items: center; margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; flex: none; }
  .ask-head .clear:not([hidden]) + .ask-close { margin-left: 2px; }
  .ask-head .ask-close:hover { background: rgba(15, 16, 19, .06); color: var(--ink); }
  .ask-head .ask-close svg { width: 16px; height: 16px; }
  body.ask-closed .ask-open { display: inline-flex; }
  /* The page keeps clear of the button: the player and its bar sit left of it. */
  body.ask-closed .center { padding-right: calc(var(--askbtn) + 40px); }
}
:root { --askbtn: 250px; }
/* The same button as the library's "Ask the course": dark, the Traversaal mark, a small tag. */
.ask-open { display: none; position: fixed; z-index: 40; right: 20px; bottom: 20px; align-items: center; gap: 10px; max-width: var(--askbtn); padding: 12px 14px 12px 15px; border: 0; border-radius: 999px; background: var(--night); color: #fff; font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; box-shadow: 0 20px 44px -16px rgba(15, 16, 19, .7), 0 0 0 1px rgba(255, 255, 255, .06) inset; animation: askIn .35s var(--e) both; transition: background-color .2s ease, transform .4s var(--e); }
.ask-open:hover { background: #000; transform: translateY(-2px); }
.ask-open .ao-mark { width: 20px; height: 20px; flex: none; }
.ask-open .t { white-space: nowrap; }
.ask-open .tag { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: rgba(255, 255, 255, .6); padding: 3px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); white-space: nowrap; }
@keyframes askIn { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .ask-open { animation: none; } }

/* The rail only collapses where it is a side pane. */
@media (max-width: 1179px) { .cb-toggle, .rail-close { display: none !important; } }

/* ================= the rail: chapters + transcript ================= */
.rail-tabs { display: flex; gap: 2px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); flex: none; }
.tab { appearance: none; border: 0; background: none; padding: 10px 10px 11px; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; position: relative; display: inline-flex; gap: 7px; align-items: center; }
.tab .c { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--coral); border-radius: 2px; }
.tab.only-mobile { display: none; }
.rail-close { appearance: none; margin-left: auto; align-self: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.rail-close:hover { background: rgba(15, 16, 19, .06); color: var(--ink); }
.rail-close svg { width: 16px; height: 16px; }
.panel { position: relative; }
.panel[hidden] { display: none !important; }
#panel-ch { padding: 8px 8px 24px; }
@media (min-width: 1180px) {
  #panel-ch { flex: 1; min-height: 0; overflow-y: auto; }
  .panel-tx { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .panel-tx .tx { flex: 1; min-height: 0; }
}

.chapters { list-style: none; margin: 0; padding: 0; }
.chap { position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 11px; align-items: start; width: 100%; text-align: left; appearance: none; border: 0; background: none; padding: 9px 8px; border-radius: 11px; cursor: pointer; transition: background-color .2s ease; }
.chap:hover { background: rgba(15, 16, 19, .04); }
.chap .th { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.chap .th img { width: 100%; height: 100%; object-fit: cover; }
.chap .th .n { position: absolute; left: 4px; top: 4px; font-family: var(--mono); font-size: 9.5px; line-height: 1; color: #fff; background: rgba(10, 11, 13, .72); padding: 3px 5px; border-radius: 4px; }
.chap .th .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--coral); }
.chap .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 600; line-height: 1.32; letter-spacing: -.005em; color: var(--ink); }
.chap .m { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.chap .live { display: none; align-items: center; gap: 5px; color: var(--coral-deep); }
.chap .live .pulse { width: 5px; height: 5px; }
.chap.on { background: var(--card); box-shadow: var(--shadow-1); }
.chap.on .live { display: inline-flex; }
.chap.on::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--coral); }

.tx-tools { display: flex; gap: 8px; align-items: center; padding: 10px 14px 6px; flex: none; }
.tx-tools input[type="search"] { flex: 1; min-width: 0; border: 1px solid var(--line-2); background: var(--card); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13px; outline: none; }
.tx-tools input[type="search"]:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255, 106, 77, .14); }
.tx-tools label { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.tx-hits { padding: 0 14px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); min-height: 4px; flex: none; }
.tx { position: relative; overflow: auto; padding: 4px 8px 24px; }
.cue { appearance: none; border: 0; background: none; display: grid; grid-template-columns: minmax(46px, auto) minmax(0, 1fr); gap: 8px; width: 100%; text-align: left; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.cue:hover { background: rgba(15, 16, 19, .04); }
.cue .tt { font-family: var(--mono); font-size: 10.5px; color: var(--faint); padding-top: 2px; }
.cue .sp { display: block; font-size: 11px; font-weight: 600; color: var(--coral-deep); }
.cue.on { background: var(--coral-wash); color: var(--ink); }
.cue.on .tt { color: var(--coral-deep); }
.cue mark { background: rgba(255, 106, 77, .22); color: inherit; border-radius: 3px; padding: 0 1px; }
.ch-rule { display: flex; align-items: center; gap: 10px; padding: 14px 8px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ch-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ================= the centre: head, player, now playing ================= */

.player { position: relative; border-radius: 16px; overflow: hidden; background: var(--night); box-shadow: var(--shadow-2); color: #fff; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #0A0B0D; overflow: hidden; cursor: pointer; }
.screen video, .screen .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0A0B0D; }
/* Zoom exports come ultrawide (3440x1440) or near it; the shared screen sits in
   the middle with black bars either side, so fill the 16:9 stage. Full screen
   shows the whole frame. */
.screen video { object-fit: cover; }
.player:fullscreen .screen video { object-fit: contain; }
.screen::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, rgba(10, 11, 13, .78)); pointer-events: none; }
.cap { position: absolute; z-index: 2; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(88%, 820px); text-align: center; pointer-events: none; }
.cap span { display: inline; font-size: clamp(12.5px, 1.1vw, 16px); line-height: 1.55; padding: 3px 8px; border-radius: 6px; background: rgba(10, 11, 13, .72); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.cap .spk { color: var(--coral-hi); font-weight: 600; margin-right: 4px; }
.cap.off { display: none; }
.badge { position: absolute; z-index: 3; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); font-size: 11.5px; color: rgba(255, 255, 255, .86); background: rgba(10, 11, 13, .7); padding: 6px 10px; border-radius: 999px; backdrop-filter: blur(8px); }
.badge b { color: #fff; font-weight: 600; }
.big { position: absolute; z-index: 3; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; border: 0; background: var(--coral); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 20px 50px -14px rgba(201, 48, 15, .8); transition: transform .3s var(--e), opacity .3s ease; }
.big svg { width: 26px; height: 26px; margin-left: 4px; }
.big:hover { transform: scale(1.06); }
.player.playing .big { opacity: 0; pointer-events: none; transform: scale(.85); }
.flash { position: absolute; z-index: 4; right: 12px; top: 12px; font-family: var(--mono); font-size: 12px; background: var(--coral); color: var(--ink); padding: 6px 10px; border-radius: 8px; opacity: 0; transform: translateY(-6px); transition: opacity .25s ease, transform .3s var(--e); pointer-events: none; }
.flash.on { opacity: 1; transform: none; }
/* After a Moment Search jump: the way back to where the learner was (session.js, returnTo) */
.spot-back { position: absolute; z-index: 7; left: 12px; top: 12px;   /* above the chapter-end card (6): the way back stays reachable */ display: flex; align-items: center; gap: 2px; max-width: calc(100% - 24px); padding: 3px; border-radius: 999px; background: rgba(10, 11, 13, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); animation: fadeIn .3s ease; cursor: default; }
.spot-back[hidden] { display: none; }
.spot-back button { appearance: none; border: 0; background: none; color: #fff; cursor: pointer; font: 600 13px/1 var(--sans); }
.sb-go { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 12px 8px 10px; border-radius: 999px; transition: background .15s ease; }
.sb-go:hover, .sb-go:focus-visible { background: rgba(255, 255, 255, .12); }
.sb-go svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--coral-hi); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sb-go span { white-space: nowrap; }
.sb-go b { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--coral-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-go b::before { content: "·"; margin-right: 8px; color: rgba(255, 255, 255, .5); }
.sb-x { flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 18px !important; font-weight: 400 !important; color: rgba(255, 255, 255, .7) !important; }
.sb-x:hover, .sb-x:focus-visible { background: rgba(255, 255, 255, .12); color: #fff !important; }
.spot { position: absolute; top: 50%; width: 4px; height: 14px; margin: -7px 0 0 -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px var(--coral); pointer-events: none; z-index: 1; }
.spot[hidden] { display: none; }
@media (max-width: 560px) { .spot-back button { font-size: 12.5px; } .sb-go { padding: 7px 10px 7px 9px; gap: 6px; } .sb-go b::before { margin-right: 6px; } }

.controls { padding: 10px 14px 10px; background: var(--night-2); }
.ctrl-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; }
.ctrl-row .spacer { flex: 1; }
.cbtn { appearance: none; border: 0; background: transparent; color: rgba(255, 255, 255, .86); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; flex: none; transition: background-color .15s ease, color .15s ease; }
.cbtn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.cbtn svg { width: 16px; height: 16px; }
.cbtn.txt { width: auto; padding: 0 9px; font-family: var(--mono); font-size: 11.5px; }
.cbtn.on { color: var(--coral-hi); }
.time { font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .62); white-space: nowrap; margin-left: 4px; }
.time b { color: #fff; font-weight: 500; }

/* the scrubber: chapters as segments, cited moments as pins */
.scrub { position: relative; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.segs { position: relative; display: flex; gap: 3px; width: 100%; height: 5px; transition: height .2s var(--e); }
.scrub:hover .segs, .scrub.drag .segs { height: 8px; }
.segs i { position: relative; display: block; height: 100%; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.segs i b { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--coral); }
.segs i.hov { background: rgba(255, 255, 255, .3); }
.knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 106, 77, .35); pointer-events: none; transform: scale(0); transition: transform .2s var(--e); }
.scrub:hover .knob, .scrub.drag .knob, .player.playing .knob { transform: scale(1); }
.pins { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; top: -3px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--coral-hi); box-shadow: 0 0 0 2px var(--night-2); pointer-events: auto; cursor: pointer; border: 0; padding: 0; }
.pin.on { background: #fff; }
.hover-card { position: absolute; bottom: 28px; width: 190px; margin-left: -95px; pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity .15s ease, transform .2s var(--e); z-index: 5; }
.scrub:hover .hover-card, .scrub.drag .hover-card { opacity: 1; transform: none; }
.hover-card .img { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); border: 1px solid rgba(255, 255, 255, .14); }
.hover-card img { width: 100%; height: 100%; object-fit: cover; }
.hover-card .t { margin-top: 6px; text-align: center; font-size: 11.5px; line-height: 1.35; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.hover-card .t b { font-family: var(--mono); color: var(--coral-hi); font-weight: 500; margin-right: 4px; }


@media (max-width: 720px) {
  .player { margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
  .badge .long { display: none; }
  .cap span { font-size: 12px; }
}

/* ================= the chapter, under the video =================
   Stacked so nothing truncates, whatever the column width:
   label · full name · previous / next (+ chapter list, autoplay) · who leads it
   · then the summary in its own section. */
.chbar { margin-top: 14px; padding: 14px 18px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-1); }
.chbar.swap .ci-t, .chbar.swap .ci-sum p, .chbar.swap .ci-who { animation: cbIn .5s var(--e); }
@keyframes cbIn { from { opacity: 0; transform: translateY(6px); } }
.ci-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.ci-k { min-width: 0; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--coral-deep); }
.ci-k .pulse { width: 6px; height: 6px; }
.ci-t { margin: 4px 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 1.55vw, 24px); line-height: 1.2; letter-spacing: -.018em; color: var(--ink); text-wrap: balance; }

.ci-nav { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.cb-btn { appearance: none; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px 0 10px; min-height: 42px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s ease; }
.cb-btn svg { width: 15px; height: 15px; }
.cb-btn:hover { border-color: var(--ink); }
.cb-btn:disabled { opacity: .38; cursor: default; }
.cb-next { appearance: none; flex: 0 1 auto; min-width: 0; max-width: 100%; display: grid; gap: 2px; align-content: center; text-align: left; padding: 6px 14px; min-height: 42px; border-radius: 11px; border: 1px solid var(--coral); background: var(--coral); color: var(--ink); cursor: pointer; transition: background-color .15s ease, transform .25s var(--e); }
.cb-next small { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: rgba(15, 16, 19, .7); }
.cb-next span { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.cb-next:hover { transform: translateX(2px); box-shadow: 0 10px 20px -12px rgba(15, 16, 19, .5); }
.cb-next.last { background: var(--paper); border-color: var(--line-2); color: var(--ink); }
.cb-next.last small { color: var(--ok); }
.cb-next.last:hover { background: #fff; border-color: var(--ink); }
.ci-tools { flex: none; display: inline-flex; align-items: center; gap: 14px; }
.cb-toggle { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.cb-toggle svg { width: 16px; height: 16px; }
.cb-toggle:hover { border-color: var(--ink); }
.cb-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cb-auto { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; user-select: none; }

.ci-who { margin-top: 12px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.ci-who:empty { display: none; }
.ci-who .faces { display: flex; }
.ci-who .faces img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--card); }
.ci-who .ini { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.ci-who b { color: var(--ink); font-weight: 600; }

.ci-sum { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ci-sum:has(p:empty) { display: none; }
.ci-lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ci-sum p { margin: 5px 0 0; min-height: 3.2em; font-size: 14.5px; line-height: 1.6; color: var(--ink); max-width: 760px; text-wrap: pretty; }

@media (max-width: 720px) {
  .chbar { padding: 16px; }
  .ci-top { flex-wrap: wrap; }
  .cb-next { flex: 1 1 200px; }
}

/* a small switch for Autoplay */
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 32px; height: 18px; margin: 0; border-radius: 999px; background: var(--paper-3); cursor: pointer; transition: background-color .2s ease; flex: none; }
.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 16, 19, .3); transition: transform .25s var(--e); }
.switch:checked { background: var(--coral); }
.switch:checked::before { transform: translateX(14px); }

/* ================= end of a chapter, on the screen ================= */
.endcard { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 20px; text-align: center; background: rgba(10, 11, 13, .74); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fadeIn .35s ease; cursor: default; }
.endcard[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.ec-k { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8FE0A8; }
.ec-k svg { width: 15px; height: 15px; }
.ec-t { margin: 12px auto 0; max-width: 560px; font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 2.2vw, 30px); line-height: 1.2; letter-spacing: -.015em; color: #fff; }
.ec-sub { margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, .66); }
.ec-b { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ec-auto { margin-top: 16px; display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; color: rgba(255, 255, 255, .78); cursor: pointer; }
.player.ended .big, .player.ended .cap { display: none; }

/* ================= overview ================= */
.ov-in { max-width: 1000px; margin: 0 auto; padding: clamp(24px, 3vw, 44px) clamp(20px, 3vw, 48px) 72px; }
.ov-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 380px); gap: clamp(24px, 3.4vw, 48px); align-items: center; }
.ov-kick { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ov-kick b { color: var(--coral-deep); font-weight: 500; }
.ov-kick > * + *::before { content: "·"; margin-right: 10px; color: var(--faint); }
.ov-hero h1 { margin: 12px 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 3.3vw, 48px); line-height: 1.04; letter-spacing: -.035em; }
.ov-tag { margin: 12px 0 0; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); max-width: 560px; }
.ov-who { margin-top: 16px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.ov-who .faces { display: flex; }
.ov-who .faces img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid var(--paper); margin-left: -8px; }
.ov-who .faces img:first-child { margin-left: 0; }
.ov-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ov-cta .btn svg { width: 14px; height: 14px; }
.ov-cta .ask-m { display: none; }
.ov-cover { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--night); box-shadow: var(--shadow-2); cursor: pointer; }
.ov-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--e); }
.ov-cover:hover img { transform: scale(1.04); }
.ov-cover .pl { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: var(--coral); color: var(--ink); display: grid; place-items: center; box-shadow: 0 18px 40px -12px rgba(201, 48, 15, .8); transition: transform .3s var(--e); }
.ov-cover .pl svg { width: 22px; height: 22px; margin-left: 3px; }
.ov-cover:hover .pl { transform: scale(1.08); }
.ov-cover .len { position: absolute; right: 10px; bottom: 10px; font-family: var(--mono); font-size: 11px; color: #fff; background: rgba(10, 11, 13, .72); padding: 4px 8px; border-radius: 6px; }

.ov-stats { margin-top: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.ov-stat { padding: 16px 16px 16px 0; min-width: 0; }
.ov-stat + .ov-stat { border-left: 1px solid var(--line); padding-left: 18px; }
.ov-stat b { display: block; font-family: var(--serif); font-weight: 600; font-size: 26px; letter-spacing: -.02em; line-height: 1.1; }
.ov-stat span { display: block; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ov-stat .bar { margin-top: 10px; height: 4px; border-radius: 4px; background: var(--paper-3); overflow: hidden; }
.ov-stat .bar i { display: block; height: 100%; background: var(--coral); }

.ov-about { margin-top: 34px; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
.ov-h { margin: 3px 0 0; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ov-about p { margin: 0; font-size: 15.5px; line-height: 1.7; color: var(--ink); max-width: 660px; }
.ov-about .topics { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }

.ov-chapters { margin-top: 40px; }
.ov-ch-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.ov-ch-head h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: -.02em; }
.ov-ch-head h2 small { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--muted); margin-left: 10px; }
/* ---------- after the chapters: assignments, in the chapters' own style ---------- */
.ov-tasks { margin-top: 48px; scroll-margin-top: 16px; }
.task-item .acc-n { color: var(--coral-deep); border-color: rgba(201, 48, 15, .35); background: var(--coral-soft, #FFEDE7); }
.task-item .acc-n svg { width: 15px; height: 15px; }
.task-item.done .acc-n { color: #fff; }
.acc-pad.task-pad { grid-template-columns: minmax(0, 1fr); }
.acc-go svg { width: 15px; height: 15px; }
.tasks-next { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 16px; font-size: 14px; color: var(--muted); }

/* in the rail, after the chapters */
.rt-h { margin: 14px 8px 4px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.chap .tth { display: grid; place-items: center; align-content: center; gap: 4px; background: var(--coral-soft, #FFEDE7); color: var(--coral-deep); }
.chap .tth svg { width: 20px; height: 20px; }
.chap .tth .k { font-family: var(--mono); font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; }

/* an assignment's page, in place of the player */
.taskpage { display: none; }
body.task-on .taskpage { display: block; }
body.task-on #player, body.task-on #chbar { display: none; }
@media (min-width: 1180px) { body.task-on .center-in { width: min(100%, 860px); } }
.tp-card { padding: 20px 22px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-1); animation: cbIn .5s var(--e); }
.tp-card .ci-k svg { width: 15px; height: 15px; }
.tp-card .ci-t { font-size: clamp(22px, 1.9vw, 30px); }
.tp-s { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.65; color: var(--ink); max-width: 720px; text-wrap: pretty; }
.task-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tlink { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: border-color .2s ease; }
.tlink:hover { border-color: var(--ink); }
.tlink svg { width: 14px; height: 14px; color: var(--coral-deep); }
.tp-brief { margin-top: 14px; padding: 6px 22px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.tp-sec { padding-top: 16px; }
.tp-sec + .tp-sec { margin-top: 4px; border-top: 1px solid var(--line); }
.tp-sec ol, .tp-sec ul { margin: 8px 0 0; padding-left: 20px; max-width: 720px; }
.tp-sec li, .tp-sec p { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.tp-sec li + li { margin-top: 6px; }
.tp-sec p { margin: 6px 0 0; max-width: 720px; }
.tp-foot { margin-top: 20px; display: flex; justify-content: flex-end; }
@media (max-width: 899px) { .tp-card, .tp-brief { padding-left: 16px; padding-right: 16px; } }

.linkbtn { appearance: none; border: 0; background: none; padding: 4px 0; color: var(--coral-aa); font-size: 13px; font-weight: 600; cursor: pointer; }
.linkbtn:hover { color: #A82508; }

.acc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.acc-item { border-bottom: 1px solid var(--line-2); }
.acc-head { appearance: none; border: 0; background: none; width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 24px; gap: 16px; align-items: center; padding: 16px 6px; text-align: left; cursor: pointer; color: var(--ink); }
.acc-n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; border: 1.5px solid var(--line-2); color: var(--ink); background: var(--paper); transition: all .2s ease; }
.acc-n svg { width: 15px; height: 15px; }
.acc-item.part .acc-n { border-color: var(--coral); color: var(--coral-deep); }
.acc-item.done .acc-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.acc-t { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; transition: color .15s ease; }
.acc-head:hover .acc-t { color: var(--coral-deep); }
.acc-m { display: block; margin-top: 3px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.acc-r { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.acc-chev { color: var(--muted); transition: transform .35s var(--e); display: grid; place-items: center; }
.acc-chev svg { width: 18px; height: 18px; }
.acc-item.open .acc-chev { transform: rotate(180deg); color: var(--ink); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--e); }
.acc-item.open .acc-body { grid-template-rows: 1fr; }
.acc-body > div { overflow: hidden; min-height: 0; }
.acc-pad { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; padding: 0 6px 22px 58px; }
.acc-pad .th { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--paper-2); border: 0; padding: 0; cursor: pointer; }
.acc-pad .th img { width: 100%; height: 100%; object-fit: cover; }
.acc-pad .th .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--coral); }
.acc-pad p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.acc-meta { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.acc-go { margin-top: 14px; }
.acc-go svg { width: 13px; height: 13px; }

@media (max-width: 760px) {
  .ov-hero { grid-template-columns: 1fr; }
  .ov-cover { order: -1; aspect-ratio: 16 / 9; }
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .ov-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ov-about { grid-template-columns: 1fr; gap: 10px; }
  .acc-head { grid-template-columns: 32px minmax(0, 1fr) 20px; gap: 12px; }
  .acc-r { display: none; }
  .acc-pad { grid-template-columns: 1fr; padding-left: 6px; }
}
@media (max-width: 899px) { .ov-cta .ask-m { display: inline-flex; } }

/* Short laptop screens: the summary is a short scroll below, the player keeps its size. */
@media (min-width: 1180px) and (max-height: 780px) {
  .center-in { --chrome: 318px; }
}

/* ================= mark as done ================= */
.done-box { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.done-box input { appearance: none; -webkit-appearance: none; margin: 0; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; flex: none; }
.done-box input::after { content: ""; width: 10px; height: 6px; border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .2s var(--e); }
.done-box input:checked { background: var(--ok); border-color: var(--ok); }
.done-box input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.done-box input:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.done-box:hover input:not(:checked) { border-color: var(--ok); }
.done-box input:checked + span { color: var(--ok); }
.ci-done { margin-left: auto; align-self: center; padding: 0 4px; }
.acc-acts { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.acc-acts .acc-go { margin-top: 0; }

/* the rail: a round tick at the end of each chapter row */
.chap-li { position: relative; }
.chap-li .chap { padding-right: 40px; }
.mark { appearance: none; position: absolute; z-index: 1; right: 12px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 1.5px solid var(--line-2); background: #fff; color: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; transition: all .15s ease; }
.mark svg { width: 12px; height: 12px; }
.mark:hover { border-color: var(--ok); color: var(--ok); }
.chap-li.is-done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.chap-li.is-done .chap .t { color: var(--ink-2); }

/* ---------- progress in the player ---------- */
.rprog { margin: 2px 4px 8px; padding: 12px 12px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.rprog .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rprog .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rprog .num { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1; color: var(--ink); }
.rprog .sub { margin-top: 7px; font-size: 12px; color: var(--muted); }
.rprog.full .num { color: var(--ok); }
.ci-meta { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.ci-meta .ci-who { margin-top: 0; }
.ci-prog { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ci-prog .pbar { width: 110px; height: 5px; }
.ci-prog b { color: var(--ink); font-weight: 600; }
.ws-more { margin-top: 18px; font-size: 13px; }
.ov .more-bar { margin-top: 44px; }
.ov-stat b.full { color: var(--ok); }
.ov-stat b.full ~ .bar i { background: var(--ok); }

/* Episode or whole session: what the bar and the clock cover. */
.viewsw { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--paper-2); }
.viewsw button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.viewsw button:hover { color: var(--ink); }
.viewsw button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 16, 19, .12); }
.cg-task b { color: #fff; font-weight: 600; }
.back-lib { flex: none; gap: 6px; padding: .55rem .95rem .55rem .7rem; white-space: nowrap; }
.back-lib svg { width: 15px; height: 15px; }
.back-lib .bl-short { display: none; }
@media (max-width: 640px) { .back-lib .bl-long { display: none; } .back-lib .bl-short { display: inline; } }
.course-end { margin-top: 20px; padding: 22px 24px 24px; border-radius: 16px; background: var(--coral-soft, #FFEDE7); border: 1px solid rgba(201, 48, 15, .18); }
.course-end .ci-lbl { color: var(--coral-deep); }
.course-end h3 { margin: 8px 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 1.7vw, 26px); line-height: 1.2; letter-spacing: -.015em; color: var(--ink); }
.course-end p { margin: 8px 0 0; max-width: 620px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.course-end .ce-b { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
/* a chapter from YouTube: the frame fills the screen and takes no clicks (the page's controls run it) */
.screen .yt, .screen .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0A0B0D; }
.screen .yt iframe { pointer-events: none; }
/* the same switch in the player's dark control bar */
.viewsw-dark { background: rgba(255, 255, 255, .08); margin-right: 4px; }
.viewsw-dark button { font-size: 11.5px; padding: 5px 10px; color: rgba(255, 255, 255, .66); }
.viewsw-dark button:hover { color: #fff; }
.viewsw-dark button[aria-pressed="true"] { background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: none; }
@media (max-width: 640px) { .viewsw-dark { display: none; } }
/* the chapter list, closed: a tab on the screen's left edge that opens it */
.rail-tab { display: none; }
@media (min-width: 1180px) {
  body.view-watch.rail-closed .rail-tab { display: inline-flex; }
  .rail-tab { position: fixed; z-index: 40; left: 0; top: 50%; transform: translateY(-50%); flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px 18px 9px; border: 0; border-radius: 0 14px 14px 0; background: var(--night); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: 0 18px 40px -16px rgba(15, 16, 19, .6); animation: railTabIn .35s var(--e) both; transition: background-color .2s ease, padding .25s var(--e); }
  .rail-tab:hover { background: #000; padding-left: 13px; }
  .rail-tab svg { width: 17px; height: 17px; color: var(--coral-hi); }
  .rail-tab span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .02em; }
}
@keyframes railTabIn { from { opacity: 0; transform: translate(-8px, -50%); } }
@media (prefers-reduced-motion: reduce) { .rail-tab { animation: none; } }
@media (min-width: 1180px) { body.view-watch.rail-closed .center { padding-left: 60px; } }
.cbtn.yt-open { text-decoration: none; }
.cbtn.yt-open svg { width: 22px; height: 16px; }
.cbtn.yt-open[hidden] { display: none; }
/* an assignment's study plan: numbered steps, each with what it is and its links */
.tp-plan .tp-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; max-width: none; }
.tp-plan .tp-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; margin: 0; padding: 16px 18px; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.tp-plan .tp-n { font-family: var(--mono); font-size: 12px; color: var(--coral-deep); padding-top: 3px; }
.tp-plan h4 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.tp-plan .tp-steps p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.tp-plan .tp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px !important; }

/* the back button counting down to the automatic return (session.js, startCount) */
.spot-back.counting { overflow: hidden; box-shadow: 0 0 0 1.5px var(--coral-hi), 0 10px 30px -12px rgba(0, 0, 0, .6); }
.spot-back.counting::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--coral-hi); transform-origin: left; animation: sbCount 5s linear forwards; pointer-events: none; }
.spot-back.counting .sb-x { width: auto; padding: 0 12px; font-size: 13px !important; font-weight: 600 !important; border-radius: 999px; }
@keyframes sbCount { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .spot-back.counting::after { animation: none; } }
