/* ============================================================
   APEX v3 — Complete Stylesheet
   Obsidian luxury wellness interface
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&display=swap');

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --void:             #080809;
  --obsidian:         var(--void);
  --deep:             #111113;
  --base:             #161619;
  --text-primary:     #F3F3F5;
  --text-muted:       #7E7E86;
  --text-faint:       #5C5C64;
  --accent:           #C5A059;
  --accent-muted:     #9A7D45;
  --tile-bg:          rgba(22, 22, 25, 0.4);
  --tile-bg-strong:   rgba(22, 22, 25, 0.65);
  --glass-bg:         var(--tile-bg);
  --glass-bg-strong:  var(--tile-bg-strong);
  --glass-border:     rgba(255, 255, 255, 0.04);
  --glass-border-hover: rgba(255, 255, 255, 0.08);
  --nav-bg:           rgba(17, 17, 19, 0.9);
  --dock-bg:          rgba(17, 17, 19, 0.95);
  --shell-border:     rgba(255, 255, 255, 0.03);
  --surface:          var(--tile-bg);
  --surface-2:        rgba(17, 17, 19, 0.85);
  --surface-hover:    rgba(28, 28, 31, 0.55);
  --border:           var(--glass-border);
  --border-glow:      rgba(197, 160, 89, 0.35);
  --electric:         var(--accent);
  --electric-dim:       var(--accent-muted);
  --electric-glow:      transparent;
  --electric-glow-2:    transparent;
  --amber:              var(--accent);
  --amber-glow:         transparent;
  --cta-bg:             #C5A059;
  --cta-fg:             #0a0a0b;
  --green:              #3D9A6E;
  --green-glow:         transparent;
  --red:                #C45C5C;
  --red-glow:           transparent;
  --white:              var(--text-primary);
  --muted:              var(--text-muted);
  --faint:              var(--text-faint);
  --skeleton-a:         #1a1a1d;
  --skeleton-b:         #2a2a2e;
  --font-display:       'DM Sans', sans-serif;
  --font-mono:          'DM Mono', monospace;
  --font-body:          'DM Sans', sans-serif;
  --radius:             12px;
  --radius-sm:          8px;
  --radius-lg:          12px;
  --radius-full:        9999px;
  --ease-premium:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-mechanical:    ease-out;
  --transition:         0.2s var(--ease-mechanical);
  --transition-view:    0.4s var(--ease-premium);
  --transition-theme:   0.5s var(--ease-premium);
  --shadow-sm:          none;
  --shadow-md:          none;
  --shadow-lg:          none;
  --glow-blue:          none;
  --glow-blue-2:        none;
  --glow-amber:         none;
}

[data-theme="light"] {
  color-scheme: light;
  --void:             #F4F4F6;
  --obsidian:         var(--void);
  --deep:             #FFFFFF;
  --base:             #EBEBED;
  --text-primary:     #121214;
  --text-muted:       #707077;
  --text-faint:       #9A9AA1;
  --accent:           #8F6E35;
  --accent-muted:     #6F5428;
  --tile-bg:          rgba(255, 255, 255, 0.6);
  --tile-bg-strong:   rgba(255, 255, 255, 0.88);
  --glass-bg:         var(--tile-bg);
  --glass-bg-strong:  var(--tile-bg-strong);
  --glass-border:     rgba(0, 0, 0, 0.04);
  --glass-border-hover: rgba(0, 0, 0, 0.08);
  --nav-bg:           rgba(255, 255, 255, 0.92);
  --dock-bg:          rgba(255, 255, 255, 0.95);
  --shell-border:     rgba(0, 0, 0, 0.04);
  --surface:          var(--tile-bg);
  --surface-2:        rgba(235, 235, 237, 0.95);
  --surface-hover:    rgba(255, 255, 255, 0.98);
  --border:           var(--glass-border);
  --border-glow:      rgba(143, 110, 53, 0.28);
  --electric:         var(--accent);
  --electric-dim:       var(--accent-muted);
  --electric-glow:      transparent;
  --electric-glow-2:    transparent;
  --amber:              var(--accent);
  --amber-glow:         transparent;
  --cta-bg:             #8F6E35;
  --cta-fg:             #FFFFFF;
  --green:              #2F7A57;
  --green-glow:         transparent;
  --red:                #B44A4A;
  --red-glow:           transparent;
  --white:              var(--text-primary);
  --muted:              var(--text-muted);
  --faint:              var(--text-faint);
  --skeleton-a:         #e8e8ec;
  --skeleton-b:         #d4d4da;
  --glow-blue:          none;
  --glow-blue-2:        none;
  --glow-amber:         none;
}

/* ── Reset & Baseline ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  transition: background-color var(--transition-theme), color var(--transition-theme);
}

body {
  background: var(--void);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  transition: background-color var(--transition-theme), color var(--transition-theme);
}

body.apex-app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.apex-viewport {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--void);
  display: flex;
  flex-direction: column;
  user-select: none;
}

.apex-viewport input,
.apex-viewport textarea,
.apex-viewport [contenteditable="true"] {
  user-select: text;
}

@media (min-width: 768px) {
  .apex-viewport {
    flex-direction: row;
  }
}

.apex-ambient,
.apex-aura,
.apex-aura--gold,
.apex-aura--recovery {
  display: none !important;
}

.apex-theme-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.apex-theme-toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  transition: all var(--transition-theme);
}

.apex-theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: none;
  transition: transform var(--transition-theme), background var(--transition-theme);
}

[data-theme="light"] .apex-theme-toggle-thumb,
html.light .apex-theme-toggle-thumb {
  transform: translateX(20px);
}

.apex-theme-toggle:focus-visible .apex-theme-toggle-track {
  outline: 2px solid var(--electric);
  outline-offset: 2px;
}

.apex-main-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.apex-workspace {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  transition: opacity var(--transition);
}

.apex-workspace-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.apex-glass,
.bio-card,
.telemetry-tile,
.glass-panel,
.card,
.dashboard-card {
  background: var(--tile-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition), background var(--transition-theme);
}

.glass-panel,
.card,
.bio-card,
.telemetry-tile {
  padding: 1.25rem;
}

.apex-glass:hover,
.bio-card:hover,
.telemetry-tile:hover,
.glass-panel:hover,
.dashboard-card:hover,
.suggestion-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.biometric-readout {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1;
}
.telemetry-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 6px;
}
.supplement-picker-btn {
  border: 1px solid var(--glass-border);
  background: var(--tile-bg);
  transition: border-color var(--transition), transform var(--transition), background var(--transition-theme);
}
.supplement-picker-btn:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}
.supplement-picker-btn.is-active {
  border-color: var(--accent);
  background: var(--tile-bg-strong);
}

.apex-display-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--white);
  line-height: 1.05;
}

.apex-meta-label,
.section-label {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
}

.bio-metric,
.stat-box-val,
.momentum-gauge span,
.msg-limit-label,
.pricing-proof-item strong {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.apex-skeleton-grid {
  display: grid;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.apex-skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--skeleton-a) 0%, var(--skeleton-b) 50%, var(--skeleton-a) 100%);
  background-size: 200% 100%;
  animation: apexShimmer 1.8s ease-in-out infinite;
}

.apex-skeleton--hero { height: 120px; }
.apex-skeleton--row { height: 72px; }
.apex-skeleton--card { height: 180px; }

@keyframes apexShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes apexMsgIn {
  0% { opacity: 0; transform: translateY(8px); }
  40% { opacity: 0.65; }
  100% { opacity: 1; transform: translateY(0); }
}

.msg-row.msg-enter {
  animation: apexMsgIn 0.42s var(--ease-premium) both;
}

body.apex-marketing-page {
  min-height: 100vh;
  background: var(--void);
}

.apex-page-center {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.apex-page-center::before {
  display: none;
}

.apex-page-center > * {
  position: relative;
  z-index: 1;
}

/* Guest vs member UI boundaries */
body.is-guest .member-only {
  display: none !important;
}

