/* ==========================================================================
   Pages — the content panel and what lives inside it.
   The frame (.app, .sidebar, .inset) and reusable pieces are in components.css.
   Layout here responds to the width of the content panel (container queries),
   so it adapts when the sidebar is collapsed, not only when the window resizes.
   ========================================================================== */

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1;
}

.brand-mark {
  width: 1.875rem;
  height: 1.875rem;
  color: var(--primary);
}

.brand-mark path {
  stroke: var(--primary-foreground);
}

/* ---------- Sidebar: the course block shown inside a course ---------- */

.sidebar-course {
  display: grid;
  gap: 0.75rem;
  padding: 0.375rem;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-lg);
  background: var(--background);
  box-shadow: var(--shadow-xs);
}

.dark .sidebar-course {
  background: var(--sidebar-accent);
}

.sidebar-course-link {
  display: grid;
  gap: 0.625rem;
  border-radius: var(--radius-md);
}

.sidebar-course .cover {
  border-radius: calc(var(--radius-lg) - 0.375rem);
}

.sidebar-course-title {
  padding-inline: 0.375rem;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: var(--leading-snug);
}

.sidebar-course-link:hover .sidebar-course-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.sidebar-course-progress {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 0.375rem 0.375rem;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.sidebar-course-progress .progress {
  flex: 1;
  height: 0.375rem;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--topbar-h);
  padding-inline: 0.875rem;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: color-mix(in oklch, var(--background) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-separator {
  flex-shrink: 0;
  width: 1px;
  height: 1.125rem;
  margin-inline: 0.25rem;
  background: var(--border);
}

.topbar-crumbs {
  min-width: 0;
}

.topbar .breadcrumb {
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
}

.topbar .breadcrumb li:last-child {
  min-width: 0;
}

.topbar .breadcrumb [aria-current] {
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-inline-start: auto;
}

.theme-moon,
.dark .theme-sun {
  display: none;
}

.dark .theme-moon {
  display: block;
}

/* A line that grows as the lesson is read */
.reading-progress {
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
}

.reading-progress-bar {
  width: var(--value, 0%);
  height: 100%;
  background: var(--foreground);
}

@media (max-width: 63.99rem) {
  .topbar {
    border-radius: 0;
  }
}

@media (max-width: 40rem) {
  /* Keep only the current location in the breadcrumb, and one account action */
  .topbar .breadcrumb li:not(:last-child),
  .topbar .breadcrumb li:last-child > svg,
  .topbar-login {
    display: none;
  }
}

/* ---------- Page ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem) clamp(3rem, 6vw, 5rem);
  container-type: inline-size;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem clamp(1rem, 3vw, 2rem);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.page-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.page-footer a:hover {
  color: var(--foreground);
}

.page-title {
  font-size: clamp(var(--text-3xl), 1.35rem + 2.2cqi, var(--text-4xl));
  line-height: var(--leading-heading);
}

.page-lead {
  max-width: 38rem;
  margin-top: 0.5rem;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--muted-foreground);
}

.section {
  margin-top: clamp(2.75rem, 6cqi, 4rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: var(--text-2xl);
}

.section-lead {
  margin-top: 0.125rem;
  color: var(--muted-foreground);
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}

.meta svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- Home: welcome panel ---------- */

.hero {
  display: grid;
  gap: 2rem;
  padding: clamp(1.5rem, 5cqi, 3rem);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-2xl);
  background: var(--hero);
  color: var(--hero-foreground);
  overflow: hidden;
}

.hero-title {
  font-size: clamp(var(--text-3xl), 1.2rem + 3.6cqi, var(--text-5xl));
  line-height: var(--leading-heading);
}

.hero-lead {
  max-width: 30rem;
  margin-top: 0.875rem;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--hero-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero-actions .btn {
  flex: 1 1 auto;
}

@container (min-width: 38rem) {
  .hero-actions .btn {
    flex: 0 0 auto;
  }
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 2rem;
  font-size: var(--text-sm);
  color: var(--hero-muted);
}

.hero-proof .avatar-stack {
  --ring-color: var(--hero);
}

.hero-proof strong {
  font-weight: 700;
  color: var(--hero-foreground);
}

/* Three course covers, fanned */
.hero-art {
  position: relative;
  display: none;
  min-height: 17rem;
}

.hero-art img {
  position: absolute;
  width: 68%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -20px oklch(0 0 0 / 0.8), 0 0 0 1px oklch(1 0 0 / 0.1);
}

.hero-art img:nth-child(1) {
  top: 2%;
  left: 0;
  rotate: -7deg;
}

.hero-art img:nth-child(2) {
  right: 0;
  bottom: 0;
  rotate: 6deg;
}

.hero-art img:nth-child(3) {
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

@container (min-width: 38rem) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
  }

  .hero-art {
    display: block;
  }
}

/* ---------- Home: resume card ---------- */

.resume {
  display: grid;
  gap: 1.25rem;
  padding: 0.375rem;
}

.resume-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 0.875rem 1rem;
}

