:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-card: #121935;
  --text: #f2f5ff;
  --muted: #aeb8d8;
  --accent: #8c9eff;
  --accent-2: #00e0b8;
  --border: #25305a;
  --max-width: 960px;
  --radius: 14px;
  /* Keep identical in capcut-playbook/styles.css (hero column width). */
  --hero-intro-columns: 1fr minmax(240px, 42%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #18224a 0%, var(--bg) 45%);
  color: var(--text);
  line-height: 1.5;
}

.hero {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(130deg, rgba(140, 158, 255, 0.2), rgba(0, 224, 184, 0.08));
}

.hero__content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.hero-nav {
  margin: 0 0 0.65rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.hero-nav__sep {
  color: var(--muted);
  user-select: none;
}

.home-link {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.home-link:hover {
  text-decoration: underline;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  margin-bottom: 0.6rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.hero-intro {
  display: grid;
  grid-template-columns: var(--hero-intro-columns);
  gap: 1.35rem 1.75rem;
  align-items: start;
  margin-bottom: 1.15rem;
}

.hero-intro__text {
  min-width: 0;
}

.hero-intro__text .subtitle {
  max-width: none;
  margin: 0.7rem 0 0;
}

.hero-intro__visual {
  margin: 0;
  min-width: 0;
}

.hero-intro__visual-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1735;
  display: block;
  line-height: 0;
}

.hero-intro__visual-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* Dos columnas: baja la foto del hero para alinearla más con el cuerpo del texto (no pegada al título). */
@media (min-width: 861px) {
  .hero-intro__visual {
    margin-top: clamp(1.5rem, 3.8vw, 2.85rem);
  }
}

.subtitle {
  color: var(--muted);
  margin: 0.7rem 0 1.4rem;
  max-width: 70ch;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  /* flex-start: "Select course" queda en la misma fila visual que "Search topic", no abajo del bloque de ayuda/estado. */
  align-items: flex-start;
}

.controls__course-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.search,
.course-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 220px;
}

/* Idioma a la derecha de la fila de controles (junto a la búsqueda). */
.hub-language-bar--in-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  text-align: right;
  margin-left: auto;
  flex-shrink: 0;
}

.hub-language-bar__caption {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hub-language-bar__flags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hub-flag-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(14, 21, 48, 0.85);
  cursor: pointer;
  line-height: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.hub-flag-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.hub-flag-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.hub-flag-btn--active {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(0, 224, 184, 0.35);
}

.hub-flag {
  display: block;
  width: 36px;
  height: 24px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .controls__course-column {
    width: 100%;
  }

  .hub-language-bar--in-controls {
    margin-left: 0;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
  }

  .hub-language-bar--in-controls .hub-language-bar__caption {
    width: 100%;
    text-align: right;
  }
}

select,
input[type="search"] {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  background: #0e1530;
  color: var(--text);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
  scroll-behavior: smooth;
}

.container--with-sidebar {
  max-width: min(1180px, 100%);
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: stretch;
  column-gap: 1.1rem;
}

.container--with-sidebar.layout-sidebar-collapsed {
  grid-template-columns: 3.35rem minmax(0, 1fr);
}

.course-sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  width: 100%;
  max-width: 280px;
  min-width: 0;
  min-height: calc(100vh - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  display: flex;
  flex-direction: column;
  padding: 0.45rem;
  box-sizing: border-box;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 25, 53, 0.98) 0%, rgba(11, 16, 32, 0.94) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    4px 0 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.course-sidebar .course-shell {
  position: static;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  padding: 0.75rem 0.72rem 0.85rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(37, 48, 90, 0.85);
  background: rgba(15, 23, 53, 0.65);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.course-sidebar .course-drawer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.course-sidebar .course-drawer__panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.layout-sidebar-collapsed .course-sidebar {
  min-height: auto;
  max-height: none;
  align-self: start;
  max-width: 3.35rem;
  padding: 0.35rem 0.25rem;
}

.layout-sidebar-collapsed .course-sidebar .course-shell {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0.45rem 0.35rem 0.55rem;
}

.course-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

@media (max-width: 820px) {
  .container--with-sidebar {
    grid-template-columns: 1fr;
    max-width: var(--max-width);
  }

  .container--with-sidebar.layout-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: relative;
    top: auto;
    max-width: none;
    width: 100%;
    min-height: auto;
    max-height: none;
    align-self: stretch;
  }

  .layout-sidebar-collapsed .course-sidebar {
    max-width: none;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
}

.card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.22rem;
}

.course-shell {
  backdrop-filter: blur(6px);
}

.course-drawer {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.course-drawer__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.course-shell.course-drawer h2.course-drawer__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}

.course-drawer__toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f1735;
  color: var(--text);
  cursor: pointer;
}

