@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --bg: #f4f2f7;
  --bg-accent: radial-gradient(1200px 600px at 10% -10%, rgba(125, 85, 165, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(60, 184, 122, 0.1), transparent 50%),
    #f4f2f7;
  --surface: #ffffff;
  --surface-2: #faf8fc;
  --line: #e6e0ee;
  --text: #1c1526;
  --muted: #6b6178;
  --brand: #7d55a5;
  --brand-deep: #5a3a7a;
  --brand-soft: rgba(125, 85, 165, 0.12);
  --ok: #1f9d63;
  --ok-soft: rgba(31, 157, 99, 0.12);
  --warn: #c47b16;
  --warn-soft: rgba(196, 123, 22, 0.14);
  --danger: #c4453b;
  --shadow: 0 10px 30px rgba(40, 24, 60, 0.06);
  --radius: 14px;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --sidebar: 15.5rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-accent);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 0.5rem;
}
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin-bottom: 0.35rem;
}
.lead { font-size: 1.1rem; }
code {
  font-size: 0.86em;
  background: var(--brand-soft);
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
.btn-cta { background: var(--brand); color: #fff; }
.btn-cta:hover { background: var(--brand-deep); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-block { width: 100%; }
.text-link {
  color: var(--brand-deep);
  font-weight: 600;
  display: inline-block;
  margin-top: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.75rem;
  font-weight: 700;
}
.pill--soft { background: #efeef3; color: var(--muted); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }

/* Auth */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.75rem; }
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
  font-size: 0.92rem;
  color: var(--brand-deep);
  font-weight: 600;
}
.demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.form { display: grid; gap: 0.9rem; margin-top: 1rem; }
.form label { display: grid; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.form input, .form textarea, .notes textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: #fff;
}
.form input:focus, .form textarea:focus, .notes textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, white);
  border-color: var(--brand);
}

/* Shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
.shell-sidebar {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1rem;
  background: linear-gradient(180deg, #2a1b3a, #1a1224);
  color: #f6f1fb;
}
.shell-sidebar--admin {
  background: linear-gradient(180deg, #1d2430, #12161d);
}
.app-shell.nav-open .shell-sidebar {
  display: flex;
  position: fixed;
  inset: 0 auto 0 0;
  width: min(84vw, var(--sidebar));
  z-index: 40;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}
.brand__mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
}
.brand__mark--admin { background: #3d8bfd; }
.brand__text { display: grid; }
.brand__text small { color: rgba(255,255,255,0.65); font-size: 0.78rem; }
.side-nav { display: grid; gap: 0.25rem; }
.side-nav__link {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.82);
  font-weight: 600;
}
.side-nav__link:hover, .side-nav__link.is-active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.sidebar-foot { margin-top: auto; display: grid; gap: 0.5rem; }
.sidebar-foot .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.2); }

.shell-main { min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.5rem;
}
.topbar h1 { font-size: clamp(1.4rem, 2vw, 1.85rem); margin: 0; }
.topbar__sub { color: var(--muted); margin: 0.25rem 0 0; }
.topbar__actions { display: flex; align-items: center; gap: 0.6rem; }
.nav-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.page { padding: 0.5rem 1.25rem 2.5rem; display: grid; gap: 1rem; }
.page--wide { max-width: none; }

.panel, .hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.hero-panel {
  background:
    linear-gradient(135deg, rgba(125, 85, 165, 0.1), rgba(255,255,255,0.9) 45%),
    var(--surface);
  animation: rise 420ms ease both;
}
.hero-panel--admin {
  background: linear-gradient(135deg, rgba(61, 139, 253, 0.12), #fff 50%);
}
.panel--row {
  display: grid;
  gap: 1rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.ud-continue-pay {
  margin: 1.1rem 0 0;
  padding: 1.05rem 1.15rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.1), #fff 58%);
  border: 1px solid rgba(225, 29, 72, 0.2);
}
.ud-continue-pay .eyebrow {
  margin: 0 0 0.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #be123c;
}
.ud-continue-pay h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}
.ud-continue-pay p {
  margin: 0;
}

.curr-lesson {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.curr-lesson__check {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 0.35rem;
  background: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.curr-lesson__check:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.curr-lesson__title {
  flex: 1 1 auto;
  text-decoration: none;
}
.ud-sec__list .ud-check {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 0.3rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.ud-sec__list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ud-sec__list li > a {
  flex: 1 1 auto;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  display: grid;
  gap: 0.25rem;
}
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat strong, .stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
}
.progress-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  color: var(--muted);
  font-weight: 600;
}
.progress-bar {
  flex: 1;
  height: 0.55rem;
  background: #ebe6f2;
  border-radius: 999px;
  overflow: hidden;
  min-width: 120px;
}
.progress-bar--lg { height: 0.85rem; margin-top: 0.75rem; }
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #9b6fc4);
  border-radius: inherit;
  transition: width 400ms ease;
}

.lesson-mini, .announce-list, .simple-list, .bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.65rem; }
.lesson-mini a, .simple-list a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
}
.lesson-mini a:hover, .simple-list a:hover { border-color: var(--line); }
.announce-list li { padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.announce-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.course-chip {
  display: grid;
  gap: 0.2rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--brand-soft);
  margin-bottom: 0.75rem;
}

.month-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.month-ladder--stack { flex-direction: column; }
.month-ladder__item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f3f1f6;
  font-size: 0.88rem;
  font-weight: 600;
}
.month-ladder__item small { display: block; font-weight: 500; color: var(--muted); }
.month-ladder__item--complete { background: var(--ok-soft); color: var(--ok); }
.month-ladder__item--current { background: var(--brand-soft); color: var(--brand-deep); }

.curriculum { display: grid; gap: 1rem; }
.curr-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.curr-section header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.curr-section__sub { margin: 0 0 0.65rem; }
.curr-unit { margin-top: 0.85rem; }
.curr-unit:first-of-type { margin-top: 0.15rem; }
.curr-unit h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--brand-deep);
}
.curr-resources {
  margin-top: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: #f7f9fa;
  border-radius: 8px;
}
.curr-resources h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}
.curr-resources__list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: grid;
  gap: 0.2rem;
}
.curr-resources__list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.86rem;
  padding: 0.2rem 0;
}
.curr-resources__list em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.75rem;
}
.content-meta {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: #f7f9fa;
  border-radius: 8px;
}
.content-meta h3 { margin-top: 0; }
.content-meta dl {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
}
.content-meta dt { color: var(--muted); font-weight: 600; }
.content-meta dd { margin: 0; word-break: break-all; }
.content-meta code { font-size: 0.82rem; }
.curr-section ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.curr-section a {
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0.35rem;
  border-radius: 8px;
}
.curr-section a em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.curr-section li.is-current a { background: var(--brand-soft); }
.curr-section li.is-done a { color: var(--ok); }
.curr-section li.is-locked a { opacity: 0.45; pointer-events: none; }

/* Player */
.player-shell { min-height: 100vh; background: var(--bg); }
.player-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.player-layout {
  display: grid;
  grid-template-columns: 1fr;
}
.player-main { padding: 1.25rem; }
.player-main h1 { font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 0.25rem 0 0.75rem; }
.player-stage {
  aspect-ratio: 16 / 9;
  max-height: 380px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #2a1b3a, #5a3a7a 55%, #7d55a5);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
  animation: fade 500ms ease both;
}
.player-stage__play {
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  backdrop-filter: blur(4px);
}
.article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.code-block {
  background: #1c1526;
  color: #e9dff5;
  padding: 1rem;
  border-radius: 12px;
  overflow: auto;
  font-size: 0.88rem;
}
.resources, .notes { margin-top: 1.25rem; }
.player-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.player-curr {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 1rem 1.15rem 2rem;
}
.player-curr h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.player-curr__mod { margin-bottom: 0.85rem; }
.player-curr__mod h3 { font-size: 0.86rem; color: var(--muted); margin-bottom: 0.35rem; }
.player-curr ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.2rem; }
.player-curr a {
  display: block;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.player-curr li.is-current a { background: var(--brand-soft); font-weight: 700; }
.player-curr li.is-done a { color: var(--ok); }
.player-curr li.is-locked a { opacity: 0.4; pointer-events: none; }
.quiz-q { display: flex; gap: 0.5rem; margin: 0.5rem 0; }

.ai-note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--brand);
  background: var(--surface-2);
}
.feedback {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--ok-soft);
  border-radius: 10px;
}
.profile-head { display: flex; gap: 1rem; align-items: center; }
.avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}
.avatar--lg { width: 4rem; height: 4rem; font-size: 1.2rem; }
.profile-dl {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.55rem 1rem;
  margin: 0 0 1rem;
}
.profile-dl dt { color: var(--muted); }
.profile-dl dd { margin: 0; font-weight: 600; }

