.shell__rail,
.shell__crown,
.shell__zonetabs,
.shell__dock,
.shell__rail-overlay,
.shell__banner {

  --space-0-5: var(--shell-metric-space-0-5);
  --space-1: var(--shell-metric-space-1);
  --space-1-5: var(--shell-metric-space-1-5);
  --space-2: var(--shell-metric-space-2);
  --space-3: var(--shell-metric-space-3);
  --space-4: var(--shell-metric-space-4);
  --space-5: var(--shell-metric-space-5);
  --space-6: var(--shell-metric-space-6);
  --space-8: var(--shell-metric-space-8);
  --space-10: var(--shell-metric-space-10);
  --space-12: var(--shell-metric-space-12);
  --text-xs: var(--shell-metric-text-xs);
  --text-sm: var(--shell-metric-text-sm);
  --text-base: var(--shell-metric-text-base);
  --text-lg: var(--shell-metric-text-lg);
  --radius-sm: var(--shell-metric-radius-sm);
  --radius-md: var(--shell-metric-radius-md);
  --radius-lg: var(--shell-metric-radius-lg);
  --radius-xl: var(--shell-metric-radius-xl);

  line-height: var(--leading-normal);
}

.shell {

  --dock-safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-height: calc(var(--crown-height) + var(--dock-safe-bottom));
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  background-color: var(--surface-page);
  color: var(--text-primary);
}

.shell[data-framed="standalone-phone"],
:root[data-framed="standalone-phone"] .shell {
  --dock-safe-bottom: 34px;
}

.shell__rail {
  flex-shrink: 0;
  margin: 0;
  padding: env(safe-area-inset-top, 0px) 0 0;
  width: var(--rail-width);
  border-right: 1px solid var(--border-subtle);
  background-color: var(--surface-neutral);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  transition: width var(--duration-normal) var(--ease-out);
  display: none;
}
.shell--rail-collapsed .shell__rail {
  width: var(--rail-collapsed);
}

.shell__workspace {

  --chrome-top: calc(var(--crown-height) + env(safe-area-inset-top, 0px));
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
  background-color: var(--surface-page);

  scrollbar-width: none;
}
.shell__workspace::-webkit-scrollbar { display: none; }