.course-drawer__toggle:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.course-drawer__toggle:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.course-drawer__chevron {
  display: block;
  transition: transform 0.22s ease;
  transform: rotate(90deg);
}

.course-drawer--collapsed .course-drawer__chevron {
  transform: rotate(-90deg);
}

.layout-sidebar-collapsed .course-drawer__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout-sidebar-collapsed .course-drawer__bar {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
}

.course-drawer__panel {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.course-drawer__panel[hidden] {
  display: none !important;
}

.course-drawer--collapsed {
  padding-bottom: 0.65rem;
}

.course-drawer--collapsed .course-drawer__bar {
  margin-bottom: 0;
}

.course-drawer__lead {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.course-roadmap {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.course-roadmap--stack {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  grid-template-columns: unset;
}

.course-roadmap--stack .module-card {
  padding: 0.52rem 0.62rem;
}

.course-roadmap__group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.25rem 0.45rem 0.55rem;
  background: rgba(11, 16, 32, 0.42);
}

.course-roadmap__group-title {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0.4rem 0.35rem 0.25rem;
  user-select: none;
}

.course-roadmap__group-title::-webkit-details-marker {
  display: none;
}

.course-roadmap__group[open] .course-roadmap__group-title {
  color: var(--accent-2);
}

.course-roadmap__group--advanced[open] .course-roadmap__group-title {
  color: var(--accent);
}

.course-roadmap__group--addons[open] .course-roadmap__group-title {
  color: #ffd166;
}

.course-roadmap--stack .course-roadmap__group + .course-roadmap__group {
  margin-top: 0.45rem;
}

.course-roadmap__group-inner {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.module-card {
  border: 1px solid var(--border);
  background: #0f1735;
  color: var(--text);
  border-radius: 12px;
  padding: 0.65rem 0.72rem;
  text-align: left;
  cursor: pointer;
}

.module-card small {
  display: block;
  color: var(--muted);
  margin-bottom: 0.18rem;
}

.module-card:hover,
.module-card.active {
  border-color: var(--accent);
  color: var(--accent-2);
}

.module-card.completed {
  border-color: #2bb8a2;
}

.lesson-controls {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.68rem;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.lesson-controls--stack {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.55rem;
  align-items: stretch;
}

.lesson-controls--stack .lesson-nav-btn {
  width: 100%;
}

.lesson-controls--stack .lesson-progress {
  grid-column: 1 / -1;
}

.lesson-nav-btn {
  border: 1px solid var(--border);
  background: #0f1735;
  color: var(--text);
  border-radius: 10px;
  padding: 0.56rem 0.8rem;
  cursor: pointer;
}

.lesson-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lesson-progress p {
  margin: 0 0 0.35rem;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #1b264f;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.lesson-card {
  display: none;
}

.lesson-card.active {
  display: block;
}

/* Búsqueda: mostrar todos los módulos mientras hay texto en el buscador */
.course-main--search-active .lesson-card {
  display: block !important;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: min(220px, 100%);
  flex: 0 1 auto;
  width: min(22rem, 100%);
  max-width: min(22rem, 100%);
}

.search-field .search input[type="search"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.course-search-form {
  margin: 0;
}

.search-help {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: min(42ch, 100%);
  line-height: 1.45;
}

.search-status-line {
  margin: 0;
  min-height: 1.3em;
  font-size: 0.85rem;
  color: var(--accent-2);
  font-weight: 600;
}

.module-card--has-match {
  box-shadow: 0 0 0 2px rgba(0, 224, 184, 0.45);
  border-color: rgba(0, 224, 184, 0.55);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.grid article,
.stack article {
  padding: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.48);
}

.grid article h3,
.stack article h3 {
  margin-top: 0;
}

.card article details {
  margin-top: 0.55rem;
  padding-top: 0.48rem;
  border-top: 1px dashed #2c3a6e;
}

.card article summary {
  color: var(--accent-2);
  font-size: 0.94rem;
}

.card article details ul {
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.52;
  font-size: 0.88rem;
  color: var(--muted);
}

.card article details li {
  margin-bottom: 0.4rem;
}

.card article details li:last-child {
  margin-bottom: 0;
}

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

.timeline article {
  border-left: 2px solid var(--accent);
  padding: 0.35rem 0 0.35rem 0.8rem;
}

/* Module 7 — best practices (rich bullets with examples) */
.best-practices-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.best-practice-item {
  margin: 0;
  padding: 0.88rem 1rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.48);
  min-width: 0;
}

.best-practice-item__title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--text);
  line-height: 1.3;
}

.best-practice-item__body {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.best-practice-item__example {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.52;
  color: #c9d4ec;
  padding: 0.55rem 0.72rem;
  border-radius: 9px;
  background: rgba(0, 224, 184, 0.07);
  border-left: 3px solid #00e0b8;
  overflow-wrap: anywhere;
}

.best-practice-item__example-k {
  font-weight: 700;
  color: var(--accent-2);
  margin-right: 0.28rem;
}

.best-practice-tools {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.best-practice-tools__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-2);
  margin: 0 0 0.35rem;
}

.best-practice-tools__label--output {
  margin-top: 0.65rem;
}

.best-practice-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.45rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.84rem;
  line-height: 1.45;
  font-family: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  min-height: 4.2rem;
}

.best-practice-input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.best-practice-tools__actions {
  margin: 0 0 0.5rem;
}

.best-practice-update-btn,
.best-practice-copy-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: rgba(0, 224, 184, 0.12);
  color: var(--accent-2);
}