.cert-card { text-align: center; padding: 2rem 1.5rem; }
.cert-preview {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  background:
    linear-gradient(180deg, rgba(125,85,165,0.08), transparent),
    #fff;
}
.cert-preview__brand {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--brand-deep);
}
.cert-preview__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0.5rem 0;
}

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.pay-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 0.75rem 0;
  background: var(--surface-2);
}
.pay-card header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.flow-steps { color: var(--muted); }
.flow-ol { margin: 0.75rem 0; padding-left: 1.2rem; }
.verify-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--ok-soft);
  animation: rise 320ms ease both;
}
.admin-mod { margin: 1rem 0; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.admin-mod ul { padding-left: 1rem; }

#toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: grid;
  gap: 0.5rem;
}
.toast {
  background: #1c1526;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-width: 22rem;
  animation: rise 220ms ease both;
}
.toast--success { background: #145c3a; }
.toast--error { background: #8f2f28; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (min-width: 900px) {
  .app-shell { grid-template-columns: var(--sidebar) 1fr; }
  .shell-sidebar { display: flex; position: sticky; top: 0; height: 100vh; }
  .nav-toggle { display: none; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .panel--row { grid-template-columns: 140px 1fr; align-items: center; }
  .player-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .player-curr {
    border-top: 0;
    border-left: 1px solid var(--line);
    min-height: calc(100vh - 3.5rem);
    position: sticky;
    top: 3.5rem;
    max-height: calc(100vh - 3.5rem);
    overflow: auto;
  }
  .page { padding-left: 1.75rem; padding-right: 1.75rem; }
}

/* ——— Udemy-style course player ——— */
.ud-player {
  min-height: 100vh;
  background: #f7f9fa;
  color: #1c1d1f;
}
.ud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: #1c1d1f;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 30;
}
.ud-top__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.ud-top__home {
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
}
.ud-top__divider {
  width: 1px;
  height: 1.1rem;
  background: rgba(255,255,255,0.25);
}
.ud-top__course {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 36rem);
}
.ud-top__right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.ud-top__btn,
.ud-progress-menu > summary {
  border: 1px solid rgba(255,255,255,0.28);
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  list-style: none;
}
.ud-progress-menu { position: relative; }
.ud-progress-menu > summary::-webkit-details-marker { display: none; }
.ud-progress-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: 16rem;
  background: #fff;
  color: #1c1d1f;
  border: 1px solid #d1d7dc;
  border-radius: 4px;
  padding: 0.85rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  display: grid;
  gap: 0.5rem;
  z-index: 40;
}
.ud-progress-menu__panel a { color: var(--brand-deep); font-weight: 700; }