body:not(.is-guest) .guest-only {
  display: none !important;
}

.guest-access-card {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}

/* ── Customizable Scrollbars ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--deep); }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--electric-dim); }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--white);
}
p { color: var(--muted); line-height: 1.7; }
a { color: var(--electric); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--white); }
code, pre { font-family: var(--font-mono); }

/* ── Responsive Multi-Tab Shell Layout ── */
.app-layout {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--void);
}

@media (min-width: 768px) {
  .app-layout {
    flex-direction: row;
  }
}

/* ── Desktop Sidebar ── */
.sidebar,
.apex-nav-rail {
  background: var(--nav-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-right: 1px solid var(--shell-border);
  z-index: 50;
  transition: background var(--transition-theme), border-color var(--transition-theme);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  height: 100%;
  overflow-y: auto;
  width: 100%;
  flex-shrink: 0;
  transition: border-color var(--transition);
}

@media (min-width: 768px) {
  .apex-nav-rail--collapsible {
    width: 5rem;
    padding: 1rem;
    overflow: hidden;
    transition: width 0.3s var(--ease-mechanical), padding var(--transition);
  }

  .apex-nav-rail--collapsible:hover {
    width: 16rem;
    padding: 1rem 1.25rem;
  }

  .apex-nav-rail--collapsible .sidebar-logo-label,
  .apex-nav-rail--collapsible .sidebar-link-label,
  .apex-nav-rail--collapsible .sidebar-user-name,
  .apex-nav-rail--collapsible .sidebar-tier-text,
  .apex-nav-rail--collapsible .sidebar-upgrade-banner,
  .apex-nav-rail--collapsible #sidebarAuthBtn,
  .apex-nav-rail--collapsible .apex-footer-compact {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-mechanical);
  }

  .apex-nav-rail--collapsible:hover .sidebar-logo-label,
  .apex-nav-rail--collapsible:hover .sidebar-link-label,
  .apex-nav-rail--collapsible:hover .sidebar-user-name,
  .apex-nav-rail--collapsible:hover .sidebar-tier-text,
  .apex-nav-rail--collapsible:hover .sidebar-upgrade-banner,
  .apex-nav-rail--collapsible:hover #sidebarAuthBtn,
  .apex-nav-rail--collapsible:hover .apex-footer-compact {
    opacity: 1;
    pointer-events: auto;
  }

  .apex-nav-rail--collapsible .sidebar-upgrade-banner {
    margin-bottom: 0;
    max-height: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    transition:
      opacity 0.2s var(--ease-mechanical),
      max-height 0.3s var(--ease-mechanical),
      padding 0.3s var(--ease-mechanical),
      margin 0.3s var(--ease-mechanical);
  }

  .apex-nav-rail--collapsible:hover .sidebar-upgrade-banner {
    margin-bottom: 12px;
    max-height: 200px;
    padding: 14px 12px;
    border: 1px solid rgba(212, 162, 74, 0.22);
  }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 1.5rem;
  white-space: nowrap;
}
.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  flex-shrink: 0;
}
.sidebar-logo .logo-icon svg { width: 18px; height: 18px; fill: #050506; }

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition), background var(--transition), transform var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.sidebar-link-label {
  transition: opacity 0.2s var(--ease-mechanical);
}
.sidebar-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.06);
}
.sidebar-link.active {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 140px;
}
.sidebar-user-name {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: var(--void);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-bottom: 1px solid var(--shell-border);
  gap: 12px;
  z-index: 10;
  flex-shrink: 0;
  transition: all var(--transition-theme);
}

.main-viewport,
.apex-workspace {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 1rem 1rem 4rem;
  position: relative;
  transition: opacity var(--transition-view), background var(--transition-theme);
}

@media (min-width: 768px) {
  .main-viewport,
  .apex-workspace {
    padding: 1.25rem 1.5rem 1.5rem;
  }
}

/* ── Responsive utilities (Tailwind-equivalent: md = 768px+) ── */
.md-only { display: none !important; }
.mobile-only { display: block; }

@media (min-width: 768px) {
  .md-only { display: revert !important; }
  .mobile-only { display: none !important; }
}

/* ── Mobile Bottom Navigation ── */
.bottom-nav {
  display: none;
}

#panel-chat .panel-intro { display: none !important; }

