/* =====================================================================
   NÃO VAI DOER — estilo base
   Tema escuro atlético · acento verde-limão · mobile-first
   ===================================================================== */

:root {
  --bg:        #0c0d10;
  --bg-soft:   #131419;
  --surface:   #181a21;
  --surface-2: #1f2230;
  --line:      rgba(255,255,255,.08);
  --line-2:    rgba(255,255,255,.14);

  --text:      #f3f4f6;
  --text-dim:  #9aa1ad;
  --text-faint:#6b7280;

  --accent:    #c8fb45;   /* verde-limão elétrico */
  --accent-2:  #aef000;
  --accent-ink:#10210a;   /* texto sobre o acento */

  --ok:    #46d39a;
  --warn:  #ffcb5c;
  --danger:#ff5d5d;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;

  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --maxw: 560px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;             /* desativa duplo-toque p/ zoom */
}
* { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 110% -10%, rgba(200,251,69,.10), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(120,200,255,.06), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- tipografia de marca ---------- */
.display, h1, h2 {
  font-family: 'Anton', 'Manrope', sans-serif;
  font-weight: 400;
  letter-spacing: .5px;
  line-height: .98;
  text-transform: uppercase;
  margin: 0;
}

/* =====================================================================
   APP SHELL (páginas logadas)
   ===================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  background: rgba(12,13,16,.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  font-family: 'Anton', sans-serif;
  font-size: 18px; letter-spacing: 1px;
  color: var(--accent-ink);
  background: var(--accent);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(200,251,69,.4), 0 6px 18px rgba(200,251,69,.18);
}
.brand-name {
  font-family: 'Anton', sans-serif;
  font-size: 19px; letter-spacing: .6px; text-transform: uppercase;
}
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-meta { text-align: right; line-height: 1.1; }
.user-meta strong { font-size: 13.5px; font-weight: 700; }
.user-meta small { display: block; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.btn-icon {
  width: 40px; height: 40px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
}
.btn-icon:active { background: var(--surface-2); }

.content {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px calc(env(safe-area-inset-bottom) + 32px);
}

/* ---------- saudação / cabeçalho de página ---------- */
.page-head { margin: 6px 0 22px; }
.page-head .eyebrow {
  color: var(--accent); font-size: 12px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
}
.page-head h1 { font-size: clamp(30px, 9vw, 40px); margin-top: 6px; }
.page-head p { color: var(--text-dim); margin: 8px 0 0; }

/* ---------- grade de atalhos (tiles) ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 16px;
  min-height: 116px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.tile:active { transform: scale(.975); }
.tile.is-on { border-color: rgba(200,251,69,.35); }
.tile.is-on:active { background: var(--surface-2); }
.tile.is-soon { opacity: .62; }
.tile-ico { font-size: 28px; line-height: 1; }
.tile-title { font-weight: 800; font-size: 16px; margin-top: auto; }
.tile-sub { color: var(--text-faint); font-size: 12.5px; }
.badge-soon {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 3px 8px;
}

/* ---------- mensagens flash ---------- */
.flash {
  border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 14px;
  font-size: 14px; font-weight: 600; border: 1px solid var(--line-2);
  background: var(--surface);
}
.flash-ok     { border-color: rgba(70,211,154,.4);  color: #b8f3da; }
.flash-erro   { border-color: rgba(255,93,93,.4);   color: #ffc9c9; }
.flash-info   { border-color: var(--line-2); color: var(--text-dim); }

/* =====================================================================
   FORMULÁRIOS
   ===================================================================== */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 700;
  letter-spacing: .3px; color: var(--text-dim); margin-bottom: 7px;
}
.input {
  width: 100%;
  font-size: 16px;                 /* >=16px evita zoom automático no iOS */
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 14px 14px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,251,69,.18);
}
.input-wrap { position: relative; }
.input-wrap .toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-faint);
  font-size: 13px; font-weight: 700; padding: 8px; cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  font-size: 16px; font-weight: 800; letter-spacing: .3px;
  padding: 15px 18px;
  border: 0; border-radius: var(--r-sm); cursor: pointer;
  color: var(--accent-ink); background: var(--accent);
  transition: transform .1s ease, filter .1s ease;
}
.btn:active { transform: scale(.985); filter: brightness(.95); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-2);
}

.hint { color: var(--text-faint); font-size: 12.5px; margin-top: 10px; }
.center { text-align: center; }

/* =====================================================================
   TELA DE AUTENTICAÇÃO (login / trocar senha)
   ===================================================================== */