.best-practice-update-btn:hover,
.best-practice-copy-btn:hover {
  background: rgba(0, 224, 184, 0.22);
}

.best-practice-copy-btn {
  margin-top: 0.45rem;
  display: inline-block;
}

.best-practice-tools__hint,
.best-practice-tools__assist {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--muted);
}

.best-practice-tools__assist {
  margin-bottom: 0.35rem;
}

.best-practice-tools__links {
  display: inline;
}

.best-practice-output {
  margin: 0;
  padding: 0.6rem 0.72rem;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dfe8ff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 14rem;
  overflow: auto;
}

.video-link {
  color: var(--accent-2);
  text-decoration: none;
}

.video-link:hover {
  text-decoration: underline;
}

.video-link-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

summary {
  cursor: pointer;
  color: var(--accent);
}

.video-frame {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
}

.video-frame iframe {
  width: 100%;
  min-height: 360px;
  border: 0;
}

.visual-with-list {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1.1fr 1fr;
}

.visual-with-list img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1735;
}

/* Quick Start: large visual carousel + synced tip text (Freepik) */
.freepik-quick-start {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.freepik-quick-carousel {
  min-width: 0;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1735;
}

.carousel-viewport--freepik-quick {
  min-height: min(36vh, 280px);
  max-height: min(92vh, 1100px);
}

.carousel-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}

.carousel-figure {
  margin: 0;
  min-width: 0;
}

.carousel-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 360px;
  padding: 0.5rem;
}

.carousel-img-wrap--freepik-quick {
  min-height: min(32vh, 240px);
  max-height: none;
  padding: 0.75rem 1rem;
}

.carousel-img-wrap img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: contain;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.carousel-img-wrap--freepik-quick img {
  max-height: none;
  width: 100%;
  height: auto;
}

.carousel-chrome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.carousel-btn {
  flex: 0 0 auto;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.35rem;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.carousel-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-2);
}

.carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.carousel-status {
  font-size: 0.88rem;
  color: var(--muted);
  min-width: 3.5rem;
  text-align: center;
}

.freepik-quick-tip {
  padding: 0.9rem 1.05rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 53, 0.55);
}

.freepik-quick-tip__progress {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  text-transform: uppercase;
}

.freepik-quick-tip__body {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-line;
}

