:root {
  --bg: #0F1115;
  --surface: #171A20;
  --surface-2: #1E222A;
  --border: #262B33;
  --text: #F2F3F0;
  --text-dim: #8A8F98;
  --text-mute: #565B66;
  --volt: #D6FF3B;
  --volt-dim: #A8CC2F;
  --red: #FF4B3E;
  --blue: #4B9EFF;

  --g-peito: #FF4B3E;
  --g-ombro: #FFA23E;
  --g-triceps: #FFD23E;
  --g-costas: #4B9EFF;
  --g-biceps: #7A6BFF;
  --g-pernas: #D6FF3B;
  --g-cardio: #3EFFC0;
  --g-quadriceps: #B6FF3E;
  --g-posterior: #FF9F3E;
  --g-gluteos: #FF5FA8;
  --g-panturrilha: #29D9FF;
  --g-abdomen: #FFE066;
  --g-trapezio: #9B8CFF;
  --g-antebraco: #6BD98A;

  --radius: 14px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(15,17,21,.79) 0%, rgba(15,17,21,.88) 38%, rgba(15,17,21,.95) 100%),
    url('../images/gym-background-premium.webp') center top / cover no-repeat;
  filter: saturate(.82);
}

body { background: transparent; isolation: isolate; }

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 32px);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
}

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}

.topbar h1 {
  font-size: 22px;
  flex: 1;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.icon-btn:active { background: var(--surface-2); }

.workout-timer-btn {
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 20px;
}

.workout-timer-btn.running {
  background: rgba(214,255,59,0.12);
  border-color: var(--volt);
  color: var(--volt);
}

/* ---------- Layout / screens ---------- */
.screen {
  padding: 0 0 24px;
  max-width: 560px;
  margin: 0 auto;
}

.screen-header {
  padding: 16px 18px 4px;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
}

.screen-header .eyebrow {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 2px;
}

.screen-header h1 {
  font-size: 26px;
}

/* ---------- Cards ---------- */
.card {
  background: rgba(23,26,32,.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.date-line {
  color: var(--text-dim);
  font-size: 14px;
  text-transform: capitalize;
  margin: 4px 0 18px;
}

.btn-primary {
  display: block;
  width: 100%;
  background: var(--volt);
  color: #0F1115;
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.btn-primary:active { background: var(--volt-dim); }

.btn-secondary {
  display: block;
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  padding: 8px 0;
  cursor: pointer;
}

.btn-danger {
  color: var(--red);
}

/* ---------- Workout type list ---------- */
.workout-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}

.workout-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(23,26,32,.94);
  border: 1px solid var(--border);
  border-left: 4px solid var(--volt);
  border-radius: var(--radius);
  padding: 12px 14px 12px 12px;
  cursor: pointer;
  box-shadow: 0 7px 22px rgba(0,0,0,0.16);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.workout-row:active { transform: scale(.985); background: var(--surface-2); }
.workout-real-photo { width: 66px; height: 66px; border-radius: 12px; }
.workout-real-photo img { object-position: center; }

.workout-row .wname {
  font-size: 17px;
  font-weight: 700;
}

.workout-row .wgroups {
  color: var(--text-dim);
  font-size: 13px;
}

.workout-row .chev {
  margin-left: auto;
  color: var(--text-mute);
}

/* ---------- Stats summary grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 6px 0 18px;
}

.stat-box {
  background: rgba(23,26,32,.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
}

.stat-box .num {
  font-family: "Arial Black", sans-serif;
  font-size: 24px;
  color: var(--volt);
  line-height: 1;
}

.stat-box .label {
  color: var(--text-dim);
  font-size: 11.5px;
  margin-top: 6px;
}

.section-title {
  font-size: 13px;
  color: var(--text-dim);
  margin: 20px 2px 8px;
  font-weight: 600;
}

/* ---------- Exercise icons (pictograms) ---------- */
.ex-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}

/* ---------- Exercise photos (real demonstration photos) ---------- */
.ex-photo-wrap {
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-2);
}

.ex-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ex-demo {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.ex-demo-img {
  flex: 1;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.ex-demo-img img {
  width: 100%;
  height: 108px;
  object-fit: cover;
  display: block;
}

.ex-demo-img span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 3px 0;
  line-height: 1.3;
}

.ex-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.ex-header .ex-title-wrap { flex: 1; min-width: 0; }

.obs-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapse-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ex-done-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--volt);
  color: #0F1115;
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Upload de foto personalizada ---------- */
.foto-upload-input {
  display: none;
}

.foto-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.foto-upload-preview {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 10px;
}

.foto-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.foto-upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  font-size: 12px;
}

