/* ==========================================================================
   MASTER STRENGTH & PROGRESSIVE OVERLOAD TRACKER - DESIGN SYSTEM
   Deep Obsidian Theme, Cyber Teal Accents, Glassmorphism, Print-Optimized
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-deep: #070a12;
  --bg-surface: #0d1322;
  --bg-card: rgba(16, 24, 40, 0.75);
  --bg-card-hover: rgba(22, 33, 56, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 245, 212, 0.3);
  --border-focus: #00f5d4;

  --accent-teal: #00f5d4;
  --accent-cyan: #00b4d8;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-teal: #5eead4;
  --text-emerald: #34d399;

  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
  --glow-teal: 0 0 20px rgba(0, 245, 212, 0.25);
  --glow-emerald: 0 0 20px rgba(16, 185, 129, 0.3);

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --container-max: 1300px;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow-x: hidden !important;
  touch-action: pan-y; /* Completely locks gesture scrolling strictly to VERTICAL. No sideways panning! */
  -webkit-tap-highlight-color: transparent;
}

/* Background Atmosphere Gradient */
body::before {
  content: '';
  position: fixed;
  top: -150px;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.08) 0%, rgba(13, 19, 34, 0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(60px);
}

body::after {
  content: '';
  position: fixed;
  bottom: -150px;
  right: 15%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.07) 0%, rgba(7, 10, 18, 0) 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* Header Section */
.tracker-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.header-brand {
  display: flex;
  flex-direction: column;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.25);
  color: var(--text-teal);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border-radius: 9999px;
  width: fit-content;
  margin-bottom: 0.5rem;
}

.settings-gear-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: inherit;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.settings-gear-btn:hover {
  background: rgba(0, 245, 212, 0.15);
  color: var(--accent-teal);
  border-color: rgba(0, 245, 212, 0.35);
}

.brand-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-teal);
  box-shadow: 0 0 8px var(--accent-teal);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.ness-brand-hero {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ness-logo-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ness-emblem {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.3), rgba(16, 185, 129, 0.15) 70%, rgba(7, 10, 18, 0.8));
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.4), inset 0 0 14px rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.ness-emblem:hover {
  transform: scale(1.06);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.65), inset 0 0 18px rgba(16, 185, 129, 0.4);
}

.app-title {
  font-family: 'Outfit', sans-serif;
  font-size: 3.4rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 45%, #34d399 85%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 20px rgba(56, 189, 248, 0.45));
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
  user-select: none;
}

.ness-tagline-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  width: fit-content;
  max-width: 100%;
}

.tagline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
}

.tagline-text {
  font-size: 0.92rem;
  color: #cbd5e1;
  letter-spacing: 0.025em;
  font-weight: 500;
}

.tagline-highlight {
  color: #38bdf8;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

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

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  font-family: inherit;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #00f5d4 0%, #00b4d8 100%);
  color: #070a12;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 245, 212, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #33ffd9 0%, #26c6ea 100%);
  color: #000;
  box-shadow: var(--glow-teal);
}

.btn-emerald {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--text-emerald);
}

.btn-emerald:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--accent-emerald);
  box-shadow: var(--glow-emerald);
}

/* Real-Time Live Feed Bar (Command Center) */
.realtime-feed-card {
  background: linear-gradient(180deg, rgba(16, 24, 40, 0.85) 0%, rgba(13, 19, 34, 0.95) 100%);
  border: 1px solid rgba(0, 245, 212, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 2.25rem;
  position: relative;
  backdrop-filter: blur(12px);
}

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

.feed-title-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feed-title svg {
  color: var(--accent-teal);
}

.persistence-shield {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--text-emerald);
}

.feed-input-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.feed-input {
  flex: 1;
  background: rgba(7, 10, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.95rem;
  color: #fff;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  transition: all 0.2s ease;
  outline: none;
}

.feed-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
  background: rgba(7, 10, 18, 0.95);
}

.feed-input::placeholder {
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
}

.feed-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feed-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 3px 9px;
  font-family: monospace;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.feed-chip:hover {
  background: rgba(0, 245, 212, 0.12);
  color: var(--text-teal);
  border-color: rgba(0, 245, 212, 0.3);
}

/* Feed Entry Format Guide & Live Preview */
.feed-format-guide {
  background: rgba(13, 20, 36, 0.75);
  border: 1px solid rgba(0, 245, 212, 0.22);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.feed-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.82rem;
}

