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

/* ─── TEMAS ─── */

body.light {
  filter: invert(1) hue-rotate(180deg);
}

body.light img,
body.light iframe,
body.light video {
  filter: invert(1) hue-rotate(180deg);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    width: 0;
  }
}

.card {
  width: 100%;
  max-width: 100%;
  background: #1a1a1a;
  border-radius: 0;
  overflow: hidden;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  width: 100%;
  height: 60px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-top: 1px solid #242424;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding: 0 4px;
}

.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
  padding: 0;
  height: 100%;
}

.bnav-btn svg {
  width: 20px;
  height: 20px;
}

.bnav-btn span {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bnav-btn:hover { color: #888; }
.bnav-btn.active { color: #3d7eff; }

/* botón + central */
.bnav-add {
  flex: 1;
  position: relative;
}

.bnav-add-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #3d7eff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(61,126,255,0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

.bnav-add:hover .bnav-add-circle {
  transform: scale(1.07);
  box-shadow: 0 4px 18px rgba(61,126,255,0.6);
}

.bnav-add-circle svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

/* ─── DRAWER ─── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  bottom: 60px;
  right: 0;
  width: 220px;
  background: #222;
  border: 1px solid #2e2e2e;
  border-radius: 12px 0 0 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  color: #ccc;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.drawer-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.drawer-item:hover { background: #2a2a2a; color: #fff; }

.drawer-item:disabled {
  color: #3a3a3a;
  cursor: not-allowed;
}
.drawer-item:disabled:hover { background: none; color: #3a3a3a; }

.drawer-badge {
  margin-left: auto;
  font-size: 8px;
  background: #2e2e2e;
  color: #555;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.3px;
}

.drawer-separator {
  height: 1px;
  background: #2a2a2a;
  margin: 4px 0;
}

.drawer-theme { color: #888; }

/* ─── VIEWS ─── */
.view {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.view.active {
  display: flex;
}

/* ─── SCROLLABLE AREA ─── */
.scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 16px;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }
}

/* ─── FORM BOTTOM ─── */
.form-bottom {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  padding: 12px 0 28px;
  background: #1a1a1a;
}

.btn-primary {
  flex: 1;
  padding: 13px;
  background: #3d7eff;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  max-width: 300px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #2d6ee8;
  box-shadow: 0 4px 16px rgba(61, 126, 255, 0.35);
}

.btn-primary:disabled {
  background: #242424;
  color: #3a3a3a;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  padding: 13px 16px;
  background: #222;
  border: none;
  border-radius: 8px;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #2a2a2a;
  color: #aaa;
}

.error {
  font-size: 12px;
  color: #f87171;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 7px;
  padding: 8px 12px;
  display: none;
}

.error.show {
  display: block;
}

/* ─── SECTION LABEL ─── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #777;
  margin-bottom: 10px;
}

/* ─── CHIPS: DÍAS ─── */
.day-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-day {
  position: relative;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid #2a2a2a;
  background: #222;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.chip-day:hover {
  border-color: #555;
  color: #999;
}

.chip-day.active {
  border-color: #3d7eff;
  background: rgba(61, 126, 255, 0.12);
  color: #3d7eff;
}

.chip-day.has-data {
  border-color: #2e3e2e;
  color: #5a9a5a;
}

.chip-day.has-data.active {
  border-color: #3d7eff;
  background: rgba(61, 126, 255, 0.12);
  color: #3d7eff;
}

/* ─── CHIPS: MÚSCULO ─── */
.muscle-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-muscle {
  position: relative;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid #2a2a2a;
  background: #222;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.chip-muscle:hover {
  border-color: #555;
}

.chip-muscle.active {
  border-color: #3d7eff;
  background: rgba(61, 126, 255, 0.12);
  color: #3d7eff;
}

.chip-muscle .badge {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3d7eff;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  border: 2px solid #1a1a1a;
}

.chip-muscle .badge.show {
  display: flex;
}

/* ─── CHIPS: EJERCICIO ─── */
.exercise-picker-area {
  min-height: 20px;
}

.muscle-ex-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #3d7eff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.muscle-ex-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #242424;
}

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

.chip-exercise {
  padding: 5px 11px;
  border-radius: 16px;
  border: 1px solid #2a2a2a;
  background: #222;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.chip-exercise:hover {
  border-color: #555;
  color: #ccc;
}

.chip-exercise.tier-1 {
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  border-color: #383838;
}

.chip-exercise.tier-2 {
  color: #888;
}

.chip-exercise.tier-3 {
  font-size: 11px;
  color: #555;
}

.chip-exercise.selected {
  border-color: #3d7eff;
  background: rgba(61, 126, 255, 0.12);
  color: #3d7eff;
}

.no-muscle-hint {
  font-size: 12px;
  color: #555;
  font-style: italic;
  padding: 8px 0;
}

/* ─── MI SEMANA GRID ─── */
.semana-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }

  padding-bottom: 24px;
}

