:root {
  color-scheme: dark;
  --black: #090909;
  --surface: #121212;
  --surface-raised: #191919;
  --surface-input: #0b0b0b;
  --border: #303030;
  --white: #f7f7f7;
  --muted: #a6a6a6;
  --red: #e50914;
  --red-soft: rgb(229 9 20 / 12%);
  --orange-soft: rgb(249 115 22 / 12%);
  --orange: #f97316;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--black); }

body {
  min-width: 320px;
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid #ff3942;
  outline-offset: 3px;
}

.app-header,
main {
  width: min(100%, 960px);
  margin-inline: auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}

.brand, .eyebrow, .session-label {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.app-header h1 { margin: 4px 0 0; font-size: 20px; }

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}

main { padding: 0 20px calc(110px + env(safe-area-inset-bottom)); }

.hero { padding: 34px 0 30px; }
.hero h2 {
  margin: 10px 0;
  font-size: clamp(38px, 9vw, 64px);
  line-height: .95;
  letter-spacing: -2px;
}
.hero h2 strong { color: var(--red); }
.hero p { max-width: 470px; color: var(--muted); line-height: 1.5; }

.week {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}

.day {
  display: flex;
  min-width: 0;
  min-height: 76px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.day:hover { border-color: #555; background: var(--surface-raised); }
.day:active { transform: scale(.98); }
.day small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.day strong { font-size: 22px; line-height: 1; }
.day.active { border-color: var(--red); background: var(--red); }
.day.active small { color: #fff; }

.workout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.workout-header h3 { margin: 5px 0 3px; font-size: clamp(23px, 5vw, 30px); }
.workout-header p { margin: 0; color: var(--muted); font-size: 14px; }
.exercise-count {
  flex: 0 0 auto;
  min-width: 68px;
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}
.exercise-count small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; }

.exercise-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.exercise-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--red-soft);
  color: #ff4149;
  font-size: 14px;
  font-weight: 900;
}
.exercise-info { min-width: 0; }
.exercise-info h4 { margin: 1px 0 14px; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.prescription, .active-prescription { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.prescription span, .active-prescription span { display: grid; gap: 4px; }
.prescription small, .active-prescription small { color: var(--muted); font-size: 10px; }
.prescription strong, .active-prescription strong { font-size: 13px; }
.arrow { align-self: center; color: var(--muted); font-size: 28px; line-height: 1; }

.start-workout, .finish-workout {
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  letter-spacing: .7px;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}
.start-workout:hover, .finish-workout:not(:disabled):hover { background: #f21a25; }
.start-workout:disabled { cursor: wait; opacity: .75; }

.active-session { min-width: 0; }
.session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, #191919, #101010);
}
.session-top h3 { margin: 5px 0; font-size: clamp(23px, 5vw, 30px); }
.session-top p { margin: 0; color: var(--muted); font-size: 13px; }
.session-progress {
  flex: 0 0 auto;
  display: grid;
  width: 64px;
  height: 64px;
  place-content: center;
  border: 1px solid #633034;
  border-radius: 50%;
  background: var(--red-soft);
  text-align: center;
}
.session-progress strong { color: #fff; font-size: 20px; }
.session-progress span { color: var(--muted); font-size: 11px; }

.active-exercises { display: grid; gap: 16px; }
.active-exercise {
  min-width: 0;
  padding: clamp(15px, 3vw, 22px);
  border: 1px solid #343434;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgb(0 0 0 / 18%);
  transition: border-color .2s ease;
}
.active-exercise.is-complete {
  border-color: #55272b;
}
.active-exercise-header { margin-bottom: 16px; }
.exercise-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.exercise-position { color: #ff4149; font-size: 12px; font-weight: 900; letter-spacing: 1px; }
.exercise-badge-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgb(229 9 20 / 18%);
  color: #ff5058;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
}
.exercise-badge-done[hidden] {
  display: none;
}
.active-exercise h4 { margin: 5px 0 12px; font-size: clamp(19px, 4vw, 23px); line-height: 1.2; overflow-wrap: anywhere; }
.active-prescription {
  width: fit-content;
  gap: 12px 22px;
  padding: 10px 12px;
  border: 1px solid #2b2b2b;
  border-radius: 11px;
  background: #0d0d0d;
}

.sets { display: grid; gap: 12px; }
.set-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #303030;
  border-radius: 14px;
  background: var(--surface-raised);
  transition: border-color .15s ease, background-color .15s ease;
}
.set-card.is-complete {
  border-color: #694044;
  background: #151112;
}
.set-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.set-card-heading h5 { margin: 0; font-size: 15px; }
.set-status { color: #b6b6b6; font-size: 11px; font-weight: 700; }
.is-complete .set-status { color: #ff6269; }
.set-inputs { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 9px; }
.set-field { display: grid; min-width: 0; gap: 7px; color: #c9c9c9; font-size: 11px; font-weight: 700; }
.set-field > span { white-space: nowrap; }
.set-field > span small { color: var(--muted); font-weight: 500; }
.set-field-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rir-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1px solid #484848;
  border-radius: 50%;
  background: #202020;
  color: #bbb;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  transition: all .15s ease;
}
.rir-info-btn:hover, .rir-info-btn:focus-visible {
  border-color: var(--red);
  color: #fff;
  background: var(--red-soft);
}

.set-field input,
.set-field select {
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 8px;
  border: 1px solid #505050;
  border-radius: 10px;
  background: var(--surface-input);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  text-align-last: center;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  transition: border-color .15s ease;
}
.set-field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.set-field select option {
  background: #181818;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.set-field input::placeholder { color: #777; opacity: 1; }
.set-field input:focus,
.set-field select:focus {
  border-color: var(--red);
  outline: 2px solid var(--red);
  outline-offset: 1px;
}
.set-field input.input-error {
  border-color: var(--red);
  outline: 2px solid var(--red);
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.set-field input::-webkit-inner-spin-button, .set-field input::-webkit-outer-spin-button { margin: 0; appearance: none; }

.set-complete {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid #514044;
  border-radius: 10px;
  background: var(--red-soft);
  color: #ff686f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.set-complete:hover {
  background: rgb(229 9 20 / 22%);
  border-color: var(--red);
  color: #fff;
}
.set-card.is-complete .set-complete {
  background: #231214;
  border-color: #694044;
  color: #ff858b;
}
.set-card.is-complete .set-complete:hover {
  background: #2f181c;
  border-color: var(--red);
  color: #fff;
}

.finish-workout:disabled {
  border: 1px solid var(--border);
  background: #191919;
  color: #858585;
  cursor: not-allowed;
}

.session-active .hero, .session-active .week { display: none; }
.session-active main { padding-top: 2px; }

/* In-History, In-Evolution & In-Workouts View Header adjustments */
.view-history .hero,
.view-history .week,
.view-evolution .hero,
.view-evolution .week,
.view-workouts .hero {
  display: none;
}
.view-workouts .week {
  display: flex;
}
.view-history main,
.view-evolution main,
.view-workouts main {
  padding-top: 4px;
}

/* RIR Dialog Modal */
.rir-dialog,
.session-details-dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--white);
  padding: 0;
  max-width: min(calc(100vw - 32px), 520px);
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.rir-dialog::backdrop,
.session-details-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.rir-dialog-content,
.session-details-content {
  padding: 22px;
  max-height: 85vh;
  overflow-y: auto;
}
.rir-dialog-header,
.session-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.rir-dialog-header h3,
.session-details-header h3 {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
}
.session-details-date {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.rir-dialog-close,
.dialog-close-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #404040;
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s ease;
  flex-shrink: 0;
}
.rir-dialog-close:hover,
.dialog-close-btn:hover {
  color: #fff;
  border-color: #666;
}
.rir-intro {
  margin: 0 0 14px;
  color: #d1d1d1;
  font-size: 13px;
  line-height: 1.4;
}
.rir-intro strong {
  color: var(--red);
}
.rir-scale {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.rir-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #282828;
  border-radius: 10px;
  background: var(--surface-input);
  font-size: 13px;
}
.rir-item strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  width: auto;
  height: 24px;
  padding: 0 4px;
  border-radius: 6px;
  background: var(--red-soft);
  color: #ff4149;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}
.rir-item span {
  color: #e0e0e0;
}
.rir-tip {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.rir-dialog-confirm {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color .15s ease;
}
.rir-dialog-confirm:hover {
  background: #f21a25;
}

/* ==================================================
   HISTÓRICO & RESUMO SEMANAL
   ================================================== */
.history-container {
  display: grid;
  gap: 20px;
}
.history-header {
  margin-bottom: 4px;
}
.history-header h3 {
  margin: 4px 0 0;
  font-size: clamp(22px, 5vw, 28px);
}

.week-summary-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, #181818, #101010);
}
.week-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.week-summary-heading h4 {
  margin: 4px 0 2px;
  font-size: 18px;
  font-weight: 800;
}
.week-range {
  color: var(--muted);
  font-size: 12px;
}
.week-context-status {
  margin: 6px 0 0;
  color: #ff686f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.adherence-badge {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 64px;
  padding: 6px;
  border: 1px solid #633034;
  border-radius: 14px;
  background: var(--red-soft);
  text-align: center;
}
.adherence-badge strong {
  font-size: 20px;
  color: #fff;
  line-height: 1;
}
.adherence-badge small {
  color: #ff686f;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}

.summary-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.metric-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border: 1px solid #282828;
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}
.metric-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
}
.metric-lbl {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.history-timeline {
  display: grid;
  gap: 14px;
}
.timeline-title {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .15s ease, background-color .15s ease;
}
.timeline-card.has-session {
  cursor: pointer;
}
.timeline-card.has-session:hover {
  border-color: #555;
  background: var(--surface-raised);
}
.timeline-card-main {
  min-width: 0;
}
.timeline-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.timeline-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.timeline-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
}
.timeline-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.timeline-arrow {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}
.status-badge.badge-completed {
  background: rgb(229 9 20 / 14%);
  border: 1px solid #632b2f;
  color: #ff525a;
}
.status-badge.badge-rescheduled {
  background: var(--orange-soft);
  border: 1px solid #5a3518;
  color: #fb923c;
}
.status-badge.badge-in_progress {
  background: rgb(59 130 246 / 14%);
  border: 1px solid #233e66;
  color: #60a5fa;
}
.status-badge.badge-incomplete {
  background: rgb(239 68 68 / 12%);
  border: 1px solid #5c2424;
  color: #f87171;
}
.status-badge.badge-missed {
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  color: #888;
}
.status-badge.badge-pending {
  background: #181818;
  border: 1px solid #333;
  color: #aaa;
}

/* Session Details Modal Elements */
.session-details-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}
.meta-box {
  padding: 10px 6px;
  border: 1px solid #2d2d2d;
  border-radius: 10px;
  background: var(--surface-raised);
  text-align: center;
}
.meta-box small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 2px;
}
.meta-box strong {
  font-size: 13px;
  color: var(--white);
  white-space: nowrap;
}

.session-details-exercises {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}
.exercise-detail-card {
  padding: 14px;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
  background: var(--surface-input);
}
.exercise-detail-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.exercise-detail-heading h5 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 800;
}
.exercise-detail-heading small {
  color: var(--muted);
  font-size: 11px;
}
.exercise-detail-sets {
  display: grid;
  gap: 6px;
}
.set-detail-row {
  display: grid;
  grid-template-columns: 70px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #222;
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
}
.set-detail-row.is-done {
  border-color: #40282b;
  background: #140f10;
}
.set-detail-row.is-not-done {
  opacity: 0.65;
}
.set-muted-status {
  color: var(--muted);
  font-weight: 600;
}
.set-detail-row .set-num {
  color: var(--muted);
  font-weight: 700;
}
.set-detail-row .set-load {
  font-weight: 800;
  color: var(--white);
}
.set-detail-row .set-rir {
  color: #ff686f;
  font-weight: 700;
  font-size: 11px;
}
.set-detail-row .set-check {
  color: #ff5058;
  font-weight: 900;
}

/* Empty State */
.empty-history-card {
  text-align: center;
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.empty-history-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
}
.empty-history-card p {
  margin: 0 auto;
  max-width: 320px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Workout Completed Card */
.workout-completed-card {
  text-align: center;
  padding: clamp(24px, 5vw, 40px) 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, #181818, #0f0f0f);
  margin-top: 10px;
}
.completed-badge {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  box-shadow: 0 0 24px rgb(229 9 20 / 35%);
}
.workout-completed-card h2 {
  margin: 8px 0 10px;
  font-size: clamp(24px, 5vw, 32px);
  letter-spacing: -0.5px;
}
.completed-summary-text {
  margin: 0 auto 24px;
  max-width: 420px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.completed-summary-text strong {
  color: var(--white);
}
.completed-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 440px;
  margin: 0 auto 28px;
}
.completed-stat {
  padding: 14px 8px;
  border: 1px solid #2d2d2d;
  border-radius: 12px;
  background: var(--surface);
}
.completed-stat small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}
.completed-stat strong {
  font-size: 20px;
  color: var(--white);
}
.back-home-btn {
  width: 100%;
  max-width: 440px;
  min-height: 56px;
  margin: 0 auto;
  border: 0;
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .7px;
  cursor: pointer;
  transition: background-color .15s ease;
}
/* ==================================================
   EVOLUÇÃO (ANÁLISE DE PROGRESSO)
   ================================================== */
.evolution-container {
  display: grid;
  gap: 20px;
}
.evolution-header {
  margin-bottom: 4px;
}
.evolution-header h3 {
  margin: 4px 0 2px;
  font-size: clamp(22px, 5vw, 28px);
}
.evolution-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.evolution-overview-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, #181818, #101010);
}
.evolution-overview-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  color: #ff5058;
  letter-spacing: 0.8px;
}
.evolution-metrics-3grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.evolution-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.evolution-exercise-list {
  display: grid;
  gap: 10px;
}
.evolution-exercise-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.evolution-exercise-card:hover {
  border-color: #555;
  background: var(--surface-raised);
}
.evolution-exercise-card:active {
  transform: scale(0.99);
}
.evolution-card-info h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
}
.evolution-card-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.evolution-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #252525;
  color: #bbb;
  font-size: 10px;
  font-weight: 700;
}
.evolution-card-arrow {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

/* Detalhes do Exercício */
.evolution-detail-header {
  display: grid;
  gap: 10px;
}
.evolution-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 0;
  border: 0;
  background: none;
  color: #ff5058;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .15s ease;
}
.evolution-back-btn:hover {
  opacity: 0.85;
}
.evolution-exercise-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.evolution-exercise-picker {
  width: 100%;
  max-width: 320px;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-input);
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

