/* ==========================================================================
   RunAnalyze Dark Tech Styling System
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(18, 26, 44, 0.75);
  --bg-card-hover: rgba(28, 38, 65, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Sports Accent Colors */
  --accent-orange: #ff5722;
  --accent-cyan: #00f2fe;
  --accent-lime: #10b981;
  --accent-pink: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 25px rgba(0, 242, 254, 0.2);
  --shadow-glow-orange: 0 0 25px rgba(255, 87, 34, 0.25);
  --shadow-glow-lime: 0 0 25px rgba(16, 185, 129, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(255, 87, 34, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(0, 242, 254, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

/* ---------------- Multi-Language (i18n) Layout & Readability Shield ---------------- */
html[lang="ko"], html[lang="ja"] {
  word-break: keep-all;
}

html[lang="en"], html[lang="es"] {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Allow badges and buttons to naturally expand and wrap when longer words (Spanish/English) are loaded */
.filter-btn, .tab-btn, .btn-format-chip, .btn-theme-chip, .info-tag, .threshold-box-tag {
  white-space: normal;
  line-height: 1.3;
}

.tab-btn {
  min-width: 0;
}

.tab-btn span {
  text-align: center;
}

.tab-hint {
  text-align: center;
  word-break: keep-all;
}

.metric-header {
  flex-wrap: wrap;
  gap: 0.3rem;
}

.metric-label {
  word-break: keep-all;
}

.threshold-box-title {
  word-break: keep-all;
}

.app-container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
  overflow-x: hidden;
}

/* ---------------- Global Header ---------------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-orange), #ff8a65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: var(--shadow-glow-orange);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  line-height: 1.1;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-orange);
}

.header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.period-control-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 87, 34, 0.4);
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.15);
  border-radius: var(--radius-md);
  padding: 0.3rem 0.5rem;
}

.period-title {
  color: var(--accent-orange);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.header-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.header-select:hover, .header-select:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-orange);
  box-shadow: 0 0 8px rgba(255, 87, 34, 0.3);
}

.header-select option {
  background: #0f172a;
  color: #fff;
}

.period-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.45);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.42rem 0.85rem;
  border-radius: 9999px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.period-active-badge strong {
  color: var(--accent-cyan);
}

.period-active-badge.badge-highlight {
  animation: badgePulse 0.8s ease-out;
}

@keyframes badgePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.8);
    border-color: #00f2fe;
    background: rgba(0, 242, 254, 0.28);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 35px rgba(0, 242, 254, 1);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
  }
}

/* Ultra High-Visibility Vibrant Refresh Button */
.btn-refresh {
  background: linear-gradient(135deg, #ff5722 0%, #ff7043 50%, #ff8a65 100%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(255, 87, 34, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-refresh i {
  font-size: 1rem;
  transition: transform 0.4s ease;
}

.btn-refresh:hover {
  background: linear-gradient(135deg, #ff3d00 0%, #ff5722 50%, #ff7043 100%);
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.85), 0 0 12px rgba(255, 138, 101, 0.6);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.7);
}

.btn-refresh:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.5);
}

.btn-refresh.spinning i {
  animation: spinIcon 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spinIcon {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dynamic Toast Banner */
.shoef-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--accent-orange);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 87, 34, 0.4);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shoef-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ---------------- Filter Bar ---------------- */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(18, 26, 44, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-label i {
  color: var(--accent-orange);
}

.filter-btn-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-btn.active {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.2), rgba(255, 112, 67, 0.3));
  border-color: var(--accent-orange);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 87, 34, 0.25);
}

.filter-btn .badge-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
}

.filter-btn.active .badge-num {
  color: #fff;
}

/* ---------------- Tabs ---------------- */
.main-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: all 0.25s ease;
}

.tab-btn i {
  font-size: 1.25rem;
}

.tab-btn span {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.tab-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  color: #fff;
  border: 1px solid rgba(255, 87, 34, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.tab-btn.active i {
  color: var(--accent-orange);
}

.tab-btn.active .tab-hint {
  color: var(--accent-orange);
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Cards Common ---------------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i {
  color: var(--accent-orange);
}

.badge-subtle {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* ---------------- Session Selector ---------------- */
.session-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.selector-header label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.badge-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.custom-select {
  width: 100%;
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.custom-select:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 15px rgba(255, 87, 34, 0.2);
}

/* ---------------- Metric Cards Grid ---------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.highlight-cyan::before { background: var(--accent-cyan); }
.highlight-orange::before { background: var(--accent-orange); }
.highlight-pink::before { background: var(--accent-pink); }
.highlight-lime::before { background: var(--accent-lime); }

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.metric-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-header i {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.metric-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.metric-val .unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.2rem;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-metric {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(18, 26, 44, 0.85));
  border-color: rgba(16, 185, 129, 0.3);
}

.hero-metric .metric-val {
  color: var(--accent-lime);
}

.badge-core {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent-lime);
  background: rgba(16, 185, 129, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
}

/* ---------------- Detail Row ---------------- */
.detail-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-card {
  margin-bottom: 0;
}

.info-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: help;
}

.decoupling-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(11, 17, 32, 0.6);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.decoupling-score {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-lime);
  white-space: nowrap;
}

.decoupling-text h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.decoupling-text p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---------------- VDOT & 5 Training Paces Card ---------------- */
.vdot-cadence-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vdot-score-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(11, 17, 32, 0.6);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.85rem;
}

.vdot-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  min-width: 78px;
}

.vdot-score-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

.vdot-score-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.vdot-score-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.training-paces-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}