.resume-title {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

.resume-title a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.resume-next {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
}

.resume-next strong {
  font-weight: 500;
  color: var(--foreground);
}

.resume-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 22rem;
  margin-top: 1rem;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.resume-progress .progress {
  flex: 1;
}

.resume-body .btn {
  margin-top: 1.25rem;
}

@container (min-width: 40rem) {
  .resume {
    grid-template-columns: 17rem minmax(0, 1fr);
    align-items: center;
    gap: 1.5rem;
  }

  .resume-body {
    padding: 0.75rem 0.5rem;
  }
}

/* ---------- Home: categories ---------- */

.cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem;
}

.cat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cat:hover {
  border-color: color-mix(in oklch, var(--hue-solid) 45%, transparent);
  box-shadow: var(--shadow-sm);
}

.cat-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--hue-bg);
  color: var(--hue-fg);
}

.cat-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.cat-name {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-snug);
}

.cat-count {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ---------- Course grid ---------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr));
  gap: 1.25rem;
}

/* ---------- Home: paths ---------- */

.paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
}

.path {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
}

/* The path's courses as a row of small overlapping covers */
.path-covers {
  display: flex;
  margin-bottom: 1rem;
}

.path-covers img {
  width: 3.5rem;
  height: 2.1875rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 2px var(--card);
  object-fit: cover;
}

.path-covers img + img {
  margin-inline-start: -0.75rem;
}

.path-title {
  font-size: var(--text-base);
}

.path-summary {
  margin-top: 0.25rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.path-steps {
  margin-block: 1rem 1.25rem;
  counter-reset: step;
}

.path-step {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: 0.625rem;
  align-items: center;
  padding-block: 0.5rem;
  font-size: var(--text-sm);
  counter-increment: step;
}

.path-step + .path-step {
  border-top: 1px solid var(--border);
}

.path-step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--muted);
  font-size: var(--text-2xs);
  font-weight: 700;
  line-height: 1;
}

.path-step a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.path-step-time {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.path-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

/* ---------- Home: how learning works ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--border);
  overflow: hidden;
}

.feature {
  padding: 1.25rem;
  background: var(--card);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--hue-bg);
  color: var(--hue-fg);
}

.feature-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.feature h3 {
  margin-top: 0.875rem;
  font-size: var(--text-base);
}

.feature p {
  margin-top: 0.25rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

/* ---------- Reviews (home and course page) ---------- */

.reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.25rem;
}

.review {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.25rem;
}

.review blockquote {
  flex: 1;
  line-height: var(--leading-normal);
}

