/* OnSkilliT academy sites: public website, student area, course player. Loaded after app.css.
   Colours come from variables (tenant brand, light and dark): --primary --on-primary --secondary --accent --on-accent. */

body.ac { background: var(--bg); color: var(--text); font-family: var(--font); }
.ac h1, .ac h2, .ac h3, .ac h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
.ac img { max-width: 100%; height: auto; }
.ac a { color: var(--primary); }
.ac :focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- buttons, tags */
.ac .btn { border-radius: calc(var(--radius) * .7); }
.ac .btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 32%, transparent); }
.ac .btn-primary:hover { filter: brightness(1.07); }
.ac .btn-ghost { color: var(--text); }
.ac .btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.ac .btn-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.ac .btn-lg { min-height: 52px; padding: .7rem 1.6rem; font-size: 1.02rem; }
.ac-btn-outline .btn-primary { background: transparent; color: var(--primary); box-shadow: none; }
.ac-btn-outline .btn-primary:hover { background: var(--primary); color: var(--on-primary); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bg-soft); color: var(--text); border: 1px solid var(--border); }
.tag-accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.tag-ok { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.eyebrow { display: inline-block; padding: .3rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }

/* ---------------------------------------------------------------- top bar and header */
.ah-top { background: var(--secondary); color: #fff; font-size: .82rem; }
.ah-top a { color: #fff; text-decoration: none; }
.ah-top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; flex-wrap: wrap; }
.ah-top-info { display: flex; gap: 16px; flex-wrap: wrap; }
.ah-top-info > * { display: inline-flex; align-items: center; gap: 6px; }
.ah-social, .af-social, .ah-top-social { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ah-social a, .af-social a, .ah-top-social a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-muted); text-decoration: none; transition: .2s; }
.ah-social a:hover, .af-social a:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.ah-top-social a { border-color: rgba(255,255,255,.3); color: #fff; width: 28px; height: 28px; }

.ah { background: var(--bg); border-bottom: 1px solid var(--border); z-index: 60; }
.ah-sticky { position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.ah-row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.ah-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text) !important; font-weight: 800; font-size: 1.15rem; flex: none; }
.ac .ah-logo, .ah-logo { height: clamp(40px, 4.2vw, 52px); width: auto; max-width: min(200px, 48vw); object-fit: contain; flex: none; }
.ah-logo-dark { display: none; }
:root[data-theme='dark'] .ah-logo-dark + .ah-name, :root[data-theme='dark'] .ah-logo-dark { display: block; }
:root[data-theme='dark'] .ah-logo-light:has(~ .ah-logo-dark) { display: none; }
.ah-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: calc(var(--radius) * .7); background: var(--primary); color: var(--on-primary); font-weight: 800; flex: none; }
.ah-name-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ah-nav { display: flex; align-items: center; gap: 2px; margin-inline-start: 12px; flex: 1; }
.ah-nav > a { padding: .5rem .8rem; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; }
.ah-nav > a:hover { background: var(--bg-soft); color: var(--primary); }
.ah-nav > a[aria-current='page'] { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.ah-close, .ah-nav-auth, .ah-backdrop, .ah-nav .ah-lang-m { display: none; }
.ah-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.ah-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.ah-icon:hover { background: var(--bg-soft); color: var(--primary); }
.ah-toggle { display: none; }
.ah-lang { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.ah-lang a { text-decoration: none; padding: 2px 4px; border-radius: 4px; color: var(--text-muted); }
.ah-lang a[aria-current='true'] { color: var(--primary); }
.ah-auth { display: flex; align-items: center; gap: 8px; }
.ah-user { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text) !important; font-weight: 600; }
.ah-avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary); font-weight: 800; flex: none; overflow: hidden; }
.ah-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ah-avatar-sm { width: 24px; height: 24px; font-size: .7rem; }
.ah-avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }
.ah-search { border-top: 1px solid var(--border); background: var(--bg); padding: 10px 0; }
.ah-search form, .hero-search { position: relative; display: flex; align-items: center; gap: 10px; }
.ah-search input, .hero-search input { flex: 1; min-width: 0; min-height: 46px; border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; background: var(--surface); color: var(--text); font: inherit; }
.ah-suggest { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 70; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.ah-suggest a { display: flex; justify-content: space-between; gap: 12px; padding: .5rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.ah-suggest a:hover, .ah-suggest a:focus { background: var(--bg-soft); }
.ah-suggest small { color: var(--text-muted); }
.ah-style-2 .ah-row { flex-wrap: wrap; justify-content: center; padding-top: 10px; }
.ah-style-2 .ah-nav { order: 3; flex-basis: 100%; justify-content: center; margin: 0; padding-bottom: 8px; }
.ah-style-2 .ah-tools { margin-inline-start: 0; position: absolute; inset-inline-end: 16px; }
@media (max-width: 1023px) { .ah-style-2 .ah-tools { position: static; margin-inline-start: auto; } .ah-style-2 .ah-row { flex-wrap: nowrap; justify-content: flex-start; } }

/* phones: the brand may shrink (name truncates) so the five header icons never push the page wider than the screen */
@media (max-width: 480px) {
  .ah-row { gap: 8px; }
  .ah-brand { flex: 0 1 auto; min-width: 0; font-size: 1.05rem; }
  .ah-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ah-tools { flex: none; gap: 0; }
  .ah-tools .ah-icon { width: 36px; height: 36px; }
  .ah-auth { gap: 0; }
}

@media (max-width: 1023px) {
  .ah-sticky { backdrop-filter: none; background: var(--bg); }   /* a blur would trap the fixed drawer inside the header box */
  .ah-tools .ah-lang { display: none; }
  .ah-nav .ah-lang-m { display: flex; padding: .8rem .9rem 0; font-size: .95rem; }
  .ah-toggle { display: grid; }
  .ah-auth .btn { display: none; }
  .ah-user-name { display: none; }
  .ah-nav {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 330px); height: 100dvh; margin: 0; padding: 64px 14px 24px; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); box-shadow: 8px 0 32px rgba(0,0,0,.22); overflow-y: auto; transform: translateX(-102%); visibility: hidden; z-index: 80;
    transition: transform .3s cubic-bezier(.22,.8,.3,1), visibility 0s linear .3s;
  }
  [dir='rtl'] .ah-nav { inset: 0 0 0 auto; transform: translateX(102%); }
  .ah-nav.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.22,.8,.3,1), visibility 0s; }
  .ah-nav > a { padding: .8rem .9rem; font-size: 1.02rem; }
  .ah-close { display: grid; place-items: center; position: absolute; top: 12px; inset-inline-end: 12px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--bg-soft); color: var(--text); cursor: pointer; }
  .ah-nav-auth { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
  .ah-backdrop { display: block; position: fixed; inset: 0; background: rgba(8,15,35,.5); z-index: 70; }
  .ah-backdrop[hidden] { display: none; }
  body.ah-lock { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .ah-nav { transition: none !important; } }

/* ---------------------------------------------------------------- generic sections */
.ac .section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); }
.ac .section-head { max-width: 680px; margin: 0 auto 32px; text-align: center; }
.ac .section-head h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.section-head p { color: var(--text-muted); margin: 0; }
.section-more { text-align: center; margin: 28px 0 0; }
.narrow { max-width: 820px; }
.mt-lg { margin-top: 40px; }
.empty { text-align: center; padding: 44px 20px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface); }
.empty-ic { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); margin-bottom: 12px; }
.empty p { color: var(--text-muted); max-width: 46ch; margin: 0 auto 14px; }
.rich { max-width: 72ch; }
.rich h2, .rich h3 { margin-top: 1.4em; }
.rich ul, .rich ol { padding-inline-start: 1.3em; }
.rich blockquote { margin: 1em 0; padding: .5em 1em; border-inline-start: 4px solid var(--primary); background: var(--bg-soft); border-radius: 0 10px 10px 0; }

