/* ==========================================================================
   W327 BRAND IDENTITY DESIGN SYSTEM — "CARBON & CRIMSON"
   ========================================================================== */

:root {
  --bg-dark: #0a0a0a;
  --card-bg: #141414;
  --accent-red: #e63946;
  --glow-red: rgba(230, 57, 70, 0.4);
  --accent-green: #22c55e;
  --glow-green: rgba(34, 197, 94, 0.35);
  --accent-yellow: #facc15;
  --glow-yellow: rgba(250, 204, 21, 0.35);
  --text-main: #f5f5f5;
  --text-muted: #a0a0a0;
  --border: #222;
  --radius: 4px;
}

/* ---- Reset & Base Elements ---- */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

.hidden { 
  display: none !important; 
}

/* ---- Loading Engine UI ---- */
.loading-shield { 
  position: fixed; 
  inset: 0; 
  background: var(--bg-dark); 
  z-index: 9999; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  transition: opacity 0.4s ease; 
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Global Navigation Elements ---- */
.btn-home { 
  position: fixed; 
  top: 20px; 
  left: 20px; 
  background: rgba(255, 255, 255, 0.05); 
  border: 1px solid var(--border); 
  color: var(--text-muted); 
  padding: 8px 12px; 
  font-size: 0.7rem; 
  text-decoration: none; 
  border-radius: var(--radius); 
  z-index: 100; 
  transition: all 0.2s ease; 
  letter-spacing: 1px;
  font-weight: 700;
}

.btn-home:hover { 
  color: var(--text-main); 
  border-color: var(--text-muted); 
  background: rgba(255, 255, 255, 0.1);
}

.landing-hero { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  justify-content: center; 
  align-items: center; 
  text-align: center; 
  padding: 20px; 
}

.hero-title { 
  font-size: clamp(3rem, 10vw, 6rem); 
  line-height: 0.9; 
  margin-bottom: 20px; 
  text-transform: uppercase; 
  font-weight: 800; 
}

.hero-desc { 
  max-width: 600px; 
  color: var(--text-muted); 
  margin-bottom: 40px; 
  font-size: 1.1rem; 
}

/* ---- Split Layout Interfaces ---- */
.split-layout { 
  display: flex; 
  min-height: 100vh; 
}

.brand-panel { 
  flex: 1.2; 
  background: linear-gradient(135deg, #000 0%, #1a0505 100%); 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border-right: 1px solid var(--border); 
}

.form-panel { 
  flex: 1; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 40px; 
}

.form-inner { 
  width: 100%; 
  max-width: 360px; 
}

/* ---- Typography & Components ---- */
h1, h2, h3 { 
  text-transform: uppercase; 
  letter-spacing: 2px; 
  font-weight: 800; 
}

.accent { 
  color: var(--accent-red); 
}

/* ---- Forms, Inputs, Buttons ---- */
.field-group { 
  margin-bottom: 15px; 
}

.field-group label { 
  display: block; 
  font-size: 0.7rem; 
  margin-bottom: 5px; 
  color: var(--text-muted); 
  letter-spacing: 1px; 
}

input,
select { 
  width: 100%; 
  height: 48px;
  min-height: 48px;
  background: #111; 
  border: 1px solid var(--border); 
  padding: 0 14px; 
  color: white; 
  border-radius: var(--radius); 
  outline: none; 
  font-family: inherit; 
  font-size: 0.9rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  line-height: normal;
  transition: border-color 0.2s, box-shadow 0.2s; 
}

input:focus,
select:focus { 
  border-color: var(--accent-red); 
  box-shadow: 0 0 10px var(--glow-red);
}

select {
  padding: 0 36px 0 14px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

select option {
  background: #111;
  color: white;
}

input[type="date"] {
  color-scheme: dark;
  position: relative;
  padding: 0 14px;
  line-height: 46px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
  filter: invert(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 4px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  transform: scale(1.1);
}

.btn-primary { 
  width: 100%; 
  background: var(--accent-red); 
  color: white; 
  border: none; 
  padding: 14px; 
  font-weight: 700; 
  cursor: pointer; 
  text-transform: uppercase; 
  border-radius: var(--radius); 
  letter-spacing: 1px; 
  transition: all 0.3s ease; 
}

.btn-primary:hover { 
  box-shadow: 0 0 20px var(--glow-red); 
  transform: scale(1.02); 
}

.btn-oauth,
.btn-google,
.btn-apple { 
  width: 100%; 
  background: rgba(255, 255, 255, 0.04); 
  border: 1px solid var(--border); 
  color: white; 
  padding: 14px 18px; 
  border-radius: var(--radius); 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 10px; 
  font-family: inherit;
  font-size: 0.82rem; 
  font-weight: 700; 
  letter-spacing: 0.5px;
  text-transform: uppercase; 
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.btn-oauth:hover,
.btn-google:hover,
.btn-apple:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* ---- Command Profile HUD ---- */
.dash-header { 
  padding: 20px 40px; 
  border-bottom: 1px solid var(--border); 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  background: #000; 
}

.header-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.header-nav-link:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.card { 
  background: var(--card-bg); 
  border: 1px solid var(--border); 
  padding: 24px; 
  border-radius: var(--radius); 
  border-left: 4px solid var(--accent-red); 
}

/* ==========================================================================
   RESPONSIVE LAYOUT ENGINE (MOBILE MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 768px) {
  .split-layout { 
    flex-direction: column; 
    min-height: 100vh;
  }
  
  .brand-panel { 
    padding: 44px 20px 24px; 
    border-right: none; 
    border-bottom: 1px solid var(--border); 
    flex: none;
    text-align: center;
  }

  .brand-panel h1 {
    font-size: 2.2rem !important;
  }
  
  .form-panel {
    padding: 28px 20px 48px;
    flex: 1;
    align-items: flex-start;
  }

  .form-inner {
    width: 100%;
    max-width: 100%;
  }

  .btn-home {
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    font-size: 0.65rem;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .dash-header {
    padding: 14px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .dash-header > div {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .dash-header > div::-webkit-scrollbar {
    display: none;
  }

  .dash-header .header-nav-link {
    padding: 8px 12px;
    font-size: 0.72rem;
    flex-shrink: 0;
  }
  
  #btn-logout {
    width: 100%;
    text-align: center;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(2.2rem, 9vw, 3.4rem);
  }

  .btn-cta, .btn-cta-ghost {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   TRAINING HUD & WORKOUT SESSION STYLES
   ========================================================================== */

/* ---- Day Navigation Tabs ---- */
.tabs-header {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.tabs-header::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--accent-red);
  border-color: var(--border) var(--border) transparent var(--border);
  border-bottom: 2px solid var(--accent-red);
  background: var(--card-bg);
}

.tab-btn .active-day-label {
  color: #22c55e;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
  transition: all 0.2s ease;
}

.tab-btn:hover .active-day-label {
  color: #4ade80;
  text-shadow: 0 0 14px rgba(74, 222, 128, 0.5);
}

.tab-btn.is-active-day.active {
  border-bottom-color: #22c55e;
}

/* ---- Muscle Group Chips & Cards ---- */
.muscle-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 24px;
}

.muscle-chip {
  background: #141414;
  border: 1px solid #222;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-main);
}

/* ---- Biometrics Section ---- */
.biometrics-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 850px) {
  .biometrics-layout {
    grid-template-columns: 1fr;
  }
}

.biometric-card {
  position: relative;
  transition: border-color 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 24px;
}

.biometric-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 2px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Split Weight Inputs & Record Button */
.split-weight-input-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 2px;
}

.split-weight-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.weight-box-int,
.weight-box-dec {
  height: 48px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
  -moz-appearance: textfield;
}

.weight-box-int::-webkit-outer-spin-button,
.weight-box-int::-webkit-inner-spin-button,
.weight-box-dec::-webkit-outer-spin-button,
.weight-box-dec::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.weight-box-int {
  flex: 1.2;
  min-width: 70px;
}

.weight-box-dec {
  flex: 0.8;
  min-width: 50px;
}

.weight-box-int:focus,
.weight-box-dec:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.25);
  background: rgba(255, 255, 255, 0.02);
}