.shell__crown {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  flex-shrink: 0;
  margin: 0;
  height: calc(var(--crown-height) + env(safe-area-inset-top, 0px));

  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 0;
  background-color: var(--surface-page-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: height var(--duration-normal) var(--ease-out);
}

@media (max-width: 1023px) {
  .shell.shell--shrunk .shell__crown {
    height: calc(var(--crown-height-collapsed) + env(safe-area-inset-top, 0px));
  }

  .shell.shell--shrunk .shell__crown {
    --railnav-mark-size: 20px;
    --crown-logo-height: 24px;
  }
  .shell.shell--shrunk .shell__crown .crown__title { font-size: var(--text-base); }
  .shell.shell--shrunk .shell__crown .brandplate__wordmark { font-size: var(--text-sm); }
  .shell.shell--shrunk .shell__crown .wayfinder,
  .shell.shell--shrunk .shell__crown .actionbar__btn { width: 32px; height: 32px; }
  .shell.shell--shrunk .shell__crown .wayfinder .material-symbols-rounded,
  .shell.shell--shrunk .shell__crown .actionbar__btn .material-symbols-rounded { font-size: 20px; }
  .shell.shell--shrunk .shell__crown .actionbar__avatar { width: 24px; height: 24px; }
  .shell.shell--shrunk .shell__workspace {
    --chrome-top: calc(var(--crown-height-collapsed) + env(safe-area-inset-top, 0px));
  }
}

.shell__zonetabs {
  position: sticky;
  top: calc(var(--crown-height) + env(safe-area-inset-top, 0px));
  z-index: var(--z-sticky);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: var(--space-1-5) var(--space-3);
  background-color: var(--surface-page-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: top var(--duration-normal) var(--ease-out);
}

@media (max-width: 1023px) {
  .shell.shell--shrunk .shell__zonetabs {
    top: calc(var(--crown-height-collapsed) + env(safe-area-inset-top, 0px));
  }
}
.shell__zonetabs .tabs--pills { max-width: 100%; overflow-x: auto; }

@media (max-width: 767px) {
  .shell__workspace[data-zone-tabs-active="z1"] .shell__stage .shell__zone:not(.shell__zone--z1),
  .shell__workspace[data-zone-tabs-active="z2"] .shell__stage .shell__zone:not(.shell__zone--z2),
  .shell__workspace[data-zone-tabs-active="z3"] .shell__stage .shell__zone:not(.shell__zone--z3),
  .shell__workspace[data-zone-tabs-active="z4"] .shell__stage .shell__zone:not(.shell__zone--z4) { display: none; }
}

.shell__stage {
  flex: 1 0 auto;
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: var(--content-pad);

  --content-pad: clamp(6px, 4vw - 9px, 32px);

  --banner-bleed: var(--content-pad);
  padding: var(--content-pad) var(--content-pad) calc(var(--content-pad) * 3);
}

.shell__stage--bleed,
.shell[data-shell-context="landing"] .shell__stage,
.shell[data-shell-context="nomination"] .shell__stage {
  padding: 0;
  --banner-bleed: 0px;
}

@media (max-width: 767px) {
  .shell__stage--bleed-phone {
    padding: 0 0 calc(var(--content-pad) * 3);
    --banner-bleed: 0px;
  }
  .shell__stage--bleed-phone .shell__zone--card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

.shell__dock {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  flex-shrink: 0;
  margin: 0;

  height: var(--dock-height);
  padding-top: 0;
  padding-bottom: var(--dock-safe-bottom);
  background-color: var(--surface-page-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  transition: height var(--duration-normal) var(--ease-out);
}
.shell[data-dock="shrink"].shell--shrunk .shell__dock {

  height: calc(var(--crown-height-collapsed) + var(--dock-safe-bottom));
}
@media (max-width: 767px) {
  .shell[data-dock="fixed"] .shell__dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
  }
  .shell[data-dock="fixed"] .shell__workspace {
    padding-bottom: var(--dock-height);
  }
  .shell:has(:is(textarea, input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], input[type="password"], input[type="number"], [contenteditable=""], [contenteditable="true"]):focus) .shell__dock {
    display: none;
  }
  .shell[data-dock="fixed"]:has(:is(textarea, input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], input[type="password"], input[type="number"], [contenteditable=""], [contenteditable="true"]):focus) .shell__workspace {
    padding-bottom: 0;
  }
}

.shell[data-dock-layout="zones"] .shell__dock {
  padding-top: var(--space-2);
}

.shell__dock-content {
  display: flex;
  align-items: stretch;
  height: 100%;
  width: 100%;
  max-width: var(--dock-content-max-width, none);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.shell__dock-content > * {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shell[data-dock-layout="zones"] .shell__dock-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}
.shell[data-dock-layout="zones"] .shell__dock-content > * {
  flex: unset;
  min-width: 0;
  display: flex;
  align-items: center;
}
.shell[data-dock-layout="zones"] .shell__dock-content > *:first-child {
  justify-content: flex-start;
}
.shell[data-dock-layout="zones"] .shell__dock-content > *:nth-child(2) {
  justify-content: center;
}
.shell[data-dock-layout="zones"] .shell__dock-content > *:last-child {
  justify-content: flex-end;
}

.shell__rail-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  margin: 0;
  padding: 0;
  border: none;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background-color: var(--surface-page);
  color: var(--text-primary);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: none;
}
.shell__rail-overlay::backdrop { background-color: transparent; }

.shell__rail:empty,
.shell__crown:empty,
.shell__dock:empty { display: none; }

@media (min-width: 1024px) {
  .shell__rail-overlay[open] { display: none; }
  .shell__rail { display: flex; flex-direction: column; }

  .shell__workspace {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }
  .shell__workspace::-webkit-scrollbar { display: block; width: 10px; }
  .shell__workspace::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
  }
}