/* Filtro de Período */
.evolution-period-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: fit-content;
}
.period-tab {
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}
.period-tab:hover {
  color: var(--white);
}
.period-tab.active {
  background: var(--red);
  color: #fff;
}

/* Card de Resumo 4-Grid */
.evolution-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

/* Card de Tendência */
.evolution-trend-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, #181818, #111111);
}
.evolution-trend-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.evolution-trend-top span.label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.8px;
}
.evolution-trend-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #e2e2e2;
}

/* Card de Comparação */
.evolution-comparison-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.evolution-comparison-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  color: #ff5058;
  letter-spacing: 0.8px;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.comparison-col {
  padding: 12px;
  border: 1px solid #282828;
  border-radius: 12px;
  background: var(--surface-input);
}
.comparison-col-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
}
.comparison-col-heading small {
  color: var(--muted);
  font-size: 10px;
}
.comparison-sets-list {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 12px;
}
.comparison-set-item {
  color: #ccc;
}
.comparison-col-footer {
  padding-top: 6px;
  border-top: 1px solid #222;
  font-size: 11px;
  color: var(--muted);
}
.comparison-col-footer strong {
  color: var(--white);
}
.comparison-insights {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #dfdfdf;
  line-height: 1.4;
}
.comparison-insights li::marker {
  color: var(--red);
}

