/* =========================================================
   WOU  —  Folha de estilos
   4 paletas: Escura (padrao) · Verde · Roxo · Azul. Cada uma com 1
   cor de destaque propria; ambar discreto no "anterior".
   ========================================================= */

:root {
  --gem-outline: #F7F7F8;
  --diamond-glow: rgba(255, 255, 255, .72);
  /* Superficies — Escuro "Atleta": preto grafite neutro (quase puro), com leve degrade vertical */
  --bg: #030304;
  --bg-grad-top: #121214;
  --bg-grad-bottom: #030304;
  --bg-elev: #19191C;
  --bg-elev-2: #222226;
  --bg-sunken: #050506;

  /* Linhas */
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.20);

  /* Texto — branco nitido (sem matiz de azul) */
  --text: #F7F7F8;
  --text-muted: #A6A6AC;
  --text-faint: #707075;

  /* Destaque + estados — azul eletrico com brilho ciano */
  --accent: #6366F1;
  --accent-strong: #4F46E5;
  --accent-soft: rgba(99, 102, 241, 0.20);
  --on-accent: #ffffff;
  --done: #22C55E;
  --done-strong: #16A34A;
  --done-soft: rgba(34, 197, 94, 0.14);
  --done-border-soft: rgba(34, 197, 94, 0.4);
  --prev: #F59E0B;
  --prev-soft: rgba(245, 158, 11, 0.12);
  --danger: #F43F5E;
  --danger-soft: rgba(244, 63, 94, 0.14);

  /* dia "feito" (bolinha/letra): branco solido no Escuro, em vez do verde padrao.
     Usado em 3 lugares que precisam bater: dot da semana, dot do calendario, letra do dia no detalhe. */
  --done-dot-bg: #ffffff;
  --done-dot-text: var(--bg);
  --done-dot-glow: rgba(255, 255, 255, 0.35);

  /* anel do avatar: neutro no Escuro (o azul solido "flutuava" demais contra o preto puro) */
  --avatar-ring: rgba(255, 255, 255, 0.38);
  --avatar-glow: rgba(255, 255, 255, 0.16);

  --shadow: 0 12px 34px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 600px;
}

/* Tema "Verde" — claro e vivo: base verde-menta clara, acento esmeralda vibrante.
   "Feito" (flag/contorno da serie) usa um verde-floresta bem escuro: familia de verde
   diferente do esmeralda/menta do resto da paleta (mais amarelado, bem mais escuro),
   p/ nao virar "so mais um tom do mesmo verde". Mantem "+ Serie" verde / "- Serie" vermelho. */
[data-theme="green"] {
  --gem-outline: #172033;
  --diamond-glow: rgba(109, 40, 217, .78);
  --bg: #ECF7F0;
  --bg-grad-top: #ECF7F0;
  --bg-grad-bottom: #ECF7F0;
  --bg-elev: #FFFFFF;
  --bg-elev-2: #DBEFE3;
  --bg-sunken: #DFF1E7;

  --border: rgba(6, 95, 70, 0.14);
  --border-strong: rgba(6, 95, 70, 0.24);

  --text: #0B2A1C;
  --text-muted: #456156;
  --text-faint: #7A958A;

  --accent: #059669;
  --accent-strong: #047857;
  --accent-soft: rgba(5, 150, 105, 0.14);
  --on-accent: #ffffff;
  --done: #047857;
  --done-strong: #065F46;
  --done-soft: rgba(16, 185, 129, 0.13);
  --done-border-soft: rgba(6, 95, 70, 0.38);
  --prev: #B45309;
  --prev-soft: rgba(180, 83, 9, 0.10);
  --danger: #E11D48;
  --danger-soft: rgba(225, 29, 72, 0.10);

  --done-dot-bg: var(--done);
  --done-dot-text: #ffffff;
  --done-dot-glow: var(--done-soft);

  --avatar-ring: var(--accent);
  --avatar-glow: var(--accent-soft);

  --shadow: 0 10px 30px rgba(6, 78, 59, 0.14);
  --shadow-sm: 0 4px 12px rgba(6, 78, 59, 0.10);
}

/* Tema "Roxo" (ex-Colorido) — claro vibrante: base lavanda, acento violeta */
[data-theme="color"] {
  --gem-outline: #172033;
  --diamond-glow: rgba(5, 150, 105, .78);
  --bg: #F3F1FF;
  --bg-grad-top: #F3F1FF;
  --bg-grad-bottom: #F3F1FF;
  --bg-elev: #FFFFFF;
  --bg-elev-2: #ECE7FF;
  --bg-sunken: #E6E0FB;

  --border: rgba(91, 33, 182, 0.14);
  --border-strong: rgba(91, 33, 182, 0.26);

  --text: #231A3D;
  --text-muted: #6B5E8C;
  --text-faint: #9A8FB8;

  --accent: #7C3AED;
  --accent-strong: #6D28D9;
  --accent-soft: rgba(124, 58, 237, 0.14);
  --on-accent: #ffffff;
  --done: #12B76A;
  --done-strong: #059669;
  --done-soft: rgba(18, 183, 106, 0.18);
  --done-border-soft: rgba(18, 183, 106, 0.45);
  --prev: #EA580C;
  --prev-soft: rgba(234, 88, 12, 0.12);
  --danger: #E11D48;
  --danger-soft: rgba(225, 29, 72, 0.10);

  --done-dot-bg: var(--done);
  --done-dot-text: #ffffff;
  --done-dot-glow: var(--done-soft);

  --avatar-ring: var(--accent);
  --avatar-glow: var(--accent-soft);

  --shadow: 0 10px 30px rgba(91, 33, 182, 0.16);
  --shadow-sm: 0 4px 12px rgba(91, 33, 182, 0.10);
}

/* Tema "Azul" — claro e chamativo: base azul-clara, acento azul eletrico */
[data-theme="blue"] {
  --gem-outline: #172033;
  --diamond-glow: rgba(225, 29, 72, .78);
  --bg: #EAF1FE;
  --bg-grad-top: #EAF1FE;
  --bg-grad-bottom: #EAF1FE;
  --bg-elev: #FFFFFF;
  --bg-elev-2: #DBE7FD;
  --bg-sunken: #E0EAFC;

  --border: rgba(29, 78, 216, 0.14);
  --border-strong: rgba(29, 78, 216, 0.26);

  --text: #0C1A33;
  --text-muted: #45566F;
  --text-faint: #7F92AE;

  --accent: #2563EB;
  --accent-strong: #1D4ED8;
  --accent-soft: rgba(37, 99, 235, 0.16);
  --on-accent: #ffffff;
  --done: #15A34A;
  --done-strong: #12813B;
  --done-soft: rgba(21, 163, 74, 0.16);
  --done-border-soft: rgba(21, 163, 74, 0.45);
  --prev: #B45309;
  --prev-soft: rgba(180, 83, 9, 0.10);
  --danger: #E11D48;
  --danger-soft: rgba(225, 29, 72, 0.10);

  --done-dot-bg: var(--done);
  --done-dot-text: #ffffff;
  --done-dot-glow: var(--done-soft);

  --avatar-ring: var(--accent);
  --avatar-glow: var(--accent-soft);

  --shadow: 0 10px 30px rgba(29, 78, 216, 0.14);
  --shadow-sm: 0 4px 12px rgba(29, 78, 216, 0.10);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html { color-scheme: dark; }
html[data-theme="green"], html[data-theme="color"], html[data-theme="blue"] { color-scheme: light; }

body {
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom));
  background-attachment: fixed;
  color: var(--text);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 14px calc(120px + env(safe-area-inset-bottom)) 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------ Header */