.review figcaption {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

.review-name {
  display: block;
  font-weight: 500;
}

.review-role {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

/* ---------- Home: closing panel ---------- */

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: clamp(1.5rem, 4cqi, 2.5rem);
  border-radius: var(--radius-2xl);
  background: var(--muted);
}

.cta-title {
  font-size: clamp(var(--text-xl), 1rem + 1.6cqi, var(--text-2xl));
}

.cta-lead {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Catalog ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.toolbar-search {
  flex: 1 1 14rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.125rem;
  margin-block: 1.75rem 1rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 4rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-lg);
  background: var(--muted);
}

.empty-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.empty-title {
  font-size: var(--text-lg);
}

.empty p {
  max-width: 24rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.empty .btn {
  margin-top: 0.75rem;
}

/* ---------- Course page ---------- */

.course-layout {
  display: grid;
  gap: 2rem;
}

.course-body {
  min-width: 0;
}

@container (min-width: 52rem) {
  .course-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
    grid-template-rows: auto 1fr;
    gap: 0 2.5rem;
  }

  .course-head,
  .course-body {
    grid-column: 1;
  }

  .enroll {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.course-head .page-title {
  margin-top: 0.875rem;
}

.course-by {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

.course-by-name {
  display: block;
  font-weight: 500;
}

.course-by-role {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.course-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.course-facts .rating {
  color: var(--foreground);
}

/* Enrol card: the cover, the price and the one action */
.enroll-card {
  padding: 0.375rem;
  box-shadow: var(--shadow-md);
}

@container (min-width: 52rem) {
  .enroll-card {
    position: sticky;
    top: calc(var(--topbar-h) + 1.5rem);
  }
}

.enroll-body {
  padding: 1rem 0.875rem 0.875rem;
}

/* Between the two-column layout and phones the card lies flat: cover beside the price,
   like the resume card, instead of a cover as wide as the page */
@container (min-width: 34rem) and (max-width: 51.99rem) {
  .enroll-card {
    display: grid;
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
  }
}

.enroll-price {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: var(--leading-heading);
}

.enroll-note {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.enroll-actions {
  display: grid;
  gap: 0.5rem;
  margin-block: 1rem;
}

.enroll-guarantee {
  margin-top: 1rem;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  text-align: center;
}

.block {
  margin-top: 3rem;
}

.block-title {
  margin-bottom: 1rem;
  font-size: var(--text-2xl);
}

.block-note {
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.checks {
  display: grid;
  gap: 0.625rem 2rem;
}

.checks li {
  display: grid;
  grid-template-columns: 1.125rem minmax(0, 1fr);
  gap: 0.625rem;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.checks svg {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.3rem;
  color: var(--success);
}

.enroll-card .checks {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.enroll-card .checks li {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.outcomes {
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  background: var(--muted);
}

@container (min-width: 40rem) {
  .outcomes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Curriculum: numbered units, each a list of lesson links */
.unit {
  overflow: hidden;
}

.unit + .unit {
  margin-top: 1rem;
}

.unit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: color-mix(in oklch, var(--muted) 60%, transparent);
}

.unit-title {
  font-size: var(--text-base);
}

.unit-meta {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.unit-lesson {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-base);
  transition: background-color 0.15s;
}

.unit-lesson:hover {
  background: color-mix(in oklch, var(--accent) 65%, transparent);
}

.unit-lesson:focus-visible {
  outline-offset: -2px;
}

.unit-lesson > svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
}

.unit-lesson[data-done="true"] > svg:first-child {
  color: var(--success);
}

.unit-lesson-title {
  flex: 1;
  min-width: 0;
}

.unit-lesson-time {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  white-space: nowrap;
}

.unit-lesson > .unit-lesson-lock {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.7;
}

.requirements {
  display: grid;
  gap: 0.375rem;
  padding-inline-start: 1.25rem;
  list-style: disc;
}

.requirements li::marker {
  color: var(--muted-foreground);
}

.instructor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
}

.instructor-name {
  font-size: var(--text-base);
  line-height: var(--leading-snug);
}

.instructor-role {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.instructor-bio {
  margin-top: 0.625rem;
  color: var(--muted-foreground);
}

.reviews-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.reviews-score {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1;
  color: var(--foreground);
}

/* ---------- Lesson page ---------- */

/* A reading column and, when there is room, an "on this page" rail */
.doc {
  display: grid;
  gap: 3rem;
}

.doc-main {
  min-width: 0;
  max-width: var(--measure);
}

.doc-rail {
  display: none;
}

@container (min-width: 52rem) {
  .doc {
    grid-template-columns: minmax(0, 1fr) 12rem;
    justify-content: space-between;
  }

  .doc-rail {
    display: block;
  }
}

.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 2rem);
}

.toc-title {
  margin-bottom: 0.625rem;
  font-size: var(--text-sm);
  font-weight: 700;
}

.toc a {
  display: block;
  padding-block: 0.3125rem;
  padding-inline-start: 0.875rem;
  border-inline-start: 2px solid var(--border);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--muted-foreground);
  transition: color 0.15s, border-color 0.15s;
}

.toc a:hover {
  color: var(--foreground);
}

.toc a[aria-current] {
  border-color: var(--foreground);
  font-weight: 500;
  color: var(--foreground);
}

.lesson-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.lesson-head .page-title {
  margin-top: 0.75rem;
}

.lesson-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 0.75rem;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.25rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

/* Optional video above the text; the course cover is its poster */
.video {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin-top: 1.75rem;
  border-radius: var(--radius-xl);
  background: var(--hero);
  overflow: hidden;
}

.video > img,
.video > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video > video {
  background: #000;
}

.video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, oklch(0 0 0 / 0.55), oklch(0 0 0 / 0.1) 55%);
  pointer-events: none;
}

.video:has(> video)::after {
  display: none;
}

.video-play {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  background: #fff;
  color: oklch(0.145 0 0);
  box-shadow: 0 10px 30px -8px oklch(0 0 0 / 0.6);
  transition: scale 0.2s var(--ease);
}

.video-play:hover {
  scale: 1.07;
}

.video-play:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  border-radius: 50%;
}

.video-play svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: currentColor;
  translate: 2px 0;
}

.video-time {
  position: absolute;
  inset-inline-end: 1rem;
  bottom: 0.875rem;
  z-index: 1;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: oklch(0 0 0 / 0.55);
  color: #fff;
  font-size: var(--text-xs);
}

.video-note {
  margin-top: 0.625rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

/* Long-form text: the part of the template that has to read well */
.prose {
  margin-top: 2rem;
  font-size: var(--text-lg);
  line-height: var(--leading-prose);
}

.prose > * + * {
  margin-top: 1.25em;
}

.prose > h2 {
  margin-top: 2.5em;
  font-size: var(--text-2xl);
  line-height: var(--leading-heading);
}

.prose > h3 {
  margin-top: 2em;
  font-size: var(--text-xl);
}

.prose > h2 + *,
.prose > h3 + * {
  margin-top: 0.75em;
}

.prose-lead {
  font-size: var(--text-xl);
  color: var(--muted-foreground);
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--muted-foreground);
  text-underline-offset: 5px;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose strong {
  font-weight: 700;
}

.prose > ul,
.prose > ol {
  padding-inline-start: 1.5rem;
}

.prose > ul {
  list-style: disc;
}

.prose > ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.375em;
}

.prose li::marker {
  color: var(--muted-foreground);
}

.prose :not(pre) > code {
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
  background: var(--muted);
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.875em;
  font-variant-ligatures: none;
}

.prose .table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.prose th,
.prose td {
  padding: 0.625rem 1rem;
  text-align: start;
}

.prose th {
  background: color-mix(in oklch, var(--muted) 60%, transparent);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted-foreground);
}

.prose td {
  border-top: 1px solid var(--border);
}

.prose .codeblock,
.prose .alert,
.prose .table-wrap,
.prose .quiz {
  margin-block: 1.5em;
}

/* ---------- Code ---------- */

.codeblock {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
}

/* The head follows the code's direction: file name above the first column */
.codeblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 2.625rem;
  padding-inline: 1rem 0.25rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 60%, transparent);
  direction: ltr;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.codeblock-name {
  font-family: var(--font-mono);
}

