/* ==========================================================================
   my.headspace.com — Post-onboarding (Upsell + App shell)
   Breakpoints: Small <768 · Medium ≥768 · Large ≥1024 · LargeX ≥1440
   ========================================================================== */

:root {
  --app-cream: var(--hs-warm-grey-100);
  --app-fg: var(--hs-color-foreground);
  --app-muted: var(--hs-warm-grey-500);
  --app-blue: var(--hs-blue-200);
  --app-green: var(--hs-green-200);
  --app-orange: #FF7A1A;
  --sidenav-w: 103px;
  --tabbar-h: 64px;
  --app-max: 1344px;
  --app-gutter: 16px;
  --content-max: 100%;
  /* Ghost icon button hover (Figma Overlay/overlay20) */
  --icon-btn-hover: rgba(20, 19, 19, 0.2);
}

/* ---------- Ghost icon buttons: shared hover ----------
   24px icons get a 32px hover circle (4px bleed) without changing layout */
.ghost-hover {
  position: relative;
  isolation: isolate;
}
.ghost-hover::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -1;
  border-radius: 50%;
  background: transparent;
  transition: background var(--hs-duration-fast, 150ms);
}
.ghost-hover--flush::before { inset: 0; }
.ghost-hover:hover::before { background: var(--icon-btn-hover); }
.ghost-hover:focus { outline: none; }
.ghost-hover:focus-visible::before { box-shadow: 0 0 0 2px var(--hs-blue-200, #0061ef); }

@media (min-width: 768px) {
  :root {
    --app-gutter: 24px;
    --content-max: min(100%, 720px);
  }
}
@media (min-width: 1024px) {
  :root {
    --sidenav-w: 183px;
    --app-gutter: 32px;
    /* Large: main ~8/12 of content area */
    --content-max: min(100%, 896px);
  }
}
@media (min-width: 1440px) {
  :root {
    --app-gutter: 48px;
    --content-max: min(100%, 1120px);
  }
}

/* ==========================================================================
   UPSELL
   ========================================================================== */
.screen--upsell {
  flex-direction: column;
  background: var(--hs-white);
  overflow: auto;
}
.upsell {
  display: flex;
  align-items: stretch;
  /* Size to content (not flex-basis:0) so the right sky can match the taller form */
  flex: 0 0 auto;
  min-height: 100%;
  width: 100%;
}
.upsell__form {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 40px;
  max-width: 100%;
  min-width: 0;
}
.upsell__logo { width: 140px; height: auto; margin-bottom: 32px; }
.upsell__copy {
  width: 100%;
  max-width: 480px;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.upsell__title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--app-fg);
}
.upsell__free { color: var(--app-green); }
.upsell__fine {
  margin: 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--app-muted);
}
.upsell__fine em { font-style: normal; color: var(--app-blue); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 20px;
}
.timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--hs-blue-100);
  opacity: .45;
}
.timeline__icon { width: 28px; height: 28px; display: flex; }
.timeline__icon img { width: 28px; height: 28px; }
.timeline__body strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}
.timeline__body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--hs-color-foreground-weak);
}
.timeline__body em { font-style: normal; color: var(--app-blue); }

.hsa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--hs-border-radius-medium);
  background: var(--app-cream);
  font-size: 13px;
  line-height: 1.4;
  color: var(--hs-color-foreground-weak);
}
.hsa img { width: 16px; height: 16px; flex: none; }

.plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}
@media (min-width: 480px) {
  .plans { grid-template-columns: 1fr 1fr; }
}
.plan {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--hs-warm-grey-200);
  border-radius: 16px;
  background: var(--app-cream);
  padding: 16px;
  min-height: 67px;
  cursor: pointer;
  font: inherit;
  color: var(--hs-color-foreground-weak);
  transition: background var(--hs-duration-faster) var(--hs-easing-standard),
              border-color var(--hs-duration-faster) var(--hs-easing-standard);
}
.plan__badge {
  position: absolute;
  top: -9px;
  left: 22px;
  padding: 2px 12px;
  border-radius: 4px;
  background: #02873e;
  color: var(--hs-white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.plan__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan__label { font-size: 15px; line-height: 1.35; }
.plan__label strong { font-weight: 700; }
.plan__label em { font-style: normal; color: var(--app-muted); font-size: 13px; }
/* Unselected = empty ring; selected = cream circle + check (Figma Plan Cards) */
.plan__mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--hs-warm-grey-400);
  background: var(--hs-white);
}
.plan__check-icon {
  width: 14px;
  height: 14px;
  display: none;
  filter: brightness(0);
}
.plan.is-selected {
  background: var(--hs-warm-grey-700);
  color: var(--hs-white);
  border-color: var(--hs-warm-grey-700);
}
.plan.is-selected .plan__label em { color: rgba(255,255,255,.7); }
.plan.is-selected .plan__mark {
  border-color: var(--hs-warm-grey-200);
  background: var(--app-cream);
}
.plan.is-selected .plan__check-icon { display: block; }
.plan:focus-visible { outline: 2px solid var(--app-blue); outline-offset: 2px; }

.upsell__visual {
  display: none;
  position: relative;
  flex: 1 1 50%;
  align-self: stretch;
  min-height: 100%;
  overflow: hidden;
  /* Figma Visual bottom stop — keeps sky continuous if the image letterboxes */
  background: #0061ef;
}
/* Figma Visual 3424:107923 @2x (1416×1658) — embeds YEAR_IN_REVIEW 3424:107939 */
.upsell__panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

@media (min-width: 900px) {
  .upsell__visual {
    display: block;
    /* Pin the sky to the viewport so scrolling the form never reveals a white gap */
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100dvh;
    min-height: 100%;
  }
  .upsell__form { padding: 32px 48px 48px; justify-content: flex-start; }
  .upsell__copy { margin: 24px auto; }
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */
/* The app scrolls the document itself (native browser scrollbar only);
   the side nav and search bar stay pinned with position: sticky. */
body[data-screen="app"] {
  height: auto;
  min-height: 100%;
  overflow: visible;
}
.screen--app {
  position: relative;
  inset: auto;
  min-height: 100dvh;
  flex-direction: row;
  align-items: flex-start;
  background: var(--hs-white);
  overflow-x: clip;
}
.app-shell {
  flex: 1;
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-top {
  position: sticky;
  top: 0;
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px var(--app-gutter);
  z-index: 2;
  background: var(--hs-white);
  border-bottom: 1px solid var(--hs-color-border, #e2ded9);
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 480px);
  height: 48px;
  padding: 0 16px;
  border-radius: var(--hs-border-radius-pill);
  background: var(--app-cream);
  box-shadow: none;
}
.search__icon { width: 24px; height: 24px; color: var(--app-muted); flex: none; }
.search__icon svg,
.search__icon img { width: 24px; height: 24px; display: block; }
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 16px/1.5 var(--hs-font-sans);
  color: var(--app-fg);
}
.search input::placeholder { color: #63605d; }

.app-grid {
  /* Top/left padding are variables so full-bleed views (Favorites) can cancel them out */
  --grid-pt: 16px;
  --grid-pl: var(--app-gutter);
  flex: 1;
  overflow-x: clip;
  display: flex;
  justify-content: center;
  padding: var(--grid-pt) var(--app-gutter) calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom, 0px)) var(--grid-pl);
}
@media (min-width: 768px) {
  .app-grid { padding-bottom: 40px; }
}

