/* styles.css — complementa o Tailwind */

/* Paleta (canais RGB para permitir opacidade: rgb(var(--c-x) / .5)) */
:root {
  --c-bg: 11 15 20;
  --c-surface: 18 24 33;
  --c-surface2: 26 34 45;
  --c-line: 36 48 64;
  --c-ink: 232 237 244;
  --c-muted: 147 161 179;
  --c-accent: 163 230 53;
  --c-on-accent: 11 15 20;
  --c-field: 15 21 29;
  --c-hover: 32 43 57;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --c-bg: 244 246 249;
  --c-surface: 255 255 255;
  --c-surface2: 238 241 245;
  --c-line: 217 224 232;
  --c-ink: 15 23 42;
  --c-muted: 91 104 120;
  --c-accent: 101 163 13;
  --c-on-accent: 255 255 255;
  --c-field: 248 250 252;
  --c-hover: 226 232 240;
  color-scheme: light;
}
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

/* Layout principal + safe-area da tab bar */
.app-main {
  min-height: 100dvh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
.screen { padding-top: env(safe-area-inset-top); }
.screen-header { padding: 20px 16px 12px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 8px;
}
.section-title h2 {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: rgb(var(--c-muted)); font-weight: 600;
}

/* Tabbar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgb(var(--c-bg) / .86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid rgb(var(--c-line));
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px 4px 10px;
  color: rgb(var(--c-muted)); text-decoration: none;
  font-size: 10.5px; letter-spacing: .02em;
  transition: color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: rgb(var(--c-accent)); }

/* Cards */
.card {
  background: rgb(var(--c-surface));
  border: 1px solid rgb(var(--c-line));
  border-radius: 16px;
  padding: 14px;
}
.card--list { padding: 0; overflow: hidden; }
.card--list .list-row { padding: 14px; }
.list-row { display: flex; align-items: center; gap: 12px; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary   { background: rgb(var(--c-accent)); color: rgb(var(--c-on-accent)); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-secondary { background: rgb(var(--c-surface2)); color: rgb(var(--c-ink)); border-color: rgb(var(--c-line)); }
.btn-secondary:hover { background: rgb(var(--c-hover)); }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-ghost     { background: transparent; color: rgb(var(--c-accent)); padding-left: 8px; padding-right: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: rgb(var(--c-surface2)); border: 1px solid rgb(var(--c-line));
  color: rgb(var(--c-ink)); cursor: pointer;
}
.icon-btn[disabled] { opacity: .35; pointer-events: none; }
.icon-btn--danger { color: #f87171; }

/* Inputs */
.input {
  width: 100%; background: rgb(var(--c-field)); border: 1px solid rgb(var(--c-line));
  border-radius: 12px; padding: 11px 13px; color: rgb(var(--c-ink));
  font-size: 15px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: rgb(var(--c-accent)); box-shadow: 0 0 0 3px rgba(163,230,53,.15); }
.input--sm { padding: 8px 10px; font-size: 14px; border-radius: 10px; }

.label {
  display: block; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: rgb(var(--c-muted));
  margin-bottom: 6px; font-weight: 600;
}

/* Chips */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 7px 12px; border-radius: 999px;
  background: rgb(var(--c-surface2)); border: 1px solid rgb(var(--c-line));
  color: rgb(var(--c-muted)); font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.chip.is-active { background: rgb(var(--c-accent)); color: rgb(var(--c-on-accent)); border-color: rgb(var(--c-accent)); }
.chip.is-active .measure-dot { outline: 1px solid rgba(0,0,0,.3); }
.chip--static { cursor: default; font-size: 11px; padding: 4px 8px; }

/* Segmented control */
.segmented {
  display: grid; grid-template-columns: 1fr 1fr;
  background: rgb(var(--c-field)); border: 1px solid rgb(var(--c-line));
  border-radius: 12px; padding: 4px; gap: 4px;
}
.segmented--3 { grid-template-columns: repeat(3, 1fr); }
.segmented label { position: relative; display: block; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; width: 100%; text-align: center;
  padding: 8px; border-radius: 9px;
  font-size: 13px; color: rgb(var(--c-muted)); font-weight: 500;
}
.segmented input:checked + span { background: rgb(var(--c-surface2)); color: rgb(var(--c-ink)); }

/* Empty state */
.empty-state {
  text-align: center; color: rgb(var(--c-muted));
  font-size: 13px; padding: 28px 16px; line-height: 1.55;
}

/* Bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.6);
  opacity: 0; transition: opacity .22s ease; pointer-events: auto;
}
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgb(var(--c-surface));
  border-top: 1px solid rgb(var(--c-line));
  border-radius: 22px 22px 0 0;
  max-height: 88dvh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .24s cubic-bezier(.22,.61,.36,1);
  padding-bottom: env(safe-area-inset-bottom);
  pointer-events: auto; overflow: hidden;
}
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet.is-open .sheet__panel { transform: translateY(0); }
.sheet__handle {
  width: 38px; height: 5px; border-radius: 99px;
  background: rgb(var(--c-line)); margin: 8px auto 0;
}
.sheet__panel form { overflow-y: auto; }
.sheet__scroll { overflow-y: auto; flex: 1; min-height: 0; }

/* Picker */
.picker-list { overflow-y: auto; padding: 0 16px 8px; max-height: 52dvh; }
.picker-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 0; border: 0; border-bottom: 1px solid rgb(var(--c-line));
  background: transparent; color: rgb(var(--c-ink)); text-align: left; cursor: pointer;
}
.picker-item:last-child { border-bottom: 0; }
.picker-item__name { flex: 1; font-weight: 500; font-size: 15px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Toast */
.toast-root {
  position: fixed; left: 0; right: 0;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 80; pointer-events: none; padding: 0 16px;
}
.toast {
  background: rgb(var(--c-surface2)); color: rgb(var(--c-ink));
  border: 1px solid rgb(var(--c-line));
  padding: 10px 16px; border-radius: 12px;
  font-size: 13.5px; max-width: 480px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--success { border-color: rgb(var(--c-accent)); }
.toast--error   { border-color: #ef4444; }

/* Builder item */
.builder-item { padding: 12px 14px; }

/* Stepper de exercícios (sessão ativa) */
.stepper {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 0 10px; scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.step {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  background: rgb(var(--c-surface2)); border: 1px solid rgb(var(--c-line));
  color: rgb(var(--c-muted)); font-size: 12.5px;
  cursor: pointer; max-width: 210px; white-space: nowrap;
}
.step.is-active { background: rgb(var(--c-accent)); border-color: rgb(var(--c-accent)); color: rgb(var(--c-on-accent)); }
.step.is-done:not(.is-active) { border-color: rgb(var(--c-accent)); color: rgb(var(--c-accent)); }
.step__idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 999px;
  background: rgba(255,255,255,.08);
  font-size: 11px; font-weight: 700;
}
.step.is-active .step__idx { background: rgba(0,0,0,.15); }
.step__label { overflow: hidden; text-overflow: ellipsis; }

/* Cronômetro */
.timer-row {
  display: flex; align-items: center; gap: 10px;
  padding-top: 10px; border-top: 1px solid rgb(var(--c-line));
}
.timer-display {
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
  margin-right: auto; color: rgb(var(--c-ink));
}

/* Séries */
.set-list { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; gap: 8px; }
.set-row__num {
  width: 24px; text-align: center;
  font-size: 12px; color: rgb(var(--c-muted)); font-weight: 600;
}
.set-row__input { flex: 1; min-width: 0; }
.set-row__unit { font-size: 12px; color: rgb(var(--c-muted)); min-width: 30px; }

/* Cards de estatística (tela Corpo) */
.card--stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: rgb(var(--c-muted)); }
.stat-value { font-size: 22px; font-weight: 600; }
.stat-unit { font-size: 11px; color: rgb(var(--c-muted)); }

/* ================================================================ */
/*  Histórico                                                        */
/* ================================================================ */

.stat-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.stat-block {
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 14px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.stat-block__value {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat-block__label {
  font-size: 10.5px; color: rgb(var(--c-muted)); line-height: 1.3;
}

.view-switch {
  display: grid; grid-template-columns: 1fr 1fr;
  background: rgb(var(--c-field)); border: 1px solid rgb(var(--c-line));
  border-radius: 12px; padding: 4px; gap: 4px;
}
.view-switch__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px; border-radius: 9px; border: 0; background: transparent;
  color: rgb(var(--c-muted)); font-size: 13px; font-weight: 600; cursor: pointer;
}
.view-switch__btn.is-active { background: rgb(var(--c-surface2)); color: rgb(var(--c-ink)); }
.view-switch__btn svg { width: 16px; height: 16px; }

.session-item {
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 16px;
  overflow: hidden;
}
.session-item__head {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 14px; background: transparent; border: 0;
  color: inherit; text-align: left; cursor: pointer;
}
.session-item__metrics {
  display: flex; flex-wrap: wrap; gap: 4px;
  font-size: 11px; color: rgb(var(--c-muted)); margin-top: 4px;
}
.session-item__chev {
  width: 18px; height: 18px; flex-shrink: 0; color: rgb(var(--c-muted));
  transition: transform .18s ease;
}
.session-item.is-expanded .session-item__chev { transform: rotate(180deg); }
.session-item__detail {
  padding: 12px 14px 14px; border-top: 1px solid rgb(var(--c-line));
}
.session-detail__ex {
  padding: 8px 0; border-bottom: 1px solid rgb(var(--c-line) / .6);
}
.session-detail__ex:last-child { border-bottom: 0; }
.set-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.set-pill {
  background: rgb(var(--c-surface2)); border: 1px solid rgb(var(--c-line));
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; color: rgb(var(--c-ink));
  font-variant-numeric: tabular-nums;
}

.day-session-item {
  padding: 12px; border-radius: 12px;
  background: rgb(var(--c-field)); border: 1px solid rgb(var(--c-line));
}

.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-grid--head { margin-bottom: 4px; }
.cal-weekday {
  text-align: center; font-size: 10.5px; color: rgb(var(--c-muted));
  padding: 4px 0; font-weight: 600; text-transform: uppercase;
}
.cal-cell {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid transparent;
  background: rgb(var(--c-field)); color: rgb(var(--c-ink));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; cursor: pointer; padding: 2px;
  position: relative;
}
.cal-cell--pad { visibility: hidden; }
.cal-cell[disabled] {
  color: rgb(var(--c-muted)); opacity: 0.35;
  cursor: default; background: transparent;
}
.cal-cell.has-session {
  background: rgba(163, 230, 53, 0.10);
  border-color: rgba(163, 230, 53, 0.35);
  color: rgb(var(--c-accent));
  font-weight: 600;
}
.cal-cell.is-today { border-color: rgb(var(--c-accent)); }
.cal-cell.is-today:not(.has-session) { color: rgb(var(--c-accent)); }
.cal-cell__num { font-size: 12.5px; line-height: 1; }
.cal-cell__dot {
  width: 4px; height: 4px; border-radius: 999px;
  background: rgb(var(--c-accent));
}

/* ================================================================ */
/*  Corpo — peso, medidas, gráficos, deltas                          */
/* ================================================================ */

.weight-current {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.weight-value {
  font-size: 34px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.weight-unit { font-size: 14px; color: rgb(var(--c-muted)); font-weight: 500; }

.chart {
  display: block; width: 100%; height: auto;
  margin-top: 8px;
}

.delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 2px 6px; border-radius: 999px;
}
.delta--up      { color: #f87171; background: rgba(248,113,113,.10); }
.delta--down    { color: #4ade80; background: rgba(74,222,128,.10); }
.delta--neutral { color: rgb(var(--c-muted)); background: transparent; padding: 0; }

.measure-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.measure-card {
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line)); border-radius: 14px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.measure-card__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  color: rgb(var(--c-muted)); font-weight: 600;
}
.measure-card__value {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 3px;
}
.measure-card__unit {
  font-size: 10px; color: rgb(var(--c-muted)); font-weight: 500;
}
.measure-card__delta { line-height: 1; }

.measure-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 999px;
  flex-shrink: 0;
}

.measure-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.measure-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgb(var(--c-surface2)); border: 1px solid rgb(var(--c-line));
  padding: 3px 8px; border-radius: 999px;
  font-size: 11px; color: rgb(var(--c-ink));
  font-variant-numeric: tabular-nums;
}

.note-hidden {
  font-size: 11.5px; color: #fbbf24;
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.25);
  border-radius: 10px; padding: 8px 10px;
  line-height: 1.4;
}
.note-hidden[hidden] { display: none; }

/* ================================================================ */
/*  Fotos                                                            */
/* ================================================================ */

/* Storage card */
.card--storage { padding: 12px; }
.storage-bar {
  height: 6px; border-radius: 999px;
  background: rgb(var(--c-surface2)); overflow: hidden;
}
.storage-bar__fill {
  height: 100%; width: 0%;
  background: rgb(var(--c-accent));
  border-radius: 999px;
  transition: width .3s ease, background .3s ease;
}
.storage-bar__fill.is-warning { background: #fbbf24; }

/* Sheet: prévia da foto */
.photo-preview {
  width: 100%; border-radius: 14px; overflow: hidden;
  background: rgb(var(--c-field));
  display: flex; align-items: center; justify-content: center;
  max-height: 36dvh;
}
.photo-preview img {
  max-width: 100%; max-height: 36dvh;
  object-fit: contain; display: block;
}

/* Sheet: detalhe */
.photo-detail__img {
  width: 100%; border-radius: 14px;
  display: block; background: rgb(var(--c-field));
  max-height: 60dvh; object-fit: contain;
}

/* Galeria agrupada */
.photo-day__label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgb(var(--c-muted)); font-weight: 600; margin-bottom: 6px;
}
.photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(var(--c-line));
  background: rgb(var(--c-field));
  cursor: pointer;
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.photo-thumb__pose {
  position: absolute;
  bottom: 6px; left: 6px;
  background: rgba(11,15,20,.72);
  color: #e8edf4;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Comparativo */
.compare-controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 10px;
}
.compare-controls__field { display: block; }
.compare-controls__field .input {
  padding: 9px 10px; font-size: 14px;
}

.compare-view {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 16px;
  overflow: hidden;
  background: rgb(var(--c-field));
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.compare-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  display: block;
}
.compare-img--overlay { will-change: clip-path; }
.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgb(var(--c-accent));
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 12px rgba(163,230,53,.55);
}
.compare-handle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: rgb(var(--c-accent));
  border: 3px solid #0b0f14;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.compare-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
  touch-action: pan-y;
}
.compare-label {
  position: absolute;
  bottom: 8px;
  background: rgba(11,15,20,.75);
  color: #e8edf4;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.compare-label--a { left: 8px; }
.compare-label--b { right: 8px; }
/* ================================================================ */
/*  Ajustes                                                          */
/* ================================================================ */

.danger-zone { border-color: rgba(239, 68, 68, .35); }
.segmented--compact span { padding: 6px !important; font-size: 12.5px !important; }

/* Faixa de status offline */
.offline-banner {
  position: fixed; left: 0; right: 0; top: 0; z-index: 70;
  padding: calc(env(safe-area-inset-top) + 4px) 12px 4px;
  background: #fbbf24; color: #0b0f14;
  font-size: 11.5px; font-weight: 600; text-align: center;
}

/* ================================================================ */
/*  Teste de nível + programa automático                             */
/* ================================================================ */

body.is-onboarding .tabbar { display: none; }
body.is-onboarding .app-main { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.test-progress { display: flex; gap: 6px; }
.test-progress span {
  flex: 1; height: 4px; border-radius: 99px;
  background: rgb(var(--c-line));
  transition: background .2s ease;
}
.test-progress span.is-on { background: rgb(var(--c-accent)); }

.test-option {
  display: block; width: 100%; text-align: left;
  padding: 16px; border-radius: 14px;
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-line));
  color: rgb(var(--c-ink)); font-size: 15px; font-weight: 500;
  cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .06s ease;
  -webkit-tap-highlight-color: transparent;
}
.test-option:active { transform: scale(.99); }
.test-option.is-active {
  border-color: rgb(var(--c-accent));
  background: rgb(var(--c-accent) / .12);
}

.level-chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}
.level-chip--ini { color: #38bdf8; background: rgba(56,189,248,.12); }
.level-chip--int { color: rgb(var(--c-accent)); background: rgb(var(--c-accent) / .14); }
.level-chip--ava { color: #fb923c; background: rgba(251,146,60,.14); }
.level-chip--pro { color: #f472b6; background: rgba(244,114,182,.14); }

.program-card { border-color: rgb(var(--c-accent) / .35); }

.level-hint {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 8px 10px; border-radius: 10px;
  background: rgb(var(--c-field)); border: 1px solid rgb(var(--c-line));
  font-size: 12px; color: rgb(var(--c-muted)); line-height: 1.35;
}
.level-hint b { color: rgb(var(--c-ink)); }
.level-hint.is-ready { border-color: rgb(var(--c-accent)); color: rgb(var(--c-accent)); }
.level-hint__dots { display: flex; gap: 4px; flex-shrink: 0; }
.level-hint__dots span {
  width: 9px; height: 9px; border-radius: 99px;
  border: 1.5px solid rgb(var(--c-line));
}
.level-hint__dots span.is-on { background: rgb(var(--c-accent)); border-color: rgb(var(--c-accent)); }

.level-up {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; border-radius: 14px;
  background: rgb(var(--c-accent) / .08); border: 1px solid rgb(var(--c-accent) / .35);
}
.level-up__row { display: flex; gap: 10px; align-items: flex-start; }
.level-up__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 99px; flex-shrink: 0;
  background: rgb(var(--c-accent)); color: rgb(var(--c-on-accent));
  font-weight: 700;
}

/* ================================================================ */
/*  Ordem das progressões                                            */
/* ================================================================ */

.ex-group__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.ex-group__head h3 {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: rgb(var(--c-muted)); font-weight: 600;
}
.ex-group__hint { font-size: 10.5px; color: rgb(var(--c-muted)); }

.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgb(var(--c-surface2)); border: 1.5px solid rgb(var(--c-line));
  color: rgb(var(--c-ink));
}
.step-num--ini { border-color: rgba(56,189,248,.6); }
.step-num--int { border-color: rgb(var(--c-accent) / .7); }
.step-num--ava { border-color: rgba(251,146,60,.7); }
.step-num--pro { border-color: rgba(244,114,182,.7); }
.step-num--sm { width: 24px; height: 24px; font-size: 11px; }

.picker-head {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 0 6px; background: rgb(var(--c-surface));
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; color: rgb(var(--c-ink));
  border-bottom: 1px solid rgb(var(--c-line));
}
.picker-head span { color: rgb(var(--c-muted)); letter-spacing: .04em; text-transform: none; font-weight: 500; }

/* ================================================================ */
/*  Séries concluídas + descanso                                     */
/* ================================================================ */

.set-row.is-done .set-row__num { color: rgb(var(--c-accent)); font-size: 14px; }
.set-row.is-done .set-row__input { border-color: rgb(var(--c-accent) / .45); }

.rest-bar {
  position: fixed; left: 8px; right: 8px; z-index: 45;
  bottom: calc(66px + env(safe-area-inset-bottom));
  background: rgb(var(--c-surface)); border: 1px solid rgb(var(--c-accent) / .5);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transform: translateY(140%); opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.22,.61,.36,1), opacity .2s ease;
}
.rest-bar.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.rest-bar.is-done { border-color: rgb(var(--c-accent)); background: rgb(var(--c-accent) / .16); }
.rest-bar__progress { height: 3px; background: rgb(var(--c-line)); }
.rest-bar__progress span {
  display: block; height: 100%; width: 100%;
  background: rgb(var(--c-accent)); transition: width .25s linear;
}
.rest-bar__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.rest-bar__label { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--c-muted)); font-weight: 600; }
.rest-bar__time { font-size: 26px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
.rest-bar.is-done .rest-bar__time { font-size: 18px; color: rgb(var(--c-accent)); }
.rest-bar__actions { display: flex; gap: 6px; flex-shrink: 0; }
.rest-bar.is-done .rest-bar__actions { display: none; }

body.has-rest-bar .app-main { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
body.has-rest-bar .toast-root { bottom: calc(160px + env(safe-area-inset-bottom)); }

/* Botão de descarte (ação destrutiva secundária) */
.btn-discard {
  background: transparent; color: #f87171;
  border-color: rgba(248,113,113,.35);
}
.btn-discard:hover { background: rgba(248,113,113,.08); }
