/* Student web app */
  .welcome { background: var(--green); color: #efe7d6; border-radius: 26px; padding: 30px 34px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin-bottom: 22px; position: relative; overflow: hidden; }
  .welcome::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(255,215,168,.2); box-shadow: 0 0 0 40px rgba(255,215,168,.04); }
  .welcome h2 { color: #fff; font-size: 32px; margin-bottom: 6px; }
  .resume { display: flex; gap: 14px; align-items: center; background: rgba(255,255,255,.08); border-radius: 18px; padding: 12px 14px 12px 12px; position: relative; z-index: 1; max-width: 420px; }
  .resume img { width: 74px; height: 56px; border-radius: 12px; object-fit: cover; }
  .resume b { color: #fff; display: block; font-size: 14.5px; }
  .my-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
  .my-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s; }
  .my-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .my-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
  .my-card .b { padding: 16px 18px 18px; display: grid; gap: 10px; flex: 1; }
  .my-card h3 { font-size: 20px; }
  .my-card .p { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); }
  .player { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
  .video { aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; position: relative; background: #111 center / cover; display: grid; place-items: center; }
  .video::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.75)); }
  .video .play { position: relative; width: 78px; height: 78px; border-radius: 50%; background: rgba(255,255,255,.95); display: grid; place-items: center; cursor: pointer; border: 0; transition: transform .25s var(--ease); color: var(--green); }
  .video .play:hover { transform: scale(1.08); }
  .video .play .lucide { width: 30px; height: 30px; margin-left: 4px; }
  .video .cap { position: absolute; left: 22px; bottom: 18px; right: 22px; color: #fff; display: flex; justify-content: space-between; align-items: end; gap: 10px; font-size: 13px; }
  .video .wm { position: absolute; top: 14px; right: 16px; color: rgba(255,255,255,.45); font-size: 12px; font-weight: 700; }
  .vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.2); }
  .vbar i { display: block; height: 100%; width: 0; background: var(--saffron); transition: width .2s linear; }
  .lesson-panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; position: sticky; top: 20px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
  .lesson-panel .hd { padding: 16px 18px; border-bottom: 1px solid var(--line); }
  .lesson-panel .ls { overflow-y: auto; }
  .lp-mod { padding: 12px 18px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
  .lp-item { display: flex; gap: 10px; align-items: center; padding: 10px 18px; font-size: 14px; cursor: pointer; border-left: 3px solid transparent; transition: background .15s; }
  .lp-item:hover { background: #fcf8f0; }
  .lp-item.current { background: var(--green-soft); border-left-color: var(--green-2); font-weight: 700; }
  .lp-item .ck { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cdbf9f; display: grid; place-items: center; flex: none; }
  .lp-item.done .ck { background: var(--green-2); border-color: var(--green-2); color: #fff; }
  .lp-item .ck .lucide { width: 12px; height: 12px; stroke-width: 3; }
  .lp-item .m { margin-left: auto; color: var(--muted); font-size: 12px; }
  .lesson-body { margin-top: 18px; display: grid; gap: 14px; }
  .lesson-body h2 { font-size: 28px; }
  .nav-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
  .quiz-q { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 10px; }
  .quiz-q label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14.5px; }
  .quiz-q label.right { border-color: var(--green-2); background: var(--green-soft); }
  .quiz-q label.wrong { border-color: var(--rose); background: var(--rose-soft); }
  .pdf-card { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
  .pdf-card .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--rose-soft); color: var(--rose); display: grid; place-items: center; flex: none; }
  .cert { background: #fffdf7; border: 10px solid var(--green); outline: 2px solid #c9a865; outline-offset: -20px; border-radius: 6px; padding: 54px 40px; text-align: center; display: grid; gap: 10px; position: relative; }
  .cert h2 { font-size: 44px; font-style: italic; color: var(--green); }
  .cert .seal { width: 84px; height: 84px; border-radius: 50%; background: var(--saffron); color: #fff; display: grid; place-items: center; margin: 10px auto 0; font-family: var(--serif); font-style: italic; font-size: 26px; box-shadow: inset 0 0 0 4px rgba(255,255,255,.4); }
  @media (max-width: 1100px) { .player { grid-template-columns: 1fr; } .lesson-panel { position: static; max-height: 460px; } }
  @media (max-width: 700px) { .welcome { grid-template-columns: 1fr; padding: 24px; } .welcome h2 { font-size: 26px; } .cert { padding: 34px 18px; } .cert h2 { font-size: 30px; } }
  @media print { .side, .topbar, .mobile-top, .no-print { display: none !important; } .shell { display: block; } .main { padding: 0; } }

/* ---------- App shell ---------- */
.splash { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; padding: 24px; }
.splash .logo-mark { width: 64px; height: 64px; font-size: 28px; }
.app-top, .tabbar, .sticky-buy { display: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 14px; background: var(--saffron); }
.avatar.xl { width: 72px; height: 72px; font-size: 28px; background: var(--green-2); }
a.kpi { color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; }
.sec-h h3 { font-family: var(--sans); font-size: 17px; font-weight: 800; letter-spacing: 0; }
.sec-h a { font-size: 14px; font-weight: 700; color: var(--green-2); }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 12px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.mini { grid-template-columns: minmax(0, 1fr); scroll-snap-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 14px; display: grid; gap: 6px; align-content: start; color: inherit; transition: box-shadow .2s; }
.mini:hover { box-shadow: var(--shadow); }
.mini img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; }
.mini.mini-ws img { aspect-ratio: 4 / 5; }
.mini b { font-size: 14.5px; line-height: 1.3; }
.price-sm b { font-size: 16px; font-weight: 800; }
.price-sm s { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.install-card { display: flex; gap: 14px; align-items: center; background: linear-gradient(120deg, var(--saffron), #c96a1c); color: #fff; border-radius: 20px; padding: 14px 16px; margin-bottom: 18px; cursor: pointer; }
.install-card .logo-mark { background: #fff; color: var(--green); flex: none; }
.install-card div { flex: 1; display: grid; min-width: 0; }
.install-card span { font-size: 13px; opacity: .92; }
.install-card .btn { color: var(--saffron); flex: none; }
.ios-steps { display: grid; gap: 10px; padding-left: 20px; margin: 16px 0 0; }
.ios-steps .lucide { width: 16px; height: 16px; vertical-align: -3px; }

/* explore */
.seg-lg { display: flex; width: 100%; max-width: 460px; }
.seg-lg a { flex: 1; text-align: center; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg-lg a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.chips-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.chips-row .chip { flex: none; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ex-grid.ws-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ex-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; color: inherit; display: flex; flex-direction: column; transition: transform .25s var(--ease), box-shadow .25s; }
.ex-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ex-img { position: relative; aspect-ratio: 16 / 10; background: var(--line-2); }
.ex-img.tall { aspect-ratio: 4 / 5; }
.ex-img img { width: 100%; height: 100%; object-fit: cover; }
.ex-img .badge { position: absolute; top: 10px; left: 10px; }
.ex-b { padding: 14px; display: grid; gap: 4px; flex: 1; align-content: start; }
.ex-b b { font-size: 16px; line-height: 1.3; }
.ex-f { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }

/* detail pages */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.d-hero img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-radius: 20px; }
.d-poster img { width: 100%; max-width: 520px; border-radius: 20px; box-shadow: var(--shadow); }
.buy-box { position: sticky; top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 12px; }
.incl { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.incl li { display: flex; gap: 8px; align-items: center; }
.incl .lucide { width: 16px; height: 16px; color: var(--green-2); }
.prof-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.prof-head b { font-family: var(--serif); font-size: 26px; font-weight: 500; display: block; }
.linkrow { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-2); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.linkrow:last-child { border-bottom: 0; }

/* ---------- Phone layout: native-style app ---------- */
@media (max-width: 900px) {
  body.student .mobile-top, body.student .side { display: none !important; }
  body.student .topbar { display: none; }
  .app-top { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 45; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(246,241,231,.92); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
  .app-top .logo-mark { width: 34px; height: 34px; font-size: 15px; }
  .app-title { flex: 1; font-family: var(--serif); font-size: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.student .main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: rgba(255,252,246,.96); backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 700; color: var(--muted); position: relative; -webkit-tap-highlight-color: transparent; }
  .tabbar a .lucide { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--green); }
  .tabbar a.active .lucide { stroke-width: 2.4; }
  .tabbar em { position: absolute; top: 4px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
  .detail { grid-template-columns: 1fr; }
  .buy-box { display: none; }
  .sticky-buy { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 55; padding: 10px 16px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(0,0,0,.3); }
  .sticky-buy .price { flex: 1; }
  .sticky-buy .price b { font-size: 20px; font-weight: 800; }
  .sticky-buy .price s { color: var(--muted); font-size: 13px; margin-left: 6px; }
  body.student .main:has(.sticky-buy) { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .d-hero img { aspect-ratio: 16 / 10; border-radius: 16px; }
  .welcome { padding: 22px; border-radius: 22px; }
  .player .video { border-radius: 14px; }
  .hscroll { grid-auto-columns: 72%; margin: 0 -16px; padding: 2px 16px 12px; scroll-padding: 16px; }
  .hscroll:has(.mini.mini-ws) { grid-auto-columns: 58%; }
  .filters .search { width: 100%; }
  .ex-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ex-grid .ex-b b { font-size: 14.5px; }
  .ex-grid .ex-f { flex-wrap: wrap; }
  .login-art { min-height: 200px; }
}
@media (max-width: 420px) { .ex-grid:not(.ws-grid) { grid-template-columns: 1fr; } .kpis { gap: 10px; } }
@media (display-mode: standalone) { .login-form .logo small::after { content: ""; } }

/* ---------- Lesson page ---------- */
.lesson2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.stage2 { position: relative; }
.l-main { min-width: 0; }
.sp-loading { display: grid; place-items: center; color: #fff; }
.sp-empty { display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; color: #fff; padding: 20px; background: #13201a center / cover; }
.sp-empty .lucide { width: 40px; height: 40px; color: #ffd7a8; }
.sp-empty span { opacity: .8; font-size: 14px; max-width: 420px; }
.l-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin: 18px 0 12px; }
.l-head h2 { font-size: 28px; margin-top: 4px; }
.l-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.l-prog { flex: 1; }
.l-tabs { margin-bottom: 14px; }
.l-tabs .only-sm { display: none; }
.l-desc { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.kbd-help { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; margin-top: 12px; }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #fff; font: 700 11px var(--sans); margin-right: 3px; }
.lp-mod2 { border-bottom: 1px solid var(--line-2); }
.lp-mod2 summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; }
.lp-mod2 summary::-webkit-details-marker { display: none; }
.lp-mod2 summary > span:first-child { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.ring { width: 26px; height: 26px; border-radius: 50%; flex: none; background: conic-gradient(var(--green-2) calc(var(--p) * 1%), var(--line-2) 0); -webkit-mask: radial-gradient(circle 8px, transparent 98%, #000); mask: radial-gradient(circle 8px, transparent 98%, #000); }
.lp-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-panel.inline { position: static; max-height: none; }
.upnext { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; align-content: center; gap: 10px; background: rgba(12,20,15,.86); color: #fff; text-align: center; padding: 20px; }
.upnext b { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.un-ring { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--saffron); display: grid; place-items: center; font: 800 20px var(--sans); }
.pdf-stage { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.pdf-stage iframe { width: 100%; height: min(75vh, 820px); border: 0; display: block; }
.pdf-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--green); color: #fff; font-weight: 700; font-size: 14px; }
.pdf-bar .lucide { width: 16px; height: 16px; vertical-align: -3px; }
.quiz-wrap { display: grid; gap: 12px; }
@media (max-width: 1100px) { .lesson2 { grid-template-columns: minmax(0, 1fr); } .lesson2 > .lesson-panel { display: none; } .l-tabs .only-sm { display: flex; } }
@media (max-width: 900px) {
  body.student .main:has(.lesson2) { padding-top: 0; }
  .lesson2 .stage2 { margin: 0 -16px; position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 30; }
  .l-head h2 { font-size: 22px; }
  .l-head { flex-wrap: wrap; }
  .l-nav .btn { padding: 8px 12px; }
  .pdf-stage iframe { height: 62vh; }
}

@media (max-width: 600px) {
  .lesson2 .pdf-card { flex-wrap: wrap; }
  .lesson2 .pdf-card > div:nth-child(2) { flex: 1 1 calc(100% - 64px) !important; }
  .lesson2 .pdf-card .btn { flex: 1; }
  .l-head > div { flex: 1 1 100%; }
  .l-head #doneBtn { width: 100%; }
  .l-nav { gap: 8px; }
}