/* Cards de Gráfico */
.evolution-chart-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.evolution-chart-header {
  margin-bottom: 12px;
}
.evolution-chart-header h5 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
}
.evolution-chart-header small {
  color: var(--muted);
  font-size: 11px;
}
.evolution-svg-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.evolution-svg-chart {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}
.chart-single-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

/* Histórico de Sessões do Exercício */
.evolution-history-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.evolution-history-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.8px;
}
.evolution-sessions-log {
  display: grid;
  gap: 10px;
}
.session-log-card {
  padding: 12px 14px;
  border: 1px solid #282828;
  border-radius: 12px;
  background: var(--surface-input);
}
.session-log-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.session-log-top strong {
  font-size: 13px;
  color: var(--white);
}
.session-log-top small {
  color: #ff5058;
  font-weight: 700;
  font-size: 11px;
}
.session-log-sets {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}
.session-log-footer {
  padding-top: 6px;
  border-top: 1px solid #202020;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* ==================================================
   MOTOR DE PROGRESSÃO (SUGESTÕES E CONFIGURAÇÃO)
   ================================================== */
.progression-pill-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 9px 12px;
  margin: 10px 0 14px;
  border: 1px solid #2d2627;
  border-radius: 12px;
  background: #140f10;
  font-size: 12px;
}
.progression-action-summary {
  flex: 1 1 auto;
  color: #dfdfdf;
  font-weight: 600;
  line-height: 1.35;
}
.btn-progression-info {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border: 1px solid #483033;
  border-radius: 8px;
  background: #201315;
  color: #ff5058;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-progression-info:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Card de Progressão na Evolução */
.evolution-progression-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, #191415, #100d0e);
}
.evolution-progression-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.evolution-progression-top span.label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.8px;
}
.progression-action-main {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.4;
}
.progression-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #282828;
  border-radius: 10px;
  background: var(--surface-input);
  font-size: 12px;
  color: var(--muted);
}
.progression-meta-row strong {
  color: var(--white);
}
.progression-reasons-box {
  margin-bottom: 12px;
}
.progression-warnings-box {
  padding: 8px 12px;
  margin-bottom: 14px;
  border: 1px solid #4a3818;
  border-radius: 10px;
  background: rgb(245 158 11 / 10%);
}
.progression-warn-item {
  margin: 2px 0;
  font-size: 12px;
  color: #fbbf24;
  line-height: 1.35;
}
.progression-config-box {
  padding-top: 12px;
  border-top: 1px solid #252021;
}
.progression-config-box label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.increment-select {
  width: 100%;
  max-width: 380px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-input);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Modal de Detalhes da Progressão */
