/* course-saas — shared stylesheet (platform, teacher sites, panel, admin) */
@font-face { font-family: Vazir; src: url(../fonts/Vazir-Light.woff2) format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: Vazir; src: url(../fonts/Vazir-Regular.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazir; src: url(../fonts/Vazir-Medium.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazir; src: url(../fonts/Vazir-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --brand: #6d28d9;
  --brand-ink: #fff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f1f1f6;
  --ink: #17151f;
  --muted: #6b6878;
  --line: #e6e4ee;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 16, 40, .05), 0 8px 24px rgba(20, 16, 40, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Vazir, Tahoma, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.8; font-size: 15px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: 12px; padding: 10px 18px; font-weight: 500; background: var(--brand); color: var(--brand-ink); transition: transform .12s, filter .12s, background .12s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-danger { background: #fee2e2; color: var(--bad); }
.btn-block { width: 100%; }
.link { color: var(--brand); font-weight: 500; }

/* ---------- Cards & fields ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea, .input-plain {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.alert-ok { background: #ecfdf5; color: #065f46; }
.alert-bad { background: #fef2f2; color: #991b1b; }
.alert-info { background: var(--brand-soft); color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-bad { background: #fee2e2; color: #991b1b; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #17151f; color: #fff; padding: 10px 20px; border-radius: 12px; font-size: 14px; opacity: 0; transition: all .25s; z-index: 1000; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); }
.stars { color: #f59e0b; letter-spacing: 1px; }
.stars-off { color: #d6d3e0; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s; }
.modal { position: fixed; inset: 0; background: rgba(15, 12, 30, .55); z-index: 500; overflow-y: auto; padding: 16px; }
.modal-box { background: var(--surface); color: var(--ink); max-width: 460px; margin: 10vh auto; border-radius: 20px; padding: 24px; box-shadow: 0 30px 60px rgba(0, 0, 0, .25); }

/* ---------- Platform header / footer ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #ec4899)); display: grid; place-items: center; color: #fff; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14px; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--surface-2); }
.nav a.btn:not(.btn-ghost), .nav a.btn:not(.btn-ghost):hover { background: var(--brand); color: var(--brand-ink); }
.nav a.btn:not(.btn-ghost):hover { filter: brightness(1.08); }
.nav a.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.topbar-quick { display: none; align-items: center; gap: 6px; margin-inline-start: auto; }
.topbar-quick .btn { padding: 7px 12px; font-size: 13px; }
.quick-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.quick-ic svg.i { width: 19px; height: 19px; transform: scaleX(-1); }
.nav-mobile-only { display: none !important; }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 6px; }
@media (max-width: 760px) {
  .nav-toggle { display: block; margin-inline-start: 0; }
  .topbar-quick { display: flex; }
  .topbar .container { gap: 10px; }
  .nav .btn { justify-content: center; margin-top: 6px; }
  .nav-mobile-only { display: inline-flex !important; }
  .nav { display: none; position: absolute; top: 64px; inset-inline: 0; background: var(--surface); flex-direction: column; align-items: stretch; padding: 12px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
}
.footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Landing ---------- */
.hero { padding: 72px 0 48px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 520px; background: radial-gradient(closest-side, var(--brand-soft), transparent); z-index: -1; }
.hero h1 { font-size: clamp(28px, 5vw, 50px); font-weight: 700; max-width: 820px; margin: 0 auto 16px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: clamp(15px, 2vw, 19px); color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
/* platform home hero variants (admin > home page) */
.hero-btns { justify-content: center; }
.hero-bg-plain::before { display: none; }
.hero-bg-gradient::before { display: none; }
.hero-bg-gradient { background: linear-gradient(165deg, color-mix(in srgb, var(--brand) 18%, var(--bg)) 0%, var(--bg) 78%); }
.hero-bg-brand::before { display: none; }
.hero-bg-brand { background: linear-gradient(150deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; }
.hero-bg-brand h1, .hero-bg-brand p.lead { color: #fff; }
.hero-bg-brand p.lead { opacity: .88; }
.hero-bg-brand .badge-brand { background: rgba(255, 255, 255, .18); color: #fff; }
.hero-bg-brand .btn:not(.btn-ghost) { background: #fff; color: var(--brand); }
.hero-bg-brand .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.hero-split .container { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 44px; align-items: center; text-align: right; }
.hero-split h1, .hero-split p.lead { margin-inline: 0; }
.hero-split .hero-btns { justify-content: flex-start; }
.hero-media { border-radius: 28px; overflow: hidden; aspect-ratio: 1; box-shadow: 0 30px 60px rgba(20, 10, 40, .2); background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 45%, #f472b6)); max-width: 460px; width: 100%; justify-self: center; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-media-ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .85); }
.hero-media-ph svg.i { width: 90px; height: 90px; }
@media (max-width: 820px) {
  .hero-split .container { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .hero-split .hero-btns { justify-content: center; }
  .hero-split h1, .hero-split p.lead { margin-inline: auto; }
  .hero-media { max-width: 340px; }
}
.section { padding: 48px 0; }
.section-head { text-align: center; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(22px, 3.4vw, 32px); }
.feature { padding: 22px; }
.feature .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 12px; }
.feature .ic svg { width: 24px; height: 24px; }
.feature h3 { font-size: 16px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }
.price-card { text-align: center; position: relative; }
.price-card.popular { border: 2px solid var(--brand); }
.price-card .amount { font-size: 26px; font-weight: 700; margin: 8px 0; }
.price-card .tag { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); background: var(--brand); color: #fff; padding: 4px 14px; font-size: 12px; font-weight: 700; line-height: 1.6; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent); }
.price-card.popular { padding-top: 26px; }
.course-grid > .card + .card { margin-top: 0; }

/* ---------- Course cards (market + teacher site) ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; min-width: 0; }
.course-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(20, 16, 40, .1); }
.course-cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #f472b6)); position: relative; overflow: hidden; }
.course-cover img { width: 100%; height: 100%; object-fit: cover; }
.course-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .9); font-weight: 700; font-size: 18px; padding: 16px; text-align: center; }
.course-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.course-body h3 { font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.course-teacher { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.course-teacher img, .avatar-sm { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.course-price { margin-top: auto; padding-top: 8px; display: flex; align-items: baseline; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.course-price s { color: var(--muted); font-weight: 400; font-size: 13px; }
.price-free { color: var(--ok); }

/* ---------- Market ---------- */
.market-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.market-bar .input { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 6px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; color: var(--muted); }
.chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ---------- Teacher site ---------- */
body.site { --bg: #fafafa; }
body.site.theme-dark { --bg: #0e0d13; --surface: #17161f; --surface-2: #22202d; --ink: #f2f0f8; --muted: #a29fb2; --line: #2b2938; }
body.site.theme-warm { --bg: #fbf6f0; --surface: #fffdf9; --surface-2: #f3ebe1; --ink: #2a2019; --muted: #7d6e60; --line: #ece1d4; }
.site-hero { padding: 56px 0 40px; }
.site-hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.site-hero h1 { font-size: clamp(26px, 4.4vw, 44px); }
.site-hero .lead { color: var(--muted); font-size: 17px; }
.site-hero-media { position: relative; }
.site-hero-media img { border-radius: 28px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; box-shadow: 0 30px 60px rgba(0, 0, 0, .15); }
.site-hero-media .blob { position: absolute; inset: 8% -6% -6% 8%; background: var(--brand); border-radius: 32px; z-index: -1; opacity: .9; }
.site-stats { display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap; }
.site-stats b { display: block; font-size: 22px; color: var(--brand); }
.site-stats span { font-size: 13px; color: var(--muted); }
@media (max-width: 820px) { .site-hero .container { grid-template-columns: 1fr; } .site-hero-media { max-width: 360px; margin: 0 auto; order: -1; } }
.social { display: flex; gap: 10px; flex-wrap: wrap; }
.social a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.social a:hover { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.social svg { width: 20px; height: 20px; }
.about-block { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; }
.about-block img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; }
.about-block .text { white-space: pre-line; min-width: 0; }
@media (max-width: 640px) { .about-block { grid-template-columns: 1fr; text-align: center; } .about-block img { margin: 0 auto; width: 140px; height: 140px; } }
.testi { padding: 20px; }
.testi p { white-space: pre-line; font-size: 14px; }
.testi b { font-size: 13px; color: var(--brand); }

/* link-in-bio */
.bio-page { max-width: 480px; margin: 0 auto; padding: 40px 16px; text-align: center; }
.bio-avatar { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 4px solid var(--surface); box-shadow: var(--shadow); background: var(--surface-2); }
.bio-link { display: block; padding: 14px 18px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-weight: 500; transition: transform .12s; }
.bio-link:hover { transform: scale(1.02); border-color: var(--brand); }
.bio-link.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* course page */
.course-hero { padding: 36px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 28px; }
.buy-box { position: sticky; top: 84px; }
.buy-box .course-cover { border-radius: 12px; margin-bottom: 14px; }
.buy-box .big-price { font-size: 24px; font-weight: 700; }
@media (max-width: 900px) { .course-layout { grid-template-columns: 1fr; } .buy-box { position: static; order: -1; } }
.desc { white-space: pre-line; }
.syllabus details { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.syllabus summary { padding: 12px 16px; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; list-style: none; }
.syllabus summary::-webkit-details-marker { display: none; }
.lesson-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.lesson-row .ic { color: var(--muted); display: flex; }
.lesson-row .ic svg { width: 18px; height: 18px; }
.lesson-row.done .ic { color: var(--ok); }
.lesson-row.current { background: var(--brand-soft); }

/* learn page */
.learn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; padding: 20px 0; align-items: start; }
@media (max-width: 960px) { .learn-layout { grid-template-columns: 1fr; } }
.learn-side { max-height: calc(100vh - 100px); overflow-y: auto; position: sticky; top: 84px; padding: 0; }
@media (max-width: 960px) { .learn-side { position: static; max-height: none; } }
.lesson-body { white-space: pre-line; }

/* secure player */
.player { position: relative; background: #000; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.player .wm { position: absolute; z-index: 5; pointer-events: none; color: rgba(255, 255, 255, .42); font-size: clamp(11px, 1.6vw, 15px); font-weight: 700; text-shadow: 0 0 3px rgba(0, 0, 0, .6); transition: top 1.6s ease, left 1.6s ease; white-space: nowrap; direction: ltr; }
.player .player-msg { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff; background: rgba(0, 0, 0, .78); font-size: 15px; }
.player .player-msg[hidden] { display: none; }
.video-processing { aspect-ratio: 16 / 9; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }

/* quiz */
.quiz-q { padding: 16px 0; border-bottom: 1px solid var(--line); }
.quiz-q:last-of-type { border-bottom: 0; }
.quiz-opt { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; cursor: pointer; }
.quiz-opt input { accent-color: var(--brand); }
.quiz-opt.right { border-color: var(--ok); background: #ecfdf5; color: #065f46; }
.quiz-opt.wrong { border-color: var(--bad); background: #fef2f2; color: #991b1b; }

/* Q&A */
.qa-item { padding: 14px 0; border-top: 1px solid var(--line); }
.qa-item .who { font-size: 13px; color: var(--muted); }
.qa-item .body { white-space: pre-line; }
.qa-reply { margin-top: 10px; margin-inline-start: 20px; padding: 10px 14px; background: var(--brand-soft); border-radius: 12px; }

/* certificate */
.cert { max-width: 900px; margin: 32px auto; background: #fff; color: #1d1a26; border-radius: 8px; padding: 56px; text-align: center; position: relative; border: 14px solid var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 40%, #fff); outline-offset: -26px; aspect-ratio: 1.414; display: flex; flex-direction: column; justify-content: center; }
.cert h1 { font-size: 38px; color: var(--brand); }
.cert .name { font-size: 30px; font-weight: 700; margin: 12px 0; }
.cert .course { font-size: 22px; font-weight: 700; }
.cert .foot { display: flex; justify-content: space-between; margin-top: 40px; font-size: 13px; color: #5c5869; }
@media (max-width: 640px) { .cert { padding: 28px 18px; border-width: 8px; aspect-ratio: auto; } .cert h1 { font-size: 26px; } .cert .name { font-size: 22px; } }
@media print { .no-print { display: none !important; } body { background: #fff; } .cert { margin: 0 auto; box-shadow: none; } @page { size: A4 landscape; margin: 8mm; } }

/* auth box */
.auth-wrap { max-width: 420px; margin: 48px auto; padding: 0 16px; }
.otp-input { letter-spacing: 12px; text-align: center; font-size: 22px; direction: ltr; }

/* ---------- Panel ---------- */
body.panel { --bg: #f5f5f9; }
.panel-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.panel-side { background: #15131d; color: #d9d6e5; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.panel-side .logo { color: #fff; margin: 0 8px 24px; font-size: 16px; }
.panel-side a.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: #b9b5c9; margin-bottom: 2px; }
.panel-side a.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.panel-side a.nav-item:hover { background: #221f2e; color: #fff; }
.panel-side a.nav-item.active { background: var(--brand); color: #fff; }
.panel-side .side-foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid #2a2738; font-size: 12px; color: #8d89a0; }
.panel-main { padding: 24px; min-width: 0; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-top h1 { font-size: 22px; margin: 0; }
.panel-burger { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 18px; cursor: pointer; }
@media (max-width: 900px) {
  .panel-shell { grid-template-columns: 1fr; }
  .panel-side { position: fixed; inset: 0 0 0 auto; width: 260px; z-index: 300; transform: translateX(100%); transition: transform .2s; }
  .panel-side.open { transform: none; box-shadow: -20px 0 50px rgba(0, 0, 0, .3); }
  .panel-burger { display: inline-block; }
  .panel-main { padding: 16px; }
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.sub-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--brand-soft); margin-bottom: 18px; font-size: 14px; }
.link-chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px; min-width: 0; max-width: 100%; }
.link-chip code { direction: ltr; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.thumb { width: 72px; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.editor-section { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; background: var(--surface); }
.editor-section-head { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--surface-2); border-radius: 14px 14px 0 0; }
.editor-lesson { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.editor-lesson .title { flex: 1; min-width: 160px; font-weight: 500; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 8px; color: var(--muted); line-height: 1; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.upload-bar { margin-top: 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.color-swatches label { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.color-swatches input { display: none; }
.color-swatches input:checked + i { outline: 3px solid var(--ink); outline-offset: 2px; }
.color-swatches i { display: block; width: 100%; height: 100%; border-radius: 50%; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-pick label { border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; text-align: center; font-size: 13px; }
.theme-pick input { display: none; }
.theme-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.theme-pick .sw { height: 46px; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--line); }
.img-pick { display: flex; align-items: center; gap: 14px; }
.img-pick img, .img-pick .ph { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.dns-box { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.dns-box code { direction: ltr; display: inline-block; background: var(--surface); padding: 2px 8px; border-radius: 6px; }

/* default icon size (icon() adds class .i) */
svg.i { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.btn svg.i, .badge svg.i { width: 17px; height: 17px; }
.btn-sm svg.i { width: 15px; height: 15px; }
.icon-btn svg.i { width: 18px; height: 18px; }
.logo-mark svg.i { width: 18px; height: 18px; }

/* player: faint full-frame watermark tile, centre flash, wrapper fullscreen (also iPhone) */
.player .wm-tile { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: .09; background-repeat: repeat; transition: background-position 1.6s ease; }
.player .wm-flash { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; color: rgba(255, 255, 255, .75); font-size: clamp(18px, 3.6vw, 36px); font-weight: 700; text-shadow: 0 0 6px rgba(0, 0, 0, .7); white-space: nowrap; direction: ltr; animation: wmflash 3s ease forwards; }
@keyframes wmflash { 0% { opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
.player .player-fs { position: absolute; top: 10px; left: 10px; z-index: 7; background: rgba(0, 0, 0, .45); color: #fff; border: 0; border-radius: 10px; padding: 7px; cursor: pointer; line-height: 0; }
.player:fullscreen, .player:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.player.pseudo-fs { position: fixed; inset: 0; z-index: 9999; border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; height: 100dvh; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

/* ================= storefront (teacher site) ================= */
.site-top { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-top-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 62px; gap: 8px; }
.site-account { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; min-width: 0; color: var(--ink); }
.site-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-account svg.i { color: var(--brand); width: 24px; height: 24px; }
.site-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; justify-content: center; min-width: 0; }
.site-logo-img { max-height: 42px; max-width: 160px; width: auto; object-fit: contain; }
.site-logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.site-tools { display: flex; justify-content: flex-end; gap: 2px; }
.tool-btn { position: relative; background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 12px; color: var(--brand); display: inline-flex; line-height: 0; }
.tool-btn:hover { background: var(--brand-soft); }
.tool-btn svg.i { width: 25px; height: 25px; }
.tool-badge { position: absolute; top: 2px; left: 2px; background: var(--bad); color: #fff; font-style: normal; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; line-height: 1; }
.tool-badge.static { position: static; margin-inline-start: auto; }
.site-nav-desktop { display: flex; gap: 4px; padding-bottom: 8px; justify-content: center; flex-wrap: wrap; }
.site-nav-desktop a { padding: 6px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); font-weight: 500; }
.site-nav-desktop a:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 760px) { .site-nav-desktop { display: none; } .site-logo-text { max-width: 110px; } .site-account span { max-width: 80px; } }
.site-search { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.drawer-bg { position: fixed; inset: 0; background: rgba(10, 8, 20, .45); z-index: 200; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); background: var(--surface); color: var(--ink); z-index: 210; transform: translateX(-105%); transition: transform .22s ease; display: flex; flex-direction: column; box-shadow: 20px 0 50px rgba(0, 0, 0, .2); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head > :first-child { flex: 1; min-width: 0; }
.drawer-user { display: flex; gap: 10px; align-items: center; }
.drawer-nav { padding: 8px; overflow-y: auto; flex: 1; }
.drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; font-weight: 500; }
.drawer-nav a:hover { background: var(--surface-2); }
.drawer-nav svg.i { color: var(--brand); }
.drawer-foot { padding: 16px; border-top: 1px solid var(--line); }
.cart-float { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--brand); color: var(--brand-ink); padding: 12px 18px; border-radius: 16px; display: flex; gap: 8px; align-items: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); font-size: 14px; white-space: nowrap; max-width: calc(100% - 24px); }
.site-footer .container { align-items: flex-start; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; max-width: 420px; }
.site-footer .site-logo { justify-content: flex-start; }

/* home: compact hero + quick-buy cards */
.shop-hero { padding: 26px 0 8px; }
.shop-hero-in { display: flex; gap: 18px; align-items: center; }
.shop-hero-in .avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 3px solid var(--brand); }
.shop-hero h1 { font-size: clamp(20px, 3.4vw, 32px); margin: 0 0 4px; }
.shop-hero .lead { color: var(--muted); margin: 0; font-size: 15px; }
.shop-search { display: flex; gap: 8px; margin-top: 16px; }
.shop-search .input { flex: 1; }
.trust { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.trust::-webkit-scrollbar { display: none; }
.trust span { flex-shrink: 0; display: inline-flex; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.trust svg.i { width: 16px; height: 16px; color: var(--brand); }
.featured { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; overflow: hidden; padding: 0; }
.featured .course-cover { aspect-ratio: auto; min-height: 100%; }
.featured-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.featured-body h2 { font-size: 20px; margin: 0; }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } .featured .course-cover { aspect-ratio: 16/9; } }
.qcard { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; flex-direction: column; }
.qcard-cover { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #f472b6)); position: relative; display: block; }
.qcard-cover img { width: 100%; height: 100%; object-fit: cover; }
.qcard-cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 700; padding: 10px; text-align: center; }
.qcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.qcard-body h3 { font-size: 15px; margin: 0; }
.qcard-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; align-items: center; }
.qcard-actions .btn { flex: 1; }
.price-line { display: flex; align-items: baseline; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.price-line s { font-weight: 400; color: var(--muted); font-size: 12px; }
.off-badge { background: var(--bad); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 700; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
@media (max-width: 600px) {
  .qgrid { grid-template-columns: 1fr; }
  .qcard { flex-direction: row; }
  .qcard-cover { width: 120px; flex-shrink: 0; aspect-ratio: auto; }
  .qcard-body { padding: 10px 12px; }
  .qcard-body h3 { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .qcard-actions .btn { padding: 7px 10px; font-size: 13px; }
}
.sec-title { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 14px; }
.sec-title h2 { font-size: 19px; margin: 0; }
.prose h2 { font-size: 19px; margin: 1.2em 0 .5em; }
.prose p, .prose ul { margin: 0 0 1em; }
.prose img { border-radius: 14px; }

/* cart */
.cart-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.sum-row.total { font-size: 17px; font-weight: 700; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; }
.pay-opt { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; margin-bottom: 10px; }
.pay-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pay-opt input { margin-top: 5px; accent-color: var(--brand); }

/* profile tabs */
.ptabs { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs a { flex-shrink: 0; padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.ptabs a.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* chat (tickets) */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--brand-soft); }
.bubble .who { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.bubble .text { white-space: pre-line; overflow-wrap: anywhere; }
.bubble .attach { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--brand); }

/* learn page: mobile sessions dropdown */
.lesson-bar { display: none; }
@media (max-width: 960px) {
  .lesson-bar { display: block; margin-bottom: 12px; }
  .lesson-bar > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-weight: 700; }
  .lesson-bar > summary::-webkit-details-marker { display: none; }
  .lesson-bar[open] > summary .chev { transform: rotate(180deg); }
  .lesson-bar .lesson-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-top: 8px; max-height: 60vh; overflow-y: auto; }
  .learn-side { display: none; }
}
.lesson-crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.back-pill { display: inline-flex; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; font-size: 14px; margin-bottom: 12px; }

/* course page: sticky buy bar on phones */
.buy-sticky { display: none; }
@media (max-width: 900px) { .buy-sticky { display: flex; position: fixed; bottom: 0; inset-inline: 0; z-index: 70; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 -8px 24px rgba(0,0,0,.08); } .buy-sticky .btn { flex: 0 0 auto; padding: 11px 22px; } body:has(.buy-sticky) .footer { padding-bottom: 90px; } body:has(.buy-sticky) .cart-float { bottom: 78px; } }

/* ================= teacher-site hero ================= */
.hero2 { position: relative; overflow: hidden; padding: 40px 0 26px; isolation: isolate;
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 16%, var(--bg)) 0%, var(--bg) 70%); }
.hero2-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero2-bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.hero2-bg .b1 { width: 420px; height: 420px; background: color-mix(in srgb, var(--brand) 55%, transparent); top: -160px; left: -120px; }
.hero2-bg .b2 { width: 320px; height: 320px; background: color-mix(in srgb, var(--brand) 35%, #f9a8d4); bottom: -140px; right: 10%; opacity: .35; }
.hero2-bg .b3 { width: 180px; height: 180px; background: color-mix(in srgb, var(--brand) 30%, #fde68a); top: 30%; right: -60px; opacity: .3; }
.hero2-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 44px; align-items: center; }
.hero2-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hero2-logo { max-height: 56px; max-width: 220px; width: auto; object-fit: contain; }
.hero2-av { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand); }
.hero2-name { font-weight: 700; font-size: 18px; }
.hero2-ig { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.hero2-ig svg.i { width: 16px; height: 16px; color: var(--brand); }
.hero2 h1 { font-size: clamp(26px, 4.6vw, 48px); line-height: 1.3; margin: 0 0 12px; letter-spacing: -.3px; }
.hero2-lead { font-size: clamp(15px, 1.8vw, 18px); color: var(--muted); margin: 0 0 22px; max-width: 560px; }
.hero2-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero2-primary { padding: 12px 22px; box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 35%, transparent); text-align: right; }
.hero2-primary span { display: flex; flex-direction: column; line-height: 1.4; }
.hero2-primary small { font-weight: 400; font-size: 12px; opacity: .9; }
.hero2-primary svg.i { width: 22px; height: 22px; }
.hero2-secondary { background: var(--surface); }
.hero2-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 26px; max-width: 600px; }
.hero2-stat { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.hero2-stat .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.hero2-stat .ic svg.i { width: 18px; height: 18px; }
.hero2-stat b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hero2-stat small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hero2-media { position: relative; justify-self: center; width: 100%; max-width: 420px; }
.hero2-frame { position: relative; border-radius: 32px; overflow: hidden; aspect-ratio: 4 / 5; box-shadow: 0 30px 60px rgba(20, 10, 40, .22); transform: rotate(-2deg); border: 6px solid var(--surface); background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 45%, #f472b6)); }
.hero2-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero2-ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .85); }
.hero2-ph svg.i { width: 90px; height: 90px; }
.hero2-float { position: absolute; display: flex; align-items: center; gap: 6px; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 9px 13px; font-size: 13px; box-shadow: 0 12px 28px rgba(20, 10, 40, .16); white-space: nowrap; animation: floaty 5s ease-in-out infinite; }
.hero2-float small { color: var(--muted); }
.hero2-float svg.i { width: 18px; height: 18px; color: var(--brand); }
.hero2-float.f1 { top: 8%; left: -28px; }
.hero2-float.f2 { bottom: 14%; right: -24px; animation-delay: -1.6s; }
.hero2-float.f3 { bottom: -12px; left: 12%; animation-delay: -3.2s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .hero2-float { animation: none; } }
.hero2-strip-head { display: flex; justify-content: space-between; align-items: center; margin: 30px 0 10px; }
.hero2-strip-head a { color: var(--brand); font-weight: 500; }
.hero2-strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.mini { flex: 0 0 280px; scroll-snap-align: start; display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; min-width: 0; }
.mini-cover { width: 74px; height: 74px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #f472b6)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 22px; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-body { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; min-width: 0; flex: 1; }
.mini-title { grid-column: 1 / -1; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-price { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.mini-btn { border: 0; cursor: pointer; background: var(--brand); color: var(--brand-ink); border-radius: 10px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 500; }
.mini-btn.soft { background: var(--brand-soft); color: var(--brand); grid-column: 2; text-align: center; }
body.site.theme-dark .hero2 { background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 28%, var(--bg)) 0%, var(--bg) 70%); }

/* phone */
@media (max-width: 820px) {
  .hero2 { padding: 18px 0 18px; }
  .hero2-in { grid-template-columns: 1fr; gap: 20px; }
  .hero2-media { order: -1; max-width: none; }
  .hero2-frame { aspect-ratio: 16 / 10; transform: none; border-radius: 24px; border-width: 4px; }
  .hero2-float.f1 { top: 10px; left: 10px; }
  .hero2-float.f2 { bottom: 10px; right: 10px; }
  .hero2-float.f3 { display: none; }
  .hero2-float { padding: 7px 10px; font-size: 12px; animation: none; }
  .hero2-text { text-align: center; }
  .hero2-brand { justify-content: center; }
  .hero2-lead { margin-inline: auto; }
  .hero2-cta { flex-direction: column; }
  .hero2-cta .btn { width: 100%; justify-content: center; }
  .hero2-primary { text-align: center; }
  .hero2-primary span { align-items: center; }
  .hero2-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-inline: auto; }
  .hero2-stats:has(.hero2-stat:nth-child(3):last-child) .hero2-stat:last-child { grid-column: 1 / -1; }
  .mini { flex-basis: 78%; }
}
@media (max-width: 820px) { .hero2-stat { flex-direction: row; justify-content: center; gap: 6px; padding: 10px 8px; } .hero2-stat .ic { width: 28px; height: 28px; margin: 0; flex-shrink: 0; } .hero2-stat b { font-size: 16px; } .hero2-stats { gap: 8px; margin-top: 18px; } }

/* purchase agreement */
.terms-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 10px 12px; border-radius: 12px; background: #fff7ed; color: #9a3412; margin-bottom: 12px; }
.terms-row svg.i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.terms-row.ok { background: #ecfdf5; color: #065f46; }
.terms-modal { position: fixed; inset: 0; z-index: 900; background: rgba(12, 8, 24, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.terms-box { background: var(--surface); color: var(--ink); width: 100%; max-width: 600px; max-height: calc(100dvh - 32px); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.terms-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.terms-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; }
.terms-body { padding: 6px 20px 10px; overflow-y: auto; flex: 1; min-height: 120px; font-size: 14px; line-height: 2; }
.terms-body h2 { font-size: 15px; color: var(--brand); margin: 14px 0 4px; }
.terms-body ul { padding-inline-start: 20px; }
.terms-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.terms-hint { color: var(--warn); margin-bottom: 8px; }
.terms-hint.done { color: var(--ok); }
.terms-check { align-items: flex-start; font-size: 13px; line-height: 1.8; }
.terms-check input { margin-top: 4px; flex-shrink: 0; }
.terms-check:has(input:disabled) { opacity: .55; cursor: not-allowed; }
@media (max-width: 600px) { .terms-modal { padding: 0; align-items: flex-end; } .terms-box { border-radius: 22px 22px 0 0; max-height: 92dvh; } }

/* device limit notice */
.device-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; font-size: 14px; }
.device-note .small { color: #1e40af; margin-top: 2px; line-height: 1.8; }
.device-note .device-ic { width: 34px; height: 34px; border-radius: 10px; background: #dbeafe; display: grid; place-items: center; flex-shrink: 0; }
.device-note .device-ic svg.i { color: #1d4ed8; }
body.site.theme-dark .device-note { background: #172554; color: #dbeafe; border-color: #1e3a8a; } body.site.theme-dark .device-note .small { color: #bfdbfe; } body.site.theme-dark .device-note .device-ic { background: #1e3a8a; }
.device-toast { margin-top: 10px; background: #1d4ed8; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.9; }

/* player settings (quality / speed / pip) */
.player .player-gear { position: absolute; top: 10px; left: 52px; z-index: 7; background: rgba(0,0,0,.45); color: #fff; border: 0; border-radius: 10px; padding: 7px; cursor: pointer; line-height: 0; display: flex; align-items: center; gap: 4px; }
.player .pm-badge { font-size: 11px; line-height: 1; font-weight: 700; }
.player .pm-badge:empty { display: none; }
.player .player-menu { position: absolute; top: 52px; left: 10px; z-index: 9; background: rgba(18,16,26,.94); color: #fff; border-radius: 14px; padding: 10px 12px 12px; width: min(300px, calc(100% - 20px)); max-height: calc(100% - 64px); overflow-y: auto; box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.player .pm-title { font-size: 12px; opacity: .7; margin: 6px 0 6px; }
.player .pm-row { display: flex; flex-wrap: wrap; gap: 6px; }
.player .pm-row button { background: rgba(255,255,255,.1); color: #fff; border: 0; border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.player .pm-row button.on { background: var(--brand); }
.player .pm-row button small { opacity: .8; }

/* ===== own player control bar ===== */
.player .player-fs, .player .player-gear { display: none !important; } /* old top-corner buttons */
.player .pc { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; direction: ltr; padding: 26px 10px 6px; background: linear-gradient(to top, rgba(0, 0, 0, .75), rgba(0, 0, 0, .35) 60%, transparent); color: #fff; transition: opacity .25s; opacity: 0; pointer-events: none; }
.player.started .pc { opacity: 1; pointer-events: auto; }
.player.started.idle .pc { opacity: 0; pointer-events: none; }
.player.started.idle { cursor: none; }
.player .pc-seek { padding: 8px 4px; cursor: pointer; touch-action: none; }
.player .pc-track { position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); transition: height .15s; }
.player .pc-seek:hover .pc-track { height: 6px; }
.player .pc-buf, .player .pc-played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.player .pc-buf { background: rgba(255, 255, 255, .35); }
.player .pc-played { background: var(--brand); }
.player .pc-knob { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 60%, transparent); }
.player .pc-row { display: flex; align-items: center; gap: 2px; }
.player .pc-btn { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 10px; line-height: 0; display: inline-flex; align-items: center; gap: 4px; }
.player .pc-btn:hover { background: rgba(255, 255, 255, .14); }
.player .pc-time { font-size: 13px; font-variant-numeric: tabular-nums; margin: 0 6px; white-space: nowrap; opacity: .95; }
.player .pc-grow { flex: 1; }
.player .pc-vol { display: inline-flex; align-items: center; }
.player .pc-volr { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: #fff; }
.player .pc-vol:hover .pc-volr, .player .pc-volr:focus { width: 80px; opacity: 1; margin-right: 6px; }
.player .pc-gear .pm-badge { font-size: 11px; font-weight: 700; line-height: 1; direction: rtl; }
.player .pc-gear .pm-badge:empty { display: none; }
.player .player-menu { top: auto; bottom: 62px; left: auto; right: 10px; direction: rtl; }
.player.pseudo-fs .pc, .player:fullscreen .pc { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
@media (max-width: 520px) {
  .player .pc-hide-xs { display: none; }
  .player .pc-volr { display: none; }
  .player .pc-time { font-size: 12px; }
  .player .pc { padding-inline: 4px; }
}
@media (hover: none) { .player .pc-volr { display: none; } }

/* brand logo in headers / sidebars */
.brand-logo-img { max-height: 40px; max-width: 170px; width: auto; object-fit: contain; }
.panel-side .side-logo .brand-logo-img { max-height: 44px; max-width: 190px; background: #fff; border-radius: 10px; padding: 4px 8px; }
.panel-notice { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats { list-style: none; padding: 0; margin: 14px 0 0; text-align: right; font-size: 13px; }
.plan-feats li { padding: 5px 0; border-top: 1px dashed var(--line); }
.plan-feats li::before { content: "✓"; color: var(--ok); margin-left: 6px; font-weight: 700; }

/* ===== logos: round (square-ish uploads) vs wide (word-marks) ===== */
img.logo-round { border-radius: 50%; object-fit: cover; aspect-ratio: 1; background: var(--surface); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
img.logo-wide { object-fit: contain; border-radius: 0; }
.site-logo-img.logo-round { width: 40px; height: 40px; max-width: none; }
.site-logo-img.logo-wide { max-height: 42px; max-width: 160px; height: auto; width: auto; }
.hero2-logo.logo-round { width: 64px; height: 64px; max-width: none; max-height: none; }
.hero2-logo.logo-wide { max-height: 56px; max-width: min(240px, 70vw); width: auto; height: auto; }
.brand-logo-img.logo-round { width: 38px; height: 38px; max-width: none; }
.logo .brand-logo-img.logo-round + span { font-weight: 700; }
.panel-side .side-logo .brand-logo-img.logo-round { width: 40px; height: 40px; padding: 0; background: #fff; }
.panel-side .side-logo { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  .hero2-logo.logo-round { width: 56px; height: 56px; }
  .site-logo-img.logo-round { width: 36px; height: 36px; }
}

/* ===== main site + panels theme (admin setting): light / dark / auto ===== */
html.pt-dark body:not(.site) {
  --bg: #0f0e15; --surface: #18171f; --surface-2: #22212c; --ink: #f1eff8; --muted: #a3a0b3; --line: #2c2a38;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
@media (prefers-color-scheme: dark) {
  html.pt-auto body:not(.site) {
    --bg: #0f0e15; --surface: #18171f; --surface-2: #22212c; --ink: #f1eff8; --muted: #a3a0b3; --line: #2c2a38;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
/* pastel status colours need darker backgrounds on a dark page */
html.pt-dark body:not(.site) .alert-ok, html.pt-dark body:not(.site) .badge-ok { background: #0b3b2e; color: #a7f3d0; }
html.pt-dark body:not(.site) .alert-bad, html.pt-dark body:not(.site) .badge-bad, html.pt-dark body:not(.site) .btn-danger { background: #4a1414; color: #fecaca; }
html.pt-dark body:not(.site) .badge-warn { background: #4a3410; color: #fde68a; }
html.pt-dark body:not(.site) .hero::before { opacity: .6; }
@media (prefers-color-scheme: dark) {
  html.pt-auto body:not(.site) .alert-ok, html.pt-auto body:not(.site) .badge-ok { background: #0b3b2e; color: #a7f3d0; }
  html.pt-auto body:not(.site) .alert-bad, html.pt-auto body:not(.site) .badge-bad, html.pt-auto body:not(.site) .btn-danger { background: #4a1414; color: #fecaca; }
  html.pt-auto body:not(.site) .badge-warn { background: #4a3410; color: #fde68a; }
}
html.pt-dark body:not(.site), html.pt-dark body:not(.site) input, html.pt-dark body:not(.site) select, html.pt-dark body:not(.site) textarea { color-scheme: dark; }
@media (prefers-color-scheme: dark) { html.pt-auto body:not(.site) { color-scheme: dark; } }

/* platform student home */
.stu-hero { padding-bottom: 36px; }
.stu-search { max-width: 560px; margin: 0 auto; }
.stu-mine { display: flex; flex-direction: column; gap: 6px; color: inherit; }
.stu-mine img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin-bottom: 4px; }
.stu-teachers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stu-teachers .card { display: flex; flex-direction: column; align-items: center; gap: 4px; color: inherit; padding: 16px 10px; }

/* free consultation form */
.consult-wrap { max-width: 620px; padding-top: 32px; padding-bottom: 40px; }
.consult-card { padding: 26px 22px; }
.consult-title { font-size: clamp(22px, 4vw, 28px); margin: 0 0 6px; }
.consult-card .req { color: var(--bad, #dc2626); font-weight: 700; }
.consult-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
.consult-card { position: relative; }
.consult-ok { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.consult-ok svg.i { width: 32px; height: 32px; }
.btn-consult { border: 1.5px solid var(--brand); }
.hero-bg-brand .btn-consult { border-color: #fff; }

/* pricing: tiers + duration switch */
.dur-switch { display: flex; justify-content: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; width: fit-content; max-width: 100%; margin: 0 auto 28px; overflow-x: auto; }
.dur-switch button { border: 0; background: none; padding: 9px 16px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.dur-switch button small { font-size: 11px; color: var(--ok); font-weight: 700; }
.dur-switch button.active { background: var(--brand); color: var(--brand-ink); }
.dur-switch button.active small { color: inherit; opacity: .9; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 360px)); gap: 20px; justify-content: center; }
.tier-card h3 { font-size: 22px; margin: 4px 0 6px; }
.tier-hours { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand); border-radius: 99px; padding: 5px 14px; font-size: 14px; margin-bottom: 10px; }
.tier-hours svg.i { width: 18px; height: 18px; }
.tier-hours b { font-size: 17px; }
.tier-price[hidden] { display: none; }
.tier-price .amount { font-size: 30px; }