.weight-dot-sep {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-muted);
  line-height: 1;
  user-select: none;
  margin: 0 2px;
}

.biometric-unit-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-left: 2px;
}

.btn-record-weight {
  width: 100%;
  height: 42px;
  background: #141414;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-record-weight:hover {
  background: #1c1c1c;
  border-color: #444;
}

.btn-record-weight .record-text {
  color: var(--text-main);
  transition: color 0.2s ease;
}

.btn-record-weight.recorded .record-text {
  color: var(--accent-green) !important;
  text-shadow: 0 0 10px var(--glow-green);
}

.weight-chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 20px 24px;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent-red);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weight-svg-chart {
  width: 100%;
  height: auto;
  display: block;
}

.weight-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #181818;
  border: 1px solid var(--accent-red);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-main);
  transform: translate(-50%, -120%);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
  white-space: nowrap;
}

.weight-chart-tooltip.visible {
  opacity: 1;
}

.weight-point-circle {
  cursor: pointer;
  transition: r 0.2s ease, fill 0.2s ease, stroke-width 0.2s ease;
}

.weight-point-circle:hover {
  r: 6px;
  fill: #ffffff;
  stroke: var(--accent-red);
  stroke-width: 3px;
}

/* ---- Workout Training Session Layout ---- */
.workout-header {
  padding: 32px 40px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0505 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.workout-body {
  padding: 40px;
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: 120px;
}

.muscle-section {
  margin-bottom: 40px;
}

.muscle-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.muscle-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Exercise Card ---- */
.exercise-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.exercise-card:hover {
  border-color: #333;
}

.exercise-card-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background: rgba(255, 255, 255, 0.01);
  transition: background 0.2s ease;
}