.progression-dialog-body {
  display: grid;
  gap: 14px;
}
.progression-dialog-card {
  padding: 14px;
  border: 1px solid #282828;
  border-radius: 12px;
  background: var(--surface-input);
}

/* ==================================================
   REST TIMER (FLOATING BANNER)
   ================================================== */
.rest-timer-banner {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 16px;
  max-width: 540px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid #ff3b44;
  border-radius: 14px;
  background: linear-gradient(135deg, #1c1012, #0d0a0b);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 59, 68, 0.2);
  backdrop-filter: blur(12px);
  animation: slideTimerIn .25s ease-out;
}
.rest-timer-banner[hidden] {
  display: none !important;
}
@keyframes slideTimerIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.rest-timer-banner.is-done {
  border-color: #22c55e;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 24px rgba(34, 197, 94, 0.35);
  animation: timerDonePulse 1.2s infinite ease-in-out;
}
@keyframes timerDonePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.rest-timer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rest-timer-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #ff8a90;
  text-transform: uppercase;
}
.rest-timer-banner.is-done .rest-timer-label {
  color: #4ade80;
}
.rest-timer-time {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.rest-timer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-timer-add,
.btn-timer-skip {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-timer-add {
  border: 1px solid #442a2d;
  background: #281618;
  color: #ff8087;
}
.btn-timer-add:hover {
  background: #ff3b44;
  color: #fff;
  border-color: #ff3b44;
}
.btn-timer-skip {
  border: 1px solid #333;
  background: #1e1e1e;
  color: #bbb;
}
.btn-timer-skip:hover {
  background: #333;
  color: #fff;
}

/* ==================================================
   TIPOS DE SÉRIE (NORMAL, AQUECIMENTO, BACK-OFF, DROP SET)
   ================================================== */
.set-type-select {
  padding: 3px 8px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #181818;
  color: #ccc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.set-type-select:focus {
  outline: none;
  border-color: var(--red);
}
.set-type-select[data-type="warmup"],
.badge-warmup {
  color: #f59e0b;
  border-color: #78350f;
  background: rgba(245, 158, 11, 0.12);
}
.set-type-select[data-type="backoff"],
.badge-backoff {
  color: #38bdf8;
  border-color: #0369a1;
  background: rgba(56, 189, 248, 0.12);
}
.set-type-select[data-type="dropset"],
.badge-dropset {
  color: #ec4899;
  border-color: #9d174d;
  background: rgba(236, 72, 153, 0.12);
}
.set-type-select[data-type="normal"] {
  color: #aaa;
}

/* ==================================================
   TELA TREINOS / PROGRAMA & CONFIGURAÇÃO
   ================================================== */
.workouts-program-list {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}
.workout-program-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .15s ease, transform .15s ease;
}
.workout-program-card:hover {
  border-color: #3d3536;
}
.workout-program-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.workout-program-header h4 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
}
.workout-program-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.workout-program-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-open-program,
.btn-start-program-direct {
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-open-program {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-input);
  color: var(--white);
}
.btn-open-program:hover {
  border-color: #444;
  background: #252525;
}
.btn-start-program-direct {
  border: none;
  background: var(--red);
  color: #fff;
}
.btn-start-program-direct:hover {
  background: var(--red-hover);
}