.guide-tag {
  color: var(--accent-cyan);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.guide-subnote {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.guide-tokens {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.pill-token {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 70px;
  text-align: center;
}

.pill-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
  margin-bottom: 2px;
  font-weight: 600;
}

.pill-name {
  background: rgba(255, 255, 255, 0.07);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.pill-weight {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.pill-rep {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-arrow {
  color: var(--accent-cyan);
  font-weight: bold;
  opacity: 0.7;
  font-size: 0.85rem;
}

.guide-example-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
}

.guide-example-strip code {
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.guide-explanation {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

/* Dynamic Live Preview */
.feed-live-preview {
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.95rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.preview-badge-label {
  color: var(--text-emerald);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(16, 185, 129, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
}

.preview-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.preview-item strong {
  color: #fff;
}

/* Notification Banner */
.notification-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
  font-size: 0.85rem;
  display: none;
  animation: fadeIn 0.2s ease;
}

.notification-banner.success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

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

/* Quick Bar Stats / Widget Bar */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 245, 212, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-teal);
  flex-shrink: 0;
}

.metric-icon-box.emerald {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

.metric-icon-box.purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
}

.metric-icon-box.amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-amber);
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--text-emerald);
  font-weight: 600;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--accent-teal);
  border-radius: 2px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Glass Tables */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  margin-bottom: 2.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: rgba(7, 10, 18, 0.85);
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.movement-name {
  font-weight: 700;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  word-break: normal;
}

.movement-category-tag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-weight: 500;
}

.load-pill {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 245, 212, 0.08);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 245, 212, 0.18);
  display: inline-block;
}

/* Badges */
.badge-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--text-teal);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-complete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--text-emerald);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-overload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid var(--accent-emerald);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
  white-space: nowrap;
}

/* Workout Session Card */
.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

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

.session-date-tag {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.session-notes-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--accent-teal);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Rest Timer Floating Bar */
.rest-timer-bar {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 245, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.timer-digits {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-teal);
  min-width: 55px;
}

.timer-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timer-btn:hover {
  background: var(--accent-teal);
  color: #000;
  font-weight: 700;
}

/* Search and Filter Inputs */
.search-input {
  background: rgba(7, 10, 18, 0.75);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-teal);
}

/* Tabs */
.tab-group {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 100%;
  flex-wrap: wrap; /* Prevents blowing out mobile viewport */
}

.tab-btn {
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: normal;
  text-align: center;
  flex: 1 1 auto;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  color: var(--accent-teal);
  border-bottom-color: var(--accent-teal);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 245, 212, 0.3);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

