/* ============================================================
   Course portal, step-by-step layout (task V.11).
   Loaded last on /course/. The sidebar becomes a top menu, chapters
   sit in a strip across the page, and each chapter runs one step
   at a time with ticks, skips and proof uploads.
   Warm tokens only. Never use em dashes.
   ============================================================ */

/* ---------- Shell: no sidebar ---------- */
.warm .cshell { display: block; padding: 0 0 48px; }
.warm .cmain { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.warm .cbanner { margin-top: 16px; }

/* ---------- Top menu: Home, Resources, Admin, Sign out ---------- */
.warm .cside {
  position: sticky; top: 76px; z-index: 35;
  height: auto; max-height: none; overflow: visible;
  display: flex; flex-direction: row; justify-content: center; gap: 4px;
  padding: 8px 24px; border: 0; border-bottom: 1px solid var(--h-line); border-radius: 0;
  background: var(--h-cream);
}
.warm .cside__list, .warm .cside__list--foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; border: 0; }
.warm .cside a, .warm .cside button, .warm .cside summary {
  display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 44px;
  padding: 0 16px; border: 0; border-radius: 999px; background: none;
  color: var(--h-ink); font-family: var(--h-body); font-size: 15px; font-weight: 600; line-height: 1;
}
.warm .cside a:hover, .warm .cside button:hover, .warm .cside summary:hover { background: rgba(26, 22, 18, 0.06); color: var(--h-ink); }
.warm .cside a.is-current, .warm .cside details.is-current > summary { background: rgba(26, 22, 18, 0.1); box-shadow: none; }
.warm .cside__mark { display: none; }
.warm .cside summary::after { position: static; margin: -4px 0 0 2px; border-color: var(--h-ink); }
.warm .cside details[open] > summary::after { margin-top: 4px; }
.warm .cside__group { position: relative; }
.warm .cside__group > ul {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  display: flex; flex-direction: column; min-width: 220px; margin: 0; padding: 8px; list-style: none;
  background: var(--h-card); border: 1px solid var(--h-line); border-radius: 20px;
  box-shadow: 0 12px 32px rgba(26, 22, 18, 0.12);
}
.warm .cside__group > ul a { display: flex; width: 100%; padding: 0 14px; border-radius: 12px; font-size: 15px; }

/* ---------- Page width and grid ---------- */
.cwide { display: flex; flex-direction: column; gap: 40px; padding: 40px 0 0; color: var(--h-ink); }
.cgrid { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.cgrid__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.cgrid__aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.kick { margin: 0; font-family: var(--h-body); font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--h-ember-d); }

/* ---------- Home: welcome and whole-course card ---------- */
.hello { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; justify-content: space-between; }
.hello__text { flex: 1 1 420px; display: flex; flex-direction: column; gap: 12px; }
.hello__title { margin: 0; font-family: var(--h-display); font-weight: 800; font-size: clamp(40px, 6vw, 64px); line-height: 1; letter-spacing: -0.035em; }
.hello__dek { margin: 0; max-width: 560px; font-size: 19px; line-height: 1.55; color: var(--h-soft); }