/* ---------- Exercise entry (treino ativo) ---------- */
.exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muscle-color, var(--volt));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 26px rgba(0,0,0,.18);
  transition: opacity .22s ease, transform .22s ease;
}
.exercise-card.exercise-current { border-color: rgba(214,255,59,.38); box-shadow: 0 10px 30px rgba(214,255,59,.07), 0 8px 26px rgba(0,0,0,.2); }
.exercise-card.exercise-complete { opacity: .72; }

.exercise-card .exname {
  font-size: 18px;
  font-weight: 800;
}

.exercise-card .last-time {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 3px 0 0;
}

.exercise-card .sets-wrap { margin-top: 14px; }

.set-row {
  margin-bottom: 14px;
}

.set-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.set-row-head .set-num {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}

.set-last-ref {
  color: var(--text-mute);
  font-size: 12.5px;
}

.set-row-inputs {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.field {
  flex: 1;
}

.field label {
  display: block;
  color: var(--text-mute);
  font-size: 11px;
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 18px;
  padding: 10px 10px;
  text-align: center;
  -moz-appearance: textfield;
}

.field input::placeholder {
  color: var(--text-mute);
  opacity: 0.7;
}

.field input:focus {
  outline: none;
  border-color: var(--volt);
}

.set-check {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: none;
  background: var(--volt);
  color: #0F1115;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}

.set-row.done {
  opacity: 0.55;
}

.set-row.done .set-check {
  background: var(--surface-2);
  color: var(--volt);
  border: 1px solid var(--border);
}

.add-set-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 10px;
  font-size: 14px;
  margin-top: 4px;
}

.finish-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 10px 18px;
  background: linear-gradient(transparent, var(--bg) 30%);
  z-index: 15;
}

.finish-bar .btn-primary {
  background: var(--red);
  color: #fff;
}

/* ---------- Temporizador de descanso ---------- */
.rest-timer-wrap {
  position: fixed;
  right: 18px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 92px);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rest-timer-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 30px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.rest-timer-btn.running {
  background: var(--volt);
  color: #0F1115;
  border-color: var(--volt);
}
.rest-timer-btn.running::before { content: '●'; margin-right: 6px; animation: timer-pulse 1s ease infinite; }
@keyframes timer-pulse { 50% { opacity: .25; } }

.rest-timer-btn.flash {
  animation: rest-flash 0.9s ease infinite;
}

