/* ======================= TREINO ======================= */

.day-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.day-name::after {
  content: " ✎";
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--muted);
}

.rest-toggle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.rest-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue-solid);
}

.exercise {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--sh-md);
  padding: 11px 8px 11px 13px;
  margin-top: 9px;
}
.ex-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ex-name {
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-sub {
  font-size: 12px;
  color: var(--muted);
}
.ex-tools {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
}
.ex-tools .icon-btn:disabled {
  opacity: 0.25;
}

#wExercises.is-rest {
  opacity: 0.75;
}

/* ======================= DEMONSTRAÇÃO ======================= */
/* As duas fotos empilhadas; a de cima pisca em steps(2), o que alterna sem
   transição — um crossfade daria a impressão de movimento contínuo que o
   exercício não tem. */
.ex-demo {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 10px;
  background: var(--field);
}
.ex-demo-sm {
  width: 56px;
  height: 42px;
}
.ex-demo-md {
  width: 96px;
  height: 72px;
}
.ex-demo-lg {
  width: 100%;
  height: 190px;
  border-radius: 14px;
  margin-bottom: 12px;
}
.ex-demo-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ex-demo.is-animated .ex-demo-frame:first-child {
  animation: ex-flip 1.6s steps(1, end) infinite;
}
@keyframes ex-flip {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}
.ex-demo.no-media {
  background: var(--field)
    linear-gradient(135deg, transparent 45%, var(--sheen) 50%, transparent 55%);
}
.ex-demo.no-media .ex-demo-frame {
  display: none;
}

.ex-tip {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--field);
  border-radius: 10px;
  padding: 9px 11px;
}
.ex-steps {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.ex-steps li {
  margin-bottom: 7px;
}

/* ======================= LISTA DE TREINOS ======================= */
.wk-modes {
  margin: 0 0 10px;
}
.wk-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.wk-slot {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.wk-card {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--sh-md);
  margin-top: 9px;
  overflow: hidden;
}
.wk-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: 0;
  padding: 13px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.wk-badge {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: "Baloo 2", sans-serif;
  font-weight: 700;
  font-size: 15px;
}
.wk-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wk-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wk-sub {
  font-size: 12px;
  color: var(--muted);
}
.wk-move {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 6px;
}
.wk-move .icon-btn:disabled {
  opacity: 0.25;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ======================= SELETOR DE EXERCÍCIO ======================= */
.picker-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  padding-bottom: 8px;
}
.picker-head .chips {
  margin-top: 8px;
}
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  /* 56px: alvo de toque generoso — a lista tem ~120 itens e errar custa scroll */
  min-height: 56px;
  background: var(--field);
  border: 0;
  border-radius: 12px;
  padding: 6px 11px 6px 6px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
}
.picker-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.picker-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-sub {
  font-size: 11.5px;
  color: var(--muted);
}
/* Linha do exercício que o próprio usuário cadastrou: aceita toque longo para
   editar. Segurar um <button> no iOS abre o callout do sistema e seleciona o
   texto por cima do gesto — daí as duas linhas abaixo. */
.picker-row.is-custom {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 2px 0 0 var(--teal);
}
.picker-row.longpress {
  background: var(--tint-blue);
}

/* ==================== CADASTRO DE EXERCÍCIO ==================== */
.ex-photos {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.ex-photo {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ex-photo-slot {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--field);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--muted);
}
.ex-photo-slot.is-filled {
  border-style: solid;
}
.ex-photo-slot.is-filled span {
  display: none;
}
.ex-photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ex-photo-label {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}
.ex-photo-acts {
  display: flex;
  gap: 6px;
}
.ex-photo-acts .btn {
  flex: 1 1 0;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
}

/* ======================= AQUECIMENTO DE MÍDIA ======================= */
.warm-bar {
  margin-top: 10px;
}
.warm-status {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ======================= PROGRESSÃO ======================= */
.prog-periods {
  margin-bottom: 12px;
}
.prog-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  background: var(--card);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--sh-md);
  padding: 13px;
  margin-top: 9px;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.pr-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prog-name {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}
.prog-mini {
  display: flex;
  flex: 0 0 auto;
}
.prog-sub,
.prog-sets {
  font-size: 12px;
  color: var(--muted);
}
.prog-sets {
  margin: 5px 0 0;
}
.prog-day {
  margin-top: 9px;
}
.prog-max {
  font-weight: 700;
  color: var(--coral);
}

/* ---------- painel: KPIs ---------- */
.prog-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.prog-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prog-kpi b {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.1;
  color: var(--coral);
}
.prog-kpi span {
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- painel: seções ---------- */
.prog-sec-title {
  margin: 18px 0 8px;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
}
.prog-sec {
  padding: 4px 13px;
}
.prog-line {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 11px 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.prog-line:first-child {
  border-top: 0;
}
.pl-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pl-name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-sub {
  font-size: 12px;
  color: var(--muted);
}
/* A pastilha de variação é .delta-chip, em components.css — compartilhada com
   a folha de troca da dieta. */

/* ---------- gráficos ---------- */
.prog-spark-mini {
  width: 62px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--coral);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.prog-spark-mini path {
  vector-effect: non-scaling-stroke;
}
.prog-resumo {
  margin: 2px 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.chart {
  width: 100%;
  height: auto;
  margin: 4px 0 0;
  display: block;
  overflow: visible;
}
.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.chart-axis {
  font-size: 9px;
  fill: var(--muted);
}
.chart-area {
  fill: var(--coral);
  fill-opacity: 0.12;
  stroke: none;
}
.chart-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-dot {
  fill: var(--card);
  stroke: var(--coral);
  stroke-width: 2.5;
}
.chart-dot.pr {
  fill: var(--coral);
}
.chart-dot.on {
  fill: var(--coral);
  stroke: var(--card);
}
.chart-hit {
  fill: transparent;
  cursor: pointer;
}
.chart-cap {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