@media (max-width: 767px) {
  /* Viewport lock — no horizontal drift or document bounce */
  html,
  body.apex-app {
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior: none;
  }

  .apex-mobile-shell,
  .app-layout,
  .main-content {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-layout {
    grid-template-columns: 1fr;
    height: 100dvh;
  }

  .mobile-decline,
  .sidebar {
    display: none !important;
  }

  .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    padding: 8px 12px;
    min-height: 44px;
    background: rgba(15, 15, 17, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 30;
  }

  .mobile-top-logo {
    display: flex !important;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
  }

  .main-content {
    background: var(--void);
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
  }

  .main-viewport {
    position: relative;
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
  }

  .panel-intro,
  .mobile-secondary {
    display: none !important;
  }

  .panel.mobile-decline {
    display: none !important;
  }

  /* Single-focus: one mobile pane fills the shell */
  .main-viewport > .panel.mobile-pane {
    flex: 1;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    animation: none;
    opacity: 1;
    transform: none;
  }

  .main-viewport > .panel.active:not(.mobile-pane) {
    display: none !important;
  }

  .main-viewport > .panel.mobile-pane.active {
    display: flex !important;
  }

  .mobile-focus-pane.active {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: var(--void);
  }

  /* Mobile typography — compact, high contrast */
  .mobile-pane h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
  }

  .mobile-pane h2 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
  }

  .mobile-pane p,
  .mobile-pane .input-hint {
    font-size: 0.84rem;
    color: #707077;
    line-height: 1.55;
  }

  [data-theme="dark"] .mobile-pane p {
    color: var(--text-muted);
  }

  .mobile-pane .section-label {
    font-size: 9px;
    letter-spacing: 0.22em;
    color: var(--accent);
  }

  .mobile-pane .telemetry-tile {
    padding: 14px;
    border-radius: var(--radius);
  }

  /* Fixed bottom dock — thumb ergonomics */
  .bottom-nav,
  .apex-dock,
  .apex-mobile-dock,
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    min-height: 64px;
    background: rgba(15, 15, 17, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem;
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
    z-index: 50;
  }

  [data-theme="light"] .apex-mobile-dock {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.04);
  }

  .bottom-btn,
  .apex-dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
    background: none;
    border: none;
    color: #71717a;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    flex: 1;
    max-width: 88px;
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-btn svg,
  .apex-dock-btn svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
  }

  .bottom-btn.active,
  .apex-dock-btn.active {
    color: var(--accent);
  }

  .apex-dock-label {
    color: inherit;
  }

  /* Coach tab — scroll + pinned input */
  body.is-mobile-layout[data-mobile-tab="coach"] .main-viewport {
    padding-bottom: 0;
  }

  body.is-mobile-layout[data-mobile-tab="coach"] #panel-chat.active,
  body.is-mobile-layout.chat-tab-active #panel-chat.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .mobile-scroll-pane,
  body.is-mobile-layout.chat-tab-active .chat-messages {
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px calc(64px + 80px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .mobile-chat-welcome h2 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .mobile-chat-welcome p {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 28rem;
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .mobile-thumb-zone,
  body.is-mobile-layout.chat-tab-active .chat-input-area {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    flex-shrink: 0;
    padding: 8px 10px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(15, 15, 17, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  [data-theme="light"] body.is-mobile-layout[data-mobile-tab="coach"] .mobile-thumb-zone {
    background: rgba(255, 255, 255, 0.96);
    border-top-color: rgba(0, 0, 0, 0.04);
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .input-hint,
  body.is-mobile-layout[data-mobile-tab="coach"] .chat-input-area .help-wrap {
    display: none !important;
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .chat-textarea {
    min-height: 44px;
    font-size: 16px;
    padding: 12px 14px;
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .send-btn {
    width: 44px;
    height: 44px;
  }

  body.is-mobile-layout[data-mobile-tab="coach"] .msg-limit-bar {
    margin-bottom: 6px !important;
  }

  /* Metrics + Profile scroll regions */
  #panel-progress.active,
  #panel-account.active,
  #panel-dashboard.active,
  #panel-plans.active,
  #panel-nutrition.active,
  #panel-meals.active,
  #panel-supplements.active {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px calc(64px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  #panel-progress .panel-intro {
    display: none !important;
  }

  #panel-progress #progressAuthGate h2,
  #panel-progress .mobile-pane-title {
    font-size: 1.15rem !important;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .dashboard-header,
  .momentum-gauge,
  .quick-log-command-row {
    display: none !important;
  }
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .mobile-top-logo { display: none !important; }
  .apex-theme-toggle--mobile { display: none; }
}

@media (max-width: 767px) {
  .sidebar .apex-theme-toggle { display: none; }
}

/* ── Views Shell (Active toggling) ── */
.main-viewport > .panel {
  display: none !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition-view), transform var(--transition-view);
}
.main-viewport > .panel.active {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
}

.apex-workspace-pane {
  position: relative;
  isolation: isolate;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--cta-bg);
  color: var(--cta-fg);
  border: 1px solid var(--glass-border);
  transition: transform var(--transition), opacity var(--transition-theme);
}
.btn-primary::before {
  display: none;
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: scale(0.99);
}

.btn-outline {
  background: transparent;
  color: var(--electric);
  border: 1.5px solid var(--electric);
}
.btn-outline:hover {
  background: var(--electric-glow);
  color: var(--electric);
}

.btn-ghost {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--white); }

.btn-danger {
  background: rgba(184,76,58,0.10);
  color: var(--red);
  border: 1px solid rgba(184,76,58,0.22);
}
.btn-danger:hover { background: rgba(184,76,58,0.16); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1.08rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }

/* ── Forms ── */
.input, .select {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--white);
  outline: none;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: none;
}
.input::placeholder { color: var(--faint); }

.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b5c46'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.badge-blue   { background: var(--tile-bg); color: var(--accent); border: 1px solid var(--glass-border); }
.badge-green  { background: var(--green-glow); color: var(--green); border: 1px solid rgba(16,185,129,0.24); }
.badge-amber  { background: var(--tile-bg); color: var(--accent); border: 1px solid var(--glass-border); }
.badge-red    { background: var(--red-glow); color: var(--red); border: 1px solid rgba(248,113,113,0.24); }
.badge-pro {
  background: var(--surface-hover);
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--border-glow);
  box-shadow: none;
}

/* ── Whoop-Style Elements (Dashboard) ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .dashboard-grid {
    gap: 2rem;
  }
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  position: relative;
}

.dashboard-header h2 { font-size: 2rem; }
.dashboard-header p { font-size: 0.95rem; margin-top: 4px; }

/* Momentum Circle Gauge */
.momentum-gauge {
  --score: 0;
  width: 110px; height: 110px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 56%, transparent 57%),
    conic-gradient(var(--electric) calc(var(--score) * 1%), var(--border) 0);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  box-shadow: none;
  position: relative;
  transition: border-color var(--transition-theme);
}
.momentum-gauge span {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.momentum-gauge small {
  font-family: var(--font-body);
  font-size: 0.58rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: -24px;
}

/* Quick Actions Logger */
.quick-log-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto 24px;
}

.quick-log-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.quick-log-btn:hover {
  border-color: var(--electric);
  background: var(--electric-glow-2);
  transform: translateY(-2px);
}
.quick-log-btn svg { width: 22px; height: 22px; fill: var(--electric); }
.quick-log-btn span {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
}

@media (max-width: 767px) {
  .quick-log-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dashboard-header { flex-direction: column; gap: 20px; text-align: center; }
}