@keyframes rest-flash {
  0%, 100% { background: var(--volt); }
  50% { background: var(--red); color: #fff; }
}

.rest-timer-config-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.rest-timer-quick-btn {
  height: 40px;
  border-radius: 20px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.setting-toggle span { display: flex; flex-direction: column; gap: 3px; }
.setting-toggle strong { font-size: 14px; }
.setting-toggle small { color: var(--text-dim); font-size: 12px; }
.setting-toggle input { width: 22px; height: 22px; accent-color: var(--volt); }

.rest-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rest-preset-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

.rest-preset-btn.active {
  background: var(--volt);
  color: #0F1115;
  border-color: var(--volt);
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(23,26,32,.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 30;
}
body.focus-mode .bottom-nav { transform: translateY(110%); pointer-events: none; }
body.focus-mode { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
.focus-mode .finish-bar { bottom: env(safe-area-inset-bottom); }
.focus-mode .rest-timer-wrap { bottom: calc(env(safe-area-inset-bottom) + 92px); }
.bottom-nav { transition: transform .25s ease; }

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-mute);
  font-size: 11px;
  background: transparent;
  border: none;
}

.nav-item .nav-icon {
  line-height: 1;
}
.nav-item .nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.nav-item.active {
  color: var(--volt);
}
.nav-item.active .nav-icon { filter: drop-shadow(0 0 7px rgba(214,255,59,.28)); }

/* ---------- History ---------- */
.history-group-label {
  color: var(--text-dim);
  font-size: 12px;
  margin: 18px 2px 6px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  border-left: 3px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.history-hiit-photo { position: relative; border-color: var(--red) !important; }
.history-hiit-photo span { position: absolute; right: 3px; bottom: 2px; font-size: 16px; filter: drop-shadow(0 1px 2px #000); }

.history-row .htitle-wrap { flex: 1; min-width: 0; }

.history-row .hdel-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--red);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-row .htitle {
  font-weight: 700;
  font-size: 15.5px;
}

.history-row .hsub {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 3px;
}

/* ---------- Evolution ---------- */
.select-row select, .select-row input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 15px;
  margin-bottom: 14px;
}

table.evo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.evo-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 6px;
  border-bottom: 1px solid var(--border);
}

table.evo-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
}

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

.evo-up { color: var(--volt); }
.evo-down { color: var(--red); }

.evo-chart-canvas {
  width: 100%;
  height: 190px;
  background: linear-gradient(180deg, rgba(214,255,59,.055), var(--surface) 58%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 10px 0 4px;
}

.evo-block {
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.evo-block:last-child {
  border-bottom: none;
}

.evo-block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.evo-block-header .li-name {
  font-weight: 700;
  font-size: 15.5px;
}

.evo-exercise-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 9px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}
.evo-exercise-row > span { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.evo-exercise-row strong { font-size: 15px; }
.evo-exercise-row small { margin-top: 3px; color: var(--text-dim); }
.evo-exercise-row > b { color: var(--text-mute); font-size: 20px; }

.evo-detail-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.evo-detail-title h2 { font-size: 20px; }
.evo-detail-title span { display: block; margin-top: 3px; color: var(--text-dim); font-size: 13px; }
.evo-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 16px; }
.evo-summary { padding: 13px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.evo-summary span { display: block; color: var(--text-dim); font-size: 11.5px; margin-bottom: 5px; }
.evo-summary strong { font-size: 19px; color: var(--text); }
.evo-summary strong.positive { color: var(--volt); }
.evo-summary strong.negative { color: var(--red); }
.evo-toolbar { display: flex; gap: 6px; margin: 8px 0; overflow-x: auto; }
.evo-toolbar button { flex: 1; min-width: max-content; padding: 9px 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); font-size: 12.5px; font-weight: 700; }
.evo-toolbar button.active { background: var(--volt); border-color: var(--volt); color: var(--bg); }
.evo-periods { margin: 4px 0 14px; }
.evo-chart-wrap { min-height: 190px; }
.evo-no-period { height: 190px; display: grid; place-items: center; color: var(--text-dim); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.evo-record-note { color: var(--text-dim); font-size: 12.5px; margin: 6px 2px 12px; }
.evo-record-note strong { color: var(--text); }

/* ---------- Mais / lists ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  margin-bottom: 8px;
}

.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-name { font-weight: 700; font-size: 15px; overflow-wrap: break-word; }
.list-item .li-sub { color: var(--text-dim); font-size: 12.5px; }

.drag-handle {
  color: var(--text-mute);
  font-size: 16px;
  padding: 4px 6px;
  cursor: grab;
}

.li-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  min-width: 36px;
  min-height: 36px;
  padding: 7px 6px;
  flex-shrink: 0;
}

.li-btn.danger { color: var(--red); }

/* ---------- Forms / modal sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
  display: flex;
  align-items: flex-end;
}

.sheet {
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.sheet h2 {
  font-size: 19px;
  margin-bottom: 16px;
}

.form-row { margin-bottom: 14px; }

.form-row label {
  display: block;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 6px;
}

.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
}

.form-row textarea { resize: vertical; min-height: 60px; }

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.sheet-actions .btn-secondary, .sheet-actions .btn-primary {
  margin: 0;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  background: var(--volt);
  color: #0F1115;
  font-weight: 700;
  padding: 13px 16px;
  border-radius: 10px;
  text-align: center;
  z-index: 60;
  animation: toast-in-out 2.2s ease forwards;
}

@keyframes toast-in-out {
  0% { opacity: 0; transform: translateY(10px); }
  10% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* ---------- Finish summary ---------- */
.summary-hero {
  text-align: center;
  padding: 30px 10px 10px;
}

.summary-hero .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--volt);
  color: #0F1115;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.summary-hero h2 { font-size: 22px; }
.summary-hero .sub { color: var(--text-dim); margin-top: 4px; }

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

/* ---------- Cardio form ---------- */
.cardio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  font-size: 14.5px;
}

.empty-state .emoji { font-size: 32px; margin-bottom: 10px; }

/* ---------- Offline badge ---------- */
.offline-badge {
  display: none;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 6px;
}

.offline-badge.show { display: block; }

/* ---------- Visualizador de foto em tela cheia ---------- */
.photo-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: photo-viewer-fade 0.15s ease;
}

