/* Telemarketer course — mission briefing learning desk */
.course-body {
  --ground: #0a0a0a;
  --panel: #141923;
  --panel-2: #1a2030;
  --paper: #f2eee5;
  --muted: #91a0b4;
  --gold: #c4a86b;
  --live: #23c8a3;
  --line: rgba(242, 238, 229, 0.14);
  --line-strong: rgba(242, 238, 229, 0.22);
  --sans: "Manrope", "Outfit", ui-sans-serif, system-ui, sans-serif;
  --display: "Cormorant Garamond", "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --rail-width: 15.5rem;
  --ref-width: 14rem;
  --ease: 160ms ease;
  background: var(--ground);
  color: var(--paper);
}

.course-body .site-header {
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}

.course-body .site-header .brand,
.course-body .site-header .site-nav a,
.course-body .site-header .btn--ghost {
  color: var(--paper);
}

.course-body .site-footer {
  background: var(--ground);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.course-body .site-footer a,
.course-body .site-footer .brand {
  color: var(--paper);
}

/* Flight plan bar */
.course-flight-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, var(--ground));
  backdrop-filter: blur(8px);
}

.course-flight-bar .wrap {
  display: grid;
  gap: 12px;
  padding-block: 12px 14px;
}

.course-flight-plan {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.course-flight-plan__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.course-flight-plan__label {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.course-flight-plan__count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.course-flight-plan__count[data-complete="true"] {
  color: var(--live);
}

.course-sync-status {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.course-sync-status[data-sync="synced"] {
  color: var(--live);
}

.course-sync-status[data-sync="pending"] {
  color: #ef5151;
}

.course-flight-node[data-state="local"] {
  border-color: rgba(239, 81, 81, 0.55);
  color: #ffb4b4;
}

.chapter-rail__item[data-sync="local"] .chapter-rail__status {
  color: #ef5151;
}

.course-flight-track {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.course-flight-node {
  position: relative;
  flex: none;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 2.4rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.course-flight-node::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--panel);
  transition: border-color var(--ease), background var(--ease), box-shadow var(--ease);
}

.course-flight-node::after {
  content: "";
  position: absolute;
  top: 5px;
  left: calc(50% + 6px);
  width: calc(100% - 12px);
  height: 2px;
  background: var(--line);
  pointer-events: none;
}

.course-flight-node:last-child::after {
  display: none;
}

.course-flight-node[data-state="done"]::before {
  border-color: var(--live);
  background: var(--live);
}

.course-flight-node[data-state="done"]::after {
  background: color-mix(in srgb, var(--live) 55%, var(--line));
}

.course-flight-node[data-state="active"] {
  color: var(--gold);
}

.course-flight-node[data-state="active"]::before {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent);
}

.course-flight-node:hover,
.course-flight-node:focus-visible {
  color: var(--paper);
  outline: none;
}

.course-flight-node:focus-visible::before {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.course-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.course-section-nav a {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  text-decoration: none;
}

.course-section-nav a:hover,
.course-section-nav a[aria-current="true"] {
  color: var(--paper);
}

/* Briefing hero */
.course-briefing {
  padding-block: 48px 36px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.course-briefing .kicker {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.course-briefing h1 {
  margin-top: 10px;
  max-width: 20ch;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.08;
  color: var(--paper);
}

.course-briefing .lede {
  margin-top: 16px;
  max-width: 58ch;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
}

.course-briefing .fineprint {
  color: color-mix(in srgb, var(--muted) 88%, var(--paper));
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
}

.course-briefing .fineprint strong {
  color: var(--paper);
}

/* Learning desk */
.course-desk {
  padding-block: 28px 40px;
  background: var(--ground);
}

.course-desk__grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.chapter-rail {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.chapter-rail__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.chapter-rail__head strong {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chapter-rail__next {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chapter-rail__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 28rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chapter-rail__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
  text-align: left;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.chapter-rail__item:hover {
  background: color-mix(in srgb, var(--panel-2) 80%, var(--ground));
  color: var(--paper);
}

.chapter-rail__item[aria-current="true"] {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
  background: color-mix(in srgb, var(--gold) 10%, var(--panel-2));
  color: var(--paper);
}

.chapter-rail__item[data-done="true"] .chapter-rail__status {
  color: var(--live);
}

.chapter-rail__num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.chapter-rail__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.chapter-rail__dur,
.chapter-rail__status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.lesson-stage {
  min-width: 0;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  background: var(--panel);
}

.lesson-stage__head {
  display: grid;
  gap: 6px;
}

.lesson-kicker {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.lesson-stage__title {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--paper);
}

.lesson-stage__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
}

.lesson-stage__dur {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.lesson-media {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ground);
  overflow: hidden;
}

.lesson-media video,
.lesson-media audio {
  display: block;
  width: 100%;
  max-height: min(52vh, 28rem);
  background: #000;
}

.lesson-media[data-mode="audio"] {
  padding: 18px 16px 14px;
}

.lesson-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lesson-controls .btn {
  min-height: 44px;
  font-family: var(--sans);
}

.lesson-format-toggle {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}

.lesson-format-toggle button {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lesson-format-toggle button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--gold) 16%, var(--panel-2));
  color: var(--paper);
}

.lesson-format-toggle button:hover {
  color: var(--paper);
}

.lesson-continue {
  margin-left: auto;
}

.desk-references {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

.desk-ref-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.desk-ref-card h3 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.desk-ref-card p {
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

.desk-ref-card .btn {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  font-family: var(--sans);
}

.desk-ref-card .btn--ghost {
  color: var(--paper);
  border-color: var(--line-strong);
}

/* Content sections below desk */
.course-body .section {
  background: var(--ground);
  color: var(--paper);
  border-top: 1px solid var(--line);
}

.course-body .section--panel {
  background: var(--panel);
}

.course-body .section .kicker {
  color: var(--gold);
  font-family: var(--sans);
}

.course-body .section .h-section {
  font-family: var(--display);
  color: var(--paper);
}

.course-body .section .lede,
.course-body .section p {
  color: var(--muted);
  font-family: var(--sans);
}

.course-body .format-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.course-body .format-card {
  border-color: var(--line);
  background: var(--panel);
}

.course-body .format-card h3 {
  font-family: var(--sans);
  color: var(--paper);
}

.course-body .format-card p {
  color: var(--muted);
}

.course-body .format-card .kicker {
  color: var(--gold);
}

.course-body .btn--forest {
  background: var(--live);
  border-color: var(--live);
  color: var(--ground);
}

.course-body .btn--ghost {
  color: var(--paper);
  border-color: var(--line-strong);
}

/* Chapter reference table */
.course-body .course-table-wrap {
  overflow-x: auto;
}

.course-body .course-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.course-body .course-table th,
.course-body .course-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}

.course-body .course-table th {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.course-body .course-table td.num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gold);
  width: 2.5em;
}

.course-body .course-table td.title {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--paper);
}

.course-body .course-table td.dur {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.course-body .course-table a.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  text-decoration: none;
}

.course-body .course-table a.pill:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--panel));
}

.course-body .course-table tr[data-active="true"] {
  background: color-mix(in srgb, var(--gold) 8%, var(--panel));
}

.course-body .handoff-step {
  border-color: var(--line);
}

.course-body .handoff-step h3 {
  font-family: var(--sans);
  color: var(--paper);
}

.course-body .handoff-step p {
  color: var(--muted);
}

.course-body .handoff-step__tag {
  color: var(--live);
}

.course-body .handoff-steps {
  display: grid;
  gap: 26px;
  margin-top: 30px;
}

.course-body .handoff-step {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.course-body .handoff-step:first-child {
  padding-top: 0;
  border-top: none;
}

.course-body .handoff-step h3 {
  font-size: 1.18rem;
  font-weight: 600;
}

.course-body .handoff-step p {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.65;
}

.course-body .handoff-step .btn {
  margin-top: 16px;
}

@media (min-width: 900px) {
  .course-body .handoff-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 32px;
  }

  .course-body .handoff-step {
    padding-top: 0;
    padding-left: 28px;
    border-top: none;
    border-left: 1px solid var(--line);
  }

  .course-body .handoff-step:first-child {
    padding-left: 0;
    border-left: none;
  }
}

@media (min-width: 1040px) {
  .course-desk__grid {
    grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--ref-width);
    align-items: start;
  }

  .course-flight-bar .wrap {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

@media (max-width: 1039px) {
  .desk-references {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .lesson-continue {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 719px) {
  .course-briefing {
    padding-block: 36px 28px;
  }

  .chapter-rail__list {
    max-height: 14rem;
  }

  .course-body .course-table-wrap {
    overflow-x: visible;
  }

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

  .course-body .course-table,
  .course-body .course-table tbody,
  .course-body .course-table tr,
  .course-body .course-table td {
    display: block;
    width: 100%;
  }

  .course-body .course-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 16px;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
  }

  .course-body .course-table tbody tr:first-child {
    margin-top: 0;
  }

  .course-body .course-table td {
    flex: 1 1 100%;
    padding: 0;
    border: none;
  }

  .course-body .course-table td.num {
    order: -2;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .course-body .course-table td.num::before {
    content: "Chapter ";
  }

  .course-body .course-table td.title {
    order: -1;
    font-size: 1.05rem;
  }

  .course-body .course-table td.dur {
    font-size: 13px;
  }

  .course-body .course-table td.dur::before {
    content: "Length ";
  }

  .course-body .course-table td.action {
    flex: 1 1 140px;
  }

  .course-body .course-table td.action .pill {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .course-body .course-table a.pill {
    padding: 10px 12px;
    font-size: 13px;
  }
}

#formats,
#chapters,
#route,
#desk {
  scroll-margin-top: 120px;
}