.auth {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 20px calc(env(safe-area-inset-bottom) + 28px);
  max-width: 460px; margin: 0 auto;
}
.auth-brand { text-align: center; margin-bottom: 30px; }
.auth-brand .mark {
  font-family: 'Anton', sans-serif; color: var(--accent-ink);
  background: var(--accent);
  width: 64px; height: 64px; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 28px; letter-spacing: 1px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(200,251,69,.25);
}
.auth-brand h1 { font-size: clamp(40px, 13vw, 58px); }
.auth-brand h1 .lime { color: var(--accent); display: block; }
.auth-brand p {
  color: var(--text-dim); margin: 12px 0 0; font-size: 14px;
  letter-spacing: .3px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.auth-card h2 {
  font-size: 22px; margin-bottom: 4px; letter-spacing: .4px;
}
.auth-foot { text-align: center; color: var(--text-faint); font-size: 12px; margin-top: 22px; }

/* =====================================================================
   COMPONENTES — listas, formulários e botão flutuante (Fase 3)
   ===================================================================== */

/* link de voltar (sub-páginas) */
.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-dim); font-weight: 700; font-size: 13px; margin-bottom: 10px;
}
.backlink::before { content: "‹"; font-size: 20px; line-height: 1; color: var(--accent); }

/* barra de busca + contagem */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .input { padding: 11px 13px; }
.count { color: var(--text-faint); font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* lista de itens */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 13px; padding: 13px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  transition: background .12s ease;
}
.list-item:active { background: var(--surface-2); }
.avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  color: var(--accent); background: rgba(200,251,69,.12);
  border: 1px solid rgba(200,251,69,.25);
}
.avatar.off { color: var(--text-faint); background: var(--surface-2); border-color: var(--line-2); }
.li-main { flex: 1 1 auto; min-width: 0; }
.li-name {
  display: block; font-weight: 700; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.li-sub {
  display: block; color: var(--text-faint); font-size: 12.5px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.li-chev { color: var(--text-faint); font-size: 20px; flex: 0 0 auto; }

/* selo de status */
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-faint); flex: 0 0 auto;
}
.badge.on  { color: var(--accent); border-color: rgba(200,251,69,.4); background: rgba(200,251,69,.08); }
.badge.off { color: #ffb4b4; border-color: rgba(255,93,93,.35); background: rgba(255,93,93,.07); }

/* estado vazio */
.empty {
  text-align: center; padding: 46px 20px; color: var(--text-faint);
  border: 1px dashed var(--line-2); border-radius: var(--r);
}
.empty .ico { font-size: 34px; }
.empty p { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }

/* botão flutuante (FAB) + espaçador */
.fab {
  position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 20px; border: 0; border-radius: 999px; cursor: pointer;
  font-weight: 800; font-size: 15px; color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 12px 30px rgba(200,251,69,.3);
}
.fab:active { transform: scale(.97); }
.fab .plus { font-size: 20px; line-height: 1; }
.fab-space { height: 92px; }

/* formulários */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 18px; box-shadow: var(--shadow);
}
select.input {
  appearance: none; -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
.field-pass { display: flex; gap: 8px; }
.field-pass .input { flex: 1 1 auto; }
.btn-mini {
  flex: 0 0 auto; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-weight: 700; font-size: 13px; cursor: pointer;
}
.btn-mini:active { background: var(--surface); }

.actions { display: flex; gap: 10px; margin-top: 8px; }
.actions .btn { width: auto; flex: 1 1 auto; }
.btn-danger { background: transparent; color: #ffb4b4; border: 1px solid rgba(255,93,93,.4); }

.section-label {
  font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-faint); margin: 22px 0 8px;
}
.callout {
  font-size: 12.5px; color: var(--text-dim); background: var(--surface);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 11px 13px; margin-top: 8px;
}
.callout strong { color: var(--text); }

/* =====================================================================
   COMPONENTES — exercícios, treinos e editor de séries (Fase 4)
   ===================================================================== */

textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }

/* checkbox com rótulo */
.check {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 14px; color: var(--text); margin: 4px 0 4px;
}
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }

/* cartão de exercício na montagem do treino */
.ex-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 14px 12px; margin-bottom: 12px;
}
.ex-head { display: flex; align-items: center; gap: 10px; }
.ex-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  color: var(--accent-ink); background: var(--accent);
}
.ex-name { flex: 1 1 auto; font-weight: 800; font-size: 15px; min-width: 0; }
.ex-move { display: flex; gap: 4px; flex: 0 0 auto; }
.ex-move form { margin: 0; }
.mini {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); border-radius: 8px; font-size: 11px; cursor: pointer;
}
.mini[disabled] { opacity: .3; pointer-events: none; }
.ex-obs { color: var(--text-dim); font-size: 12.5px; margin: 10px 0 0; font-style: italic; }