@keyframes photo-viewer-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.photo-viewer-close {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.photo-viewer-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.photo-viewer-arrow.left { left: 12px; }
.photo-viewer-arrow.right { right: 12px; }

.photo-viewer-counter {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 600;
  z-index: 2;
}

img.zoomable {
  cursor: zoom-in;
}

/* ---------- Seletor de programa (Mike 1, Mike 2...) ---------- */
.programa-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  color: var(--text);
  text-align: left;
}

.programa-switch .prog-label {
  color: var(--text-dim);
  font-size: 12px;
  display: block;
}

.programa-switch .prog-nome {
  font-size: 15px;
  font-weight: 700;
}

.programa-switch .prog-main { flex: 1; min-width: 0; }
.programa-switch .chev { color: var(--text-mute); font-size: 14px; }

.programa-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}

.programa-row .li-name { font-weight: 700; font-size: 15px; }
.programa-row .radio-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.programa-row.active .radio-dot {
  border-color: var(--volt);
}
.programa-row.active .radio-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--volt);
}

/* ---------- Calendário (Histórico) ---------- */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 14px;
}

.cal-mes-label {
  font-size: 16px;
  font-weight: 800;
  text-transform: capitalize;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}

.cal-weekday {
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 24px;
}

.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid transparent;
  overflow: hidden;
}

.cal-day.muted {
  color: var(--text-mute);
  background: transparent;
}

.cal-day.today {
  border-color: var(--volt);
  font-weight: 800;
}

.cal-day.has-session {
  cursor: pointer;
  background: var(--surface-2);
}

.cal-day-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cal-day-bg-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}

.cal-day-num {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 800;
}

.cal-day.today .cal-day-num {
  background: var(--volt);
  color: #0F1115;
}

/* ---------- Seletor de exercícios (catálogo) ---------- */
.cat-search {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 12px;
}

.cat-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.cat-chips::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.cat-chip.active {
  background: var(--volt);
  color: #0F1115;
  border-color: var(--volt);
}

.cat-list {
  max-height: 52vh;
  overflow-y: auto;
  margin-top: 6px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
}