.semana-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 8px;
}

.dia-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dia-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #666;
  padding: 7px 10px;
  background: #222;
  border: 1px solid #2a2a2a;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.dia-stats {
  display: flex;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-top: none;
  border-bottom: none;
  padding: 6px 10px;
  gap: 4px;
}

.dia-stats.today {
  border-color: #3d7eff;
  background: rgba(61, 126, 255, 0.04);
}

.dia-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dia-stat + .dia-stat {
  border-left: 1px solid #2a2a2a;
}

.dia-stat-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #555;
}

.dia-stat-value {
  font-size: 12px;
  font-weight: 600;
  color: #aaa;
}

.dia-header-count {
  font-size: 10px;
  font-weight: 600;
  color: white;
}


.dia-header.today {
  color: #3d7eff;
  border-color: #3d7eff;
  background: rgba(61, 126, 255, 0.08);
}

.dia-header.today .dia-header-count {
  color: rgba(61, 126, 255, 0.5);
}

.dia-content {
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid #2a2a2a;
  border-radius: 0 0 8px 8px;
  background: #181818;
  scrollbar-width: none;
  min-height: 80px;

  &::-webkit-scrollbar {
    display: none;
  }
}

.dia-header.today ~ .dia-content {
  border-color: #3d7eff;
  border-top: none;
}

.dia-empty {
  font-size: 10px;
  color: #2a2a2a;
  text-align: center;
  margin-top: 12px;
}

.dia-muscle-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #3d7eff;
  margin: 8px 0 4px;
}

.dia-muscle-label:first-child {
  margin-top: 0;
}

.dia-ex {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
  border-bottom: 1px solid #1f1f1f;
}

.dia-ex:last-child {
  border-bottom: none;
}

.dia-ex-name {
  font-size: 12px;
  color: #666;
  min-width: 0;
}

.dia-ex-info {
  font-size: 11px;
  color: white;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: "Courier New", monospace;
}

.dia-ex-info.has-data {
  color: white;
}

/* ─── MI RUTINA ─── */
.rutina-day-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
  padding: 4px 0 8px;
  border-bottom: 1px solid #242424;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rutina-day-label:hover {
  color: #888;
}

.day-toggle-hint {
  font-size: 10px;
  color: #3a3a3a;
  transition: color 0.15s;
}

.rutina-day-label:hover .day-toggle-hint {
  color: #666;
}

.btn-move-day {
  margin-left: auto;
  background: none;
  border: none;
  color: #3a3a3a;
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.rutina-day-label:hover .btn-move-day {
  color: #666;
}

.btn-move-day:hover {
  color: #3d7eff !important;
}

.rutina-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #333;
  text-align: center;
}

.rutina-empty .icon {
  font-size: 32px;
}

.rutina-empty p {
  font-size: 13px;
  line-height: 1.5;
}

/* ─── MUSCLE SECTIONS ─── */
#muscle-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.muscle-section {
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
}

.muscle-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #222;
  cursor: pointer;
  user-select: none;
}

.muscle-section-header:hover {
  background: #252525;
}

.muscle-section-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #3d7eff;
}

.btn-collapse {
  background: none;
  border: none;
  color: #444;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  transition: transform 0.2s;
}

.muscle-section.collapsed .btn-collapse {
  transform: rotate(-90deg);
}

.muscle-section.collapsed .section-body {
  display: none;
}

