/* KORVFIT: visual do app (pensado primeiro para o celular) */

:root {
  --bg: #0A0B0C;
  --bg-2: #0F1012;
  --surface: #15171A;
  --surface-2: #1C1F23;
  --surface-3: #252930;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #FCFCFC;
  --text-2: #C9CDD2;
  --muted: #858B93;
  --lime: #DEFC38;
  --lime-soft: #E8FD95;
  --lime-grad: linear-gradient(120deg, #E8FD95 0%, #DEFC38 100%);
  --lime-glow: rgba(222, 252, 56, 0.35);
  --on-lime: #0A0B0C;
  --danger: #FF5A5F;

  --radius-s: 12px;
  --radius: 18px;
  --radius-l: 26px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
  --app-w: 520px;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { overflow: hidden; }

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

img { display: block; max-width: 100%; }

button, a, .pressable { touch-action: manipulation; user-select: none; -webkit-user-select: none; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 8px; }

/* Efeito de "apertar" em tudo que é tocável */
.pressable, .btn, .tab, .btn-google { transition: transform 140ms var(--ease-out), opacity 140ms; }
.pressable:active, .btn:active, .btn-google:active { transform: scale(0.97); }

/* No computador, o app fica numa coluna do tamanho de um celular */
.app {
  position: relative;
  height: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  overflow: hidden;
  background: var(--bg);
}
@media (min-width: 560px) {
  body {
    background:
      radial-gradient(600px 400px at 50% 0%, rgba(222, 252, 56, 0.06), transparent 70%),
      #050506;
  }
  .app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* ---------------- Tela de entrada ---------------- */

.screen-login {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12vh) 28px calc(var(--safe-bottom) + 36px);
  overflow: hidden;
}

.login-glow {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(222, 252, 56, 0.22) 0%, rgba(222, 252, 56, 0.05) 40%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 0%, transparent 65%);
  pointer-events: none;
}

.brand { position: relative; display: flex; flex-direction: column; align-items: center; }

.brand-k { position: relative; width: 132px; aspect-ratio: 347 / 353; }
.brand-k img { position: absolute; inset: 0; width: 100%; height: 100%; }
.k-lime { filter: drop-shadow(0 0 18px var(--lime-glow)); }

/* Brilho que passa por cima do K */
.k-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%);
  background-size: 300% 100%;
  -webkit-mask: url(/img/k-lime.png) center / 100% 100% no-repeat;
  mask: url(/img/k-lime.png) center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
}

.brand-word { position: relative; width: 230px; aspect-ratio: 832 / 123; margin-top: 34px; }
.brand-word img { position: absolute; inset: 0; width: 100%; height: 100%; }

.brand-tagline {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.01em;
  text-align: center;
}
.brand-tagline span { color: var(--lime-soft); }

.login-actions { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 14px; }

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 58px;
  border-radius: 16px;
  background: var(--text);
  color: #111;
  font-weight: 650;
  font-size: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}
.btn-google svg { width: 22px; height: 22px; }

.login-note { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------------- Estrutura do app ---------------- */

.shell { position: absolute; inset: 0; display: flex; flex-direction: column; }

.topbar {
  position: relative;
  z-index: 5;
  padding-top: var(--safe-top);
  background: linear-gradient(var(--bg) 70%, rgba(10, 11, 12, 0));
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
}
.page-title { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }

.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--lime);
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-avatar .avatar-fallback { border: 0; font-size: 16px; }

.view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 8px 20px calc(var(--tabbar-h) + var(--safe-bottom) + 110px);
  outline: none;
}

/* Menu de baixo */
.tabbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 10px);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--tabbar-h);
  padding: 6px;
  border-radius: 24px;
  background: rgba(21, 23, 26, 0.82);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 220ms var(--ease-out);
}
.tab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 260ms var(--ease-spring);
}
.tab.active { color: var(--on-lime); }
.tab.active svg { transform: translateY(-1px) scale(1.06); }
.tab:active svg { transform: scale(0.88); }

.tab-indicator {
  position: absolute;
  top: 6px;
  left: 6px;
  bottom: 6px;
  width: calc((100% - 12px) / 4);
  border-radius: 18px;
  background: var(--lime-grad);
  box-shadow: 0 6px 24px rgba(222, 252, 56, 0.28);
  will-change: transform;
}