.series-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; }
.series-table th {
  text-align: left; color: var(--text-faint); font-size: 11px; font-weight: 800;
  letter-spacing: .5px; text-transform: uppercase; padding: 0 8px 6px 0;
}
.series-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line); }
.series-table th:first-child, .series-table td:first-child { width: 46px; color: var(--text-dim); }

.ex-actions { display: flex; gap: 8px; margin-top: 12px; }
.ex-actions form { margin: 0; }
.ex-actions .btn-mini { padding: 8px 14px; }
.btn-mini.danger { color: #ffb4b4; border-color: rgba(255,93,93,.35); }

/* editor dinâmico de séries */
.series-editor { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.serie-head, .serie-row {
  display: grid; grid-template-columns: 26px 1fr 1fr 74px 30px;
  gap: 8px; align-items: center;
}
.serie-head { padding: 0 0 8px; }
.serie-head span {
  font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text-faint);
}
.serie-row { margin-bottom: 8px; }
.serie-row .input { padding: 11px 8px; text-align: center; }
.serie-row .input[name="repeticoes[]"], .serie-row .input[name="carga[]"] { text-align: left; }
.serie-n {
  text-align: center; font-weight: 800; font-size: 13px; color: var(--accent);
}
.serie-del {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255,93,93,.3); background: rgba(255,93,93,.06);
  color: #ffb4b4; font-size: 12px;
}
#add-serie { margin-top: 4px; }

/* lista de vínculo de treinos na ficha do aluno (Fase 4.1) */
.assign-list { display: flex; flex-direction: column; gap: 8px; }
.assign-item {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .12s ease, background .12s ease;
}
.assign-item input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.assign-item .ai-main { display: flex; flex-direction: column; min-width: 0; }
.assign-item .ai-name { font-weight: 700; font-size: 14.5px; }
.assign-item .ai-sub { color: var(--text-faint); font-size: 12px; }
.assign-item:has(input:checked) { border-color: rgba(200,251,69,.4); background: rgba(200,251,69,.05); }

/* construtor unificado de treino (Fase 4.2) */
.bldex {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; margin-bottom: 12px;
}
.bldex-head { display: flex; align-items: center; gap: 8px; }
.bldex-head .ex-sel { flex: 1 1 auto; min-width: 0; }
.bldex-head .ex-move { display: flex; gap: 4px; flex: 0 0 auto; }
.mini.danger { color: #ffb4b4; border-color: rgba(255,93,93,.3); background: rgba(255,93,93,.06); }
.bldex .serie-row .input { padding: 11px 8px; text-align: center; }
.bldex .serie-row .input[data-k="reps"], .bldex .serie-row .input[data-k="carga"] { text-align: left; }

/* =====================================================================
   ÁREA DO ALUNO — treino, mídia e cronômetro de pausa (Fase 5)
   ===================================================================== */
.aex {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 14px; margin-bottom: 14px;
}
.aex-head { display: flex; align-items: center; gap: 10px; }
.aex-name { font-weight: 800; font-size: 17px; min-width: 0; }

.ex-media { border-radius: 12px; overflow: hidden; margin: 12px 0; background: #000; }
.ex-media img, .ex-media video { width: 100%; display: block; }
.ex-media.video { position: relative; aspect-ratio: 16 / 9; background-size: cover; background-position: center; cursor: pointer; }
.ex-media.video .play {
  position: absolute; inset: 0; margin: auto; width: 62px; height: 62px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 22px; display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(2px);
}
.ex-media.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ex-instr { color: var(--text-dim); font-size: 13.5px; line-height: 1.55; margin: 12px 0 0; white-space: pre-line; }
.aex-obs { color: var(--accent); font-size: 12.5px; margin: 10px 0 0; font-weight: 700; }

.aseries { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.aserie {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
}
.aserie-info { cursor: pointer; line-height: 1.25; -webkit-user-select: none; user-select: none; }
.aserie-info strong { font-size: 14px; }
.aserie-info span { display: block; color: var(--text-faint); font-size: 12.5px; }
.aserie.done { opacity: .5; }
.aserie.done .aserie-info strong, .aserie.done .aserie-info span { text-decoration: line-through; }
.rest-btn {
  flex: 0 0 auto; padding: 10px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(200,251,69,.4); background: rgba(200,251,69,.08);
  color: var(--accent); font-weight: 800; font-size: 13px; white-space: nowrap;
}
.rest-btn:active { background: rgba(200,251,69,.18); }

/* dock do cronômetro */
.restdock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface-2); border-top: 1px solid var(--line-2);
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  box-shadow: 0 -12px 30px rgba(0,0,0,.45);
}
.rd-bar { height: 5px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.rd-fill { height: 100%; width: 100%; background: var(--accent); transition: width 1s linear; }
.rd-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rd-time { font-family: 'Anton', sans-serif; font-size: 34px; letter-spacing: 1px; line-height: 1; }
.rd-actions { display: flex; gap: 8px; }
.rd-btn {
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-weight: 800; font-size: 14px; cursor: pointer;
}
.rd-btn.primary { background: var(--accent); color: var(--accent-ink); border: 0; }
.restdock.done { background: rgba(70,211,154,.16); border-top-color: var(--ok); }
.restdock.done .rd-fill { background: var(--ok); }
.restdock.done .rd-time { color: #bff3dd; }

/* progresso do treino (Fase 5.1) */
.tprog { position: sticky; top: 0; z-index: 15; background: var(--bg); padding: 8px 0 12px; margin-bottom: 12px; }
.tprog-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.tprog-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 99px; transition: width .25s ease; }
.tprog-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tprog-row span { font-size: 12.5px; font-weight: 800; color: var(--text-dim); letter-spacing: .3px; }
.tprog.full .tprog-fill { background: var(--ok); }
.tprog.full .tprog-row span { color: var(--ok); }
.tprog-reset { background: none; border: 0; color: var(--text-faint); font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: underline; }

/* check de série */
.aserie { gap: 12px; }
.aserie .aserie-info { flex: 1 1 auto; }
.schk {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid var(--line-2); background: transparent; position: relative;
}
.aserie.done .schk { background: var(--accent); border-color: var(--accent); }
.aserie.done .schk::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--accent-ink); font-size: 14px; font-weight: 900;
}

