  /* =========================================================================
     1. Design Tokens & Core Canvas
     ========================================================================= */
  :root {
    --bg-base: #0C0D0F;
    --bg-surface: #16181C;
    --bg-surface-raised: #1E2127;
    
    --border-hairline: #2A2E36;
    --border-light-catch: rgba(255, 255, 255, 0.07);
    --border-track: #2A2E36;

    --bg-surface-sunken: #08090B;
    --text-primary: #F5F5F2;
    --text-secondary: #A0A5B1;
    --text-muted: #626773;
    --text-tertiary: #5C6270;
    --text-on-light: #1A1A1A;

    --font-sans: 'Space Grotesk', sans-serif;
  }

  html {
    font-size: 16px;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    background-color: #0C0D0F;
    overscroll-behavior: none;
    min-height: -webkit-fill-available;
    height: 100%;
  }

  *, *:before, *:after { box-sizing: inherit; }

body {
  margin: 0 !important;
  padding: 0 1rem !important;
  background-color: var(--bg-base) !important;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  height: 100vh !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

  /* =========================================================================
     2. Layout Container Framework
     ========================================================================= */
  .viewport-container {
    width: 100% !important;
    max-width: 440px !important;
    min-width: 320px !important;
    margin: 0 auto !important;
    display: block !important;
  }

  .app-view {
    width: 100% !important;
    box-sizing: border-box;
  }

/* =========================================================================
     3. Unified Premium Card Architecture
     ========================================================================= */
  .card {
    background: linear-gradient(0deg, #0F1012 0%, #1C1E22 100%) !important;
    border: 1px solid var(--border-hairline) !important;
    border-radius: 20px !important;

    /* UPDATED: Precise 16px layout footprint */
    padding: 12px !important;
    margin-bottom: 12px !important;

    width: 100% !important;
    display: block !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.7) !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  /* Mobile Texture Noise overlay */
  .card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='premiumNoise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' result='noise'/%3E%3CfeGaussianBlur in='noise' stdDeviation='0.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23premiumNoise)' opacity='0.12'/%3E%3C/svg%3E") !important;
    mix-blend-mode: screen !important; 
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 65%) !important;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 65%) !important;
    pointer-events: none;
    z-index: 1;
  }

  .card > * { position: relative; z-index: 2; }
  .card.no-texture::before { display: none !important; }
  .card[onclick] { cursor: pointer !important; }
  .card[onclick]:active { transform: scale(0.985) !important; }

/* Structured Typography System */
  .card-label {
    font-family: var(--font-sans) !important;
    font-size: 12px !important; /* Retained sharp metadata clarity */
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    color: var(--text-secondary) !important;
    margin-bottom: 0.5rem !important;
    text-transform: uppercase;
  }

  .card-title {
    font-family: var(--font-sans) !important;
    font-size: 1.1rem !important; /* Balanced 20px header size */
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em !important;
    color: var(--text-primary) !important;
    margin: 0 0 0.5rem 0 !important;
  }

  .card-hero {
    font-family: var(--font-sans) !important;
    font-size: 1.65rem !important; /* Impactful 32px focus stat metric */
    font-weight: 700 !important;
    line-height: 1.1 !important;
    color: var(--text-primary) !important;
    margin: 0.25rem 0 0 0 !important;
  }

  .body-text {
    font-family: var(--font-sans) !important;
    font-size: 1rem !important; /* THE BASE INTENT: True 16px (12pt) reading text */
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #CED2DB !important;
  }

  /* Safe Hero Specific Classes to guarantee White Text */
  .hero-card .next-up-title,
  .hero-card .next-up-value {
    color: var(--text-primary) !important;
  }

/* ==========================================================================
   UPDATED UNIFIED TAG SYSTEM
   ========================================================================== */

/* Base tag settings - Forces sizing, padding, and sentence-casing globally */
.session-tag {
  display: inline-block !important;
  font-size: 13px !important;                             /* FIXED: Forced to 13px */
  font-weight: 700 !important;
  padding: 3px 8px !important;                            /* FIXED: Matches Week pill padding exactly */
  border-radius: 4px !important;
  text-transform: none !important;                        /* FIXED: Relaxes forced capitals globally */
  color: #FFFFFF !important;                               /* FIXED: Crisp white font everywhere */
}

/* Category-specific border and background tint routing */
.tag-recovery, .tag-easy {
  background-color: rgba(168, 197, 160, 0.12) !important;
  border: 1px solid rgba(168, 197, 160, 0.3) !important;
}

.tag-interval, .tag-threshold, .tag-tempo {
  background-color: rgba(242, 153, 74, 0.12) !important;  /* Soft intensity orange tint */
  border: 1px solid rgba(242, 153, 74, 0.3) !important;
}

.tag-long {
  background-color: rgba(155, 81, 224, 0.12) !important;   /* Soft endurance purple tint */
  border: 1px solid rgba(155, 81, 224, 0.3) !important;
}