.app-col {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}
.app-col--wide { max-width: min(100%, var(--app-max)); }

/* ---------- Figma layout grid ----------
   Every breakpoint frame uses a viewport-wide column grid that runs underneath the nav:
   Small 4 cols / 16 gutter / 24 margin · Medium 8 / 16 / 48 · Large 12 / 24 / 48 (stretch)
   LargeX ≥1440: 12 fixed 90px cols / 24 gutter, centered (1344px total).
   A page column picks a start column and a span, e.g. Program pages are 7 cols from col 4. */
:root {
  --gc-n: 4;
  --gc-g: 16px;
  --gc-m: 24px;
  --gc-nav: 0px;
  --gc-col: calc((100vw - 2 * var(--gc-m) - (var(--gc-n) - 1) * var(--gc-g)) / var(--gc-n));
}
@media (min-width: 768px) {
  :root { --gc-n: 8; --gc-m: 48px; --gc-nav: var(--sidenav-w); }
}
@media (min-width: 1024px) {
  :root { --gc-n: 12; --gc-g: 24px; }
}
@media (min-width: 1440px) {
  :root { --gc-col: 90px; --gc-m: calc((100vw - 1344px) / 2); }
}
@media (min-width: 768px) {
  /* Session's stack lives inside a plain .app-col; let that wrapper span the whole grid */
  .app-grid .view--session > .app-col { max-width: none; margin: 0; }
  .app-grid .view--today .app-col,
  .app-grid .explore-stack,
  .app-grid .med-col,
  .app-grid .program-stack,
  .app-grid .session-stack {
    --start: 3;
    --span: 5;
    /* Viewport x of the column's left edge (also used by carousels that bleed to the edge) */
    --gc-x: calc(var(--gc-m) + (var(--start) - 1) * (var(--gc-col) + var(--gc-g)));
    width: calc(var(--span) * var(--gc-col) + (var(--span) - 1) * var(--gc-g));
    max-width: none;
    /* The column sits inside .app-grid, which already starts after the nav + its left padding */
    margin-left: calc(var(--gc-x) - var(--gc-nav) - var(--grid-pl));
    margin-right: 0;
  }
}
@media (min-width: 1024px) {
  .app-grid .view--today .app-col,
  .app-grid .explore-stack,
  .app-grid .med-col { --span: 8; }
  .app-grid .program-stack,
  .app-grid .session-stack { --start: 4; --span: 7; }
}
@media (min-width: 1280px) {
  .app-grid .view--today .app-col { --start: 4; }
}
@media (min-width: 1440px) {
  /* Today's LargeX column is 657px from col 3; its carousels bleed to the viewport edge */
  .app-grid .view--today .app-col { --start: 3; width: 657px; }
}

@media (min-width: 1440px) {
  .app-shell {
    max-width: calc(var(--app-max) + var(--sidenav-w));
  }
  .screen--app {
    justify-content: flex-start;
  }
  .app-grid {
    /* LargeX: content starts 93px from the nav rail and 48px below the search bar */
    justify-content: flex-start;
    --grid-pt: 48px;
    --grid-pl: 93px;
    padding-top: var(--grid-pt);
    padding-left: var(--grid-pl);
    padding-right: max(var(--app-gutter), calc((100vw - var(--sidenav-w) - var(--app-max)) / 2 + var(--app-gutter)));
  }
}

.view { width: 100%; animation: screen-in var(--hs-duration-slow) var(--hs-easing-entrance); }
.view[hidden] { display: none !important; }

/* ---------- side nav (Medium+) ----------
   Figma "Nav drawer/Medium+":
   - Medium (768–1023): 103px rail, icon stacked over a 12px label ("_Nav items/Mobile/*")
   - Large+ (≥1024): 183px drawer, icon beside a 14px label ("_Nav items/Desktop/*") */
.sidenav {
  display: none;
  position: sticky;
  top: 0;
  height: 100dvh;
  flex: none;
  width: var(--sidenav-w);
  flex-direction: column;
  align-items: stretch;
  padding: 24px 0 24px;
  background: var(--hs-white);
  border-right: 1px solid #e2ded9;
  z-index: 3;
}
.sidenav__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 0;
  margin-bottom: 31px;
  text-decoration: none;
}
.sidenav__logo-full { display: none; width: min(160px, 90%); height: auto; }
.sidenav__logo-dot { width: 34px; height: 34px; }
.sidenav__list {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.sidenav__item {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 60px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  font: 400 12px/18px var(--hs-font-sans);
  letter-spacing: 0;
  cursor: pointer;
}
/* The medium selection pill is 51px tall, inset 4px from the top of the 60px item */
.sidenav__item::before {
  content: "";
  position: absolute;
  inset: 4px 0 5px;
  z-index: -1;
  border-radius: var(--hs-border-radius-pill);
  background: transparent;
}
.sidenav__item:hover::before { background: rgba(45, 44, 43, 0.04); }
.sidenav__item.is-active { color: var(--app-fg); }
.sidenav__item.is-active::before { background: var(--app-cream); }
.sidenav__item:focus { outline: none; }
.sidenav__item:focus-visible::before { outline: 2px solid var(--app-blue); outline-offset: -2px; }
.sidenav__icon { width: 24px; height: 24px; flex: none; color: var(--app-fg); }
.sidenav__icon svg,
.sidenav__icon img { width: 24px; height: 24px; display: block; }
.sidenav__label { display: block; white-space: nowrap; }
.sidenav__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(145deg, #FFA1CC, #FF7300);
  color: var(--hs-white);
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidenav__avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.sidenav__settings {
  width: 100%; height: 50px; margin: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--app-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sidenav__settings svg,
.sidenav__settings img { width: 24px; height: 24px; display: block; }
.sidenav__settings:hover { background: var(--app-cream); color: var(--app-fg); }

@media (min-width: 768px) {
  .sidenav { display: flex; }
}
@media (min-width: 1024px) {
  .sidenav__brand {
    padding: 6px 0;
    margin-bottom: 40px;
  }
  .sidenav__logo-dot { display: none; }
  .sidenav__logo-full { display: block; width: 134px; height: 32px; object-fit: contain; }
  .sidenav__list { gap: 0; padding: 0 12px; }
  .sidenav__item {
    flex-direction: row;
    justify-content: flex-start;
    height: 48px;
    padding: 12px 24px;
    gap: 16px;
    font: 400 14px/1.5 var(--hs-font-sans);
  }
  .sidenav__item::before { inset: 0; }
  .sidenav__settings { height: 48px; }
}

/* ---------- bottom tab bar (Small) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 8px env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--hs-white);
  box-shadow: var(--hs-shadow-navigation-bottom);
}
.tabbar__item {
  flex: 1;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: 700 11px/1.2 var(--hs-font-sans);
  color: var(--app-muted);
  cursor: pointer;
}
.tabbar__item.is-active { color: var(--app-fg); }
.tabbar__icon { width: 22px; height: 22px; }
.tabbar__icon svg,
.tabbar__icon img { width: 22px; height: 22px; display: block; }
@media (min-width: 768px) {
  .tabbar { display: none; }
}

/* ---------- shared content bits ---------- */
.page-title {
  margin: 8px 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.empty-copy {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--hs-color-foreground-weak);
  max-width: 36ch;
}
.section { margin-top: 28px; }
/* Figma spacing: Recents → Essentials 32px, Essentials → carousels 48px, between carousels 24px */
.view--today .app-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.view--today .section { margin-top: 0; }
.view--today .seg { margin-bottom: 8px; }
.view--today .section--essentials { margin-bottom: 24px; }
@media (min-width: 1440px) {
  /* Carousels bleed past the 657px column to the viewport edge, as in Figma */
  .view--today .tile-row {
    width: calc(100vw - var(--gc-x));
    max-width: none;
  }
}
.section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 0 16px;
}
.section--essentials .section__title {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding-bottom: 16px;
}
.section--essentials .checklist { margin-top: 4px; }
.section__title {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--app-fg);
}
.section__header .section__title,
.section--essentials .section__title {
  margin: 0;
}
.section__title--lg {
  font-size: 24px;
  letter-spacing: -0.72px;
}
.section__title--md {
  font-size: 18px;
  letter-spacing: -0.54px;
}
.section__chevron {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--app-cream);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
/* The exported Figma glyph points left; the instance in Figma is mirrored to point right */
.section__chevron img {
  width: 6.35px;
  height: 10.71px;
  display: block;
  transform: scaleX(-1);
}

.seg {
  display: inline-flex;
  gap: 10px;
  margin: 0;
}
.seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--hs-border-radius-pill);
  background: var(--app-cream);
  color: var(--app-fg);
  font: 700 16px/1.2 var(--hs-font-sans);
  letter-spacing: -0.03em;
  cursor: pointer;
}
.seg__btn svg,
.seg__btn img { width: 16px; height: 16px; display: block; flex: none; object-fit: contain; }
.seg__btn.is-active {
  background: var(--app-cream);
  color: var(--app-fg);
}
.seg__btn:focus-visible { outline: 2px solid var(--app-blue); outline-offset: 2px; }