.pace-zone-item {
  background: rgba(11, 17, 32, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pace-zone-item:hover {
  transform: translateY(-2px);
}

.pace-zone-item.pace-e { border-top: 3px solid #10b981; }
.pace-zone-item.pace-m { border-top: 3px solid #00f2fe; }
.pace-zone-item.pace-t { border-top: 3px solid #f59e0b; }
.pace-zone-item.pace-i { border-top: 3px solid #ff5722; }
.pace-zone-item.pace-r { border-top: 3px solid #ec4899; }

.pz-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.25rem;
}

.pz-code {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
}

.pace-e .pz-code { color: #10b981; }
.pace-m .pz-code { color: #00f2fe; }
.pace-t .pz-code { color: #f59e0b; }
.pace-i .pz-code { color: #ff5722; }
.pace-r .pz-code { color: #ec4899; }

.pz-name {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.pz-val {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
  margin: 0.2rem 0;
  white-space: nowrap;
}

.pz-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.2;
}

@media (max-width: 640px) {
  .training-paces-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 420px) {
  .training-paces-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.text-cyan { color: var(--accent-cyan) !important; }
.text-orange { color: var(--accent-orange) !important; }
.text-lime { color: var(--accent-lime) !important; }
.text-purple { color: var(--accent-purple) !important; }

/* ---------------- Threshold Diagnostics Card ---------------- */
.threshold-card {
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(18, 26, 44, 0.9));
  border: 1px solid rgba(0, 242, 254, 0.2);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

.threshold-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.threshold-status-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.threshold-status-badge.success {
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-lime);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.threshold-status-badge.warning {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.threshold-status-badge.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.threshold-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-hr-settings {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fca5a5;
  border-radius: 9999px;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hr-settings:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  color: #fff;
  transform: translateY(-1px);
}

.hr-settings-drawer {
  background: rgba(11, 17, 32, 0.85);
  border-bottom: 1px solid rgba(0, 242, 254, 0.2);
  padding: 1rem 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.hr-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.hr-drawer-header h4 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.4rem;
  line-height: 1;
}

.btn-close-drawer:hover {
  color: #fff;
}

.hr-drawer-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.hr-input-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.hr-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hr-input-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit input {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.4rem 2rem 0.4rem 0.65rem;
  width: 110px;
}

.input-with-unit input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.input-with-unit .unit {
  position: absolute;
  right: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
}

.hr-input-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-save-hr {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: opacity 0.2s ease;
}

.btn-save-hr:hover {
  opacity: 0.9;
}

.btn-reset-hr {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-reset-hr:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.accuracy-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.accuracy-badge.gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.accuracy-badge.standard {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
}

.threshold-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.threshold-box {
  background: rgba(11, 17, 32, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.threshold-box:hover {
  transform: translateY(-2px);
}

.threshold-box.lt1 {
  border-left: 4px solid var(--accent-lime);
}

.threshold-box.lt2 {
  border-left: 4px solid var(--accent-orange);
}

.threshold-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.4rem;
}

.threshold-box-title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.threshold-box-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.threshold-values-row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.threshold-val-item {
  display: flex;
  flex-direction: column;
}

.threshold-val-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.threshold-val-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
}

.threshold-box.lt1 .threshold-val-number {
  color: var(--accent-lime);
}

.threshold-box.lt2 .threshold-val-number {
  color: var(--accent-orange);
}

.threshold-val-number .unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.threshold-box-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.threshold-coaching-box {
  margin-top: 1rem;
  background: rgba(0, 242, 254, 0.05);
  border: 1px dashed rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.threshold-coaching-box i {
  color: var(--accent-cyan);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Notice box when unable to determine */
.threshold-notice-box {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.threshold-notice-msg {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.threshold-notice-msg i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Fallback Estimates */
.threshold-fallback-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.threshold-fallback-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.threshold-fallback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.threshold-fallback-item {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--text-muted);
}

.threshold-fallback-item.lt1 {
  border-left-color: var(--accent-lime);
}

.threshold-fallback-item.lt2 {
  border-left-color: var(--accent-orange);
}

.threshold-fallback-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.threshold-fallback-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

/* Accordion Test Guide */
.threshold-accordion {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.4);
}

.threshold-accordion-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: none;
  color: var(--text-primary);
  padding: 0.85rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.threshold-accordion-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
}

.threshold-accordion-toggle .toggle-icon {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.threshold-accordion.open .threshold-accordion-toggle .toggle-icon {
  transform: rotate(180deg);
}

.threshold-accordion-content {
  display: none;
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.threshold-accordion.open .threshold-accordion-content {
  display: block;
}

.threshold-rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

.threshold-rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.threshold-rules-list li i {
  color: var(--accent-cyan);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.threshold-rules-list strong {
  color: #fff;
}

@media (max-width: 768px) {
  .threshold-grid, .threshold-fallback-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------- Chart Card ---------------- */
.chart-card {
  margin-bottom: 1.5rem;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
}

/* ---------------- TAB 2: WEEKLY RECAP ---------------- */
.weekly-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.wh-content .sub-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.wh-content .main-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.35rem 0 0.5rem 0;
}

.wh-content .description {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.weekly-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.weekly-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  transition: transform 0.2s;
}

.weekly-card:hover {
  transform: translateY(-3px);
}

.weekly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.wc-week-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.wc-date-range {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.wc-distance {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.wc-distance small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* 10% Rule Badge */
.rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.rule-safe {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-lime);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.rule-caution {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.rule-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.rule-recovery {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.wc-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}

.wc-stat-row {
  display: flex;
  justify-content: space-between;
}

.wc-stat-row span:last-child {
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------------- TAB 3: MONTHLY & INSTA CARD ---------------- */
.month-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.month-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.m-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.4rem;
}

.m-val {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.1;
  display: block;
  margin-bottom: 0.35rem;
}

.m-val small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.m-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Card Studio */
.card-studio-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
}

.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.studio-header h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
}

.studio-header p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.studio-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.format-picker-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.btn-format-chip {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn-format-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-format-chip.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.theme-picker-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.btn-theme-chip, .btn-theme {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn-theme-chip:hover, .btn-theme:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-theme-chip.active, .btn-theme.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-dark {
  background: var(--accent-orange);
  box-shadow: 0 0 6px var(--accent-orange);
}

.dot-neon {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.dot-minimal {
  background: #f8fafc;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.studio-btn-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), #ff7043);
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-glow-orange);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ---------------- INSTAGRAM CARD STUDIO ---------------- */
.insta-card-wrapper {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

/* Base / 9:16 Story Card */
.insta-card,
.insta-card.format-story {
  width: 360px;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 640px;
  border-radius: 24px;
  padding: 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease, width 0.3s ease, min-height 0.3s ease;
}

/* 1:1 Square Feed Post Format */
.insta-card.format-square {
  width: 440px;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 440px;
  aspect-ratio: 1 / 1;
  padding: 1rem 1.25rem;
  border-radius: 20px;
}

.insta-card.format-square .ic-header {
  margin-bottom: 0.15rem;
}

.insta-card.format-square .ic-title-area {
  margin: 0.15rem 0 0.35rem 0;
}

.insta-card.format-square .ic-sub {
  font-size: 0.58rem;
  margin-bottom: 0.05rem;
  letter-spacing: 0.4px;
}

.insta-card.format-square .ic-main-distance {
  font-size: 2.35rem;
  line-height: 0.95;
  letter-spacing: -1px;
}

.insta-card.format-square .ic-main-distance .unit {
  font-size: 1.05rem;
}

.insta-card.format-square .ic-ef-range {
  font-size: 0.58rem;
  margin-top: 0.15rem;
  letter-spacing: 0.2px;
}

.insta-card.format-square .ic-stats-grid {
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.35rem;
}

.insta-card.format-square .ic-stat-label {
  font-size: 0.55rem;
}

.insta-card.format-square .ic-stat-val {
  font-size: 1.02rem;
}

.insta-card.format-square .ic-highlight-banner {
  padding: 0.35rem 0.55rem;
  margin-bottom: 0.35rem;
  gap: 0.25rem;
}

.insta-card.format-square .hl-title {
  font-size: 0.55rem;
  margin-bottom: 0.05rem;
}

.insta-card.format-square .hl-value {
  font-size: 0.8rem;
}

.insta-card.format-square .wc-type-chips {
  gap: 0.2rem;
}

.insta-card.format-square .wc-type-chips .badge-count {
  font-size: 0.56rem !important;
  padding: 0.1rem 0.35rem !important;
}

.insta-card.format-square .ic-weeks-row {
  height: 40px;
  margin-bottom: 0.35rem;
  gap: 0.3rem;
  padding: 0 0.2rem;
}

.insta-card.format-square .ic-week-val {
  font-size: 0.58rem;
}

.insta-card.format-square .ic-bar-wrap {
  height: 18px;
}

.insta-card.format-square .ic-week-lbl {
  font-size: 0.55rem;
}

.insta-card.format-square .ic-footer {
  padding-top: 0.3rem;
}

.insta-card.format-square .ic-pol-footer {
  gap: 0.2rem;
}

.insta-card.format-square .ic-pol-tag {
  font-size: 0.55rem;
}

.insta-card.format-square .ic-pol-val {
  font-size: 0.58rem;
}

.insta-card.format-square .ic-pol-bar-wrap {
  height: 4px;
}

/* 4:5 Portrait Feed Post Format */
.insta-card.format-portrait {
  width: 400px;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 500px;
  aspect-ratio: 4 / 5;
  padding: 1.35rem 1.45rem;
  border-radius: 22px;
}

.insta-card.format-portrait .ic-title-area {
  margin: 0.45rem 0 0.6rem 0;
}

.insta-card.format-portrait .ic-main-distance {
  font-size: 2.9rem;
}

.insta-card.format-portrait .ic-ef-range {
  font-size: 0.65rem;
  margin-top: 0.25rem;
}

.insta-card.format-portrait .ic-stats-grid {
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.65rem;
}

.insta-card.format-portrait .ic-stat-val {
  font-size: 1.15rem;
}

.insta-card.format-portrait .ic-highlight-banner {
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.65rem;
  gap: 0.35rem;
}

.insta-card.format-portrait .wc-type-chips .badge-count {
  font-size: 0.6rem !important;
  padding: 0.12rem 0.4rem !important;
}

.insta-card.format-portrait .ic-weeks-row {
  height: 44px;
  margin-bottom: 0.65rem;
}

.insta-card.format-portrait .ic-bar-wrap {
  height: 24px;
}

.insta-card.format-portrait .ic-footer {
  padding-top: 0.45rem;
}

.insta-card.format-portrait .ic-pol-footer {
  gap: 0.25rem;
}

.insta-card.format-portrait .ic-pol-tag {
  font-size: 0.58rem;
}

.insta-card.format-portrait .ic-pol-val {
  font-size: 0.62rem;
}

.insta-card.format-portrait .ic-pol-bar-wrap {
  height: 5px;
}

/* Mobile responsive for card formats */
@media (max-width: 480px) {
  .insta-card,
  .insta-card.format-story {
    width: 330px;
    min-height: 586px;
    padding: 1.25rem 1.15rem;
  }
  .insta-card.format-story .ic-main-distance {
    font-size: 2.8rem;
  }
  .insta-card.format-story .ic-title-area {
    margin: 0.65rem 0 0.5rem 0;
  }
  .insta-card.format-story .ic-stats-grid {
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.65rem;
  }
  .insta-card.format-story .ic-highlight-banner {
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.65rem;
  }
  .insta-card.format-square {
    width: 320px;
    min-height: 320px;
    padding: 0.75rem 0.9rem;
  }
  .insta-card.format-square .ic-main-distance {
    font-size: 2.05rem;
  }
  .insta-card.format-square .ic-stats-grid {
    gap: 0.15rem 0.4rem;
    margin-bottom: 0.25rem;
  }
  .insta-card.format-square .ic-stat-val {
    font-size: 0.88rem;
  }
  .insta-card.format-square .ic-highlight-banner {
    padding: 0.25rem 0.45rem;
    margin-bottom: 0.25rem;
  }
  .insta-card.format-square .ic-weeks-row {
    height: 34px;
    margin-bottom: 0.25rem;
  }
  .insta-card.format-portrait {
    width: 320px;
    min-height: 400px;
    padding: 1rem 1.1rem;
  }
  .insta-card.format-portrait .ic-main-distance {
    font-size: 2.5rem;
  }
  .insta-card.format-portrait .ic-stats-grid {
    gap: 0.35rem 0.55rem;
    margin-bottom: 0.45rem;
  }
  .insta-card.format-portrait .ic-highlight-banner {
    padding: 0.4rem 0.55rem;
    margin-bottom: 0.45rem;
  }
}

/* Themes for Card */
.insta-card.theme-dark {
  background: linear-gradient(160deg, #090e17 0%, #111a2e 50%, #060a10 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.insta-card.theme-neon {
  background: linear-gradient(160deg, #0d0221 0%, #150050 50%, #000000 100%);
  color: #fff;
  border: 1px solid rgba(0, 242, 254, 0.4);
  box-shadow: 0 0 40px rgba(0, 242, 254, 0.25);
}

.insta-card.theme-minimal {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.insta-card.theme-neon .ic-week-val {
  color: var(--accent-lime);
}

.insta-card.theme-minimal .ic-badge,
.insta-card.theme-minimal .ic-stat-label,
.insta-card.theme-minimal .hl-title,
.insta-card.theme-minimal .ic-sub,
.insta-card.theme-minimal .ic-week-lbl,
.insta-card.theme-minimal .ic-pol-tag {
  color: #64748b;
}

.insta-card.theme-minimal .ic-pol-bar-wrap {
  background: #e2e8f0;
}

.insta-card.theme-minimal .ic-brand,
.insta-card.theme-minimal .ic-main-distance,
.insta-card.theme-minimal .ic-stat-val,
.insta-card.theme-minimal .hl-value,
.insta-card.theme-minimal .ic-week-val,
.insta-card.theme-minimal .ic-ef-range,
.insta-card.theme-minimal .ic-pol-val,
.insta-card.theme-minimal #sc-footer-metrics {
  color: #0f172a;
}

.insta-card.theme-minimal .ic-highlight-banner,
.insta-card.theme-minimal .ic-bar-wrap {
  background: #f1f5f9;
}

/* Card Internals */
.ic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ic-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--accent-orange);
}

.ic-brand {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
}

.ic-title-area {
  margin: 0.85rem 0 0.65rem 0;
}

.ic-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.ic-main-distance {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1.5px;
  background: linear-gradient(90deg, #ff5722, #ff9100);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ic-main-distance .unit {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-secondary);
  -webkit-text-fill-color: initial;
}

.ic-ef-range {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 0.35rem;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ic-ef-range i {
  color: var(--accent-orange);
  font-size: 0.75rem;
}

.ic-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 0.85rem;
  margin-bottom: 0.75rem;
}

.ic-stat-item {
  display: flex;
  flex-direction: column;
}

.ic-stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.ic-stat-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.ic-stat-val small {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ic-highlight-banner {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-subtle);
}

.ic-hl-box {
  display: flex;
  flex-direction: column;
}

.hl-title {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}

.hl-value {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.wc-type-chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

.wc-type-chips .badge-count {
  font-size: 0.62rem;
  padding: 0.15rem 0.45rem;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Weekly Sparklines in Card */
.ic-weeks-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 52px;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0 0.5rem;
}

.ic-week-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  height: 100%;
}

.ic-week-val {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1;
  letter-spacing: -0.2px;
}

.ic-bar-wrap {
  width: 100%;
  height: 30px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.ic-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-orange), #ff8a65);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
}

.ic-week-lbl {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

.ic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.65rem;
  box-sizing: border-box;
  width: 100%;
}

.ic-pol-footer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  box-sizing: border-box;
}

.ic-pol-labels-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.ic-pol-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  letter-spacing: 0.4px;
}

.ic-pol-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  box-sizing: border-box;
}

.ic-pol-bar-low {
  height: 100%;
  background: linear-gradient(90deg, #00e676, #00b0ff);
  transition: width 0.4s ease;
}

.ic-pol-bar-high {
  height: 100%;
  background: linear-gradient(90deg, #ff7043, #ff1744);
  transition: width 0.4s ease;
}

.ic-pol-val {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

/* ---------------- TAB 4: YEARLY RECAP & SHOE TRACKER ---------------- */
.yearly-hero-card {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.08) 0%, rgba(0, 242, 254, 0.04) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
}

.yearly-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.yearly-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.yearly-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-orange);
}

.yc-year {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.yc-distance {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--accent-orange);
  margin-bottom: 0.5rem;
}

.yc-distance small {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.yc-metrics-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
}

.yc-metric-item {
  display: flex;
  justify-content: space-between;
}

.yc-metric-item strong {
  color: var(--text-primary);
}

/* Shoe Tracker Cards */
.shoe-tracker-card {
  margin-top: 2rem;
}

.shoe-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.shoe-item-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shoe-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.shoe-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.shoe-dist {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-orange);
}

.shoe-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.shoe-progress-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s ease;
}

.shoe-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---------------- Global Footer ---------------- */
.app-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 2rem 0 1rem 0;
}

/* ---------------- Responsive Tweaks ---------------- */
@media (max-width: 840px) {
  .metrics-grid,
  .month-hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-cards-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .app-container {
    padding: 1rem 0.75rem;
  }
  .metrics-grid,
  .month-hero-grid {
    grid-template-columns: 1fr;
  }
  .main-tabs {
    gap: 0.25rem;
  }
  .tab-btn span {
    font-size: 0.82rem;
  }
  .tab-btn i {
    font-size: 1.1rem;
  }
  .tab-hint {
    display: none;
  }
  .insta-card {
    width: 100%;
    min-height: 580px;
    padding: 1.5rem 1.25rem;
  }
  .ic-main-distance {
    font-size: 3rem;
  }
}

/* ---------------- TAB 4: RUNNING HEATMAP STYLES ---------------- */
.heatmap-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(6, 11, 25, 0.95));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.hh-info,
.hh-content {
  flex: 1;
  min-width: 260px;
}

.hh-info .sub-title,
.hh-content .sub-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-orange);
  letter-spacing: 1px;
}

.hh-info .main-title,
.hh-content .main-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0.3rem 0 0.5rem 0;
}

.hh-info .description,
.hh-content .description {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.hh-stats,
.hh-quick-stats {
  display: flex;
  gap: 1.5rem;
  background: rgba(11, 17, 32, 0.6);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.hh-stat-item {
  display: flex;
  flex-direction: column;
}

.hh-stat-item .lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.hh-stat-item .val {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

/* Map Card & Container Overflow Guard */
#panel-heatmap,
.map-card,
#runningHeatmap,
.leaflet-container {
  overflow: hidden !important;
  max-width: 100% !important;
  position: relative;
}

/* Map Card */
.map-card {
  padding: 1.25rem;
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Heatmap Sport Filter (Pure Running vs All) */
.heatmap-sport-filter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(11, 17, 32, 0.7);
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.hm-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.hm-filter-btn:hover {
  color: #fff;
}

.hm-filter-btn.active {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.25), rgba(255, 112, 67, 0.35));
  border-color: var(--accent-orange);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.3);
}

.map-quick-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.map-quick-buttons .btn-ghost {
  width: auto;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  gap: 0.3rem;
  font-weight: 600;
}

.map-quick-buttons .active-ghost {
  background: rgba(255, 87, 34, 0.2);
  border-color: var(--accent-orange);
  color: #fff;
}

.track-color-picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tcp-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-right: 0.25rem;
}

.tcp-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s;
}

.tcp-btn:hover {
  transform: scale(1.2);
}

.tcp-btn.active {
  border-color: #fff;
  box-shadow: 0 0 8px #fff;
}

/* Leaflet Canvas Container */
.running-map-view {
  width: 100%;
  height: 520px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #0b0f19;
  z-index: 1;
}

/* Pure CSS Dark-Mode Theme for OpenStreetMap Tiles (100% Free & No API Key) */
.running-map-view .leaflet-tile-pane {
  filter: brightness(0.65) invert(1) contrast(2.8) hue-rotate(200deg) saturate(0.25) brightness(0.6);
}

/* Keep the Vector Polyline Track Layers at Full Brightness & Glow */
.running-map-view .leaflet-overlay-pane {
  z-index: 400;
}

.map-footer-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Custom Leaflet Dark Popup */
.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.95) !important;
  color: #fff !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 87, 34, 0.4) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8) !important;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
}

.map-popup-card {
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

.map-popup-card h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-orange);
  margin-bottom: 0.25rem;
}

.map-popup-card .stats-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.map-popup-card .stats-row strong {
  color: #fff;
}

/* Routes Grid */
.outdoor-routes-section {
  margin-top: 1.5rem;
}

.outdoor-routes-section .section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.outdoor-routes-section .section-title i {
  color: var(--accent-cyan);
}

.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.route-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.route-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-orange);
  background: var(--bg-card-hover);
}

.rc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.rc-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.rc-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
}

.rc-details {
  display: flex;
  gap: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.rc-details strong {
  color: var(--text-primary);
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN ENHANCEMENTS
   ========================================================================== */

/* Button & Nav Wrap Controls */
.tabs-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}
.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pills {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}
.filter-pills::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Map Header & Actions Mobile Layout */
.map-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.heatmap-sport-filter,
.map-quick-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  white-space: nowrap;
}

.heatmap-sport-filter::-webkit-scrollbar,
.map-quick-buttons::-webkit-scrollbar {
  display: none;
}

.hm-filter-btn,
.btn-ghost {
  white-space: nowrap;
  flex-shrink: 0;
}

.track-color-picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

/* Header Nav Quick Links */
.header-nav-quick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-header-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Tablet & Mobile Screens (<= 960px) */
@media (max-width: 960px) {
  .app-container {
    padding: 1rem 0.85rem 3rem 0.85rem;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .header-brand {
    justify-content: flex-start;
  }

  .header-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .month-hero-grid,
  .metric-grid,
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-cards-row {
    grid-template-columns: 1fr;
  }

  .weekly-hero-card,
  .heatmap-hero-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }

  .hh-quick-stats,
  .hh-stats {
    width: 100%;
    justify-content: space-around;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .map-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Smartphone Screens (<= 640px) */
@media (max-width: 640px) {
  .app-container {
    padding: 0.75rem 0.6rem 2.5rem 0.6rem;
  }

  .app-header {
    padding: 0.5rem 0 0.85rem 0;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-badge {
    font-size: 0.58rem;
    letter-spacing: 0.5px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .header-meta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }

  .period-control-group {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.4rem;
  }

  .period-title {
    font-size: 0.72rem;
  }

  .header-select {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    padding: 0.25rem 0.3rem;
  }

  .period-active-badge {
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .btn-refresh {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    justify-content: center;
  }

  .header-nav-quick {
    display: flex;
    gap: 0.35rem;
    width: 100%;
  }

  .btn-header-link {
    flex: 1;
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.32rem 0.4rem;
  }

  /* Filter Bar Mobile: 3 equal buttons, no overflow */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.55rem 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
  }

  .filter-label {
    font-size: 0.75rem;
  }

  .filter-btn-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 0.2rem;
  }

  .filter-btn {
    min-width: 0;
    justify-content: center;
    padding: 0.4rem 0.1rem;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: var(--radius-sm);
  }

  .filter-btn .badge-num {
    font-size: 0.62rem;
  }

  /* Main Tabs Mobile: 5 compact buttons with no hint */
  .main-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.2rem;
    padding: 0.25rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
  }

  .tab-btn {
    padding: 0.5rem 0.1rem;
    gap: 0.1rem;
  }

  .tab-btn i {
    font-size: 0.95rem;
  }

  .tab-btn span {
    font-size: 0.68rem;
    letter-spacing: -0.5px;
    white-space: nowrap;
  }

  .tab-hint {
    display: none !important;
  }

  /* Metrics Grid Mobile: 1 col */
  .month-hero-grid,
  .metric-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .metric-card {
    padding: 1rem;
  }

  .metric-val,
  .m-val {
    font-size: 1.5rem;
  }

  /* Weekly Recap Mobile */
  .weekly-cards-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Monthly Format Chips Mobile */
  .format-picker-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 0.25rem;
  }

  .btn-format-chip {
    padding: 0.45rem 0.15rem;
    font-size: 0.68rem;
    justify-content: center;
    white-space: nowrap;
  }

  .studio-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
  }

  .studio-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .theme-picker-group {
    width: 100%;
    justify-content: space-around;
  }

  .studio-btn-group {
    width: 100%;
    display: flex;
  }

  .studio-btn-group .btn-primary {
    flex: 1;
    justify-content: center;
  }

  /* Insta Card Preview Mobile */
  .insta-card,
  .insta-card.format-story,
  .insta-card.format-square,
  .insta-card.format-portrait {
    width: 100% !important;
    max-width: 330px !important;
    min-width: 0 !important;
    margin: 0 auto;
    box-sizing: border-box !important;
  }

  .insta-card.format-square {
    min-height: auto;
    aspect-ratio: 1 / 1;
    padding: 0.85rem 1rem;
  }

  .insta-card.format-square .ic-main-distance {
    font-size: 2.1rem;
  }

  .insta-card.format-portrait {
    min-height: auto;
    aspect-ratio: 4 / 5;
    padding: 1.1rem;
  }

  .insta-card.format-portrait .ic-main-distance {
    font-size: 2.4rem;
  }

  /* Heatmap Mobile */
  .hh-quick-stats,
  .hh-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding: 0.65rem 0.4rem;
  }

  .hh-stat-item .val {
    font-size: 1.05rem;
  }

  .hh-stat-item .lbl {
    font-size: 0.62rem;
  }

  .map-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .heatmap-sport-filter,
  .map-quick-buttons {
    display: flex;
    width: 100%;
  }

  .hm-filter-btn {
    flex: 1;
    justify-content: center;
    padding: 0.42rem 0.35rem;
    font-size: 0.72rem;
  }

  .btn-ghost {
    flex: 1;
    justify-content: center;
  }

  .track-color-picker {
    width: 100%;
    justify-content: center;
  }

  /* Mobile Card Padding Optimization (Prevent horizontal overflow) */
  .card {
    padding: 1.15rem 0.85rem;
    border-radius: var(--radius-md);
  }

  /* Threshold Diagnostics Mobile Optimization */
  .threshold-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .threshold-header .card-title {
    width: 100%;
    font-size: 1rem;
    line-height: 1.35;
  }

  .threshold-header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .btn-hr-settings,
  .threshold-status-badge {
    width: 100%;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }

  .hr-settings-drawer {
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius-sm);
  }

  .hr-drawer-header h4 {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .hr-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hr-input-group,
  .input-with-unit,
  .hr-input-actions {
    width: 100%;
  }

  .input-with-unit input {
    width: 100% !important;
    box-sizing: border-box;
  }

  .btn-save-hr,
  .btn-reset-hr {
    flex: 1;
    justify-content: center;
    padding: 0.55rem 0.75rem;
  }

  .threshold-box {
    padding: 0.95rem 0.85rem;
    box-sizing: border-box;
    overflow: hidden;
  }

  .threshold-val-number {
    font-size: 1.35rem;
  }

  .threshold-coaching-box {
    padding: 0.75rem 0.85rem;
    font-size: 0.78rem;
  }

  /* Aerobic Decoupling Box Mobile */
  .decoupling-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 0.85rem;
  }

  /* VDOT & Paces Banner Mobile */
  .vdot-score-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
  }

  .vdot-score-box {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 0.45rem 0.85rem;
    box-sizing: border-box;
  }

  .training-paces-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem;
  }

  .pace-zone-item {
    padding: 0.5rem 0.35rem;
  }

  .pz-val {
    font-size: 0.9rem;
  }

  /* Outdoor Routes & Yearly Grids Mobile */
  .routes-grid,
  .yearly-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Studio Button Group Mobile */
  .studio-btn-group .btn-secondary {
    flex: 1;
    justify-content: center;
  }

  .theme-picker-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 0.25rem;
  }

  .btn-theme-chip {
    padding: 0.45rem 0.15rem;
    font-size: 0.68rem;
    justify-content: center;
    white-space: nowrap;
  }
}