.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 14px 2px;
  margin-bottom: 14px;
}

/* Emblema WOU (marca) — mesma identidade do icone: o O vira um alvo;
   gradiente azul->violeta FIXO (nao segue o tema) p/ bater sempre com o icone. */
.brand { justify-self: start; }
.wou-mark {
  display: flex; align-items: center; justify-content: center; gap: 2px;
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, #3B82F6, #7C3AED);
  box-shadow: 0 5px 16px rgba(99, 102, 241, 0.45);
}
.wou-l { color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.5px; line-height: 1; }
.wou-bull {
  position: relative; flex-shrink: 0; box-sizing: border-box;
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff;
}
.wou-bull::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 3px; height: 3px; border-radius: 50%; background: #fff;
}

/* Foto + nome centralizados (opção A) */
.profile-center { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.profile-center .name {
  font-size: 0.92rem; font-weight: 800; letter-spacing: -0.3px;
  max-width: 42vw; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.avatar {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2.5px solid var(--avatar-ring);
  background: var(--bg-elev-2);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.55rem;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 2px 12px var(--avatar-glow);
}
.avatar-wrap { position: relative; width: 66px; height: 66px; flex-shrink: 0; }
.avatar-wrap .avatar { display: flex; }
.streak-seal-host { position: absolute; inset: 0; pointer-events: none; }
.streak-seal { position: absolute; z-index: 3; display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%; color: #171717; background: var(--seal-color);
  border: 2px solid var(--bg); box-shadow: 0 1px 6px rgba(0,0,0,.35); }
.streak-seal-black { box-shadow: 0 0 0 1px var(--seal-color), 0 0 11px rgba(163, 255, 18, .68); }
.streak-seal-diamond:not(.streak-seal-black) {
  box-shadow: 0 0 0 1px var(--diamond-glow), 0 0 9px var(--diamond-glow);
}
.streak-seal-diamond:not(.streak-seal-black) svg { filter: drop-shadow(0 0 2px var(--diamond-glow)); }
.streak-seal svg { display: block; width: 11px; height: 11px; fill: currentColor; }
.avatar-wrap > span > .streak-seal { right: -2px; bottom: 0; }
.profile-photo-wrap { position: relative; width: 140px; height: 140px; margin: 4px auto 14px; }
.profile-photo-wrap .profile-photo { margin: 0; }
.profile-photo-wrap > span > .streak-seal { right: 1px; bottom: 3px; width: 26px; height: 26px; border-width: 2px; }
.profile-photo-wrap > span > .streak-seal svg { width: 15px; height: 15px; }

.header-actions { display: flex; gap: 6px; justify-self: end; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .18s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }

/* ------------------------------------------------ Tabs */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 8px;
  background: var(--bg-elev);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transition: all .18s ease;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
/* aba sendo arrastada pra reordenar: "levanta" e segue o dedo (sem transicao, p/ acompanhar liso) */
.tab-btn.dragging {
  transition: none; z-index: 5; position: relative; cursor: grabbing;
  border-color: var(--accent); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--accent-soft);
}
.tab-check { font-size: 0.85em; }
.tab-add, .tab-run {
  flex: 0 0 auto;
  width: 38px; padding: 0;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem; font-weight: 700;
  cursor: pointer;
}
.tab-run { font-size: 1rem; }
.tab-add:hover, .tab-run:hover { color: var(--accent); border-color: var(--accent); }

/* Barra de sessao (cronometro do treino) */
.session-bar { display: flex; justify-content: center; align-items: center; margin-bottom: 14px; }
.session-start {
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 8px 18px; font-size: 0.82rem; font-weight: 800; cursor: pointer;
  transition: all .18s ease;
}
.session-start:hover { background: var(--accent); color: var(--on-accent); }
.session-start:active { transform: scale(.97); }
.session-bar.running {
  justify-content: space-between; cursor: pointer;
  background: var(--accent-soft); border: 1.5px solid var(--accent);
  border-radius: 999px; padding: 8px 16px;
  box-shadow: 0 3px 14px var(--accent-soft);
}
.session-bar.running .s-live { display: flex; align-items: center; gap: 7px;
  font-size: 0.8rem; font-weight: 800; color: var(--accent); }
.session-bar.running .s-live b { color: var(--accent); }
.s-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: s-pulse 1.4s ease-in-out infinite; flex-shrink: 0; }
.s-time { font-size: 0.98rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
@keyframes s-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
/* indicador de treino em andamento na aba */
.t-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  margin-right: 5px; vertical-align: middle; animation: s-pulse 1.4s ease-in-out infinite; }
.tab-btn.training:not(.active) { border-color: var(--accent); color: var(--text); }
.tab-btn.active .t-dot { background: #fff; }
@media (prefers-reduced-motion: reduce) { .s-dot, .t-dot { animation: none; } }

/* ------------------------------------------------ Workout header (nome do dia) */
.workout-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.workout-bar h2 {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 7px;
}
.workout-bar .count {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  background: var(--bg-elev-2); padding: 3px 9px; border-radius: 999px;
  white-space: nowrap;
}
.workout-name { cursor: pointer; flex-wrap: wrap; }
.edit-hint { font-size: .8rem; color: var(--text-faint); font-weight: 600; }
.add-desc {
  background: transparent; border: 1px dashed var(--border-strong);
  color: var(--text-muted); font-size: 0.85rem; font-weight: 700;
  padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: all .18s ease;
}
.add-desc:hover { color: var(--accent); border-color: var(--accent); }

/* ------------------------------------------------ Exercise card */
.exercise-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.exercise-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 11px;
}
/* selo de feito (esquerda), seta e badge/menu (direita) ficam presos no topo (align-self),
   nao seguem o align-items:center do header -- assim nao "boiam" pro meio quando o nome
   quebra em 2 linhas. O nome (titulo) continua regido pelo align-items:center do header,
   pra ficar centralizado quando for curto. */