/* PRINT MEDIA STYLES - Generates the exact clean Hardcopy Record from the user's PDF */
@media print {
  body {
    background: #0f172a !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body::before, body::after,
  .realtime-feed-card,
  .header-actions,
  .rest-timer-bar,
  .tab-group,
  .search-input,
  .btn,
  .notification-banner {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .table-container {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: none !important;
  }

  .data-table th {
    background: #0f172a !important;
    color: #94a3b8 !important;
  }

  .data-table td {
    color: #e2e8f0 !important;
    border-bottom: 1px solid #334155 !important;
  }

  .badge-locked, .badge-complete {
    border: 1px solid #00f5d4 !important;
    color: #00f5d4 !important;
  }
}

/* Comprehensive Mobile Responsive Adjustments (Zero Sideways Scroll) */
/* Comprehensive Mobile Responsive Adjustments (Zero Sideways Scroll, Normal Horizontal Text) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    touch-action: pan-y !important;
  }

  .container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) calc(0.75rem + env(safe-area-inset-right, 0px)) calc(4.5rem + env(safe-area-inset-bottom, 0px)) calc(0.75rem + env(safe-area-inset-left, 0px)) !important;
    overflow-x: hidden !important;
  }

  .app-title {
    font-size: 2.5rem !important;
    letter-spacing: 0.1em !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .ness-emblem {
    width: 42px !important;
    height: 42px !important;
  }

  .ness-emblem svg {
    width: 24px !important;
    height: 24px !important;
  }

  .tagline-text {
    font-size: 0.8rem !important;
  }

  .header-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }

  .rest-timer-bar {
    width: 100% !important;
    justify-content: space-between !important;
    padding: 0.45rem 0.75rem !important;
    margin-bottom: 0.4rem;
  }

  .metrics-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1.5rem !important;
    width: 100% !important;
  }

  .metric-card {
    padding: 0.65rem 0.65rem !important;
    gap: 0.5rem !important;
  }

  .metric-icon-box {
    width: 32px !important;
    height: 32px !important;
  }

  .metric-label {
    font-size: 0.68rem !important;
  }

  .metric-value {
    font-size: 1.05rem !important;
  }

  .metric-sub {
    font-size: 0.65rem !important;
  }

  .tab-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    width: 100% !important;
    margin-bottom: 1.25rem !important;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
    white-space: normal !important;
    word-break: normal !important;
    flex: 1 1 auto;
    text-align: center;
  }

  /* Mobile Table Transformation: Converts squished 5-column table into clean, readable cards */
  .table-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1.5rem !important;
  }

  .data-table {
    display: block !important;
    width: 100% !important;
    font-size: 0.85rem !important;
  }

  .data-table thead {
    display: none !important; /* Hide cramped multi-column header on mobile */
  }

  .data-table tbody {
    display: block !important;
    width: 100% !important;
  }

  .data-table tr {
    display: block !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 0.85rem !important;
    padding: 0.85rem 1rem !important;
    box-shadow: var(--shadow-sm) !important;
    width: 100% !important;
  }

  .data-table td {
    display: block !important;
    width: 100% !important;
    padding: 0.25rem 0 !important;
    border: none !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: normal !important; /* Ensures words are readable horizontally, never broken letter-by-letter */
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
  }

  /* Movement Name (Top row of card) */
  .data-table td:nth-child(1) {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-bottom: 0.45rem !important;
    margin-bottom: 0.45rem !important;
  }

  .movement-name {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .movement-name > span:first-child {
    display: inline !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: normal !important;
    word-break: normal !important;
  }

  /* Load row */
  .data-table td:nth-child(2) {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0.25rem 0 !important;
  }

  .data-table td:nth-child(2)::before {
    content: "Load:";
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    min-width: 55px;
  }

  /* Volume row */
  .data-table td:nth-child(3) {
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    padding: 0.25rem 0 !important;
    color: var(--text-secondary) !important;
  }

  .data-table td:nth-child(3)::before {
    content: "Volume:";
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    min-width: 55px;
    flex-shrink: 0;
  }

  /* Status badge & Date row */
  .data-table td:nth-child(4) {
    display: inline-flex !important;
    align-items: center !important;
    width: auto !important;
    margin-top: 0.4rem !important;
    margin-right: 0.6rem !important;
  }

  .data-table td:nth-child(5) {
    display: inline-block !important;
    width: auto !important;
    font-size: 0.78rem !important;
    color: var(--text-muted) !important;
    margin-top: 0.4rem !important;
  }

  .load-pill {
    padding: 2px 7px !important;
    font-size: 0.78rem !important;
    white-space: normal !important;
    word-break: break-word !important;
    display: inline-flex !important;
    max-width: 100% !important;
  }

  .badge-locked, .badge-complete, .badge-overload {
    padding: 2px 7px !important;
    font-size: 0.7rem !important;
    display: inline-flex !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  .realtime-feed-card {
    padding: 1rem 0.85rem !important;
    margin-bottom: 1.5rem !important;
  }

  .feed-input-group {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .feed-input {
    font-size: 0.88rem !important;
    padding: 0.75rem 0.85rem !important;
    width: 100% !important;
    word-break: normal !important;
  }

  .feed-chips {
    gap: 0.35rem !important;
  }

  .feed-chip {
    font-size: 0.72rem !important;
    padding: 2px 7px !important;
    word-break: normal !important;
  }

  .btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.78rem !important;
    word-break: normal !important;
    max-width: 100% !important;
  }

  /* Routine Split & Green Overload Bars Responsive Containment */
  .routine-split-card {
    padding: 0.85rem 0.65rem !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .routine-exercise-card {
    padding: 0.85rem 0.75rem !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .routine-ex-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .routine-ex-title-group {
    width: 100% !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }

  .routine-ex-title-group > div {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 38px) !important;
  }

  .routine-ex-name {
    display: inline !important;
    font-size: 0.98rem !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .routine-gate-badges {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
    max-width: 100% !important;
  }

  .gate-pill {
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
    text-align: left !important;
    display: inline-flex !important;
    font-size: 0.7rem !important;
    padding: 3px 8px !important;
    box-sizing: border-box !important;
  }

  .gate-pill.gate-cleared {
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
  }

  .load-pill-overload {
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.35 !important;
  }

  .routine-actions-row {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .routine-timer-chip,
  .routine-log-btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
    box-sizing: border-box !important;
    padding: 8px 12px !important;
  }

  .routine-log-btn-overload {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .routine-day-pill {
    min-width: 105px !important;
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
  }

  .btn-emerald {
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   WEIGHT & NUTRITION TRACKING MODULES - DESIGN SYSTEM
   ========================================================================== */

/* 4-Column Stat Summary Cards */
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card-deep {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.stat-card-deep:hover {
  border-color: rgba(0, 245, 212, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.stat-card-deep::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 212, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card-deep:hover::after {
  opacity: 1;
}

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

.stat-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.stat-card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 245, 212, 0.1);
  color: var(--accent-teal);
}

.stat-card-icon.emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}

.stat-card-icon.amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
}

.stat-card-icon.purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-purple);
}

.stat-card-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-card-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.trend-badge.down {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.trend-badge.up {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.trend-badge.neutral {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Weight Goal Progress Bar */
.goal-progress-wrap {
  margin-top: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  position: relative;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), #10b981);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

/* Interactive Weight Chart Container */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  position: relative;
}

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

.chart-title-area h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-range-pills {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.chart-range-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.chart-range-btn:hover {
  color: var(--text-primary);
}

.chart-range-btn.active {
  background: var(--accent-teal);
  color: #070a12;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

.svg-chart-container {
  width: 100%;
  height: 240px;
  position: relative;
  overflow: visible;
}

/* Quick Log Cards */
.quick-log-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
}

.quick-log-card:focus-within {
  border-color: rgba(0, 245, 212, 0.35);
}

.quick-log-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stepper Group for Weight */
.stepper-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stepper-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.stepper-btn:hover {
  background: rgba(0, 245, 212, 0.15);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

.condition-chips-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0.6rem 0;
}

.condition-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.condition-chip:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.condition-chip.active {
  background: rgba(0, 245, 212, 0.15);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.25);
}

/* Nutrition Hero Grid */
.macro-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .macro-hero-grid {
    grid-template-columns: 1fr;
  }
}

.macro-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}

.macro-hero-card.calories-hero {
  border-color: rgba(0, 180, 216, 0.35);
  background: linear-gradient(135deg, rgba(13, 27, 42, 0.85) 0%, rgba(8, 20, 32, 0.85) 100%);
}

.macro-hero-card.protein-hero {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(6, 32, 24, 0.85) 0%, rgba(8, 20, 18, 0.85) 100%);
}

.macro-hero-card.split-hero {
  border-color: rgba(139, 92, 246, 0.3);
  background: linear-gradient(135deg, rgba(22, 14, 40, 0.85) 0%, rgba(12, 10, 25, 0.85) 100%);
}

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

.macro-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.macro-title.cal { color: var(--accent-cyan); }
.macro-title.pro { color: var(--accent-emerald); }
.macro-title.sec { color: var(--accent-purple); }

.macro-number-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 0.6rem;
}

.macro-big-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.macro-goal-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
}

.macro-remaining-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.macro-remaining-pill.cal {
  background: rgba(0, 180, 216, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 180, 216, 0.3);
}

.macro-remaining-pill.pro {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Macro Meter Track */
.macro-meter-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.macro-meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.macro-meter-fill.cal {
  background: linear-gradient(90deg, #00b4d8, #00f5d4);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.4);
}

.macro-meter-fill.pro {
  background: linear-gradient(90deg, #059669, #10b981, #34d399);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Date Navigator Bar */
.date-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  margin-bottom: 1.25rem;
}

.date-nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.date-nav-btn:hover {
  background: rgba(0, 245, 212, 0.12);
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

.date-nav-current {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-teal);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nutrition-date-picker-input {
  background: rgba(15, 23, 42, 0.7);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  color-scheme: dark;
  transition: all 0.2s ease;
}

.nutrition-date-picker-input:hover,
.nutrition-date-picker-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  outline: none;
}

.btn-today-jump {
  animation: pulse-border 2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(56, 189, 248, 0.35); }
  50% { border-color: rgba(56, 189, 248, 0.85); box-shadow: 0 0 10px rgba(56, 189, 248, 0.3); }
}

.nutrition-weekly-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.nutrition-summary-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nutrition-summary-card.highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.nutrition-summary-card-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.nutrition-summary-card-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.nutrition-summary-card-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nutrition-history-active-row {
  background: rgba(0, 245, 212, 0.08) !important;
  border-left: 3px solid var(--accent-teal);
}

.nutrition-day-detail-drawer {
  background: rgba(10, 15, 29, 0.85);
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding: 0.75rem 1.25rem;
}

.btn-copy-to-today {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-copy-to-today:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #34d399;
  color: #fff;
  transform: translateY(-1px);
}

/* Athlete Presets / Staples Grid */
.athlete-staples-wrapper {
  margin-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.athlete-staples-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 8px;
}

.athlete-staples-heading {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-manage-staples {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  touch-action: manipulation;
}

.btn-manage-staples:hover, .btn-manage-staples:active {
  background: rgba(6, 182, 212, 0.22);
  border-color: var(--accent-cyan);
  color: #ffffff;
}

.athlete-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.55rem;
}

.athlete-preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(16, 185, 129, 0.2);
}

.athlete-preset-chip:hover, .athlete-preset-chip:active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.athlete-preset-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.athlete-preset-macros {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-emerald);
  font-weight: 600;
}

/* Meal Pills for logging */
.meal-selector-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.meal-selector-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
}