.codeblock > pre {
  margin: 0;
  padding: 0.875rem 1rem;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  text-align: left;
  overflow-x: auto;
  counter-reset: line;
}

.code-line {
  display: block;
  min-height: 1.75em;
  counter-increment: line;
  white-space: pre;
}

.code-line::before {
  content: counter(line);
  display: inline-block;
  width: 1.25rem;
  margin-right: 1rem;
  color: var(--muted-foreground);
  opacity: 0.55;
  text-align: right;
  user-select: none;
}

.tok-k {
  color: var(--code-keyword);
}

.tok-f {
  color: var(--code-function);
}

.tok-s {
  color: var(--code-string);
}

.tok-n {
  color: var(--code-number);
}

.tok-c {
  color: var(--muted-foreground);
}

.code-output {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: color-mix(in oklch, var(--muted) 60%, transparent);
  font-size: var(--text-sm);
}

.code-output-label {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.code-output pre {
  font-family: var(--font-mono);
  line-height: var(--leading-normal);
  white-space: pre-wrap;
}

/* ---------- Quiz ---------- */

.quiz {
  padding: 1.25rem;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.quiz-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.quiz-question {
  font-size: var(--text-lg);
  font-weight: 700;
}

.quiz .codeblock {
  margin-block: 1rem;
}

.quiz-options {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.quiz-option:hover {
  background: color-mix(in oklch, var(--accent) 65%, transparent);
}

.quiz-option:has(:checked) {
  border-color: var(--foreground);
  background: color-mix(in oklch, var(--accent) 65%, transparent);
}

.quiz-option:has(:focus-visible) {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

.quiz-option[data-state="correct"] {
  border-color: var(--success);
  background: color-mix(in oklch, var(--success) 10%, transparent);
}

.quiz-option[data-state="wrong"] {
  border-color: var(--destructive);
  background: color-mix(in oklch, var(--destructive) 8%, transparent);
}

.quiz-option input {
  appearance: none;
  display: grid;
  place-content: center;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  border: 1.5px solid var(--muted-foreground);
  border-radius: 50%;
  outline: none;
}

.quiz-option input::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--foreground);
  scale: 0;
  transition: scale 0.12s var(--ease);
}

.quiz-option input:checked {
  border-color: var(--foreground);
}

.quiz-option input:checked::before {
  scale: 1;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.quiz-feedback {
  font-size: var(--text-sm);
}

.quiz-feedback[data-state="correct"] {
  color: var(--success);
}

.quiz-feedback[data-state="wrong"] {
  color: var(--destructive);
}

/* ---------- End of lesson ---------- */

.lesson-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  background: var(--muted);
}

.lesson-end-title {
  font-weight: 700;
}

.lesson-end-text {
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pager-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pager-link:hover {
  border-color: color-mix(in oklch, var(--foreground) 20%, transparent);
  box-shadow: var(--shadow-sm);
}

.pager-link:focus-visible {
  border-radius: var(--radius-xl);
}

.pager-link svg {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--muted-foreground);
}

.pager-text {
  flex: 1;
  min-width: 0;
}

.pager-next {
  grid-column: 2;
  text-align: end;
}

.pager-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.pager-title {
  display: block;
  font-weight: 500;
  line-height: var(--leading-snug);
}

/* ---------- Not found ---------- */

.not-found {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  padding-block: clamp(2rem, 8vw, 5rem);
}

.not-found p {
  max-width: 28rem;
  color: var(--muted-foreground);
}

.not-found .btn {
  margin-top: 0.75rem;
}

/* ==========================================================================
   Store, checkout, blog, and the lesson's extra panels.
   ========================================================================== */

.by-end {
  margin-inline-start: auto;
  color: var(--muted-foreground);
}

/* ---------- Product page (shares .course-layout with the course page) ---------- */

.details {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.details div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  font-size: var(--text-base);
}

.details div + div {
  border-top: 1px solid var(--border);
}

.details dt {
  color: var(--muted-foreground);
}

.details dd {
  font-weight: 500;
}

.body-text {
  display: grid;
  gap: 1em;
  max-width: var(--measure);
  font-size: var(--text-lg);
  line-height: var(--leading-prose);
}

/* ---------- Checkout ---------- */

.checkout {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

@container (min-width: 52rem) {
  .checkout {
    grid-template-columns: minmax(0, 1fr) 21rem;
    gap: 2.5rem;
    align-items: start;
  }

  .checkout-summary {
    position: sticky;
    top: calc(var(--topbar-h) + 1.5rem);
  }
}

.form-sections {
  display: grid;
  gap: 1.5rem;
}

.form-section {
  padding: 1.25rem;
}

.form-section-title {
  margin-bottom: 1rem;
  font-size: var(--text-lg);
}

.form-grid {
  display: grid;
  gap: 1rem;
}

@container (min-width: 34rem) {
  .form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid .span-2 {
    grid-column: 1 / -1;
  }
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.pay-panel {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.checkout-summary {
  padding: 1.25rem;
}

.checkout-summary .line-items {
  margin-block: 1rem 1.25rem;
}

.coupon {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.coupon .input {
  flex: 1;
}

.checkout-summary .btn-lg {
  margin-top: 1.25rem;
}

.secure-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.875rem;
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--muted-foreground);
}

.secure-note svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  color: var(--success);
}

/* After paying */
.receipt {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  max-width: 34rem;
  margin: clamp(1rem, 5cqi, 3rem) auto 0;
  padding: clamp(1.5rem, 5cqi, 2.5rem);
  text-align: center;
}

.receipt-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.5rem;
  border-radius: 50%;
  background: color-mix(in oklch, var(--success) 14%, transparent);
  color: var(--success);
}

.receipt-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.receipt p {
  color: var(--muted-foreground);
}

.receipt .line-items {
  width: 100%;
  margin-block: 1.25rem;
  padding-block: 1.25rem;
  border-block: 1px solid var(--border);
  text-align: start;
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* ---------- Blog ---------- */

.post-featured {
  display: grid;
  padding: 0.375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-featured:hover {
  border-color: color-mix(in oklch, var(--foreground) 20%, transparent);
  box-shadow: var(--shadow-md);
}

.post-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.25rem 0.875rem;
}

.post-featured-title {
  margin-top: 0.625rem;
  font-size: clamp(var(--text-2xl), 1rem + 2cqi, var(--text-3xl));
  line-height: var(--leading-heading);
}

.post-featured-excerpt {
  margin-top: 0.5rem;
  color: var(--muted-foreground);
}

.post-featured .course-card-by {
  margin-top: 1.25rem;
  padding-top: 0;
}

@container (min-width: 44rem) {
  .post-featured {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1rem;
  }

  .post-featured-body {
    padding: 1.5rem;
  }
}

.article-head .course-by {
  margin-top: 1.5rem;
}

.article-cover {
  margin-top: 1.75rem;
  border-radius: var(--radius-xl);
}

.author-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.25rem;
}

/* ---------- Lesson panels: notes, discussion, files, ask ---------- */

.panel-intro {
  margin-bottom: 1rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.composer {
  display: grid;
  gap: 0.75rem;
}

.composer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.composer-status {
  font-size: var(--text-sm);
  color: var(--success);
}

.stack {
  display: grid;
  gap: 0.875rem;
  margin-top: 1.5rem;
}

.note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 0.75rem;
  padding: 1rem 1.125rem;
}

.note-text {
  line-height: var(--leading-normal);
  white-space: pre-wrap;
}

.note-time {
  grid-column: 1;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.thread {
  padding: 1.125rem;
}

.comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.625rem;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

.comment-name {
  font-weight: 500;
}

.comment-time {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.comment-text {
  margin-top: 0.25rem;
  line-height: var(--leading-normal);
}

.replies {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  margin-inline-start: 1.25rem;
  padding-inline-start: 1.25rem;
  border-inline-start: 2px solid var(--border);
}

.files {
  overflow: hidden;
}

.file {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
}

.file + .file {
  border-top: 1px solid var(--border);
}

.file-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--muted);
}

.file-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.file-text {
  flex: 1;
  min-width: 0;
  line-height: var(--leading-snug);
}

.file-name {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
}

.file-meta {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.ask-instructor {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--muted);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

.ask-instructor strong {
  display: block;
  font-weight: 500;
}

.ask-instructor span span {
  color: var(--muted-foreground);
}

@media (max-width: 40rem) {
  .topbar-signup {
    display: none;
  }
}

.toolbar .chips {
  margin-top: 0;
}

/* ---------- Lesson workspace: content, then a tools column ----------
   From 80rem the tools are a third column that can be closed.
   Below that they slide over the page when opened. */

.workspace {
  display: flex;
  flex: 1;
  align-items: flex-start;
  min-width: 0;
}

.workspace > .page {
  min-width: 0;
}

/* The reading column sits in the middle of whatever room is left */
.lesson .doc-main {
  margin-inline: auto;
}

.tools {
  display: flex;
  flex-direction: column;
  background: var(--background);
}

.tools-head {
  display: none;
}

.tools-title {
  font-size: var(--text-lg);
}

/* Equal columns for however many tabs are visible */
.tools-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  flex-shrink: 0;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tools-tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.125rem;
  border-radius: var(--radius-md);
  font-size: var(--text-2xs);
  font-weight: 500;
  line-height: var(--leading-heading);
  color: var(--muted-foreground);
  transition: background-color 0.15s, color 0.15s;
}

.tools-tab:hover {
  color: var(--foreground);
}

.tools-tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--foreground);
}