/* page banner */
.pagehead { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--bg)), var(--bg-soft)); padding: 36px 0 32px; border-bottom: 1px solid var(--border); }
.pagehead h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin-bottom: .2em; }
.pagehead p { color: var(--text-muted); margin: 0; max-width: 62ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--text-muted); margin-bottom: 10px; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary); }

/* ---------------------------------------------------------------- hero */
.ac .hero { position: relative; padding: 48px 0 64px; background: radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 62%), radial-gradient(700px 360px at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%), var(--bg); overflow: hidden; }
.ac .hero[data-bg] { background: linear-gradient(rgba(5,12,30,.62), rgba(5,12,30,.62)), var(--hero-bg) center / cover no-repeat; color: #fff; }
.ac .hero[data-bg] .lead, .ac .hero[data-bg] .hero-stats span { color: rgba(255,255,255,.85); }
.hero-grid > *, .course-layout > *, .archive > *, .student > *, .contact-grid > *, .about-grid > *, .custom-block > *, .auth-split > * { min-width: 0; }
.ac .hero .hero-grid { display: grid; gap: 36px; align-items: center; grid-template-columns: 1fr; }
.hero-copy h1 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 800; margin: .4em 0 .35em; }
.hero-copy .hl { color: var(--primary); }
.ac .hero[data-bg] .hl { color: var(--accent); }
.hero-copy .lead { font-size: 1.1rem; color: var(--text-muted); max-width: 54ch; }
.hero-search { max-width: 560px; margin: 22px 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.hero-search > .ic { margin-inline-start: 10px; color: var(--text-muted); flex: none; }
.hero-search input { border: 0; background: transparent; min-height: 44px; width: 100%; }
.hero-search .btn { flex: none; padding-inline: 1rem; }
.hero-search input:focus { outline: none; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 24px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; list-style: none; margin: 0; padding: 0; }
.hero-stats strong { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.hero-stats span { color: var(--text-muted); font-size: .85rem; }
.hero-art { position: relative; }
.hero-art img { width: 100%; border-radius: calc(var(--radius) * 1.4); box-shadow: var(--shadow); aspect-ratio: 4 / 3; object-fit: cover; }
.hero-fallback { position: relative; aspect-ratio: 4 / 3; border-radius: calc(var(--radius) * 1.6); background: linear-gradient(135deg, var(--primary), var(--secondary)); display: grid; place-items: center; color: var(--on-primary); box-shadow: var(--shadow); overflow: hidden; }
.hero-fallback i { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); }
.hero-fallback i:nth-of-type(1) { width: 180px; height: 180px; top: -50px; inset-inline-end: -40px; }
.hero-fallback i:nth-of-type(2) { width: 110px; height: 110px; bottom: 24px; inset-inline-start: 26px; }
.hero-fallback i:nth-of-type(3) { width: 60px; height: 60px; top: 40px; inset-inline-start: 60px; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.hero-fallback span { position: relative; display: grid; place-items: center; width: 120px; height: 120px; border-radius: 28px; background: rgba(255,255,255,.18); }
.hero-centered .hero-grid { text-align: center; justify-items: center; }
.hero-centered .hero-art { display: none; }
.hero-centered .hero-search, .hero-centered .hero-cta, .hero-centered .hero-stats { margin-inline: auto; justify-content: center; }
.hero-classic .hero-art { order: -1; }
@media (min-width: 960px) {
  .ac .hero { padding: 84px 0 96px; }
  .ac .hero-split .hero-grid, .ac .hero-classic .hero-grid { grid-template-columns: 1.05fr .95fr; }
  .hero-classic .hero-art { order: 0; }
}

/* ---------------------------------------------------------------- categories, features, stats, steps */
.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.cat { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text) !important; transition: .2s; }
.cat:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.cat small { color: var(--text-muted); }
.cat-ic, .feat-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: calc(var(--radius) * .8); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); margin-bottom: 8px; flex: none; }
.feat-grid, .mv-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.feat { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feat h3 { font-size: 1.1rem; }
.feat p { color: var(--text-muted); margin: 0; }
.stats-band { background: var(--secondary); color: #fff; }
.stats-band h2, .stats-band .section-head p { color: #fff; }
.stat-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); list-style: none; margin: 0; padding: 0; text-align: center; }
.stat-grid strong { display: block; font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; line-height: 1.1; }
.stat-grid span { opacity: .85; }
.steps { display: grid; gap: 22px; grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { text-align: center; padding: 8px; }
.step-n { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 1.2rem; margin-bottom: 12px; }
.steps p { color: var(--text-muted); margin: 0; }
.cta { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; justify-content: space-between; padding: 36px; border-radius: calc(var(--radius) * 1.4); background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; }
.cta h2 { color: #fff; margin: 0 0 .25em; font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
.cta p { margin: 0; opacity: .9; max-width: 56ch; }
.custom-block { display: grid; gap: 28px; align-items: center; }
.custom-img img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } .feat-grid { grid-template-columns: repeat(2, 1fr); } .steps { grid-template-columns: repeat(2, 1fr); } .mv-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); } .feat-grid { grid-template-columns: repeat(4, 1fr); } .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .cta { flex-direction: row; align-items: center; }
  .custom-block.has-img { grid-template-columns: 1.1fr .9fr; }
}

