/* App shell, header, page visibility, and section labels */
#app { max-width: 980px; margin: 0 auto; padding: 0 20px calc(var(--nav-h) + var(--safe-bottom) + 20px); min-height: 100vh; position: relative; z-index: 1; }

.app-header { padding: 52px 0 32px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.app-header.header-switching .header-left,
.app-header.header-switching .header-right {
  animation: headerSwitch .42s var(--spring) both;
}
.app-header.header-switching .header-right { animation-delay: .04s; }
@keyframes headerSwitch {
  0% { opacity: .35; transform: translateY(-10px) scale(.985); filter: blur(5px); }
  60% { opacity: 1; transform: translateY(3px) scale(1.006); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.header-eyebrow { font-size: 9px; letter-spacing: 4px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.header-title { font-family: 'Bebas Neue', sans-serif; font-size: clamp(48px, 9vw, 96px); line-height: 0.92; letter-spacing: -1px; }
.header-title span { color: var(--accent); }
.app-header .header-title {
  transform-origin: left top;
  transform: translateY(var(--logo-scroll-y, 0px)) scale(var(--logo-scroll-scale, 1));
  opacity: var(--logo-scroll-opacity, 1);
  transition: transform .12s linear, opacity .12s linear;
}
.header-sub { margin-top: 12px; font-size: 12px; color: var(--muted2); display: flex; align-items: center; gap: 8px; }
.header-day-badge { background: var(--accent-dim); border: 1px solid rgba(232,244,77,0.25); color: var(--accent); padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; background: rgba(255,255,255,0.07); backdrop-filter: var(--blur-sm); -webkit-backdrop-filter: var(--blur-sm); border: 1px solid rgba(255,255,255,0.14); border-radius: 40px; cursor: pointer; transition: all 0.3s var(--spring); box-shadow: var(--glass-shadow); -webkit-tap-highlight-color: transparent; }
.user-chip:active { transform: scale(0.96); background: rgba(255,255,255,0.11); }
.user-chip-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #000; }
.user-chip-name { font-size: 12px; font-weight: 600; }
.user-chip-arrow { font-size: 10px; color: var(--muted2); }
.save-status { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted2); letter-spacing: 1px; }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.page { display: none; animation: fadeUp 0.4s var(--spring) both; }
.page.active { display: block; }
#page-home.page.active { display: flex; flex-direction: column; }
@keyframes fadeUp { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

.section-label { font-size: 9px; letter-spacing: 4px; text-transform: uppercase; color: rgba(255,255,255,0.30); margin-bottom: 12px; margin-top: 32px; display: flex; align-items: center; gap: 10px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.06); }

body.workout-mode #app {
  position: fixed;
  inset: 0;
  z-index: 750;
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
  overflow: hidden;
  background: transparent;
}
body.workout-mode #page-home.page.active {
  display: block;
  animation: none !important;
  transform: none !important;
  opacity: 1 !important;
  filter: none !important;
}
body.workout-mode .app-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

@media (max-width: 600px) {
  #app { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 420px) {
  .header-title { font-size: 52px; }
}