.tools-tab:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
  border-radius: var(--radius-md);
}

.tools-tab svg {
  width: 1.125rem;
  height: 1.125rem;
}

.tools-tab .tabs-count {
  position: absolute;
  top: 0.125rem;
  inset-inline-end: calc(50% - 1.375rem);
  min-width: 1rem;
  padding-inline: 0.25rem;
  background: var(--primary);
  font-size: var(--text-2xs);
  line-height: 1rem;
  color: var(--primary-foreground);
}

.tools-body {
  flex: 1;
  min-height: 0;
  padding: 1.25rem 1rem 2rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* The same pieces as elsewhere, tightened for a narrow column */
.tools .toc {
  position: static;
}

.tools .textarea {
  min-height: 5.5rem;
}

.tools .stack {
  margin-top: 1.25rem;
}

.tools .note,
.tools .thread {
  padding: 0.875rem;
}

.tools .comment-text,
.tools .note-text {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.tools .replies {
  margin-inline-start: 0.5rem;
  padding-inline-start: 0.75rem;
}

.tools .file {
  gap: 0.75rem;
  padding: 0.75rem;
}

.tools .empty {
  padding: 2.5rem 1rem;
}

.tools-backdrop {
  display: none;
}

@media (min-width: 80rem) {
  .tools {
    position: sticky;
    top: var(--topbar-h);
    flex: 0 0 var(--tools-w);
    width: var(--tools-w);
    height: calc(100dvh - var(--topbar-h) - var(--inset-gap));
    border-inline-start: 1px solid var(--border);
  }

  [data-tools="closed"] .tools {
    display: none;
  }
}

@media (max-width: 79.99rem) {
  .tools {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 50;
    width: min(24rem, 92vw);
    border-inline-start: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    translate: var(--sheet-offset) 0;
    visibility: hidden;
    transition: translate 0.3s var(--ease), visibility 0s 0.3s;
  }

  [data-tools-open] .tools {
    translate: 0 0;
    visibility: visible;
    transition: translate 0.3s var(--ease), visibility 0s;
  }

  .tools-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    height: var(--topbar-h);
    padding-inline: 1.25rem 0.875rem;
    border-bottom: 1px solid var(--border);
  }

  .tools-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: oklch(0 0 0 / 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  [data-tools-open] .tools-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ==========================================================================
   Accounts: sign-in pages, the content gate, and the student area.
   ========================================================================== */

/* Pages that need an account stay blank until auth.js has checked the session */
body[data-auth="required"]:not([data-authed]) .inset {
  visibility: hidden;
}

/* ---------- Sign-in, sign-up, reset ---------- */

.auth-layout {
  display: grid;
  min-height: 100dvh;
}

@media (min-width: 60rem) {
  .auth-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.auth-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.5rem clamp(1.25rem, 5vw, 3rem);
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.auth-body {
  flex: 1;
  display: grid;
  align-content: center;
  width: 100%;
  max-width: 24rem;
  margin-inline: auto;
  padding-block: 2.5rem;
}

.auth-title {
  font-size: var(--text-3xl);
  line-height: var(--leading-heading);
}

.auth-lead {
  margin-top: 0.375rem;
  color: var(--muted-foreground);
}

.auth-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.75rem;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--text-sm);
}

.auth-link {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 5px;
}

.auth-link:hover {
  text-decoration-color: currentColor;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-block: 1.25rem;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  margin-top: 1.5rem;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
  text-align: center;
}

.auth-foot {
  font-size: var(--text-xs);
  color: var(--muted-foreground);
  text-align: center;
}

/* The dark side panel: the same covers as the home page, and what an account gives */
.auth-aside {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 2.5rem;
  margin: var(--inset-gap);
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid var(--hero-border);
  border-radius: var(--radius-2xl);
  background: var(--hero);
  color: var(--hero-foreground);
  overflow: hidden;
}

@media (min-width: 60rem) {
  .auth-aside {
    display: flex;
  }
}

.auth-aside .hero-art {
  display: block;
  width: min(100%, 26rem);
  min-height: 15rem;
}

.auth-aside-title {
  font-size: var(--text-3xl);
  line-height: var(--leading-heading);
}

.auth-points {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
  color: var(--hero-muted);
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-points svg {
  width: 1.125rem;
  height: 1.125rem;
  color: var(--hero-foreground);
}

/* ---------- Gate: shown in place of content the visitor may not open ---------- */

.gate {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding: clamp(2rem, 6cqi, 3.5rem) 1.5rem;
  text-align: center;
}

.gate-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-lg);
  background: var(--muted);
}

.gate-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.gate-title {
  font-size: var(--text-xl);
}

.gate p {
  max-width: 26rem;
  color: var(--muted-foreground);
}

.gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ---------- Student area ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
}

.stat-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--hue-bg);
  color: var(--hue-fg);
}

.stat-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.stat-value {
  display: block;
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-heading);
}

.stat-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--muted-foreground);
}

.note-source {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  color: var(--muted-foreground);
}

.note-source a {
  font-weight: 500;
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 4px;
}

.orders {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.orders th,
.orders td {
  padding: 0.75rem 1rem;
  text-align: start;
}

.orders th {
  background: color-mix(in oklch, var(--muted) 60%, transparent);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted-foreground);
}

.orders td {
  border-top: 1px solid var(--border);
}

.table-card {
  overflow-x: auto;
}

.settings {
  display: grid;
  gap: 1.5rem;
  max-width: 40rem;
  margin-top: 1.75rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.form-status {
  font-size: var(--text-sm);
  color: var(--success);
}

.checks-list {
  display: grid;
  gap: 0.75rem;
}

/* A button that reads as a link inside a sentence */
.link-button {
  font-weight: 500;
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: var(--muted-foreground);
  text-underline-offset: 4px;
}

.link-button:hover {
  text-decoration-color: currentColor;
}