.meal-selector-pill:hover {
  color: var(--text-primary);
}

.meal-selector-pill.active {
  background: var(--accent-emerald);
  color: #070a12;
  font-weight: 700;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

/* Responsive Nutrition Log Form */
.nutrition-log-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.nutrition-form-food-row {
  width: 100%;
}

.nutrition-input-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nutrition-input-label.label-cal { color: var(--accent-cyan); }
.nutrition-input-label.label-pro { color: var(--accent-emerald); }
.nutrition-input-label.label-carb { color: #fbbf24; }
.nutrition-input-label.label-fat { color: #fb7185; }

.nutrition-food-input {
  width: 100%;
  padding: 0.72rem 0.9rem;
  font-size: 0.92rem;
  box-sizing: border-box;
}

.nutrition-form-macros-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  width: 100%;
}

.macro-input-group {
  min-width: 0;
}

.macro-number-input {
  width: 100%;
  padding: 0.68rem 0.5rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  box-sizing: border-box;
}

.nutrition-form-submit-row {
  width: 100%;
  margin-top: 0.15rem;
}

.btn-submit-nutrition {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border-radius: var(--radius-md);
  border: none;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.18s ease;
}

.btn-submit-nutrition:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

@media (max-width: 640px) {
  .nutrition-form-macros-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .macro-number-input {
    padding: 0.75rem 0.5rem;
  }
}

/* Meals List */
.meal-group-block {
  margin-bottom: 1.25rem;
}

.meal-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.6rem;
}

.meal-group-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meal-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: background 0.15s;
}