/* ── Inline Slide-Down Form overlay ── */
.slide-form-container {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto 20px;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.slide-form-container.active { display: block; }

/* ── Custom SVGs and Progress Charts ── */
.custom-chart-wrapper {
  margin-top: 16px;
  height: 60px;
  width: 100%;
  position: relative;
}
.chart-timeline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  width: 100%;
}
.chart-bar-point {
  flex: 1;
  background: var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.6s ease, background 0.3s ease;
  position: relative;
}
.chart-bar-point.active {
  background: linear-gradient(to top, var(--electric-dim), var(--electric));
}
.chart-bar-point:hover::after {
  content: attr(data-val);
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translate(-50%, -4px);
  background: var(--surface-2);
  border: 1px solid var(--border-glow);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--white);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* ── My Plans — personalized dashboard ── */
.plans-canvas {
  background: #09090B;
  border-radius: var(--radius);
  padding: 4px 0 8px;
}
.plans-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.plans-glass {
  background: rgba(22, 22, 28, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(39, 39, 42, 0.4);
  border-radius: var(--radius);
}
.plans-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #71717A;
  margin-bottom: 12px;
}
.plans-metric {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.plans-briefing-wrap {
  position: relative;
  width: 100%;
}
.plans-briefing-glow {
  display: none;
}
.plans-briefing-card {
  position: relative;
  z-index: 1;
  padding: 22px 28px;
}
.plans-briefing-copy {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: #D4D4D8;
  max-width: 920px;
}
.plans-briefing-name,
.plans-briefing-goal {
  color: var(--white);
  font-weight: 500;
}
.plans-briefing-emphasis {
  color: var(--electric);
  font-weight: 500;
}
.plans-timeline-section {
  padding: 4px 0;
}
.plans-timeline-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  padding: 8px 0 4px;
}
.plans-timeline-track::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 1px;
  background: rgba(39, 39, 42, 0.6);
  transform: translateY(-50%);
  z-index: 0;
}
.plans-timeline-node {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  padding: 0 6px;
}
.plans-timeline-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 14px 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: opacity var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.plans-timeline-day-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #71717A;
}
.plans-timeline-day-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.3;
}
.plans-timeline-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 14px;
  color: #52525B;
}
.plans-timeline-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: none;
}
.plans-timeline-node--past {
  opacity: 0.4;
}
.plans-timeline-node--past .plans-timeline-day-title {
  color: #71717A;
}
.plans-timeline-node--active .plans-timeline-card {
  border-color: var(--accent);
  box-shadow: none;
  background: var(--tile-bg);
}
.plans-timeline-node--active .plans-timeline-day-title {
  color: var(--white);
  font-weight: 600;
}
.plans-timeline-node--active .plans-timeline-day-label {
  color: var(--electric);
}
.plans-timeline-node--future {
  opacity: 0.3;
  filter: blur(0.3px);
}
.plans-coach-panel {
  padding: 22px 24px 20px;
}
.plans-coach-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  font-weight: 500;
}
.plans-coach-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plans-coach-note {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(39, 39, 42, 0.35);
  background: rgba(9, 9, 11, 0.45);
}
.plans-coach-note p {
  font-family: var(--font-display);
  font-size: 0.94rem;
  line-height: 1.65;
  color: #E4E4E7;
  font-weight: 400;
  letter-spacing: 0.01em;
}
@media (max-width: 720px) {
  .plans-timeline-track {
    flex-direction: column;
    gap: 10px;
    padding-top: 0;
  }
  .plans-timeline-track::before {
    display: none;
  }
  .plans-timeline-node {
    padding: 0;
  }
  .plans-timeline-card {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 14px 16px;
  }
}

/* ── Plans Section Layout ── */
.plan-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.plan-day-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all var(--transition);
}
.plan-day-card:hover { border-color: var(--border-glow); }
.plan-day-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--electric);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.plan-exercise-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-exercise-item {
  font-size: 0.88rem;
  color: var(--white);
  display: flex;
  justify-content: space-between;
}
.plan-exercise-meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* Macro visual graph split */
.macro-chart {
  display: flex;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.macro-part { height: 100%; text-align: center; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; color: var(--void); display: flex; align-items: center; justify-content: center; }
.macro-part.carb { background: var(--electric); }
.macro-part.protein { background: var(--amber); }
.macro-part.fat { background: var(--green); }
.macro-part.carb, .macro-part.fat { color: #ffffff; }
.macro-part.protein { color: var(--electric); }

/* ── Progress logs list ── */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.history-table th {
  background: var(--surface);
  padding: 10px 14px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
  border-bottom: 1px solid var(--border);
}
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.history-table tr:hover td { background: rgba(255,255,255,0.015); color: var(--white); }
.history-table tr:last-child td { border-bottom: none; }

/* ── AI Coach Chat Experience ── */
#panel-chat.active {
  height: 100%;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.chat-messages::-webkit-scrollbar { display: none; }

.msg-row {
  display: flex; gap: 12px;
  animation: fadeUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.msg-row.user { justify-content: flex-end; }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 800; flex-shrink: 0; align-self: flex-start;
}
.msg-avatar.apex {
  background: var(--accent);
  color: var(--cta-fg);
  box-shadow: none;
}
.msg-avatar.user { background: var(--surface-2); border: 1px solid var(--border); }

.msg-body { max-width: 76%; display: flex; flex-direction: column; gap: 6px; }
.msg-row.user .msg-body { align-items: flex-end; }
.msg-name {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.msg-bubble {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.65;
}

.msg-bubble.apex {
  background: var(--tile-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  box-shadow: none;
}

.msg-bubble.user {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  font-weight: 500;
  box-shadow: none;
}

/* Markdown parsing inside Coach bubbles */
.msg-bubble strong { font-weight: 700; color: var(--electric); }
.msg-bubble.user strong { color: #ffffff; }
.msg-bubble em { font-style: italic; color: var(--muted); }
.msg-bubble ul, .msg-bubble ol { margin: 8px 0 8px 20px; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 8px;
  color: var(--white);
}
.msg-bubble.user h1, .msg-bubble.user h2, .msg-bubble.user h3 { color: #ffffff; }
.msg-bubble h1:first-child, .msg-bubble h2:first-child, .msg-bubble h3:first-child { margin-top: 0; }
.msg-bubble pre {
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 0.8rem;
}
.msg-bubble pre code { background: none; border: none; padding: 0; color: var(--white); }
.msg-bubble hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

.msg-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.msg-time { font-family: var(--font-mono); font-size: 0.65rem; color: var(--faint); }

.msg-limit-bar {
  background: var(--tile-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 8px 12px;
  box-shadow: none;
}
.msg-limit-track {
  height: 3px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: rgba(63,63,70,0.55);
  margin-bottom: 7px;
}
.msg-limit-fill {
  height: 100%;
  border-radius: inherit;
  background: #A1A1AA;
  transition: width var(--transition);
}
.msg-limit-label {
  color: #A1A1AA;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}
.msg-limit-bar.concierge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}
.msg-limit-bar.concierge .msg-limit-track {
  display: none;
}
.msg-limit-bar.concierge .msg-limit-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.2em;
}
.concierge-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: none;
}

.chat-input-area {
  flex-shrink: 0;
  border-top: 1px solid var(--shell-border);
  padding: 16px;
  background: var(--dock-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: all var(--transition-theme);
}
.chat-input-row {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.chat-textarea {
  width: 100%;
  min-height: 52px;
  max-height: 140px;
  resize: none;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--white);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.45;
  outline: none;
}
.chat-textarea:focus {
  border-color: var(--accent);
  box-shadow: none;
}
.send-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--cta-bg);
  color: var(--cta-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}
.send-btn:active {
  transform: scale(0.99);
}
.send-btn svg { width: 22px; height: 22px; fill: currentColor; }
.chat-context-chip {
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(22,22,28,0.54);
  color: var(--muted);
  padding: 6px 11px;
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
}
.chat-context-chip:hover {
  border-color: var(--border-glow);
  color: var(--electric);
}
.input-hint {
  max-width: 860px;
  margin: 8px auto 0;
  color: var(--faint);
  font-size: 0.72rem;
}

/* Coach mobile scroll/input: see consolidated block above (data-mobile-tab="coach") */

.copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--faint); font-size: 0.68rem; padding: 2px 6px;
  border-radius: var(--radius-sm); font-family: var(--font-body);
  transition: all var(--transition);
}
.copy-btn:hover { color: var(--electric); background: var(--electric-glow); }
.copy-btn.copied { color: var(--green); }

/* Quick onboarding split */
.coach-suggestions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}
.suggestion-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.suggestion-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  cursor: pointer;
  transition: all var(--transition);
}
.suggestion-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}
.suggestion-card h4 { font-size: 0.95rem; color: var(--white); margin-bottom: 4px; }
.suggestion-card p { font-size: 0.8rem; }