/* ---------- Today: essentials checklist (Figma "Checklist Accordion" 3559:65625) ---------- */
/*
 * One open step (180px media card) and collapsed steps (48px rows). Every card
 * holds both layouts stacked on top of each other; .is-open crossfades between
 * them while the height animates — the CSS version of Figma's Smart Animate.
 */
.checklist {
  --checklist-ease: cubic-bezier(0.6, 0, 0.4, 1); /* Figma custom bezier */
  --checklist-dur: 0.3s;
  /*
   * Labels never overlap: outgoing content fades out in the first 0.1s, and
   * incoming content waits until the card is mostly resized (0.15s) before
   * fading in, so everything still finishes within the 0.3s height change.
   */
  --checklist-fade-out: opacity 0.1s ease-out;
  --checklist-fade-in: opacity 0.15s ease-in 0.15s;
  --checklist-cream: #f9f4f2;
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.checklist__item {
  position: relative;
  display: flex;
  gap: 8px;
}

/* Timeline rail: dashes above and below a status dot, centered on the card */
.checklist__rail {
  width: 16px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Figma dashes: 4px round-capped strokes, 6 on / 12 off */
.checklist__dash {
  flex: 1 1 0;
  width: 4px;
  min-height: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='18'%3E%3Crect width='4' height='10' rx='2' fill='%23E2DED9'/%3E%3C/svg%3E") repeat-y;
  background-origin: content-box;
  background-clip: content-box;
}
.checklist__dash--up { padding-bottom: 4px; background-position: 0 100%; }
.checklist__dash--down { padding-top: 4px; background-position: 0 0; }
/* The line runs from the first dot to the last, with one dash bridging each 12px gap */
.checklist__item:first-child .checklist__dash--up,
.checklist__item:last-child .checklist__dash--down { visibility: hidden; }
.checklist__item + .checklist__item::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 6px;
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: #e2ded9;
}
.checklist__dot {
  width: 16px;
  height: 16px;
  flex: none;
  box-sizing: border-box;
  border: 2px solid #e2ded9;
  border-radius: 50%;
  background: var(--hs-white, #fff);
  transition: background-color var(--checklist-dur) var(--checklist-ease),
              border-color var(--checklist-dur) var(--checklist-ease),
              transform var(--checklist-dur) var(--checklist-ease);
}
/* Active dot is 20px in Figma; scaling keeps the 16px layout slot */
.checklist__item.is-open .checklist__dot {
  background: #ff7300;
  border-color: #fc5500;
  transform: scale(1.25);
}

/* Card. Registering the colour lets the fill animate between yellow and cream */
@property --checklist-bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #f9f4f2;
}
.checklist__card {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  --checklist-bg: var(--checklist-cream);
  background: var(--checklist-bg);
  transition: height var(--checklist-dur) var(--checklist-ease),
              --checklist-bg var(--checklist-dur) var(--checklist-ease);
}
.checklist__item.is-open .checklist__card {
  height: 180px;
  --checklist-bg: var(--card-open-bg, var(--checklist-cream));
}

/* Collapsed row: "Title • meta", pinned to the top of the card */
.checklist__summary {
  position: absolute;
  inset: 0 0 auto;
  height: 48px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border: 0;
  background: none;
  font: 400 14px/21px var(--hs-font-sans);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--checklist-fade-in);
}
.checklist__name,
.checklist__sep { color: #44423f; }
.checklist__meta { color: #63605d; overflow: hidden; text-overflow: ellipsis; }
.checklist__item.is-open .checklist__summary { opacity: 0; pointer-events: none; transition: var(--checklist-fade-out); }
.checklist__summary:focus-visible,
.checklist__detail:focus-visible { outline: none; }
/* The ring goes on the card, since its layers are clipped to its rounded corners */
.checklist__card:has(:focus-visible) { outline: 2px solid var(--app-blue); outline-offset: 2px; }

/* Open card: details left, art right. Always 180px tall and centered, so
   it's revealed from the middle as the card grows */
.checklist__detail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 180px;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: #2d2c2b;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: var(--checklist-fade-out);
}
.checklist__item.is-open .checklist__detail { opacity: 1; pointer-events: auto; transition: var(--checklist-fade-in); }
.checklist__details {
  position: relative;
  z-index: 2;
  flex: 1 1 0;
  min-width: 0;
  margin-right: -41px; /* Figma: details and art overlap by 41px */
  padding: 16px 0 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.checklist__heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.checklist__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 21.6px;
  letter-spacing: -0.54px;
}
.checklist__meta-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 18px;
}
.checklist__type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.checklist__type img { width: 16px; height: 16px; flex: none; display: block; }
/* The play glyph is 10×12 inside a 16px icon frame */
.checklist__type .checklist__icon--play { width: 10px; height: 12px; margin: 2px 3px; }
/* The art fades out toward its left edge (Figma's gradient overlay, as a mask), so
   it blends into whatever colour the card is — with no seam at fractional pixels */
.checklist__thumb {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to left, #000 36%, rgba(0, 0, 0, 0.2) 76.08%, transparent 100%);
  mask-image: linear-gradient(to left, #000 36%, rgba(0, 0, 0, 0.2) 76.08%, transparent 100%);
}
/* Art pinned to the card's right edge; it scales up rather than leaving a gap */
.checklist__thumb img,
.checklist__thumb video {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: auto;
  min-width: 100%;
  max-width: none;
  object-fit: cover;
  object-position: right center;
  display: block;
  pointer-events: none;
}
.checklist__overflow {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--checklist-fade-out);
}
.checklist__overflow img { display: block; width: 12px; height: 3px; }
.checklist__item.is-open .checklist__overflow { opacity: 1; transition: var(--checklist-fade-in); }

@media (prefers-reduced-motion: reduce) {
  .checklist * { transition-duration: 1ms !important; }
}