.meal-item-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.meal-item-info {
  flex: 1;
  min-width: 0;
}

.meal-item-food {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  word-break: break-word;
}

.meal-item-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-macro {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-macro.pro {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-macro.cal {
  background: rgba(0, 180, 216, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(0, 180, 216, 0.3);
}

.badge-macro.carb {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.badge-macro.fat {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
}

/* Prominent Mobile-Friendly Delete Button */
.btn-food-delete {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(239, 68, 68, 0.4);
  padding: 0;
  transition: all 0.15s ease;
}

.btn-food-delete:hover, .btn-food-delete:active {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.7);
  color: #ffffff;
  transform: scale(0.95);
}

.btn-item-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  touch-action: manipulation;
}

.btn-item-delete:hover, .btn-item-delete:active {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.18);
}

/* Manage Staples Modal List Item */
.staple-manage-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.staple-manage-item-info {
  flex: 1;
  min-width: 0;
}

.staple-manage-item-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.staple-manage-item-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.staple-manage-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 7-Day Adherence Streak Bar */
.streak-bar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 0.75rem;
}

.streak-day-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.3rem;
  text-align: center;
}

.streak-day-box.hit {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.streak-day-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.streak-day-icon {
  margin: 3px 0;
  font-size: 0.85rem;
}

.streak-day-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* =============================================================
   PROGRESS PHOTOS, SILHOUETTE & QUAD GROWTH COMPARER
   ============================================================= */

.photo-mode-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.photo-mode-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.4);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

.compare-style-btn {
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
}

.compare-style-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
}

.photo-compare-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

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

.compare-selector-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.compare-select-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compare-select-box label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compare-swap-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--accent-teal);
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s ease;
}

.compare-swap-arrow:hover {
  background: rgba(0, 180, 216, 0.2);
  border-color: var(--accent-teal);
  transform: rotate(180deg);
}

.compare-delta-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.compare-delta-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.compare-delta-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 800;
}

.compare-delta-val.gain { color: #34d399; }
.compare-delta-val.loss { color: #38bdf8; }

.compare-delta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.compare-stage-container {
  width: 100%;
  min-height: 440px;
}

/* Side-by-Side Dual Grid */
.compare-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .compare-dual-grid {
    grid-template-columns: 1fr;
  }
}

.compare-col-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.compare-col-card.is-baseline {
  border-color: rgba(14, 165, 233, 0.35);
}

.compare-col-card.is-current {
  border-color: rgba(16, 185, 129, 0.4);
}

.compare-col-header {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
}

.compare-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.compare-img-wrap {
  position: relative;
  width: 100%;
  min-height: 380px;
  max-height: 480px;
  background: #050a18;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  overflow: hidden;
}

.compare-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.compare-img-wrap:hover img {
  transform: scale(1.02);
}

.compare-col-footer {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
}

/* Interactive Split Slider */
.split-slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  min-height: 450px;
  max-height: 520px;
  border-radius: var(--radius-md);
  overflow: hidden;
  user-select: none;
  border: 1px solid rgba(14, 165, 233, 0.3);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  background: #050a18;
}