/* Aerobic sections: name | tiempo | intensidad | delete */
.aerobic-section .col-labels,
.aerobic-section .exercise-row {
  grid-template-columns: 1fr 90px 120px 28px;
}

.col-labels {
  display: grid;
  grid-template-columns: 1fr 70px 58px 58px 45px 28px 28px;
  gap: 6px;
  padding: 8px 12px 4px;
}

.col-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #666;
}

.exercise-list {
  padding: 0 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exercise-row {
  display: grid;
  grid-template-columns: 1fr 70px 58px 58px 45px 28px 28px;
  gap: 6px;
  align-items: center;
}

.ex-time {
  font-size: 10px;
  color: #555;
  text-align: center;
  white-space: nowrap;
}

.ex-name {
  font-size: 12px;
  color: #ccc;
  padding: 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.15s;
}

.ex-name:hover {
  color: #3d7eff;
}

.exercise-row input,
.exercise-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  background: #242424;
  color: #f0f0f0;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.exercise-row input[type="number"]::-webkit-inner-spin-button,
.exercise-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.exercise-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-color: #242424;
  padding-right: 22px;
  cursor: pointer;
}

.exercise-row input:focus,
.exercise-row select:focus {
  outline: none;
  border-color: #3d7eff;
  box-shadow: 0 0 0 2px rgba(61, 126, 255, 0.15);
}

.exercise-row input::placeholder {
  color: #555;
}

.btn-video {
  background: none;
  border: none;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 5px;
  transition:
    color 0.2s,
    background 0.2s;
}

.btn-video:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.btn-video.has-video {
  background: #ff0000;
  color: white;
}

.btn-video.has-video:hover {
  background: #cc0000;
}

.btn-delete {
  background: none;
  border: none;
  color: #3a3a3a;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: 5px;
  transition:
    color 0.2s,
    background 0.2s;
}

.btn-delete:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

/* ─── ÍNDICE DE INTENSIDAD ─── */
.ii-banner {
  padding: 16px 18px;
  border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
}

.ii-banner-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #555;
  margin-bottom: 12px;
}

.ii-banner-body {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ii-banner-number {
  font-size: 46px;
  font-weight: 800;
  font-family: "Courier New", monospace;
  line-height: 1;
  letter-spacing: -2px;
}

.ii-banner-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ii-banner-label {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.ii-banner-sub {
  font-size: 12px;
  color: #666;
}

.ii-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: "Courier New", monospace;
  padding: 3px 7px;
  border-radius: 5px;
  background: #242424;
  border: 1px solid #333;
  color: #888;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── RESUMEN POR MÚSCULO ─── */
.muscle-summary-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vol-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #555;
  margin-bottom: 2px;
}

.muscle-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.muscle-summary-card {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.msc-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msc-is {
  font-size: 14px;
  font-weight: 800;
  font-family: "Courier New", monospace;
  flex-shrink: 0;
}

.msc-label {
  font-size: 11px;
  font-weight: 600;
}

.msc-stats {
  display: flex;
  gap: 0;
  border: 1px solid #242424;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}

.msc-stat {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  border-right: 1px solid #242424;
}

.msc-stat:last-child {
  border-right: none;
}

.msc-num {
  font-size: 15px;
  font-weight: 800;
  font-family: "Courier New", monospace;
  color: #ccc;
  line-height: 1;
}

.msc-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #555;
  margin-top: 2px;
}

/* ─── PROGRESIÓN ─── */
.result-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  background: #222;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
}

.legend-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #888;
  margin-bottom: 4px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #999;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green {
  background: #22c55e;
}

.dot-yellow {
  background: #eab308;
}

.dot-red {
  background: #ef4444;
}

/* ─── MI PERFIL ─── */
.perfil-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 16px;
}

.perfil-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perfil-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.perfil-input {
  width: 100%;
  padding: 10px 12px;
  background: #222;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  color: #eee;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.perfil-input:focus {
  border-color: #3d7eff;
}