/* ---------------- Componentes ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 16px;
}
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--lime-grad); color: var(--on-lime); box-shadow: 0 8px 26px rgba(222, 252, 56, 0.22); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(255, 90, 95, 0.12); color: var(--danger); border: 1px solid rgba(255, 90, 95, 0.25); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Saudação */
.hello { margin: 4px 0 22px; }
.hello h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.01em; }
.hello p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Estado vazio / em construção */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 34px 22px;
  border-radius: var(--radius-l);
  background:
    radial-gradient(300px 160px at 50% 0%, rgba(222, 252, 56, 0.08), transparent 70%),
    var(--surface);
  border: 1px solid var(--border);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: rgba(222, 252, 56, 0.1);
  color: var(--lime);
}
.empty-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty h3 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 280px; }

.pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  margin-top: 16px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

/* Perfil */
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 26px; }
.avatar-ring {
  position: relative;
  width: 108px;
  height: 108px;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--lime), var(--lime-soft), rgba(222, 252, 56, 0.15), var(--lime));
}
.avatar-ring img, .avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  background: var(--surface-2);
}
.avatar-fallback { display: grid; place-items: center; font-size: 38px; font-weight: 800; color: var(--lime); }
.profile-head h2 { margin: 16px 0 4px; font-size: 22px; font-weight: 750; }
.profile-head p { margin: 0; color: var(--muted); font-size: 14px; }