/* Lista de Exercícios com Configuração Individual */
.ecc-list {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}
.ecc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.ecc-card:hover, .ecc-card:focus-visible {
  border-color: #3d3536;
  background: #181516;
  outline: none;
}
.ecc-card:focus-visible {
  box-shadow: 0 0 0 2px var(--red);
}
.ecc-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.ecc-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 11px;
  background: var(--red-soft);
  color: #ff4149;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.ecc-info {
  flex: 1;
  min-width: 0;
}
.ecc-info h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ecc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #dfdfdf;
  margin-bottom: 3px;
}
.ecc-dot {
  color: var(--muted);
}
.ecc-increment {
  font-size: 11px;
  color: var(--muted);
}
.ecc-increment strong {
  color: #aaa;
}
.ecc-edit-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
  transition: color .15s ease;
}
.ecc-card:hover .ecc-edit-icon,
.ecc-card:focus-visible .ecc-edit-icon {
  color: #ff5058;
}

/* Formulário de Configuração do Exercício (Modal) */
.config-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.config-field-full {
  grid-column: 1 / -1;
}
.config-input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
.config-input-group input,
.config-input-group select {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-input);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.config-input-group input:focus,
.config-input-group select:focus {
  outline: none;
  border-color: var(--red);
  background: #111;
}

