/* ═══════════════════════════════════════════════════════════════════════
   Atlas mobile bottom tab bar + More sheet
   2 Jun 2026 - per BRIEF-MOBILE-TABBAR-2JUN.md
   Lives in its own stylesheet so the existing atlas-sections.css is
   untouched. Drops in via <link> tag - see runbook in the brief.

   Scope: shows ≤1023px (phones + tablets). Desktop sidebar unaffected.
   ═══════════════════════════════════════════════════════════════════════ */

/* Hide on desktop. Single-rule gate. */
.atlas-tabbar,
.atlas-more-backdrop,
.atlas-more-sheet,
.atlas-session-banner {
  display: none;
}

@media (max-width: 1023px) {

  /* ── Hamburger retired on mobile (8 Jul 2026) ──────────────────────
     The bottom tab bar + More sheet now own all mobile navigation, so
     the floating hamburger is redundant and was cluttering the top line.
     Desktop (>1023px) keeps its always-visible sidebar; no hamburger
     exists there anyway. */
  .sidebar-hamburger { display: none !important; }

  /* ── Tab bar ───────────────────────────────────────────────────── */
  .atlas-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 31, 31, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 0.5px solid rgba(255, 255, 255, 0.06);
    padding: 8px 4px calc(18px + env(safe-area-inset-bottom));
    z-index: 950;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }
  .atlas-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    background: transparent;
    border: 0;
    color: #7a8585;
    font-size: 10px;
    letter-spacing: 0.2px;
    cursor: pointer;
    position: relative;
    transition: color 120ms;
    -webkit-tap-highlight-color: transparent;
  }
  .atlas-tab:active { background: var(--atlas-surface-nested); }
  .atlas-tab-icon { font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
  .atlas-tab-icon svg { display: block; }
  .atlas-tab.is-active { color: #f1eee8; }
  .atlas-tab-label { line-height: 1; }

  /* Ask Atlas - gold treatment (always present, regardless of active) */
  .atlas-tab-ai .atlas-tab-icon { color: #d4b26a; }
  .atlas-tab-ai-dot {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(7px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4b26a;
    box-shadow: 0 0 0 2px rgba(212, 178, 106, 0.2);
  }

  /* Notification dot - same gold language as the live-AI dot. Static by
     default; pulse when the data source warrants it (Home: new Recovery
     Engine card, etc). */
  .atlas-tab-notify {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(7px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d4b26a;
    border: 1.5px solid rgba(26, 31, 31, 0.96);
  }
  .atlas-tab-notify.pulse {
    animation: atlas-tab-pulse 2.4s ease-in-out infinite;
  }
  @keyframes atlas-tab-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 178, 106, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(212, 178, 106, 0); }
  }

  /* ── Coach view-as collision - tab bar lifts above the coach bar ── */
  body.coach-view .atlas-tabbar {
    bottom: 36px;
  }

  /* ── Active session - bar disappears, banner takes over ───────── */
  body.session-active .atlas-tabbar {
    display: none;
  }
  body.session-active .atlas-session-banner {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #1a1f1f;
    color: #6CD693;
    padding: 5px 14px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
  }
  .atlas-session-banner-exit {
    color: #7a8585;
    background: transparent;
    border: 0;
    font-size: 10px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    padding: 4px 8px;
  }
  .atlas-session-banner-exit:active { color: #f1eee8; }

  /* Push main content above the bar so nothing hides behind it. */
  #app-main {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }

  /* ── More sheet backdrop ──────────────────────────────────────── */
  .atlas-more-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 20, 0);
    z-index: 960;
    pointer-events: none;
    transition: background 220ms ease-out;
  }
  .atlas-more-backdrop.is-open {
    background: rgba(15, 20, 20, 0.55);
    pointer-events: auto;
  }

  /* ── More sheet ───────────────────────────────────────────────── */
  .atlas-more-sheet {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #101514;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0 calc(78px + env(safe-area-inset-bottom));
    z-index: 970;
    max-height: 78vh;
    max-height: 78dvh; /* 16 Jun 2026 - dvh so iOS bounds the sheet to the visible area; see .atlas-postsess */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateY(100%);
    transition: transform 260ms ease-out;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #f1eee8;
  }
  .atlas-more-sheet.is-open { transform: translateY(0); }
  /* Tablet - don't stretch the sheet edge-to-edge on a 10-inch screen. */
  @media (min-width: 600px) and (max-width: 1023px) {
    .atlas-more-sheet {
      left: 50%;
      right: auto;
      max-width: 480px;
      width: 480px;
      transform: translate(-50%, 100%);
    }
    .atlas-more-sheet.is-open { transform: translate(-50%, 0); }
  }

  .atlas-more-handle {
    width: 38px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
    margin: 0 auto 14px;
  }

  /* Identity header */
  .atlas-more-id {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px 14px;
    margin: 0 14px 6px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    width: calc(100% - 28px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .atlas-more-id-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(212, 178, 106, 0.15);
    color: #d4b26a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 15px;
    border: 0.5px solid rgba(212, 178, 106, 0.3);
    flex-shrink: 0;
  }
  .atlas-more-id-stack { flex: 1; text-align: left; }
  .atlas-more-id-name {
    font-size: 14px;
    font-weight: 500;
    color: #f1eee8;
  }
  .atlas-more-id-tier {
    font-size: 10px;
    color: #d4b26a;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .atlas-more-id-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6CD693;
    box-shadow: 0 0 0 2px rgba(74, 157, 107, 0.2);
  }
  .atlas-more-id-chev {
    color: #7a8585;
    font-size: 14px;
  }

  /* Sections + rows */
  .atlas-more-section {
    font-size: 10px;
    color: #7a8585;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 14px 18px 6px;
  }
  .atlas-more-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 18px;
    color: #f1eee8;
    font-size: 13px;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .atlas-more-row:active { background: var(--atlas-surface-nested); }
  .atlas-more-row-icon {
    font-size: 18px;
    color: #a8b3b3;
    width: 20px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .atlas-more-row-icon svg { display: block; }
  .atlas-more-row-label { flex: 1; }
  .atlas-more-row-meta {
    margin-left: auto;
    font-size: 11px;
    color: #7a8585;
  }
  .atlas-more-row-meta.is-open { color: #d4b26a; }
  .atlas-more-row-meta.is-warn { color: #e07550; }
  .atlas-more-row-chev {
    margin-left: auto;
    color: #5a6a6a;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
  }
  .atlas-more-row-chev svg { display: block; }
  .atlas-more-row.is-danger,
  .atlas-more-row.is-danger .atlas-more-row-icon {
    color: #e07550;
  }

  .atlas-more-id-chev { display: inline-flex; align-items: center; font-size: 14px; color: #7a8585; }
  .atlas-more-id-chev svg { display: block; }

}

/* ─────────────────────────────────────────────────────────────────────
   Performance Overview - "Today's session" CTA card.
   Stage 1 of session-log v2 (2 Jun 2026). Lives outside the ≤1023px
   media query so it renders on desktop too - it's the universal entry
   point into the session surface from Performance.
   ───────────────────────────────────────────────────────────────────── */
.perf-today-cta {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #1D2524;
  border: 0.5px solid rgba(212, 178, 106, 0.35);
  border-radius: 12px;
  margin-bottom: 14px;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 180ms;
  overflow: hidden;
  min-height: 86px;
}
.perf-today-cta:hover { border-color: rgba(212, 178, 106, 0.55); }
.perf-today-cta:active { filter: brightness(1.04); }
.perf-today-cta:focus-visible {
  outline: 2px solid rgba(212, 178, 106, 0.5);
  outline-offset: 2px;
}
/* Full-gold date tile on the left - calendar-style block with day/date/month. */
.perf-today-cta-tile {
  flex-shrink: 0;
  width: 72px;
  background: #d4b26a;
  color: #101514;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.perf-today-cta-tile-dow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.4px;
  opacity: 0.85;
}
.perf-today-cta-tile-num {
  font-size: 26px;
  font-weight: 500;
  line-height: 1.05;
  margin-top: 1px;
}
.perf-today-cta-tile-mon {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.4px;
  opacity: 0.85;
  margin-top: 1px;
}
/* Done / missed / in-progress state tints - tile colour reflects the session state.
   In-progress shares the brand-green palette with done (active, healthy)
   but with a subtler pulse to read as "live" rather than "finished". */
.perf-today-cta.is-done .perf-today-cta-tile { background: #6CD693; }
.perf-today-cta.is-missed .perf-today-cta-tile { background: #d85a30; color: #ffffff; }
.perf-today-cta.is-inprogress .perf-today-cta-tile {
  background: #6CD693;
  position: relative;
}
.perf-today-cta.is-inprogress .perf-today-cta-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px rgba(241, 238, 232, 0.35);
  animation: perf-today-cta-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes perf-today-cta-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.perf-today-cta-body {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.perf-today-cta-tag {
  font-size: 10px;
  letter-spacing: 0.06em;
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.perf-today-cta-name {
  font-size: 16px;
  font-weight: 500;
  color: #f1eee8;
  line-height: 1.2;
  margin-bottom: 3px;
}
.perf-today-cta-meta {
  font-size: 11px;
  color: #a8b3b3;
  letter-spacing: 0.2px;
}
.perf-today-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(212, 178, 106, 0.18);
  color: #d4b26a;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 8px 13px;
  border-radius: 8px;
  flex-shrink: 0;
  margin: auto 14px;
  border: 0.5px solid rgba(212, 178, 106, 0.35);
  transition: background 160ms;
}
.perf-today-cta:hover .perf-today-cta-btn {
  background: rgba(212, 178, 106, 0.28);
}
.perf-today-cta-icon {
  font-size: 14px;
  line-height: 1;
}

@media (max-width: 540px) {
  .perf-today-cta {
    flex-wrap: wrap;
    min-height: 0;
  }
  .perf-today-cta-tile {
    flex-direction: row;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    justify-content: flex-start;
  }
  .perf-today-cta-tile-num {
    font-size: 17px;
    margin-top: 0;
  }
  .perf-today-cta-tile-dow,
  .perf-today-cta-tile-mon {
    font-size: 11px;
    margin-top: 0;
  }
  .perf-today-cta-body {
    flex-basis: 100%;
    padding: 12px 16px 4px;
  }
  .perf-today-cta-btn {
    margin: 0 14px 14px;
    justify-content: center;
    padding: 10px;
    flex-basis: calc(100% - 28px);
  }
}

/* ─────────────────────────────────────────────────────────────────────
   Pre-session questionnaire modal - Stage 2 of session-log v2 (2 Jun).
   Fires when client taps "Start session" on the Performance Overview
   Today CTA. Three taps (sleep / soreness / readiness), then either
   Skip or Save & begin → deep-links into the session detail via the
   existing __atlas_open_session_pending pattern.
   ───────────────────────────────────────────────────────────────────── */
.atlas-presession-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 20, 0);
  z-index: 970;
  pointer-events: none;
  transition: background 220ms ease-out;
}
.atlas-presession-backdrop.is-open {
  display: block;
  background: rgba(15, 20, 20, 0.62);
  pointer-events: auto;
}
.atlas-presession {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #101514;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  /* 17 Jun 2026 - bottom padding moved onto the sticky actions row
     (env(safe-area-inset-bottom)) so the home-indicator pad isn't
     double-counted against the scroll area + the buttons sit above it. */
  padding: 14px 0 0;
  z-index: 980;
  max-height: 92vh;
  max-height: 92dvh; /* 16 Jun 2026 - dvh so iOS bounds the sheet to the visible area; see .atlas-postsess */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform 260ms ease-out;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  font-family: var(--font-sans);
  color: #f1eee8;
}
.atlas-presession.is-open {
  display: block;
  transform: translateY(0);
}
@media (min-width: 600px) {
  .atlas-presession {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    max-width: 480px;
    width: 480px;
    border-radius: 16px;
    border: 0.5px solid rgba(212, 178, 106, 0.3);
    transform: translate(-50%, calc(-50% + 30px));
    opacity: 0;
    padding: 22px 0 26px;
  }
  .atlas-presession.is-open {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}
.atlas-presession-handle {
  width: 38px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 12px;
}
@media (min-width: 600px) {
  .atlas-presession-handle { display: none; }
}
.atlas-presession-head {
  padding: 0 22px 14px;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 18px;
}
.atlas-presession-tag {
  font-size: 10px;
  color: #d4b26a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 4px;
}
.atlas-presession-title {
  font-size: 18px;
  font-weight: 500;
  color: #f1eee8;
  line-height: 1.2;
  margin-bottom: 4px;
}
.atlas-presession-sub {
  font-size: 11px;
  color: #a8b3b3;
  line-height: 1.5;
}
.atlas-presession-wearable {
  display: flex;
  gap: 14px;
  padding: 10px 22px;
  background: rgba(0, 0, 0, 0.18);
  margin: 0 0 18px;
  font-size: 11px;
  color: #a8b3b3;
  border-top: 0.5px solid rgba(255, 255, 255, 0.05);
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}
.atlas-presession-wearable strong {
  color: #f1eee8;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.atlas-presession-q {
  padding: 0 22px;
  margin-bottom: 18px;
}
.atlas-presession-q-label {
  font-size: 11px;
  color: #a8b3b3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 8px;
}
.atlas-presession-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.atlas-presession-pills.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}
.atlas-presession-pill {
  background: #1D2524;
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  color: #a8b3b3;
  font-size: 11px;
  letter-spacing: 0.2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 140ms, background 140ms, color 140ms;
}
.atlas-presession-pill:hover {
  color: #f1eee8;
  border-color: rgba(255, 255, 255, 0.14);
}
.atlas-presession-pill.is-selected {
  background: rgba(212, 178, 106, 0.16);
  border-color: rgba(212, 178, 106, 0.5);
  color: #d4b26a;
}
.atlas-presession-actions {
  display: flex;
  gap: 10px;
  /* 17 Jun 2026 - sticky-pin Skip/Save inside the scrollable sheet so they
     stay tappable when the question list exceeds the visible area on
     mobile (clients couldn't reach Save & begin on small phones). The
     solid background prevents pill rows from showing through, and the
     bottom padding honours the home-indicator safe-area. */
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #101514;
  padding: 14px 22px calc(20px + env(safe-area-inset-bottom));
  border-top: 0.5px solid rgba(255, 255, 255, 0.06);
  margin-top: 6px;
}
.atlas-presession-btn {
  flex: 1;
  padding: 13px;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #a8b3b3;
}
.atlas-presession-btn.is-primary {
  background: #d4b26a;
  color: #101514;
  border-color: #d4b26a;
}
.atlas-presession-btn:active { filter: brightness(0.95); }

@media (max-width: 1023px) {
  /* Session banner pulse */
  .atlas-session-pulse {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6CD693;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(74, 157, 107, 0.4);
    animation: atlas-session-pulse 2s ease-in-out infinite;
  }
  @keyframes atlas-session-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 157, 107, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(74, 157, 107, 0); }
  }
}

/* ────────────────────────────────────────────────────────────────────────
   Stage 5 (4 Jun 2026) - sticky live-session banner inside the active
   gym tracker. Lives right under the existing .sess-tracker-header and
   sticks to the top of the viewport during scrolling. Reuses brand teal
   + gold tokens; pulse-dot reads as "live recording" without being noisy.
   ────────────────────────────────────────────────────────────────────────*/
.sess-live-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  margin: -4px 0 14px;
  background: linear-gradient(180deg, rgba(10, 14, 14, 0.97) 0%, rgba(10, 14, 14, 0.93) 100%);
  border: 0.5px solid rgba(212, 178, 106, 0.22);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}
.sess-live-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sess-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6CD693;
  box-shadow: 0 0 0 0 rgba(74, 157, 107, 0.55);
  animation: sess-live-pulse 1.6s ease-in-out infinite;
}
@keyframes sess-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 157, 107, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(74, 157, 107, 0); }
}
.sess-live-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6CD693;
}
.sess-live-timer {
  font-size: 14px;
  font-weight: 600;
  color: #f1eee8;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  margin-left: 4px;
}
.sess-live-exit {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  background: transparent;
  color: #d4b26a;
  border: 0.5px solid rgba(212, 178, 106, 0.4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease;
}
.sess-live-exit:hover { background: rgba(212, 178, 106, 0.08); border-color: rgba(212, 178, 106, 0.6); }
.sess-live-exit:active { filter: brightness(0.9); }

/* ── Save & Exit modal (action sheet on mobile, centred dialog on tablet+) ── */
.sess-saveexit-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 28, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}
.sess-saveexit-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sess-saveexit-modal {
  position: fixed;
  z-index: 201;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: #1D2524;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  border: 0.5px solid rgba(241, 238, 232, 0.08);
  border-bottom: 0;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  transition: transform 240ms cubic-bezier(0.18, 0.79, 0.31, 0.99);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sess-saveexit-modal.is-open { transform: translateX(-50%) translateY(0); }
@media (min-width: 600px) {
  .sess-saveexit-modal {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -45%);
    border-radius: 16px;
    border-bottom: 0.5px solid rgba(241, 238, 232, 0.08);
    padding: 22px;
  }
  .sess-saveexit-modal.is-open { transform: translate(-50%, -50%); }
}
.sess-saveexit-head {
  padding: 4px 6px 12px;
  border-bottom: 0.5px solid rgba(241, 238, 232, 0.06);
  margin-bottom: 6px;
}
.sess-saveexit-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d4b26a;
  margin-bottom: 6px;
}
.sess-saveexit-title {
  font-size: 14px;
  color: #c8d2d2;
  line-height: 1.4;
}
.sess-saveexit-btn {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10, 14, 14, 0.6);
  border: 0.5px solid rgba(241, 238, 232, 0.08);
  color: #f1eee8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, border-color 120ms ease;
}
.sess-saveexit-btn:hover { background: rgba(10, 14, 14, 0.85); }
.sess-saveexit-btn:active { filter: brightness(0.92); }
.sess-saveexit-sub {
  font-size: 12px;
  color: #8a9595;
  font-weight: 400;
  margin-top: 3px;
}
.sess-saveexit-btn--primary {
  background: rgba(212, 178, 106, 0.18);
  border-color: rgba(212, 178, 106, 0.45);
  color: #d4b26a;
}
.sess-saveexit-btn--primary .sess-saveexit-sub { color: rgba(212, 178, 106, 0.7); }
.sess-saveexit-btn--cancel {
  background: transparent;
  text-align: center;
  align-items: center;
  margin-top: 4px;
  color: #8a9595;
  font-weight: 500;
}

