#carix-app {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  min-height: 0;
  background: #070707;
}

#carix-routes,
.carix-route-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #070707;
}

.carix-route-view > .carix-app-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.carix-route-view[hidden],
.carix-bottom-accessory-view[hidden] {
  display: none !important;
}

.carix-route-view--primary { z-index: auto; }
.carix-route-view--secondary { z-index: 175; }

#carix-bottom-frame { z-index: 150; }
#carix-bottom-frame.has-accessory { gap: 10px; }

#carix-bottom-accessory,
#carix-navbar { width: 100%; }

/* Every full-width header is sized against the app viewport, not its page's
   content column. This also keeps scroll headers flush during SPA dissolves. */
.main-home-first-time__header,
.main-home__header,
.main-stats__header,
.main-help__fixed-header,
.main-account__fixed-header,
.main-profile__fixed-header,
.main-referral__fixed-header,
.program-info__fixed-header,
.routine-day__fixed-header,
.program-progress__heading,
.program-progress__top-control,
.home-scroll-header {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

#carix-popup-layer { display: contents; }
#carix-popup-layer > [role="dialog"] { z-index: 200; }

.popup-dissolve-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
  align-items: end;
  overflow: visible;
}

.popup-dissolve-stage > * {
  position: absolute !important;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100% !important;
  max-width: none !important;
  align-self: end;
}

.carix-bottom-accessory-view:not([hidden]) { display: contents; }

/* Cards fill the overlay's usable phone width from their first rendered frame.
   Keeping the design cap here prevents the one-frame viewport-width flash on
   wide screens while still yielding 100% width on the intended phone canvas. */
:is(#carix-routes, #carix-popup-layer) :is(
  .main-home-popup-overlay,
  .main-stats-popup-overlay,
  .main-account-popup-overlay,
  .routine-day-popup-overlay,
  .program-progress-popup-overlay
) .popup-card,
:is(#carix-routes, #carix-popup-layer) .module-unlocked-overlay .module-unlocked-popup-card {
  width: 100% !important;
  max-width: none !important;
  height: fit-content !important;
  flex: 0 0 auto;
}

:is(#carix-routes, #carix-popup-layer) .main-home-first-time-popup-overlay :is(
  .app-onboarding-popup-card,
  .app-trial-review-popup-card
) {
  width: 100% !important;
  max-width: none !important;
  height: fit-content !important;
  flex: 0 0 auto;
}

#carix-startup { transition: opacity 500ms linear; }
#carix-startup img { transition: opacity 300ms ease-out; }
#carix-startup.is-logo-visible img { opacity: 1; }
#carix-startup.is-hidden { opacity: 0; pointer-events: none; }

.carix-route-view.is-route-animating {
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Every area owns its loading state. It keeps its measured layout at zero
   opacity until its images/data are ready, then performs its one reveal. */
.carix-route-view .carix-area-entrance,
.carix-bottom-accessory-view .carix-area-entrance {
  opacity: 0;
}

.carix-area-entrance.is-carix-area-ready-a {
  animation: carix-area-fade-in-a var(--carix-motion-duration) var(--carix-motion-spring) both;
}

.carix-area-entrance.is-carix-area-ready-b {
  animation: carix-area-fade-in-b var(--carix-motion-duration) var(--carix-motion-spring) both;
}

@keyframes carix-area-fade-in-a {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes carix-area-fade-in-b {
  from { opacity: 0; }
  to { opacity: 1; }
}

#carix-route-error {
  position: fixed;
  z-index: 12000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #070707;
  color: #fff;
  font: 500 15px/1.4 "Aeonik", Arial, sans-serif;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  #carix-startup,
  #carix-startup img { transition-duration: 1ms; }
}
.carix-route-view,.carix-route-view>main,.carix-route-view [aria-expanded],.carix-route-view [class*="dropdown"]{overflow-anchor:none}