.list { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 16px; }
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row .row-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--lime);
}
.list-row .row-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.list-row .row-text { flex: 1; min-width: 0; }
.list-row .row-title { font-size: 15px; font-weight: 600; }
.list-row .row-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.install-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  padding: 20px;
  background:
    radial-gradient(260px 180px at 100% 0%, rgba(222, 252, 56, 0.2), transparent 70%),
    var(--surface-2);
  border: 1px solid rgba(222, 252, 56, 0.25);
}
.install-card h3 { margin: 0 0 6px; font-size: 18px; }
.install-card p { margin: 0 0 16px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.install-card ol { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.install-card b { color: var(--text); }

.version { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; }

/* Esqueleto de carregamento */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* ---------------- Gaveta de baixo (bottom sheet) ---------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 51;
  width: 100%;
  max-width: var(--app-w);
  max-height: 88vh;
  overflow-y: auto;
  transform: translateX(-50%);
  padding: 10px 20px calc(var(--safe-bottom) + 22px);
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  overscroll-behavior: contain;
}
.sheet-grab { position: sticky; top: -10px; z-index: 2; margin: -10px -20px 6px; padding: 12px 0 14px; touch-action: none; cursor: grab; background: linear-gradient(var(--surface) 70%, rgba(21, 23, 26, 0)); }
.sheet-handle { width: 42px; height: 5px; margin: 0 auto; border-radius: 99px; background: var(--surface-3); }
.sheet h3 { margin: 0 0 8px; font-size: 20px; }
.sheet p { margin: 0 0 20px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.sheet .stack { gap: 10px; }

/* ---------------- Avisos (toasts) ---------------- */

.toasts {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 12px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 440px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(28, 31, 35, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 600;
}
.toast-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.toast.error .toast-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }

/* Quem pediu para reduzir animações no celular */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ================= Parte 4B: treinos e exercícios ================= */

.topbar-inner { gap: 10px; }
.page-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-title.small { font-size: 22px; }

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#topbar-back { margin-left: -6px; }

/* Botão flutuante "+" */
.fab {
  position: absolute;
  right: 20px;
  bottom: calc(var(--safe-bottom) + var(--tabbar-h) + 26px);
  z-index: 9;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 22px;
  background: var(--lime-grad);
  color: var(--on-lime);
  box-shadow: 0 12px 30px rgba(222, 252, 56, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 160ms var(--ease-out);
}
.fab:active { transform: scale(0.92); }
.fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

/* Cartão de treino */
.workout-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 140ms var(--ease-out), border-color 200ms;
}
.workout-card:active { transform: scale(0.98); border-color: rgba(222, 252, 56, 0.3); }
.workout-card.today { border-color: rgba(222, 252, 56, 0.35); background: radial-gradient(260px 140px at 100% 0%, rgba(222, 252, 56, 0.09), transparent 70%), var(--surface); }
.workout-card .wc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.workout-card h3 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.workout-card .wc-sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.workout-card .wc-arrow { flex: none; width: 22px; height: 22px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.today-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: var(--lime); color: var(--on-lime); font-size: 11px; font-weight: 800; vertical-align: 3px; letter-spacing: 0.04em; }

.day-dots { display: flex; gap: 6px; margin-top: 16px; }
.day-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.day-dot.on { background: var(--lime-grad); color: var(--on-lime); box-shadow: 0 0 14px rgba(222, 252, 56, 0.25); }
.day-dot.is-today { outline: 1.5px solid var(--lime); outline-offset: 2px; }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.field > label, .field-label { font-size: 13px; font-weight: 650; color: var(--text-2); letter-spacing: 0.01em; }
.input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  color: var(--text);
  font-size: 17px;
  font-family: inherit;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}
.input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(222, 252, 56, 0.15); }
.input::placeholder { color: #5b6067; }
textarea.input { height: auto; min-height: 80px; padding: 14px 16px; resize: none; line-height: 1.4; }

.day-toggles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-toggle {
  height: 50px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  transition: background 180ms, color 180ms, transform 140ms var(--ease-out);
}
.day-toggle:active { transform: scale(0.92); }
.day-toggle.on { background: var(--lime-grad); color: var(--on-lime); border-color: transparent; }

.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.switch { position: relative; width: 52px; height: 32px; border-radius: 99px; background: var(--surface-3); transition: background 200ms; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform 260ms var(--ease-spring); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch.on { background: var(--lime); }
.switch.on::after { transform: translateX(20px); }

/* Botões de − e + (stepper) */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: transform 120ms var(--ease-out), background 160ms, opacity 160ms;
}
.stepper-btn:active { transform: scale(0.9); background: var(--surface-3); }
.stepper-btn:disabled { opacity: 0.35; }
.stepper-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.stepper-btn.plus { background: rgba(222, 252, 56, 0.12); border-color: rgba(222, 252, 56, 0.35); color: var(--lime); }
.stepper-value {
  flex: 1;
  min-width: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.stepper-value input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 0;
}
.stepper-value input::placeholder { color: #5b6067; font-size: 15px; font-weight: 600; }
.stepper-value .unit { flex: none; color: var(--muted); font-size: 14px; font-weight: 600; padding-right: 12px; }
.stepper-value:focus-within { border-color: var(--lime); }

/* Cabeçalho do treino */
.wk-head { margin: 0 0 18px; }
.wk-head .day-dots { margin-top: 0; }
.wk-head .wk-meta { margin-top: 12px; color: var(--muted); font-size: 14px; }

/* Cartão de exercício */
.ex-list { display: flex; flex-direction: column; gap: 12px; }
.ex-card {
  position: relative;
  padding: 16px 16px 14px;
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow 200ms, border-color 200ms;
}
.ex-card.dragging { z-index: 20; border-color: rgba(222, 252, 56, 0.5); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(222, 252, 56, 0.3); }
.ex-top { display: flex; align-items: flex-start; gap: 10px; }
.ex-handle {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 40px;
  margin: -4px 0 0 -8px;
  border-radius: 10px;
  color: #5b6067;
  touch-action: none;
  cursor: grab;
}
.ex-handle svg { width: 18px; height: 18px; fill: currentColor; }
.ex-info { flex: 1; min-width: 0; }
.ex-name { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ex-scheme { margin-top: 3px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.ex-scheme b { color: var(--lime-soft); }
.ex-notes { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.ex-status {
  flex: none;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  background: var(--surface-3);
  color: var(--text-2);
  opacity: 0;
}
.ex-status.saved { background: rgba(222, 252, 56, 0.14); color: var(--lime); }
.ex-status.error { background: rgba(255, 90, 95, 0.14); color: var(--danger); }
.ex-weight { margin-top: 14px; }
.ex-weight .stepper-value input { font-size: 26px; color: var(--lime); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 12px; }
.section-title h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-2); letter-spacing: 0.02em; }
.section-title span { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 18px 0 0; }

/* ================= Parte 4C: Hoje e Evolução ================= */

/* Botões de alternar (segmentado) */
.seg { display: flex; gap: 6px; padding: 5px; margin-bottom: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-btn { flex: 1 0 auto; min-height: 42px; padding: 0 14px; border-radius: 12px; color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; transition: background 220ms var(--ease-out), color 220ms; }
.seg-btn.on { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.seg-btn:active { transform: scale(0.96); }

/* Marcar exercício como feito */
.ex-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  margin: -3px 0 0 -4px;
  border-radius: 50%;
  border: 2px solid var(--surface-3);
  color: transparent;
  transition: background 220ms, border-color 220ms, color 220ms;
}
.ex-check svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ex-check.done { background: var(--lime-grad); border-color: transparent; color: var(--on-lime); box-shadow: 0 0 16px rgba(222, 252, 56, 0.35); }
.ex-card.is-done { border-color: rgba(222, 252, 56, 0.22); }
.ex-card.is-done .ex-name { color: var(--text-2); text-decoration: line-through; text-decoration-color: rgba(222, 252, 56, 0.6); text-decoration-thickness: 2px; }

/* Cartão de progresso do treino de hoje */
.today-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-l);
  background: radial-gradient(280px 160px at 100% 0%, rgba(222, 252, 56, 0.12), transparent 70%), var(--surface);
  border: 1px solid rgba(222, 252, 56, 0.22);
  transition: border-color 300ms;
}
.today-card.complete { border-color: rgba(222, 252, 56, 0.6); box-shadow: 0 0 30px rgba(222, 252, 56, 0.12); }
.today-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.today-name { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.progress { height: 10px; margin-top: 16px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--lime-grad); transform-origin: left center; transform: scaleX(0); box-shadow: 0 0 12px rgba(222, 252, 56, 0.4); }
.progress-text { display: flex; justify-content: space-between; margin-top: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.progress-text b { color: var(--text); }
.today-trophy { position: absolute; right: 18px; bottom: 44px; color: var(--lime); opacity: 0.9; }
.today-trophy svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.link-btn { display: block; margin: 18px auto 0; padding: 10px 14px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Dia de descanso */
.next-card, .pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 140ms var(--ease-out);
}
.next-card:active, .pick-row:active { transform: scale(0.98); }
.next-card .eyebrow { margin-bottom: 4px; }
.next-name { font-size: 19px; font-weight: 750; margin-bottom: 2px; }
.next-card .muted, .pick-row .muted { font-size: 14px; }
.pick-row { background: var(--surface-2); }

/* Blocos de números (evolução) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles > .tile-hero:first-child:nth-last-child(3) { grid-column: 1 / -1; }
.tiles.four { grid-template-columns: 1fr 1fr; margin-top: 12px; }
.tile { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.tile-hero { background: radial-gradient(240px 120px at 100% 0%, rgba(222, 252, 56, 0.14), transparent 70%), var(--surface); border-color: rgba(222, 252, 56, 0.25); }
.tile-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.tile-value { margin-top: 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-hero .tile-value { color: var(--lime); }
.tile-sub { margin-top: 2px; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.evo-list .evo-row + .evo-row { border-top: 1px solid var(--border); }
.evo-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 70px; padding: 12px 16px; text-align: left; transition: background 160ms; }
.evo-row:active { background: var(--surface-2); }
.evo-main { flex: 1; min-width: 0; }
.evo-name { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evo-sub { font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.evo-weight { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.evo-badge { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 750; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.evo-badge.up { background: rgba(222, 252, 56, 0.13); color: var(--text); }
.evo-badge.up .evo-icon { color: var(--lime); }
.evo-badge.down .evo-icon { color: var(--muted); }
.evo-badge.none { color: var(--muted); font-weight: 600; }
.evo-icon { display: flex; }
.evo-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }

.evo-head { margin: 0 0 14px; font-size: 14px; }

/* Gráfico */
.chart-card { padding: 16px 12px 10px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--border); }
.chart-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 6px 6px; font-size: 14px; font-weight: 700; }
.chart-title .muted { font-size: 12px; font-weight: 500; text-align: right; }
.chart { position: relative; width: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; overflow: visible; }
.chart-grid line { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart-grid text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke: var(--lime); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(222, 252, 56, 0.35)); }
.chart-dot { fill: var(--lime); stroke: var(--surface); stroke-width: 2; }
.chart-end { fill: var(--text); font-size: 13px; font-weight: 800; font-family: var(--font); }
.chart-guide { stroke: rgba(255, 255, 255, 0.25); stroke-width: 1; }
.chart-focus { fill: var(--lime); stroke: var(--surface); stroke-width: 3; }
.chart-tip {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(37, 41, 48, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  white-space: nowrap;
}
.chart-tip b { font-size: 16px; color: var(--text); }
.chart-tip span { font-size: 12px; color: var(--text-2); }

/* Links legais e exclusão de conta (discreta) */
.login-note { line-height: 1.6; }
.login-note a, .legal-links a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.legal-links { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.version { margin-top: 10px; }
.quiet-link { display: block; margin: 2px auto 0; padding: 8px 12px; color: #4d5258; font-size: 12px; font-weight: 500; }
.quiet-link:active { color: var(--danger); }
.btn:disabled { opacity: 0.4; }

/* ================= Fase 2, pacote A: treino em andamento ================= */

.session-block { margin-top: 16px; }
.start-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.last-session { margin-top: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.session-live { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: 0.3; transform: scale(0.8); } }
.session-clock { margin: 4px 0 14px; text-align: center; font-size: 44px; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.today-card.live { border-color: rgba(222, 252, 56, 0.5); }

/* Bolinha na aba Hoje quando tem treino rolando */
.tab.live::after { content: ''; position: absolute; top: 8px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px var(--lime); animation: livePulse 1.4s ease-in-out infinite; }
.tab.active.live::after { background: var(--on-lime); box-shadow: none; }

/* Séries */
.sets-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.set-dots { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.set-dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 13px; font-weight: 800; transition: background 200ms, color 200ms; }
.set-dot.on { background: var(--lime-grad); color: var(--on-lime); box-shadow: 0 0 10px rgba(222, 252, 56, 0.3); }
.set-btn { flex: none; min-height: 48px; padding: 0 16px; background: var(--lime-grad); color: var(--on-lime); font-size: 15px; }
.set-btn.finished { background: rgba(222, 252, 56, 0.12); color: var(--lime); }

/* Barra de descanso */
.rest-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + var(--tabbar-h) + 20px);
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 22px;
  background: rgba(28, 31, 35, 0.94);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(222, 252, 56, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(222, 252, 56, 0.1);
}
.rest-bar.done { border-color: var(--lime); background: rgba(40, 46, 20, 0.96); }
.rest-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rest-ring-wrap { flex: none; width: 46px; height: 46px; }
.rest-ring { width: 100%; height: 100%; }
.rest-ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 5; }
.rest-ring-fg { fill: none; stroke: var(--lime); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 250ms linear; }
.rest-label { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.rest-time { font-size: 26px; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rest-bar.done .rest-time { color: var(--lime); }
.rest-actions { display: flex; gap: 6px; flex: none; }
.rest-btn { min-width: 46px; height: 44px; padding: 0 10px; border-radius: 14px; background: var(--surface-3); color: var(--text); font-size: 14px; font-weight: 800; transition: transform 120ms var(--ease-out); }
.rest-btn:active { transform: scale(0.92); }
.rest-btn.skip { background: rgba(222, 252, 56, 0.14); color: var(--lime); }
@media (max-width: 360px) { .rest-btn { min-width: 40px; padding: 0 6px; } .rest-label { max-width: 90px; } }

/* Com a barra de descanso aberta, o botão + sobe um pouco */
.shell:has(.rest-bar:not([hidden])) .fab { bottom: calc(var(--safe-bottom) + var(--tabbar-h) + 104px); }

/* Resumo do treino */
.summary { text-align: center; }
.summary-badge { display: grid; place-items: center; width: 72px; height: 72px; margin: 6px auto 14px; border-radius: 24px; background: var(--lime-grad); color: var(--on-lime); box-shadow: 0 10px 30px rgba(222, 252, 56, 0.3); }
.summary-badge svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.summary h3 { margin-bottom: 2px; }
.summary > p { margin: 0; }
.summary-time { margin: 14px 0 18px; font-size: 46px; font-weight: 850; letter-spacing: -0.02em; color: var(--lime); }
.summary .tiles { text-align: left; }
.summary-ups { margin-top: 16px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); text-align: left; }
.up-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 15px; }
.up-row:first-of-type { border-top: 0; }
.up-row b { color: var(--text); white-space: nowrap; }
.summary-tip { margin-top: 16px !important; color: var(--muted); font-size: 14px; }
.field-hint { color: var(--muted); font-weight: 500; }