/* contador e check do exercício */
.aex-name { flex: 1 1 auto; }
.aex-count { font-size: 12px; font-weight: 800; color: var(--text-faint); white-space: nowrap; }
.aex-check {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid var(--line-2); background: transparent; position: relative;
}
.aex.done .aex-check { background: var(--ok); border-color: var(--ok); }
.aex.done .aex-check::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #06281b; font-size: 15px; font-weight: 900;
}
.aex.done { opacity: .82; }
.aex.done .aex-name { text-decoration: line-through; color: var(--text-dim); }

/* =====================================================================
   HISTÓRICO DE TREINOS / ATIVIDADE / RESPOSTAS (Fase 5.2)
   ===================================================================== */
.hist { display: flex; flex-direction: column; gap: 10px; }
.hist-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.hist-line { font-size: 13.5px; line-height: 1.5; margin: 0; color: var(--text); }
.hist-line strong { font-weight: 800; }
.hist-com { font-size: 13px; color: var(--text-dim); font-style: italic; margin: 8px 0 0; }
.hist-resp {
  margin-top: 10px; font-size: 13px; color: var(--text);
  background: var(--bg-soft); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 9px 11px;
}
.hist-resp-tag {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 3px;
}

/* respostas do professor */
.reply { margin-top: 12px; }
.reply-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font-size: 12.5px; font-weight: 700;
}
.chip:active { background: var(--surface); }

/* painel de finalização do treino (aluno) */
.finish { margin: 8px 0 4px; }
.finish-card {
  background: linear-gradient(180deg, rgba(200,251,69,.10), var(--surface));
  border: 1px solid rgba(200,251,69,.35); border-radius: var(--r-lg);
  padding: 20px 16px; text-align: center;
}
.finish-emoji { font-size: 38px; line-height: 1; }
.finish-card strong { display: block; font-size: 18px; margin-top: 6px; }
.finish-card form { margin-top: 12px; text-align: left; }

/* modal de finalização + botão Finalizar (Fase 5.3) */
.tprog-actions { display: flex; align-items: center; gap: 10px; }
.tprog-fin {
  background: var(--accent); color: var(--accent-ink); border: 0;
  padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 12.5px; cursor: pointer;
}
body.noscroll { overflow: hidden; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 26px 20px 22px; box-shadow: var(--shadow); animation: modalpop .22s ease;
}
@keyframes modalpop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-dim);
  font-size: 13px; cursor: pointer;
}
.modal-title { display: block; font-size: 20px; margin-top: 6px; }
.modal-card .finish-emoji { font-size: 40px; line-height: 1; }
.modal-card form { text-align: left; margin-top: 14px; }