/* Dedicated Phase Week Token Class */
.tag-week {
  background-color: rgba(74, 143, 217, 0.2) !important;    /* Slightly deeper solid background fill */
  border: 1px solid rgba(74, 143, 217, 0.4) !important;
}

  /* =========================================================================
     4. App Headers & Premium Bottom Navigation Bars
     ========================================================================= */
.app-header {
    position: fixed !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 440px !important;
    height: 4.5rem !important; /* Increased slightly to accommodate 2 lines */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 1.2rem !important;
    z-index: 9999 !important;
    background: transparent !important;
    border-bottom: 2px solid transparent !important;
    border-image: linear-gradient(
      to right, 
      rgba(199, 131, 61, 0) 0%, 
      rgba(199, 131, 61, 1) 50%, 
      rgba(199, 131, 61, 0) 100%
    ) 1 !important;
  }
.app-header {
  position: fixed !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  max-width: 440px !important;
  height: 5.5rem !important;
  
  /* FIXED: Changed from transparent to your theme color to block out background text */
  background: var(--bg-base) !important; 
  
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 0 1.2rem !important;
  z-index: 9999 !important;

  /* Your gorgeous tapered accent line preserved perfectly */
  border-bottom: 2px solid transparent !important;
  border-image: linear-gradient(
    to right, 
    rgba(199, 131, 61, 0) 0%, 
    rgba(199, 131, 61, 1) 50%, 
    rgba(199, 131, 61, 0) 100%
  ) 1 !important;
}

.app-header h1 {
  font-family: var(--font-sans) !important;
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px !important;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 !important;
}

.header-greeting {
  margin: 2px 0 0 0 !important;
  font-size: 14pt !important;
  font-weight: 400 !important;
  color: #FFFFFF !important;
  letter-spacing: 0 !important;
}

  .bottom-navigation-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    background: rgba(10, 11, 13, 0.88) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: none !important;
    border-top: 2px solid transparent !important;
    border-image: linear-gradient(to right, rgba(199,131,61,0) 0%, rgba(199,131,61,0.7) 50%, rgba(199,131,61,0) 100%) 1 !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    border-radius: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 6px 0 6px 0 !important;
    gap: 0 !important;
    z-index: 9999 !important;
  }

  .nav-item {
    background: none !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-family: var(--font-sans) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer !important;
    flex: 1 !important;
    padding: 6px 0 !important;
    gap: 4px !important;
  }

  .nav-icon svg {
    width: 28px !important;
    height: 28px !important;
  }

  .nav-item.active {
    color: #C7833D !important;
  }

  /* =========================================================================
     5. Modals & Overlay Shells
     ========================================================================= */
  .modal-overlay { 
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; 
    width: 100vw !important; height: 100vh !important;
    background: rgba(0, 0, 0, 0.75) !important; 
    backdrop-filter: blur(4px) !important; 
    -webkit-backdrop-filter: blur(4px) !important;
    display: none; 
    align-items: center !important; 
    justify-content: center !important;
    z-index: 99999 !important; 
    padding: 1.5rem !important; 
  }
  
  .modal-card { 
    background: #0C0D0F !important;
    width: 100% !important; 
    max-width: 400px !important;
    border: 1px solid var(--border-hairline) !important; 
    border-radius: 16px;
    padding: 1.5rem !important; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
    animation: modalFadeIn 0.2s ease-out;
  }

  @keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
  }
  /* Custom Global Refactor Safety Locks */
.hero-card .card-label {
  color: #FFFFFF !important;
  opacity: 1 !important;
}
/* =========================================================================
   6. Form & Modal Input Component System
   ========================================================================= */