/* Typing indicator */
.typing-row { display: flex; gap: 12px; animation: fadeIn 0.2s ease; max-width: 860px; width: 100%; margin: 0 auto; }
.typing-bubble {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); border-bottom-left-radius: 4px;
  padding: 14px 18px; display: flex; gap: 5px; align-items: center;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--electric); animation: pulse 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(22,22,28,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--white);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  min-width: 280px;
  max-width: 380px;
}
.toast.toast-visible { opacity: 1; transform: translateY(0); }
.toast.toast-hiding { opacity: 0; transform: translateY(8px); }
.toast.toast-success { border-color: rgba(74,124,89,0.38); }
.toast.toast-error { border-color: rgba(184,76,58,0.38); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Modals & Overlays ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(5, 5, 6, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease-out;
  transition: opacity var(--transition);
}

.modal {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  animation: fadeUp 0.5s var(--ease-premium) both;
  position: relative;
  transition: all var(--transition-theme);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--electric), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--white); background: var(--border-glow); }

.guest-limit-modal {
  z-index: 850;
  background: rgba(8, 8, 9, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.guest-limit-card {
  max-width: 420px;
  width: min(420px, calc(100vw - 32px));
  text-align: center;
  border: 1px solid rgba(197, 160, 89, 0.28);
  background: linear-gradient(180deg, rgba(22, 22, 25, 0.98) 0%, rgba(15, 15, 17, 0.98) 100%);
  box-shadow: none;
}

[data-theme="light"] .guest-limit-card {
  border-color: rgba(143, 110, 53, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f6 100%);
}

body.guest-chat-locked .chat-input-area {
  opacity: 0.72;
}

body.guest-chat-locked .chat-textarea:disabled,
body.guest-chat-locked .send-btn:disabled,
body.coach-chat-locked .chat-textarea:disabled,
body.coach-chat-locked .send-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-input-area {
  position: relative;
}

.coach-paywall-wall {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 24px;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(8, 8, 9, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Spec: backdrop-blur-md bg-[#080809]/80 */
.coach-paywall-wall.coach-paywall-wall--active {
  backdrop-filter: blur(12px);
  background-color: rgba(8, 8, 9, 0.8);
}

.coach-paywall-wall[hidden] {
  display: none !important;
}

.coach-paywall-readout {
  margin: 0;
  max-width: 520px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  line-height: 1.65;
  color: var(--text-primary);
  text-transform: uppercase;
}

body.is-premium .coach-paywall-wall,
body.is-premium [data-tier-gate],
body.is-premium .tier-gate-only,
body.is-premium .pro-gate-element {
  display: none !important;
}

.sidebar-upgrade-banner {
  margin-bottom: 12px;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 162, 74, 0.22);
  background: linear-gradient(145deg, rgba(212, 162, 74, 0.08), rgba(8, 8, 9, 0.4));
}

.tier-gate-gold {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d4a24a;
  line-height: 1.5;
}

.dashboard-upgrade-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid rgba(212, 162, 74, 0.2);
  background: linear-gradient(135deg, rgba(212, 162, 74, 0.07), rgba(8, 8, 9, 0.35));
}

.progress-premium-analytics-slot {
  margin-top: 8px;
}

.premium-analytics-gate {
  position: relative;
  min-height: 200px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.premium-analytics-gate-blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 8, 9, 0.55);
}

.premium-analytics-gate-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.premium-analytics-gate-label {
  margin: 0;
  max-width: 420px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}

.premium-analytics-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.premium-analytics-tile {
  padding: 22px 20px;
}

.premium-analytics-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.premium-analytics-meta {
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── Section labels & markers ── */
.section-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--electric);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before, .section-label::after {
  content: '';
  height: 1px;
  background: var(--electric);
  opacity: 0.25;
  flex: 1;
  max-width: 36px;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--electric);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* Noise overlay */
body::before {
  display: none;
}

/* ── Nav (Preserved for Landing, Pricing and Billing Pages) ── */
.nav,
.apex-nav-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--nav-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-bottom: 1px solid var(--shell-border);
  transition: all var(--transition-theme);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--white);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--electric);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.logo-icon svg { width: 18px; height: 18px; fill: #050506; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links .apex-theme-toggle {
  display: inline-flex;
  vertical-align: middle;
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-transform: uppercase;
}

.nav-links a:hover { color: var(--white); background: var(--surface); }