.btn-reset-workout-config {
  width: 100%;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #383032;
  border-radius: 10px;
  background: #1c1416;
  color: #ff5058;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
  margin-top: 8px;
}
.btn-reset-workout-config:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* Banner de Atualização do PWA (Service Worker) */
.update-banner {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 16px;
  right: 16px;
  max-width: 540px;
  margin-inline: auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border: 1px solid #ff3b44;
  border-radius: 14px;
  background: linear-gradient(135deg, #1c1012, #0d0a0b);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 59, 68, 0.25);
  backdrop-filter: blur(12px);
  animation: slideUpdateIn .25s ease-out;
}
.update-banner[hidden] {
  display: none !important;
}
.update-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.update-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.update-banner-text strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.update-banner-text small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.btn-update-app {
  flex-shrink: 0;
  padding: 6px 14px;
  min-height: 36px;
  border: none;
  border-radius: 8px;
  background: #ff3b44;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity .15s ease;
}
.btn-update-app:hover {
  opacity: 0.9;
}
@keyframes slideUpdateIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Card Sobre o WW Treino */
.about-card {
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.about-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
}
.about-version {
  font-size: 11px;
  font-weight: 800;
  color: #ff5058;
  background: var(--red-soft);
  padding: 3px 8px;
  border-radius: 6px;
}
.about-description {
  margin: 0 0 14px;
  font-size: 13px;
  color: #dfdfdf;
  line-height: 1.4;
}
.about-features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.about-feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.about-feature-item span {
  color: #ff5058;
  font-size: 14px;
}
.about-section-block {
  padding-top: 12px;
  border-top: 1px solid #222;
  margin-top: 12px;
}
.about-section-block h5 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.about-section-block p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.about-install-row {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-install-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #ff3b44;
  border-radius: 10px;
  background: linear-gradient(135deg, #1c1012, #0d0a0b);
  color: #ff5058;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-install-app:hover {
  background: #ff3b44;
  color: #fff;
}
.install-hint-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #181818;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ==================================================
   BACKUP & RESTAURAÇÃO
   ================================================== */
.backup-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  margin-top: 24px;
}
.backup-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
}
.backup-card p {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.backup-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-backup-export,
.btn-backup-restore {
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-backup-export {
  border: 1px solid #443033;
  background: #201315;
  color: #ff5058;
}
.btn-backup-export:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-backup-restore {
  border: 1px solid #333;
  background: var(--surface-input);
  color: #dfdfdf;
}
.btn-backup-restore:hover {
  background: #2a2a2a;
  color: #fff;
}

/* ==================================================
   PROGRESSÃO DISCRETA NO TREINO ATIVO
   ================================================== */
.active-progression-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  margin: 8px 0 12px;
  border: 1px solid #2d2627;
  border-radius: 12px;
  background: #140f10;
  font-size: 12px;
}
.active-progression-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 200px;
}
.active-progression-last {
  font-size: 11px;
  color: var(--muted);
}
.active-progression-last strong {
  color: #ccc;
}
.active-progression-next {
  color: #dfdfdf;
  font-weight: 700;
  line-height: 1.35;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 960px);
  margin-inline: auto;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  background: rgb(13 13 13 / 97%);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 24%);
  backdrop-filter: blur(14px);
}
.bottom-nav .nav-btn {
  min-width: 0;
  min-height: 48px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: #888;
  font-size: clamp(10px, 3vw, 12px);
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease;
}
.bottom-nav .nav-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.bottom-nav .nav-btn.selected { color: #ff4149; font-weight: 800; }

/* ==================================================
   TERMOS DE USO, POLÍTICA DE PRIVACIDADE E CONSENTIMENTO
   ================================================== */
.legal-dialog {
  max-width: min(calc(100vw - 32px), 580px);
}
.legal-dialog-content {
  padding: 24px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
}

.legal-document {
  display: flex;
  flex-direction: column;
}
.legal-doc-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #222;
}
.legal-doc-header h3 {
  margin: 4px 0 2px;
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
}
.legal-meta {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.legal-content-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: #dfdfdf;
  overflow-y: auto;
  padding-right: 4px;
}
.legal-content-body p {
  margin: 0 0 12px;
}
.legal-content-body strong {
  color: #fff;
}
.legal-doc-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #222;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