.avatar-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 1px 6px 1px 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}
.avatar-counter__stack {
  display: inline-flex;
  align-items: center;
}
.avatar-counter__stack img {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  margin-left: -4px;
  box-shadow: 0 0 0 1px #fff;
}
.avatar-counter__stack img:first-child { margin-left: 0; }
.avatar-counter__count {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.36px;
  color: #2d2c2b;
}

/* ---------- Today: content tile rows ---------- */
.tile-row {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  scrollbar-width: none;
}
.tile-row::-webkit-scrollbar { display: none; }
.content-tile {
  flex: none;
  width: 204px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
  border-radius: 16px;
  background: var(--app-cream);
  overflow: hidden;
}
.content-tile__media {
  aspect-ratio: 155.5 / 104;
  width: 100%;
  overflow: hidden;
}
.content-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.content-tile__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 60px;
  padding: 0 12px;
}
.content-tile__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.48px;
  color: var(--app-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hs-color-foreground-weak, #44423f);
}
.content-tile__type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.content-tile__type img { width: 16px; height: 16px; flex: none; }
.content-tile__sep { flex: none; }

/* Explore — LargeX */
.explore-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
@media (min-width: 768px) {
  .explore-stack { gap: 48px; }
}
.view--explore .section { margin-top: 0; }
.section--explore .section__title { margin: 0 0 16px; }
.section__intro { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.section__intro .section__title { margin: 0; }
.section__subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--hs-color-foreground-weak, #44423f);
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.mode-btn {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: var(--app-cream);
  font: 700 18px/1.2 var(--hs-font-sans);
  letter-spacing: -0.54px;
  color: var(--app-fg);
  cursor: pointer;
  min-width: 0;
}
.mode-btn img { width: 24px; height: 24px; flex: none; }
.mode-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-entry {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 180px;
  height: auto;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--app-fg);
  background: var(--app-cream);
}
@media (min-width: 768px) {
  .featured-entry { height: 240px; }
}
.featured-entry__copy {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 16px 8px 16px 20px;
}
@media (min-width: 768px) {
  .featured-entry__copy { padding-left: 32px; }
}
.featured-entry__copy strong {
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.72px;
}
.featured-entry__copy span {
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1.5;
  color: var(--app-fg);
}
.featured-entry__art {
  flex: none;
  width: min(200px, 42%);
  height: auto;
  min-height: 160px;
  max-height: 240px;
  object-fit: contain;
  object-position: bottom right;
  align-self: flex-end;
}
@media (min-width: 768px) {
  .featured-entry__art {
    height: 100%;
    width: auto;
    max-width: 46%;
    min-height: 0;
  }
}

.gp-row {
  display: flex;
  gap: 16px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gp-row::-webkit-scrollbar { display: none; }
.gp-card {
  flex: 1 1 0;
  min-width: 220px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 16px;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--hs-white);
  overflow: hidden;
  position: relative;
}
.gp-card--cbt {
  background: linear-gradient(to top, #ff52a5 0%, #ff7300 82.834%);
}
.gp-card--sleep {
  background: linear-gradient(to top, #0057ee 0%, #0040ea 26.302%, #0000db 100%);
}
.gp-card--stress {
  background: linear-gradient(to bottom, #0b662a 0%, #02873e 100%);
}
.gp-card__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 16px 16px 0;
  z-index: 1;
}
.gp-card__text strong {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.54px;
  color: var(--hs-white);
}
.gp-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hs-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-card__meta img {
  width: 16px;
  height: 16px;
  flex: none;
  filter: brightness(0) invert(1);
}
.gp-card__thumb {
  position: relative;
  width: 96px;
  height: 96px;
  flex: none;
  overflow: visible;
  align-self: flex-end;
}
.gp-card__thumb > img:only-child,
.gp-card--cbt .gp-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom right;
}
.gp-card__thumb--sleep .gp-card__frame {
  position: absolute;
  bottom: -14px;
  right: -14px;
  width: 93px;
  height: 93px;
}
.gp-card__thumb--sleep .gp-card__teacher {
  position: absolute;
  bottom: -8px;
  right: -6px;
  width: 78px;
  height: 78px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  z-index: 1;
}
.gp-card__thumb--sleep .gp-card__star {
  position: absolute;
  bottom: 10px;
  right: 83px;
  width: 13px;
  height: 13px;
  z-index: 2;
}
.gp-card__thumb--sleep .gp-card__dot {
  position: absolute;
  bottom: 7px;
  right: 79px;
  width: 3px;
  height: 3px;
  z-index: 2;
}
.gp-card__thumb--stress .gp-card__circle {
  position: absolute;
  bottom: -14px;
  right: -14px;
  width: 93px;
  height: 93px;
  border-radius: 50%;
  object-fit: cover;
}
.gp-card__thumb--stress .gp-card__overlay {
  position: absolute;
  bottom: -3px;
  right: -1px;
  width: 98px;
  height: 103px;
  object-fit: cover;
}
@media (min-width: 768px) {
  .gp-row { overflow: visible; }
  .gp-card { min-width: 0; }
}

.collection-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.collection-entry {
  display: flex;
  align-items: stretch;
  min-height: 96px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--app-cream);
}
.collection-entry__copy {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 13px 7px 13px 20px;
}
.collection-entry__copy strong {
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: -0.48px;
  color: var(--app-fg);
}
.collection-entry__copy span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--hs-color-foreground-weak, #44423f);
}
.collection-entry__art {
  flex: none;
  width: 95px;
  height: 95px;
  object-fit: contain;
  object-position: bottom right;
  align-self: flex-end;
}