@media (min-width: 768px) {

  .shell:not([data-shell-context="participation"]) .shell__dock { display: none; }

  @container workspace (min-width: 736px) {
    .shell__workspace:has(.shell__stage--rung-736) .shell__zonetabs { display: none; }
  }
  @container workspace (max-width: 735.98px) {
    .shell__workspace[data-zone-tabs-active="z1"] .shell__stage--rung-736 .shell__zone:not(.shell__zone--z1),
    .shell__workspace[data-zone-tabs-active="z2"] .shell__stage--rung-736 .shell__zone:not(.shell__zone--z2),
    .shell__workspace[data-zone-tabs-active="z3"] .shell__stage--rung-736 .shell__zone:not(.shell__zone--z3),
    .shell__workspace[data-zone-tabs-active="z4"] .shell__stage--rung-736 .shell__zone:not(.shell__zone--z4) { display: none; }
  }

  @container workspace (min-width: 904px) {
    .shell__workspace:has(.shell__stage--rung-904) .shell__zonetabs { display: none; }
  }
  @container workspace (max-width: 903.98px) {
    .shell__workspace[data-zone-tabs-active="z1"] .shell__stage--rung-904 .shell__zone:not(.shell__zone--z1),
    .shell__workspace[data-zone-tabs-active="z2"] .shell__stage--rung-904 .shell__zone:not(.shell__zone--z2),
    .shell__workspace[data-zone-tabs-active="z3"] .shell__stage--rung-904 .shell__zone:not(.shell__zone--z3),
    .shell__workspace[data-zone-tabs-active="z4"] .shell__stage--rung-904 .shell__zone:not(.shell__zone--z4) { display: none; }
  }

  @container workspace (min-width: 1088px) {
    .shell__workspace:has(.shell__stage--rung-1088) .shell__zonetabs { display: none; }
  }
  @container workspace (max-width: 1087.98px) {
    .shell__workspace[data-zone-tabs-active="z1"] .shell__stage--rung-1088 .shell__zone:not(.shell__zone--z1),
    .shell__workspace[data-zone-tabs-active="z2"] .shell__stage--rung-1088 .shell__zone:not(.shell__zone--z2),
    .shell__workspace[data-zone-tabs-active="z3"] .shell__stage--rung-1088 .shell__zone:not(.shell__zone--z3),
    .shell__workspace[data-zone-tabs-active="z4"] .shell__stage--rung-1088 .shell__zone:not(.shell__zone--z4) { display: none; }
  }
}

@media (max-width: 767px) {
  .shell__stage--bleed:has(.studio) ~ .shell__dock { display: none; }
}

