html {
  --phone-height: min(100dvh, 852px);
  container-type: inline-size;
  max-width: 393px;
  margin-inline: auto;
  overflow: hidden;
  background: #eef0ef;
}

html > body {
  height: var(--phone-height);
  min-height: 0;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

html:has(.site-mobile-menu[open]) > body {
  overflow: hidden;
}

#dashboard-header {
  position: sticky;
  top: 0;
  z-index: 6;
  padding-top: env(safe-area-inset-top);
  box-shadow: none;
}

/* The mobile dashboard follows the calendar’s white lists and date bands. */
main:has(> :is(#dashboard, #past-view):not([hidden])),
main:has(> .phone-store) {
  width: 100%;
  padding-top: 0;
}

:is(#dashboard, #past-view) {
  --list-ink: #10243c;
  --list-muted: #6b7783;
  --list-line: #e9edf0;
  --list-date: #f3f5f7;
  gap: 0;
  color: var(--list-ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

#dashboard :is(.event-column, .account-column) { gap: 0; }
#dashboard :is(.event-column > .panel, #profile-panel, #teams-panel, #account-panel),
#past-view {
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--list-line);
  border-radius: 0;
  padding: 16px;
}

#dashboard :is(.event-column > .panel > h2, #teams-heading, #account-title),
#past-view > :is(h1, h2, summary) {
  font-size: 1.25rem;
  line-height: 1.25;
}
#dashboard #events-title,
#past-view > h2 { margin: 0 0 .75rem; }

#dashboard #events-title,
#past-view > h2,
#dashboard.teams-page #teams-heading,
body:not(.court-mode) #schedule-title:has(> .schedule-heading),
body.standalone-rental #schedule-title:has(> .rental-heading),
.phone-store > h1 {
  font: 700 1.25rem/1.25 "Space Grotesk", system-ui, sans-serif;
  letter-spacing: -.035em;
}
body:is(:not(.court-mode), .standalone-rental) .phone .page-title > .title {
  padding: 16px 16px .75rem;
}
body:not(.court-mode) .phone .page-title .book-court {
  display: none;
}

#teams-panel { scroll-margin-top: calc(4.5rem + 1px + env(safe-area-inset-top)); }
#dashboard #past-teams-toggle[aria-expanded="false"] { margin-top: 0; }

#dashboard .panel:has(> #events-title) { padding-bottom: 0; }
#dashboard .dashboard-schedule-link {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--list-line);
  margin-inline: -16px;
  min-height: 2rem;
  padding: .25rem 16px;
  color: var(--list-ink);
  font-size: .8rem;
  text-decoration: none;
}
#dashboard .dashboard-schedule-link:is(:hover, :focus-visible) > span { text-decoration: underline; }
#dashboard .dashboard-schedule-link:focus-visible { outline-offset: -3px; }