.btn--tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border: 0;
  border-radius: var(--hs-border-radius-pill, 999px);
  background: transparent;
  color: var(--app-fg);
  font: 700 16px/1.2 var(--hs-font-sans);
  letter-spacing: -0.48px;
  cursor: pointer;
}
.btn--tertiary:hover { background: var(--app-cream); }
/* Figma "Button" Tertiary · M-Large (48) · full width, icon after (1870:188124) */
.btn--view-all {
  gap: 4px;
  padding: 0 24px;
  background: var(--hs-white);
  box-shadow: inset 0 0 0 2px var(--hs-color-border, #e2ded9);
}
.btn--view-all:active:not(:disabled) { box-shadow: inset 0 0 0 2px var(--hs-color-border, #e2ded9); }
.btn--view-all img {
  flex: none;
  display: block;
  width: 20px;
  height: 20px;
  aspect-ratio: 1;
  object-fit: contain;
}

.sidenav__icon--explore {
  position: relative;
  width: 24px;
  height: 24px;
}
.sidenav__icon--explore .sidenav__icon-active { display: none; }
.sidenav__item.is-active .sidenav__icon--explore .sidenav__icon-default { display: none; }
.sidenav__item.is-active .sidenav__icon--explore .sidenav__icon-active { display: block; }

/* ==========================================================================
   MEDITATE — Explore › Meditate mode (Figma "Explore / Modes" 1735:114694)
   Two layouts:
   · Compact (< 1024): small tonal cards, recents as a list, collections in 1 column
   · Wide (≥ 1024): 180px tonal cards, recents as a 3-up grid, collections in 2 columns
   Column width per Figma frame: 393 → full · 768 → 414 · 1023 → 573 · 1024 → 610 ·
   1280 → 782 · 1440+ → 888 (widths in between interpolate linearly).
   ========================================================================== */
@media (min-width: 768px) {
  .screen--app:has(.view--meditate:not([hidden])) .app-top { background: var(--hs-orange-100, #ffa500); }
  /* Content starts 32px below the search bar */
  .view--meditate { margin-top: calc(32px - var(--grid-pt)); }
}

.med-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (max-width: 767px) {
  .med-col { padding-inline: 8px; } /* 16px grid gutter + 8px = Figma's 24px */
}
@media (min-width: 1024px) { .med-col { gap: 48px; } }

/* Section rhythm: compact 24 · 24 · 32 · 32 · 32 — wide 48 · 48 · 48 · 32 · 48 */
.med-section--today,
.med-section--essentials,
.med-section--collections { margin-top: 8px; }
@media (min-width: 1024px) {
  .med-section--today,
  .med-section--collections { margin-top: 0; }
  .med-section--essentials { margin-top: -16px; }
}

.med-top { display: flex; align-items: center; gap: 15px; }
.med-back {
  display: flex;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.med-back img { display: block; }
.med-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3.162px;
  width: 127px;
  height: 44px;
  padding: 12.647px;
  border-radius: 12.647px;
  background: var(--app-cream);
  font: 700 14.23px/1.2 var(--hs-font-sans);
  letter-spacing: -0.4269px;
  color: var(--app-fg);
  white-space: nowrap;
}
.med-mode img { width: 18.971px; height: 18.971px; flex: none; display: block; }

.med-section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.med-section--recents { gap: 12px; }
@media (min-width: 1024px) { .med-section--featured { gap: 24px; } }
@media (min-width: 1440px) { .med-section--recents { gap: 16px; } }
.med-title {
  margin: 0;
  font: 700 18px/1.2 var(--hs-font-sans);
  letter-spacing: -0.54px;
  color: var(--app-fg);
}

/* Badge (Figma "Badge", Default on surface) — Medium below 1024, Large above */
.med-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--hs-white);
  color: var(--hs-blue-200, #0061ef);
  font: 700 12px/14.4px var(--hs-font-sans);
  letter-spacing: -0.36px;
  white-space: nowrap;
}
@media (min-width: 1024px) {
  .med-badge { font-size: 14px; line-height: 1.2; letter-spacing: -0.42px; }
}

.med-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 400 14px/1.5 var(--hs-font-sans);
  color: var(--hs-color-foreground-weak, #44423f);
  white-space: nowrap;
}
.med-type img { width: 16px; height: 16px; flex: none; display: block; }

/* Drop-down chips (static here) */
.med-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 2px 12px;
  border-radius: 72px;
  background: var(--hs-white);
  font: 700 12px/1.2 var(--hs-font-sans);
  letter-spacing: -0.36px;
  color: var(--app-fg);
  white-space: nowrap;
}
.med-chip--teacher { padding-left: 2px; }
.med-chip .t-avatar { width: 24px; height: 24px; }

/* ---------- Tonal card (Featured + Today's Meditation) ---------- */
.tonal-card {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 16px;
  background: var(--app-cream);
  cursor: pointer;
}
/* Compact: the square image matches the card's height (set by app.js as --tonal-thumb) */
.tonal-card__image {
  position: relative;
  flex: none;
  /* Fallback is the one-line card height, so titles get the room to fit on one line first */
  width: var(--tonal-thumb, 108px);
  overflow: hidden;
}
.tonal-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tonal-card__content {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "details play"
    "actions actions";
  align-content: center;
  column-gap: 4px;
  row-gap: 12px;
  padding: 12px;
}
.tonal-card__details {
  grid-area: details;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.tonal-card__title {
  width: 100%;
  margin: 0;
  font: 700 18px/1.2 var(--hs-font-sans);
  letter-spacing: -0.54px;
  color: var(--app-fg);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.tonal-card__play {
  grid-area: play;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}
.tonal-card__play:hover { background: var(--primary-hover); }
.tonal-card__play img { display: block; }
.tonal-card__play-lg { display: none !important; }
.tonal-card__actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  min-width: 0;
}
.tonal-card__overflow {
  display: flex;
  margin-left: auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.tonal-card__overflow img { display: block; }
@media (min-width: 1024px) {
  .tonal-card { height: 180px; border-radius: 24px; }
  .tonal-card__image { width: 180px; }
  .tonal-card__content {
    grid-template-areas:
      "details play"
      "actions play";
    column-gap: 12px;
    padding: 16px 24px;
  }
  .tonal-card__title { font-size: 24px; letter-spacing: -0.72px; }
  .tonal-card__play { align-self: center; width: 56px; height: 56px; }
  .tonal-card__play-lg { display: block !important; }
  .tonal-card__play-sm { display: none !important; }
  .tonal-card__overflow { display: none; }
}

/* ---------- Recents / Recommended ---------- */
.med-tabs { display: flex; align-items: flex-start; gap: 24px; }
.med-tab {
  padding: 0 0 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: 700 20px/1.2 var(--hs-font-sans);
  letter-spacing: -0.6px;
  color: var(--hs-warm-grey-500, #63605d);
  cursor: pointer;
  white-space: nowrap;
}
.med-tab.is-active { color: var(--app-fg); border-bottom-color: var(--app-fg); }
.med-tab:focus-visible { outline: 2px solid var(--app-blue); outline-offset: 2px; }
@media (min-width: 1024px) {
  .med-tab { font-size: 24px; letter-spacing: -0.72px; }
}

/* Compact: 56px list rows · Wide: 3-up "Open Cards" */
.open-cards { display: flex; flex-direction: column; gap: 12px; }
.open-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 56px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.open-card__image {
  position: relative;
  flex: none;
  width: 84px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
}
.open-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.open-card__badge { display: none; }
.open-card__details {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.open-card__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 16px/1.2 var(--hs-font-sans);
  letter-spacing: -0.48px;
  color: var(--app-fg);
}
.open-card__meta { font-size: 12px; line-height: 18px; }
.open-card__chevron { flex: none; width: 24px; height: 24px; display: block; }
@media (min-width: 1024px) {
  .open-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .open-card { flex-direction: column; align-items: stretch; gap: 12px; height: auto; }
  .open-card__image { width: 100%; height: auto; aspect-ratio: 327 / 218; border-radius: 12px; }
  .open-card__badge { display: inline-flex; position: absolute; top: 8px; left: 8px; }
  .open-card__title { font-size: 18px; letter-spacing: -0.54px; }
  .open-card__meta { font-size: 14px; line-height: 1.5; }
  .open-card__chevron { display: none; }
}

/* ---------- Headspace Essentials ---------- */
.ess-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 1024px) { .ess-row { gap: 24px; } }
.ess-tile {
  display: flex;
  flex-direction: column;
  height: 161px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--app-cream);
}
.ess-tile__title {
  flex: none;
  margin: 16px 16px 4px;
  font: 700 16px/1.2 var(--hs-font-sans);
  letter-spacing: -0.48px;
  color: var(--app-fg);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.ess-tile__art { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; }
.ess-tile__img {
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
  max-width: none;
  object-fit: cover;
}
/* Images ignore top + bottom stretching, so heights are explicit (Figma insets from the bottom-right) */
.ess-tile__img--beginning { width: 116px; height: 106px; }
.ess-tile__img--popular { height: 94.17%; aspect-ratio: 116 / 106; }

/* ---------- Explore Meditation (Entry / Collection) ---------- */
.med-collections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.med-entry--large-only { display: none !important; }
@media (min-width: 1024px) {
  .med-collections { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .med-entry--large-only { display: flex !important; }
}
.med-entry {
  display: flex;
  align-items: flex-end;
  height: 116px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--app-cream);
}
.med-entry__copy {
  flex: 1 1 0;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 16px 8px 16px 24px;
}
.med-entry__copy strong,
.med-entry__copy span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.med-entry__copy strong {
  font: 700 16px/1.2 var(--hs-font-sans);
  letter-spacing: -0.48px;
  color: var(--app-fg);
}
.med-entry__copy span {
  font: 400 14px/1.5 var(--hs-font-sans);
  color: var(--hs-color-foreground-weak, #44423f);
}
.med-entry__art {
  position: relative;
  flex: none;
  width: 116px;
  height: 116px;
  overflow: hidden;
  border-bottom-right-radius: 11px;
}
.med-entry__img {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 88.33%;
  aspect-ratio: 116 / 106;
  max-width: none;
  object-fit: cover;
}
.med-entry__img--quick { height: 100%; aspect-ratio: 116 / 120; }
.med-entry__img--anxiety {
  top: -3.45%;
  left: 0;
  width: 100%;
  height: 103.45%;
  aspect-ratio: auto;
}
.black-joy {
  position: absolute;
  top: 14.17%;
  right: -0.21px;
  bottom: 0;
  aspect-ratio: 116 / 103;
  overflow: hidden;
}
.black-joy__v,
.black-joy__v > span { position: absolute; display: block; }
.black-joy__v img { display: block; width: 100%; height: 100%; max-width: none; }

/* ==========================================================================
   FAVORITES (Figma 2935:48883)
   The cream header runs edge to edge (from the side nav to the right edge),
   so the view cancels the grid's top/left padding. The title and the list share
   one column centered on the viewport. Column width per Figma frame:
   393 → 345 · 768 → 500 · 1023 → 691 · 1024 → 447 · 1280 → 580 · 1440+ → 660
   (widths in between interpolate linearly).
   ========================================================================== */
.app-grid:has(.view--favorites:not([hidden])) {
  justify-content: flex-start;
  overflow-x: visible; /* .screen--app still clips, so the page never scrolls sideways */
}
.view--favorites {
  --fav-nav-w: 0px;
  --fav-w: calc(100vw - 48px);
  flex: none;
  width: calc(100vw - var(--fav-nav-w));
  margin: calc(-1 * var(--grid-pt)) 0 0 calc(-1 * var(--grid-pl));
}
/* Card stack spans 6 grid columns, centered: Medium cols 2–7, Large+ cols 4–9 */
@media (min-width: 768px) {
  .view--favorites { --fav-nav-w: var(--sidenav-w); --fav-w: calc(6 * var(--gc-col) + 5 * var(--gc-g)); }
}

.fav-col {
  width: var(--fav-w);
  margin-left: calc((100vw - var(--fav-w)) / 2 - var(--fav-nav-w));
}

/* Illustrated Header / Collection */
.fav-header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 24px 0 48px;
  background: var(--app-cream);
  overflow: hidden;
}
.fav-header__title {
  margin: 0;
  font: 700 24px/28.8px var(--hs-font-sans);
  letter-spacing: -0.72px;
  color: var(--app-fg);
  text-align: center;
}
/* White curve along the bottom edge (Figma "bottom mask", flipped) */
.fav-header__mask {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 24px;
  transform: rotate(180deg);
  pointer-events: none;
}
@media (min-width: 768px) {
  .fav-header { height: 200px; padding: 0; }
  .fav-header__title {
    max-width: min(100%, 500px);
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.96px;
    text-align: left;
  }
}

/* Favorited content rows ("Open / Open Cards") */
.fav-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) { .fav-list { margin-top: 32px; } }
.fav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 56px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--app-fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.fav-item:focus { outline: none; }
.fav-item:focus-visible { outline: 2px solid var(--app-blue); outline-offset: 4px; border-radius: 8px; }
.fav-item__thumb {
  flex: none;
  width: 84px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}
.fav-item__text {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.fav-item__title {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.fav-item__title img { flex: none; display: block; }
.fav-item__title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 16px/19.2px var(--hs-font-sans);
  letter-spacing: -0.48px;
}
.fav-item__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 400 12px/18px var(--hs-font-sans);
  color: var(--hs-color-foreground-weak, #44423f);
  white-space: nowrap;
}
.fav-item__meta img { flex: none; display: block; }
.fav-item__chevron { flex: none; display: block; width: 24px; height: 24px; }

/* Program overview — LargeX */
.program-stack {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-bottom: 88px;
}
.program-hero {
  position: relative;
  border-radius: 24px;
  padding: 16px 16px 28px;
  color: var(--hs-white);
  background: linear-gradient(to bottom, #0b662a 0%, #02873e 100%);
  overflow: hidden;
  min-height: 281px;
}
.program-hero__bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
}
.program-hero__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px 0;
  text-align: center;
}
.program-hero__tag {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: var(--hs-border-radius-pill, 999px);
  background: rgba(255, 255, 255, 0.18);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hs-white);
}
.program-hero h1 {
  margin: 0;
  width: 100%;
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.2;
  color: var(--hs-white);
  letter-spacing: -1.2px;
}
.program-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hs-white);
}
.program-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.program-hero__meta-item img { width: 16px; height: 16px; flex: none; }
.program-hero__dot { opacity: 0.9; }
.program-hero__teacher {
  position: relative;
  width: 72px;
  height: 72px;
  margin-top: 0;
}
.program-hero__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #ff7300;
  display: block;
}
.program-hero__play {
  position: absolute;
  right: -16px;
  top: 40px;
  width: 32px;
  height: 32px;
}
.program-hero__art {
  position: absolute;
  bottom: 0;
  width: 160px;
  height: 140px;
  object-fit: cover;
  pointer-events: none;
  z-index: 1;
}
.program-hero__art--left { left: 0; }
.program-hero__art--right { right: 0; }