.col-sum, .collapse-btn, .exercise-meta { align-self: flex-start; }
.exercise-title {
  flex: 1; min-width: 0; cursor: pointer;
  font-size: 0.92rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.2px; line-height: 1.3;
  /* nome do exercicio em ate 2 linhas (corta o excedente com reticencias) */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.collapse-btn {
  background: none; border: none; color: var(--text-muted); font-size: 1.2rem;
  cursor: pointer; width: 30px; height: 30px; flex-shrink: 0; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  margin-right: 4px;
}
.collapse-btn:hover { color: var(--text); }
/* exercicio minimizado */
.exercise-card.collapsed { padding: 10px 13px; }
/* altura minima reservada pra 2 linhas de nome fica na LINHA (header), nao no titulo em si:
   -webkit-box-pack nao centraliza o texto dentro do proprio -webkit-box do line-clamp (navegador
   ignora), entao quem garante a altura e centraliza o nome e o align-items:center do flex do
   header (a seta e o selo/badge/menu ficam de fora disso via align-self, ver acima). */
.exercise-card.collapsed .exercise-header { margin-bottom: 0; min-height: 2.4rem; }
.col-sum {
  font-size: 0.72rem; font-weight: 800; color: var(--text-muted); flex-shrink: 0;
  background: var(--bg-elev-2); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
/* concluido (minimizado): so um circulo pequeno com check -> o card ja fica
   inteiro verde (.all-done), o selo nao precisa repetir isso em formato de pilula grande */
.col-sum.ok {
  color: #fff; background: var(--done);
  width: 14px; height: 14px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.48rem;
}
.exercise-card.collapsed.all-done { border-color: var(--done-border-soft); background: var(--done-soft); }
.exercise-meta { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }

.exercise-target {
  font-size: 0.72rem; font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; cursor: pointer; user-select: none;
  transition: all .18s ease;
}
.exercise-target:active { transform: scale(.95); }

.menu-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: none; background: transparent; color: var(--text-faint);
  font-size: 1.2rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.menu-btn:hover { background: var(--bg-elev-2); color: var(--text); }

/* ------------------------------------------------ Series */
.series-list { display: flex; flex-direction: column; gap: 7px; }

.series-row {
  display: flex; flex-direction: column; gap: 7px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  transition: border-color .2s ease, background .2s ease;
}
.series-row.completed {
  border-color: var(--done);
  background: var(--done-soft);
}
[data-theme="dark"] .series-row.completed {
  background: var(--bg-sunken);
  border-color: #FFFFFF;
  box-shadow: none;
}
/* temas claros: realca a serie concluida (o verde suave quase some no fundo claro) */
[data-theme="green"] .series-row.completed,
[data-theme="color"] .series-row.completed,
[data-theme="blue"] .series-row.completed {
  background: var(--done-soft);
  border-color: var(--done-strong);
  box-shadow: inset 3px 0 0 var(--done-strong);
}
[data-theme="green"] .series-row.completed .check-btn {
  background: #D1FAE5;
  border-color: #A7F3D0;
  color: #047857;
  box-shadow: none;
}

.series-top { display: flex; align-items: center; justify-content: space-between; }
.series-label {
  font-size: 0.72rem; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.series-prev {
  font-size: 0.72rem; font-weight: 600; color: var(--prev);
  background: var(--prev-soft); padding: 2px 8px; border-radius: 6px;
}
.series-prev.empty { color: var(--text-faint); background: transparent; }

.series-inputs { display: flex; align-items: center; gap: 8px; }

.input-group {
  flex: 1; display: flex; align-items: center; gap: 5px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 5px 9px;
  transition: border-color .18s ease;
}
.input-group:focus-within { border-color: var(--accent); }
.input-group label { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; }
.input-group input {
  width: 100%; background: transparent; border: none;
  color: var(--text); font-size: 1rem; font-weight: 700;
  text-align: center; padding: 3px 0; min-width: 0;
}
.input-group input:focus { outline: none; }
.input-group input::placeholder { color: var(--text-faint); font-weight: 600; }
.unit { font-size: 0.68rem; color: var(--text-faint); font-weight: 700; }
.time-input-group { gap: 4px; }
.time-input-group label { flex-shrink: 0; }
.time-parts { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.time-parts input { width: 24px; flex: 1; font-size: .9rem; }
.time-parts span { color: var(--text-faint); font-weight: 800; font-size: .82rem; }
.time-input-group > .unit { white-space: nowrap; font-size: .62rem; }

.check-btn {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-faint);
  font-size: 1.15rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s ease;
}
.check-btn:active { transform: scale(.92); }
.series-row.completed .check-btn {
  background: var(--done); border-color: var(--done); color: #fff;
  box-shadow: 0 3px 10px var(--done-soft);
}

/* series add/remove */
.series-actions { display: flex; gap: 7px; margin-top: 9px; }
.btn-series {
  flex: 1; padding: 7px; border-radius: 9px;
  border: 1px dashed var(--done);
  background: var(--done-soft); color: var(--done);
  font-size: 0.76rem; font-weight: 800; cursor: pointer;
  transition: all .18s ease;
}
.btn-series:hover { background: var(--done); color: #fff; border-style: solid; }
.btn-series.remove {
  border-color: var(--danger); background: var(--danger-soft); color: var(--danger);
}
.btn-series.remove:hover { background: var(--danger); color: #fff; border-style: solid; }

/* ------------------------------------------------ Big buttons */
.btn-add-exercise {
  width: 100%;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 13px; font-size: 0.9rem; font-weight: 800; cursor: pointer;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .18s ease;
}
.btn-add-exercise:hover { background: var(--accent); color: var(--on-accent); }

.finish-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--done) 0%, var(--done-strong) 100%);
  color: #fff; border: none; border-radius: var(--radius);
  padding: 16px; font-size: 1rem; font-weight: 800; letter-spacing: .3px;
  cursor: pointer; box-shadow: 0 6px 20px var(--done-soft);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .18s ease;
}
.finish-btn:active { transform: scale(.98); }

.empty-state {
  text-align: center; color: var(--text-muted);
  padding: 30px 16px; font-size: 0.9rem; line-height: 1.5;
}
.empty-state .big { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ------------------------------------------------ Rest timer bar */
.rest-bar {
  position: fixed;
  left: 50%;
  /* escondida: desce a altura inteira + os 64px do 'bottom' + safe-area + folga (senao sobra um pedaco roxo) */
  transform: translateX(-50%) translateY(calc(100% + 80px + env(safe-area-inset-bottom)));
  /* um pouco acima do fundo pra nao encostar no selo do Netlify / barra do navegador (Android) */
  bottom: calc(64px + env(safe-area-inset-bottom));
  width: calc(100% - 24px); max-width: calc(var(--maxw) - 24px);
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(79, 70, 229, 0.45);
  padding: 12px 14px 14px 14px;
  z-index: 800;
  color: #fff;
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.rest-bar.active { transform: translateX(-50%) translateY(0); }

.rest-progress-track {
  height: 5px; width: 100%;
  background: rgba(255, 255, 255, 0.25); border-radius: 999px; overflow: hidden;
  margin-bottom: 10px;
}
.rest-progress-fill {
  height: 100%; width: 100%;
  background: #fff;
  border-radius: 999px; transition: width .25s linear;
}
.rest-main { display: flex; align-items: center; gap: 10px; }
.rest-info { flex: 1; min-width: 0; }
.rest-label { font-size: 0.68rem; font-weight: 800; color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase; letter-spacing: .8px; }
.rest-time { font-size: 2rem; font-weight: 800; letter-spacing: -1px; color: #fff;
  font-variant-numeric: tabular-nums; line-height: 1; margin-top: 2px; }
.rest-time.done { color: #fff; opacity: .9; }

.rest-btns { display: flex; gap: 6px; flex-shrink: 0; }
.rest-btn {
  height: 42px; min-width: 42px; padding: 0 10px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.16); color: #fff;
  font-size: 0.85rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
  touch-action: manipulation;
}
.rest-btn:active { transform: scale(.92); }
.rest-btn.primary { background: #fff; border-color: #fff; color: var(--accent-strong); }
.rest-btn.close { background: transparent; color: rgba(255, 255, 255, 0.85); border: none; font-size: 1.3rem; }

.rest-presets { display: flex; gap: 6px; margin-top: 10px; }
.rest-preset {
  flex: 1; padding: 7px 0; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.30); background: transparent;
  color: rgba(255, 255, 255, 0.90); font-size: 0.78rem; font-weight: 800; cursor: pointer;
  transition: all .15s ease;
  touch-action: manipulation;
}
.rest-preset:hover, .rest-preset.active { background: #fff; color: var(--accent-strong); border-color: #fff; }

/* ------------------------------------------------ Modal (centro) */
.modal-overlay, .sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 12, 0.6);
  backdrop-filter: blur(4px);
  display: flex; z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.modal-overlay { align-items: center; justify-content: center; padding: 20px; }
.sheet-overlay { align-items: flex-end; justify-content: center; }
.modal-overlay.active, .sheet-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 22px 18px; width: 100%; max-width: 360px;
  box-shadow: var(--shadow);
  transform: scale(.92); transition: transform .22s ease;
}
.modal-overlay.active .modal-card { transform: scale(1); }
.modal-icon { font-size: 2.1rem; text-align: center; display: block; margin-bottom: 10px; }
.modal-title { font-size: 1.15rem; font-weight: 800; text-align: center; margin-bottom: 7px; }
.modal-msg { font-size: 0.88rem; color: var(--text-muted); text-align: center;
  line-height: 1.45; margin-bottom: 18px; }

/* ------------------------------------------------ Saudacao diaria ("Bora treinar?") */
.welcome-card { padding-top: 34px; position: relative; }
.welcome-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--bg-elev-2); color: var(--text-muted);
  font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.welcome-mark { width: 64px; height: 64px; border-radius: 17px; margin: 0 auto 10px; }
.welcome-mark .wou-l { font-size: 1.3rem; }
.welcome-mark .wou-bull { width: 14px; height: 14px; }
.welcome-tagline {
  text-align: center; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 18px;
}

/* ------------------------------------------------ Bottom sheet */
.sheet {
  background: var(--bg-elev);
  border-top-left-radius: 22px; border-top-right-radius: 22px;
  border-top: 1px solid var(--border-strong);
  width: 100%; max-width: var(--maxw);
  max-height: 88vh; overflow-y: auto; overscroll-behavior-y: contain;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom)) 18px;
  box-shadow: var(--shadow);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.22,1,.36,1);
}
.sheet-overlay.active .sheet { transform: translateY(0); }
.sheet.sheet-background-locked { overflow: hidden !important; touch-action: none; }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px;
  background: var(--border-strong); margin: 4px auto 14px auto; }