.exercise-card-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.exercise-name {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.exercise-card.all-completed .exercise-name,
.exercise-card-header.all-completed .exercise-name {
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.exercise-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Icon Buttons (Description ?, Notes ✏️, Settings ⚙️) */
.btn-card-icon-toggle {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}

.btn-card-icon-toggle:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
}

.btn-card-icon-toggle.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
  box-shadow: 0 0 10px var(--glow-red);
}

.btn-card-icon-toggle.has-content::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
}

.exercise-card-body {
  padding: 20px;
  border-top: 1px solid var(--border);
}

/* ---- Exercise Settings Panel (Opened by Gear Icon) ---- */
.exercise-settings-panel {
  display: none;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--text-muted);
  animation: fadeIn 0.2s ease;
}

.settings-panel-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-toggle-inclusion-modal {
  padding: 8px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

.btn-danger-outline:hover {
  background: var(--accent-red);
  color: white;
  box-shadow: 0 0 10px var(--glow-red);
}

.btn-include-routine {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid #22c55e;
  color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.btn-include-routine:hover {
  background: #22c55e;
  color: #000;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.4);
}

.sets-count-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-yellow);
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.45);
  padding: 3px 10px;
  border-radius: var(--radius);
  font-family: inherit;
  white-space: nowrap;
}

.sets-slider-wrapper {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sets-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #181818;
  outline: none;
  border: 1px solid #333;
  cursor: grab;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sets-range-slider:active {
  cursor: grabbing;
}

.sets-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent-yellow) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='7 8 3 12 7 16'/%3e%3cpolyline points='17 8 21 12 17 16'/%3e%3cline x1='12' y1='6' x2='12' y2='18'/%3e%3c/svg%3e") no-repeat center center / 20px 20px;
  cursor: grab;
  box-shadow: 0 0 12px var(--glow-yellow), 0 2px 6px rgba(0, 0, 0, 0.6);
  border: 1.5px solid #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sets-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px var(--glow-yellow), 0 3px 8px rgba(0, 0, 0, 0.7);
}

.sets-range-slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  transform: scale(1.12);
  box-shadow: 0 0 22px var(--glow-yellow), 0 4px 12px rgba(0, 0, 0, 0.8);
}

