/* Academy — student app */
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }
.small { font-size: 14px; }
.tiny { font-size: 12px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--header); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--border); }
.topbar-inner { height: 64px; display: flex; align-items: center; gap: 20px; position: relative; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 500; transition: .2s; }
.topnav a:hover { color: var(--text); background: var(--surface); }
.topnav a.on { color: var(--text); background: var(--surface-2); }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); transition: .2s; position: relative; }
.user-btn:hover { border-color: var(--border-2); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); display: grid; animation: pop .2s var(--ease); z-index: 60; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 14px; color: var(--muted); text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--text); }
.menu .head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }

.page { padding: 36px 0 80px; }
.page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.4vw, 52px); letter-spacing: -0.025em; line-height: 1.05; }
.page-title em { color: var(--accent); }

/* dashboard */
.resume { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); margin-top: 28px; }
.resume .cover { min-height: 260px; }
.resume .cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 50%, var(--surface)); }
.resume .play-big { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow-lg); transition: transform .3s var(--ease); }
.resume:hover .play-big { transform: translate(-50%, -50%) scale(1.06); }
.play-big .i { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.resume-body { padding: 32px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.resume-body h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -0.02em; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.kpi { padding: 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); display: flex; gap: 14px; align-items: center; }
.kpi-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); color: var(--text); border: 1px solid var(--border); flex: none; }
.kpi b { display: block; font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: -0.03em; }
.kpi span { color: var(--muted); font-size: 13px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 44px 0 18px; }
.section-title h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -0.02em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.ccard { display: flex; flex-direction: column; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; transition: transform .3s var(--ease), border-color .3s; }
.ccard:hover { transform: translateY(-3px); border-color: var(--border-2); }
.ccard .cover { aspect-ratio: 16/9; margin: 8px 8px 0; border-radius: 12px; }
.ccard-body { padding: 18px; display: grid; gap: 12px; }
.ccard-body h4 { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -0.02em; line-height: 1.05; }
.prog-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.prog-row .progress { flex: 1; }
.locked { opacity: .7; }