.split-slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.split-slider-after-wrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  width: 50%;
  border-right: 2px solid var(--accent-cyan);
  box-shadow: 2px 0 15px rgba(14, 165, 233, 0.6);
  z-index: 2;
}

.split-slider-after-wrap .split-slider-img {
  width: 600px; /* Locked to match container width */
  max-width: none;
}

.split-slider-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-cyan);
  z-index: 5;
  cursor: ew-resize;
  transform: translateX(-50%);
  box-shadow: 0 0 12px var(--accent-cyan);
}

.split-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background: var(--accent-cyan);
  color: #030712;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.8);
  pointer-events: none;
}

.split-slider-tag {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  z-index: 6;
  backdrop-filter: blur(8px);
}

.split-slider-tag.left {
  left: 12px;
  background: rgba(16, 185, 129, 0.85);
  color: #030712;
}

.split-slider-tag.right {
  right: 12px;
  background: rgba(14, 165, 233, 0.85);
  color: #030712;
}

/* Photo Gallery Grid */
.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.photo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.photo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(14, 165, 233, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.photo-card-img-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  background: #050a18;
  cursor: zoom-in;
  overflow: hidden;
}

.photo-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-card-img-wrap:hover img {
  transform: scale(1.05);
}

.photo-card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.photo-card-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.photo-card-date {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.photo-card-notes {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
  flex: 1;
}

.photo-card-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Photo Drop Zone & Form */
.photo-drop-zone {
  border: 2px dashed rgba(14, 165, 233, 0.4);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(14, 165, 233, 0.03);
  transition: all 0.2s ease;
  margin-bottom: 1.25rem;
}

.photo-drop-zone:hover {
  border-color: var(--accent-cyan);
  background: rgba(14, 165, 233, 0.08);
}

.pose-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pose-chip {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pose-chip:hover {
  border-color: var(--accent-cyan);
  color: #fff;
}

.pose-chip.active {
  background: rgba(14, 165, 233, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.3);
}

/* Body Weight Table Photo Check-in Thumbnails */
.photo-thumb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(14, 165, 233, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-thumb-pill:hover {
  background: rgba(14, 165, 233, 0.25);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.3);
}

.photo-thumb-mini-img {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
}

.photo-thumb-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-thumb-btn:hover {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(14, 165, 233, 0.1);
}

/* Lightbox Modal */
.lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: -38px;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
}

.lightbox-caption {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  max-width: 80vw;
  text-align: center;
}

/* ==========================================================================
   MOBILE & 6-DAY MASS ROUTINE DESIGN SYSTEM
   ========================================================================== */

/* Routine Split Container & Header */
.routine-split-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

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

.routine-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.routine-badge-tag {
  background: rgba(0, 245, 212, 0.12);
  color: var(--accent-teal);
  border: 1px solid rgba(0, 245, 212, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Day Selector Pills (Wrapping Grid - Zero Left-to-Right Scrolling) */
.routine-day-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
  width: 100%;
  overflow-x: visible !important;
}

.routine-day-pill {
  flex: 1 1 calc(25% - 8px);
  min-width: 130px;
  text-align: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: normal;
}

.routine-day-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.routine-day-pill.active {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.2), rgba(0, 180, 216, 0.25));
  border-color: var(--accent-teal);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.3);
}

/* Exercise Cards (Mobile Optimized) */
.routine-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.routine-exercise-card {
  background: rgba(13, 19, 34, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: transform 0.15s ease, border-color 0.2s ease;
  position: relative;
}

.routine-exercise-card:hover {
  border-color: rgba(0, 245, 212, 0.35);
  background: rgba(18, 27, 46, 0.95);
}

.routine-ex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0.75rem;
}