.cat-item .li-name { font-weight: 700; font-size: 14.5px; }
.cat-item .li-sub { color: var(--text-dim); font-size: 12px; margin-top: 1px; }

.cat-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 30px 10px;
  font-size: 14px;
}

.cat-custom-link {
  display: block;
  width: 100%;
  text-align: center;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  padding: 12px;
  border-radius: 10px;
  font-size: 13.5px;
  margin-top: 12px;
}

/* ---------- Telas grandes (tablets, dobráveis abertos como o Z Fold) ---------- */
@media (min-width: 720px) {
  .screen {
    max-width: 900px;
  }

  .screen-header {
    max-width: 900px;
    margin: 0 auto;
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar {
    max-width: 900px;
    margin: 0 auto;
  }

  .workout-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .stat-box .num {
    font-size: 28px;
  }

  .exercise-card,
  .card {
    padding: 20px;
  }

  .ex-demo-img img {
    height: 150px;
  }

  .finish-bar,
  .sheet-backdrop {
    display: flex;
    justify-content: center;
  }

  .finish-bar > .btn-primary {
    max-width: 900px;
  }

  .sheet {
    max-width: 640px;
    border-radius: 18px;
    margin-bottom: 24px;
  }

  .cal-grid {
    gap: 8px;
  }

  .cal-day {
    font-size: 15px;
  }
}

@media (min-width: 1000px) {
  .screen,
  .screen-header,
  .topbar {
    max-width: 1080px;
  }

  .workout-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Card do HIIT (Início) ---------- */
.hiit-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: linear-gradient(135deg, rgba(255,75,62,0.18), rgba(255,75,62,0.05));
  border: 1px solid rgba(255,75,62,0.4);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0 18px;
  text-align: left;
}

.hiit-card-emoji { font-size: 28px; flex-shrink: 0; }
.hiit-card-photo { width: 58px; height: 58px; flex-shrink: 0; overflow: hidden; border-radius: 12px; border: 2px solid var(--red); }
.hiit-card-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hiit-card-text { display: flex; flex-direction: column; flex: 1; }
.hiit-card-title { font-size: 17px; font-weight: 800; color: var(--text); }
.hiit-card-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

/* ---------- Tela do HIIT ---------- */
.hiit-protocolo-resumo {
  text-align: left;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  margin-top: 4px;
}

.hiit-body {
  min-height: calc(100vh - 70px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  transition: background 0.4s ease;
}

.hiit-body.fase-aquecimento { background: rgba(75,158,255,0.10); }
.hiit-body.fase-forte { background: rgba(255,75,62,0.14); }
.hiit-body.fase-recuperacao { background: rgba(62,255,192,0.10); }
.hiit-body.fase-desaceleracao { background: rgba(138,143,152,0.10); }

.hiit-ciclo-info {
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hiit-fase-emoji {
  font-size: 56px;
  line-height: 1;
}

.hiit-fase-nome {
  font-family: "Arial Black", sans-serif;
  font-size: 30px;
  letter-spacing: -0.01em;
  margin: 6px 0 4px;
}

.hiit-body.fase-forte .hiit-fase-nome { color: var(--red); }
.hiit-body.fase-recuperacao .hiit-fase-nome { color: #3EFFC0; }
.hiit-body.fase-aquecimento .hiit-fase-nome { color: #4B9EFF; }

.hiit-cronometro {
  font-family: "Arial Black", sans-serif;
  font-size: 84px;
  line-height: 1;
  margin: 10px 0 14px;
  font-variant-numeric: tabular-nums;
}

.hiit-orientacao {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 320px;
  margin-bottom: 22px;
}

.hiit-progress-track {
  width: 100%;
  max-width: 420px;
  height: 10px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 28px;
}

.hiit-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.5s linear;
}

.hiit-controles {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.hiit-controles button {
  flex: 1;
  padding: 18px 10px;
  font-size: 15px;
  font-weight: 800;
}
