/* ═══════════════════════════════════════════════════════════════════════
   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) {

  /* ── 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: rgba(255, 255, 255, 0.02); }
  .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: #a8d36a;
    padding: 5px 14px;
    font-size: 10px;
    letter-spacing: 0.8px;
    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: #2E3E3E;
    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;
    overflow-y: auto;
    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: 2px;
    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: 1px;
    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: #a8d36a;
    box-shadow: 0 0 0 2px rgba(168, 211, 106, 0.2);
  }
  .atlas-more-id-chev {
    color: #7a8585;
    font-size: 14px;
  }

  /* Sections + rows */
  .atlas-more-section {
    font-size: 10px;
    color: #7a8585;
    letter-spacing: 1.2px;
    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: rgba(255, 255, 255, 0.03); }
  .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: #3A4D4D;
  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: #2E3E3E;
  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: 9.5px;
  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: #97c459; }
.perf-today-cta.is-missed .perf-today-cta-tile { background: #d85a30; color: #ffffff; }
.perf-today-cta.is-inprogress .perf-today-cta-tile {
  background: #97c459;
  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: 1.2px;
  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: 7px;
  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: #2E3E3E;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  padding: 14px 0 calc(20px + env(safe-area-inset-bottom));
  z-index: 980;
  max-height: 92vh;
  overflow-y: auto;
  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: 2px;
  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: 1.2px;
  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: 10.5px;
  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: 10.5px;
  color: #a8b3b3;
  letter-spacing: 0.8px;
  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: #3A4D4D;
  border: 0.5px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  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;
  padding: 8px 22px 0;
  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: #2E3E3E;
  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: #a8d36a;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(168, 211, 106, 0.4);
    animation: atlas-session-pulse 2s ease-in-out infinite;
  }
  @keyframes atlas-session-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168, 211, 106, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(168, 211, 106, 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(46, 62, 62, 0.97) 0%, rgba(46, 62, 62, 0.93) 100%);
  border: 0.5px solid rgba(212, 178, 106, 0.22);
  border-radius: 10px;
  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: #97c459;
  box-shadow: 0 0 0 0 rgba(151, 196, 89, 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(151, 196, 89, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(151, 196, 89, 0); }
}
.sess-live-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #97c459;
}
.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: 12.5px;
  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: #3A4D4D;
  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: 14px;
    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: 10.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  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: 10px;
  background: rgba(46, 62, 62, 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(46, 62, 62, 0.85); }
.sess-saveexit-btn:active { filter: brightness(0.92); }
.sess-saveexit-sub {
  font-size: 11.5px;
  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: 200; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
}
.atlas-postsess-backdrop.is-open { opacity: 1; pointer-events: auto; }

.atlas-postsess {
  position: fixed; z-index: 201;
  left: 50%; bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 540px;
  background: #3A4D4D;
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  border: 0.5px solid rgba(241, 238, 232, 0.08); border-bottom: 0;
  padding: 8px 4px 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);
  max-height: 92vh; overflow-y: auto;
  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: 2px;
}
@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: 10.5px; font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: #97c459;
  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(46, 62, 62, 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: 10.5px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #8a9595;
}
.atlas-postsess-q {
  padding: 14px 22px 4px;
}
.atlas-postsess-q-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 1.3px; 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(46, 62, 62, 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(46, 62, 62, 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;
}
.atlas-postsess-actions {
  display: flex; gap: 10px;
  padding: 16px 22px 6px;
  margin-top: 6px;
  border-top: 0.5px solid rgba(241, 238, 232, 0.06);
}
.atlas-postsess-btn {
  flex: 1;
  padding: 14px;
  border-radius: 9px;
  text-align: center;
  font-size: 13.5px; 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: #2E3E3E;
  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: 12.5px; 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: 11.5px; color: #8a9595;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.atlas-postsess-progression-side {
  display: flex; align-items: center; gap: 8px;
}
.atlas-postsess-progression-pill {
  font-size: 11.5px; font-weight: 600;
  padding: 5px 10px;
  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(46, 62, 62, 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: 11.5px; font-weight: 600;
  color: #8a9595;
  background: rgba(46, 62, 62, 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: 11.5px; 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(46,62,62,0) 0%, rgba(46,62,62,0.95) 35%, rgba(46,62,62,0.95) 100%);
  z-index: 10;
}
.atlas-interim-begin {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  background: #d4b26a;
  border: 0.5px solid #d4b26a;
  color: #2E3E3E;
  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 4px 18px rgba(212, 178, 106, 0.22);
}
.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: 14.5px; }
}

/* ────────────────────────────────────────────────────────────────────────
   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-headline {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #8a9595;
  padding: 0 4px 10px;
}
.perf-week-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.perf-week-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 12px 8px 11px;
  border-radius: 10px;
  background: rgba(46, 62, 62, 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(46, 62, 62, 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: 9.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  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: 10.5px;
  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: 6px;
  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: 10px;
  font-weight: 500;
  color: #c8d2d2;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
  padding: 0 1px;
  text-align: center;
}
.perf-week-tier-icon {
  font-size: 11px;
  font-weight: 700;
  color: #8a9595;
  line-height: 1;
}
.perf-week-tier-from {
  display: block;
  font-size: 8.5px;
  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(151, 196, 89, 0.16);
}
.perf-week-tier.is-done .perf-week-tier-icon { color: #97c459; }
.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; }

.perf-week-tier.is-inprogress {
  background: rgba(151, 196, 89, 0.18);
}
.perf-week-tier.is-inprogress .perf-week-tier-icon {
  color: #97c459;
  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: 8.5px;
  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(46, 62, 62, 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: 9.5px; }
  .perf-week-tier-from, .perf-week-tier-moved-to { font-size: 8px; }
}