.btn-submit {
  width: 100%;
  background-color: #C7833D; /* brand/primary */
  color: #FFFFFF;            /* text/primary */
  border: none;
  border-radius: 8px;
  padding: 0.875rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-submit:hover {
  background-color: #9E5F22; /* brand/primary-deep */
}

.btn-submit:disabled {
  opacity: 0.4;
  background-color: var(--text-muted);
  cursor: not-allowed;
}

/* =========================================================================
   7. Form Inputs & Typography System
   ========================================================================= */
.form-group {
  margin-bottom: 1.25rem;
  width: 100%;
}

.form-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #A0A5B1; /* text/secondary */
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.form-input {
  width: 100%;
  background-color: var(--bg-base); /* Inset deep well look */
  border: 1px solid #2A2E36;       /* border/hairline */
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #FFFFFF;                  /* text/primary */
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: #C7833D;          /* brand/primary on focus highlight */
}

.form-status {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.75rem;
  text-align: center;
  display: none;
}
/* =========================================================================
   Card Typography Override Layer
   ========================================================================= */
.card .card-title {
  font-size: 1.1rem !important; /* Forces balanced ~20px header */
  line-height: 1.25 !important;
}

/* Update this specific selector at the bottom of Styles.txt */
.card .card-hero {
  font-size: 1.65rem !important;        /* Keeps your impactful ~32px focus stat */
  line-height: 1.2 !important;       /* FIXED: Gives wrapped words room to breathe */
  margin-top: 0.25rem !important;
  margin-bottom: 12px !important;    /* FIXED: Pulls the capsule tag up slightly */
}

.card .body-text {
  font-size: 1rem !important;   /* FORCES THE BASE INTENT: True 16px text */
  line-height: 1.5 !important;
}
/* Add this below your card overrides at the bottom of Styles.txt */
.card .card-label {
  color: var(--text-primary) !important;
  text-transform: none !important;
  font-size: 12px !important;
  letter-spacing: normal !important;
}
/* Update this at the bottom of Styles.txt */
/* Update this at the bottom of Styles.txt */
.tag-week {
  background-color: rgba(74, 143, 217, 0.2) !important;   /* Only the pill background gets the info blue */
  border: 1px solid rgba(74, 143, 217, 0.4) !important;    /* Only the pill border gets the info blue */
  color: #FFFFFF !important;                               /* FIXED: Font is now crisp white */
  
  /* FIXED: Stripping global overrides */
  text-transform: none !important;                         /* Forces it out of all-caps mode */
  font-size: 13px !important;                              /* Keeps the pill profile nice and small */
  padding: 3px 8px !important;                             /* Clean, tight spacing boundaries */
  display: inline-block !important;
}
/* Premium Tapered Accent Line */
.header-glow-line {
  width: 100%;
  height: 2px;                                                 /* Super thin line height */
  background: radial-gradient(circle at center, #C7833D 0%, rgba(199, 131, 61, 0) 70%);
  margin-top: 8px;                                            /* Clean spacing below your greeting text */
  opacity: 0.8;                                               /* Subtle, premium glow level */
}
/* 1. Style the main container so it stays strictly below the header and handles the scroll */
.viewport-container {
  flex: 1;
  width: 100%;
  max-width: 440px; /* Anchors the scroll column width perfectly to your header frame */
  overflow-y: auto;
  overscroll-behavior: none;
  box-sizing: border-box;
  background-color: #0C0D0F;
  
  /* Re-applies your layout padding safely INSIDE the scroll window */
  padding-top: 6.5rem !important; /* Pushes the first card down just past your 5.5rem header */
  padding-bottom: 6.5rem !important; /* Preserves your bottom navigation footer spacing */
}
.viewport-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Hides scrollbar for Firefox and IE/Edge */
.viewport-container {
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
}
/* Phase Timeline Modal */
.phases-timeline-modal-card { background: #0C0D0F !important; padding: 1.25rem !important; max-height: 80vh !important; overflow-y: auto !important; }
.timeline-modal-header { font-family: 'Space Grotesk', sans-serif !important; font-size: 1.05rem !important; font-weight: 700 !important; color: #FFFFFF !important; text-transform: none !important; margin-bottom: 16px !important; padding-bottom: 12px !important; border-bottom: 1px solid rgba(199,131,61,0.3) !important; }
.timeline-modal-flex-stack { display: flex !important; flex-direction: column !important; gap: 10px !important; }
.phase-tl-card { background: linear-gradient(0deg, #0F1012 0%, #1C1E22 100%) !important; border: 1px solid #2A2E36 !important; border-radius: 16px !important; padding: 14px 16px !important; display: flex !important; align-items: center !important; justify-content: space-between !important; }
.phase-tl-card.is-active { border: 1px solid rgba(199,131,61,0.5) !important; }
.phase-tl-name { font-family: 'Space Grotesk', sans-serif !important; font-size: 1.3rem !important; font-weight: 700 !important; color: #FFFFFF !important; line-height: 1.2 !important; text-transform: none !important; }
.phase-tl-dates { font-size: 13px !important; font-weight: 500 !important; color: rgba(255,255,255,0.8) !important; margin-top: 4px !important; }
.phase-active-badge { display: inline-block !important; font-size: 12px !important; font-weight: 700 !important; color: #FFFFFF !important; background: rgba(199,131,61,0.2) !important; border: 1px solid rgba(199,131,61,0.5) !important; border-radius: 4px !important; padding: 2px 8px !important; margin-left: 8px !important; text-transform: none !important; vertical-align: middle !important; }

/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0C0D0F;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.6s ease;
}
#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
.ls-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.ls-greeting {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 48px;
  text-align: center;
}
.ls-runner-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}
.ls-glow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 12px;
  background: radial-gradient(ellipse at center, rgba(199,131,61,0.5) 0%, rgba(199,131,61,0) 70%);
  border-radius: 50%;
}
.ls-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  margin-bottom: 14px;
  letter-spacing: 0.3px;
}

.modal-close-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  cursor: pointer !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 24px !important;
  font-weight: 300 !important;
  user-select: none !important;
  flex-shrink: 0 !important;
  margin: -10px -10px -10px 0 !important;
}
.ls-dots {
  display: flex;
  gap: 6px;
}
.ls-dots span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C7833D;
  animation: lsDotPulse 1.2s ease-in-out infinite;
}
.ls-dots span:nth-child(2) { animation-delay: 0.2s; }
.ls-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lsDotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.75); }
  40% { opacity: 1; transform: scale(1); }
}