/* dashboard: trading-desk banner */
.deck { --tint: #1E5B4A; --line: rgba(255, 255, 255, 0.12); --txt: #f6f3ec; --mut: rgba(246, 243, 236, 0.72); --dimc: rgba(246, 243, 236, 0.5); --upc: #8ff0c4; --acc: #ff7a3d;
  position: relative; margin-top: 28px; border-radius: var(--radius-xl); color: var(--txt); border: 1px solid color-mix(in srgb, var(--tint) 60%, #000); box-shadow: var(--shadow-lg); overflow: hidden; isolation: isolate;
  background:
    radial-gradient(70% 90% at 100% 0%, color-mix(in srgb, var(--tint) 55%, #fff 18%) 0%, transparent 60%),
    radial-gradient(60% 80% at 0% 100%, color-mix(in srgb, var(--acc) 22%, transparent) 0%, transparent 65%),
    linear-gradient(150deg, color-mix(in srgb, var(--tint) 92%, #000) 0%, color-mix(in srgb, var(--tint) 55%, #08080a) 100%); }
/* faint chart grid, like the course covers */
.deck::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(180deg, transparent, #000 35%, #000); -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%, #000); }
.deck-top { background: rgba(0, 0, 0, 0.18); display: flex; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); font: 500 11.5px var(--mono); letter-spacing: .08em; color: var(--mut); }
.ticker { display: inline-flex; align-items: center; gap: 8px; color: var(--txt); text-transform: uppercase; }
.ticker i { width: 7px; height: 7px; border-radius: 50%; background: var(--upc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--upc) 25%, transparent); }
.deck-main { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; padding: 30px 28px 8px; }
.deck-copy { display: grid; gap: 10px; justify-items: start; }
.deck-label { font: 500 11.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.deck h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4vw, 50px); letter-spacing: -0.025em; line-height: 1.02; max-width: 16ch; }
.deck-meta { color: var(--mut); font-size: 14px; }
.deck .btn-accent { margin-top: 8px; }
.deck .btn-accent .i { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.deck-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, 0.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.deck-stats div { padding: 14px 20px; min-width: 104px; }
.deck-stats div + div { border-left: 1px solid var(--line); }
.deck-stats dt { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dimc); }
.deck-stats dd { margin: 6px 0 0; font: 500 26px var(--mono); letter-spacing: -0.04em; }
.deck-stats dd small { font-size: 14px; color: var(--dimc); letter-spacing: 0; }
.deck-stats dd.up { color: var(--upc); }

.chart { display: flex; gap: 10px; padding: 18px 28px 0; height: 168px; }
.chart .ph { display: grid; grid-template-rows: 1fr auto; min-width: 0; border-bottom: 1px dashed var(--line); position: relative; }
.chart .ph svg { width: 100%; height: 130px; overflow: visible; }
.chart .ph > span { font: 500 10px var(--mono); color: var(--dimc); padding: 8px 0 0; letter-spacing: .06em; cursor: default; }
.chart .ph.on > span { color: var(--acc); }
.chart .ph.full > span { color: var(--txt); }
.cd line { stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cd rect { fill: currentColor; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; transition: opacity .2s; }
.cd.done { color: #f6f3ec; }
.cd.todo { color: rgba(246, 243, 236, 0.4); }
.cd.todo rect { fill: transparent; }
.cd.now { color: var(--acc); animation: pulse 1.8s ease-in-out infinite; }
.cd:hover rect { opacity: .7; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .cd.now { animation: none; } }
.deck-foot { padding: 14px 28px 20px; color: var(--mut); font-size: 13.5px; }

/* dashboard: course rows */
.crows { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.crow { display: flex; align-items: center; gap: 16px; padding: 16px 18px 16px 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: border-color .2s, transform .25s var(--ease); }
a.crow:hover { border-color: var(--border-2); transform: translateY(-2px); }
.crow-art { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 80%, #fff) , var(--c)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.crow-art .i { width: 22px; height: 22px; }
.crow-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
.crow-main h4 { font-family: var(--serif); font-weight: 400; font-size: 25px; letter-spacing: -0.02em; line-height: 1.05; }
.crow-ring { --p: 0; width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.crow-ring.full { background: var(--up); }
.crow-ring span { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 500 11.5px var(--mono); }
.crow-go { color: var(--dim); flex: none; }
.ring.full { background: var(--up); }

/* course overview */
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.crumb:hover { color: var(--text); }
.crumb .i { width: 16px; height: 16px; }
.page > .crumb + .deck { margin-top: 14px; }
.cbody { display: grid; grid-template-columns: 1fr 340px; gap: 24px; margin-top: 28px; align-items: start; }
.phase-list { display: grid; gap: 10px; }
.phase { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: border-color .2s; }
.phase.cur { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.phase summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 44px 1fr auto 20px; gap: 16px; align-items: center; padding: 16px 18px; }
.phase summary::-webkit-details-marker { display: none; }
.phase-n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--serif); font-size: 22px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); }
.phase.cur .phase-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.phase.full .phase-n { background: var(--up-soft); border-color: transparent; color: var(--up); }
.phase-n .i { width: 18px; height: 18px; stroke-width: 2.6; }
.phase-t { display: grid; gap: 3px; min-width: 0; }
.phase-t b { font-weight: 500; font-size: 16px; }
.phase-t .accent { color: var(--accent-text); }
.phase-p { display: grid; gap: 6px; justify-items: end; width: 90px; color: var(--muted); }
.phase-p .bar { width: 100%; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.phase-p .bar i { display: block; height: 100%; background: var(--up); border-radius: 4px; }
.phase.cur .phase-p .bar i { background: var(--accent); }
.phase .chev { color: var(--dim); transition: transform .3s var(--ease); }
.phase[open] .chev { transform: rotate(180deg); }
.phase ul { list-style: none; margin: 0; padding: 0 10px 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.cside { position: sticky; top: 88px; display: grid; gap: 14px; }
.side-card { padding: 20px; display: grid; gap: 12px; }
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.req-list li { display: flex; gap: 10px; align-items: flex-start; }
.req-list .i { width: 16px; height: 16px; color: var(--up); flex: none; margin-top: 2px; stroke-width: 2.4; }
.req-sum { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); }

/* explore more: requestable courses */
.xcard { display: flex; flex-direction: column; border-radius: var(--radius-xl); background: var(--surface); border: 1px dashed var(--border-2); overflow: hidden; }
.xcard .cover { aspect-ratio: 16/9; margin: 8px 8px 0; border-radius: 12px; filter: saturate(.55); }
.xcard .lock { position: absolute; z-index: 1; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; }
.xcard-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.xcard-body h4 { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -0.02em; line-height: 1.05; }
.xcard.upgrade { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.xcard.upgrade .cover { filter: none; }
.up-badge { position: absolute; z-index: 1; top: 10px; left: 10px; }
.up-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--up-soft); }
.up-note .i { color: var(--up); flex: none; margin-top: 2px; stroke-width: 2.6; }
.xcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; font-size: 14.5px; color: var(--muted); transition: background .15s, color .15s; }
.lrow:hover { background: var(--surface-2); color: var(--text); }
.lrow.on { background: var(--accent-soft); color: var(--text); }
/* lesson status: empty ring → accent ring with play (current) → solid green tick (done) */
.lrow .st { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-2); flex: none; transition: background .2s, border-color .2s; }
.lrow .st .i { width: 12px; height: 12px; stroke-width: 3; }
.lrow.on .st { border-color: var(--accent); color: var(--accent); }
.lrow.on .st .i { fill: currentColor; stroke: none; width: 10px; height: 10px; margin-left: 2px; }
.lrow.done .st { background: var(--up); border-color: var(--up); color: #fff; }
.lrow.done .st .i { fill: none; stroke: currentColor; stroke-width: 3; width: 12px; height: 12px; margin: 0; }
.lrow.done:not(.on) .tt { color: var(--dim); }
.lrow .t { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--dim); flex: none; }
.lrow .tt { min-width: 0; }

/* player */
.player-wrap { display: grid; grid-template-columns: 1fr 380px; min-height: calc(100dvh - 64px); }
.player-wrap.wide { grid-template-columns: 1fr 0; }
.player-wrap.wide .curr { display: none; }
.player-main { min-width: 0; }
.stage { background: #000; position: relative; }
.stage-inner { max-width: 1400px; margin: 0 auto; aspect-ratio: 16/9; max-height: calc(100dvh - 140px); width: 100%; position: relative; }
.stage video, .stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.watermark { position: absolute; z-index: 3; pointer-events: none; font-family: var(--mono); font-size: 12px; color: rgba(255,255,255,.22); text-shadow: 0 1px 2px rgba(0,0,0,.5); transition: top 2s, left 2s; user-select: none; white-space: nowrap; }
.no-video { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; background: radial-gradient(circle at center, var(--surface-2), #000); }
.no-video .i { width: 40px; height: 40px; margin: 0 auto 12px; }
.next-overlay { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(0,0,0,.75); backdrop-filter: blur(6px); animation: fade .3s; text-align: center; padding: 20px; }
.next-overlay h3 { font-size: 20px; margin: 6px 0 18px; }

.lesson-bar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--bg-2); flex-wrap: wrap; }
.lesson-content { padding: 26px 28px 40px; display: grid; gap: 22px; }
.lesson-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 28px; flex-wrap: wrap; }
.lesson-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.lesson-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#ltab:empty { display: none; }
#ltab > p { max-width: 75ch; }
.lesson-content h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.2vw, 40px); letter-spacing: -0.02em; }
.speed { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.speed button { padding: 4px 9px; border-radius: 7px; font-size: 12px; font-family: var(--mono); color: var(--dim); }
.speed button.on { background: var(--surface-3); color: var(--text); }
.tabs2 { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs2 button { padding: 10px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs2 button.on { color: var(--text); border-color: var(--accent); }
.res-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.res-item:hover { border-color: var(--border-2); }

.curr { border-left: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; height: calc(100dvh - 64px); position: sticky; top: 64px; }
.curr-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.curr-body { overflow-y: auto; padding: 10px; flex: 1; position: relative; }
.curr-mod { margin-bottom: 6px; }
.curr-mod > div { padding: 12px 10px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; display: flex; justify-content: space-between; }

/* profile */
.profile { display: grid; grid-template-columns: 300px 1fr; gap: 24px; margin-top: 28px; align-items: start; }
.profile-card { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 32px 22px; }
.profile-card .avatar { width: 84px; height: 84px; font-size: 28px; margin-bottom: 8px; }

/* bottom tab bar on phones */
.tabbar { display: none; }

@media (max-width: 1080px) {
  .player-wrap { grid-template-columns: 1fr; }
  .curr { position: static; height: auto; border-left: 0; border-top: 1px solid var(--border); }
  .curr-body { overflow: visible; }
  .player-wrap.wide .curr { display: flex; }
  .toggle-curr { display: none; }
  .cbody { grid-template-columns: 1fr; }
  .cside { position: static; }
}
@media (max-width: 760px) {
  .topnav { display: none; }
  .user-btn .nm { display: none; }
  .user-btn { padding: 4px; }
  .resume { grid-template-columns: 1fr; }
  .resume .cover { min-height: 190px; }
  .resume .cover::after { background: linear-gradient(180deg, transparent 50%, var(--surface)); }
  .resume-body { padding: 22px; }
  .kpis { grid-template-columns: 1fr; }
  .deck-top { padding: 12px 18px; }
  .deck-main { grid-template-columns: 1fr; padding: 24px 18px 4px; gap: 22px; }
  .deck-stats { grid-template-columns: repeat(3, 1fr); }
  .deck-stats div { min-width: 0; padding: 12px 14px; }
  .deck-stats dd { font-size: 20px; }
  .chart { padding: 14px 18px 0; gap: 5px; height: 130px; }
  .chart .ph svg { height: 96px; }
  .chart .ph > span { font-size: 9px; }
  .deck-foot { padding: 12px 18px 18px; }
  .crows { grid-template-columns: 1fr; }
  .crow-main h4 { font-size: 22px; }
  .phase summary { grid-template-columns: 38px 1fr 20px; gap: 12px; padding: 14px; }
  .phase-n { width: 38px; height: 38px; font-size: 19px; }
  .phase-p { display: none; }
  .hide-xs { display: none; }
  .kpi { padding: 16px; }
  .profile { grid-template-columns: 1fr; }
  .page { padding: 24px 0 110px; }
  .lesson-bar { padding: 12px 16px; }
  .lesson-content { padding: 20px 16px 110px; }
  .stage-inner { max-height: none; }
  .lesson-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
  .lesson-actions > .btn:first-child { grid-column: 1 / -1; }
  .lesson-bar .speed { order: 3; width: 100%; justify-content: space-between; }
  .lesson-bar .speed button { flex: 1; }
  .tabbar { display: flex; position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 62px; border-radius: 20px; background: var(--header); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .tabbar a { flex: 1; display: grid; place-items: center; align-content: center; gap: 3px; font-size: 11px; color: var(--dim); font-weight: 500; }
  .tabbar a.on { color: var(--accent); }
  .tabbar .i { width: 21px; height: 21px; }
}

/* banner ends with the chart (no footer line) */
.deck > .chart:last-child { height: auto; padding-bottom: 20px; }