.sheet-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; }
.sheet-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; }

/* Form fields */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.76rem; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; background: var(--bg-sunken);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 1rem; font-weight: 600;
  padding: 11px 12px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.sound-choice { display: flex; align-items: center; gap: 8px; }
.sound-choice select { flex: 1; min-width: 0; }
.sound-choice .btn { width: auto; flex: 0 0 auto; padding: 11px 14px; }

/* Botoes genericos */
.btn {
  width: 100%; padding: 13px; border-radius: 11px; border: none;
  font-size: 0.92rem; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--accent-strong), var(--accent)); color: var(--on-accent); box-shadow: 0 6px 16px var(--accent-soft); }
.btn-ghost { background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); }
/* "Fechar" do card compartilhavel do mes: segue a paleta escolhida; no tema Escuro (acento azul) fica neutro, como o do calendario */
[data-theme="dark"] .cc-close { background: var(--bg-elev-2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* Segmented control (tema, etc.) */
.segment {
  display: flex; gap: 4px; background: var(--bg-sunken);
  border: 1px solid var(--border); border-radius: 11px; padding: 4px;
}
.segment button {
  flex: 1; padding: 9px 3px; border: none; background: transparent;
  color: var(--text-muted); font-size: 0.78rem; font-weight: 800; white-space: nowrap;
  border-radius: 8px; cursor: pointer; transition: all .15s ease;
}
.segment button.active { background: var(--accent); color: var(--on-accent); }

/* chips (presets de descanso nas configuracoes) */
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-sunken);
  color: var(--text-muted); font-size: 0.82rem; font-weight: 800; cursor: pointer;
  transition: all .15s ease;
}
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Setting row com toggle */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label { font-size: 0.92rem; font-weight: 600; }
.setting-row .desc { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 999px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 20px; width: 20px;
  left: 3px; top: 3px; background: var(--text-faint);
  border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); background: #fff; }

.section-label {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-faint);
  margin: 18px 0 8px 2px;
}

/* Perfil */
.profile-photo {
  width: 140px; height: 140px; border-radius: 50%;
  border: 3px solid var(--avatar-ring); background: var(--bg-elev-2);
  background-size: cover; background-position: center;
  margin: 4px auto 14px auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 800; color: var(--accent); overflow: hidden;
}
.profile-streak-record { margin: -2px 0 16px; padding: 9px 12px; border-radius: 11px;
  background: var(--bg-elev-2); color: var(--text-muted); text-align: center; font-size: .78rem; }
.profile-streak-record strong { color: var(--text); }

/* Rosca de semanas consecutivas dentro do resumo, mas separada visualmente dos dias. */
.wk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 54px; align-items: stretch; gap: 7px; }
.wk-calendar { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.wk-streak-side { display: flex; align-items: center; justify-content: center; padding: 0 0 0 7px; border-left: 1px solid var(--border); }
.wk-streak-button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text);
  display: grid; place-items: center; cursor: pointer; transition: transform .18s ease, filter .18s ease; }
.wk-streak-button:active { transform: scale(.94); }
.wk-streak-button.streak-ring-unlocked { animation: streak-ring-pop .8s cubic-bezier(.2,1.5,.4,1); }
@keyframes streak-ring-pop { 0% { transform: scale(1); filter: brightness(1); }
  45% { transform: scale(1.12); filter: brightness(1.3); }
  100% { transform: scale(1); filter: brightness(1); } }