:is(#dashboard :is(#events, #my-teams, #past-teams), #past-events) { margin-inline: -16px; }
#dashboard .schedule-day .events { margin-top: 0; }
#dashboard .schedule-day > h3 {
  position: static;
  margin: 0;
  padding: 10px 16px;
  background: var(--list-date);
  font: 700 .98rem/1.25 "Space Grotesk", system-ui, sans-serif;
}
:is(#dashboard, #past-view) .events { gap: 0; }
:is(#dashboard, #past-view) .events > .event {
  --event-title: #1d6b4f;
  --event-meta: var(--list-muted);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  border-top: 1px solid #f2f4f6;
}
:is(#dashboard, #past-view) .events > [data-category="adultDropIns"] { --event-title: #5a3a92; }
:is(#dashboard, #past-view) .events > [data-category="teenDropIns"] { --event-title: #a12e2e; }
:is(#dashboard, #past-view) .events > [data-category="youthClasses"] { --event-title: #9a5a14; }
:is(#dashboard, #past-view) .events > [data-category="leagues"] { --event-title: #7a6408; }
:is(#dashboard, #past-view) .events > [data-category="volleyRoyale"] { --event-title: #235f72; }
:is(#dashboard, #past-view) .events > [data-category="availableRentals"] { --event-title: #2c6db5; }
:is(#dashboard, #past-view) .events > .event h3 { padding-inline-end: 0; white-space: normal; font: 600 .98rem/1.25 "Space Grotesk", system-ui, sans-serif; }
#past-events:not(:empty) { border-bottom: 1px solid #f2f4f6; }
#past-events > .event {
  align-items: center;
  border-top: 0;
  box-shadow: inset 0 1px #f2f4f6;
}
#past-events .event-video-button {
  inset-block: 0;
  inset-inline-end: 1.1225rem;
  margin-block: auto;
}
#past-events .event-video-button {
  width: 3.305rem;
  height: 2rem;
}
#past-events .event-video-icon {
  width: 1.96308rem;
  height: 1.29276rem;
}
#past-events .event-video-icon {
  background: #4a4a4a;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'%3E%3Crect x='0' y='1' width='11' height='9' rx='2'/%3E%3Cpath d='M11.5 4.2 16 1.5v8l-4.5-2.7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#past-events .event.has-video > div { padding-inline-end: 3.75rem; }
:is(#dashboard, #past-view) .events .event p { margin-top: 3px; font-size: .8rem; line-height: 1.25; }
#dashboard .events > .event:has(> .schedule-times) {
  grid-template: "time details action" / min(74px, 20%) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
#dashboard .event > .schedule-times {
  grid-area: time;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-content: start;
  min-height: 0;
  padding: 0;
  gap: 3px;
  background: transparent;
}
#dashboard .event > .schedule-times + div { grid-area: details; display: block; min-height: 0; }
#dashboard .event:has(> .schedule-times) > :is(.book-link, .cancel-event, .cancel-unavailable) { grid-area: action; }
#dashboard .schedule-times .schedule-start { font-size: .9rem; font-weight: 600; line-height: 1.25; text-transform: lowercase; }
#dashboard .schedule-times .schedule-start small { font-size: inherit; }
#dashboard .schedule-times:has(.schedule-duration) .schedule-end { display: none; }
#dashboard .schedule-duration { display: block; color: var(--list-muted); font-size: .78rem; line-height: 1.25; white-space: nowrap; }
#dashboard .event .book-link { min-height: 2.5rem; padding-inline: .8rem; font-size: .88rem; }
#dashboard .events .event-roster-link { color: var(--list-muted); font-size: inherit; font-weight: 500; }
#dashboard #events .event-roster-link { min-height: 0; }
#dashboard .event .desktop-roster-label { display: inline; }
#dashboard .event .mobile-roster-count { display: none; }
#dashboard #events .upcoming-event-card {
  position: relative;
  grid-template-columns: min(74px, 22%) minmax(0, 1fr) auto;
}
.upcoming-event-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.upcoming-event-card > :is(.cancel-event, .cancel-unavailable) {
  position: relative;
  z-index: 2;
}
.upcoming-event-open:focus-visible { outline-offset: -3px; }


html:has(.phone-bottom-nav:not([hidden])) {
  --bottom-nav-height: calc(60px + env(safe-area-inset-bottom, 0px));
}
body:has(> .phone-bottom-nav:not([hidden]))::after {
  content: "";
  display: block;
  height: var(--bottom-nav-height);
}
.phone-bottom-nav {
  position: fixed;
  z-index: 7;
  inset: var(--phone-height) 0 auto;
  width: min(100%, 393px);
  margin-inline: auto;
  transform: translateY(-100%);
  box-sizing: border-box;
  height: var(--bottom-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #dce5e1;
  background: #fff;
  font: 600 .75rem/1.15 "Space Grotesk", system-ui, sans-serif;
}
.phone-bottom-nav a {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  color: #52655e;
  text-decoration: none;
}
.phone-bottom-nav a[aria-current="page"] {
  background: #f5f5f5;
  color: #35413c;
}
@media (hover: hover) {
  .phone-bottom-nav a:hover {
    background: #f5f5f5;
    color: #35413c;
  }
}
.phone-bottom-nav a:focus-visible { outline-offset: -4px; }
.phone-bottom-nav svg { width: 23px; height: 23px; }
body:has(.site-mobile-menu[open]) > .phone-bottom-nav { visibility: hidden; }

#dashboard.teams-page > :not(#teams-panel) { display: none; }
#dashboard.teams-page:not([hidden]) { display: block; }

.site-header .site-header-inner {
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 2px;
}
.site-header .site-header-inner > .site-mobile-menu { grid-area: 1 / 1; }
.site-header .site-header-inner > .site-logo { grid-area: 1 / 2; }
.site-header .site-header-inner > .site-account { grid-area: 1 / 3; }
.site-header .site-account-avatar img { transform: scale(1.12); }
.site-header .site-header-inner > .site-logo img {
  width: auto;
  height: 32px;
}

.phone-account-preview {
  position: absolute;
  z-index: 2;
  top: 100%;
  right: 1rem;
  width: min(19rem, calc(100% - 2rem));
  box-sizing: border-box;
  padding: .9rem;
  border: 1px solid #dce5e1;
  border-radius: .65rem;
  background: #fff;
  color: #172523;
  box-shadow: 0 4px 14px #17252320;
  font: .85rem/1.4 system-ui, sans-serif;
}
.phone-account-preview dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .7rem 1rem;
  margin: 0;
}
.phone-account-preview dt { font-weight: 600; }
.phone-account-preview dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.site-header:has(.site-mobile-menu[open]) .phone-account-preview { display: none; }

.phone-account-preview > #profile-panel {
  margin: 0 0 .75rem;
  padding: 0 0 .75rem;
  border: 0;
  border-bottom: 1px solid #dce5e1;
  border-radius: 0;
  box-shadow: none;
}

.phone-account-preview .profile-details { padding-top: 3px; }
.phone-account-preview .profile-name { font-size: 1.3rem; }
.phone-account-preview .saved-card-selector.profile-switcher select {
  font-size: min(1.3rem, calc((100cqi - 2.15rem) * var(--name-fit, 100)));
}
.phone-account-preview .profile-actions {
  flex-wrap: wrap;
  gap: .25rem .85rem;
  margin-top: .3rem;
}
.phone-account-preview .profile-actions .text-button {
  min-height: 1.75rem;
}

#dashboard.overview-page > :is(#teams-panel, #account-panel) { display: none; }
#dashboard.billing-page > :not(#account-panel) { display: none !important; }
#dashboard.billing-page:not([hidden]) { display: block; }

#dashboard.store-page { display: none; }
.phone-store { padding: 1rem; color: #10243c; }
.phone-store > h1,
#dashboard.teams-page #teams-heading {
  margin: 0 -1rem;
  padding: 0 1rem .75rem;
  border-bottom: 1px solid #e9edf0;
}
.phone-store > h1 { margin-bottom: 1.25rem; }
#dashboard.teams-page #teams-heading { margin-bottom: .75rem; }
.phone-store h2 { margin: 1.25rem 0 .5rem; font-size: 1.2rem; }
.phone-store h3 { margin: 0; font-size: 1rem; }
.phone-store p, .phone-store details { margin: 0; font-size: .875rem; }
#shop-class-passes { anchor-name: --class-passes-section; }
.shop-info-trigger {
  anchor-name: --class-passes-info;
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-inline-start: .25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #205f4d;
  font: 600 .6875rem/1 system-ui, sans-serif;
  vertical-align: middle;
  cursor: pointer;
}
.shop-info-trigger > span {
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid #a9bbb3;
  border-radius: 50%;
}
.phone-store .shop-info-popup {
  inset: auto;
  top: var(--class-passes-top);
  left: var(--class-passes-left);
  width: min(20rem, var(--class-passes-width));
  box-sizing: border-box;
  margin: 0;
  padding: 1rem;
  border: 1px solid #dce5e1;
  border-radius: .65rem;
  background: #fff;
  color: #10243c;
  box-shadow: 0 4px 14px #17252330;
}
@supports (top: anchor(bottom)) {
  .phone-store .shop-info-popup {
    position-anchor: --class-passes-info;
    top: calc(anchor(bottom) + .35rem);
    left: anchor(--class-passes-section left);
    width: min(20rem, anchor-size(--class-passes-section width));
    position-try-fallbacks: flip-block;
  }
}
.phone-store article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .35rem .75rem;
  padding-block: .75rem;
  border-top: 1px solid #e9edf0;
}
.phone-store article p { grid-row: 2; }
.phone-store article :is(button, .shop-buy-link) {
  grid-area: 1 / 2 / 3 / 3;
  align-self: center;
  min-height: 40px;
  padding: 0 1rem;
  border: 1px solid #f0bd19;
  border-radius: .5rem;
  background: #ffd333;
  color: #10243c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.phone-store .shop-buy-link {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  text-decoration: none;
}
.phone-store details { grid-column: 1 / -1; }
.phone-store summary { cursor: pointer; color: #205f4d; }
.phone-store ul { padding-inline-start: 1.25rem; }

#dashboard .schedule-times .schedule-start,
#past-events > .event > time {
  color: #111;
}

.site-mobile-links > .site-mobile-account-heading {
  margin: 1.75rem 0 0;
  color: #52655e;
  font: 600 .85rem/1.25 "Space Grotesk", system-ui, sans-serif;
}

.phone-linked-profile:not([hidden]) {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .75rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #dce5e1;
}
.phone-linked-profile-photo {
  display: grid;
  flex: none;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  overflow: hidden;
  border: 1px solid #dce5e1;
  border-radius: 50%;
  color: #205f4d;
  text-decoration: none;
}
.phone-linked-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.phone-linked-profile .profile-name { margin: 0; font-weight: 700; }
.phone-linked-profile .profile-actions { display: flex; align-items: center; }
.phone-linked-profile .profile-actions :is(a, button) {
  padding: 0;
  border: 0;
  background: transparent;
  color: #205f4d;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.phone-linked-profile .profile-actions :is(a, button):hover { text-decoration: underline; }

.site-header .phone-account-add {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  min-height: 1.5rem;
  margin-inline-start: -.125rem;
  color: #455e56;
  font: 500 .8125rem/1.5 "Space Grotesk", system-ui, sans-serif;
  text-decoration: none;
}
.site-header .phone-account-add:is(:hover, :focus-visible) { text-decoration: underline; }
.phone-store > section { scroll-margin-top: 5rem; }

#dashboard #event-status:not([hidden]) { margin-bottom: .75rem; }

.phone-linked-profile-switcher {
  max-width: 100%;
  margin-inline-start: -.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: 700 1.15rem/1.25 "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
}
.phone-linked-profile-photo > * { grid-area: 1 / 1; }
.phone-linked-profile-photo img[hidden] { display: none; }


.site-mobile-links > .site-mobile-social {
  margin-top: auto;
  padding-top: 1rem;
}

#past-teams-heading { margin: 1rem 0 .5rem; font-size: 1.25rem; line-height: 1.25; }

body:not(.court-mode) header.top:has(#days:empty) { display: none; }

/* Bottom tab bar as a floating pill (like modern iOS apps): inset from the edges, fully rounded,
   frosted see-through background with a soft shadow, and the current tab in its own soft highlight. */
html:has(.phone-bottom-nav:not([hidden])) {
  --bottom-nav-height: calc(86px + env(safe-area-inset-bottom, 0px));
}
.phone-bottom-nav {
  width: min(calc(100% - 24px), 369px);
  height: 62px;
  padding: 5px;
  transform: translateY(calc(-100% - 12px - env(safe-area-inset-bottom, 0px)));
  border: 1px solid rgb(255 255 255 / .75);
  border-radius: 26px;
  background: rgb(255 255 255 / .72);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 8px 28px rgb(16 36 60 / .16), 0 1px 3px rgb(16 36 60 / .1);
  font: 600 .75rem/1.1 "Space Grotesk", system-ui, sans-serif;
}
.phone-bottom-nav a {
  gap: 3px;
  border-radius: 21px;
  color: #3f4a52;
  transition: background .15s, color .15s;
}
.phone-bottom-nav a[aria-current="page"] {
  background: rgb(16 36 60 / .08);
  color: #10243c;
  font-weight: 700;
}
@media (hover: hover) {
  .phone-bottom-nav a:hover { background: rgb(16 36 60 / .06); color: #10243c; }
}
.phone-bottom-nav svg { width: 22px; height: 22px; }

/* On a real phone (touch screen) fill the whole screen, whatever its size; the 393 x 852 frame is only for desktop previews. */
@media (hover: none) and (pointer: coarse) {
  html { --phone-height: 100dvh; max-width: none; }
  .phone-bottom-nav { width: calc(100% - 24px); }
}

/* The tab bar is only for signed-in people (site-menu.js hides it otherwise). */
.phone-bottom-nav[hidden] { display: none !important; }