.perfil-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.perfil-chip {
  padding: 7px 14px;
  background: #222;
  border: 1px solid #2e2e2e;
  border-radius: 20px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.perfil-chip:hover {
  border-color: #555;
  color: #ccc;
}

.perfil-chip.active {
  background: rgba(61, 126, 255, 0.12);
  border-color: #3d7eff;
  color: #3d7eff;
}

.perfil-desc {
  display: none;
  font-size: 11px;
  color: #777;
  line-height: 1.6;
  padding: 8px 12px;
  background: #1e1e1e;
  border-left: 2px solid #3d7eff;
  border-radius: 0 6px 6px 0;
}

.perfil-desc.show {
  display: block;
}

#result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-muscle-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.result-muscle-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 8px;
}

.result-muscle-header:hover .result-muscle-title-text {
  color: #aaa;
}

.result-muscle-title-text {
  flex: 1;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  transition: color 0.15s;
}

.result-collapse-btn {
  font-size: 11px;
  color: #444;
  transition: color 0.15s;
}

.result-muscle-header:hover .result-collapse-btn {
  color: #666;
}

.result-muscle-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.result-muscle-group.collapsed .result-muscle-body {
  display: none;
}

.result-day-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 2px 5px;
  flex-shrink: 0;
}

.result-card {
  border-radius: 8px;
  border-left: 4px solid #2a2a2a;
  border-top: 1px solid #2a2a2a;
  border-right: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #212121;
}

.result-card.zone-green {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.result-card.zone-yellow {
  border-left-color: #eab308;
  background: rgba(234, 179, 8, 0.06);
}

.result-card.zone-red {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.result-exercise-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #ddd;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #333;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.result-exercise-name:hover {
  color: #3d7eff;
  text-decoration-color: #3d7eff;
}

.result-rm {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-family: "Courier New", monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-rm span {
  font-size: 11px;
  font-weight: 500;
  color: #888;
}

.result-suggestion {
  display: flex;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.sug-stat {
  padding: 5px 10px;
  text-align: center;
  border-right: 1px solid #2a2a2a;
  min-width: 44px;
}

.sug-stat:last-child {
  border-right: none;
}

.sug-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #666;
  margin-bottom: 1px;
}

.sug-value {
  font-size: 14px;
  font-weight: 800;
  color: #eee;
  font-family: "Courier New", monospace;
  line-height: 1;
}

.sug-unit {
  font-size: 8px;
  color: #666;
  margin-top: 1px;
}

.prog-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #333;
  text-align: center;
}

.prog-empty .icon {
  font-size: 32px;
}

.prog-empty p {
  font-size: 13px;
  line-height: 1.5;
}

/* ─── IMPORT MODAL ─── */
.import-modal {
  max-width: 420px;
}

.import-modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 20px;
}

.btn-import-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #222;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition:
    border-color 0.15s,
    background 0.15s;
  width: 100%;
}

.btn-import-opt:hover {
  border-color: #3d7eff;
  background: rgba(61, 126, 255, 0.06);
}

.import-opt-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.import-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.import-opt-text strong {
  font-size: 13px;
  color: #ddd;
  font-weight: 700;
}

.import-opt-text small {
  font-size: 11px;
  color: #666;
}

#import-text-area textarea {
  width: 100%;
  min-height: 140px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #ccc;
  font-family: "Courier New", monospace;
  font-size: 11px;
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  line-height: 1.5;
}

#import-text-area textarea:focus {
  border-color: #3d7eff;
}

/* ─── VIDEO MODAL ─── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-height: 90vh;
  max-width: 720px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.modal.is-short {
  max-width: 380px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.modal-title {
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #f87171;
}

.modal iframe {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 0;
  border: none;
}

@media (max-width: 1100px) {
  .semana-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .muscle-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 810px) {
  .semana-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .muscle-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── STOPWATCH ─── */
.sw-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 24px 24px;
  gap: 32px;
  min-height: 0;
  overflow-y: auto;
}

.sw-display {
  font-size: clamp(52px, 15vw, 80px);
  font-weight: 200;
  letter-spacing: -2px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sw-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}

.sw-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.1s, opacity 0.2s;
}

.sw-btn:active { transform: scale(0.93); }

.sw-btn-main {
  width: 72px;
  height: 72px;
  background: #3d7eff;
  color: #fff;
  font-size: 15px;
}