/* ── Site-wide footer (legal / Paddle compliance) ── */
.apex-site-footer {
  margin-top: 48px;
  padding: 32px 20px 40px;
  text-align: center;
  border-top: 1px solid var(--border);
}

.apex-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--white);
  text-transform: uppercase;
}

.apex-footer-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--electric), var(--electric-dim));
}

.apex-footer-logo-icon svg {
  width: 16px;
  height: 16px;
  fill: var(--void);
}

.apex-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-bottom: 14px;
}

.apex-footer-link {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
}

.apex-footer-link:hover {
  color: var(--electric);
}

.apex-footer-link--muted {
  color: var(--faint);
}

.apex-footer-tagline {
  font-size: 0.85rem;
  color: var(--faint);
  max-width: 520px;
  margin: 0 auto 10px;
  line-height: 1.6;
}

.apex-footer-copy {
  font-size: 0.78rem;
  color: var(--faint);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.apex-footer-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.apex-footer-compact a {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.apex-footer-compact a:hover {
  color: var(--electric);
}

.apex-legal-inline {
  font-size: 0.76rem;
  color: var(--faint);
  line-height: 1.65;
  text-align: center;
  margin: 0;
}

.apex-legal-inline a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.apex-legal-inline a:hover {
  color: var(--electric);
}

.pricing-legal-notice {
  margin-top: 12px;
  font-size: 0.76rem;
  color: var(--faint);
  line-height: 1.6;
  text-align: center;
}

.pricing-legal-notice a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pricing-legal-notice a:hover {
  color: var(--electric);
}

.auth-legal-note {
  font-size: 0.72rem;
  text-align: center;
  margin-top: 12px;
  line-height: 1.55;
  color: var(--faint);
}

.auth-legal-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal-note a:hover {
  color: var(--electric);
}

@media (max-width: 480px) {
  .apex-footer-nav {
    gap: 8px 12px;
  }
  .apex-footer-link {
    font-size: 0.68rem;
  }
}

/* ── Progress panel (Log / History / Trends) ── */
.progress-panel-root {
  padding: 0 24px 32px;
}

.progress-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.progress-subtab {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.progress-subtab.active {
  background: var(--accent, var(--electric));
  border-color: var(--accent, var(--electric));
  color: var(--bg-primary, #0a0a0b);
}

.progress-section {
  display: none;
}

.progress-section.active {
  display: block;
}

.progress-log-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-log-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface, rgba(255, 255, 255, 0.02));
}

.progress-log-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-size: 0.95rem;
}

.progress-log-card-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.progress-log-card-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.progress-log-card-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.progress-log-card.is-expanded .progress-log-card-body {
  display: block;
  padding-top: 16px;
}

.progress-weight-input {
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 2rem;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-primary);
  color: var(--white);
  margin-bottom: 12px;
}

.progress-unit-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-unit-toggle button {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.progress-unit-toggle button.active {
  background: var(--accent, var(--electric));
  color: var(--bg-primary, #0a0a0b);
}

.progress-target-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.progress-field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress-field-label .progress-live-pct {
  color: var(--accent, var(--electric));
  margin-left: 6px;
}

.progress-macro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.progress-macro-cell input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--white);
}

.progress-macro-target {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}

.progress-exercise-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.progress-exercise-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--white);
  font-size: 0.88rem;
}

.progress-exercise-row input.progress-ex-name {
  flex: 1;
  min-width: 0;
}

.progress-exercise-row input.progress-ex-sm {
  width: 48px;
  text-align: center;
  font-family: var(--font-mono);
}

.progress-exercise-row input.progress-ex-weight {
  width: 64px;
  font-family: var(--font-mono);
}

.progress-ex-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
}

.progress-ex-remove:hover {
  color: #c45c5c;
}

.progress-rpe-row {
  margin: 14px 0;
}

.progress-rpe-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.progress-rpe-pill {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
}

.progress-rpe-pill.active {
  background: rgba(212, 162, 74, 0.25);
  border-color: #d4a24a;
  color: #d4a24a;
}

.progress-scale-row {
  margin: 14px 0;
}

.progress-sleep-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  text-align: center;
  color: var(--white);
  margin-bottom: 8px;
}

.progress-sleep-slider {
  width: 100%;
  accent-color: var(--accent, var(--electric));
}

.progress-scale-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.progress-scale-pill {
  flex: 1;
  min-width: 72px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
}

.progress-scale-pill.active {
  border-color: var(--accent, var(--electric));
  background: rgba(201, 169, 110, 0.12);
  color: var(--white);
}

.progress-input-sm {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--white);
  margin-bottom: 12px;
}

.progress-history-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.progress-history-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 8px;
}

.progress-history-date:first-child {
  margin-top: 0;
}

.progress-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.progress-history-row:last-child {
  border-bottom: none;
}

.progress-history-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.progress-history-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.progress-history-value {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-history-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.progress-history-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.progress-history-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 6px;
  position: relative;
}

.progress-history-delete.is-confirm {
  color: #c45c5c;
  background: rgba(196, 92, 92, 0.12);
}

.progress-history-delete[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: -22px;
  font-size: 0.65rem;
  color: #c45c5c;
  white-space: nowrap;
  pointer-events: none;
}