/* Modal de Aceite Inicial (Consentimento) */
.legal-consent-box {
  display: flex;
  flex-direction: column;
}
.legal-consent-intro {
  font-size: 13.5px;
  line-height: 1.45;
  color: #dfdfdf;
  margin: 0 0 16px;
}
.legal-doc-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.btn-legal-read {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #383032;
  border-radius: 10px;
  background: #181415;
  color: #ff5058;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
}
.btn-legal-read:hover, .btn-legal-read:focus-visible {
  border-color: #ff3b44;
  background: #241618;
}

.legal-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #2e2627;
  border-radius: 12px;
  background: #140f10;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  margin-bottom: 18px;
  transition: border-color .15s ease;
}
.legal-checkbox-label:hover {
  border-color: #ff3b44;
}
.legal-checkbox-input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-top: 1px;
  border: 2px solid #555;
  border-radius: 6px;
  background: #000;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all .15s ease;
}
.legal-checkbox-input:checked {
  border-color: #ff3b44;
  background: #ff3b44;
}
.legal-checkbox-input:checked::before {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}
.legal-checkbox-input:focus-visible {
  outline: 2px solid #ff3b44;
  outline-offset: 2px;
}

.btn-agree-continue {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  background: #e50914;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease;
}
.btn-agree-continue:disabled {
  background: #2a2a2a;
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Estado de Consentimento Recusado / Bloqueado */
.legal-declined-card {
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  margin-top: 20px;
}
.legal-declined-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #fff;
}
.legal-declined-card p {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.legal-declined-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  margin-inline: auto;
}