/* ---------------------------------------------------------------- course cards */
.cc-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
.cc { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(11,27,58,.05); transition: transform .2s, box-shadow .2s, border-color .2s; }
.cc:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.cc-media { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.cc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.cc:hover .cc-media img { transform: scale(1.04); }
.cc-ph { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 22%, var(--bg-soft)), color-mix(in srgb, var(--secondary) 22%, var(--bg-soft))); color: var(--primary); }
.cc-badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; }
.cc-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; gap: 6px; }
.cc-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .78rem; }
.cc-cat { font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: .03em; }
.cc-level { color: var(--text-muted); }
.cc-title { font-size: 1.08rem; margin: 0; }
.cc-title a { color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-title a:hover { color: var(--primary); }
.cc-sum { color: var(--text-muted); margin: 0; font-size: .92rem; }
.cc-by { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .88rem; color: var(--text-muted); }
.cc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 4px 0 0; padding: 0; font-size: .82rem; color: var(--text-muted); }
.cc-meta li { display: inline-flex; align-items: center; gap: 4px; }
.cc-rate { color: #b7791f; font-weight: 700; }
.cc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.cc-price { font-size: 1.15rem; color: var(--primary); }
.ac-card-2 .cc { border-radius: calc(var(--radius) * 1.3); border: 0; box-shadow: var(--shadow); }
.ac-card-2 .cc-foot { border-top: 0; }
.cc-stack { display: grid; gap: 16px; }
.cc-list { flex-direction: row; }
.cc-list .cc-media { flex: 0 0 38%; aspect-ratio: auto; min-height: 160px; }
@media (max-width: 599px) { .cc-list { flex-direction: column; } .cc-list .cc-media { aspect-ratio: 16 / 9; } }
@media (min-width: 640px) { .cc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .cc-grid:not(.cc-grid-3) { grid-template-columns: repeat(4, 1fr); } }

/* ---------------------------------------------------------------- archive */
.archive { display: grid; gap: 24px; padding-block: 32px 56px; grid-template-columns: 1fr; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; align-self: start; }
.filters .field { margin-bottom: 12px; }
.filters .btn-block + .btn-block { margin-top: 8px; }
.archive-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.archive-bar p { margin: 0; }
.archive-tools { display: flex; gap: 10px; align-items: center; }
.sort-form select { min-height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; background: var(--surface); color: var(--text); font: inherit; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.view-toggle a { display: grid; place-items: center; width: 40px; height: 40px; color: var(--text-muted); }
.view-toggle a[aria-current='true'] { background: var(--primary); color: var(--on-primary); }
.pager { margin-top: 28px; display: flex; justify-content: center; }
.pg { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pg-btn { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; background: var(--surface); }
.pg-btn.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pg-btn.disabled { opacity: .45; }
.pg-gap { align-self: center; }
@media (min-width: 960px) { .archive { grid-template-columns: 270px 1fr; } .filters { position: sticky; top: 90px; } }

/* inputs the base stylesheet does not know about */
.ac .field input[type='search'], .ac .field input[type='tel'], .ac .field input[type='date'] { width: 100%; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.ac .field input[type='search']:focus { border-color: var(--primary); outline: none; }

/* ---------------------------------------------------------------- instructors */
.ins-grid { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
.ins { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-align: center; transition: .2s; }
.ins:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ins-photo { display: grid; place-items: center; aspect-ratio: 1; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 20%, var(--bg-soft)), var(--bg-soft)); overflow: hidden; }
.ins-photo img { width: 100%; height: 100%; object-fit: cover; }
.ins-photo, .ins-photo:hover { text-decoration: none; }
.ins-initial { font-size: 3.4rem; font-weight: 800; color: var(--primary); display: grid; place-items: center; width: 100%; height: 100%; }
.ins-body { padding: 14px 12px 16px; }
.ins-body h3 { margin: 0; font-size: 1.05rem; }
.ins-body h3 a { color: var(--text); text-decoration: none; }
.ins-title { margin: 2px 0 8px; color: var(--text-muted); font-size: .88rem; }
.ins-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; list-style: none; margin: 0 0 8px; padding: 0; font-size: .8rem; color: var(--text-muted); }
.ins-meta li { display: inline-flex; align-items: center; gap: 4px; }
.ins-social { justify-content: center; }
.ins-social a { width: 30px; height: 30px; }
.ins-profile { display: grid; gap: 28px; grid-template-columns: 1fr; }
.ins-profile-photo { max-width: 320px; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); aspect-ratio: 1; display: grid; place-items: center; }
.ins-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0 0 18px; padding: 0; }
.stat-chips li { padding: .5rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
@media (min-width: 640px) { .ins-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 270px)); justify-content: center; } }
@media (min-width: 960px) { .ins-profile { grid-template-columns: 320px 1fr; } }