.progress-trends-ranges {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.progress-trends-range {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.progress-trends-range.active {
  background: var(--accent, var(--electric));
  border-color: var(--accent, var(--electric));
  color: var(--bg-primary, #0a0a0b);
}

.progress-chart-block {
  margin-bottom: 28px;
}

.progress-chart-heading {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.progress-chart-wrap {
  position: relative;
  height: 200px;
}

.progress-chart-wrap--tall {
  height: 220px;
}

.progress-chart-empty {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 24px 0;
  text-align: center;
}

.progress-chart-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

@media (max-width: 767px) {
  .progress-panel-root {
    padding: 0 16px 24px;
  }
  .progress-macro-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ══════════════════════════════════════════════════════════
   Mobile optimization pass (≤768px) — feature parity
   ══════════════════════════════════════════════════════════ */
.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  /* TASK 13 — hide scrollbars, keep scroll */
  * {
    scrollbar-width: none;
  }
  *::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* TASK 4 — typography */
  body.apex-app,
  body.apex-marketing-page,
  body.pricing-page {
    font-size: 15px;
    line-height: 1.6;
  }

  .panel,
  .telemetry-tile,
  .modal,
  .plan-day-card,
  .progress-log-card,
  .goal-block,
  .coach-summary-card,
  .program-ready-banner {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  h1,
  .panel-intro h1,
  .mobile-pane h1 {
    font-size: min(1.2rem, 1.2rem) !important;
  }

  h2,
  .mobile-pane h2,
  .plan-session-title {
    font-size: min(1.2rem, 1.2rem) !important;
  }

  .steps-today-number,
  .goal-pct-value,
  .profile-weight-input,
  .progress-weight-input,
  .proof-num,
  .stat-box-val {
    font-size: min(2.2rem, 2.2rem) !important;
  }

  /* TASK 2 — bottom navigation */
  .mobile-nav,
  .bottom-nav.apex-mobile-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    min-height: 64px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: stretch;
    z-index: 100;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-nav-btn,
  .mobile-nav .bottom-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    max-width: none;
    min-height: 64px;
    padding: 6px 2px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-btn svg,
  .mobile-nav .bottom-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .mobile-nav-label,
  .mobile-nav .apex-dock-label {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: none;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .mobile-nav-btn.active,
  .mobile-nav .bottom-btn.active {
    color: var(--accent, var(--electric));
  }

  body.keyboard-open .mobile-nav {
    display: none !important;
  }

  .sidebar,
  .mobile-decline {
    display: none !important;
  }

  .apex-main-shell,
  .main-content {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  /* TASK 3 — grids & layout */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #dashboardGrid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }

  #dashboardGrid .program-ready-banner {
    order: 1;
  }
  #dashboardGrid .goal-block {
    order: 2;
  }
  #dashboardGrid .target-weight-prompt,
  #dashboardGrid [class*="target"] {
    order: 3;
  }
  #dashboardGrid .steps-section {
    order: 5;
  }
  #dashboardGrid .coach-summary-card,
  #dashboardGrid #dashboardSummaryCard {
    order: 4;
  }

  .dashboard-grid[style*="repeat(auto-fit"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .goal-meta,
  .goal-progress-row,
  .panel-intro,
  .plan-header-row,
  .plan-adapt-banner,
  .program-ready-banner,
  .telemetry-tile[style*="flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .panel-intro {
    display: none !important;
  }

  #panel-nutrition .panel-intro,
  #panel-plans .panel-intro,
  #panel-supplements .panel-intro,
  #panel-meals .panel-intro {
    display: none !important;
  }

  #panel-supplements .dashboard-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  #panel-nutrition .nutrition-coaching,
  #panel-nutrition #nutritionContent {
    padding: 0 4px;
  }

  .main-viewport > .panel.active {
    display: flex !important;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px calc(64px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
  }

  .main-viewport > .panel.active:not(.mobile-pane) {
    display: flex !important;
  }

  .panel.mobile-decline {
    display: none !important;
  }

  .plan-week-strip {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .plan-week-strip::-webkit-scrollbar {
    display: none;
  }

  .plan-day-pill {
    min-height: 40px;
  }

  /* TASK 10 — exercise table → stacked cards */
  .plan-exercise-table thead {
    display: none;
  }
  .plan-exercise-table,
  .plan-exercise-table tbody,
  .plan-exercise-table tr {
    display: block;
    width: 100%;
  }
  .plan-exercise-table tr {
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .plan-exercise-table td {
    display: block;
    border: none;
    padding: 2px 0;
    text-align: left !important;
  }
  .plan-exercise-table td:first-child {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 4px;
  }
  .plan-exercise-table td.col-mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--muted);
  }
  .plan-exercise-table td.col-muted {
    font-size: 0.78rem;
    margin-top: 4px;
  }

  /* TASK 11 — progress */
  .progress-panel-root {
    padding: 0 12px 20px;
  }
  .progress-log-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .progress-exercise-row {
    flex-wrap: wrap;
  }
  .progress-exercise-row .progress-ex-name {
    flex: 1 1 100%;
    width: 100%;
    min-width: 100%;
  }
  .progress-exercise-row .progress-ex-sm,
  .progress-exercise-row .progress-ex-weight {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .progress-chart-wrap,
  .progress-chart-wrap--tall {
    height: 160px !important;
  }
  .progress-trends-ranges,
  .progress-subtabs {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Charts — shorter on mobile */
  .steps-chart-wrap {
    height: 120px !important;
  }

  /* Onboarding / profile setup equipment */
  .profile-equipment-grid,
  .profile-pill-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
  .profile-pill.is-lg {
    grid-column: span 2;
  }

  #profileSetupScreen {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .profile-setup-body {
    overflow-y: visible;
    max-height: none;
  }

  /* TASK 5 & 6 — touch targets & forms */
  .btn,
  button.btn {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .input,
  input.input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    min-height: 48px;
    font-size: 16px !important;
    -webkit-appearance: none;
    appearance: none;
    border-radius: var(--radius-sm);
  }

  textarea {
    resize: none;
  }

  select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b5c46' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
  }

  .profile-pill,
  .progress-pill,
  .progress-scale-pill,
  .progress-subtab,
  .progress-trends-range,
  .meal-day-tab,
  .guided-option-pill,
  .plan-day-pill {
    min-height: 40px;
    min-width: 44px;
    padding: 8px 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .progress-rpe-pill {
    min-width: 36px;
    min-height: 36px;
  }

  .progress-ex-remove,
  .progress-history-delete,
  .entry-delete {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* TASK 7 — modals as bottom sheets */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal,
  .modal.auth-modal,
  .modal.guest-limit-card,
  .onboarding-modal .modal {
    width: 100%;
    max-width: 100vw;
    max-height: 90vh;
    margin: 0;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  #onboardingModal .modal,
  .onboarding-modal {
    max-height: 100vh;
    height: auto;
    border-radius: 0;
    top: 0;
    bottom: 0;
  }

  #profileSetupScreen {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* TASK 8 — chat */
  body.is-mobile-layout #panel-chat.active,
  body.is-mobile-layout.chat-tab-active #panel-chat.active {
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.is-mobile-layout .chat-messages,
  body.is-mobile-layout[data-mobile-tab="coach"] .mobile-scroll-pane {
    height: calc(100vh - 64px - 80px - env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - 64px - 80px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 64px - 80px - env(safe-area-inset-bottom, 0px));
    padding: 8px 12px 12px;
    padding-bottom: calc(80px + 64px + env(safe-area-inset-bottom, 0px));
  }

  body.is-mobile-layout .chat-input-area,
  body.is-mobile-layout .mobile-thumb-zone {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 90;
  }

  .chat-textarea {
    width: 100%;
    min-height: 48px;
    max-height: 120px;
    font-size: 16px !important;
  }

  .send-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    touch-action: manipulation;
  }

  .chat-context-chips,
  .chat-context-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 6px 12px;
  }
  .chat-context-chips::-webkit-scrollbar,
  .chat-context-row::-webkit-scrollbar {
    display: none;
  }

  .chat-context-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .msg-limit-bar {
    padding: 6px 12px !important;
    font-size: 9px !important;
  }

  /* TASK 14 — performance */
  button,
  a.btn,
  .sidebar-link,
  .mobile-nav-btn,
  [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav,
  .mobile-nav {
    will-change: transform;
  }

  .telemetry-tile,
  .modal,
  .progress-log-card {
    box-shadow: 0 1px 0 var(--border);
  }

  /* Fixed widths → fluid */
  .panel-intro,
  .plan-engine,
  .msg-body,
  .chat-messages,
  .upgrade-card {
    max-width: 100% !important;
    width: 100%;
  }

  [style*="min-width: 240px"],
  [style*="min-width: 200px"] {
    min-width: 0 !important;
  }
}

@media (min-width: 769px) {
  .mobile-nav {
    display: none !important;
  }
  .sidebar {
    display: flex !important;
  }
}

/* Marketing — index.html inline companions */
@media (max-width: 768px) {
  body.apex-marketing-page .nav-links li:not(:last-child):not(:first-child) {
    display: none;
  }
  body.apex-marketing-page .nav-links {
    gap: 8px;
  }
  body.apex-marketing-page .hero h1 {
    font-size: 2rem !important;
  }
  body.apex-marketing-page .hero-sub {
    font-size: 15px;
  }
  body.apex-marketing-page .hero-cta {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  body.apex-marketing-page .hero-cta .btn {
    width: 100%;
  }
  body.apex-marketing-page .features-grid {
    grid-template-columns: 1fr !important;
  }
  body.apex-marketing-page .pricing-grid,
  body.apex-marketing-page .pricing-cards {
    grid-template-columns: 1fr !important;
  }
  body.pricing-page .pricing-wrap > section,
  body.pricing-page .pricing-hero {
    grid-template-columns: 1fr !important;
  }
  body.pricing-page .nav-links li:not(:last-child):not(:first-child) {
    display: none;
  }
}

/* Auth modal — password visibility */
.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.auth-password-wrap .input {
  flex: 1;
  padding-right: 4.5rem;
}
.auth-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--electric);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 8px;
  min-height: 44px;
  min-width: 44px;
}
.auth-form-error {
  color: #f87171;
  font-size: 0.82rem;
  margin: 0 0 14px;
  line-height: 1.45;
}

/* Nutrition hub (Progress → Nutrition, dashboard tile) */
.nutrition-macro-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.nutrition-macro-summary-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 4px;
}
.nutrition-macro-summary strong {
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.nutrition-macro-summary span:last-child {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 2px;
}
.nutrition-rationale,
.nutrition-adherence-block,
.nutrition-hub-targets {
  margin-top: 16px;
}
.nutrition-rationale p,
.nutrition-hub-empty p,
.dashboard-nutrition-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}
.nutrition-meta-line {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.06em;
  margin-top: 8px;
}
.nutrition-hub-empty {
  padding: 20px 0;
}
.dashboard-nutrition-tile {
  grid-column: 1 / -1;
}
@media (max-width: 768px) {
  .nutrition-macro-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .auth-password-wrap .input {
    font-size: 16px;
  }
}

/* ── Mission Control ── */
.mission-control-root {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 24px 24px;
  max-width: 720px;
}

.mc-card {
  padding: 22px 24px;
  border-radius: var(--radius, 12px);
}

.mc-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}

.mc-kicker--gold {
  color: var(--gold, #d4a24a);
}

.mc-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mc-status-goal {
  font-size: 0.95rem;
  color: var(--white);
  margin: 0 0 6px;
}

.mc-status-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.mc-status-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mc-status-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
}

.mc-status-label {
  flex-shrink: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.mc-status-leader {
  flex: 1;
  min-width: 12px;
  height: 0;
  align-self: center;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.18);
  margin: 0 4px;
}

.mc-status-value {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--white);
}

