/* ---------- Professional flat theme ---------- */
.source-notice{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;padding:18px;margin-bottom:22px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--text)}
.source-notice>div:first-child{flex:1 1 280px;min-width:0}
.source-notice p{margin:6px 0 0;color:var(--muted);font-size:13px;line-height:1.6}
.source-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.source-notice .source-actions{justify-content:flex-start}
.akki-verification{width:min(500px,calc(100vw - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;padding:28px;border:1px solid var(--line);border-radius:20px;background:var(--panel);color:var(--text);overflow:auto}
.akki-verification::backdrop{background:#10182899}
.akki-verification h2{font-size:22px;margin:8px 28px 12px 0}
.akki-verification p{color:var(--muted);font-size:14px;line-height:1.6}
.akki-verification .av-close{position:absolute;right:12px;top:12px}
.akki-verification .source-actions{justify-content:flex-start;margin:18px 0}
.akki-verification form{display:grid;gap:12px;margin-top:22px}
.akki-verification label{font-size:14px;font-weight:600}
.akki-verification input{box-sizing:border-box;width:100%;min-width:0;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--text);font:inherit}
.akki-verification [data-av-status]{min-height:22px}
.akki-verification>a{color:var(--brand)}
/* Loaded last. One solid accent on neutral surfaces: no decorative gradients, glows or tinted backdrops.
   Gradients that do a job stay in ux.css: the dark scrim behind video controls, the seek-bar fill,
   the scroll-edge fade on the category row and the loading shimmer. */
:root{--bg:#f6f7f9;--panel:#fff;--text:#14151a;--muted:#646875;--line:#e4e6eb;--soft:#f1f2f5;--brand:#4f46e5;--brand-hover:#4338ca;--brand-soft:#eef0fd;--brand-ink:#3730a3;--on-brand:#fff;--accent:#eef0fd;--forest:#3730a3;--ring:#6366f1;--hero:#1e1b4b;--hero-ink:#c9cdee;--shadow:0 1px 2px #1018280d,0 4px 14px -6px #1018281f;--shadow-sm:0 1px 2px #1018280d;--shadow-md:0 1px 3px #10182814,0 10px 24px -14px #10182838}
html[data-theme="dark"]{--bg:#0e0f13;--panel:#16181d;--text:#e9eaee;--muted:#9a9eab;--line:#262933;--soft:#1e2027;--brand:#6366f1;--brand-hover:#7c7ff5;--brand-soft:#23264a;--brand-ink:#c7d2fe;--on-brand:#fff;--accent:#23264a;--forest:#c7d2fe;--ring:#818cf8;--hero:#1a1c38;--hero-ink:#b9bde0;--shadow:0 1px 2px #0006;--shadow-sm:0 1px 2px #0006;--shadow-md:0 1px 3px #0008,0 10px 24px -14px #000c}
body:before{display:none}
::selection{background:#c7d2fe;color:#1e1b4b}

/* Brand mark, avatars and icon badges */
.brand-mark{background:var(--brand);color:#fff;box-shadow:none}
.brand-dot,.player-wordmark>span:last-child{color:var(--brand)}
.avatar,.pm-avatar,html[data-theme="dark"] .avatar,html[data-theme="dark"] .pm-avatar{background:var(--brand-soft);color:var(--brand-ink);border-color:var(--line);box-shadow:none}
.drawer-avatar{background:var(--brand-soft);color:var(--brand-ink)}
.pf-resume-icon,.pm-resume-icon,.direct-badge,html[data-theme="dark"] .pm-resume-icon{background:var(--brand);color:#fff;box-shadow:none}
.avatar.has-pet{box-shadow:none}
.pm-avatar.has-pet{box-shadow:0 0 0 3px var(--pet-ring)}
.empty-state>span,html[data-theme="dark"] .empty-state>span{background:var(--brand-soft);color:var(--brand)}

/* Navigation: quiet selected state instead of a filled pill */
.nav-item.active,html[data-theme="dark"] .nav-item.active{background:var(--brand-soft);color:var(--brand-ink);box-shadow:none}
.nav-item.active .nav-count{background:var(--panel);color:var(--brand-ink)}
.tab-item.active,html[data-theme="dark"] .tab-item.active{background:var(--brand-soft);color:var(--brand-ink)}
.sidebar-note,html[data-theme="dark"] .sidebar-note{background:var(--soft)}
.note-art,.eyebrow,html[data-theme="dark"] .eyebrow{color:var(--brand)}
.explore-link,html[data-theme="dark"] .explore-link,.text-button{color:var(--brand)}

/* Hero banners: one solid deep colour */
.hero,html[data-theme="dark"] .hero{background:var(--hero);box-shadow:none;border:0}
.hero-label{background:#ffffff14;color:var(--hero-ink)}
.hero h1 em,.hero h2 em{color:#a5b4fc}
.hero p{color:var(--hero-ink)}
.hero-actions .button-primary{background:#fff;border-color:#fff;color:#1e1b4b;box-shadow:none}
.hero-actions .button-primary:hover{background:#eef0fd}
.pf-hero,.cw-hero{background:var(--hero);box-shadow:none}
.pf-hero:after,.cw-hero::after{display:none}
.pf-level{background:#ffffff12;border-color:#ffffff1f}
.pf-level-bar i,.cw-progress span{background:#fbbf24}

/* Buttons */
.button-primary,html[data-theme="dark"] .button-primary{background:var(--brand);border-color:var(--brand);color:var(--on-brand);box-shadow:none}
.button-primary:hover,html[data-theme="dark"] .button-primary:hover{background:var(--brand-hover);border-color:var(--brand-hover);box-shadow:none;filter:none}
.button:not(.button-primary):not(:disabled):hover,html[data-theme="dark"] .button:not(.button-primary):not(:disabled):hover{background:var(--soft);border-color:var(--line)}
.akki-action--play,html[data-theme="dark"] .akki-action--play{background:var(--brand);box-shadow:none}
.akki-action--play:hover,html[data-theme="dark"] .akki-action--play:hover{background:var(--brand-hover);box-shadow:none}
.lesson-play{background:var(--brand-soft);color:var(--brand)}
html[data-theme="dark"] .lesson-play:not(:disabled){background:var(--brand-soft);color:var(--brand-ink)}
.lesson-play:not(:disabled):hover{box-shadow:none;background:var(--brand);color:#fff}

/* Chips and tabs: solid ink when selected */
.category-bar button.active,.resource-tabs button.active,.pill.active,
html[data-theme="dark"] .category-bar button.active,html[data-theme="dark"] .resource-tabs button.active,html[data-theme="dark"] .pill.active{background:var(--text);border-color:var(--text);color:var(--panel);box-shadow:none}
.pill.active em{color:inherit;opacity:.7}
.group-item.active,html[data-theme="dark"] .group-item.active{background:var(--brand-soft);color:var(--brand-ink)}
.group-item.active em{background:var(--panel);color:var(--brand-ink)}
.speed-options button[aria-pressed="true"]{background:var(--brand);color:#fff;box-shadow:none}
.chapter-number,html[data-theme="dark"] .chapter-number{background:var(--brand-soft);color:var(--brand-ink)}

/* Cards and tiles */
.batch-card:hover,.subject-card:hover,.chapter-card:hover,.lesson-card:hover{border-color:#d3d6dd;box-shadow:var(--shadow-md)}
html[data-theme="dark"] .batch-card:hover,html[data-theme="dark"] .subject-card:hover,html[data-theme="dark"] .chapter-card:hover,html[data-theme="dark"] .lesson-card:hover{border-color:#353946}
.batch-cover,.batch-cover[data-cat],html[data-theme="dark"] .batch-cover[data-cat],.cover-fallback{background:var(--soft)}
.batch-cover .cover-fallback,html[data-theme="dark"] .batch-cover .cover-fallback{color:var(--muted)}
.subject-card.is-rich .subject-symbol{background:hsl(var(--h) 85% 95%);box-shadow:none}
html[data-theme="dark"] .subject-card.is-rich .subject-symbol{background:hsl(var(--h) 30% 20%);box-shadow:none}
.subject-card.is-all,html[data-theme="dark"] .subject-card.is-all{background:var(--panel);border-color:var(--line)}
.subject-card.is-rich::after{display:none}
.subject-card.is-rich:hover{border-color:#d3d6dd;box-shadow:var(--shadow-md)}
html[data-theme="dark"] .subject-card.is-rich:hover{border-color:#353946;box-shadow:var(--shadow-md)}
.direct-art,html[data-theme="dark"] .direct-art{background:var(--soft)}
.direct-art .giant-play{background:var(--panel);border-color:var(--line);color:var(--brand);box-shadow:0 0 0 18px var(--brand-soft)}
html[data-theme="dark"] .direct-art .giant-play{background:var(--panel);border-color:var(--line);color:var(--brand-ink);box-shadow:0 0 0 18px var(--brand-soft)}

/* Profile and progress */
.pm-usage,.pm-resume,html[data-theme="dark"] .pm-usage,html[data-theme="dark"] .pm-resume{background:var(--panel);border-color:var(--line)}
.pm-resume:hover{box-shadow:var(--shadow-md)}
.pm-bar,html[data-theme="dark"] .pm-bar{background:var(--soft)}
.pm-bar i{background:#c7d2fe}
html[data-theme="dark"] .pm-bar i{background:#3d4170}
.pm-day.is-today .pm-bar i,html[data-theme="dark"] .pm-day.is-today .pm-bar i{background:var(--brand)}
.recent-progress>span,.cw-row-foot .cw-progress span,.video-wrap::after{background:var(--brand)}
.cw-thumb{background:conic-gradient(var(--brand) var(--p,0%),var(--brand-soft) 0);color:var(--brand)}
html[data-theme="dark"] .cw-thumb{background:conic-gradient(var(--brand) var(--p,0%),var(--soft) 0);color:var(--brand-ink)}

/* Theme switch */
.theme-toggle,html[data-theme="dark"] .theme-toggle{background:var(--soft);border-color:var(--line)}
.theme-toggle:hover{box-shadow:0 0 0 3px var(--brand-soft)}

/* Player loading: plain dark screen and a single-colour spinner */
.player-loading{background:#0b0c10}
.player-loading::before{display:none}
.pl-ring{background:none;-webkit-mask:none;mask:none;border:3px solid #ffffff1a;border-top-color:#a5b4fc}
.seek-ripple.is-left,.seek-ripple.is-right{background:#ffffff1a}

/* Toast, dialogs, focus */
#toast{background:#1d1f26;color:#f1f2f5;border-color:#2c2f38;box-shadow:var(--shadow-md)}
dialog::backdrop{background:#0b0c10b3}
.search-box:focus-within,.direct-card input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}

/* Access gate and update prompt */
.gate,html[data-theme="dark"] .gate{background:var(--bg);backdrop-filter:none}
.gate-card{box-shadow:var(--shadow-md)}
.gate-mark,html[data-theme="dark"] .gate-mark{background:var(--brand-soft);box-shadow:none}
.gate-mark.is-update{background:#e7f6ee}
html[data-theme="dark"] .gate-mark.is-update{background:#16302a}

/* Phones: no menu button; the tab bar and Profile → Your library reach every page */
@media(max-width:800px){.mobile-menu{display:none}.topbar-path{margin-left:4px}}

/* NextTopper and KGS lists: search and a Filters button on one row, chips only when asked for */
.akki-toolbar{flex-wrap:nowrap;gap:10px;margin:0 0 14px}
.akki-toolbar .akki-search{flex:1;width:auto;max-width:520px;order:0}
.akki-filter-toggle{display:inline-flex;align-items:center;gap:8px;flex:none;height:46px;padding:0 16px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);font-weight:650;font-size:14px}
.akki-filter-toggle svg{width:18px;height:18px}
.akki-filter-toggle[aria-expanded="true"]{background:var(--text);border-color:var(--text);color:var(--panel)}
.akki-filter-toggle b{min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:var(--brand);color:#fff;font-size:11.5px;line-height:20px;text-align:center}
.akki-facets{margin:0 0 6px;padding:14px 14px 4px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.akki-count{margin:10px 0 16px}
@media(max-width:800px){
  .akki-head{display:none}
  .akki-toolbar{flex-direction:row;align-items:center;margin-top:-6px}
  .akki-toolbar .akki-search{max-width:none}
  .akki-filter-toggle span{display:none}
  .akki-filter-toggle{width:46px;padding:0;justify-content:center;position:relative}
  .akki-filter-toggle b{position:absolute;top:-6px;right:-6px}
}

/* Profile opens from the avatar in the top bar, so it is styled as an obvious button */
#profile-button{position:relative;width:40px;height:40px;border:2px solid var(--brand);cursor:pointer;transition:transform .12s,background .15s}
#profile-button:active{transform:scale(.93)}
#profile-button::after{content:'';position:absolute;right:-5px;bottom:-5px;width:17px;height:17px;border-radius:50%;border:2px solid var(--panel);background:var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/11px no-repeat}
#profile-button.is-active{background:var(--brand);color:#fff}

.lecture-filters{display:contents}
/* Lecture list: one grouped list with hairline dividers instead of floating cards */
.lesson-list{gap:0;background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.lesson-card,.lesson-card:hover{border:0;border-radius:0;box-shadow:none;border-bottom:1px solid var(--line)}
.lesson-card:last-child{border-bottom:0}
.lesson-card.is-clickable:hover{background:var(--soft)}
.lesson-card.is-clickable:active{transform:none;background:var(--soft)}
.lesson-card .lesson-play{border-radius:12px}
.lesson-card.is-clickable:hover .lesson-play:not(:disabled){transform:none;box-shadow:none;background:var(--brand);color:#fff}
.lesson-kicker,html[data-theme="dark"] .lesson-kicker{color:var(--brand);letter-spacing:.3px}
html[data-theme="dark"] .lesson-kicker{color:var(--brand-ink)}
.lesson-copy h3{font-weight:650}
.lecture-summary{color:var(--muted)}
@media(max-width:800px){
  .lecture-toolbar{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px}
  .lecture-toolbar .lecture-search{flex:1 0 100%;order:-1}
  /* The three dropdowns become one swipeable row of chips; their menus open across the whole toolbar. */
  .lecture-toolbar{position:relative;z-index:30}
  .lecture-filters{display:flex;flex:1 0 100%;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px}
  .lecture-filters::-webkit-scrollbar{display:none}
  .lecture-filters .lecture-select{flex:0 0 auto;width:auto;position:static}
  .lecture-filters .lecture-select .dd{position:static}
  .lecture-filters .dd-button{width:auto;min-height:40px;padding:0 12px 0 14px;gap:6px;border-radius:999px;font-size:13.5px;box-shadow:none;white-space:nowrap}
  .lecture-filters .dd-button svg{width:16px;height:16px}
  .lesson-card{padding:14px 14px 14px 12px;gap:12px}
  .lesson-card .lesson-play{width:40px;height:40px}
  .lesson-copy h3{font-size:15px}
}

/* Below the video: clear title, pill buttons, compact "Up next" list */
.player-details .eyebrow{color:var(--muted);letter-spacing:.6px}
.player-details h2{font-weight:700;letter-spacing:-.3px}
.player-controls .button{min-height:44px;border-radius:999px;padding:0 18px;font-size:14px;font-weight:650;box-shadow:none}
#loop-lecture{background:var(--soft);border-color:var(--soft);color:var(--text)}
#loop-lecture[aria-pressed="true"]{background:var(--brand-soft);border-color:var(--brand);color:var(--brand-ink)}
#player-message{display:flex;align-items:center;gap:6px;margin:12px 0 0;font-size:12.5px;color:var(--muted)}
.playlist-heading strong{font-size:16px;font-weight:700}
.playlist-heading>span{padding:2px 9px;border-radius:99px;background:var(--soft);font-size:12px;font-weight:650;color:var(--muted)}
.playlist-item{border-bottom:1px solid var(--line)}
.playlist-item.active{background:var(--brand-soft);box-shadow:inset 3px 0 0 var(--brand)}
.playlist-item.active h3{color:var(--brand-ink);font-weight:650}
.playlist-index{color:var(--muted);font-variant-numeric:tabular-nums}
@media(max-width:800px){
  .player-details{padding:16px 16px 18px}
  .player-details h2{font-size:18px;margin:6px 0 14px}
  .player-controls{display:grid;grid-template-columns:auto 1fr;gap:10px}
  .player-controls #next-lecture{margin-left:0;justify-content:center}
  .playlist-heading{padding:16px}
  .playlist-hint{display:none}
  .playlist-item{padding:13px 16px}
}

/* Profile: playback speed as a grid of choices (0.5× to 4×) instead of a small dropdown */
.pf-speed-row{padding-bottom:6px}
.pf-speed-now{margin-left:auto;padding:4px 10px;border-radius:99px;background:var(--brand-soft);color:var(--brand-ink);font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.pf-speed{display:grid;grid-template-columns:repeat(auto-fill,minmax(58px,1fr));gap:8px;padding:6px 16px 16px}
.pf-speed button{height:40px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);font-size:14px;font-weight:650;font-variant-numeric:tabular-nums}
.pf-speed button:active{transform:scale(.96)}
.pf-speed button[aria-checked="true"]{background:var(--brand);border-color:var(--brand);color:#fff}

/* Lecture page on phones: a shorter header so lectures start higher, and two-line lecture titles */
main .resource-tabs button.active{box-shadow:none}
.lesson-copy h3{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
@media(max-width:800px){
  /* The page title already names the current step, so the breadcrumb stops at its parent and never runs off screen. */
  main:has(.resource-tabs) .breadcrumb strong,main:has(.resource-tabs) .breadcrumb svg:has(+ strong){display:none}
  main:has(.resource-tabs) .breadcrumb{margin-bottom:6px}
  main:has(.resource-tabs) .page-title{font-size:24px;letter-spacing:-.5px}
  main:has(.resource-tabs) .page-heading{margin-bottom:12px}
  main .resource-tabs{margin-bottom:12px;box-shadow:none}
  main .resource-tabs button{min-height:36px;font-size:13px}
  .lecture-toolbar .lecture-search input{min-height:42px}
  .lecture-summary{margin-bottom:8px}
  .lesson-copy .lesson-kicker{font-size:10.5px}
  .lesson-copy h3{font-size:14.5px;line-height:1.4}
}

/* Bottom tab bar: a pill behind the active icon (no filled block), quiet labels, hairline on top */
@media(max-width:800px){
  .tabbar{gap:0;padding:6px 4px calc(6px + env(safe-area-inset-bottom));background:var(--panel);border-top:1px solid var(--line);box-shadow:0 -8px 24px -18px #10182855;backdrop-filter:none;-webkit-backdrop-filter:none}
  .tab-item,.tab-item.active,html[data-theme="dark"] .tab-item.active{gap:4px;min-height:58px;border-radius:0;background:none;color:var(--muted)}
  .tab-item>span:first-child{display:grid;place-items:center;width:58px;height:32px;border-radius:999px;transition:background .2s,color .2s}
  .tab-item svg{width:22px;height:22px}
  .tab-item.active>span:first-child{background:var(--brand-soft);color:var(--brand-ink)}
  .tab-item:active>span:first-child{background:var(--soft)}
  .tabbar .tab-item span:last-child{font-size:11px;font-weight:600;letter-spacing:.1px}
  .tabbar .tab-item.active span:last-child{font-weight:750;color:var(--brand-ink)}
}

/* ---------- Skeleton loading: grey shapes of the page that is coming ---------- */
/* One opacity pulse on the wrapper (no moving gradient), so slow phones are not repainting every frame. */
:root{--sk:#e8eaee}
html[data-theme="dark"]{--sk:#23262e}
.sk-wrap{animation:sk-pulse 1s ease-in-out infinite alternate}
@keyframes sk-pulse{from{opacity:1}to{opacity:.5}}
.sk-card{background:var(--panel);border:1px solid var(--line);border-radius:16px}
.sk-row{display:flex;align-items:center;gap:14px;padding:16px}
.sk-box{display:block;flex:none;background:var(--sk)}
.sk-icon{width:52px;height:52px;border-radius:16px}
.sk-num{width:36px;height:38px;border-radius:10px}
.sk-play{width:40px;height:40px;border-radius:12px}
.sk-copy{flex:1;display:flex;flex-direction:column;gap:9px;min-width:0}
.sk-line{display:block;height:11px;border-radius:6px;background:var(--sk)}
.sk-copy .sk-line:nth-child(2){height:14px}
.sk-bar{display:block;height:44px;margin-bottom:10px;border-radius:12px;background:var(--panel);border:1px solid var(--line)}
.sk-chips{display:flex;gap:8px;margin-bottom:14px;overflow:hidden}
.sk-chips b{display:block;flex:none;width:118px;height:38px;border-radius:999px;background:var(--panel);border:1px solid var(--line)}
.sk-list .sk-row{border-bottom:1px solid var(--line)}
.sk-list .sk-row:last-child{border-bottom:0}
.chapter-list.sk-wrap{display:flex;flex-direction:column;gap:10px}
.skeleton{height:auto;background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.skeleton:before{content:'';display:block;height:auto;aspect-ratio:1.94;background:var(--sk);animation:none}
.skeleton:after{content:'';display:block;width:72%;height:14px;margin:18px 18px 44px;border-radius:7px;background:var(--sk);box-shadow:0 26px 0 0 var(--sk)}

/* ---------- Motion: short, opacity/transform only, so it stays smooth on slow phones ---------- */
@keyframes content-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
@keyframes sheet-up{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
.subject-grid:not(.sk-wrap),.chapter-list:not(.sk-wrap),.lesson-list:not(.sk-list),.batch-grid:not(.sk-wrap),.akki-facets:not([hidden]){animation:content-in .22s ease-out both}
.gate-card{animation:fade-in .18s ease-out both}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,14px)}to{opacity:1;transform:translate(-50%,0)}}
#toast:not([hidden]){animation:toast-in .22s ease-out both}
@media(max-width:800px){.player-dialog[open]{animation:sheet-up .24s ease-out both}}
/* Press feedback: the card or button dips slightly under the finger */
.batch-card,.subject-card,.chapter-card,.akki-card,.button,.pill,.category-bar button,.pf-speed button,.akki-filter-toggle{transition:transform .14s ease,background-color .15s,border-color .15s,box-shadow .15s}
.batch-card:active,.subject-card:active,.chapter-card:active,.akki-card:active{transform:scale(.985)}
.button:active,.pill:active,.category-bar button:active,.akki-filter-toggle:active{transform:scale(.96)}
/* Tab bar: the pill grows in behind the icon when a tab becomes active */
@media(max-width:800px){
  .tab-item>span:first-child{position:relative;isolation:isolate}
  .tab-item.active>span:first-child{background:none}
  .tab-item>span:first-child::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:999px;background:var(--brand-soft);opacity:0;transform:scaleX(.45);transition:transform .25s ease,opacity .2s ease}
  .tab-item.active>span:first-child::before{opacity:1;transform:none}
}

/* ---------- Smooth scrolling on slow phones ---------- */
/* No live blur behind bars (expensive while scrolling), and cards off screen are not drawn until scrolled near. */
.topbar,html[data-theme="dark"] .topbar{background:var(--panel);backdrop-filter:none;-webkit-backdrop-filter:none}
.batch-category{backdrop-filter:none;-webkit-backdrop-filter:none}
dialog::backdrop,.embed-player::backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}
.lesson-card,.playlist-item{content-visibility:auto;contain-intrinsic-size:auto 92px}
.batch-grid>.batch-card,.batch-grid>[data-item]{content-visibility:auto;contain-intrinsic-size:auto 340px}
/* Low-memory or few-core phones (html.lite, set in app.js): content appears without entrance motion */
html.lite .page-fade,html.lite .subject-grid:not(.sk-wrap),html.lite .chapter-list:not(.sk-wrap),html.lite .lesson-list:not(.sk-wrap),html.lite .batch-grid:not(.sk-wrap),html.lite .akki-facets,html.lite .gate-card,html.lite #toast,html.lite .player-dialog[open]{animation:none}
html.lite .sk-wrap{animation-duration:1.6s}
html.lite .batch-card:hover{transform:none}

/* The app never zooms: no double-tap zoom anywhere (the video's own double-tap seek still works) */
html{touch-action:manipulation;-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* NextTopper and KGS batches use the PW card; inside the filter wrapper it still fills its grid cell */
.batch-grid>[data-name]>.batch-card{flex:1;display:flex;flex-direction:column;min-width:0}
a.batch-cover,a.explore-link{text-decoration:none}

/* A NextTopper or KGS row waiting for its PDF or lecture link (its button is hidden on phones). */
.akki-row.is-busy{opacity:.55;pointer-events:none;transition:opacity .15s}
.hero-live{display:inline-flex;align-items:center;gap:7px;margin-top:12px;padding:5px 11px;border-radius:999px;background:#ffffff1a;color:#e6e7fb;font-size:11px;font-weight:600}.hero-live i{width:7px;height:7px;border-radius:50%;background:#34d399;box-shadow:0 0 0 3px #34d39933}
.gate-help{display:block;margin-top:12px;padding:10px;border-radius:10px;border:1px dashed var(--brand);color:var(--brand);font-weight:700;font-size:13px;text-align:center;letter-spacing:.4px}

.batch-search-form{display:flex;align-items:stretch;gap:10px;width:100%;max-width:500px;margin:0 0 20px}
.batch-search-form .search-box{flex:1;min-width:0;width:auto;order:0}
.batch-search-form .button{flex:none;min-height:48px;margin:0}
@media(max-width:540px){
  .batch-search-form{gap:8px}
  .batch-search-form .search-box input{font-size:16px}
  .batch-search-form .button{padding-inline:14px}
}

.sk-search,.sk-nav{height:48px;margin-bottom:20px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.sk-search{width:100%;max-width:500px}
.sk-nav{width:90px}
@media(prefers-reduced-motion:reduce){
  .sk-wrap{animation:none}
}
.batch-materials{display:grid;gap:10px;background:transparent;border:0}
.batch-materials details{min-width:0;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.batch-materials summary{min-height:48px;padding:12px;cursor:pointer;font-weight:700;overflow-wrap:anywhere}
.batch-materials summary small{margin-inline-start:5px;color:var(--muted);white-space:nowrap}
.batch-material-chapters,.batch-material-items{display:grid;gap:8px;padding:0 10px 10px}
.batch-material-items h3{margin:6px 0 0;font-size:14px}
.batch-material-items ul{list-style:none;margin:0;padding:0}
.batch-material-items a{display:block;min-height:44px;padding:10px 4px;border-top:1px solid var(--line);overflow-wrap:anywhere}
.batch-material-items button[data-media-id]{display:block;width:100%;min-height:44px;padding:10px 4px;border:0;border-top:1px solid var(--line);background:transparent;color:var(--text);text-align:start;font:inherit;cursor:pointer;overflow-wrap:anywhere}
.batch-material-switch{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.batch-material-switch .button{min-height:44px}

.batch-browser-player{box-sizing:border-box;width:min(1040px,calc(100% - 24px));max-height:calc(100dvh - 24px);margin:auto;padding:0;overflow:auto;border:1px solid #333747;border-radius:18px;background:#151722;color:#fafaff;box-shadow:0 24px 90px #0506119c}
.batch-browser-player::backdrop{background:#090b17cf}
.batch-player-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;border-bottom:1px solid #2e3042}
.batch-player-top h2,.batch-player-top p{margin:0}
.batch-player-top h2{font-size:clamp(1rem,2.3vw,1.25rem);line-height:1.35;overflow-wrap:anywhere}
.batch-player-top p{margin-bottom:3px;color:#b9b2ed;font-size:.76rem;font-weight:650}
.batch-player-top form{flex:none;margin:0}
.batch-player-close,.batch-player-actions button,.batch-player-actions select{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:44px;min-height:44px;padding:0 8px;border:0;border-radius:9px;background:transparent;color:#f7f7fd;font:inherit;cursor:pointer}
.batch-player-close:hover,.batch-player-actions button:hover{background:#292d40}
.batch-player-close svg,.batch-player-actions svg{width:20px;height:20px;stroke:currentColor;flex:none}
.batch-player-stage{position:relative;background:#08090e}
.batch-player-stage video{display:block;width:100%;max-height:min(66dvh,590px);aspect-ratio:16/9;object-fit:contain;cursor:pointer}
.batch-player-feedback{position:absolute;inset:0;display:grid;place-items:center;padding:16px;pointer-events:none}
.batch-player-feedback p{max-width:420px;margin:0;padding:10px 14px;border:1px solid #535674;border-radius:12px;background:#151725f5;color:#f8f8fd;text-align:center;font-size:.9rem}
.batch-player-feedback p.is-loading{display:flex;align-items:center;gap:10px;box-shadow:0 8px 24px #08091270}
.batch-player-feedback p.is-loading::before{content:"";flex:none;width:18px;height:18px;border:2px solid #666586;border-top-color:#d9ceff;border-radius:50%;animation:study-loader-spin .75s linear infinite}
.batch-player-feedback p:empty{display:none}
.batch-player-controls{display:grid;gap:2px;padding:5px 14px 10px;border-top:1px solid #2e3042;background:#151722}
.batch-player-timeline,.batch-player-actions,.batch-player-settings{display:flex;align-items:center;gap:6px}
.batch-player-timeline input{flex:1;min-width:0;min-height:30px;margin:0;accent-color:#b8acff;cursor:pointer}
.batch-player-timeline output{flex:none;color:#d8d7e8;font-size:.8rem;font-variant-numeric:tabular-nums}
.batch-player-settings{margin-inline-start:auto}
.batch-player-actions .batch-player-play{background:#dcd5ff;color:#211846}
.batch-player-actions .batch-player-play:hover{background:#eee9ff}
.batch-player-actions select{background:#27293b;color-scheme:dark}
.batch-player-actions button:disabled,.batch-player-timeline input:disabled{opacity:.45;cursor:default}
.batch-player-actions button span{font-size:.75rem}
.batch-player-view:fullscreen{display:flex;flex-direction:column;justify-content:center;background:#08090e}
.batch-player-view:fullscreen .batch-player-stage{flex:1;min-height:0}
.batch-player-view:fullscreen video{height:100%;max-height:none}
.batch-browser-player :focus-visible{outline:2px solid #c8c0ff;outline-offset:2px}
@media(max-width:540px){
  .batch-browser-player{width:calc(100% - 12px);border-radius:12px}
  .batch-player-top,.batch-player-controls{padding-inline:8px}
  .batch-player-actions,.batch-player-settings{gap:2px}
  .batch-player-actions button span{display:none}
}
.batch-material-items button[data-media-id]{display:flex;align-items:center;gap:12px}
.lecture-thumbnail{position:relative;display:grid;place-items:center;flex:none;width:clamp(68px,18vw,96px);aspect-ratio:16/9;overflow:hidden;border-radius:8px;background:var(--brand-soft);color:var(--brand-ink)}
.lecture-thumbnail svg{width:20px;height:20px;stroke:currentColor}
.lecture-thumbnail-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.lecture-thumbnail-image[hidden]{display:none}
.batch-pdf-group{min-width:0;padding:2px 10px 4px;border-radius:10px;background:var(--soft)}
.batch-pdf-group h3{display:flex;align-items:center;gap:8px;margin:8px 0;padding-inline:4px}
.batch-pdf-group h3 small{color:var(--muted);font-weight:550}
.batch-pdf-group a{display:flex;align-items:center;gap:10px}
.batch-pdf-group a>span:first-child{flex:none;color:var(--brand)}
.batch-pdf-group a svg{display:block;width:18px;height:18px;stroke:currentColor}
.study-lecture-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr));gap:14px;align-items:start}
.study-lecture-card{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--panel);box-shadow:var(--shadow-sm)}
.study-lecture-card .study-lecture-open,.batch-material-items .study-lecture-open[data-media-id]{display:block;width:100%;padding:0;border:0;background:transparent;color:var(--text);text-decoration:none;text-align:start;cursor:pointer;font:inherit}
.study-lecture-open:focus-visible{outline-offset:-3px}
.study-lecture-cover{position:relative;display:grid;place-items:center;aspect-ratio:16/9;background:var(--brand-soft);color:var(--brand-ink);overflow:hidden}
.study-cover-play{z-index:1;display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#231d40d9;color:#fff}
.study-cover-play svg,.study-related svg{flex:none;width:18px;height:18px;stroke:currentColor}
.study-lecture-name,.study-lecture-caption{display:block;overflow-wrap:anywhere}
.study-lecture-name{padding:12px 14px;font-weight:700;line-height:1.4}
.study-lecture-caption{padding:0 14px 12px;color:var(--muted);font-size:.85rem}
.batch-material-items .study-related{display:grid;gap:5px;margin:0 10px 10px;padding:8px 0 0;border-top:1px solid var(--line)}
.batch-material-items .study-attachment{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;min-height:48px;padding:6px 8px;border:1px solid transparent;border-radius:9px;background:var(--soft);color:var(--text);text-decoration:none;text-align:start}
.batch-material-items .study-attachment:hover,.batch-material-items .study-attachment:focus-visible{border-color:var(--brand);background:var(--panel)}
.study-attachment-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:var(--brand-soft);color:var(--brand-ink)}
.study-attachment[data-kind="dpp"] .study-attachment-icon{background:var(--panel);color:var(--brand)}
.study-attachment-icon svg,.study-attachment-open svg{width:15px;height:15px}
.study-attachment-copy{display:grid;gap:2px;line-height:1.3;overflow-wrap:anywhere}
.study-attachment-copy strong{font-size:.88rem;font-weight:700}
.study-attachment-copy small{color:var(--muted);font-size:.76rem}
.study-attachment-open{display:grid;color:var(--muted)}
.study-archive-grid>.lesson-card{min-width:0;display:grid;grid-template-columns:auto 1fr;align-items:start;gap:10px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.study-archive-grid>.lesson-card>.button{grid-column:2;justify-self:start}
.study-archive-grid .lesson-copy{min-width:0;overflow-wrap:anywhere}
@media(max-width:540px){.study-lecture-grid{grid-template-columns:1fr;gap:10px}}
.batch-library-view{display:block;min-width:0}
.batch-library-heading{margin:0 0 14px;scroll-margin-top:100px;font-size:clamp(1.2rem,3vw,1.65rem);overflow-wrap:anywhere}
.batch-library-heading:focus{outline:none}
.batch-library-crumbs{flex-wrap:wrap;margin-bottom:10px}
.batch-library-crumbs button{min-height:44px;padding:0 4px;border:0;background:transparent;color:var(--brand);font:inherit;font-weight:650;cursor:pointer}
.batch-library-card-copy{display:grid;gap:4px;min-width:0;text-align:start;overflow-wrap:anywhere}
.batch-library-card-copy span{color:var(--muted);font-size:.85rem}
.batch-library-view :is(.subject-symbol,.chapter-number,.tile-arrow) svg{width:20px;height:20px}
.batch-library-view .subject-card,.batch-library-view .chapter-card{min-width:0;text-align:start}
.batch-library-view .batch-material-items{padding:0}
@media(max-width:540px){
  .batch-library-view .subject-grid{grid-template-columns:1fr}
  .batch-library-heading{scroll-margin-top:76px}
}
.batch-material-switch{scroll-margin-top:85px}
.batch-library-view .batch-pdf-group{padding:0 0 12px;background:transparent}
.study-document-grid{align-items:stretch}
.batch-material-items .study-document-card{display:flex;align-items:center;gap:10px;min-width:0;min-height:78px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);text-decoration:none;color:var(--text)}
.batch-material-items .study-document-card:hover{border-color:var(--brand)}
.study-document-icon{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:9px;background:var(--brand-soft);color:var(--brand-ink)}
.study-document-copy{display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
.study-document-copy small,.study-document-copy>span,.study-document-arrow{color:var(--muted);font-size:.8rem}
.study-document-arrow{margin-inline-start:auto}
.batch-card--interactive{position:relative;align-self:start;cursor:pointer}
.batch-card--interactive .batch-body{position:static;padding:12px 16px 10px}
.batch-card--interactive .batch-heading{align-items:center}
.batch-card--interactive .batch-title{min-height:0;overflow-wrap:anywhere}
.batch-card--interactive .batch-meta{margin:4px 0 10px}
.batch-card--interactive .batch-bottom{flex-wrap:wrap;margin-top:0;padding-top:4px}
.batch-card--interactive .explore-link{min-height:40px;margin-inline-start:auto;white-space:nowrap}
.batch-card--interactive .explore-link::after{content:"";position:absolute;inset:0;z-index:2;border-radius:inherit}
.batch-card--interactive .explore-link:focus-visible::after{outline:2px solid var(--ring);outline-offset:-3px}
.batch-card--interactive .save-button{position:relative;z-index:3;width:44px;height:44px;margin:-4px -4px -4px 0}
@media(max-width:540px){
  .batch-card--interactive .batch-body{padding-inline:12px}
  .batch-card--interactive .explore-link{min-height:44px}
}
.batch-library-view .tile-arrow{margin-inline-start:auto}
.batch-library-view .chapter-number{background:hsl(var(--h) 85% 95%);color:hsl(var(--h) 58% 35%)}
html[data-theme="dark"] .batch-library-view .chapter-number{background:hsl(var(--h) 30% 20%);color:hsl(var(--h) 75% 78%)}
@media(max-width:540px){.batch-library-view .subject-card.is-rich{padding:12px 14px 12px 18px;gap:12px}.batch-library-view .subject-symbol{width:44px;height:44px}}
.pdf-viewer{display:grid;gap:12px}
.pdf-viewer-bar{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pdf-viewer-bar h1{margin:0;font-size:clamp(1rem,3vw,1.45rem);overflow-wrap:anywhere}
.pdf-viewer-bar .button{flex:none;min-height:44px}
.pdf-viewer-stage{position:relative;min-height:60dvh;height:calc(100dvh - 185px);overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--panel)}
.pdf-viewer-stage iframe{display:block;width:100%;height:100%;border:0;background:var(--panel)}
.pdf-viewer-loading{position:absolute;inset:0;z-index:1;display:grid;place-content:center;justify-items:center;gap:8px;padding:20px;text-align:center;background:var(--panel)}
.pdf-viewer-loading[hidden]{display:none}
.pdf-viewer-loading>span:last-of-type{color:var(--muted);font-size:.9rem}
.pdf-viewer-mark{position:relative;display:grid;place-items:center;width:64px;height:64px;margin-bottom:10px;border-radius:50%;background:var(--brand-soft);color:var(--brand)}
.pdf-viewer-mark::before{content:"";position:absolute;inset:-6px;border:2px solid var(--line);border-top-color:var(--brand);border-radius:50%;animation:study-loader-spin .85s linear infinite}
.pdf-viewer-mark svg{width:26px;height:26px;stroke:currentColor}
.pdf-viewer-loading.is-error .pdf-viewer-mark::before{animation:none;border-color:var(--line)}
@keyframes study-loader-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.pdf-viewer-mark::before,.batch-player-feedback p.is-loading::before{animation:none}}
@media(max-width:540px){.pdf-viewer-stage{height:calc(100dvh - 220px);border-radius:12px}.pdf-viewer-bar .button{padding-inline:10px}}
.batch-player-speed{position:relative}
.batch-player-speed summary{display:flex;align-items:center;justify-content:center;gap:6px;min-width:58px;min-height:44px;padding:0 8px;border:1px solid #48435e;border-radius:9px;list-style:none;background:#232537;color:#f8f7ff;font-size:.85rem;font-weight:700;cursor:pointer}
.batch-player-speed summary::-webkit-details-marker{display:none}
.batch-player-speed summary svg{width:13px;height:13px;transform:rotate(-90deg)}
.batch-player-speed[open] summary{border-color:#ab9ff7}
.batch-player-speed[open] summary svg{transform:rotate(90deg)}
.batch-speed-menu{position:absolute;z-index:3;inset-inline-end:0;bottom:calc(100% + 9px);width:min(258px,calc(100vw - 80px));padding:10px;border:1px solid #48435e;border-radius:14px;background:#1d2030;color:#f8f7ff;box-shadow:0 12px 32px #060610a8}
.batch-speed-menu p{margin:0 0 7px;padding:2px 4px;color:#d2c9f8;font-size:.78rem;font-weight:700}
.batch-speed-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
.batch-player-actions .batch-speed-options button{min-width:0;min-height:44px;padding:0 3px;border-radius:7px;font-size:.79rem;font-weight:650;white-space:nowrap}
.batch-player-actions .batch-speed-options button[aria-pressed="true"]{background:#dcd5ff;color:#211846}
@media(max-width:370px){.batch-speed-options{grid-template-columns:repeat(4,minmax(0,1fr))}}
.batch-playback-badge{display:inline-flex;align-items:center;gap:6px;flex:none;padding:5px 8px;border-radius:999px;background:#303749;color:#f3f5fa;font-size:.72rem;font-weight:750;line-height:1.2}
.batch-playback-badge::before{content:"";width:7px;height:7px;border-radius:50%;background:#a6b1c6}
.batch-playback-badge[data-status="online"]{background:#123a2b;color:#e1ffed}
.batch-playback-badge[data-status="online"]::before{background:#66e6a1;box-shadow:0 0 0 2px #66e6a130}
.batch-playback-badge[data-status="offline"]::before{background:#c8d1e0}
.batch-cover .batch-playback-badge{position:absolute;inset-block-start:9px;inset-inline-end:9px;z-index:3;pointer-events:none;box-shadow:0 2px 10px #13142230}
.batch-playback-legend{display:flex;flex-wrap:wrap;gap:8px 18px;margin:0 0 14px;color:var(--muted);font-size:.85rem}
.batch-playback-legend>span{display:inline-flex;align-items:center;gap:8px}
.batch-player-view:fullscreen .batch-player-controls{position:absolute;z-index:3;inset:auto 0 0;padding-bottom:max(10px,env(safe-area-inset-bottom));background:linear-gradient(transparent,#10111cf0 32%);border:0;transition:opacity .2s ease,transform .2s ease}
.batch-player-view:fullscreen.hide-fullscreen-controls .batch-player-controls{opacity:0;transform:translateY(8px);pointer-events:none}
.batch-player-view:fullscreen.hide-fullscreen-controls video{cursor:none}
@media(prefers-reduced-motion:reduce){.batch-player-view:fullscreen .batch-player-controls{transition:none}}
.study-lecture-cover>.lecture-thumbnail-image{top:-22%;bottom:auto;height:122%;object-position:center top}
.batch-library-back{margin-bottom:12px}
.batch-exam-filter{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 14px}
.batch-exam-filter .button{min-height:40px;padding:7px 12px}
#batch-sync-sources{margin-top:12px}
.batch-library-back{scroll-margin-top:85px}
.batch-resume{display:flex;flex-wrap:wrap;gap:8px;min-height:44px;margin:0 0 14px;text-align:left}
.batch-resume span{font-weight:500;overflow-wrap:anywhere}