.icon-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: var(--hs-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.icon-btn svg,
.icon-btn img { width: 24px; height: 24px; display: block; }
.icon-btn--ghost {
  background: transparent;
  box-shadow: none;
}
.icon-btn--ghost:hover { background: var(--icon-btn-hover); }
.icon-btn--ghost img { filter: brightness(0) invert(1); }
.icon-btn--ghost .icon-btn__overflow {
  width: 18px;
  height: 4px;
  object-fit: contain;
}
.icon-btn__back { transform: rotate(180deg); }
.icon-btn--on-dark { background: rgba(255, 255, 255, 0.18); color: var(--hs-white); }
.icon-btn:not(.icon-btn--on-dark):not(.icon-btn--ghost) {
  background: var(--hs-white);
  color: var(--app-fg);
  box-shadow: var(--hs-shadow-navigation-bottom);
}

.program-desc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  color: var(--hs-color-foreground-weak, #44423f);
}
.program-desc h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.48px;
}
.program-desc p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}
.accordion__item {
  background: var(--app-cream);
  border-radius: 16px;
  overflow: hidden;
}
.accordion__item.is-open {
  box-shadow: none;
}
.accordion__head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.accordion__titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.accordion__eyebrow {
  font-size: 14px;
  line-height: 1.5;
  color: var(--hs-color-foreground-weak, #44423f);
}
.accordion__head strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.54px;
  margin: 0;
  color: var(--app-fg);
}
.accordion__head em {
  display: block;
  font-style: normal;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hs-color-foreground-weak, #44423f);
  margin-top: 4px;
}
.accordion__caret {
  width: 24px;
  height: 24px;
  flex: none;
  margin-top: 2px;
  background: url("assets/program/icons/caret-down.svg") center / 24px 24px no-repeat;
}
.accordion__item.is-open .accordion__caret {
  background-image: url("assets/program/icons/caret-up.svg");
}
.accordion__body {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px 24px;
}
.accordion__item.is-open .accordion__body { display: flex; }