.routine-ex-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.routine-order-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 245, 212, 0.15);
  color: var(--accent-teal);
  border: 1px solid rgba(0, 245, 212, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.routine-ex-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.routine-cat-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.routine-cat-primary {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.routine-cat-lengthened {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.routine-cat-isolation {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.routine-ex-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 0.85rem;
}

.routine-metric-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  text-align: center;
}

.routine-metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.routine-metric-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

/* Planet Fitness Equipment Swap & Free Weight Barbell System */
.pf-swap-container {
  margin: 8px 0 10px 0;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(0, 245, 212, 0.25);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-swap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.pf-swap-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pf-swap-select {
  width: 100%;
  background: #090e17;
  color: #e2e8f0;
  border: 1px solid rgba(0, 245, 212, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pf-swap-select:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.4);
}

.pf-swap-select option {
  background: #0b1120;
  color: #fff;
  padding: 6px;
}

.pf-swap-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.73rem;
}

.pf-swap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pf-badge-barbell {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pf-badge-smith {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.pf-badge-db {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.pf-badge-cable {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.pf-badge-machine {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pf-swap-reason {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.4;
}

.barbell-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.barbell-mode-btn:hover {
  background: rgba(245, 158, 11, 0.28);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.barbell-mode-active {
  background: linear-gradient(135deg, #d97706, #f59e0b) !important;
  color: #000 !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5) !important;
}

.routine-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.routine-timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.routine-timer-chip:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

.routine-log-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  transition: all 0.2s ease;
}
.routine-log-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* Mobile Bottom Navigation Bar (Gym Ergonomics) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 10, 18, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 999;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.mobile-bottom-nav::-webkit-scrollbar {
  display: none;
}

.bottom-nav-item {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  padding: 5px 1px;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-align: center;
}

.bottom-nav-item span {
  font-size: 0.62rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  max-width: 100%;
}

.bottom-nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  flex-shrink: 0;
}

.bottom-nav-item.active {
  color: var(--accent-teal);
}

.bottom-nav-item.active svg {
  stroke: var(--accent-teal);
  filter: drop-shadow(0 0 6px rgba(0, 245, 212, 0.6));
}

/* Mobile Responsive Breakpoints */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; /* Ensure content is never obstructed by bottom bar */
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .container {
    padding: 0.75rem 0.5rem;
  }

  .tracker-header {
    margin-bottom: 0.85rem;
  }

  .app-title {
    font-size: 2.5rem;
    letter-spacing: 0.1em;
  }

  .app-subtitle {
    font-size: 0.8rem;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .rest-timer-bar {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 4px;
  }

  .stats-grid-4, .metrics-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .tab-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    overflow-x: visible !important;
    margin-bottom: 1.25rem !important;
  }

  .tab-btn {
    flex: 1 1 calc(50% - 6px) !important;
    text-align: center !important;
    padding: 8px 6px !important;
    font-size: 0.78rem !important;
    white-space: normal !important;
    word-break: normal !important;
    border-radius: var(--radius-sm) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border-subtle) !important;
  }

  .tab-btn.active {
    background: rgba(0, 245, 212, 0.12) !important;
    border-color: var(--accent-teal) !important;
    color: var(--accent-teal) !important;
  }

  .routine-day-pills {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    overflow-x: visible !important;
  }

  .routine-day-pill {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px 6px !important;
    font-size: 0.78rem !important;
    text-align: center !important;
    white-space: normal !important;
  }


  .routine-ex-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dual-Session Gate Visual Tinting & Badges */
.routine-card-overload-ready {
  border-color: rgba(16, 185, 129, 0.6) !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(13, 19, 34, 0.95) 100%) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.22) !important;
}

.routine-card-gate1 {
  border-color: rgba(245, 158, 11, 0.45) !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(13, 19, 34, 0.95) 100%) !important;
}

.routine-gate-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}

.gate-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
}

.gate-pill.gate-cleared {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  animation: pulse-emerald 2s infinite ease-in-out;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.gate-pill.gate-step1 {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.gate-pill.gate-locked {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.load-pill-overload {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3) !important;
  max-width: 100%;
  white-space: normal !important;
  word-break: break-word;
  line-height: 1.35;
}

.load-pill-gate1 {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  max-width: 100%;
  white-space: normal !important;
  word-break: break-word;
  line-height: 1.35;
}

.routine-log-btn-overload {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

@keyframes pulse-emerald {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}

/* Exercise Edit & Delete Buttons */
.btn-action-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.3);
  color: var(--accent-teal);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-edit:hover {
  background: rgba(0, 245, 212, 0.25);
  border-color: var(--accent-teal);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
  transform: translateY(-1px);
}

.btn-action-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-delete:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 0.55rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.set-edit-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 34px;
  gap: 8px;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Planet Fitness Equipment Alternates System */
.pf-swap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  background: rgba(15, 23, 42, 0.45);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(0, 245, 212, 0.25);
}

.pf-swap-label {
  font-size: 0.72rem;
  color: var(--accent-teal);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}

.pf-swap-select {
  background: rgba(13, 19, 34, 0.95);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
  max-width: 100%;
}

.pf-swap-select:focus, .pf-swap-select:hover {
  border-color: var(--accent-teal);
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.3);
}

.pf-swap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  border-radius: 9999px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pf-swap-reason {
  font-size: 0.73rem;
  color: var(--text-muted);
  width: 100%;
  margin-top: 2px;
  padding-left: 2px;
}

/* ==========================================================================
   FORM & TECHNIQUE GUIDE SYSTEM
   ========================================================================== */
.form-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.guide-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 245, 212, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 245, 212, 0.15);
}