/* destaque colorido para os cards de treino (Fase 5.4) */
.list-item.treino {
  background: linear-gradient(135deg, rgba(200,251,69,.12), var(--surface) 62%);
  border-color: rgba(200,251,69,.30);
}
.list-item.treino:active { background: linear-gradient(135deg, rgba(200,251,69,.18), var(--surface-2) 62%); }
.list-item.treino .avatar {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.list-item.treino .li-chev { color: var(--accent); }

/* grade de resultados/indicadores da avaliação (Fase 6) */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.stat .v { font-family: 'Anton', sans-serif; font-size: 26px; line-height: 1; color: var(--text); }
.stat .v small { font-size: 13px; color: var(--text-dim); font-family: 'Manrope', sans-serif; font-weight: 700; margin-left: 2px; }
.stat .l { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text-faint); margin-top: 7px; }
.stat .c { font-size: 12px; color: var(--accent); font-weight: 700; margin-top: 2px; }
.stat.wide { grid-column: 1 / -1; }

/* =====================================================================
   EVOLUÇÃO DO ALUNO — gráficos, composição e comparativo (Fase 6b)
   ===================================================================== */
.chart-wrap { margin-bottom: 6px; }
.chart {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 6px;
}
.chart svg { display: block; }

/* composição corporal */
.comp-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); margin: 4px 0 12px; }
.comp-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.comp-legend .dot.magra { background: var(--accent); }
.comp-legend .dot.gorda { background: #5a6172; }
.comp { display: flex; flex-direction: column; gap: 0; }
.comp-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.comp-d { font-size: 11px; color: var(--text-faint); width: 48px; flex: 0 0 auto; }
.comp-bar { flex: 1 1 auto; height: 22px; border-radius: 7px; overflow: hidden; display: flex; background: var(--surface-2); }
.comp-magra { background: var(--accent); height: 100%; }
.comp-gorda { background: #5a6172; height: 100%; }
.comp-kg { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; flex: 0 0 auto; }

/* comparativo (linhas com variação) */
.cmp { display: flex; flex-direction: column; }
.cmp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px;
}
.cmp-l { color: var(--text-dim); }
.cmp-vals { display: flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.cmp-ant { color: var(--text-faint); }
.cmp-arr { color: var(--text-faint); }
.cmp-at { color: var(--text); }
.cmp-d { font-size: 11px; font-weight: 800; color: var(--accent); margin-left: 4px; }
.cmp-d.eq { color: var(--text-faint); }

/* =====================================================================
   BREADCRUMB, CABEÇALHO DE SEÇÃO E TAG DO PROFESSOR (Fase 6c)
   ===================================================================== */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  font-size: 12.5px; margin-bottom: 12px; line-height: 1.4;
}
.crumb { color: var(--text-faint); font-weight: 700; text-decoration: none; }
a.crumb { color: var(--text-dim); }
a.crumb:active { opacity: .6; }
.crumb.home { color: var(--accent); }
.crumb.atual { color: var(--text); }
.crumb-sep { color: var(--text-faint); }

/* cabeçalho de seção com ação à direita */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-link { font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; white-space: nowrap; }
.section-link:active { opacity: .6; }

/* tag do professor no painel do aluno */
.prof-tag {
  display: flex; align-items: center; gap: 12px; margin-top: 22px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r);
}
.prof-ico { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.prof-meta { display: flex; flex-direction: column; min-width: 0; }
.prof-meta small { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.prof-meta strong { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
   CONVITE DE INSTALAÇÃO DO PWA (Fase 7)
   ===================================================================== */
.pwa-banner {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 200; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
  max-width: 560px; margin: 0 auto;
  animation: pwaUp .28s ease both;
}
@keyframes pwaUp { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pwa-ico { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.pwa-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.pwa-txt strong { font-size: 14px; color: var(--text); }
.pwa-txt small { font-size: 12px; color: var(--text-dim); line-height: 1.35; }
.pwa-go {
  flex: 0 0 auto; appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 13.5px; padding: 9px 16px; border-radius: 11px;
}
.pwa-go:active { opacity: .85; }
.pwa-x {
  flex: 0 0 auto; appearance: none; border: 0; cursor: pointer;
  background: transparent; color: var(--text-faint);
  font-size: 22px; line-height: 1; padding: 2px 6px;
}