.sets-range-slider::-moz-range-thumb {
  width: 36px;
  height: 22px;
  border-radius: 5px;
  background: var(--accent-yellow) url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='7 8 3 12 7 16'/%3e%3cpolyline points='17 8 21 12 17 16'/%3e%3cline x1='12' y1='6' x2='12' y2='18'/%3e%3c/svg%3e") no-repeat center center / 20px 20px;
  cursor: grab;
  box-shadow: 0 0 12px var(--glow-yellow), 0 2px 6px rgba(0, 0, 0, 0.6);
  border: 1.5px solid #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sets-range-slider::-moz-range-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 16px var(--glow-yellow), 0 3px 8px rgba(0, 0, 0, 0.7);
}

.sets-range-slider:active::-moz-range-thumb {
  cursor: grabbing;
  transform: scale(1.12);
  box-shadow: 0 0 22px var(--glow-yellow), 0 4px 12px rgba(0, 0, 0, 0.8);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

.metric-segment-control {
  display: flex;
  width: 100%;
  height: 48px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
  box-sizing: border-box;
}

.btn-metric-pill {
  flex: 1 1 0%;
  width: 50%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: calc(var(--radius) - 1px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-metric-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-metric-pill.active {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 0 8px var(--glow-red);
}

.exercise-desc {
  display: none;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #101010;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-red);
  animation: fadeIn 0.2s ease;
}

.desc-meta-bar {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---- Set Attempts Grid ---- */
.attempt-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.attempt-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.attempt-row.warmup-row {
  border-left: 3px solid #facc15;
}

.attempt-row.warmup-row .attempt-label {
  color: #facc15;
}

.attempt-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.attempt-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.attempt-input-wrap input {
  padding: 8px 10px;
  font-size: 0.85rem;
  text-align: center;
  font-weight: 700;
}

.attempt-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.btn-save-attempt {
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.btn-save-attempt:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
}

.btn-save-attempt.saved {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #22c55e;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.btn-save-attempt.saved:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: #22c55e;
  color: #4ade80;
}

.btn-toggle-inclusion {
  margin-left: auto;
}

/* ---- Notes Box ---- */
.notes-section {
  display: none;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #101010;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-red);
  animation: fadeIn 0.2s ease;
}

.notes-input {
  width: 100%;
  background: #000;
  border: 1px solid var(--border);
  color: #ddd;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  border-radius: var(--radius);
  resize: vertical;
  min-height: 65px;
  outline: none;
  margin-bottom: 0;
  transition: border-color 0.2s ease;
}

.notes-input:focus {
  border-color: var(--accent-red);
}

.btn-discard-note {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-discard-note:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: rgba(230, 57, 70, 0.05);
}

.btn-save-note {
  background: #22c55e;
  border: 1px solid #22c55e;
  color: #000;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-save-note:hover {
  background: #4ade80;
  border-color: #4ade80;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.btn-save-note:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Excluded Accordion ---- */
.excluded-accordion-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s ease;
  text-align: center;
}

.excluded-accordion-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border-color: #444;
}

/* ---- Sticky Bottom Workout Bar ---- */
.workout-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 16px 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 900;
}

.workout-bottom-bar > *:first-child {
  justify-self: start;
}

.workout-bottom-bar > *:last-child {
  justify-self: end;
}

/* ==========================================================================
   CUSTOM STRATEGY BUILDER STYLES
   ========================================================================== */
.day-builder-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  padding: 24px;
  transition: all 0.25s ease;
}

.day-builder-card.active {
  border-color: rgba(230, 57, 70, 0.4);
  border-left: 4px solid var(--accent-red);
  background: #111;
}

.day-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-builder-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.day-builder-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Switch Toggle UI */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #222;
  border: 1px solid #333;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #888;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px var(--glow-green);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #000;
}

.switch.switch-day input:checked + .slider {
  background-color: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px var(--glow-green);
}

.switch.switch-day input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #000;
}