.guide-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0.75rem;
}

.guide-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.guide-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.85rem;
}

.guide-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.guide-tag-primary {
  background: rgba(0, 245, 212, 0.15);
  color: var(--accent-teal);
  border: 1px solid rgba(0, 245, 212, 0.35);
}

.guide-tag-secondary {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.guide-tag-equip {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.guide-cue-highlight {
  background: rgba(15, 23, 42, 0.6);
  border-left: 3px solid var(--accent-teal);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.guide-cue-highlight strong {
  color: var(--accent-teal);
}

.guide-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-guide-open {
  flex: 1;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.15), rgba(0, 180, 216, 0.15));
  border: 1px solid rgba(0, 245, 212, 0.4);
  color: var(--accent-teal);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-guide-open:hover {
  background: var(--accent-teal);
  color: #070a12;
  box-shadow: 0 0 14px rgba(0, 245, 212, 0.4);
}

.btn-guide-log {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-guide-log:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Modal Form Guide Specifics */
.guide-modal-content {
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.75rem;
  text-align: left;
}

.guide-section-box {
  background: rgba(13, 19, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.1rem;
}

.guide-box-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.65rem;
}

.guide-steps-list {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.guide-steps-list li {
  margin-bottom: 0.45rem;
}

.guide-steps-list li strong {
  color: #fff;
}

.guide-cues-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.guide-cue-tile {
  background: rgba(0, 245, 212, 0.07);
  border: 1px solid rgba(0, 245, 212, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.guide-cue-tile-header {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.guide-cue-tile-text {
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.4;
}

.guide-mistakes-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.1rem;
}

.guide-mistakes-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f87171;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.5rem;
}

.guide-mistakes-list {
  padding-left: 1.25rem;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.5;
}

.guide-mistakes-list li {
  margin-bottom: 0.35rem;
}

.guide-tempo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-tempo-item {
  display: flex;
  flex-direction: column;
}

.guide-tempo-label {
  font-size: 0.7rem;
  color: #c4b5fd;
  text-transform: uppercase;
  font-weight: 700;
}

.guide-tempo-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.btn-inline-guide {
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--accent-teal);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  vertical-align: middle;
  text-decoration: none;
}

.btn-inline-guide:hover {
  background: var(--accent-teal);
  color: #070a12;
}

/* ==========================================================================
   VIDEO DEMONSTRATION & VISUAL CHECKPOINT STYLES
   ========================================================================== */
.guide-video-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 245, 212, 0.35);
  box-shadow: 0 8px 32px rgba(0, 245, 212, 0.08);
}

.guide-video-ext-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}

.guide-video-ext-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.guide-video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #090d16;
  border: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.guide-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 1-Tap YouTube App / External Player Fallback Bar */
.video-app-fallback-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.video-app-fallback-bar:hover,
.video-app-fallback-bar:active {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

.video-app-fallback-bar strong {
  color: #f87171;
  font-weight: 600;
}

/* 3 Plain-English Visual Checkpoint Cards */
.guide-checkpoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.checkpoint-card {
  background: rgba(13, 20, 37, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkpoint-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.tag-setup {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.tag-form {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-avoid {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.checkpoint-text {
  font-size: 0.84rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.btn-inline-video {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  vertical-align: middle;
  text-decoration: none;
}

.btn-inline-video:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.movement-name-clickable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.movement-name-clickable:hover {
  color: var(--accent-teal);
  text-decoration: underline;
}

/* ==========================================================================
   GEMINI AI COACH & MULTIMODAL VISION SCANNER STYLES
   ========================================================================== */
.ai-msg-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 90%;
  word-break: break-word;
}

.ai-msg-bubble.coach {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.ai-msg-bubble.user {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #f8fafc;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ai-msg-bubble.loading {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-style: italic;
  align-self: flex-start;
}

/* Floating Quick-Access AI Coach Button (Never scroll to top) */
.floating-ai-fab {
  position: fixed;
  bottom: 84px;
  right: 18px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  user-select: none;
}

.floating-ai-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.65), 0 4px 12px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.6);
}

.floating-ai-fab:active {
  transform: translateY(1px) scale(0.97);
}

@media (min-width: 900px) {
  .floating-ai-fab {
    bottom: 24px;
    right: 24px;
    padding: 12px 22px;
    font-size: 0.95rem;
  }
}