/* ==========================================================================
   SUB-PAGES (ABOUT, GUIDE, PRIVACY, CONTACT) STYLING (Dark Tech UI)
   ========================================================================== */
/* App Footer Links */
.app-footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem 1rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.footer-links a:hover {
  color: var(--accent-orange);
}

.footer-links .sep {
  color: rgba(255, 255, 255, 0.2);
}

/* Header Quick Navigation */
.header-nav-quick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-header-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.subpage-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
}

.subpage-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.subpage-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-orange);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 87, 34, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 87, 34, 0.25);
  margin-bottom: 1rem;
}

.subpage-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subpage-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.6;
}

.subpage-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: rgba(13, 19, 33, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
}

.subpage-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  text-decoration: none;
  color: #fff;
}

.subpage-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subpage-nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.subpage-nav-link:hover,
.subpage-nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.subpage-nav-link.active {
  color: var(--accent-orange);
  border-bottom: 2px solid var(--accent-orange);
}

/* Content Sections */
.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem;
  margin-bottom: 2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.doc-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.doc-section-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
}

.doc-section-title i {
  color: var(--accent-orange);
  font-size: 1.3rem;
}

.doc-card p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.doc-card p:last-child {
  margin-bottom: 0;
}

.doc-card ul, .doc-card ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.doc-card li {
  margin-bottom: 0.45rem;
}