.freepik-quick-tip__source {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.freepik-quick-tip__source-lead {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: var(--accent-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.freepik-quick-tip__ref.jump-link {
  font-size: inherit;
  font-weight: 500;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Format cards: same visual pattern as CapCut "Canvas & ratios" module */
.card-ui-capcut {
  margin: 0 0 0.75rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1735;
}

.card-ui-capcut img {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.card-learn-link {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
}

.feature-image {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 0.8rem;
  background: #0f1735;
}

/* Module 5: interactive workspace map (References → Finals + detail panel) */
.workspace-interactive {
  margin-bottom: 0.95rem;
  min-width: 0;
}

.workspace-interactive[hidden] {
  display: none !important;
}

.workspace-interactive__chrome {
  border-radius: 16px;
  border: 1px solid #25305a;
  background: linear-gradient(180deg, #0e1530 0%, #121935 42%);
  padding: 1rem 1rem 1.05rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.workspace-interactive__map-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 700;
  color: #f2f5ff;
  letter-spacing: -0.02em;
}

.workspace-interactive__hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #aeb8d8;
}

.workspace-interactive__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 780px) {
  .workspace-interactive__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.workspace-interactive__step {
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid #8c9eff;
  background: #1a2450;
  color: #f2f5ff;
  padding: 0.65rem 0.72rem 0.72rem;
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.workspace-interactive__step:hover {
  border-color: #00e0b8;
  box-shadow: 0 0 0 1px rgba(0, 224, 184, 0.25);
}

.workspace-interactive__step:focus-visible {
  outline: 2px solid #00e0b8;
  outline-offset: 2px;
}

.workspace-interactive__step--active {
  border-color: #00e0b8;
  background: #152042;
  box-shadow:
    0 0 0 1px rgba(0, 224, 184, 0.35),
    inset 0 0 0 1px rgba(0, 224, 184, 0.12);
}

.workspace-interactive__step-label {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
}

.workspace-interactive__step-sub {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #aeb8d8;
}

.workspace-interactive__panel {
  border-radius: 12px;
  border: 1px solid #25305a;
  background: #0b1020;
  padding: 0.85rem 0.95rem 1rem;
  min-height: 10rem;
}

.workspace-interactive__detail-title {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #f2f5ff;
}

.workspace-interactive__prose {
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #c7d0e8;
}

.workspace-interactive__bullets {
  margin: 0.2rem 0 0;
  padding-left: 1.15rem;
  color: #aeb8d8;
  font-size: 0.84rem;
  line-height: 1.5;
}

.workspace-interactive__bullets li {
  margin-bottom: 0.35rem;
}

/* Module 5: timeline cards below the interactive map — separated block + section title */
.workflow-steps-block {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.workflow-steps-block__title {
  margin: 0 0 0.75rem;
  font-size: clamp(0.95rem, 2.1vw, 1.12rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}

.workflow-steps-block .timeline {
  margin-top: 0;
}

/* Model guide (module): responsive chooser — replaces fixed SVG where text could not wrap */
.model-chooser-banner {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1.15rem 1rem 1.25rem;
  margin-bottom: 0.85rem;
}

.model-chooser-banner[hidden] {
  display: none !important;
}

.model-chooser-banner__title {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 2.8vw, 1.55rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.model-chooser-banner__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  align-items: stretch;
}

@media (max-width: 720px) {
  .model-chooser-banner__grid {
    grid-template-columns: 1fr;
  }
}

.model-chooser-banner__col {
  min-width: 0;
  padding: 0.7rem 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.55);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.model-chooser-banner__subtitle {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.model-chooser-banner__thumb {
  margin: 0 0 0.55rem;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1735;
  flex-shrink: 0;
  /* Natural image height (no forced 4:3 crop) */
}

.model-chooser-banner__thumb img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  display: block;
}

.model-chooser-banner__line {
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.model-chooser-banner__line--muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.model-chooser-banner__line--accent {
  margin-top: 0.45rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.86rem;
}

.model-chooser-banner__rule {
  margin-top: 1rem;
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  background: #0b1020;
  border: 1px solid var(--border);
  min-width: 0;
}

.model-chooser-banner__models {
  margin-top: 0.9rem;
  padding: 0.72rem 0.9rem;
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.6);
  border: 1px solid var(--border);
}

/* Module 4: stills vs video carousels — two columns on wide viewports, stacked on narrow */
.model-chooser-banner__models-duo {
  display: grid;
  gap: 0.85rem 1rem;
  margin-top: 0.2rem;
  align-items: start;
}

.model-chooser-banner__models-duo--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.model-chooser-banner__models-duo--cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 920px) {
  .model-chooser-banner__models-duo--cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.model-chooser-models-band {
  min-width: 0;
  padding: 0.55rem 0.62rem 0.65rem;
  border-radius: 12px;
  background: rgba(8, 12, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.model-chooser-models-band--stills {
  border-left: 4px solid #5b9eff;
  box-shadow: inset 0 0 0 1px rgba(91, 158, 255, 0.12);
}

.model-chooser-models-band--motion {
  border-left: 4px solid #f472b6;
  box-shadow: inset 0 0 0 1px rgba(244, 114, 182, 0.12);
}

.model-chooser-models-band__head {
  margin-bottom: 0.35rem;
}

.model-chooser-models-band__badge {
  display: inline-block;
  padding: 0.18rem 0.52rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
}

.model-chooser-models-band__badge--stills {
  color: #cfe4ff;
  background: rgba(91, 158, 255, 0.2);
  border: 1px solid rgba(91, 158, 255, 0.45);
}

.model-chooser-models-band__badge--motion {
  color: #ffe4f3;
  background: rgba(244, 114, 182, 0.22);
  border: 1px solid rgba(244, 114, 182, 0.45);
}

.model-chooser-models-band__lead {
  margin: 0 0 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-2);
  line-height: 1.35;
}

.model-chooser-banner__models-duo .model-chooser-models-carousel__viewport {
  min-height: 10.25rem;
}

.model-chooser-banner__models-lead {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent-2);
}

.model-chooser-banner__models-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  columns: 2;
  column-gap: 1rem;
}

/* Per-model: advantage + image credit hints (Module 4) — horizontal carousel + autoplay */
.model-chooser-models-carousel {
  min-width: 0;
  margin: 0.2rem 0 0.15rem;
}

.model-chooser-models-carousel__viewport {
  overflow: hidden;
  width: 100%;
  min-height: 11.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(6, 10, 22, 0.4);
  touch-action: pan-y;
}

.model-chooser-models-carousel__track {
  display: flex;
  transition: transform 0.3s ease;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .model-chooser-models-carousel__track {
    transition: none;
  }
}

.model-chooser-models-carousel__slide {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.4rem 0.55rem 0.5rem;
  box-sizing: border-box;
  align-items: stretch;
  display: flex;
}

.model-chooser-models-carousel__slide .model-chooser-modelrow {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.model-chooser-models-carousel__chrome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* Legacy: stacked list (if ever used without carousel) */
.model-chooser-banner__model-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  min-width: 0;
}

.model-chooser-modelrow {
  padding: 0.55rem 0.72rem;
  border-radius: 9px;
  background: rgba(6, 10, 22, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.model-chooser-modelrow__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.28rem;
}

.model-chooser-modelrow__line {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.model-chooser-modelrow__line--credits {
  color: #c7d0e0;
}

.model-chooser-modelrow__k {
  color: var(--accent-2);
  font-weight: 600;
  margin-right: 0.2rem;
}

.model-chooser-banner__models-video {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.model-chooser-banner__models-source {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.model-chooser-banner__rule-title {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.model-chooser-banner__rule-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.moment-card__thumb-link {
  display: block;
  width: 100%;
  margin-bottom: 0.45rem;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

.moment-card__thumb-link:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.moment-card__thumb-link:hover img {
  border-color: var(--accent);
  opacity: 0.96;
}

.moment-card img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.45rem;
}

.moment-card__thumb-link img {
  margin-bottom: 0;
  display: block;
}

.jump-link {
  display: inline-block;
  text-decoration: none;
  color: var(--accent-2);
  margin-top: 0.42rem;
}

.jump-link:hover {
  text-decoration: underline;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem;
  text-align: center;
  color: var(--muted);
}

li + li {
  margin-top: 0.46rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .hero-intro {
    grid-template-columns: 1fr;
  }

  .visual-with-list {
    grid-template-columns: 1fr;
  }

  .video-frame iframe {
    min-height: 260px;
  }

  .lesson-controls {
    grid-template-columns: 1fr;
  }

  .carousel-viewport--freepik-quick {
    min-height: 240px;
    max-height: min(88vh, 1000px);
  }

  .carousel-img-wrap--freepik-quick {
    min-height: 200px;
    max-height: none;
  }

  .carousel-img-wrap--freepik-quick img {
    max-height: none;
  }
}