.session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--hs-white);
  padding: 16px 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.session-row--static { cursor: default; }
.session-row--muted { color: var(--hs-warm-grey-500, #63605d); }
.session-row__status { width: 20px; height: 20px; flex: none; }
.session-row__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.session-row__eyebrow {
  font-size: 12px;
  line-height: 1.5;
  color: var(--hs-color-foreground-weak, #44423f);
}
.session-row--muted .session-row__eyebrow { color: inherit; }
.session-row__copy strong {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.48px;
  color: var(--app-fg);
}
.session-row--muted .session-row__copy strong { color: inherit; }
.session-row__caret { width: 24px; height: 24px; flex: none; }

/* Button tray pinned to the viewport bottom (above the tab bar on Small,
   beside the side nav on Medium+). The view gets matching bottom padding
   so the last session row can scroll clear of the tray. */
.program-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 16px var(--app-gutter);
  background: var(--hs-white);
  box-shadow: 0 -2px 4px rgba(20, 19, 19, 0.08);
  display: flex;
  justify-content: center;
  z-index: 4;
}
.program-cta .btn {
  width: 100%;
  max-width: 500px;
}
.view--program { padding-bottom: 96px; }
@media (min-width: 768px) {
  .program-cta {
    left: var(--sidenav-w);
    bottom: 0;
  }
}

/* ==========================================================================
   SESSION DETAILS (Figma 2428:118224 + breakpoints)
   Single centered column inside the same .app-col as the Program overview:
   Small: full width (24px inset) · Medium 414 · Large 531 · LargeX 774
   ========================================================================== */
.session-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  margin: 0 auto;
  padding: 0 8px; /* 16px app gutter + 8px = Figma's 24px inset on Small */
}

/* Illustrated header */
.session-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  /* Small: full-bleed under the top bar */
  margin: -16px -24px 0;
  height: 160px;
  padding: 32px 0 0;
  background: linear-gradient(to bottom, #0b662a, #02873e);
  text-align: center;
}
.session-hero__badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--hs-border-radius-pill, 999px);
  background: rgba(255, 255, 255, 0.2);
  color: var(--hs-white);
  font: 700 14px/1.2 var(--hs-font-sans);
  letter-spacing: -0.42px;
  white-space: nowrap;
}
.session-hero__title {
  position: relative;
  z-index: 2;
  margin: 0;
  width: 100%;
  color: var(--hs-white);
  font: 700 24px/28.8px var(--hs-font-sans);
  letter-spacing: -0.72px;
}
.session-hero__art {
  position: absolute;
  bottom: 0;
  width: 96px;
  height: 84px;
  object-fit: cover;
  pointer-events: none;
  z-index: 1;
}
.session-hero__art--left { left: 0; }
.session-hero__art--right { right: 0; }
.session-hero__mask {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 24px;
  transform: rotate(180deg);
  z-index: 3;
  pointer-events: none;
}

/* "Part 1 • Session 1" + title */
.session-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  text-align: center;
}
.session-heading__tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--hs-border-radius-pill, 999px);
  background: var(--app-cream);
  color: var(--app-fg);
  font: 700 14px/1.2 var(--hs-font-sans);
  letter-spacing: -0.42px;
  white-space: nowrap;
}
.session-heading__title {
  margin: 0;
  width: 100%;
  color: var(--app-fg);
  font: 700 24px/28.8px var(--hs-font-sans);
  letter-spacing: -0.72px;
}

/* Activities list */
.session-activities {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Deep Breathing — Small: "Tonal / XL <768" vertical card */
.session-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
}
.session-card__image {
  position: relative;
  height: 200px;
  overflow: hidden;
  flex: none;
}
.session-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.session-card__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: var(--app-cream);
}
.session-card__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.session-card__type {
  display: flex;
  align-items: center;
  gap: 4px;
  font: 400 12px/18px var(--hs-font-sans);
  color: var(--app-fg);
}
.session-card__type img { width: 16px; height: 16px; flex: none; display: block; }
.session-card__title {
  order: -1; /* Small shows the title above the content type */
  margin: 0;
  color: var(--app-fg);
  font: 700 24px/28.8px var(--hs-font-sans);
  letter-spacing: -0.72px;
}
.session-card__desc {
  margin: 0;
  font: 400 14px/21px var(--hs-font-sans);
  color: var(--hs-color-foreground-weak, #44423f);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.session-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 36px;
}
.session-card__overflow {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.session-card__overflow img { display: block; width: 24px; height: 24px; }
.session-card__play {
  position: absolute;
  top: 172px; /* centered on the image's bottom edge */
  right: 24px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--shadow-default);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.session-card__play:hover { background: var(--primary-hover); }
.session-card__play img {
  width: 11.82px;
  height: 14.87px;
  margin-left: 2px;
  display: block;
}

/* Duration chips */
.session-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 2px 12px;
  border-radius: 72px;
  background: var(--hs-white);
  color: var(--app-fg);
  font: 700 12px/1.2 var(--hs-font-sans);
  letter-spacing: -0.36px;
  white-space: nowrap;
}
.session-chip--l {
  height: 36px;
  padding: 4px 16px;
  border-radius: var(--hs-border-radius-pill, 999px);
}

/* Dashed connector between activities */
.session-connector {
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.session-connector img {
  width: 16px;
  height: 4px;
  transform: rotate(90deg);
  display: block;
}

/* Up next (locked) activity */
.session-next { position: relative; }
.session-tonal {
  display: flex;
  border-radius: 16px;
  overflow: hidden;
  opacity: 0.4;
}
.session-tonal__image {
  position: relative;
  width: 96px;
  flex: none;
}
.session-tonal__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.session-tonal__content {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: var(--app-cream);
}
.session-tonal__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.session-tonal__details strong {
  font: 700 14px/1.2 var(--hs-font-sans);
  letter-spacing: -0.42px;
  color: var(--app-fg);
}
.session-tonal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
}
.session-tonal__actions img { width: 24px; height: 24px; display: block; }
.session-next__badge {
  position: absolute;
  top: -12px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 2px 8px;
  border-radius: 80px;
  background: #050726;
  color: #e5e7ec;
  font: 700 14px/1.2 var(--hs-font-sans);
  letter-spacing: -0.42px;
  white-space: nowrap;
}

/* Medium ≥768: rounded header card, horizontal "Session Card/Contained" */
@media (min-width: 768px) {
  .session-stack {
    padding: 0;
    gap: 40px;
  }
  .session-hero {
    margin: 0;
    height: auto;
    padding: 58px 0;
    border-radius: 24px;
  }
  .session-hero__title {
    font-size: 32px;
    line-height: 38.4px;
    letter-spacing: -0.96px;
  }
  .session-hero__art {
    width: 160px;
    height: 140px;
  }
  .session-hero__mask { display: none; }

  .session-card { flex-direction: row; }
  .session-card__image {
    width: 160px;
    height: auto;
    align-self: stretch;
  }
  .session-card__image img {
    /* Figma crops the thumbnail with -7.14% top / -4.08% bottom overflow */
    inset: auto;
    top: -7.14%;
    left: 0;
    height: 111.22%;
  }
  .session-card__content {
    flex: 1 1 0;
    min-width: 0;
  }
  .session-card__title {
    order: 0;
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: -0.54px;
  }
  .session-card__play {
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
}

/* Large ≥1024 */
@media (min-width: 1024px) {
  .session-hero__title {
    font-size: 40px;
    line-height: 48px;
    letter-spacing: -1.2px;
  }
  .session-heading__title {
    font-size: 32px;
    line-height: 38.4px;
    letter-spacing: -0.96px;
  }
}
/* ==========================================================================
   PLAYER (Figma 2064:136692 + breakpoints)
   Full bleed on every breakpoint, layered above the side nav, search bar
   and tab bar. Content column: Small 345 (24px inset) · Medium 500 ·
   Large ~610 · LargeX 888.
   ========================================================================== */
.view--player {
  position: fixed;
  inset: 0;
  z-index: 100;
  animation: none;
}
.view--player[hidden] { display: none !important; }
/* Freeze the page behind the player */
body:has(.view--player:not([hidden])) { overflow: hidden; }

.player {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--app-fg);
  background: #ffce00;
}
.player__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Top toolbar — close button only */
.player__toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 56px;
}
.player__close {
  position: absolute;
  top: 8px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--hs-duration-fast, 150ms);
}
.player__close:hover { background: var(--icon-btn-hover); }
.player__close img { width: 16px; height: 16px; display: block; }