.ud-body {
  display: grid;
  grid-template-columns: 1fr;
}
.ud-player[data-sidebar-open="true"] .ud-body {
  grid-template-columns: 1fr;
}
.ud-main { min-width: 0; background: #fff; }
.ud-stage { background: #000; }
.ud-stage__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: min(62vh, 520px);
  margin: 0 auto;
  background:
    radial-gradient(circle at 30% 30%, rgba(125,85,165,0.35), transparent 45%),
    linear-gradient(160deg, #1a1224, #0d0d0d 60%);
  display: grid;
  place-items: center;
}
.ud-stage__frame.is-live {
  display: block;
  background: #000;
}
.ud-stage__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.ud-stage__play {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.92);
  color: #1c1d1f;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
}
.ud-stage__chrome {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.5rem 0.75rem 0.65rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
}
.ud-stage__bar {
  height: 3px;
  background: rgba(255,255,255,0.25);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}
.ud-stage__bar span {
  display: block;
  height: 100%;
  background: var(--brand);
}
.ud-stage__controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.ud-stage__spacer { flex: 1; }
.ud-stage__skip {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  z-index: 2;
}
.ud-stage__skip--prev { left: 0.75rem; }
.ud-stage__skip--next { right: 0.75rem; }
.ud-stage__doc {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  color: #f5f5f5;
  min-height: 280px;
}
.ud-stage__doc .eyebrow { color: #cbb7e2; }
.ud-stage__doc h2 { color: #fff; }

.ud-below { padding: 0 1.15rem 2.5rem; }
.ud-lesson-head { padding: 1.1rem 0 0.5rem; }
.ud-lesson-head h1 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.ud-lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  margin: 0.85rem 0 0.25rem;
}

.ud-tabs {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  border-bottom: 1px solid #d1d7dc;
  margin-top: 0.5rem;
}
.ud-tab {
  border: 0;
  background: transparent;
  padding: 0.85rem 0.9rem;
  font: inherit;
  font-weight: 700;
  color: #6a6f73;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ud-tab.is-active {
  color: #1c1d1f;
  border-bottom-color: #1c1d1f;
}
.ud-tab-panels { padding: 1.1rem 0 0; }
.ud-tab-panel { animation: fade 200ms ease; }
.ud-qa-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.75rem; }
.ud-qa-list li {
  padding: 0.75rem;
  border: 1px solid #d1d7dc;
  border-radius: 4px;
  background: #f7f9fa;
}

.ud-sidebar {
  display: none;
  background: #fff;
  border-left: 1px solid #d1d7dc;
  flex-direction: column;
  max-height: none;
}
.ud-player[data-sidebar-open="true"] .ud-sidebar { display: flex; }
.ud-sidebar__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #d1d7dc;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.ud-sidebar__head h2 { font-size: 1rem; margin: 0; }
.ud-sidebar__close {
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #1c1d1f;
}
.ud-sidebar__scroll { overflow: auto; }
.ud-sec { border-bottom: 1px solid #d1d7dc; }
.ud-sec > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.2rem;
  background: #fff;
}
.ud-sec > summary::-webkit-details-marker { display: none; }
.ud-sec[open] > summary { background: #f7f9fa; }
.ud-sec__title { font-weight: 700; font-size: 0.92rem; }
.ud-sec__meta { font-size: 0.78rem; color: #6a6f73; }
.ud-sec__list { list-style: none; margin: 0; padding: 0 0 0.35rem; }
.ud-sec__list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.25rem;
}
.ud-sec__list a {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}
.ud-sec__list li.is-current { background: #d1d7dc; }
.ud-sec__list li.is-done .ud-check { color: var(--ok); font-weight: 800; }
.ud-sec__list li.is-locked { opacity: 0.45; pointer-events: none; }
.ud-check {
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid #6a6f73;
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  margin-top: 0.15rem;
}
.ud-sec__list li.is-done .ud-check {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.ud-sec__name { display: block; font-weight: 600; }
.ud-sec__sub { display: block; color: #6a6f73; font-size: 0.78rem; margin-top: 0.15rem; }
.ud-res-btn {
  margin: 0 0.75rem 0.55rem 2.5rem;
  border: 1px solid #d1d7dc;
  background: #fff;
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

@media (min-width: 960px) {
  .ud-player[data-sidebar-open="true"] .ud-body {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .ud-sidebar {
    position: sticky;
    top: 3rem;
    height: calc(100vh - 3rem);
    max-height: calc(100vh - 3rem);
  }
  .ud-sidebar__scroll { overflow: auto; flex: 1; }
}