.switch.switch-warmup input:checked + .slider {
  background-color: #facc15;
  border-color: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.switch.switch-warmup input:checked + .slider:before {
  background-color: #000;
}

/* Mini Muscle Group Yellow Toggle */
.switch.switch-muscle {
  width: 36px;
  height: 20px;
  pointer-events: none;
  flex-shrink: 0;
}

.switch.switch-muscle .slider:before {
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
}

.switch.switch-muscle input:checked + .slider {
  background-color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  box-shadow: 0 0 10px var(--glow-yellow);
}

.switch.switch-muscle input:checked + .slider:before {
  transform: translateX(16px);
  background-color: #000;
}

.muscle-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.25s ease;
}

.muscle-checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.muscle-checkbox-item:hover {
  border-color: #444;
  background: rgba(255, 255, 255, 0.03);
}

.muscle-checkbox-item.checked {
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.25);
  background: rgba(230, 57, 70, 0.08);
}

.muscle-checkbox-item span {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.muscle-checkbox-item.checked span {
  color: var(--text-main);
}

/* ---- Danger Zone ---- */
.danger-zone {
  margin-top: 40px;
  padding: 24px;
  background: rgba(230, 57, 70, 0.04);
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: var(--radius);
}

.danger-zone-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 8px;
}

.danger-zone-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: var(--accent-red);
  color: white;
  box-shadow: 0 0 14px var(--glow-red);
}

@media (max-width: 680px) {
  .workout-header {
    padding: 20px 16px;
  }
  
  .workout-body {
    padding: 16px 12px 140px;
  }

  .exercise-card-header {
    padding: 14px 14px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .exercise-name {
    font-size: 0.88rem;
    flex: 1;
    min-width: 0;
  }

  .exercise-header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }

  .btn-card-icon-toggle {
    width: 30px;
    height: 30px;
  }

  .exercise-card-body {
    padding: 14px 10px;
  }

  .attempt-row {
    grid-template-columns: 56px 1fr 1fr 48px;
    gap: 6px;
    padding: 8px 8px;
  }

  .attempt-label {
    font-size: 0.65rem;
  }

  .attempt-input-wrap {
    gap: 3px;
  }

  .attempt-input-wrap input {
    padding: 8px 2px;
    font-size: 0.95rem;
  }

  .attempt-unit {
    font-size: 0.6rem;
  }

  .btn-save-attempt {
    padding: 8px 4px;
    font-size: 0.68rem;
  }

  .workout-bottom-bar {
    padding: 12px 16px;
    gap: 10px;
  }

  .workout-bottom-bar .header-nav-link {
    padding: 10px 14px;
    font-size: 0.72rem;
  }

  #btn-end-training {
    padding: 12px 16px;
    font-size: 0.72rem;
    letter-spacing: 1px;
    flex: 1;
  }

  .day-builder-card {
    padding: 18px 14px;
    margin-bottom: 14px;
  }

  .day-builder-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .muscle-selection-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
  }

  .muscle-checkbox-item {
    padding: 8px 10px;
  }

  .muscle-checkbox-item span {
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  .attempt-row {
    grid-template-columns: 48px 1fr 1fr 42px;
    gap: 4px;
    padding: 6px 4px;
  }

  .muscle-selection-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Trainer Portal CTA Button ────────────────────────────────────────── */
.btn-trainer-cta {
  display: inline-flex;
  flex-direction: column;
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.16) 0%, rgba(20, 16, 8, 0.95) 100%);
  border: 1.5px solid #f39c12;
  box-shadow: 0 0 20px rgba(243, 156, 18, 0.22);
  border-radius: var(--radius);
  padding: 16px 24px;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  max-width: 480px;
  width: 100%;
}

.btn-trainer-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(243, 156, 18, 0.45);
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.26) 0%, rgba(30, 24, 10, 0.98) 100%);
}

.trainer-badge {
  font-size: 0.64rem;
  letter-spacing: 2.5px;
  font-weight: 800;
  color: #f39c12;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.trainer-cta-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.trainer-cta-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.trainer-day-btn.btn-trainee-settings-nav {
  background: rgba(243, 156, 18, 0.1);
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.35);
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trainer-day-btn.btn-trainee-settings-nav:hover {
  background: #f39c12;
  color: #000;
  box-shadow: 0 0 14px rgba(243, 156, 18, 0.35);
}