.crown {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
  height: 100%;
  width: 100%;
  padding: 0 var(--space-3);
}
.crown__lead    { display: flex; align-items: center; gap: var(--space-2); min-width: 0; justify-self: start; }
.crown__marquee { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.crown__tail    { display: flex; align-items: center; gap: var(--space-1); justify-self: end; }

.shell[data-shell-context="participation"] .crown__marquee,
.shell[data-shell-context="coach"]         .crown__marquee { justify-self: center; }
.shell[data-shell-context="account"]       .crown__marquee { justify-self: start; }

.crown--centered { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.crown.crown--centered > .crown__marquee { justify-self: center; }

.brandplate {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.brandplate__mark {
  flex-shrink: 0;
  width: var(--railnav-mark-size);
  height: var(--railnav-mark-size);

  transition: width var(--duration-normal) var(--ease-out),
              height var(--duration-normal) var(--ease-out);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brandplate__mark img { width: 100%; height: 100%; object-fit: contain; }

.brandplate__mark--product { border-radius: var(--radius-full); background: var(--brand-600); }

.brandplate__mark--collapsed { display: none; }
.brandplate__logo {
  max-height: var(--crown-logo-height);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: max-height var(--duration-normal) var(--ease-out);
}
.brandplate__wordmark {
  font-family: var(--soul-font-display);
  font-size: var(--text-base);
  transition: font-size var(--duration-normal) var(--ease-out);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell__rail .brandplate {
  height: var(--crown-height);
  padding: 0 var(--space-4);
  flex-shrink: 0;
}

.shell__rail .brandplate--logo,
.brandplate--box {
  justify-content: center;
  height: auto;
  width: 100%;
}

.shell__rail .brandplate--logo {
  min-height: var(--crown-height);
  padding: var(--space-3) var(--space-4);
}
.shell__rail .brandplate--logo .brandplate__logo,
.brandplate--box .brandplate__logo {
  width: 100%;
  height: auto;
  max-height: clamp(var(--space-16), var(--brandplate-logo-vh-budget), var(--space-32));
}

.shell--rail-collapsed .shell__rail .brandplate {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.shell--rail-collapsed .shell__rail .brandplate__wordmark { display: none; }
.shell--rail-collapsed .shell__rail .brandplate__logo { display: none; }
.shell--rail-collapsed .shell__rail .brandplate__mark--collapsed { display: flex; }

.crown__title-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  vertical-align: middle;
}
.crown__title-icon {
  font-size: 1em;
  line-height: 1;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.crown__title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crown__title--brand-swap { display: none; }

.crown__brand-link {
  display: flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
}
.crown__brand-link:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
@media (min-width: 768px) {
  .shell[data-shell-context="coach"] .crown__marquee .crown__brand-link,
  .shell.shell--member-dashboard .crown__marquee .crown__brand-link,
  .shell[data-shell-context="coach"] .crown__marquee .brandplate,
  .shell.shell--member-dashboard .crown__marquee .brandplate { display: none; }
  .shell[data-shell-context="coach"] .crown__marquee .crown__title--brand-swap,
  .shell.shell--member-dashboard .crown__marquee .crown__title--brand-swap { display: block; }

  .shell[data-shell-context="coach"] .crown__marquee,
  .shell.shell--member-dashboard .crown__marquee { justify-self: start; }
  .shell[data-shell-context="coach"] .crown--centered > .crown__marquee,
  .shell.shell--member-dashboard .crown--centered > .crown__marquee { justify-self: center; }

  .shell[data-shell-context="coach"] .shell__rail-overlay[open],
  .shell.shell--member-dashboard .shell__rail-overlay[open] { display: none; }
}

.shell__rail-overlay .railnav {
  transform: none;
  width: 100%;
  height: 100%;
  box-shadow: none;
  border-right: none;
}

@media (max-width: 767px) {
  .shell__rail-overlay .railnav {
    transform: none;
    width: 100%;
    max-width: none;
    z-index: auto;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .shell__rail-overlay .railnav__list {
    flex: 1;
    padding: calc(var(--crown-height) + var(--space-2)) var(--space-4) var(--space-2);
  }

  .shell__rail-overlay .railnav__section {
    margin-bottom: var(--space-5);
  }

  .shell__rail-overlay .railnav__group {
    padding: var(--space-2) var(--space-1);
  }

  .shell__rail-overlay .railnav__session {
    padding: 0 var(--space-4);
  }

  .shell__rail-overlay .railnav__anchor {
    margin-top: auto;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  }
}
.wayfinder--close {
  position: absolute;
  top: calc(var(--space-3) + env(safe-area-inset-top, 0px));
  right: var(--space-3);
  z-index: 1;
}

.wayfinder,
.actionbar__btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              width var(--duration-normal) var(--ease-out),
              height var(--duration-normal) var(--ease-out);
}
.wayfinder:hover,
.actionbar__btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.wayfinder:focus-visible,
.actionbar__btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.wayfinder--close:focus,
.wayfinder--close:focus-visible { outline: none; }
.wayfinder .material-symbols-rounded,
.actionbar__btn .material-symbols-rounded { font-size: 24px; }

@media (min-width: 1024px) {
  .shell[data-shell-context="account"] .wayfinder--menu { display: none; }
}
@media (min-width: 768px) {
  .shell[data-shell-context="coach"] .wayfinder--menu,
  .shell.shell--member-dashboard .wayfinder--menu { display: none; }
}

.crown__title {
  font-family: var(--soul-font-display);
  font-size: var(--text-lg);
  transition: font-size var(--duration-normal) var(--ease-out);
  font-weight: var(--soul-display-weight);
  letter-spacing: var(--soul-display-tracking);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.actionbar { display: flex; align-items: center; gap: var(--space-1); }
.actionbar__avatar {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-out),
              height var(--duration-normal) var(--ease-out);
  background: var(--surface-selected);
  color: var(--accent-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  text-decoration: none;
}
.actionbar__avatar img { width: 100%; height: 100%; object-fit: cover; }
.actionbar__avatar svg { width: 100%; height: 100%; display: block; }

.actionbar__cta {
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: 36px; padding: 0 var(--space-3);
  border-radius: var(--soul-radius-button);
  border: none;
  background: var(--accent-primary);
  color: var(--text-on-accent);
  font-family: var(--soul-font-chrome);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}
.actionbar__cta .material-symbols-rounded { font-size: 18px; }

@media (max-width: 767px) {
  .shell__crown .notif-menu.dropdown__menu {
    position: fixed;
    left: var(--space-3);
    right: var(--space-3);
    width: auto;
    max-width: none;
    max-height: calc(100dvh - var(--chrome-top) - var(--dock-height) - var(--space-6));
  }
  .shell__crown .notif-menu__list { flex: 1 1 auto; min-height: 0; max-height: none; }
}

.docknav { display: flex; align-items: stretch; width: 100%; height: 100%; }
.docknav__tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--shell-metric-space-0-5);
  text-decoration: none;
  color: var(--text-tertiary);
  position: relative;
}
.docknav__tab .material-symbols-rounded { font-size: 24px; }
.docknav__label { font-size: var(--railnav-group-font-size); font-weight: 500; }
.docknav__tab--active { color: var(--accent-primary); }
.docknav__tab--active .material-symbols-rounded { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.docknav__tab--active::before {
  content: ""; position: absolute; top: 0; left: 34%; right: 34%;
  height: 2px; border-radius: var(--radius-full); background: var(--accent-primary);
}

.footernav { display: flex; align-items: center; width: 100%; height: 100%; padding: 0 var(--space-4); gap: var(--space-2); }
.footernav__back   { flex: 0 0 auto; }
.footernav__center { flex: 1; display: flex; justify-content: center; }
.footernav__end    { flex: 0 0 auto; }