.sw-btn-reset,
.sw-btn-lap {
  width: 56px;
  height: 56px;
  background: #2a2a2a;
  color: #aaa;
}

.sw-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.sw-btn-main.running { background: #ef4444; }

.sw-laps {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sw-lap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #242424;
  font-size: 13px;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

.sw-lap-row:first-child { color: #fff; }

.sw-lap-num { color: #555; font-size: 11px; }

/* ─── MINI TIMER ─── */
.mini-timer {
  display: none;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 20px;
  padding: 5px 14px;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  z-index: 80;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  transition: opacity 0.2s;
}

.mini-timer.visible { display: flex; }
.mini-timer:hover { opacity: 0.85; }

.mini-timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ─── HIIT TIMER ─── */
.hiit-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 0;
  overflow-y: auto;
}

.hiit-config {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 340px;
}

.hiit-config-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
}

.hiit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.hiit-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #222;
  border-radius: 12px;
  padding: 14px 10px;
}

.hiit-field label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #666;
}

.hiit-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hiit-stepper button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2e2e2e;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hiit-stepper button:hover { background: #3a3a3a; color: #fff; }

.hiit-stepper span {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.hiit-start-btn {
  width: 120px !important;
  height: 48px !important;
  border-radius: 24px !important;
  font-size: 15px !important;
}

/* running */
.hiit-running {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.hiit-phase-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #3d7eff;
  transition: color 0.3s;
}

.hiit-phase-label.rest { color: #22c55e; }
.hiit-phase-label.prep { color: #f59e0b; }
.hiit-phase-label.done { color: #aaa; }

.hiit-ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}

.hiit-ring {
  width: 200px;
  height: 200px;
  transform: rotate(-90deg);
}

.hiit-ring-bg {
  fill: none;
  stroke: #2a2a2a;
  stroke-width: 10;
}

.hiit-ring-fill {
  fill: none;
  stroke: #3d7eff;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 553;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.9s linear, stroke 0.3s;
}

.hiit-ring-fill.rest  { stroke: #22c55e; }
.hiit-ring-fill.prep  { stroke: #f59e0b; }

.hiit-ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hiit-countdown {
  font-size: 56px;
  font-weight: 200;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hiit-round-info {
  font-size: 12px;
  color: #555;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.hiit-run-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* done */
.hiit-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hiit-done-icon { font-size: 64px; }

.hiit-done-text {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

/* mini-hiit pill: positioned slightly below the stopwatch pill */
.mini-hiit {
  top: 50px !important;
}

.mini-hiit .mini-timer-dot { background: #22c55e; }
.mini-hiit .mini-timer-dot.work { background: #3d7eff; animation: pulse-dot 1s infinite; }
.mini-hiit .mini-timer-dot.rest { background: #22c55e; animation: pulse-dot 1.5s infinite; }
.mini-hiit .mini-timer-dot.prep { background: #f59e0b; animation: pulse-dot 0.7s infinite; }

/* ─── MOBILE ─── */
@media (max-width: 767px) {
  .card {
    padding: 16px;
  }
  .muscle-summary-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  .semana-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .exercise-row input,
  .exercise-row select {
    font-size: 11px;
  }

  .top-nav {
    margin: 0 -16px 16px;
    padding: 0 16px;
  }

  .form-bottom {
    padding-bottom: 20px;
  }

  .aerobic-section .col-labels,
  .aerobic-section .exercise-row {
    grid-template-columns: 1fr 70px 100px 28px;
  }

  .col-labels {
    grid-template-columns: 1fr 1fr 1fr 38px 28px 28px;
    gap: 5px;
    padding: 8px 10px 4px;
  }

  .exercise-row {
    grid-template-columns: 1fr 1fr 1fr 38px 28px 28px;
    gap: 5px;
  }

  .ex-name {
    grid-column: 1 / -1;
    font-size: 13px;
    padding: 4px 0;
  }

  .result-card {
    flex-wrap: wrap;
    gap: 8px;
  }

  .result-exercise-name {
    width: 100%;
  }

  .result-suggestion {
    width: 100%;
    justify-content: space-around;
  }

  .sug-stat {
    flex: 1;
  }

  .modal-overlay {
    padding: 12px;
  }
}