/* Player UI column: header top, play centered, scrubber bottom */
.player__ui {
  position: relative;
  z-index: 1;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: calc(56px + 24px) 24px calc(24px + env(safe-area-inset-bottom, 0px));
}
.player__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}
.player__titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}
.player__eyebrow {
  margin: 0;
  font: 400 16px/1.5 var(--hs-font-sans);
  color: var(--hs-color-foreground-weak, #44423f);
}
.player__title {
  margin: 0;
  max-width: 100%;
  font: 700 32px/1.2 var(--hs-font-sans);
  letter-spacing: -0.96px;
  color: #2d2c2b;
}

/* Teacher + duration drop-down chips */
.player__chips {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.player__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 2px 8px 2px 16px;
  border: 0;
  border-radius: 72px;
  background: rgba(255, 255, 255, 0.6);
  color: #2d2c2b;
  font: 700 16px/1.2 var(--hs-font-sans);
  letter-spacing: -0.48px;
  white-space: nowrap;
  cursor: pointer;
}
.player__chip--teacher {
  /* Figma width is 110px for "Andy"; grows for longer names like Kessonga */
  min-width: 110px;
  justify-content: center;
  padding-left: 2px;
  gap: 4px;
}
.player__chip--teacher .t-avatar {
  width: 36px;
  height: 36px;
  margin-right: 4px; /* avatar → label is 8px */
}
.player__chip:focus { outline: none; }
.player__chip:focus-visible { box-shadow: 0 0 0 2px #0061ef; }
.player__caret {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform var(--hs-duration-fast, 150ms);
}
.player__chip[aria-expanded="true"] .player__caret { transform: rotate(180deg); }

/* Teacher avatar: circle crop of the Figma headshot.
   Each teacher has its own crop (Figma image inset), set through custom properties. */
.t-avatar {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: #e2ded9;
}
.t-avatar img {
  position: absolute;
  top: var(--crop-top);
  left: var(--crop-left);
  width: var(--crop-w);
  height: var(--crop-h);
  max-width: none;
  object-fit: cover;
}
.t-avatar--andy     { --crop-top: 6.11%;   --crop-left: -65.28%; --crop-w: 209.45%; --crop-h: 227.41%; }
.t-avatar--dora     { --crop-top: -5.28%;  --crop-left: -7.78%;  --crop-w: 109.26%; --crop-h: 162.13%; }
.t-avatar--eve      { --crop-top: -22.59%; --crop-left: -16.39%; --crop-w: 119.54%; --crop-h: 179.26%; }
.t-avatar--kessonga { --crop-top: -6.11%;  --crop-left: 11.11%;  --crop-w: 88.89%;  --crop-h: 132.78%; }

/* Drop-down menu (Figma "Dropdown menu / Detailed menu") */
.player__chips { position: relative; }
.dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  width: min(432px, calc(100vw - 48px));
  padding: 8px;
  border-radius: 16px;
  background: var(--hs-white, #fff);
  box-shadow: 0 0 12px rgba(20, 19, 19, 0.2);
  text-align: left;
}
.dd-menu[hidden] { display: none; }
.dd-menu--compact { width: min(240px, calc(100vw - 48px)); }
.dd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #2d2c2b;
  font-family: var(--hs-font-sans);
  text-align: left;
  cursor: pointer;
}
.dd-item:hover { background: #f9f4f2; }
.dd-item:focus { outline: none; }
.dd-item:focus-visible { border-color: #0061ef; }
.dd-item:disabled { opacity: 0.5; cursor: default; }
.dd-item:disabled:hover { background: transparent; }
.dd-item__text {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.dd-item__text strong {
  font: 700 18px/21.6px var(--hs-font-sans);
  letter-spacing: -0.54px;
  color: #2d2c2b;
}
.dd-item__text span {
  font: 400 14px/21px var(--hs-font-sans);
  color: #44423f;
}
.dd-item__check {
  display: flex;
  align-items: center;
  flex: none;
  width: 24px;
  align-self: stretch;
  visibility: hidden;
}
.dd-item__check img { display: block; width: 24px; height: 24px; }
.dd-item.is-selected .dd-item__check { visibility: visible; }

/* Play dot */
.player__play {
  width: 96px;
  height: 96px;
  padding: 0;
  border: 0;
  background: none;
  flex: none;
  cursor: pointer;
}
.player__play img { width: 96px; height: 96px; display: block; }

/* Caption, scrubber, bottom controls */
.player__scrubber-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}
.player__caption {
  display: none; /* Small has no caption */
  margin: 0;
  max-height: 96px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(20, 19, 19, 0.4);
  color: var(--hs-white);
  font: 500 18px/1.2 var(--hs-font-sans);
  letter-spacing: -0.54px;
  text-align: center;
}
.player__scrubber {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.player__track {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
}
.player__track::before {
  content: "";
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 19, 19, 0.4);
}
.player__progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 105px;
  height: 16px;
}
.player__times {
  display: flex;
  justify-content: space-between;
  font: 400 14px/1.5 var(--hs-font-sans);
  color: #2d2c2b;
}
.player__controls {
  display: flex;
  align-items: center;
  gap: 40px;
}
.player__controls button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.player__controls .player__control--l { width: 32px; height: 32px; }
.player__controls img { display: block; width: 100%; height: 100%; }

/* Medium ≥768 */
@media (min-width: 768px) {
  .player__close { right: 40px; }
  .player__ui {
    max-width: 500px;
    padding: calc(56px + 120px) 0 48px; /* Medium stacks the 56px toolbar above the 120px top padding */
  }
  .player__caption { display: block; }
  .player__controls { gap: 64px; }
}

/* Large ≥1024 */
@media (min-width: 1024px) {
  .player__ui {
    max-width: 610px;
    padding-top: 120px;
  }
}

/* LargeX ≥1440 */
@media (min-width: 1440px) {
  .player__toolbar { height: 64px; }
  .player__close { top: 12px; }
  .player__ui { max-width: 888px; }
}

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
}
