/* lessons area styles (wave 3, lessons builder). Use app.css tokens; keep the restrained house style. */

/* ================================================================ player */
.lp { --lp-ink: rgba(255, 255, 255, .92); --lp-dim: rgba(255, 255, 255, .62); position: relative; border-radius: var(--r-lg); overflow: hidden; background: #0d0d0f; color: var(--lp-ink); box-shadow: var(--sh-2); outline: none; }
.lp-stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.lp-stage video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; cursor: pointer; }
.lp video::cue { background: rgba(10, 10, 12, .78); color: #fff; font-family: var(--font-ui); font-size: .95em; line-height: 1.35; }
.lp-big { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); color: #111;
  display: grid; place-items: center; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); transition: opacity .24s var(--ease), transform .24s var(--ease); }
.lp-big svg { margin-left: 3px; }
.lp-big:hover { transform: scale(1.05); }
.lp.playing .lp-big { opacity: 0; transform: scale(.92); pointer-events: none; }
.lp-toast { position: absolute; left: 50%; top: 16px; transform: translate(-50%, -6px); padding: 6px 12px; border-radius: 999px; background: rgba(10, 10, 12, .78); color: #fff; font-size: 13px; font-weight: 550;
  opacity: 0; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease); font-variant-numeric: tabular-nums; }