.wk-streak-ring { width: 42px; height: 42px; flex-basis: 42px; }
.wk-streak-ring .streak-ring-center { width: 33px; height: 33px; }
.wk-streak-ring .streak-ring-center b { font-size: .8rem; }
.wk-streak-ring .streak-ring-center small { font-size: .46rem; }
.week-strip { gap: 0; }
.week-strip .wk-days { gap: 3px; }
.week-strip .wk-day { min-width: 0; }
.week-strip .wk-dot { flex: 0 0 21px; }
.week-strip .wk-lbl { white-space: nowrap; }
.wk-streak-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.streak-progress-content { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.streak-ring { --ring-pct: 0%; --ring-color: var(--accent); width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring-color) 0 var(--ring-pct), var(--bg-elev-2) var(--ring-pct) 100%); }
.streak-ring-center { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-elev);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.streak-ring-center b { font-size: .86rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.streak-ring-center small { margin-top: 2px; font-size: .5rem; color: var(--text-muted); font-weight: 700; }
.streak-progress-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.streak-progress-kicker { display: flex; align-items: center; gap: 4px; color: var(--text-faint); font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .55px; }
.streak-progress-kicker svg { width: 12px; height: 12px; color: var(--current-fire); fill: currentColor; flex: 0 0 auto; }
.streak-progress-copy strong { font-size: .82rem; line-height: 1.2; }
.streak-progress-copy small { color: var(--text-muted); font-size: .68rem; line-height: 1.25; }
.streak-detail-sheet { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.streak-detail-meter { display: flex; justify-content: center; padding: 10px 0 14px; }
.streak-progress-content.large { flex-direction: column; text-align: center; gap: 10px; }
.streak-progress-content.large .streak-ring { width: 94px; height: 94px; flex-basis: 94px; }
.streak-progress-content.large .streak-ring-center { width: 76px; height: 76px; }
.streak-progress-content.large .streak-ring-center b { font-size: 1.5rem; }
.streak-progress-content.large .streak-ring-center small { font-size: .66rem; }
.streak-progress-content.large .streak-progress-copy { align-items: center; gap: 6px; }
.streak-progress-content.large .streak-progress-kicker {
  color: var(--text-muted); font-size: .8rem; font-weight: 700;
  text-transform: none; letter-spacing: 0;
}
.streak-progress-content.large .streak-progress-kicker svg { width: 14px; height: 14px; }
.streak-progress-content.large .streak-progress-copy strong,
.streak-progress-content.large .streak-progress-copy small {
  max-width: 290px; font-size: .8rem; font-weight: 700; line-height: 1.35;
}
.streak-progress-content.large .streak-progress-copy strong { color: var(--text-muted); }
.streak-progress-content.large .streak-progress-copy small { color: var(--text-muted); }
.streak-record-line { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 16px; padding: 10px 12px; border-radius: 11px;
  background: var(--bg-elev-2); border: 1px solid var(--border); }
.streak-record-line > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.streak-record-line strong { color: var(--text); font-size: .74rem; }
.streak-record-line small { color: var(--text-muted); font-size: .66rem; line-height: 1.3; }
.streak-record-line > b { flex: 0 0 auto; color: var(--text); font-size: .82rem; white-space: nowrap; }
.streak-future-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.streak-future-card { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg-elev-2); }
.streak-future-card.next { background: var(--accent-soft); border-color: var(--accent); }
.streak-future-mark { display: grid; place-items: center; color: var(--seal-color); }
.streak-future-mark svg { width: 18px; height: 18px; fill: currentColor; }
.streak-future-mark.black svg,
.streak-future-card.black .streak-future-mark svg { filter: drop-shadow(0 0 4px rgba(163, 255, 18, .75)); }
.streak-future-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.streak-future-info strong { color: var(--text); font-size: .76rem; }
.streak-future-info small { color: var(--text-muted); font-size: .65rem; }
.streak-future-distance { color: var(--text-muted); font-size: .64rem; font-weight: 800; white-space: nowrap; }
.streak-future-card.black { background: linear-gradient(120deg, #101510, #1B2517); border-color: #A3FF12;
  box-shadow: 0 0 13px rgba(163, 255, 18, .18); }
.streak-future-card.black .streak-future-info strong { color: #D9FF66; }
.streak-future-card.black .streak-future-info small,
.streak-future-card.black .streak-future-distance { color: #E2F2C0; }
.streak-earned-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.streak-earned-card { cursor: default; }
.streak-no-seals { color: var(--text-muted); font-size: .76rem; }
.profile-streak-link { display: block; width: 100%; margin: 0 0 8px; padding: 10px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); color: var(--text); cursor: pointer; }

/* Editor de enquadramento da foto (cropper) */
.cropper {
  position: relative; width: 100%; max-width: 280px; aspect-ratio: 1 / 1;
  margin: 12px auto 0; border-radius: 16px; overflow: hidden; background: var(--bg-sunken);
}
.cropper canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.cropper canvas:active { cursor: grabbing; }
/* guia circular: escurece fora do circulo + aro fino, sem capturar toques */
.cropper-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75), 0 0 0 9999px rgba(0, 0, 0, 0.45);
}
.crop-zoom { width: 100%; margin-top: 14px; accent-color: var(--accent); }

/* ------------------------------------------------ Progresso / grafico */
.progress-stats { display: flex; gap: 8px; margin-bottom: 16px; }
/* calendario tem 4 blocos (sequencia + ano + tempo + mes): 1 linha so (nao 2x2, que dobra a
   altura) + ~20% menores, pra caber na tela do celular sem rolar junto com a grade de dias */
#cal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#cal-stats .stat { padding: 9px 3px; }
#cal-stats .stat-icon { font-size: 1rem; margin-bottom: 3px; }
#cal-stats .stat .v { font-size: 1.05rem; }
#cal-stats .stat .k { font-size: 0.56rem; }
.stat {
  flex: 1; background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 10px; text-align: center;
}
.stat-icon { display: block; font-size: 1.2rem; line-height: 1; margin-bottom: 5px; }
.stat .v { font-size: 1.3rem; font-weight: 800; letter-spacing: -.5px; }
.stat .k { font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }
.stat-sub { font-size: 0.62rem; font-weight: 600; color: var(--text-faint); margin-top: 4px; }
.chart-wrap { background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 10px 6px 10px; margin-bottom: 16px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.hist-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.hist-item:last-child { border-bottom: none; }
.hist-item .date { color: var(--text-muted); font-weight: 600; }
.hist-item .load { font-weight: 800; }
.month-record-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 10px; }
.month-record-row .date { min-width: 0; overflow-wrap: anywhere; }
.month-record-row .load { white-space: nowrap; font-size: .78rem; }

/* ------------------------------------------------ Toast */
.toast-root {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 1200;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: calc(100% - 40px); max-width: 360px;
}
.toast {
  background: var(--text); color: var(--bg);
  padding: 11px 18px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
/* variante com botao "Desfazer" (exclusao de check-in) */
.toast-undo { display: flex; align-items: center; justify-content: space-between; gap: 14px; pointer-events: auto; }
.toast-undo-btn {
  background: none; border: none; color: var(--accent);
  font-size: 0.85rem; font-weight: 800; cursor: pointer; padding: 0; flex-shrink: 0;
}

/* ------------------------------------------------ Action menu (⋯) */
.menu-list { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 6px; border: none; background: transparent;
  color: var(--text); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-align: left; border-bottom: 1px solid var(--border);
}
.menu-item:last-child { border-bottom: none; }
.menu-item .mi-icon { font-size: 1.2rem; width: 24px; text-align: center; }
.menu-item.danger { color: var(--danger); }

/* license footer */
.license-note {
  text-align: center; font-size: 0.72rem; color: var(--text-faint);
  margin-top: 20px; line-height: 1.5;
}

/* Portao de ativacao (bloqueia o app ate inserir a chave) */
.gate-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)) 24px;
}