.mc-status-icon--ok {
  color: #5cb87a;
}

.mc-status-icon--partial,
.mc-status-icon--none {
  color: var(--faint);
}

.mc-briefing-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary, var(--white));
  margin: 0;
}

.mc-adherence-row {
  display: grid;
  grid-template-columns: auto 1fr auto 80px;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 14px;
}

.mc-adherence-icon {
  font-size: 1rem;
}

.mc-adherence-label {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-adherence-leader {
  height: 0;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.14);
  min-width: 8px;
}

.mc-adherence-pct {
  font-size: 0.82rem;
  color: var(--white);
  text-align: right;
}

.mc-adherence-bar {
  grid-column: 2 / -1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.mc-adherence-bar-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.35s ease;
}

.mc-weekly-score {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.mc-weekly-value {
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1.1;
  margin: 8px 0 6px;
}

.mc-weekly-denom {
  font-size: 1.1rem;
  color: var(--faint);
  font-weight: 400;
}

.mc-weekly-note {
  font-size: 0.82rem;
  color: var(--faint);
  font-style: italic;
  margin: 0;
}

.mc-weekly-note--alert {
  color: rgba(196, 92, 92, 0.9);
}

.mc-card--transform {
  text-align: center;
}

.mc-transform-score {
  font-size: 4rem;
  font-weight: 500;
  color: var(--white);
  line-height: 1;
  margin-bottom: 8px;
}

.mc-transform-label {
  margin-bottom: 12px;
}

.mc-transform-delta {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.mc-delta--up {
  color: #5cb87a;
}

.mc-delta--down {
  color: #d4a24a;
}

.mc-transform-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin: 0 auto 14px;
  max-width: 420px;
}

.mc-transform-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.mc-transform-insight {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

.mc-quick-log {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 28px;
  max-width: 720px;
}

.mc-quick-log-btn {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 96px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.mc-quick-log-btn:hover {
  border-color: var(--electric);
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.mc-quick-log-btn span {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

#panel-mission-control .guided-log-panel {
  margin: 0 24px 24px;
  max-width: 720px;
}

.apex-mobile-dock--8 .mobile-nav-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 2px;
}

.apex-mobile-dock--8 .mobile-nav-label {
  font-size: 0.58rem;
  letter-spacing: 0.02em;
}

@media (max-width: 767px) {
  .mission-control-root,
  .mc-quick-log,
  #panel-mission-control .guided-log-panel {
    padding-left: 16px;
    padding-right: 16px;
    max-width: none;
  }

  .mc-adherence-row {
    grid-template-columns: auto 1fr auto;
  }

  .mc-adherence-bar {
    grid-column: 1 / -1;
  }

  .mc-quick-log-btn {
    flex: 1 1 calc(50% - 8px);
  }
}