.lp-toast.on { opacity: 1; transform: translate(-50%, 0); }
.lp-bar { padding: 6px 12px 8px; background: #141416; border-top: 1px solid rgba(255, 255, 255, .06); }
.lp-seek { position: relative; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; border-radius: 4px; }
.lp-seek:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lp-track { position: relative; width: 100%; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; transition: height .16s var(--ease); }
.lp-seek:hover .lp-track, .lp-seek.drag .lp-track, .lp-seek:focus-visible .lp-track { height: 6px; }
.lp-buf, .lp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.lp-buf { background: rgba(255, 255, 255, .26); }
.lp-fill { background: #fff; }
.lp-tick { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #141416; }
.lp-knob { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  transform: scale(0); transition: transform .16s var(--ease); pointer-events: none; }
.lp-seek:hover .lp-knob, .lp-seek.drag .lp-knob, .lp-seek:focus-visible .lp-knob { transform: scale(1); }
.lp-tip { position: absolute; bottom: 24px; transform: translateX(-50%); padding: 6px 9px; border-radius: 7px; background: rgba(10, 10, 12, .92); color: #fff; font-size: 12px; white-space: nowrap;
  pointer-events: none; display: flex; gap: 8px; align-items: baseline; max-width: 260px; }
.lp-tip b { font-variant-numeric: tabular-nums; }
.lp-tip span { color: var(--lp-dim); overflow: hidden; text-overflow: ellipsis; }
.lp-ctrls { display: flex; align-items: center; gap: 2px; min-width: 0; }
.lp-btn { height: 36px; min-width: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--lp-ink); display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; transition: background .15s; }
.lp-btn:hover { background: rgba(255, 255, 255, .1); }
.lp-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.lp-speed { font-variant-numeric: tabular-nums; min-width: 46px; }
.lp-cc { font-size: 11px; letter-spacing: .04em; }
.lp-cc[aria-pressed="true"] { color: #141416; background: #fff; }
.lp-cc[aria-pressed="true"]:hover { background: rgba(255, 255, 255, .85); }
.lp-time { font-size: 13px; color: var(--lp-ink); padding: 0 8px; white-space: nowrap; }
.lp-sep { color: var(--lp-dim); margin: 0 4px; }
.lp-chap { font-size: 13px; color: var(--lp-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .14); }
.lp-chap:empty { display: none; }
.lp-grow { flex: 1; }
.lp-vol { display: inline-flex; align-items: center; }
.lp-vol input { width: 0; opacity: 0; transition: width .2s var(--ease), opacity .2s; accent-color: #fff; height: 4px; }
.lp-vol:hover input, .lp-vol:focus-within input { width: 78px; opacity: 1; margin: 0 6px 0 2px; }
.lp-pop { position: relative; }
.lp-menu { position: absolute; right: 0; bottom: 42px; z-index: 3; min-width: 120px; padding: 5px; border-radius: 10px; background: #1d1d20; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7);
  display: flex; flex-direction: column; animation: menuIn .16s var(--ease); transform-origin: bottom right; }
.lp-menu[hidden] { display: none; }
.lp-menu button { text-align: left; border: 0; background: none; color: var(--lp-ink); padding: 7px 10px 7px 26px; border-radius: 6px; font-size: 13px; position: relative; font-variant-numeric: tabular-nums; }
.lp-menu button:hover, .lp-menu button:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.lp-menu button[aria-checked="true"]::before { content: ''; position: absolute; left: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #fff; }
.lp.fs { border-radius: 0; display: flex; flex-direction: column; background: #000; }
.lp.fs .lp-stage { flex: 1; aspect-ratio: auto; }
.lp.fs video { object-fit: contain; }
@media (max-width: 560px) {
  .lp-chap, .lp-vol input { display: none; }
  .lp-btn { min-width: 34px; padding: 0 6px; }
  .lp-time { padding: 0 4px; font-size: 12px; }
  .lp-big { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
}
/* embeds: a poster first, then the provider's own player */
.lp-embed .player { border-radius: 0; }
.lp-poster { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: #16161a center / cover no-repeat; color: #fff; text-align: left; cursor: pointer; overflow: hidden; }
.lp-poster::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .2); transition: background .2s; }
.lp-poster:hover::after { background: rgba(0, 0, 0, .3); }
.lp-poster .lp-big.static { z-index: 1; }
.lp-poster:hover .lp-big { transform: scale(1.05); }
.lp-poster-title { position: absolute; left: 28px; top: 26px; right: 28px; font: 650 clamp(18px, 3vw, 30px)/1.15 var(--font-display); letter-spacing: -.01em; z-index: 1; max-width: 22ch; }
.lp-resume, .lp-provider { position: absolute; bottom: 14px; z-index: 1; font-size: 12.5px; font-weight: 550; padding: 5px 10px; border-radius: 999px; background: rgba(10, 10, 12, .7); font-variant-numeric: tabular-nums; }
.lp-resume { left: 14px; }
.lp-provider { right: 14px; color: rgba(255, 255, 255, .8); }

/* ============================================================ student list */
.lsn-h2 { font-size: 16px; margin: 4px 2px 12px; }
.lsn-continue { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 26px; }
.lsn-cont { display: flex; gap: 14px; align-items: center; padding: 12px; text-decoration: none; }
.lsn-cont .body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.lsn-cont .body b { font-weight: 600; line-height: 1.3; }
.lsn-cont .bar { margin-top: 6px; }
.lsn-thumb { width: 112px; flex: none; aspect-ratio: 16 / 9; border-radius: 8px; background: #16161a center / cover no-repeat; position: relative; overflow: hidden; }
.lsn-thumb.type { background: hsl(var(--h) 18% 14%); display: flex; align-items: flex-end; padding: 8px; }
.lsn-thumb.type span { font: 600 10.5px/1.2 var(--font-ui); color: #fff; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lsn-subject { margin-bottom: 26px; scroll-margin-top: 80px; }
.lsn-subject-head { display: flex; align-items: center; gap: 14px; margin: 0 2px 12px; flex-wrap: wrap; }
.lsn-subject-head .grow { flex: 1; min-width: 180px; }
.lsn-subject-head h2 { font-size: 16px; }
.lsn-subject-bar { width: 160px; }
@media (max-width: 680px) { .lsn-subject-bar { display: none; } }
.lsn-list.card { padding: 6px 8px; }
.lsn-list.flush { margin: 0 -6px; }
.lsn-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); min-width: 0; transition: background .12s; }
.lsn-row + .lsn-row { box-shadow: 0 -1px 0 var(--line); }
.lsn-row:hover { background: var(--surface-2); }
.lsn-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lsn-row .main b { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsn-row .main span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsn-row.locked .main b { color: var(--ink-2); }
.lsn-row.current { background: var(--surface-2); }
.lsn-row.current .main b { font-weight: 650; }
.lsn-row.compact { padding: 9px 8px; gap: 10px; }
.lsn-row.compact .main b { font-size: 13.5px; }
.lsn-n { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 650 12px/1 var(--font-ui); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lsn-n.done { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.lsn-n.locked { background: transparent; color: var(--ink-3); border-style: dashed; }
.lsn-n.now { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lsn-pct { font: 600 12.5px/1 var(--font-ui); color: var(--info); font-variant-numeric: tabular-nums; padding: 5px 8px; border-radius: 999px; background: var(--info-tint); }

/* ============================================================ one lesson */
.lsn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; margin-top: 14px; align-items: start; }
.lsn-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lsn-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--topbar) + 14px); min-width: 0; }
@media (max-width: 1100px) {
  .lsn-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; } .lsn-aside { position: static; }
  /* one column: chapters straight after the player and title, the subject outline last */
  .lsn-layout.ordered > .lsn-main, .lsn-layout.ordered > .lsn-aside { display: contents; }
  .lsn-player { order: 1; } .lsn-head { order: 2; } .lsn-outcomes { order: 3; } .lsn-ch-card { order: 4; } .lsn-notes { order: 5; }
  .lsn-ask { order: 6; } .lsn-next { order: 7; } .lsn-outline { order: 8; } .lsn-keys-card { order: 9; }
}
.lsn-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 2px; }
.lsn-head .grow { flex: 1; min-width: 240px; }
.lsn-head h1 { font-size: clamp(22px, 2.6vw, 28px); margin-top: 6px; letter-spacing: -.015em; }
.lsn-head .eyebrow a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.lsn-chips { gap: 6px; margin-top: 10px; }
.lsn-done { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 200px; }
.lsn-watch { width: 200px; display: flex; flex-direction: column; gap: 6px; }
.lsn-done-hint { margin-top: -2px; }
.lsn-complete-badge { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; background: var(--ok-tint); color: var(--ok); font-weight: 600; font-size: 14px; animation: rise .3s var(--ease); }
@media (max-width: 680px) { .lsn-done { align-items: stretch; width: 100%; } .lsn-watch { width: 100%; } }
.lsn-outcomes { display: flex; flex-direction: column; gap: 8px; }
.lsn-lo { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.lsn-lo .code, .lo-code { font: 700 11px/1 var(--font-ui); letter-spacing: .06em; color: var(--brand); flex: none; padding: 4px 7px; border-radius: 6px; background: var(--brand-tint); }
.lsn-notes .card-head h2, .lsn-ask .card-head h2 { font-size: 16px; }
.lsn-rich { max-width: 72ch; }
.lsn-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 16px; }
.lsn-file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-lg); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; transition: border-color .15s, background .15s; }
.lsn-file:hover { border-color: var(--line-2); background: var(--surface-2); }
.lsn-file .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lsn-file .main b { font-weight: 550; font-size: 13.5px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.lsn-file .main span { font-size: 12px; color: var(--ink-3); }
.lsn-file > svg { color: var(--ink-3); }
.lsn-file-ic { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.lsn-file-ic.sm { width: 30px; height: 30px; border-radius: 8px; }
.lsn-next { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); }
.lsn-next .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lsn-next .grow b { font-weight: 600; font-size: 16px; }
.lsn-next.locked { background: var(--surface-2); }
.lsn-next.unlocked { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.lsn-chapters { list-style: none; padding: 0; margin: -4px -6px 0; display: flex; flex-direction: column; }
.lsn-chapters button { display: flex; gap: 12px; width: 100%; padding: 8px 8px; border: 0; background: none; border-radius: 8px; text-align: left; align-items: baseline; color: var(--ink-2); transition: background .12s, color .12s; }
.lsn-chapters button:hover { background: var(--surface-2); color: var(--ink); }
.lsn-chapters button .num { font-size: 12.5px; color: var(--ink-3); min-width: 38px; }
.lsn-chapters button b { font-weight: 500; font-size: 13.5px; }
.lsn-chapters button.on { color: var(--ink); background: var(--surface-2); }
.lsn-chapters button.on b { font-weight: 650; }
.lsn-chapters button.on .num { color: var(--brand); font-weight: 650; }
.lsn-keys-card summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; }
.lsn-keys-card summary svg { color: var(--ink-3); transition: transform .2s var(--ease); }
.lsn-keys-card[open] summary svg { transform: rotate(180deg); }
.lsn-keys-card summary::-webkit-details-marker { display: none; }
.lsn-keys { margin: 12px 0 0; display: flex; flex-direction: column; gap: 7px; }
.lsn-keys div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.lsn-keys dt { white-space: nowrap; color: var(--ink-3); }
.lsn-keys dd { margin: 0; color: var(--ink-2); text-align: right; }
.lsn-locked { padding: 34px; display: flex; flex-direction: column; align-items: flex-start; }
.lsn-locked h1 { font-size: clamp(22px, 2.6vw, 28px); margin: 8px 0 10px; }
.lsn-locked p.muted { max-width: 60ch; }
.lsn-lock-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); margin-bottom: 16px; }
.lsn-panel .card-head h2, .lsn-panel .card-head h3 { display: flex; align-items: center; gap: 8px; }

/* ============================================================== staff list */
.lsn-manage { margin-bottom: 16px; scroll-margin-top: 80px; }
.lsn-manage-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.lsn-manage-head .grow { flex: 1; min-width: 200px; }
.lsn-manage-head h2 { font-size: 16px; }
.lsn-seq { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.lsn-seq > span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.lsn-mlist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.lsn-mrow { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.lsn-mrow:last-child { border-bottom: 0; }
.lsn-move { display: flex; flex-direction: column; gap: 0; }
.lsn-move .iconbtn { width: 26px; height: 22px; }
.lsn-mrow .main { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 3px; }
.lsn-mrow .main b { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lsn-mmeta { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 4px; align-items: center; }
.lsn-mchips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lsn-mdone { width: 64px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 0; }
.lsn-mdone i { flex-basis: 100%; height: 4px; border-radius: 99px; margin-top: 5px; background: linear-gradient(to right, var(--ok) var(--p), var(--surface-3) var(--p)); }
@media (max-width: 760px) {
  .lsn-mrow { flex-wrap: wrap; }
  .lsn-mrow .main { flex-basis: calc(100% - 90px); }
  .lsn-mchips { justify-content: flex-start; margin-left: 76px; }
  .lsn-mdone { display: none; }
  .lsn-mrow > .btn { margin-left: auto; }
}

/* ============================================================== new + editor */
.lsn-narrow { max-width: 860px; }
.lsn-picks { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-height: 340px; }
.lsn-picks .pick span { line-height: 1.35; }
[data-vform] .dropzone, .lsn-narrow .dropzone { display: block; }
.dropzone.compact { padding: 14px; }
.nowrap { white-space: nowrap; }
.lsn-h3 { font-size: 15px; margin: 6px 2px 12px; }
.lsn-drop { max-width: 760px; }
.lsn-vmeta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.lsn-vmeta > * { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.lsn-vmeta a { color: var(--ink-2); }
.lsn-chrows { display: flex; flex-direction: column; gap: 8px; }
.lsn-chrow { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.lsn-chrow .err { grid-column: 1 / -1; font-size: 12.5px; color: var(--bad); }
.lsn-chrow .input.num { text-align: center; }
.warn-text { color: var(--warn) !important; font-weight: 600; }
.lsn-cc { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font: 700 10.5px/1 var(--font-ui); color: var(--ink-2); letter-spacing: .04em; flex: none; }
.lsn-cuepreview { margin: 10px 0 4px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.lsn-cuepreview div { display: flex; gap: 10px; }
.lsn-cuepreview div span:last-child { white-space: pre-line; }
.lsn-upform { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lsn-upform .field { min-width: 120px; }
.lsn-upform .field.grow { flex: 1; min-width: 180px; }
.lsn-upform input[type=file].input { padding-top: 7px; }
.lsn-mathprev { margin-top: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.lsn-hist .tl-item b { display: block; font-weight: 550; font-size: 13.5px; }

/* ========================================================== outcomes */
.lsn-outcomes-mgr { scroll-margin-top: 80px; }
.lsn-outcomes-mgr .card-head { align-items: flex-start; }
.lsn-outcomes-mgr .card-head h2 { font-size: 16px; }
.lo-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.lo-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.lo-row:last-child { border-bottom: 0; }
.lo-row .lo-code { margin-top: 2px; min-width: 44px; text-align: center; }
.lo-row .main { flex: 1; min-width: 0; }
.lo-row .main b { font-weight: 550; }
.lo-row .main p { margin-top: 3px; }
.lo-topics { gap: 6px; margin-top: 8px; }
.lo-use { text-align: right; line-height: 1.5; min-width: 74px; }
@media (max-width: 680px) {
  .lo-row { flex-wrap: wrap; }
  .lo-row .main { flex-basis: calc(100% - 100px); }
  .lo-use { text-align: left; margin-left: 38px; }
  .lo-row .btn-row { margin-left: auto; }
}
@media (max-width: 560px) {
  .lsn-chrow { grid-template-columns: 84px minmax(0, 1fr) auto auto; row-gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .lsn-chrow [data-ch-title] { grid-column: 1 / -1; grid-row: 2; }
  .lsn-chrow [data-ch-go] { grid-column: 3; grid-row: 1; } .lsn-chrow [data-ch-del] { grid-column: 4; grid-row: 1; }
}