/* Card de conclusao (compartilhavel) — tema "concluido" verde */
.cc {
  --cc: #22C55E; --cc-rgb: 34,197,94; --cc-g1: #132018; --cc-g2: #0b120d; /* padrao verde; sobrescrito inline */
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 18px 16px 14px; width: 100%; color: #fff;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(var(--cc-rgb), 0.40), transparent 62%),
    linear-gradient(170deg, var(--cc-g1), var(--cc-g2));
  border: 1px solid rgba(var(--cc-rgb), 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.cc-top { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.cc-photo {
  width: 76px; height: 76px; border-radius: 50%;
  border: 2.5px solid var(--cc); background: var(--bg-elev-2) center/cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.7rem; color: var(--cc); overflow: hidden;
  box-shadow: 0 0 0 4px rgba(var(--cc-rgb), 0.22);
}
.cc-photo-wrap { position: relative; width: 76px; height: 76px; margin-bottom: 2px; }
.cc-photo-wrap .cc-photo { width: 100%; height: 100%; }
.cc-photo-wrap > .streak-seal { right: -2px; bottom: -1px; width: 21px; height: 21px;
  border: 2px solid #101116; box-shadow: 0 1px 8px rgba(0,0,0,.5); }
.cc-photo-wrap > .streak-seal svg { width: 12px; height: 12px; }
.cc-milestone { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 9px 0 4px;
  padding: 8px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px;
  background: rgba(255,255,255,.07); animation: milestone-arrive .65s cubic-bezier(.2,1.5,.4,1) both; }
.cc-milestone-copy { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.cc-milestone-copy strong { color: var(--cc); font-size: .76rem; text-transform: uppercase; letter-spacing: .45px; }
.cc-milestone-copy small { color: rgba(255,255,255,.82); font-size: .68rem; font-weight: 700; }
.cc-milestone .streak-seal { position: static; flex: 0 0 22px; width: 22px; height: 22px; border-color: rgba(255,255,255,.5); }
.cc-milestone-unlocked .cc-photo-wrap > .streak-seal { animation: milestone-seal-pop .8s .12s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes milestone-arrive { from { opacity: 0; transform: translateY(-5px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes milestone-seal-pop { 0% { transform: scale(.5) rotate(-20deg); } 65% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .wk-streak-button.streak-ring-unlocked, .cc-milestone, .cc-milestone-unlocked .cc-photo-wrap > .streak-seal { animation: none; }
}
.cc-who { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.3px; }
.cc-did { font-size: 0.74rem; opacity: 0.75; }
.cc-banner { display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 8px 0 2px; font-weight: 800; font-size: 1rem; color: var(--cc); letter-spacing: -0.5px; }
.cc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
/* card do mes com sequencia: 3 tiles em vez de 2 (so quando ha sequencia >= 1 semana) */
.cc-stats.cc-stats-3 { grid-template-columns: repeat(3, 1fr); }
.cc-stat { flex: 1; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px; padding: 8px 6px; text-align: center; }
.cc-stat-icon { display: block; font-size: 0.92rem; line-height: 1; margin-bottom: 3px; }
.cc-stat .v { font-weight: 800; font-size: 0.98rem; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.cc-stat .k { font-size: 0.58rem; font-weight: 700; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 3px; }
/* Slot 3 do card: recorde(s) em destaque -- dourado fixo (cor de "medalha", nao a cor do tema) */
.cc-record {
  margin-top: 6px; border-radius: 13px; padding: 9px 11px; text-align: center;
  background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.45);
}
.cc-rec-tag { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.5px;
  text-transform: uppercase; color: #FBBF24; }
/* titulo do slot no card do MES ("RECORDES DO MES"): maior, chama atencao -- distinto do
   .cc-rec-tag pequeno usado no card de 1 treino, pra nao bagunçar o que ja funcionava la */
.cc-rec-title { font-size: 0.86rem; font-weight: 800; letter-spacing: -0.2px;
  text-transform: uppercase; color: #FBBF24; }
.cc-rec-main { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.3px; margin-top: 3px; line-height: 1.25; }
.cc-rec-delta { font-size: 0.95rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cc-rec-arrow { color: #FBBF24; font-weight: 800; margin: 0 5px; }
.cc-rec-extra { font-size: 0.68rem; font-weight: 700; opacity: 0.7; margin-left: 8px; }
/* Card do MES: zona 1 (contagem por tipo, 2 colunas) */
.cc-rec-counts { display: flex; gap: 6px; margin-top: 6px; }
.cc-rec-count-box { flex: 1; background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 6px 6px; text-align: center; }
.cc-rec-count-label { font-size: 0.66rem; font-weight: 700; color: var(--text-muted); }
.cc-rec-count-num { font-size: 1.15rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cc-rec-count-sub { font-size: 0.56rem; font-weight: 700; color: var(--done); margin-top: 1px; }
.cc-rec-divider { height: 1px; background: rgba(251, 191, 36, 0.25); margin: 6px 0; }
/* Card do MES: zona 2 (maiores evolucoes -- 1 card completo por tipo) */
.cc-rec-evo { background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 6px 9px; margin-top: 5px; text-align: left; }
.cc-rec-evo-tag { font-size: 0.56rem; font-weight: 800; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; }
.cc-rec-evo-name { font-size: 0.8rem; font-weight: 800; margin-top: 2px; }
.cc-rec-evo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.cc-rec-evo-nums { font-size: 0.82rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-rec-evo-badge { background: var(--done-soft); color: var(--done); font-weight: 800; font-size: 0.68rem; padding: 3px 7px; border-radius: 999px; white-space: nowrap; }
.cc-rec-total { text-align: center; font-size: 0.6rem; color: var(--text-faint); margin-top: 6px; }
.cc-record.is-none { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
.cc-record.is-none .cc-rec-main { font-size: 0.98rem; opacity: 0.92; font-weight: 700; }
.cc-date { text-align: center; font-size: 0.72rem; opacity: 0.6; margin-top: 14px; text-transform: capitalize; }
.cc-mark { display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.cc-mark .m { padding: 3px 7px; border-radius: 7px; font-size: 0.68rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  display: flex; align-items: center; justify-content: center; letter-spacing: -0.3px; }
.cc-mark .t { font-size: 0.72rem; opacity: 0.8; font-weight: 700; }

/* Confete (sutil) no card de conclusao */
.confetti-piece {
  position: absolute; top: 6px; width: 8px; height: 11px; border-radius: 2px;
  opacity: 0; pointer-events: none; z-index: 2; will-change: transform, opacity;
}
@keyframes confetti-fall {
  0% { opacity: 0; transform: translateY(-8px) translateX(0) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--cf-dist, 160px)) translateX(var(--cf-x, 0)) rotate(var(--cf-rot, 360deg)); }
}

/* Swatches de cor do card (Configuracoes) */
.swatch { width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s ease; }
.swatch.active { outline-color: var(--text); }

/* Resumo da semana (topo) — clicavel: abre o calendario */
.week-strip {
  position: relative;
  display: flex; flex-direction: column; gap: 0;
  margin-bottom: 14px; padding: 11px 14px;
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
  border: 0; border-radius: 17px;
  cursor: pointer; transition: background-color .15s ease;
}
.week-strip::before {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--border);
  border-radius: inherit; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 94%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 94%);
}
.week-strip::after {
  content: ""; position: absolute; left: 5%; right: 5%; bottom: 0; height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--border) 9%, var(--border) 91%, transparent);
  pointer-events: none;
}
.week-strip:active { background-color: rgba(255,255,255,.025); }
.wk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wk-chev { color: var(--text-faint); font-size: 1.1rem; font-weight: 800; line-height: 1; }
.wk-title { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.wk-count { color: var(--done); font-weight: 800; font-size: 1.05rem; }
/* 7 dias distribuidos por igual ocupando toda a largura (flex:1 em cada) */
.wk-days { display: flex; gap: 6px; }
.wk-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wk-dot { width: 21px; height: 21px; border-radius: 50%; background: var(--bg-sunken);
  border: 1px solid var(--border); transition: all .2s ease; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 800; color: #fff; line-height: 1; }
/* dia so com corrida (sem letra de treino): emoji sozinho fica pequeno/apagado no mesmo
   tamanho usado pra letras -> aumenta so nesse caso, sem mexer no tamanho do circulo */
.wk-dot.run-only { font-size: 0.95rem; }
/* selo pequeno no canto: indica que, alem do que preenche o circulo (letra ou atividade mais longa),
   houve mais 1 atividade avulsa no mesmo dia. .b2 = 2a atividade extra, canto espelhado (inferior-esquerdo) */
.wk-run-badge {
  position: absolute; top: 3px; right: 3px; transform: translate(50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-elev); border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 7px; line-height: 1;
}
.wk-run-badge.b2 { top: auto; right: auto; bottom: 3px; left: 3px; transform: translate(-50%, 50%); }
/* dia treinado = mesmo tratamento do dot "feito" usado no calendario (--done-dot-*) */
.wk-day.done .wk-dot { background: var(--done-dot-bg); border-color: var(--done-dot-bg); color: var(--done-dot-text);
  box-shadow: 0 0 7px var(--done-dot-glow); }
.wk-day.today .wk-dot { box-shadow: 0 0 0 2px var(--accent); }
.wk-day.today.done .wk-dot { box-shadow: 0 0 0 2px var(--accent), 0 0 7px var(--done-dot-glow); }
.wk-lbl { font-size: 0.6rem; font-weight: 800; color: var(--text-faint); text-transform: uppercase; }
.wk-day.done .wk-lbl { color: var(--done-dot-bg); }
.wk-day.today .wk-lbl { color: var(--text); }

/* ------------------------------------------------ Calendario de treino */
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 10px; }
.cal-title { font-size: 1rem; font-weight: 800; text-transform: capitalize; }
.cal-arrow {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--bg-elev-2); color: var(--text);
  font-size: 1.3rem; font-weight: 700; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; transition: all .15s ease;
}
.cal-arrow:active { transform: scale(.94); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 0.58rem; font-weight: 800; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .3px; padding-bottom: 4px; }
/* cada dia = circulo (preenchido com a letra do treino quando feito) + numero embaixo */
/* min-height fixo + sempre 6 semanas (preenchidas no JS) = grade de altura constante,
   pra as setas de mes nao "pularem" ao avancar/recuar */
.cal-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 0; min-height: 56px; }
.cal-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800; line-height: 1; color: #fff;
  background: transparent; border: 1.5px solid var(--border); transition: all .15s ease;
  position: relative;
}
/* dia so com corrida (sem letra de treino): emoji sozinho fica pequeno/apagado no mesmo
   tamanho usado pra letras -> aumenta so nesse caso, sem mexer no tamanho do circulo */
.cal-dot.run-only { font-size: 1.3rem; }
/* selo pequeno no canto: indica que, alem do que preenche o circulo (letra ou atividade mais longa),
   houve mais 1 atividade avulsa no mesmo dia. .b2 = 2a atividade extra, canto espelhado (inferior-esquerdo) */
.cal-run-badge {
  position: absolute; top: 4px; right: 4px; transform: translate(50%, -50%);
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg-elev); border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; line-height: 1;
}
.cal-run-badge.b2 { top: auto; right: auto; bottom: 4px; left: 4px; transform: translate(-50%, 50%); }
.cal-cell.trained { cursor: pointer; }
.cal-cell.trained .cal-dot { background: var(--done-dot-bg); border-color: var(--done-dot-bg); color: var(--done-dot-text); box-shadow: 0 0 8px var(--done-dot-glow); }
.cal-cell.today .cal-dot { box-shadow: 0 0 0 2px var(--accent); }
.cal-cell.today.trained .cal-dot { box-shadow: 0 0 0 2px var(--accent), 0 0 8px var(--done-dot-glow); }
[data-theme="green"] .cal-sheet .cal-cell.trained .cal-dot {
  background: #064E3B; border-color: #064E3B; color: #FFFFFF;
  box-shadow: 0 0 9px rgba(6, 78, 59, .24);
}
[data-theme="color"] .cal-sheet .cal-cell.trained .cal-dot {
  background: #3B1B63; border-color: #3B1B63; color: #FFFFFF;
  box-shadow: 0 0 9px rgba(59, 27, 99, .24);
}
[data-theme="blue"] .cal-sheet .cal-cell.trained .cal-dot {
  background: #12305D; border-color: #12305D; color: #FFFFFF;
  box-shadow: 0 0 9px rgba(18, 48, 93, .24);
}
[data-theme="green"] .cal-sheet .cal-cell.today.trained .cal-dot,
[data-theme="color"] .cal-sheet .cal-cell.today.trained .cal-dot,
[data-theme="blue"] .cal-sheet .cal-cell.today.trained .cal-dot {
  box-shadow: 0 0 0 2px var(--accent), 0 0 9px rgba(0, 0, 0, .18);
}
[data-theme="green"] .cal-sheet .cal-cell:not(.trained) .cal-dot { border-color: rgba(6, 95, 70, .24); }
[data-theme="color"] .cal-sheet .cal-cell:not(.trained) .cal-dot { border-color: rgba(91, 33, 182, .24); }
[data-theme="blue"] .cal-sheet .cal-cell:not(.trained) .cal-dot { border-color: rgba(29, 78, 216, .24); }
.cal-day-num { font-size: 0.62rem; line-height: 1; font-weight: 700; color: var(--text-faint); }
.cal-cell.trained .cal-day-num { color: var(--text); }
.cal-cell.today .cal-day-num { color: var(--accent); }
.cal-hint { text-align: center; font-size: 0.68rem; color: var(--text-faint); margin-top: 12px; }
/* botoes grandes do resumo do mes: icone em cima, rotulo embaixo (mesmo peso visual pros 2) */
.cal-actions { display: flex; gap: 10px; }
.cal-action-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 8px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-elev-2);
  color: var(--text); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: all .15s ease;
}
.cal-action-btn:active { transform: scale(.97); background: var(--bg-elev); }
.cal-action-btn .ic { font-size: 1.6rem; line-height: 1; }

/* Calendario — visual "com respiro": titulo, indicadores, mes e botoes em blocos separados.
   Escopo so na folha do calendario (.cal-sheet); nao mexe nas outras folhas. */
.cal-sheet {
  padding: 12px 20px calc(28px + env(safe-area-inset-bottom)) 20px;
  border-top-left-radius: 36px; border-top-right-radius: 36px;
}
.cal-sheet .sheet-handle { margin-bottom: 22px; }
.cal-sheet .sheet-title { text-align: center; font-size: 1.1rem; margin-bottom: 28px; }
.cal-sheet #cal-stats { gap: 10px; margin-bottom: 18px; }
.cal-sheet #cal-stats .stat { padding: 14px 4px 12px; border-radius: 16px; }
.cal-sheet #cal-stats .stat-icon { font-size: 1.1rem; margin-bottom: 7px; }
.cal-sheet #cal-stats .stat .v { font-size: 1.12rem; }
.cal-sheet #cal-stats .stat .k { font-size: 0.58rem; margin-top: 4px; }
.cal-card {
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 18px; padding: 16px 12px 14px; margin-bottom: 18px;
}
.cal-card .cal-nav { margin: 0 0 16px; padding: 0 2px; }
.cal-card .cal-arrow { border-radius: 50%; background: var(--bg-elev); }
.cal-card .cal-grid { gap: 2px; }
.cal-card .cal-wd { padding-bottom: 8px; }
.cal-card .cal-cell { min-height: 50px; }
.cal-card .cal-hint { margin-top: 12px; padding: 0 6px; line-height: 1.4; }
.cal-sheet .cal-actions { gap: 12px; margin-bottom: 12px; }
.cal-sheet .cal-action-btn { padding: 16px 8px; border-radius: 16px; background: var(--bg-sunken); }
[data-theme="green"] .cal-sheet #cal-stats .stat,
[data-theme="green"] .cal-sheet .cal-action-btn {
  background: #D4E9DB;
  border-color: rgba(6, 95, 70, .22);
}
[data-theme="green"] .cal-sheet .cal-card {
  background: #CDE4D4;
  border-color: rgba(6, 95, 70, .22);
}
[data-theme="green"] .cal-sheet .cal-cell:not(.trained) .cal-dot {
  border-color: rgba(6, 95, 70, .24);
}

/* valores de duracao longos (ex: 10h58): mesma altura de linha dos vizinhos + fonte um pouco menor,
   pra nao "pesarem" mais que os outros numeros. Calendario, Ver resumo e Compartilhar. */
.stat .v { line-height: 1.7rem; }
.stat .v.dur-long { font-size: 1.12rem; }
.cal-sheet #cal-stats .stat .v { line-height: 1.5rem; }
.cal-sheet #cal-stats .stat .v.dur-long { font-size: 0.96rem; }
.cc-stat .v { line-height: 1.3rem; }
.cc-stat .v.dur-long { font-size: 0.84rem; }

/* icone do spinning (SVG proprio, silhueta): acompanha o tamanho do texto/emoji ao redor */
.spin-ic { width: 1em; height: 1em; vertical-align: -0.14em; }
.hist-item .spin-ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.cal-dot .spin-ic, .wk-dot .spin-ic, .day-sess-letter .spin-ic, .modal-icon .spin-ic { vertical-align: middle; }
/* o selinho de canto tem fundo proprio (claro nos temas claros): cor de texto em vez de herdar do ponto */
.cal-run-badge, .wk-run-badge { color: var(--text); }
.cal-run-badge .spin-ic { width: 11px; height: 11px; vertical-align: middle; }
.wk-run-badge .spin-ic { width: 9px; height: 9px; vertical-align: middle; }
.day-sess-letter .spin-ic { width: 16px; height: 16px; }
.mi-icon .spin-ic, .modal-icon .spin-ic, .cal-dot.run-only .spin-ic, .wk-dot.run-only .spin-ic { width: 1.2em; height: 1.2em; }

/* Resumo dos treinos de um dia (toque num dia do calendario) */
.day-sess {
  background: var(--bg-elev-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px;
}
.day-sess-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-sess-name { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); min-width: 0; }
.day-sess-letter {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--done-dot-bg); color: var(--done-dot-text); font-weight: 800; font-size: 0.8rem;
}
.day-sess-letter.run { background: var(--accent); color: #fff; font-size: 0.72rem; }
.day-sess-time { flex-shrink: 0; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
.day-sess-stats { font-size: 0.78rem; color: var(--text-muted); margin: 8px 0 10px; }
.day-sess-actions { display: flex; gap: 8px; }
.day-sess-edit, .day-sess-del { flex: 1; font-size: 0.82rem; }
.day-sess-edit { color: var(--accent); }
.day-sess-del { color: var(--danger); }

@media (max-width: 360px) {
  .streak-progress-content { gap: 7px; }
  .streak-ring { width: 42px; height: 42px; flex-basis: 42px; }
  .streak-ring-center { width: 33px; height: 33px; }
  .wk-layout { grid-template-columns: minmax(0, 1fr) 49px; gap: 5px; }
  .wk-streak-side { padding: 0 0 0 5px; }
  .wk-streak-button { width: 40px; height: 40px; }
  .wk-streak-ring { width: 38px; height: 38px; flex-basis: 38px; }
  .wk-streak-ring .streak-ring-center { width: 30px; height: 30px; }
  .week-strip .wk-days { gap: 2px; }
  .rest-time { font-size: 1.7rem; }
}
