/* The phone app: signed in, no top bar and no tab bar, just a floating menu button bottom right; and a home screen that is one swipeable workout hero.
   Everything here is inside the phone breakpoint; the desktop keeps the sidebar and the power-user layouts. */
.m-menu-btn, .m-hero { display: none; }

@media (max-width: 899px) {
  :root { --m-tab-h: 76px; }

  /* a guest's top bar: a large title on the left, the sign-in button on the right; nothing else */
  .wb-top { height: auto; min-height: 64px; padding: calc(var(--space-lg) + env(safe-area-inset-top)) var(--space-md) var(--space-xs); border-bottom: 0; background: var(--color-paper); }
  .wb-logo, .wb-search { display: none; }
  .wb-crumb { display: block; padding: 0; border: 0; color: var(--color-ink); font-size: 2rem; font-weight: 700; letter-spacing: 0; line-height: 1.1; }
  .wb-top-right { gap: var(--space-sm); }
  .wb-top .wb-icon-btn, .wb-top .wb-pill { border-radius: 50%; height: 40px; width: 40px; padding: 0; justify-content: center; background: var(--color-paper-2); border-color: transparent; }
  .wb-top .wb-pill { width: auto; padding: 0 var(--space-sm); border-radius: 20px; }
  .wb-top .wb-avatar { width: 40px; height: 40px; }
  .wb-top .wb-avatar .nf-avatar { width: 40px; height: 40px; }

  /* signed in: the full menu holds the logo, avatar, achievements and calendar, so the top bar goes and pages start at the top of the screen */
  body.has-mnav .wb-top { display: none; }
  body.has-mnav .wb-main, body.has-mnav .wb-main.page-wrap { padding-top: calc(env(safe-area-inset-top) + var(--space-2xl)); } /* room above the title, clear of the status bar and its shading (Home's hero overrides this below) */
  body.has-mnav .wb-main, body.has-mnav .wb-main.page-wrap { padding-bottom: var(--space-lg); } /* the footer below does the clearing of the menu button */
  body.has-mnav .wb-shell .ach-bg { top: 0; }

  /* the floating menu button */
  .m-menu-btn { display: grid; place-items: center; position: fixed; z-index: 80; right: var(--space-sm); bottom: calc(var(--space-xs) + env(safe-area-inset-bottom)); width: 64px; height: 64px; padding: 0; border-radius: 50%; color: var(--color-ink); cursor: pointer; }
  .m-menu-btn .icon { width: 26px; height: 26px; stroke-width: 1.6; }
  .m-menu-btn .wb-dot { top: 2px; right: 2px; }
  body.wb:has(.mnav-sheet.is-open) .m-menu-btn { display: none; }
  .wb-main, .wb-main.page-wrap { padding-bottom: calc(var(--m-tab-h) + var(--space-xl) + env(safe-area-inset-bottom)); } /* the last thing on a page clears the floating menu button (the more specific .page-wrap rule used to win) */

  /* home: the hero carousel runs edge to edge from the top of the screen */
  body:has(.m-hero) .wb-main, body.has-mnav:has(.m-hero) .wb-main.page-wrap { padding-top: 0; padding-inline: 0; }
  .wb-home { padding: 0; }
  .wb-home-head, .wb-next, .wb-focus-modal { display: none; }
  
  .wb-home .wb-block { padding-inline: var(--space-md); }
  .wb-home .wb-block-head { padding: 0; }

  .m-hero { display: block; position: relative; margin: 0 0 var(--space-md); }
  .m-hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
  .m-hero-track::-webkit-scrollbar { display: none; }
  .m-slide { position: relative; flex: 0 0 100%; min-height: min(78svh, 640px); scroll-snap-align: start; display: flex; align-items: flex-end; overflow: hidden; background: var(--color-paper-3) var(--art, none) center / cover no-repeat; color: var(--dk-ink); }
  .m-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--k-000000) 58%, transparent) 0, transparent 24%, transparent 42%, color-mix(in srgb, var(--k-000000) 88%, transparent) 100%); pointer-events: none; }
  .m-slide-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .m-slide-body { position: relative; z-index: 1; width: 100%; display: grid; justify-items: center; gap: var(--space-xs); padding: var(--space-lg) var(--space-md) calc(var(--space-xl) + var(--space-md)); text-align: center; }
  .m-slide-kicker { margin: 0; padding: var(--space-3xs) var(--space-sm); border: 1px solid color-mix(in srgb, var(--k-ffffff) 40%, transparent); border-radius: 4px; font-size: 0.8rem; font-weight: 600; }
  .m-slide h2 { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: 0; line-height: 1.1; text-wrap: balance; }
  .m-slide-meta { margin: 0; color: color-mix(in srgb, var(--k-ffffff) 78%, transparent); font-size: 0.95rem; }
  .m-slide-actions { margin-top: var(--space-xs); }
  .m-play { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-width: 180px; min-height: 52px; padding: 0 var(--space-lg); border-radius: 26px; background: var(--k-ffffff); color: var(--k-000000); font-size: 1.1rem; font-weight: 700; text-decoration: none; }
  .m-play .icon { width: 20px; height: 20px; fill: currentColor; }
  .m-play:hover, .m-play:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
  .m-dots { position: absolute; left: 0; right: 0; bottom: var(--space-md); display: flex; justify-content: center; gap: var(--space-xs); pointer-events: none; }
  .m-dots i { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--k-ffffff) 40%, transparent); }
  .m-dots i.is-on { background: var(--k-ffffff); width: 28px; border-radius: 4px; }

  /* rows of posters scroll sideways, like the Apple TV shelves */
  .wb-home .wb-grid, .wb-workouts .wb-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 68%; gap: var(--space-sm); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: calc(var(--space-md) * -1); padding-inline: var(--space-md); scroll-padding-inline: var(--space-md); }
  .wb-home .wb-grid::-webkit-scrollbar, .wb-workouts .wb-grid::-webkit-scrollbar { display: none; }
  .wb-home .wb-grid > *, .wb-workouts .wb-grid > * { scroll-snap-align: start; min-width: 0; }
  .wb-home .rail { margin-inline: calc(var(--space-md) * -1); padding-inline: var(--space-md); scroll-padding-inline: var(--space-md); }
  .wb-home .rail > .poster { flex: 0 0 68%; min-width: 0; }
  .m-dup { display: none; }

  /* Learn: each playlist is a shelf, its videos a row of posters */
  .course-list { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .course { border: 0; margin: 0 0 var(--space-lg); }
  .course-summary { display: block; padding: 0 0 var(--space-xs); cursor: default; }
  .course-thumb, .course-toggle, .course-subhead, .course-outcomes, .course-skills, .course-video-num, .course-video-desc { display: none; }
  .course-head { gap: var(--space-3xs); }
  .course-title { font-size: 1.15rem; font-weight: 600; letter-spacing: 0; text-decoration: none; }
  .course-meta { font-size: 0.85rem; }
  .course-body { padding: 0; max-width: none; }
  .course-intro { margin: 0 0 var(--space-xs); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .course-videos { display: grid; grid-auto-flow: column; grid-auto-columns: 68%; gap: var(--space-sm); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: calc(var(--space-md) * -1); padding-inline: var(--space-md); scroll-padding-inline: var(--space-md); }
  .course-videos::-webkit-scrollbar { display: none; }
  .course-videos > li { scroll-snap-align: start; min-width: 0; }
  .course-video { position: relative; display: grid; gap: var(--space-xs); padding: 0; background: transparent; border: 0; border-radius: 0; }
  .course-video-thumb { flex: none; width: 100%; border-radius: 8px; }
  .course-video-play { position: absolute; top: calc(50% - 40px); left: 50%; translate: -50% -50%; width: 44px; height: 44px; background: color-mix(in srgb, var(--k-000000) 45%, transparent); color: var(--k-ffffff); }
  .course-video-title { font-size: 0.95rem; font-weight: 500; }
  .course-footer { margin-top: var(--space-xs); }
  .m-hide { display: none; }
  .learn-actions { margin-bottom: var(--space-md); }

  /* a long title shrinks (and ends in an ellipsis) before it crowds the controls */
  .wb-crumb { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wb-top-right { flex: none; margin-left: var(--space-sm); }

  /* Progress: the badge, one flat row of numbers, a three-way switch */
  .ach-page .spirit-hero { width: min(180px, 52vw); }
  
  
  .ach-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: var(--space-sm) 0; }
  .ach-tab-btn { border-radius: 0; font-size: 0.9rem; white-space: nowrap; padding: var(--space-xs) var(--space-2xs); }
  .ach-tab-btn:first-child { border-radius: 6px 0 0 6px; }
  .ach-tab-btn:last-child { border-radius: 0 6px 6px 0; }
  .ach-tab-btn + .ach-tab-btn { margin-left: -1px; }

  /* Calendar and player profile: flat sections, the week as shelves */
  .wb-calendar .wb-page-head h1, .wb-calendar .wb-sub, .wb-calendar .wb-back { display: none; }
  .wb-calendar .wb-page-head { margin-bottom: var(--space-xs); justify-content: flex-start; }
  .wb-calendar .btn { padding-inline: 0; }
  .wb-calendar .wb-upnext { display: grid; grid-template-columns: 1fr; background: transparent; border: 0; border-radius: 0; padding: 0; gap: var(--space-sm); }
  .wb-calendar .wb-upnext-art { max-height: none; border-radius: 10px; }
  .wb-calendar .wb-upnext h2 { margin: 0; font-size: 1.5rem; }
  .wb-calendar .wb-calendar-streak, .wb-calendar .gameday, .wb-calendar .trainlevel, .profile-head ~ .panel { background: transparent; border: 0; border-top: 1px solid var(--color-rule); border-radius: 0; padding: var(--space-md) 0 0; margin: var(--space-md) 0 0; }
  .wb-calendar .wb-grid { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 68%; gap: var(--space-sm); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin-inline: calc(var(--space-md) * -1); padding-inline: var(--space-md); scroll-padding-inline: var(--space-md); }
  .wb-calendar .wb-grid::-webkit-scrollbar { display: none; }
  .wb-calendar .wb-grid > * { scroll-snap-align: start; min-width: 0; }
  .wb-calendar .wb-calendar-streak .streak-card { background: transparent; border: 0; border-radius: 0; padding: 0; }
  .wb-calendar .wb-block { margin-top: var(--space-lg); }
  .profile-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-xs) var(--space-sm); margin-bottom: var(--space-sm); }
  .profile-head .avatar-lg { width: 64px; height: 64px; }
  .profile-head-info h1 { display: none; }
  .profile-head-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-xs); }
  .profile-head-actions .btn-primary { padding-inline: 0; justify-content: flex-start; }
  .profile-head ~ .panel .panel-head { margin-bottom: var(--space-xs); }
  .activity-grid > * { background: transparent; border: 0; border-radius: 0; padding: 0; }

  /* Spirit, animals, boss: the badge up top, flat sections under thin rules */
  .back-link { display: none; }
  .spirit-page .spirit-kicker, .spirit-page .spirit-blurb { display: none; }
  .spirit-page .spirit-hero { width: min(180px, 52vw); margin-inline: auto; }
  .spirit-page .power-how { background: transparent; border: 0; border-top: 1px solid var(--color-rule); border-radius: 0; box-shadow: none; padding: var(--space-md) 0 0; margin: var(--space-md) 0 0; }
  .spirit-page .power-how h2 { font-size: 1.15rem; font-weight: 600; }
  .animal-grid { display: block; }
  .animal-card { background: transparent; border: 0; border-top: 1px solid var(--color-rule); border-radius: 0; box-shadow: none; padding: var(--space-md) 0 0; margin: var(--space-md) 0 0; }
  .animal-card .animal-blurb { display: none; }
  .animal-evo { display: grid; grid-auto-flow: column; grid-auto-columns: 30%; gap: var(--space-xs); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-md) * -1); padding-inline: var(--space-md); }
  .animal-evo::-webkit-scrollbar { display: none; }
  

  /* My players: a flat list; video and list-workout detail without cards */
  .player-grid { display: block; }
  .player-card { background: transparent; border: 0; border-top: 1px solid var(--color-rule); border-radius: 0; box-shadow: none; padding: var(--space-md) 0 0; margin: var(--space-md) 0 0; }
  .player-card-actions { display: flex; gap: var(--space-md); }
  .player-card-actions .btn { padding-inline: 0; border-color: transparent; background: transparent; }
  .page-header-row .header-actions { display: flex; flex-wrap: wrap; gap: var(--space-md); }
  .page-header-row .header-actions { justify-content: flex-start; }
  .page-header-row .header-actions .btn { padding-inline: 0; width: auto; justify-content: flex-start; }
  .video-detail-back { display: none; }
  .video-detail-media { border-radius: 10px; overflow: hidden; margin-inline: calc(var(--space-md) * -1); border-radius: 0; }
  .video-detail-body h1 { font-size: 1.5rem; }
  .list-workout-page .weight-panel, .list-workout-page .track-panel, .list-workout-page .list-log, .list-workout-page .list-chart { background: transparent; border: 0; border-top: 1px solid var(--color-rule); border-radius: 0; box-shadow: none; padding: var(--space-md) 0 0; margin: var(--space-md) 0 0; }

  /* the menu button is glass: clear, blurred, lit along its top edge */
  .m-menu-btn { background: color-mix(in oklab, var(--color-paper) 38%, transparent); -webkit-backdrop-filter: blur(28px) saturate(1.8) brightness(1.05); backdrop-filter: blur(28px) saturate(1.8) brightness(1.05); border: 1px solid color-mix(in oklab, var(--color-ink) 14%, transparent); box-shadow: inset 0 1px 0 color-mix(in oklab, white 35%, transparent), inset 0 -1px 0 color-mix(in oklab, white 8%, transparent), 0 10px 30px -8px rgb(0 0 0 / 0.35); }

  /* the Progress badge sits on a dark pixel scene in both modes */
  .ach-page .ach-about { color: oklch(82% 0.1 250); }

  /* touch targets: 44px for what you tap */
  .wb-icon-btn, .wb-pill, .wb-avatar { min-width: 44px; min-height: 44px; }
  .panel-link, .streak-more, .ach-about { display: inline-flex; align-items: center; min-height: 44px; }
  .btn-sm, .filter-pill, .ach-tab-btn, .poster-chip, .name-pill { min-height: 44px; }
  .poster-chip, .poster-heart, .icon-btn-round, .name-shuffle { min-width: 44px; min-height: 44px; }
  .btn, .account-page .btn, .account-page select, .account-page input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .wb-switch button, .wb-main input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .wb-main select, .streak-cta, .btn-link { min-height: 44px; }
  .wb-main a.more { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .m-hero-pause { position: absolute; right: var(--space-sm); bottom: calc(var(--space-md) - 14px); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--k-ffffff); cursor: pointer; }
  .m-hero-pause .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
  :focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
  .m-hero :focus-visible, .ach-page :focus-visible { outline-color: var(--k-ffffff); }
  .wb-main select { height: 44px; }
}