/* ---------------------------------------------------------------- course detail */
.pagehead-course { background: linear-gradient(135deg, var(--secondary), color-mix(in srgb, var(--secondary) 70%, var(--primary))); color: #fff; border: 0; padding: 30px 0 36px; }
.pagehead-course .crumbs, .pagehead-course .crumbs a { color: rgba(255,255,255,.75); }
.pagehead-course h1 { color: #fff; }
.course-head .lead { color: rgba(255,255,255,.85); max-width: 70ch; font-size: 1.05rem; }
.course-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 12px 0 0; padding: 0; font-size: .92rem; }
.course-facts li { display: inline-flex; align-items: center; gap: 6px; }
.course-facts a { color: #fff; }
.course-layout { display: grid; gap: 28px; padding-block: 28px 60px; grid-template-columns: 1fr; }
.course-main .block { margin-bottom: 36px; }
.course-main h2 { font-size: 1.4rem; }
.checks, .dots { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .ic { color: var(--ok); margin-top: 3px; flex: none; }
.dots li { padding-inline-start: 18px; position: relative; }
.dots li::before { content: ''; position: absolute; inset-inline-start: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.acc { border: 1px solid var(--border); border-radius: calc(var(--radius) * .8); margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.acc summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '+'; margin-inline-start: auto; font-size: 1.2rem; color: var(--primary); }
.acc[open] summary::after { content: '\2013'; }
.acc ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.acc li { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: .94rem; }
.acc li:last-child { border-bottom: 0; }
.acc li small { margin-inline-start: auto; color: var(--text-muted); }
.acc .lock { color: var(--text-muted); margin-inline-start: auto; }
.acc li small + .lock, .acc li .lock + small { margin-inline-start: 8px; }
.ins-box { display: flex; gap: 18px; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ins-box-photo { flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; }
.ins-box-photo img { width: 100%; height: 100%; object-fit: cover; }
.ins-box-photo .ins-initial { font-size: 2.2rem; }
.reviews { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.reviews li { display: flex; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.reviews p { margin: 4px 0 0; }
.stars { color: #d69e2e; }
.buy { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.2); overflow: hidden; box-shadow: var(--shadow); }
.buy-media { position: relative; aspect-ratio: 16 / 9; background: var(--bg-soft); }
.buy-media img { width: 100%; height: 100%; object-fit: cover; }
.buy-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.28); color: #fff !important; }
.buy-play .ic { width: 64px; height: 64px; padding: 18px; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
.buy-body { padding: 20px; }
.buy-price { font-size: 2rem; font-weight: 800; margin: 0 0 12px; color: var(--primary); }
.buy-h { font-size: 1rem; margin: 20px 0 8px; }
.buy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .94rem; }
.buy-list li { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.buy-list .ic { color: var(--primary); }
@media (min-width: 960px) {
  .course-layout { grid-template-columns: minmax(0, 1fr) 370px; align-items: start; }
  .course-side { position: sticky; top: 92px; margin-top: -140px; }
}

/* ---------------------------------------------------------------- about, contact, testimonials */
.about-grid { display: grid; gap: 32px; align-items: center; }
.about-img { position: relative; }
.about-img img { border-radius: var(--radius); box-shadow: var(--shadow); }
.about-img .about-img2 { position: absolute; width: 46%; inset-inline-end: -8px; bottom: -22px; border: 6px solid var(--bg); }
.message { margin: 0; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 1.15rem; }
.message footer { margin-top: 10px; color: var(--text-muted); font-size: .95rem; }
.contact-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
.contact-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .feat-ic { margin: 0; width: 44px; height: 44px; }
.contact-list p { margin: 0; color: var(--text-muted); }
.map iframe { width: 100%; height: 280px; border: 0; border-radius: var(--radius); margin-top: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tm-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.tm { margin: 0; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.tm blockquote { margin: 0; font-size: 1rem; flex: 1; }
.tm-stars { color: var(--border); display: flex; gap: 2px; }
.tm-stars .on { color: #d69e2e; fill: #d69e2e; }
.tm figcaption { display: flex; gap: 12px; align-items: center; }
.tm figcaption small { display: block; color: var(--text-muted); }
.tm-photo { border-radius: 50%; width: 44px; height: 44px; object-fit: cover; }
.page-img { border-radius: var(--radius); margin-bottom: 24px; width: 100%; }
@media (min-width: 640px) { .tm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .tm-grid { grid-template-columns: repeat(3, 1fr); } .about-grid.has-img { grid-template-columns: 1.1fr .9fr; } .contact-grid { grid-template-columns: 1fr 1.1fr; } }

/* ---------------------------------------------------------------- footer */
.af { background: var(--secondary); color: rgba(255,255,255,.82); margin-top: 0; }
.af a { color: rgba(255,255,255,.82); text-decoration: none; }
.af a:hover { color: #fff; text-decoration: underline; }
.af h3 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.af-grid { display: grid; gap: 28px; padding-block: 48px 32px; grid-template-columns: 1fr; }
.af ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.af-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff !important; font-size: 1.15rem; margin-bottom: 12px; }
.ac .af-logo, .af-logo { height: clamp(48px, 6vw, 64px); width: auto; max-width: min(220px, 70vw); object-fit: contain; background: #fff; padding: 4px 8px; border-radius: 12px; }
.af-contact li { display: flex; gap: 10px; align-items: flex-start; }
.af-contact .ic { margin-top: 4px; flex: none; }
.af-social a { border-color: rgba(255,255,255,.3); color: #fff; }
.af-bottom { border-top: 1px solid rgba(255,255,255,.14); font-size: .85rem; }
.af-bottom-row { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; padding-block: 16px; }
.af-style-2 { background: var(--bg-soft); color: var(--text-muted); }
.af-style-2 a, .af-style-2 h3, .af-style-2 .af-brand { color: var(--text) !important; }
.af-style-2 .af-bottom { border-color: var(--border); }
.af-style-2 .af-social a { color: var(--text-muted); border-color: var(--border); }
@media (min-width: 720px) { .af-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }

/* ---------------------------------------------------------------- auth */
.ac-auth main { min-height: 70vh; }
.auth-split { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 140px); }
.auth-side { display: none; background: linear-gradient(145deg, var(--primary), var(--secondary)); color: #fff; padding: 56px; align-items: center; }
.auth-side-in { max-width: 420px; margin-inline: auto; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none; margin-bottom: 36px; font-size: 1.2rem; }
.auth-logo { background: #fff; padding: 6px 10px; border-radius: 10px; height: 48px; width: auto; }
.auth-side h2 { color: #fff; font-size: 2rem; }
.auth-side p { opacity: .9; }
.auth-points { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px 16px; }
.auth-form { width: min(100%, 440px); }
.auth-form h1 { font-size: 1.7rem; }
.auth-alt { text-align: center; color: var(--text-muted); margin-top: 18px; }
@media (min-width: 900px) { .auth-split { grid-template-columns: 1fr 1fr; } .auth-side { display: flex; } }

/* ---------------------------------------------------------------- student area */
.student { display: grid; gap: 24px; padding-block: 28px 56px; grid-template-columns: 1fr; }
.s-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; align-self: start; }
.s-user { display: flex; gap: 12px; align-items: center; padding: 6px 6px 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.s-user small { display: block; color: var(--text-muted); }
.s-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; }
.s-nav a, .s-nav button { display: flex; align-items: center; gap: 10px; padding: .6rem .8rem; border-radius: 10px; color: var(--text); text-decoration: none; font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; white-space: nowrap; width: 100%; }
.s-nav a:hover, .s-nav button:hover { background: var(--bg-soft); color: var(--primary); }
.s-nav a[aria-current='page'] { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.s-stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 20px; }
.s-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.s-stats .ic { color: var(--primary); }
.s-stats strong { font-size: 1.7rem; line-height: 1.1; }
.s-stats span { color: var(--text-muted); font-size: .85rem; }
.resume { display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: var(--radius); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), var(--surface)); border: 1px solid var(--border); margin-bottom: 26px; }
.resume h2 { margin: 6px 0 10px; font-size: 1.25rem; }
.s-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 12px; }
.s-head h2 { margin: 0; font-size: 1.2rem; }
.sc-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.sc { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sc-media { display: block; aspect-ratio: 16 / 9; background: var(--bg-soft); }
.sc-media img { width: 100%; height: 100%; object-fit: cover; }
.sc-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.sc-body h3 { margin: 0; font-size: 1.02rem; }
.sc-body h3 a { color: var(--text); text-decoration: none; }
.act { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.act li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.act li > span:first-of-type, .act li > a:first-of-type { flex: 1; }
.ac .progress > span { background: linear-gradient(90deg, var(--primary), var(--accent)); }
@media (min-width: 640px) { .s-stats { grid-template-columns: repeat(4, 1fr); } .sc-grid { grid-template-columns: repeat(2, 1fr); } .resume { flex-direction: row; align-items: center; justify-content: space-between; } .resume > div { flex: 1; } }
@media (min-width: 960px) {
  .student { grid-template-columns: 250px 1fr; }
  .s-nav ul { flex-direction: column; overflow: visible; }
  .s-nav { position: sticky; top: 90px; }
  .sc-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------- course player */
.player { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 140px); }
.player-toggle { margin: 10px 16px; justify-self: start; }
.player-side { display: none; background: var(--surface); border-inline-end: 1px solid var(--border); }
.player.open .player-side { display: block; border-bottom: 1px solid var(--border); }
.player-side-head { padding: 16px; display: grid; gap: 8px; border-bottom: 1px solid var(--border); }
.player-side a { text-decoration: none; }
.pl-topic { border-bottom: 1px solid var(--border); }
.pl-topic summary { padding: 12px 16px; font-weight: 700; cursor: pointer; }
.pl-topic ul { list-style: none; margin: 0; padding: 0 0 8px; }
.pl-topic li a { display: flex; align-items: center; gap: 10px; padding: .55rem 16px; color: var(--text); font-size: .92rem; }
.pl-topic li a small { margin-inline-start: auto; color: var(--text-muted); }
.pl-topic li.current a { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font-weight: 600; }
.pl-ic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); flex: none; color: var(--text-muted); }
.pl-ic.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.player-main { padding: 20px 16px 48px; max-width: 980px; width: 100%; }
.player-main h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
.player-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
@media (min-width: 960px) {
  .player { grid-template-columns: 340px 1fr; }
  .player-toggle { display: none; }
  .player-side { display: block; position: sticky; top: 68px; align-self: start; max-height: calc(100vh - 68px); overflow-y: auto; }
  .player-main { padding: 28px 32px 56px; }
}

/* ---------------------------------------------------------------- dark mode touches */
:root[data-theme='dark'] .cc, :root[data-theme='dark'] .ins, :root[data-theme='dark'] .feat, :root[data-theme='dark'] .buy { box-shadow: none; }
:root[data-theme='dark'] .cc-rate, :root[data-theme='dark'] .stars { color: #f6c453; }
:root[data-theme='dark'] .stats-band { background: color-mix(in srgb, var(--secondary) 70%, #000); }
:root[data-theme='dark'] .af { background: color-mix(in srgb, var(--secondary) 55%, #000); }
:root[data-theme='dark'] .pagehead-course { background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 60%, #000), color-mix(in srgb, var(--primary) 30%, #000)); }

@media (prefers-reduced-motion: reduce) { .cc, .cc-media img, .cat, .ins { transition: none !important; } .cc:hover, .cat:hover, .ins:hover { transform: none; } }
@media print { .ah, .ah-top, .af, .s-nav, .player-side { display: none !important; } }


/* quizzes: student player, results, builder */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qz-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 14px; padding: 0; }
.qz-q { margin-bottom: 12px; border: 1px solid var(--border); }
.qz-q legend { padding: 0 6px; font-size: 1.05rem; }
.qz-num { margin-inline-end: 4px; font-weight: 700; }
.qz-qimg { max-width: 100%; max-height: 260px; border-radius: 10px; margin-bottom: 10px; }
.qz-options .qz-opt { padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.qz-options .qz-opt:has(input:checked) { border-color: var(--primary); background: var(--bg-soft); }
.qz-imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.qz-imgopt { display: flex; flex-direction: column; gap: 6px; align-items: center; border: 2px solid var(--border); border-radius: 12px; padding: 8px; cursor: pointer; text-align: center; }
.qz-imgopt:has(input:checked) { border-color: var(--primary); background: var(--bg-soft); }
.qz-imgopt img { width: 100%; height: 120px; object-fit: contain; border-radius: 8px; }
.qz-imgopt input { align-self: flex-start; }
.qz-blank input { display: inline-block; width: 9rem; max-width: 100%; margin: 0 4px; padding: .3rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.qz-match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 10px; }
.qz-match select { width: 100%; min-height: 44px; }
.qz-matchimg { max-width: 100%; max-height: 120px; object-fit: contain; border-radius: 8px; }
@media (max-width: 520px) { .qz-match { grid-template-columns: 1fr; } }
.qz-sort, .qz-rows, .qz-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.qz-sort li, .qz-row { display: flex; align-items: center; gap: 8px; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.qz-sorttext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qz-handle { touch-action: none; cursor: grab; border: 0; background: none; color: var(--text-muted); font-size: 1.3rem; padding: .25rem .5rem; min-width: 40px; min-height: 40px; user-select: none; }
.qz-dragging { opacity: .55; box-shadow: var(--shadow); }
.qz-pos { width: 4rem; }
.qz-sort.qz-js .qz-pos { display: none; }
.qz-arrows { display: inline-flex; gap: 4px; }
.qz-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.qz-nav [hidden], #quiz-form [data-q][hidden] { display: none !important; }
.qz-timer { position: sticky; top: 70px; z-index: 5; }
.qz-hint { margin-bottom: 10px; }
.qz-verdict { font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; }
.qz-verdict.ok, .qz-review.qz-correct .badge { color: var(--ok); }
.qz-verdict.bad { color: var(--danger); }
.qz-score { font-size: 1.1rem; }
.qz-review { border-inline-start: 4px solid var(--border); }
.qz-review.qz-correct { border-inline-start-color: var(--ok); }
.qz-review.qz-wrong { border-inline-start-color: var(--danger); }
.qz-table { width: 100%; border-collapse: collapse; }
.qz-table th, .qz-table td { text-align: start; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
.qz-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0 0 16px; }
.qz-stats li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; }
.qz-stats strong { font-size: 1.5rem; }
.qz-item { display: flex; align-items: center; gap: 10px; padding: 12px; margin: 0; flex-wrap: wrap; }
.qz-item-main { flex: 1; min-width: 200px; }
.qz-item.qz-off { opacity: .6; }
.qz-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.qz-types { display: flex; flex-wrap: wrap; gap: 8px; }
.qz-row input[type='text'] { flex: 1; min-width: 0; }
.qz-row input[type='file'] { flex: 1; min-width: 0; max-width: 220px; }
.qz-thumb { width: 56px; height: 56px; flex: none; display: grid; place-items: center; background: var(--bg-soft); border-radius: 8px; overflow: hidden; }
.qz-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qz-navset { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 16px; padding: 8px 12px; }
.topic-actions { margin-top: 10px; }
@media (max-width: 640px) { .qz-row { flex-wrap: wrap; } .qz-row input[type='file'] { max-width: 100%; } }

/* admin website CMS */
.cms-grid { display: grid; gap: 16px; list-style: none; margin: 0 0 16px; padding: 0; }
.cms-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; }
.cms-sec > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; }
.cms-sec > summary::-webkit-details-marker { display: none; }
.cms-sec .cms-body { padding: 0 16px 16px; }
.cms-sec.off > summary { opacity: .6; }
.cms-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.cms-tabs a { display: block; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; }
.cms-tabs a[aria-current='page'] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.cms-img { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cms-img img { max-height: 70px; width: auto; border-radius: 8px; border: 1px solid var(--border); }
.cms-rows { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.cms-rows .qz-row { flex-wrap: wrap; }
.cms-rows .qz-row textarea { flex: 1 1 200px; min-height: 44px; }
.cms-note { color: var(--text-muted); font-size: .85rem; }

/* live class countdown */
.lc { display: inline-flex; align-items: center; gap: 6px; }
.lc-unit { display: inline-flex; flex-direction: column; align-items: center; min-width: 44px; padding: 5px 7px 4px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 12%, var(--bg-soft)); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); line-height: 1; }
.lc-unit[hidden], .lc-live[hidden] { display: none; }
.lc-unit b { font-variant-numeric: tabular-nums; font-size: 1.05rem; font-weight: 800; color: var(--primary); display: block; }
.lc-unit i { font-style: normal; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-top: 3px; }
.lc-tick { animation: lc-flip .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes lc-flip { 0% { transform: translateY(-60%) rotateX(80deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.lc-soon .lc-unit { animation: lc-pulse 1.6s ease-in-out infinite; border-color: var(--primary); }
@keyframes lc-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.lc-live { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: #e5334b; color: #fff; font-weight: 700; font-size: .85rem; }
.lc-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: lc-blink 1s ease-in-out infinite; }
@keyframes lc-blink { 50% { opacity: .25; transform: scale(.7); } }
@media (max-width: 480px) { .lc { gap: 4px; } .lc-unit { min-width: 38px; padding: 4px 5px 3px; } .lc-unit b { font-size: .95rem; } }
@media (prefers-reduced-motion: reduce) { .lc-tick, .lc-soon .lc-unit, .lc-dot { animation: none; } }

/* course intro video */
.buy-media { position: relative; overflow: hidden; }
.buy-media > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.buy-play-lg { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .2s; animation: iv-pulse 2s ease-in-out infinite; }
.buy-play-lg:hover { transform: scale(1.08); }
@keyframes iv-pulse { 0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 0 0 color-mix(in srgb, var(--primary) 55%, transparent); } 50% { box-shadow: 0 8px 24px rgba(0,0,0,.35), 0 0 0 14px transparent; } }
.iv-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.8); }
.iv-frame { position: relative; width: min(960px, 100%); aspect-ratio: 16 / 9; background: #000; border-radius: 12px; }
.iv-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; }
.iv-close { position: absolute; top: -40px; right: 0; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; color: #000; font-size: 22px; line-height: 1; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .buy-play-lg { animation: none; } }

/* LMS video player shell */
.lms-player { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #05080f; border-radius: var(--radius, 12px); overflow: hidden; }
.lms-player > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lms-player .plyr, .lms-player .plyr__video-embed { position: absolute; inset: 0; width: 100%; height: 100%; }
.lms-player { --plyr-color-main: var(--primary); --plyr-video-background: #05080f; }
.lms-player .plyr--video { border-radius: inherit; }
.lms-player-state { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; color: #cbd5e1; background: #05080f; }
.lms-player-state[hidden] { display: none; }
.lms-spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--primary); animation: lms-rot .9s linear infinite; }
@keyframes lms-rot { to { transform: rotate(360deg); } }
.iv-frame.lms-player { width: min(960px, 100%); }
@media (prefers-reduced-motion: reduce) { .lms-spin { animation-duration: 3s; } }
/* YouTube draws its title bar and "Watch on" link along the top/bottom edge of its frame. The frame is made taller than
   the 16:9 video, so those edge bars sit in the letterbox area outside the visible player. The video itself is untouched. */
.lms-player .plyr--youtube .plyr__video-embed iframe { height: 150%; top: -25%; }
.lms-player .plyr--youtube .plyr__video-embed { overflow: hidden; }


/* ---------------------------------------------------------------- instructor dashboard charts */
.bar-row { display: grid; grid-template-columns: minmax(80px, 2fr) 3fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: .9rem; }
.bar { display: block; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--primary) 15%, transparent); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 18px; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.chart-col i { display: block; width: 70%; min-height: 2px; background: var(--primary); border-radius: 6px 6px 0 0; }
.chart-val, .chart-lbl { font-size: .72rem; opacity: .8; }

/* grid children may shrink below their content so a wide table scrolls inside its own wrapper instead of widening the page */
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
/* section rows of the homepage editor wrap on phones instead of widening the page */
.cms-sec > summary { flex-wrap: wrap; }
.cms-sec > summary > span:not(.qz-arrows) { min-width: 0; overflow-wrap: anywhere; }

.rm.rm-on { overflow: hidden; transition: max-height .3s ease; }
.rm.rm-on:not(.rm-open) { -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.rm-btn { margin-top: 8px; min-height: 40px; }
@media (prefers-reduced-motion: reduce) { .rm.rm-on { transition: none; } }

/* ---- Admin sidebar (desktop): turns the grouped admin nav into a left sidebar. Below 960px the pill layout above is kept. */
@media (min-width: 960px) {
  .container:has(> .admin-nav-wrap) { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .container:has(> .admin-nav-wrap) > * { grid-column: 2; }
  .container:has(> .admin-nav-wrap) > .admin-nav-wrap {
    grid-column: 1; grid-row: 1 / span 40; position: sticky; top: 16px; margin: 0;
    max-height: calc(100vh - 32px); overflow-y: auto; padding: 12px 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  }
  body:has(.ah-sticky) .container:has(> .admin-nav-wrap) > .admin-nav-wrap { top: 96px; max-height: calc(100vh - 112px); }
  .admin-nav-wrap .admin-nav-group { display: block; margin: 0 0 14px; }
  .admin-nav-wrap .admin-nav-title { display: block; min-width: 0; margin: 0 0 4px; padding: 0 .7rem; }
  .admin-nav-wrap .admin-nav { flex-direction: column; flex-wrap: nowrap; gap: 2px; margin: 0 0 14px; }
  .admin-nav-wrap .admin-nav-group .admin-nav { margin: 0; }
  .admin-nav-wrap .admin-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 8px; padding: .45rem .7rem; background: transparent; }
  .admin-nav-wrap .admin-nav a:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
  .admin-nav-wrap .admin-nav a[aria-current='page'] { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); font-weight: 600; }
}

/* ---- Course editor steps (see js/course-steps.js). Without JS the panels are all visible. */
.course-steps .steps-bar { display: flex; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; border-bottom: 1px solid var(--border); overflow-x: auto; }
.course-steps .step-tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; padding: .7rem 1rem; font: inherit; font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.course-steps .step-tab .step-no { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-inline-end: .5rem; border-radius: 50%; border: 1px solid var(--border); font-size: .85rem; }
.course-steps .step-tab[aria-selected='true'] { color: var(--primary); border-bottom-color: var(--primary); }
.course-steps .step-tab[aria-selected='true'] .step-no { background: var(--primary); border-color: var(--primary); color: #fff; }
.course-steps .step-tab:hover { color: var(--primary); }
.course-steps .step-nav { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.course-steps:not(.is-stepped) .steps-bar, .course-steps:not(.is-stepped) .step-nav { display: none; }

/* ---- Curriculum builder (course editor, step 2) */
.cur-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 8px 0 4px; }
.cur-head h2 { margin: 0; }
.cur-topic { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; box-shadow: var(--shadow); }
.cur-topic.dragging, .cur-item.dragging { opacity: .45; }
.cur-topic-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.cur-no { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--primary-contrast); font-weight: 700; font-size: .9rem; }
.cur-topic-title { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.cur-topic-title strong { font-size: 1.08rem; overflow-wrap: anywhere; }
.cur-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-inline-start: auto; }
.cur-actions .inline-form { display: inline-flex; }
.cur-icon-btn { min-width: 34px; padding-inline: .5rem; }
.cur-body { padding: 10px 16px 16px; }

.cur-items { list-style: none; margin: 0; padding: 0; }
.cur-item { border-bottom: 1px solid var(--border); }
.cur-item:last-child { border-bottom: 0; }
.cur-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.cur-ico { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg-soft); color: var(--primary); font-size: .85rem; font-weight: 700; }
.cur-ico-quiz { color: var(--accent); }
.cur-ico-live { color: var(--danger); }
.cur-main { flex: 1 1 auto; min-width: 0; }
.cur-title { display: block; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.cur-title:hover { color: var(--primary); }
.cur-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: .8rem; color: var(--text-muted); }
.cur-more { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 12px 82px; }

/* "Edit" and "Files" buttons that open a clean edit card */
.cur-chip > summary, .cur-add-d > summary { list-style: none; cursor: pointer; display: inline-block; padding: .35rem .9rem; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; font-size: .875rem; background: var(--surface); color: var(--text); user-select: none; }
.cur-chip > summary::-webkit-details-marker, .cur-add-d > summary::-webkit-details-marker { display: none; }
.cur-chip > summary:hover, .cur-add-d > summary:hover { border-color: var(--primary); color: var(--primary); }
.cur-chip > summary:focus-visible, .cur-add-d > summary:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.cur-chip[open], .cur-add-d[open] { flex-basis: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 14px; background: var(--bg-soft); }
.cur-chip[open] > summary, .cur-add-d[open] > summary { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); margin-bottom: 12px; }
.cur-body > .cur-chip { margin-bottom: 8px; }
.cur-body > .cur-chip[open] { display: block; }
.cur-edit { margin: 0; }
.cur-edit .field { margin-bottom: 12px; }
.cur-edit .field input[type='text'], .cur-edit .field input[type='url'], .cur-edit .field input[type='number'], .cur-edit .field input[type='datetime-local'], .cur-edit .field select, .cur-edit .field textarea { width: 100%; }
.cur-edit .field textarea { min-height: 140px; }
.cur-edit label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0 0 12px; }
.cur-edit label.check input { width: auto; margin: 0; }
.cur-edit-actions { display: flex; gap: 8px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.cur-edit .list-clean li { background: var(--surface); padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }

.cur-empty { margin: 10px 0; padding: 16px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 10px; }
.cur-add { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.cur-add-label { align-self: center; margin-inline-end: 4px; font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }

.cur-newtopic { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px; border: 2px dashed var(--border); border-radius: var(--radius); }
.cur-newtopic .field { flex: 1 1 260px; margin: 0; }
.cur-newtopic .field input { width: 100%; }

.cur-live-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 0; }
.cur-live-item > form[style] { margin-top: 4px; }

@media (max-width: 640px) {
  .cur-more { padding-left: 0; }
  .cur-row { flex-wrap: wrap; }
  .cur-actions { width: 100%; margin-inline-start: 0; }
  .cur-topic-head .cur-actions { margin-top: 2px; }
}

/* Course permalink field */
.perma-row { display: flex; align-items: stretch; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.perma-row:focus-within { border-color: var(--primary); }
.perma-base { flex: none; display: inline-flex; align-items: center; padding: 0 .75rem; background: var(--bg-soft); color: var(--text-muted); font-size: .875rem; border-inline-end: 1px solid var(--border); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perma-row input[type='text'] { flex: 1 1 auto; min-width: 0; border: 0; border-radius: 0; background: transparent; outline: none; }
@media (max-width: 640px) { .perma-row { flex-direction: column; } .perma-base { max-width: 100%; border-inline-end: 0; border-bottom: 1px solid var(--border); padding: .4rem .75rem; } }

/* ---- Admin > Enrollment */
.enr-form h2 { margin-top: 0; }
.enr-mode { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; padding: 0; border: 0; }
.enr-mode legend { width: 100%; padding: 0; margin-bottom: 8px; }
.enr-choice { flex: 1 1 240px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.enr-choice:hover { border-color: var(--primary); }
.enr-choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.enr-choice input { margin-top: 4px; }
.enr-choice span { display: flex; flex-direction: column; gap: 2px; }
.enr-choice small { color: var(--text-muted); }
.enr-paid { margin: 0 0 4px; padding: 14px 14px 2px; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg-soft); }
.enr-paid[hidden] { display: none; }
.enr-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; padding: 14px 16px; }
.enr-filters .field { flex: 1 1 200px; margin: 0; }
.enr-filters .field input, .enr-filters .field select { width: 100%; }
.enr-form .field select, .enr-form .field input[type='email'], .enr-form .field input[type='number'], .enr-form .field input[type='text'] { width: 100%; }