.overall {
  flex: 1 1 360px; max-width: 460px; display: flex; flex-direction: column; gap: 14px;
  padding: 28px; border-radius: 28px; background: var(--h-ink); color: #F3EDE3;
}
.overall__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.overall__kick { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #FF8B69; }
.overall__count { margin: 0; font-size: 14px; font-weight: 600; color: #A99F8E; }
.overall__pct { margin: 0; font-family: var(--h-display); font-weight: 800; font-size: 72px; line-height: 1; letter-spacing: -0.03em; }
.overall__bar { height: 12px; border-radius: 999px; background: #34302A; overflow: hidden; }
.overall__bar span { display: block; height: 100%; border-radius: 999px; background: var(--h-ember); transition: width .3s linear; }
.overall__note { margin: 0; font-size: 15px; line-height: 1.5; color: #CFC6B7; }

/* Slim version above the chapter strip on chapter pages. */
.overall--slim {
  flex: none;
  max-width: none; display: grid; grid-template-columns: auto auto minmax(120px, 1fr); align-items: center; gap: 8px 20px;
  padding: 16px 24px; border-radius: 20px;
}
.overall--slim .overall__top { display: contents; }
.overall--slim .overall__kick { grid-column: 1; grid-row: 1; }
.overall--slim .overall__count { grid-column: 1; grid-row: 2; }
.overall--slim .overall__pct { grid-column: 2; grid-row: 1 / 3; font-size: 40px; }
.overall--slim .overall__bar { grid-column: 3; grid-row: 1 / 3; }
.rail { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Chapter strip ---------- */
.chapters { display: flex; flex-direction: column; gap: 14px; }
.chapters__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.chapters__title { margin: 0; font-family: var(--h-display); font-weight: 800; font-size: 28px; letter-spacing: -0.03em; }
.chapters__note { margin: 0; font-size: 14px; font-weight: 600; color: var(--h-mute); }
.strip__list {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px;
  margin: 0; padding: 0 0 6px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity;
}
.strip__list li { display: flex; scroll-snap-align: start; }
.tile {
  flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 150px; padding: 16px;
  border: 1.5px solid var(--h-card); border-radius: 20px; background: var(--h-card); color: var(--h-ink);
  text-decoration: none; transition: border-color .15s linear;
}
.tile:hover { border-color: var(--h-ink); color: var(--h-ink); }
.tile__top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--h-ember-d); }
.tile__title { flex-grow: 1; font-family: var(--h-display); font-weight: 700; font-size: 17px; line-height: 1.2; letter-spacing: -0.02em; }
.tile__bar { display: block; height: 6px; border-radius: 999px; background: var(--h-line); overflow: hidden; }
.tile__bar span { display: block; height: 100%; border-radius: 999px; background: var(--h-ember-d); }
.tile__sub { font-size: 13px; font-weight: 600; color: var(--h-mute); }
.tile.is-current { background: var(--h-ink); border-color: var(--h-ink); color: #F3EDE3; }
.tile.is-current .tile__top { color: #FF8B69; }
.tile.is-current .tile__bar { background: #34302A; }
.tile.is-current .tile__bar span { background: var(--h-ember); }
.tile.is-current .tile__sub { color: #CFC6B7; }
.tile.is-locked { background: transparent; border: 1.5px dashed #C9BDA9; color: var(--h-mute); }
.tile.is-locked .tile__top { color: var(--h-mute); }

/* ---------- Home: next up ---------- */
.nextup { display: flex; flex-direction: column; gap: 14px; padding: 32px; border-radius: 28px; background: var(--h-card); }
.nextup__title { margin: 0; font-family: var(--h-display); font-weight: 800; font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; }
.nextup__step { margin: 0; font-size: 17px; line-height: 1.55; color: var(--h-soft); }

/* ---------- Certificate and catch up ---------- */
.cert { display: flex; flex-direction: column; gap: 14px; padding: 28px; border-radius: 32px; background: var(--h-ink); color: #F3EDE3; }
.cert__kick { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #FF8B69; }
.cert__title { margin: 0; font-family: var(--h-display); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -0.03em; color: #F3EDE3; }
.cert__list { margin: 0; padding: 0; list-style: none; }
.cert__list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #34302A; font-size: 15px; }
.cert__list li:last-child { border-bottom: 0; }
.cert__list span { color: #CFC6B7; }
.cert__note { margin: 0; font-size: 15px; line-height: 1.5; color: #CFC6B7; }

.catch { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 28px; background: var(--h-card); }
.catch__title { margin: 0; font-family: var(--h-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.catch__body { margin: 0; font-size: 15px; line-height: 1.55; color: var(--h-soft); }
.catch__none { margin: 0; padding: 8px 0; font-size: 15px; font-weight: 600; color: var(--h-mute); }
.catch__list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.catch__item {
  display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 10px 14px;
  border: 1.5px dashed var(--h-mute); border-radius: 14px; background: var(--h-cream); color: var(--h-ink); text-decoration: none;
}
.catch__item:hover { border-style: solid; border-color: var(--h-ink); color: var(--h-ink); }
.catch__where { font-size: 13px; font-weight: 700; color: var(--h-ember-d); white-space: nowrap; }
.catch__step { font-size: 15px; font-weight: 600; }

/* ---------- Chapter page ---------- */
.chap2 { color: var(--h-ink); }
.chap2__title { margin: 0; font-family: var(--h-display); font-weight: 800; font-size: clamp(32px, 4.5vw, 44px); line-height: 1.1; letter-spacing: -0.03em; }
.chap2__dek { margin: 0; font-size: 19px; line-height: 1.55; color: var(--h-soft); }
.chap2 .vid, .chap2 .minimum, .chap2 .chap__intro, .chap2 .faqs, .chap2 .finish { margin-top: 0; }
.chap2 .minimum { border: 0; border-radius: 20px; background: var(--h-card); }

.flow2 { display: flex; flex-direction: column; gap: 14px; }
.flow2__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.flow2__title { margin: 0; font-family: var(--h-display); font-weight: 800; font-size: 26px; letter-spacing: -0.03em; }
.flow2__count { margin: 0; font-size: 14px; font-weight: 600; color: var(--h-mute); }

.segs { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.segs li { flex: 1 1 0; display: flex; }
.seg {
  flex: 1; height: 16px; padding: 0; cursor: pointer;
  border: 1.5px solid var(--h-line); border-radius: 4px; background: var(--h-line);
}
.seg.is-done { background: var(--h-ember-d); border-color: var(--h-ember-d); }
.seg.is-skipped { background: var(--h-card); border-style: dashed; border-color: var(--h-mute); }
.seg.is-current { background: var(--h-ink); border-color: var(--h-ink); }
.seg:hover { border-color: var(--h-ink); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; color: var(--h-mute); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend__key { box-sizing: border-box; width: 12px; height: 12px; border-radius: 3px; background: var(--h-line); }
.legend__key.is-done { background: var(--h-ember-d); }
.legend__key.is-current { background: var(--h-ink); }
.legend__key.is-skipped { background: var(--h-card); border: 1.5px dashed var(--h-mute); }

/* The step in focus */
.focus { display: flex; flex-direction: column; gap: 18px; padding: 32px; border-radius: 28px; background: var(--h-card); scroll-margin-top: 150px; }
.focus__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.focus__kick { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--h-mute); }
.focus__title { margin: 0; font-family: var(--h-display); font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; }
.focus__title:focus { outline: none; }
.focus__title:focus-visible { outline: 2px solid var(--h-ember); outline-offset: 4px; border-radius: 6px; }
.focus .md { font-size: 17px; }
.focus .callout { margin: 0; }
.focus__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.focus__hint { font-size: 14px; color: var(--h-mute); }
.h-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.h-btn { cursor: pointer; }

.badge {
  display: inline-flex; align-items: center; padding: 5px 10px; border: 1.5px solid var(--h-cream); border-radius: 999px;
  background: var(--h-cream); color: var(--h-soft); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.badge--done { background: var(--h-ember-d); border-color: var(--h-ember-d); color: #fff; }
.badge--here { background: var(--h-ink); border-color: var(--h-ink); color: #fff; }
.badge--skip { background: var(--h-card); border-style: dashed; border-color: var(--h-mute); }

/* Proof upload */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px 20px; border: 1.5px dashed var(--h-mute); border-radius: 20px; background: var(--h-cream);
  color: var(--h-ember-d); text-align: center; cursor: pointer; transition: border-color .15s linear, background-color .15s linear;
}
.drop:hover, .drop.is-over { border-color: var(--h-ink); background: #fff; }
.drop:focus-within, .proof__more:focus-within { outline: 2px solid var(--h-ember); outline-offset: 2px; }
.drop.is-busy { opacity: 0.6; pointer-events: none; }
.drop__title { font-size: 16px; font-weight: 700; color: var(--h-ink); }
.drop__body { max-width: 440px; font-size: 15px; line-height: 1.5; color: var(--h-soft); }
.proof { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 16px; background: var(--h-cream); }
.proof__list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.proof__list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.proof__mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--h-ember-d); color: #fff; }
.proof__name { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; }
.proof__when { font-size: 14px; color: var(--h-mute); }
.proof__more { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 700; color: var(--h-ember-d); cursor: pointer; }
.proof__more:hover { color: var(--h-ink); }
.proof__more.is-busy { opacity: 0.6; pointer-events: none; }

/* Every step in the chapter */
.slist { margin: 0; padding: 12px 20px; list-style: none; border-radius: 28px; background: var(--h-card); }
.srow {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 52px; padding: 12px 8px;
  border: 0; border-bottom: 1px solid var(--h-line); border-radius: 0; background: none;
  color: var(--h-ink); font-family: var(--h-body); text-align: left; cursor: pointer;
}
.slist li:last-child .srow { border-bottom: 0; }
.srow:hover, .srow.is-current { background: rgba(26, 22, 18, 0.06); border-radius: 12px; }
.srow__num { width: 28px; flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--h-ember-d); }
.srow__title { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 500; }
.srow.is-current .srow__title { font-weight: 700; }
.srow__proof { font-size: 13px; color: var(--h-mute); white-space: nowrap; }

/* ---------- Phone ---------- */
@media (max-width: 899px) {
  .warm .cside {
    display: none; position: sticky; top: 76px; flex-direction: column; align-items: stretch;
    margin: 8px 12px 0; padding: 8px; border: 1px solid var(--h-line); border-radius: 20px; background: var(--h-card);
  }
  .warm .cside.is-open { display: flex; }
  .warm .cside__list, .warm .cside__list--foot { flex-direction: column; align-items: stretch; }
  .warm .cside a, .warm .cside button, .warm .cside summary { width: 100%; border-radius: 12px; }
  .warm .cside__group > ul { position: static; min-width: 0; padding: 0 0 0 12px; border: 0; box-shadow: none; }
  .warm .cmain { padding: 0 16px; }
}
@media (max-width: 640px) {
  .cwide { gap: 28px; padding-top: 24px; }
  .overall, .cert, .nextup, .focus { padding: 22px; border-radius: 22px; }
  .overall__pct { font-size: 56px; }
  .overall--slim { grid-template-columns: auto minmax(0, 1fr); }
  .overall--slim .overall__pct { grid-column: 2; grid-row: 1 / 3; justify-self: end; font-size: 32px; }
  .overall--slim .overall__bar { grid-column: 1 / -1; grid-row: 3; }
  .focus__title, .nextup__title { font-size: 24px; }
  .focus__actions .h-btn, .nextup .h-btn { flex: 1 1 100%; }
  .srow { flex-wrap: wrap; gap: 6px 12px; }
  .srow__title { flex-basis: calc(100% - 44px); }
  .srow__proof { margin-left: 40px; }
  .slist { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .overall__bar span { transition: none; }
}

/* Home: the next session and the recording and referral pair sit in the
   main column under Next up. */
.cgrid__main .dash-next, .cgrid__main .dash-pair { margin-top: 0; }