/* Lista de Links Legais na Seção Sobre */
.legal-links-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.btn-about-legal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid #2e2829;
  border-radius: 8px;
  background: #161213;
  color: #dfdfdf;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-about-legal-link:hover, .btn-about-legal-link:focus-visible {
  border-color: #ff3b44;
  color: #fff;
  background: #201517;
}

/* Nota de isenção no card do Motor de Progressão */
.progression-disclaimer-note {
  margin: 12px 0 0;
  font-size: 11px;
  color: #888;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 600px) {
  .exercise-list { grid-template-columns: minmax(0, 1fr); }
  .exercise-card { padding: 16px; }
  .summary-metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .session-details-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison-grid { grid-template-columns: minmax(0, 1fr); }
  .evolution-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evolution-exercise-picker-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .evolution-exercise-picker { max-width: 100%; }
  .config-form-grid { grid-template-columns: minmax(0, 1fr); }
  .workout-program-actions { flex-direction: column; align-items: stretch; }
  .legal-doc-buttons-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .app-header { padding-inline: 16px; }
  main { padding-inline: 16px; }
  .day { min-height: 72px; padding-inline: 12px; }
  .set-card { padding: 12px 10px; }
  .set-inputs { gap: 7px; }
  .set-field { font-size: 10px; }
  .set-field input,
  .set-field select { padding-inline: 4px; font-size: 18px; }
  .summary-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evolution-metrics-3grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .evolution-period-bar { width: 100%; justify-content: space-between; }
  .period-tab { padding: 6px 8px; font-size: 11px; flex: 1; text-align: center; }
  .evolution-exercise-card { padding: 12px 10px; gap: 8px; }
  .rest-timer-banner { padding: 8px 12px; }
  .rest-timer-time { font-size: 17px; }
}

@media (min-width: 760px) {
  main { padding-right: 28px; padding-left: 28px; }
  .active-exercises { gap: 18px; }
  .sets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ecc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