.doc-card strong {
  color: #fff;
}

.doc-highlight-box {
  background: rgba(0, 242, 254, 0.05);
  border-left: 3px solid var(--accent-cyan);
  padding: 1.1rem 1.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
}

.doc-highlight-box p {
  color: #e2e8f0;
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}

/* Feature Grid in Guide */
.guide-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.guide-menu-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guide-menu-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-orange);
}

.guide-menu-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.guide-menu-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Contact Component */
.contact-card-box {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.08) 0%, rgba(0, 242, 254, 0.05) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2.5rem;
  text-align: center;
  margin-top: 2rem;
}

.contact-email-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glow);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), #ff8a65);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
}

.contact-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.6);
}

.contact-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Quick Inquiry Form */
.inquiry-form {
  max-width: 600px;
  margin: 2rem auto 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inquiry-input, .inquiry-textarea {
  width: 100%;
  background: rgba(13, 19, 33, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.inquiry-input:focus, .inquiry-textarea:focus {
  border-color: var(--accent-cyan);
}

.inquiry-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Toast Message */
.subpage-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.subpage-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Mobile responsive for subpages */
@media (max-width: 768px) {
  .subpage-container {
    padding: 1.25rem 1rem 4rem 1rem;
  }
  .subpage-title {
    font-size: 1.85rem;
  }
  .subpage-nav-bar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .subpage-nav-links {
    justify-content: space-around;
    flex-wrap: wrap;
  }
  .doc-card {
    padding: 1.5rem 1.25rem;
  }
  .contact-email-wrapper {
    font-size: 0.95rem;
    padding: 0.65rem 1rem;
  }
}

/* ==========================================================================
   Strava Web OAuth Button & Real-time Sync Modal Styles
   ========================================================================== */

.btn-strava-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: linear-gradient(135deg, #fc5200 0%, #e04400 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(252, 82, 0, 0.5);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(252, 82, 0, 0.35);
  text-decoration: none;
  white-space: nowrap;
}

.btn-strava-auth:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #ff6a24 0%, #fc5200 100%);
  box-shadow: 0 4px 16px rgba(252, 82, 0, 0.55);
}

.btn-strava-auth:active {
  transform: translateY(0);
}

.btn-strava-auth.connected {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.25) 100%);
  border-color: rgba(16, 185, 129, 0.6);
  color: #10b981;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.btn-strava-auth.connected:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.25) 100%);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

/* Strava Sync Overlay Modal */
.strava-sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.sync-modal-box {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(11, 17, 32, 0.98));
  border: 1px solid rgba(252, 82, 0, 0.4);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(252, 82, 0, 0.2);
  padding: 2.25rem 2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.sync-icon-wrapper {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.sync-strava-icon {
  font-size: 2.2rem;
  color: #fc5200;
  z-index: 2;
  filter: drop-shadow(0 0 10px rgba(252, 82, 0, 0.6));
}

.sync-spinner {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(252, 82, 0, 0.15);
  border-top-color: #fc5200;
  border-right-color: #ff8a50;
  border-radius: 50%;
  animation: syncSpin 1s linear infinite;
}

@keyframes syncSpin {
  to {
    transform: rotate(360deg);
  }
}

.sync-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0;
}

.sync-modal-desc {
  font-size: 0.88rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.5;
  margin: 0;
}

.sync-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.sync-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fc5200, #ff8a50, #00f2fe);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.sync-modal-status {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #ff8a50;
  letter-spacing: 0.5px;
}