/* ────────────────────────────────────────────────────────────────────────
   Stage 6 (4 Jun 2026) - post-session report modal. Fires when client
   taps Complete Session. Mirrors the pre-session modal pattern (bottom
   sheet on mobile, centred modal on tablet+). Adds a 4-stat summary
   strip at the top + three quick-tap rows.
   ────────────────────────────────────────────────────────────────────────*/
.atlas-postsess-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 28, 28, 0.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 1000; opacity: 0; pointer-events: none; /* 23 Jun 2026 - above the bottom tab bar (z 950) so the sheet's Save/Skip buttons aren't covered by it */
  transition: opacity 200ms ease;
}
.atlas-postsess-backdrop.is-open { opacity: 1; pointer-events: auto; }

.atlas-postsess {
  position: fixed; z-index: 1001; /* 23 Jun 2026 - above the bottom tab bar (z 950); was 201, so the tab bar covered the actions row and the buttons were unreachable */
  left: 50%; bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 540px;
  background: #1D2524;
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  border: 0.5px solid rgba(241, 238, 232, 0.08); border-bottom: 0;
  /* 17 Jun 2026 - sheet bottom padding moved onto the sticky actions row
     so the home-indicator safe-area isn't subtracted from the scrollable
     area while ALSO living under the buttons. */
  padding: 8px 4px 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  transition: transform 240ms cubic-bezier(0.18, 0.79, 0.31, 0.99);
  /* 16 Jun 2026 - iOS scroll fix. vh is the LARGE viewport (ignores the URL
     bar), so the sheet was sized taller than the visible area: content fit
     inside 92vh, no internal scroll engaged, and the Save button rendered below
     the chrome - unreachable. dvh = the actual visible height, so the sheet is
     bounded and overflow-y scrolls to the Save button. vh kept as fallback for
     browsers without dvh. */
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.atlas-postsess.is-open { transform: translateX(-50%) translateY(0); }
@media (min-width: 600px) {
  .atlas-postsess {
    bottom: auto; top: 50%;
    transform: translate(-50%, -45%);
    border-radius: 16px;
    border-bottom: 0.5px solid rgba(241, 238, 232, 0.08);
    padding: 8px 4px 22px;
  }
  .atlas-postsess.is-open { transform: translate(-50%, -50%); }
}
.atlas-postsess-handle {
  width: 36px; height: 4px;
  margin: 8px auto 4px;
  background: rgba(241, 238, 232, 0.15);
  border-radius: 4px;
}
@media (min-width: 600px) { .atlas-postsess-handle { display: none; } }
.atlas-postsess-head {
  padding: 8px 22px 14px;
  border-bottom: 0.5px solid rgba(241, 238, 232, 0.06);
}
.atlas-postsess-tag {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #6CD693;
  margin-bottom: 6px;
}
.atlas-postsess-title {
  font-size: 17px; font-weight: 600;
  color: #f1eee8; line-height: 1.3;
  margin-bottom: 6px;
}
.atlas-postsess-sub {
  font-size: 13px; color: #8a9595;
  line-height: 1.4;
}
.atlas-postsess-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 14px 18px 16px;
  border-bottom: 0.5px solid rgba(241, 238, 232, 0.06);
  background: rgba(10, 14, 14, 0.4);
}
.atlas-postsess-stat {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 4px 2px;
}
.atlas-postsess-stat-val {
  font-size: 16px; font-weight: 600;
  color: #f1eee8;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-bottom: 4px;
}
.atlas-postsess-stat-lbl {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a9595;
}
.atlas-postsess-q {
  padding: 14px 22px 4px;
}
.atlas-postsess-q-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #c8d2d2;
  margin-bottom: 10px;
}
.atlas-postsess-pills {
  display: grid; gap: 8px;
}
.atlas-postsess-pills.cols-4 { grid-template-columns: repeat(4, 1fr); }
.atlas-postsess-pill {
  padding: 11px 6px;
  border-radius: 8px;
  text-align: center;
  font-size: 13px; font-weight: 500;
  color: #c8d2d2;
  background: rgba(10, 14, 14, 0.5);
  border: 0.5px solid rgba(241, 238, 232, 0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.atlas-postsess-pill:hover { background: rgba(10, 14, 14, 0.75); }
.atlas-postsess-pill:active { filter: brightness(0.92); }
.atlas-postsess-pill.is-selected {
  background: rgba(212, 178, 106, 0.18);
  border-color: rgba(212, 178, 106, 0.55);
  color: #d4b26a;
}
/* Training Brain slice 1 (17 Jul 2026) - session RPE chip row + anchored
   labels + joint-location flag chips. Same visual family as the pills. */
.atlas-postsess-rpe-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.atlas-postsess-rpe {
  padding: 10px 0;
  border-radius: 8px;
  text-align: center;
  font-size: 13px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #c8d2d2;
  background: rgba(10, 14, 14, 0.5);
  border: 0.5px solid rgba(241, 238, 232, 0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.atlas-postsess-rpe.is-selected {
  background: rgba(212, 178, 106, 0.18);
  border-color: rgba(212, 178, 106, 0.55);
  color: #d4b26a;
  font-weight: 600;
}
.atlas-postsess-rpe-anchors {
  display: flex; justify-content: space-between;
  font-size: 10px; color: #8a9595;
  margin-top: 5px; padding: 0 2px;
}
.atlas-postsess-flags {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.atlas-postsess-flag {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: #c8d2d2;
  background: rgba(10, 14, 14, 0.5);
  border: 0.5px solid rgba(241, 238, 232, 0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.atlas-postsess-flag.is-selected {
  background: rgba(216, 90, 48, 0.14);
  border-color: rgba(216, 90, 48, 0.55);
  color: #e8a37e;
}
.atlas-postsess-actions {
  display: flex; gap: 10px;
  /* 17 Jun 2026 - sticky-pin Save/Skip inside the scrollable sheet so
     mobile clients with longer summaries (progression card, 3 questions)
     can always reach the buttons. Same pattern as .atlas-presession-actions. */
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #1D2524;
  padding: 16px 22px calc(20px + env(safe-area-inset-bottom));
  margin-top: 6px;
  border-top: 0.5px solid rgba(241, 238, 232, 0.06);
}
.atlas-postsess-btn {
  flex: 1;
  padding: 14px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #a8b3b3;
  transition: filter 120ms ease;
}
.atlas-postsess-btn.is-primary {
  background: #d4b26a;
  color: #101514;
  border-color: #d4b26a;
  font-weight: 600;
}
.atlas-postsess-btn:active { filter: brightness(0.95); }

/* ── Brief 4 (4 Jun 2026) - auto-progression "Next session" preview ──────
   Sits between the quick-tap questions and the action buttons. Pill colours:
   gold = push, neutral = hold, coral (#e07550, matches is-warn) = back off. */
.atlas-postsess-progression {
  padding: 14px 22px 4px;
  border-top: 0.5px solid rgba(241, 238, 232, 0.06);
  margin-top: 10px;
}
.atlas-postsess-progression-headline {
  font-size: 13px; font-weight: 600;
  color: #f1eee8; line-height: 1.35;
  margin-bottom: 4px;
}
.atlas-postsess-progression-empty {
  font-size: 13px; color: #8a9595; line-height: 1.45;
  padding: 2px 0 6px;
}
.atlas-postsess-progression-row {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(241, 238, 232, 0.05);
}
.atlas-postsess-progression-row:last-child { border-bottom: 0; }
.atlas-postsess-progression-main { flex: 1; min-width: 0; }
.atlas-postsess-progression-name {
  font-size: 13px; font-weight: 500;
  color: #f1eee8; line-height: 1.3;
}
.atlas-postsess-progression-last {
  font-size: 12px; color: #8a9595;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.atlas-postsess-progression-prev {
  color: #6a7575;
}
.atlas-postsess-progression-side {
  display: flex; align-items: center; gap: 8px;
}
.atlas-postsess-progression-pill {
  font-size: 12px; font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 0.5px solid;
  text-align: center;
  line-height: 1.25;
  max-width: 200px;
}
.atlas-postsess-progression-pill.is-push {
  color: #d4b26a;
  border-color: rgba(212, 178, 106, 0.55);
  background: rgba(212, 178, 106, 0.12);
}
.atlas-postsess-progression-pill.is-hold {
  color: #c8d2d2;
  border-color: rgba(241, 238, 232, 0.18);
  background: rgba(10, 14, 14, 0.5);
}
.atlas-postsess-progression-pill.is-back {
  color: #e07550;
  border-color: rgba(224, 117, 80, 0.5);
  background: rgba(224, 117, 80, 0.1);
}
.atlas-postsess-progression-why {
  width: 22px; height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  font-size: 12px; font-weight: 600;
  color: #8a9595;
  background: rgba(10, 14, 14, 0.5);
  border: 0.5px solid rgba(241, 238, 232, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.atlas-postsess-progression-why[aria-expanded="true"] {
  color: #d4b26a;
  border-color: rgba(212, 178, 106, 0.55);
}
.atlas-postsess-progression-rationale {
  flex-basis: 100%;
  font-size: 12px; color: #8a9595;
  line-height: 1.45;
  padding: 2px 0 2px;
}

/* ────────────────────────────────────────────────────────────────────────
   Interim Pre-Session AI page (4 Jun 2026 PM) - Today's Focus card +
   "Begin session" CTA between the Stage 2 modal and the gym tracker.
   Stripped-down spiritual successor to the legacy renderPreSessionCheckIn.
   ────────────────────────────────────────────────────────────────────────*/
.atlas-interim-prefocus { margin: 14px 0 22px; }
.atlas-interim-cta-row {
  position: sticky;
  bottom: 16px;
  padding: 4px 0 20px;
  background: linear-gradient(180deg, rgba(10,14,14,0) 0%, rgba(10,14,14,0.95) 35%, rgba(10,14,14,0.95) 100%);
  z-index: 10;
}
.atlas-interim-begin {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--atlas-gold-grad, #d4b26a);
  border: none;
  color: #141008;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: filter 120ms ease, transform 80ms ease;
  box-shadow: 0 6px 24px rgba(212, 178, 106, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.atlas-interim-begin:hover { filter: brightness(1.04); }
.atlas-interim-begin:active { transform: scale(0.99); filter: brightness(0.96); }
@media (max-width: 480px) {
  .atlas-interim-cta-row { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .atlas-interim-begin { padding: 15px 18px; font-size: 15px; }
}

/* ────────────────────────────────────────────────────────────────────────
   Week-grid strip (4 Jun 2026 PM) - Mon→Sun pill row on Performance
   Overview between the pre-focus AI card and the Today CTA. Last Stage 9
   blocker. Brand teal pills, gold rim on today, green/coral state tints
   for done/missed, pulsing green for in-progress, neutral grey for rest
   days. Matches the selected-state-visual-contract memory: gold-rail +
   gradient on the active item.
   ────────────────────────────────────────────────────────────────────────*/
.perf-week-grid { margin: 0 0 18px; }
.perf-week-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 10px;
}
.perf-week-header-row .perf-week-headline { padding: 0; flex: 1; text-align: left; }
.perf-week-headline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a9595;
  padding: 0 4px 10px;
}
/* 6 Jul 2026 - week nav controls on the client Training strip. */
.perf-week-nav-btn {
  background: var(--atlas-surface-card);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.65);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.perf-week-nav-btn:hover:not(:disabled) {
  background: rgba(212,178,106,0.10);
  border-color: rgba(212,178,106,0.35);
  color: #f1eee8;
}
.perf-week-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.perf-week-return {
  background: rgba(212,178,106,0.10);
  border: 1px solid rgba(212,178,106,0.35);
  color: #d4b26a;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  margin: 0 auto 10px;
  display: block;
  transition: background 0.12s;
}
.perf-week-return:hover {
  background: rgba(212,178,106,0.18);
}
.perf-week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
/* 6 Jul 2026 - phone widths squeeze 7 equal columns to ~48px, forcing session
   names into mid-word wraps ("Condit/ioning"). Below ~640px, give each card a
   readable min-width: the week fits all 7 when it can, and scrolls horizontally
   (snap) when it can't - names stay on one/clean lines. Desktop is untouched. */
@media (max-width: 640px) {
  .perf-week-row {
    grid-template-columns: repeat(7, minmax(84px, 1fr));
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .perf-week-row::-webkit-scrollbar { display: none; }
  .perf-week-pill { scroll-snap-align: start; }
}
/* 10 Jun 2026 - Extras rail. Sits below the 7-day grid and houses
   sessions from non-Primary phases (rehab adjuncts, conditioning blocks,
   etc.). Visual hierarchy is deliberately quieter than the main grid:
   smaller pill height, no gold-rim emphasis on today, no full-week scaffold
   - just a horizontal row of compact day-labelled cards. Each card uses
   the same click handler as week-grid pills (data-perf-launch-session). */
.perf-extras-strip {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 0.5px dashed rgba(241, 238, 232, 0.08);
}
.perf-extras-headline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a7575;
  padding: 0 4px 10px;
}
.perf-extras-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.perf-extras-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  min-width: 132px;
  flex: 0 1 auto;
  border-radius: 8px;
  background: rgba(10, 14, 14, 0.45);
  border: 0.5px solid rgba(241, 238, 232, 0.07);
  color: #b8c2c2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  position: relative;
}
.perf-extras-card:hover {
  background: rgba(10, 14, 14, 0.7);
  border-color: rgba(241, 238, 232, 0.15);
}
.perf-extras-card:active { transform: scale(0.98); }
.perf-extras-card-day {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a8585;
}
.perf-extras-card-name {
  font-size: 13px;
  font-weight: 500;
  color: #EEF3F1;
  line-height: 1.25;
  /* Two-line clamp so long names ("Hip Injury Management - Rehab A") don't
     blow out the card width. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.perf-extras-card-icon {
  font-size: 12px;
  color: #8a9595;
  position: absolute;
  top: 8px;
  right: 10px;
}
.perf-extras-card.is-done {
  background: rgba(74, 157, 107, 0.10);
  border-color: rgba(74, 157, 107, 0.30);
}
.perf-extras-card.is-done .perf-extras-card-icon { color: #6CD693; }
.perf-extras-card.is-cutshort {
  background: rgba(212, 178, 106, 0.08);
}
.perf-extras-card.is-cutshort .perf-extras-card-icon { color: #d4b26a; }
.perf-extras-card.is-missed {
  background: rgba(224, 117, 80, 0.08);
  border-color: rgba(224, 117, 80, 0.22);
}
.perf-extras-card.is-missed .perf-extras-card-icon { color: #e07550; }
.perf-extras-card.is-inprogress {
  background: rgba(74, 157, 107, 0.10);
  border-color: rgba(74, 157, 107, 0.28);
}
.perf-extras-card.is-inprogress .perf-extras-card-icon { color: #6CD693; }
.perf-extras-card.is-today:not(.is-done):not(.is-missed):not(.is-inprogress) {
  border-color: rgba(212, 178, 106, 0.40);
}
.perf-extras-card.is-today:not(.is-done):not(.is-missed):not(.is-inprogress) .perf-extras-card-icon { color: #d4b26a; }
.perf-week-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 12px 8px 11px;
  border-radius: 12px;
  background: rgba(10, 14, 14, 0.55);
  border: 0.5px solid rgba(241, 238, 232, 0.08);
  color: #c8d2d2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  min-height: 88px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.perf-week-pill:not(.is-rest):hover {
  background: rgba(10, 14, 14, 0.85);
  border-color: rgba(241, 238, 232, 0.18);
}
.perf-week-pill:not(.is-rest):active { transform: scale(0.97); }
.perf-week-pill-dow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8a9595;
  text-transform: uppercase;
}
.perf-week-pill-num {
  font-size: 17px;
  font-weight: 700;
  color: #f1eee8;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.perf-week-pill-name {
  font-size: 11px;
  font-weight: 500;
  color: #c8d2d2;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
  padding: 0 2px;
}
.perf-week-pill-icon {
  font-size: 11px;
  font-weight: 700;
  color: #8a9595;
  line-height: 1;
}

/* 6 Jun 2026 - dual-tier pill. Each tier renders its own session card with
   state colour + tap target. is-dual stacks two tiers vertically with a
   thin divider; single-tier shows just the one tile. The pill chrome
   (dow + num + today rail) stays unchanged; the state colour now lives on
   the tier, not the pill. */
.perf-week-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  padding: 4px 2px;
  border-radius: 8px;
  background: rgba(241, 238, 232, 0.03);
  cursor: pointer;
  transition: background 100ms ease;
  min-height: 30px;
}
.perf-week-tier:hover { background: rgba(241, 238, 232, 0.08); }
.perf-week-tier-name {
  font-size: 9px;
  font-weight: 500;
  color: #c8d2d2;
  line-height: 1.2;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  padding: 0 1px;
  text-align: center;
}
/* 2 Jul 2026 - full session names on the strip. Names with a whitespace-
   flanked dash split into a bolder short code ("Lower A") plus a smaller
   muted descriptor ("Squat & Posterior Chain", 2-line max). Names without
   a separator wrap up to 3 lines via the clamp above. Pill min-heights
   are floors, so cells grow with the extra line; the 7-column grid and
   the pill's overflow:hidden keep 390px phones from scrolling sideways.
   Descriptor inherits the tier state colour (done/missed tints) at
   reduced opacity so it always reads as the muted line. */
.perf-week-tier-name.is-split {
  display: flex;
  flex-direction: column;
  gap: 1px;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.perf-week-tier-code {
  display: block;
  /* 6 Jul 2026 - 9px + tight tracking so a 12-char word like "Conditioning"
     fits a phone-width card on one line; break at word boundaries (not mid-word)
     for multi-word codes, hyphenate long single words as a last resort. */
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.2px;
  overflow-wrap: break-word;
  hyphens: auto;
}
.perf-week-tier-desc {
  font-size: 10px;
  font-weight: 500;
  color: inherit;
  opacity: 0.62;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
}
.perf-week-tier-icon {
  font-size: 11px;
  font-weight: 700;
  color: #8a9595;
  line-height: 1;
}
.perf-week-tier-from {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: #d4b26a;
  letter-spacing: 0.4px;
  margin-top: 1px;
  text-transform: lowercase;
  opacity: 0.85;
}
/* Tier state variants - done/missed/in-progress mirror the old pill states
   but live one layer inside, so dual-tier pills can show TWO states. */
.perf-week-tier.is-done {
  background: rgba(74, 157, 107, 0.16);
}
.perf-week-tier.is-done .perf-week-tier-icon { color: #6CD693; }
.perf-week-tier.is-done .perf-week-tier-name { color: #c1e0a0; }

.perf-week-tier.is-missed {
  background: rgba(216, 90, 48, 0.13);
}
.perf-week-tier.is-missed .perf-week-tier-icon { color: #d85a30; }
.perf-week-tier.is-missed .perf-week-tier-name { color: #e8aa92; }

/* "Cut short" - started but not finished. Muted gold, deliberately quieter
   than Missed red: partial work is a fact, not a failure. 3 Jul 2026. */
.perf-week-tier.is-cutshort {
  background: rgba(212, 178, 106, 0.10);
}
.perf-week-tier.is-cutshort .perf-week-tier-icon { color: #d4b26a; }
.perf-week-tier.is-cutshort .perf-week-tier-name { color: #cbbd97; }

.perf-week-tier.is-inprogress {
  background: rgba(74, 157, 107, 0.18);
}
.perf-week-tier.is-inprogress .perf-week-tier-icon {
  color: #6CD693;
  animation: perf-week-pulse 1.8s ease-in-out infinite;
}
@keyframes perf-week-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
/* "Moved-away" placeholder - shows on the PRESCRIBED day for a session
   that was made up on a different day. Faded so it reads as ghost intent,
   not actual missed work. Cursor=default - not tappable. */
.perf-week-tier-moved {
  background: rgba(212, 178, 106, 0.06);
  border: 1px dashed rgba(212, 178, 106, 0.28);
  cursor: default;
  opacity: 0.75;
}
.perf-week-tier-moved .perf-week-tier-name {
  color: #b7a679;
  font-style: italic;
}
.perf-week-tier-moved .perf-week-tier-icon { color: #b7a679; }
.perf-week-tier-moved-to {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #d4b26a;
  letter-spacing: 0.3px;
  margin-top: 1px;
  font-style: normal;
}
.perf-week-tier-rest {
  background: transparent;
  cursor: default;
}
.perf-week-tier-rest .perf-week-tier-name { color: #8a9595; opacity: 0.55; }
.perf-week-tier-rest .perf-week-tier-icon { opacity: 0.4; }

/* Dual-tier pill grows vertically to give each tier breathing room.
   Tiers separated by a thin hairline. */
.perf-week-pill.is-dual { min-height: 118px; padding-bottom: 8px; }
.perf-week-pill.is-dual .perf-week-tier + .perf-week-tier {
  margin-top: 4px;
  border-top: 1px solid rgba(241, 238, 232, 0.06);
  padding-top: 6px;
}

.perf-week-pill.is-rest {
  background: rgba(10, 14, 14, 0.32);
  border-style: dashed;
  border-color: rgba(241, 238, 232, 0.10);
  cursor: default;
}
.perf-week-pill.is-rest .perf-week-pill-dow { opacity: 0.55; }
.perf-week-pill.is-rest .perf-week-pill-num { color: #8a9595; }

/* Today gets the gold-rail + gradient - selected-state visual contract.
   Layered above state tints so today's done/missed pill still reads as today. */
.perf-week-pill.is-today {
  border-color: rgba(212, 178, 106, 0.55);
  background: linear-gradient(90deg, rgba(212, 178, 106, 0.16) 0%, rgba(212, 178, 106, 0.05) 100%);
  box-shadow: inset 3px 0 0 0 #d4b26a;
}
.perf-week-pill.is-today .perf-week-pill-dow { color: #d4b26a; }
.perf-week-pill.is-today .perf-week-pill-num { color: #f1eee8; }

/* Mobile - narrow pill stack, slightly smaller text but keep the row 7-up
   on phones (Daily Timeline pattern). Below 360px we'd need a different
   layout; nobody's that narrow. */
@media (max-width: 480px) {
  .perf-week-row { gap: 4px; }
  .perf-week-pill { padding: 9px 4px 8px; min-height: 78px; }
  .perf-week-pill.is-dual { min-height: 108px; }
  .perf-week-pill-num { font-size: 15px; }
  .perf-week-tier-name { font-size: 10px; }
  .perf-week-tier-code { font-size: 10px; }
  .perf-week-tier-desc { font-size: 9px; }
  .perf-week-tier-from, .perf-week-tier-moved-to { font-size: 8px; }
}

/* ════════════════════════════════════════════════════════════════════
   Phase 4a - Cardio Add-on Module block (BRIEF-progressive-program-designer)
   A cardio block attached to a resistance session, rendered above/below the
   exercise list. Blue-mid (#5B9BB5) left rail - the WHOOP source-dot semantic,
   visually distinct from the gold today-rail and the exercise cards.
   ════════════════════════════════════════════════════════════════════ */
.cardio-block {
  background: rgba(10, 14, 14, 0.50);
  border: 1px solid rgba(91, 155, 181, 0.28);
  border-radius: 16px;
  box-shadow: inset 3px 0 0 0 #5b9bb5;
  padding: 14px 16px 16px;
  margin: 14px 0;
}
.cardio-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cardio-block-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b9bb5;
}
.cardio-block-pos {
  font-size: 11px;
  font-weight: 600;
  color: #BCC6C4;
  background: rgba(91, 155, 181, 0.14);
  border: 1px solid rgba(91, 155, 181, 0.30);
  border-radius: 999px;
  padding: 3px 9px;
}
.cardio-block-presc {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}
.cardio-block-type {
  font-size: 15px;
  font-weight: 700;
  color: #f1eee8;
}
.cardio-block-meta {
  font-size: 13px;
  color: #BCC6C4;
}
.cardio-block-cta {
  display: block;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(91, 155, 181, 0.45);
  background: rgba(91, 155, 181, 0.16);
  color: #EEF3F1;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.cardio-block-cta:hover { background: rgba(91, 155, 181, 0.24); border-color: rgba(91, 155, 181, 0.65); }
.cardio-block-cta:active { opacity: 0.78; }
.cardio-block-cta:focus-visible { outline: 2px solid #5b9bb5; outline-offset: 2px; }

/* Pending - completion gate fired (lifts done, cardio outstanding). */
.cardio-block--pending {
  border-color: rgba(91, 155, 181, 0.6);
  box-shadow: inset 3px 0 0 0 #5b9bb5, 0 0 0 2px rgba(91, 155, 181, 0.28);
}

/* Done - module logged. Rail stays blue; row reads as a confirmation. */
.cardio-block--done { background: rgba(10, 14, 14, 0.36); }
.cardio-block-done-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cardio-block-check {
  flex: 0 0 auto;
  color: #6CD693;
  font-weight: 800;
  font-size: 14px;
}
.cardio-block-done-txt {
  font-size: 13px;
  color: #BCC6C4;
}

/* ── Log-cardio modal (reuses .bio-modal-overlay / .bio-modal base) ── */
.cardio-log-body { margin-top: 14px; }
.cardio-log-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cardio-log-field { display: flex; flex-direction: column; gap: 5px; }
.cardio-log-field--full { margin-top: 12px; }
.cardio-log-field label {
  font-size: 12px;
  font-weight: 600;
  color: #8F9A98;
}
.cardio-log-field input,
.cardio-log-field textarea {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(241, 238, 232, 0.14);
  background: rgba(10, 14, 14, 0.55);
  color: #EEF3F1;
  font-size: 16px; /* ≥16px avoids iOS auto-zoom */
  padding: 10px 12px;
}
.cardio-log-field textarea { min-height: 60px; resize: vertical; line-height: 1.4; }
.cardio-log-field input:focus,
.cardio-log-field textarea:focus {
  outline: none;
  border-color: #5b9bb5;
}
.cardio-log-save {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid #5b9bb5;
  background: rgba(91, 155, 181, 0.22);
  color: #f1eee8;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 150ms ease, opacity 150ms ease;
}
.cardio-log-save:hover { background: rgba(91, 155, 181, 0.32); }
.cardio-log-save:active { opacity: 0.8; }
.cardio-log-save.saving { opacity: 0.6; cursor: default; }
.cardio-log-save:focus-visible { outline: 2px solid #5b9bb5; outline-offset: 2px; }

/* ── Phase 1b · Rest Timer + Audio (BRIEF-progressive-program-designer · Lane A)
 * Loaded after atlas-sections.css, so these rules supersede the legacy
 * ring-timer .rest-btn styles there (equal specificity, later wins). The old
 * .rest-ring / .rest-countdown rules become dead - markup no longer emits them.
 * Atlas tokens: gold #D4B26A, text #EEF3F1 / #BCC6C4 / #8F9A98. ───────────── */
.ex-rest-timer { margin: 4px 0 12px; display: block; }

.rest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--atlas-surface-card);
  border: 1px solid rgba(212,178,106,0.28);
  border-radius: 12px;
  color: #EEF3F1;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.rest-btn:hover { background: rgba(255,255,255,0.06); }
.rest-btn:active { background: rgba(255,255,255,0.08); }
.rest-btn:focus-visible { outline: 2px solid #D4B26A; outline-offset: 2px; }

.rest-btn-face { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rest-btn-icon { display: inline-flex; width: 16px; height: 16px; color: #D4B26A; flex: none; }
.rest-btn-icon svg { width: 16px; height: 16px; }
.rest-btn-text { font-variant-numeric: tabular-nums; }

/* Counting - number pinned left, Reset pinned right. */
.rest-btn.is-counting {
  justify-content: space-between;
  background: rgba(212,178,106,0.08);
  border-color: rgba(212,178,106,0.5);
  color: #D4B26A;
}
.rest-btn.is-counting .rest-btn-icon { display: none; }
.rest-btn.is-counting .rest-btn-text { font-size: 20px; font-weight: 700; }

.rest-btn-reset {
  display: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8F9A98;
  padding: 4px 8px;
  border-radius: 8px;
  flex: none;
}
.rest-btn.is-counting .rest-btn-reset { display: inline-flex; align-items: center; }
.rest-btn-reset:hover { color: #BCC6C4; }

/* Session-header speaker toggle (audio on/off for the whole session). */
.sess-audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  flex: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  color: #8F9A98;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.sess-audio-toggle svg { width: 18px; height: 18px; }
.sess-audio-toggle[aria-pressed="true"] {
  color: #D4B26A;
  border-color: rgba(212,178,106,0.3);
}
.sess-audio-toggle:hover { color: #BCC6C4; }
.sess-audio-toggle:focus-visible { outline: 2px solid #D4B26A; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .rest-btn, .sess-audio-toggle { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * DS v2 polish layer (9 Jul 2026) - additive. Deeper glass on the bar,
 * inset highlight, press scale on tabs. Geometry untouched.
 * ═══════════════════════════════════════════════════════════════════════════ */
.atlas-tabbar {
  background: rgba(10, 16, 16, 0.72);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 -12px 40px rgba(0, 0, 0, 0.45);
}
.atlas-tab { transition: color 160ms cubic-bezier(0.22,1,0.36,1), transform 160ms cubic-bezier(0.22,1,0.36,1); }
.atlas-tab:active { transform: scale(0.92); background: transparent; }
@media (prefers-reduced-motion: reduce) {
  .atlas-tab { transition: color 160ms; }
  .atlas-tab:active { transform: none; }
}

/* ── Keyboard chrome (20 Jul 2026) ──────────────────────────────────────
   Paired with _wireKeyboardChrome() in atlas-tabbar.js. While a text field
   is focused the tab bar is hidden (it otherwise rides on top of the
   keyboard) and a Done bar sits at the bottom so iOS has an explicit way to
   dismiss - without one the keyboard stays up with no exit. */
body.atlas-kb-open .atlas-tabbar { transform: translateY(110%); pointer-events: none; }
.atlas-tabbar { transition: transform 0.18s ease; }

.atlas-kb-done {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; justify-content: flex-end;
  padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
  background: #141719; border-top: 0.5px solid rgba(255, 255, 255, 0.10);
}
.atlas-kb-done.on { display: flex; }
/* 23 Jul 2026 (Harry) - gold pill button, not bare gold text. */
.atlas-kb-done-btn {
  background: linear-gradient(135deg, #E9CB84, #C9A557); border: 0; font-family: inherit;
  font-size: 14px; font-weight: 700; letter-spacing: 0.02em; color: #171207;
  padding: 9px 24px; min-height: 40px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(212,178,106,0.28), inset 0 1px 0 rgba(255,255,255,0.35);
}


/* ══════════════════════════════════════════════════════
   DS v3 (23 Jul 2026) — the Ask Atlas orb. 40px gold-gradient
   circle inline with the other tabs, Atlas A monogram in brand
   ink. svg display:block kills the inline-svg baseline offset
   so the A sits dead-centre. Approved vs gallery screens 02/03/05.
   ══════════════════════════════════════════════════════ */
.atlas-tab-ai { justify-content: center; }
.atlas-tab-orb {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #E9CB84, #C9A557);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 26px rgba(212,178,106,0.28);
}
.atlas-tab-orb svg { display: block; }
.atlas-tab-ai:active .atlas-tab-orb { transform: scale(0.96); }