.btn-cancel-sync {
  margin-top: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #64748b);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.btn-cancel-sync:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* ==========================================================================
   Workout Classification & Like-for-Like EF Intelligence Styles
   ========================================================================== */
.badge-wo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.badge-wo i {
  font-size: 0.8rem;
}

.badge-wo-low {
  background: rgba(0, 230, 118, 0.14);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.35);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.15);
}

.badge-wo-high {
  background: rgba(255, 87, 34, 0.14);
  color: #ff7043;
  border: 1px solid rgba(255, 87, 34, 0.35);
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.15);
}

.badge-wo-lsd {
  background: rgba(0, 229, 255, 0.14);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.badge-wo-other {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Like-for-Like EF Subtext in Hero Card */
.metric-sub-like {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.4;
}

.metric-sub-like strong {
  font-weight: 700;
}

.metric-sub-like .ef-up {
  color: #00e676;
}

.metric-sub-like .ef-down {
  color: #ff9100;
}

.metric-sub-like .ef-flat {
  color: var(--text-muted);
}

/* Weekly 80/20 Polarized Coaching Card */
.weekly-coaching-card {
  background: linear-gradient(135deg, rgba(20, 26, 40, 0.85) 0%, rgba(13, 18, 28, 0.95) 100%);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-lg, 14px);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.weekly-coaching-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #00e5ff, #00e676, #ffab00);
}

.wcc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.wcc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.wcc-title i {
  color: var(--accent-cyan, #00e5ff);
}

.wcc-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.wcc-badge.gold {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.wcc-badge.green {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.wcc-badge.orange {
  background: rgba(255, 112, 67, 0.15);
  color: #ff7043;
  border: 1px solid rgba(255, 112, 67, 0.3);
}

/* 80/20 Ratio Progress Bar */
.wcc-ratio-wrap {
  margin-bottom: 1rem;
}

.wcc-ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.wcc-ratio-labels .low-lbl {
  color: #00e676;
}

.wcc-ratio-labels .high-lbl {
  color: #ff9100;
}

.wcc-bar-container {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.wcc-bar-low {
  height: 100%;
  background: linear-gradient(90deg, #00e676, #00e5ff);
  transition: width 0.5s ease;
}

.wcc-bar-high {
  height: 100%;
  background: linear-gradient(90deg, #ff9100, #ff5252);
  transition: width 0.5s ease;
}

.wcc-coaching-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary, #cbd5e1);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm, 8px);
  border-left: 3px solid var(--accent-orange, #ff5722);
}

.wcc-coaching-text strong {
  color: #fff;
}

/* AI Coach Prescription Box inside Weekly Coaching Card */
.wcc-prescription-card {
  margin-top: 1rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: var(--radius-md, 12px);
  padding: 1.1rem 1.25rem;
  backdrop-filter: blur(8px);
}

.wpc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.wpc-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.wpc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent-cyan, #00e5ff);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.wpc-note {
  font-size: 0.84rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

.wpc-note strong {
  color: var(--accent-orange, #ff5722);
}

.wpc-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.wpc-metric-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  text-align: center;
}

.wpc-lbl {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.25rem;
}

.wpc-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #f8fafc;
}

.wpc-val small {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-create-plan-from-weekly {
  width: 100%;
  padding: 0.85rem 1.25rem;
  min-height: 46px;
  background: linear-gradient(135deg, #ff5722 0%, #ff8f00 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 87, 34, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-create-plan-from-weekly:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(255, 87, 34, 0.5);
  background: linear-gradient(135deg, #ff6e40 0%, #ffa000 100%);
}

.btn-create-plan-from-weekly:active {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .wpc-metric-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .btn-create-plan-from-weekly {
    font-size: 0.85rem;
    padding: 0.8rem 1rem;
  }
}

/* Weekly Card Workout Breakdown Chips */
.wc-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.wc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.wc-chip-low { background: rgba(0, 230, 118, 0.12); color: #00e676; }
.wc-chip-high { background: rgba(255, 87, 34, 0.12); color: #ff7043; }
.wc-chip-lsd { background: rgba(0, 229, 255, 0.12); color: #00e5ff; }

/* 80/20 Mini Bar inside Weekly Card */
.wc-mini-bar-wrap {
  margin-top: 0.55rem;
}

.wc-mini-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  font-family: var(--font-mono);
}

.wc-mini-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.wc-mini-bar-low {
  height: 100%;
  background: #00e676;
}

.wc-mini-bar-high {
  height: 100%;
  background: #ff9100;
}

/* ==========================================================================
   HEADER STRAVA CONNECTED PILL & RUNNER PROFILE BUTTON
   ========================================================================== */
.strava-nav-box {
  display: inline-flex;
  align-items: center;
}

.strava-connected-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(252, 76, 2, 0.12);
  border: 1px solid rgba(252, 76, 2, 0.35);
  border-radius: 12px;
  padding: 0.25rem 0.5rem;
  gap: 0.4rem;
  font-family: var(--font-outfit);
}

.strava-user-tag {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-right: 0.35rem;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-strava-sync-mini {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}
.btn-strava-sync-mini:hover {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.15);
}

.btn-strava-disconnect-mini {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-outfit);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}
.btn-strava-disconnect-mini:hover {
  background: #ef4444;
  color: #fff;
}

.btn-runner-profile {
  border-color: rgba(255, 87, 34, 0.35) !important;
  background: rgba(255, 87, 34, 0.08) !important;
  cursor: pointer;
}
.btn-runner-profile:hover {
  background: rgba(255, 87, 34, 0.2) !important;
  border-color: rgba(255, 87, 34, 0.6) !important;
}

/* ==========================================================================
   RUNNER PROFILE MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.runner-profile-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 87, 34, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.runner-profile-card .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.runner-profile-card .modal-title {
  font-family: var(--font-outfit);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.2s;
}
.btn-modal-close:hover {
  color: #fff;
}

.runner-profile-card .modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 75vh;
  overflow-y: auto;
}

.runner-profile-card .modal-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
  background: rgba(0, 242, 254, 0.05);
  border-left: 3px solid var(--accent-cyan);
  padding: 0.65rem 0.85rem;
  border-radius: 0 8px 8px 0;
}

.profile-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
  font-family: var(--font-outfit);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.input-unit-wrap {
  display: flex;
  align-items: center;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  transition: border-color 0.2s;
}
.input-unit-wrap:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.input-unit-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.input-unit-wrap .unit-text {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
  margin-left: 0.3rem;
}

.gender-toggle-group {
  display: flex;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  height: 42px;
  box-sizing: border-box;
}

.btn-gender {
  flex: 1;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-outfit);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-gender.active {
  background: rgba(255, 87, 34, 0.25);
  color: #ff8a65;
  box-shadow: 0 0 10px rgba(255, 87, 34, 0.2);
}

.outdoor-anchor-card {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.oac-header {
  font-size: 0.84rem;
  font-family: var(--font-outfit);
  color: #10b981;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.oac-body {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-strava-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.mss-header {
  font-size: 0.84rem;
  font-family: var(--font-outfit);
  color: #fc4c02;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mss-content {
  font-size: 0.82rem;
  color: #94a3b8;
}

.btn-danger-outline {
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-outfit);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}
.btn-danger-outline:hover {
  background: #ef4444;
  color: #fff;
}

.runner-profile-card .modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 13, 22, 0.5);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-outfit);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary-gradient {
  background: linear-gradient(135deg, #ff5722 0%, #ff8a65 100%);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: var(--font-outfit);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.4);
  transition: all 0.2s;
}
.btn-primary-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 87, 34, 0.6);
}

/* ==========================================================================
   2-Track Onboarding Gateway Modal Styling
   ========================================================================== */
.welcome-gateway-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 8, 16, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gateway-modal-box {
  background: linear-gradient(135deg, rgba(18, 26, 44, 0.96), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  max-width: 920px;
  width: 100%;
  padding: 2.25rem 2rem 1.75rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 40px rgba(0, 242, 254, 0.08);
  box-sizing: border-box;
}

.gateway-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.gateway-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  letter-spacing: 0.8px;
  margin-bottom: 0.75rem;
}

.gateway-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.gateway-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
}

.gateway-sub strong {
  color: #fff;
}

.gateway-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.gateway-track-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.gateway-track-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.04);
}

.gateway-track-card.track-a:hover {
  border-color: rgba(255, 87, 34, 0.5);
  box-shadow: 0 10px 30px rgba(255, 87, 34, 0.18);
}

.gateway-track-card.track-b:hover {
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 10px 30px rgba(0, 242, 254, 0.18);
}

.gtc-top {
  margin-bottom: 1.25rem;
}

.gtc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.gtc-tag-orange {
  color: var(--accent-orange);
  background: rgba(255, 87, 34, 0.12);
  border: 1px solid rgba(255, 87, 34, 0.3);
}

.gtc-tag-cyan {
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.gtc-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.4rem;
}

.gtc-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.gtc-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.gtc-features li {
  font-size: 0.84rem;
  color: #cbd5e1;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}

.gtc-features li i {
  font-size: 1rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.btn-gateway-action {
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  border: none;
}

.btn-track-a {
  background: linear-gradient(135deg, #fc5200 0%, #ff7043 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(252, 82, 0, 0.35);
}

.btn-track-a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(252, 82, 0, 0.55);
}

.btn-track-b {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.35);
}

.btn-track-b:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.55);
}

.gateway-footer {
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-gateway-demo {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-gateway-demo:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Instagram Plan Card Row Types */
.pic-day-row.easy {
  border-left: 3px solid var(--accent-lime);
  background: rgba(16, 185, 129, 0.05);
}
.pic-day-row.tempo {
  border-left: 3px solid var(--accent-orange);
  background: rgba(255, 87, 34, 0.08);
}
.pic-day-row.lsd {
  border-left: 3px solid var(--accent-cyan);
  background: rgba(0, 242, 254, 0.06);
}
.pic-day-row.rest {
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   DAILY INSTA CARD: THE STATE OF RUNNING 2019 GLOBAL BENCHMARK BADGE
   ========================================================================== */
.ic-global-benchmark-badge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 242, 254, 0.06);
  border: 1px solid rgba(0, 242, 254, 0.22);
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
  width: 100%;
}

.ic-gb-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-outfit);
}

.ic-gb-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-tier {
  font-family: var(--font-outfit);
  font-size: 0.68rem;
  font-weight: 800;
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.15);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.badge-source {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* Theme overrides for Benchmark Badge */
.insta-card.theme-minimal .ic-global-benchmark-badge {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.insta-card.theme-minimal .ic-gb-left {
  color: #0f172a;
}
.insta-card.theme-minimal .badge-tier {
  color: #0284c7;
  background: #e0f2fe;
}
.insta-card.theme-minimal .badge-source {
  color: #64748b;
}

/* Format scale for square (1:1) and mobile */
.insta-card.format-square .ic-global-benchmark-badge {
  padding: 0.25rem 0.55rem;
  margin-bottom: 0.45rem;
}
.insta-card.format-square .ic-gb-left {
  font-size: 0.68rem;
}
.insta-card.format-square .badge-tier {
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
}
.insta-card.format-square .badge-source {
  display: none; /* Hide source tag in tight square to prevent wrapping */
}

@media (max-width: 480px) {
  .profile-inputs-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   7-Day Training Plan & Instagram Blueprint Studio (Mobile-First)
   ========================================================================== */
.plan-hero-card {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 20px;
  padding: 1.8rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.plan-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

.plan-hero-title {
  font-family: var(--font-brand);
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.plan-hero-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 780px;
  margin: 0;
}

/* Strava Live Autofill Banner */
.plan-autofill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(255, 87, 34, 0.08);
  border: 1px solid rgba(255, 87, 34, 0.3);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.pab-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: #f1f5f9;
}

.pab-info i {
  font-size: 1.2rem;
}

.btn-pab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #ff5722 0%, #ff8a65 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(255, 87, 34, 0.35);
}

.btn-pab:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Plan Form Card */
.plan-form-card {
  background: rgba(18, 26, 44, 0.75);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.8rem 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.pfc-header {
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pfc-title {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pfc-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.plan-form-group {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.pfg-label {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 800;
  color: #00f2fe;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.pfg-row-mobile {
  display: flex;
  gap: 1rem;
}

.pfg-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pfg-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pfg-field input {
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.pfg-field input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

.pfg-time-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 240px;
}

.pfg-time-inputs input {
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
}

.pfg-time-colon {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.2rem;
}

/* Segmented Control */
.plan-segmented-control {
  display: flex;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}

.plan-seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-brand);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.plan-seg-btn.active {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

/* Chips Row */
.plan-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.plan-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-muted);
  font-family: var(--font-brand);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.plan-chip.active {
  background: rgba(255, 87, 34, 0.15);
  color: var(--accent-orange);
  border-color: rgba(255, 87, 34, 0.4);
}

/* Mode Switcher */
.plan-mode-switcher {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.plan-mode-tab {
  flex: 1;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  color: var(--text-muted);
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s;
}

.plan-mode-tab.active {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.35);
}

.plan-mode-content {
  background: rgba(9, 13, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem;
}

.plan-help-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.plan-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: #fde68a;
  line-height: 1.5;
}

/* Action Button */
.btn-plan-generate {
  width: 100%;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #090d16;
  border: none;
  border-radius: 14px;
  padding: 1rem 1.5rem;
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.3);
}

.btn-plan-generate:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.45);
}

/* Plan Result Metrics Grid */
.plan-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pm-box {
  background: rgba(18, 26, 44, 0.75);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pm-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pm-val {
  font-family: var(--font-brand);
  font-size: 1.55rem;
  font-weight: 900;
}

.pm-val small {
  font-size: 0.85rem;
  font-weight: 600;
}

.pm-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 80/20 Ratio Bar Box */
.plan-ratio-bar-box {
  background: rgba(18, 26, 44, 0.75);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.75rem;
}

.prb-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
}

.prb-lbl-low {
  color: var(--accent-lime);
  font-weight: 700;
}

.prb-lbl-high {
  color: var(--accent-orange);
  font-weight: 700;
}

.prb-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  display: flex;
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.prb-fill-low {
  height: 100%;
  background: var(--accent-lime);
  border-radius: 9999px 0 0 9999px;
  transition: width 0.6s ease;
}

.prb-fill-high {
  height: 100%;
  background: var(--accent-orange);
  border-radius: 0 9999px 9999px 0;
  transition: width 0.6s ease;
}

.prb-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 7-Day Stack Cards */
.plan-days-container {
  margin-bottom: 2.5rem;
}

.plan-section-title {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.plan-days-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pday-card {
  background: rgba(18, 26, 44, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
}

.pday-card:hover {
  background: rgba(28, 38, 65, 0.85);
  border-color: rgba(0, 242, 254, 0.3);
  transform: translateY(-1px);
}

.pday-card.day-rest {
  border-left: 4px solid #64748b;
  opacity: 0.85;
}

.pday-card.day-easy {
  border-left: 4px solid var(--accent-lime);
}

.pday-card.day-tempo {
  border-left: 4px solid var(--accent-orange);
}

.pday-card.day-lsd {
  border-left: 4px solid var(--accent-cyan);
}

.pday-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.pday-badge {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  min-width: 58px;
  text-align: center;
}

.pday-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pday-title {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pday-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.pday-tag.tag-rest { background: rgba(100, 116, 139, 0.2); color: #cbd5e1; }
.pday-tag.tag-easy { background: rgba(16, 185, 129, 0.2); color: var(--accent-lime); }
.pday-tag.tag-tempo { background: rgba(255, 87, 34, 0.2); color: var(--accent-orange); }
.pday-tag.tag-lsd { background: rgba(0, 242, 254, 0.2); color: var(--accent-cyan); }

.pday-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pday-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 140px;
}

.pday-dist {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
}

.pday-dist small {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pday-pace {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.pday-hr {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Plan Instagram Studio */
.plan-insta-studio {
  background: rgba(18, 26, 44, 0.75);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.8rem 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pis-header {
  margin-bottom: 1.25rem;
}

.pis-title {
  font-family: var(--font-brand);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pis-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.pis-formats {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.pis-fmt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  color: var(--text-muted);
  font-family: var(--font-brand);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.pis-fmt-btn.active {
  background: rgba(255, 87, 34, 0.15);
  color: var(--accent-orange);
  border-color: rgba(255, 87, 34, 0.4);
}

/* Plan Card Viewport & Realistic Canvas */
.plan-card-viewport {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0;
}

.plan-insta-card {
  width: 360px;
  background: #090d16;
  border-radius: 20px;
  padding: 1.5rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(255, 87, 34, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(0, 242, 254, 0.1) 0%, transparent 40%);
}

.plan-insta-card.fmt-story {
  height: 640px;
}

.plan-insta-card.fmt-square {
  width: 360px;
  height: 360px;
  padding: 1rem 1.1rem;
}

.plan-insta-card.fmt-portrait {
  width: 360px;
  height: 450px;
  padding: 1.25rem 1.25rem;
}

/* Inside Plan Card */
.pic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pic-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pic-logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff5722 0%, #ff8a65 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
}

.pic-brand-text {
  font-family: var(--font-brand);
  font-size: 0.95rem;
  font-weight: 900;
  color: #fff;
}

.pic-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.pic-hero-banner {
  text-align: center;
  margin: 0.85rem 0 0.65rem 0;
}

.pic-level-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-lime);
  letter-spacing: 1px;
}

.pic-target-dist {
  font-family: var(--font-brand);
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin: 0.2rem 0;
}

.pic-target-dist small {
  font-size: 1.1rem;
  color: var(--accent-orange);
  margin-left: 0.2rem;
}

.pic-vdot-info {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.pic-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.pic-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
}

.pic-day-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pic-day-lbl {
  font-family: var(--font-brand);
  font-weight: 800;
  color: #fff;
  min-width: 22px;
}

.pic-day-task {
  color: #e2e8f0;
  font-weight: 600;
}

.pic-day-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
}

.pic-day-km {
  font-weight: 800;
  color: #fff;
}

.pic-day-pace {
  color: var(--accent-cyan);
  font-size: 0.68rem;
}

/* Compact rules for 1:1 Square */
.plan-insta-card.fmt-square .pic-hero-banner {
  margin: 0.4rem 0 0.3rem 0;
}
.plan-insta-card.fmt-square .pic-target-dist {
  font-size: 1.8rem;
}
.plan-insta-card.fmt-square .pic-schedule-list {
  gap: 0.22rem;
}
.plan-insta-card.fmt-square .pic-day-row {
  padding: 0.22rem 0.55rem;
  font-size: 0.65rem;
}

/* Compact rules for 4:5 Portrait */
.plan-insta-card.fmt-portrait .pic-target-dist {
  font-size: 2.1rem;
}
.plan-insta-card.fmt-portrait .pic-day-row {
  padding: 0.28rem 0.6rem;
  font-size: 0.68rem;
}

.pic-footer-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.pic-footer-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  display: flex;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.pic-bar-low {
  height: 100%;
  background: var(--accent-lime);
}

.pic-bar-high {
  height: 100%;
  background: var(--accent-orange);
}

.pic-watermark {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.pis-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Mobile-First Responsive System (<768px & <480px)
   ========================================================================== */

@media (max-width: 768px) {
  /* Mobile Header */
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.75rem 0 1rem 0;
    margin-bottom: 1rem;
  }

  .header-brand {
    width: 100%;
    justify-content: space-between;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .header-meta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.65rem;
  }

  .header-nav-quick {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    width: 100%;
    flex-wrap: wrap;
  }

  .btn-header-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.76rem;
  }

  .period-control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.4rem;
  }

  .period-control-group select {
    flex: 1;
    min-width: 0;
  }

  .period-active-badge {
    font-size: 0.76rem;
    padding: 0.35rem 0.65rem;
    width: 100%;
    justify-content: center;
  }

  .btn-refresh {
    width: 100%;
    justify-content: center;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
  }

  /* Mobile-First Main Navigation Tabs (Swipeable Horizontal Scroll) */
  .main-tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    gap: 0.45rem;
    padding: 0.4rem 0.35rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
  }

  .main-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .tab-btn {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 84px;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
  }

  .tab-btn i {
    font-size: 1.15rem;
  }

  .tab-btn span {
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .tab-hint {
    display: none; /* 모바일 가독성 및 공간 절약을 위해 힌트 숨김 */
  }

  /* Filter Bar Mobile */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    margin-bottom: 1rem;
  }

  .filter-label {
    font-size: 0.76rem;
  }

  .filter-btn-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    width: 100%;
  }

  .filter-btn {
    justify-content: center;
    padding: 0.45rem 0.25rem;
    font-size: 0.74rem;
    min-width: 0;
  }

  /* 7-Day Plan Section Mobile Adjustments */
  .plan-hero-title {
    font-size: 1.35rem;
  }

  .plan-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .pfg-row-mobile {
    flex-direction: column;
    gap: 0.75rem;
  }

  .pfg-field input[type="number"],
  .pfg-time-inputs input {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    height: 44px; /* Touch friendly */
  }

  .pday-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
  }

  .pday-right {
    text-align: left;
    min-width: unset;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
  }

  .pday-dist {
    font-size: 1.15rem;
  }

  .btn-plan-generate {
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    height: 48px;
  }

  /* Instagram Plan Card Responsive Viewport */
  .plan-card-viewport {
    overflow-x: auto;
    padding: 0.5rem;
  }

  .plan-insta-card {
    max-width: 100%;
  }

  /* Gateway Modal Mobile */
  .gateway-modal-box {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius-lg);
  }
  .gateway-title {
    font-size: 1.35rem;
  }
  .gateway-sub {
    font-size: 0.82rem;
  }
  .gateway-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.25rem 0;
  }
  .gateway-track-card {
    padding: 1.25rem;
  }
  .btn-gateway-action {
    height: 46px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .gateway-modal-box {
    padding: 1.25rem 0.95rem;
  }
  .gateway-title {
    font-size: 1.2rem;
  }
  .gtc-title {
    font-size: 1.1rem;
  }
  .gtc-features li {
    font-size: 0.8rem;
  }

  .plan-metrics-grid {
    grid-template-columns: 1fr;
  }

  .pab-info {
    font-size: 0.82rem;
  }

  .btn-pab {
    width: 100%;
    justify-content: center;
  }

  .plan-mode-switcher {
    flex-direction: column;
  }

  .plan-mode-tab {
    width: 100%;
    justify-content: center;
  }

  .plan-chips-row {
    gap: 0.35rem;
  }

  .plan-chip {
    flex: 1 1 calc(50% - 0.35rem);
    text-align: center;
    padding: 0.45rem 0.5rem;
    font-size: 0.76rem;
  }
}




