:root {
  --bg: #070707;
  --s0: #0c0c0c;
  --s1: #101010;
  --s2: #151515;
  --s3: #1c1c1c;
  --line: #262626;
  --line-2: #3a3428;
  --text: #f4efe4;
  --muted: #b3ad9f;
  --faint: #928c80;
  --gold: #e3a614;
  --gold-hi: #f4c44c;
  --ink: #1a1202;
  --ok: #6fc28a;
  --alerta: #e8715f;
  --font: "Archivo", "Segoe UI", system-ui, sans-serif;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --touch: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
/* iPhone: campo com letra menor que 16px faz a tela dar zoom ao tocar. */
@supports (-webkit-touch-callout: none) { input, select, textarea { font-size: max(16px, 1em); } }
a { color: var(--gold); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

.app {
  position: relative;
  width: min(100%, 460px);
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(118px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app.is-session, .app.is-entrada { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.app:not(.is-session):not(.is-entrada)::after { content: ""; position: fixed; z-index: 11; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 460px); height: calc(92px + env(safe-area-inset-bottom)); pointer-events: none; background: linear-gradient(to top, var(--bg) 22%, rgba(7, 7, 7, 0)); }
[data-view] { display: flex; flex-direction: column; gap: 14px; }
.boot { color: var(--faint); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-width: 0; }
/* Marca Haltera: símbolo H-halter + nome na fonte do sistema (SF Pro no iPhone), como a Apple escreve as marcas dela. */
.mark { display: inline-flex; align-items: center; gap: 7px; color: #f5f5f7; font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; text-transform: none; flex: none; }
.mark::before { content: ""; width: 20px; height: 20px; flex: none; background: url(/assets/img/haltera-simbolo.svg) center / contain no-repeat; }
.who { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.who [data-who] { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; text-align: right; }
.demo-tag { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--gold); border-radius: 999px; padding: 2px 8px; }

.hello { margin: 6px 0 0; font-size: 30px; line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: break-word; }
.phase { margin: 0; color: var(--muted); font-size: 15px; }
.phase b { color: var(--text); font-weight: 600; }

.trail { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 2px; padding: 0; }
.trail li { display: flex; flex-direction: column; gap: 6px; font-size: 11px; letter-spacing: 0.03em; color: var(--faint); }
.trail i { display: block; height: 3px; border-radius: 3px; background: var(--s3); }
.trail .is-feita i { background: var(--line-2); }
.trail .is-atual { color: var(--text); }
.trail .is-atual i { background: var(--gold); }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card--flat { gap: 6px; }
.card--destaque { background: linear-gradient(180deg, #16130b 0%, var(--s1) 70%); border-color: var(--line-2); }
.card--aviso { border-color: var(--line-2); }
.card--demo { border-style: dashed; border-color: var(--line-2); background: transparent; }
.kicker { margin: 0; color: var(--gold); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.kicker--sec { color: var(--faint); margin-top: 10px; }
.selo { text-transform: none; letter-spacing: 0; color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-weight: 450; font-size: 11px; }
h1 { margin: 0; font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
.sub { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; overflow-wrap: break-word; }

.btn { min-height: 52px; border: 0; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 650; cursor: pointer; padding: 0 22px; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; transition: transform 0.12s ease, background 0.15s; }
.btn:active { transform: scale(0.985); }
.btn:hover { background: var(--gold-hi); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost:hover { background: var(--s2); }
.textbtn { border: 0; background: transparent; color: var(--muted); padding: 10px; cursor: pointer; }

.choices { display: flex; gap: 8px; }
.choices--wrap { flex-wrap: wrap; }
.choices button { flex: 1; min-height: 46px; border-radius: 999px; border: 0; background: var(--s3); color: var(--text); cursor: pointer; padding: 0 14px; }
.choices--wrap button { flex: 1 1 28%; }
.choices button[aria-pressed="true"] { background: var(--gold); color: var(--ink); font-weight: 600; }

.banner { margin: 0; padding: 12px 14px; border-radius: 14px; background: rgba(227, 166, 20, 0.12); color: var(--gold-hi); font-size: 14px; line-height: 1.35; }
.banner--alerta { background: rgba(232, 113, 95, 0.12); color: #f2a498; }
.banner--ok { background: rgba(233, 200, 115, 0.1); color: var(--ok); }
.aviso { margin: 0; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--s2); display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; line-height: 1.35; color: var(--muted); }
.aviso--ok { color: var(--ok); }
.aviso button { border: 0; background: var(--s3); border-radius: 999px; min-height: 34px; padding: 0 14px; cursor: pointer; }

.progresso { display: flex; gap: 14px; align-items: center; }
.ring { width: 64px; height: 64px; flex: none; }
.ring-bg { fill: none; stroke: var(--s3); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.ring text { fill: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.week { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 6px 0 2px; padding: 0; }
.week li { text-align: center; font-size: 12px; color: var(--faint); padding: 9px 0 7px; border-radius: 12px; position: relative; }
.week .is-plano { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.week .is-hoje { background: var(--gold); color: var(--ink); box-shadow: none; font-weight: 650; }
.week .is-feito i { position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--ok); }
.week .is-hoje.is-feito i { background: var(--ink); }

.next { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; padding: 0 4px; }
.next--leve { color: var(--faint); font-size: 14px; }

.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.facts li:first-child { border-top: 0; }
.facts span { color: var(--muted); min-width: 0; overflow-wrap: break-word; }
.facts b { font-weight: 550; text-align: right; min-width: 0; flex: 0 1 auto; max-width: 62%; overflow-wrap: break-word; }
.facts--inline li { padding: 7px 0; }

.list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { background: var(--s1); border: 1px solid var(--line); border-radius: 16px; }
.exbtn { width: 100%; display: grid; grid-template-columns: 64px 30px minmax(0, 1fr) 18px; gap: 10px; align-items: center; background: transparent; border: 0; border-radius: 16px; padding: 8px 10px 8px 8px; text-align: left; cursor: pointer; transition: background 0.15s, transform 0.12s; }
.exbtn:hover { background: var(--s2); }
.exbtn:active { transform: scale(0.99); }
.chev { width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s, stroke 0.2s; }
.exbtn:hover .chev { transform: translateX(3px); stroke: var(--gold); }
.list img, .list .ph { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--s3); display: block; }
.list span:not(.ph) { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 600; }
.list b { display: block; font-weight: 550; overflow-wrap: break-word; }
.list small { color: var(--muted); font-size: 13px; overflow-wrap: break-word; }

.dia { background: var(--s1); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; }
.dia summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 0; cursor: pointer; list-style: none; color: var(--muted); }
.dia summary b, .dia summary span { min-width: 0; overflow-wrap: break-word; }
.dia summary b { color: var(--text); font-weight: 550; }
.dia[open] summary { border-bottom: 1px solid var(--line); }

.duo { padding: 8px 0; border-top: 1px solid var(--line); }
.duo:first-of-type { border-top: 0; }
.duo-v { margin: 2px 0 0; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.duo-v i { color: var(--gold); font-style: normal; }
.duo-v em { font-style: normal; color: var(--faint); font-size: 14px; font-weight: 450; }
.duo-v small { font-size: 14px; color: var(--faint); font-weight: 450; }
.chart { margin: 6px 0 2px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart path { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { stroke: none; fill: rgba(227, 166, 20, 0.1); }
.chart circle { fill: var(--bg); stroke: var(--gold); stroke-width: 2; }
.chart figcaption { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; }

.measure { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.measure label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 13px; }
.measure input, .measure textarea, .sel select { color: var(--text); }
.measure input, .sel select { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--s2); padding: 0 14px; color-scheme: dark; }
.measure input[aria-invalid="true"] { border-color: var(--alerta); }
.consentimento, .measure label.consentimento { flex-direction: row; align-items: flex-start; gap: 12px; margin: 14px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--s2); color: var(--text); font-size: 13px; line-height: 1.5; cursor: pointer; }
.consentimento input, .measure .consentimento input { flex: 0 0 auto; width: 22px; height: 22px; margin: 1px 0 0; padding: 0; accent-color: var(--gold); }
.consentimento input[aria-invalid="true"] { outline: 2px solid var(--alerta); outline-offset: 2px; }
.consentimento a { color: var(--gold); }
.erro { margin: -4px 0 0; color: #f2a498; font-size: 13px; }
.duo-btns { display: flex; flex-direction: column; gap: 8px; }
.sel { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 13px; }
.conv a { word-break: break-all; }

/* ------------------------------------------------------------- navegação */
.tabs { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 16px), 460px); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 5px; border-radius: 28px; background: rgba(16, 16, 16, 0.78); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); z-index: 12; }
.tabs button { background: transparent; border: 0; color: var(--faint); font-size: 10px; letter-spacing: 0.01em; padding: 8px 0 7px; border-radius: 22px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.tabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--gold); background: rgba(227, 166, 20, 0.16); }
.tabs button[aria-current="page"] span { font-weight: 650; }

/* ---------------------------------------------------------------- sessão */
.session { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.session h2 { font-size: 26px; line-height: 1.22; overflow-wrap: break-word; }
.load { margin: 0; font-size: 46px; line-height: 1; letter-spacing: -0.035em; font-weight: 600; font-variant-numeric: tabular-nums; }
.load--sm { font-size: 28px; }
.shot { margin: 0; }
.shot img { width: 100%; height: 232px; object-fit: cover; border-radius: 20px; background: var(--s2); display: block; }
.shot--rest img { height: 120px; }
.shot figcaption { margin-top: 5px; color: var(--faint); font-size: 11px; }
.foto-nota { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.4; }
/* Ficha do exercício: início e final lado a lado, mesma altura, legenda embaixo de cada um. */
.shot--par .par { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shot--par .par__item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.shot.shot--par img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; }
/* Foto única na ficha (muitas trazem início e final no mesmo quadro): inteira, sem cortar as laterais. */
.shot--folha.shot--img:not(.shot--par):not(.shot--multi) img { height: auto; max-height: 260px; object-fit: contain; background: #fff; }
.shot--par .par__leg { text-align: center; color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.how { margin: 0; font-size: 16px; line-height: 1.45; overflow-wrap: break-word; }
.count { margin: 0; font-size: 96px; line-height: 0.95; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.sync { margin: 0; text-align: center; color: var(--faint); font-size: 12px; }

.entrada { display: flex; flex-direction: column; gap: 16px; padding-top: 6vh; }
.entrada h1 { max-width: 12ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .rest .fg { animation: none !important; }
}

/* --------------------------------------------------------------- desktop */
@media (min-width: 900px) {
  body { background: #050505; }
  .app { width: min(100%, 940px); display: grid; grid-template-columns: 220px minmax(0, 520px); grid-template-areas: "marca view" "nav view"; align-content: start; gap: 0 56px; padding: 40px 32px; justify-content: center; }
  .app.is-session, .app.is-entrada { grid-template-columns: minmax(0, 520px); grid-template-areas: "view"; }
  .app { grid-template-rows: auto 1fr; }
  .top { grid-area: marca; flex-direction: column; align-items: flex-start; justify-content: flex-start; align-self: start; gap: 6px; }
  [data-view] { grid-area: view; }
  .tabs { grid-area: nav; position: sticky; top: 24px; transform: none; left: auto; bottom: auto; width: 100%; grid-template-columns: 1fr; gap: 4px; padding: 6px; margin-top: 24px; align-self: start; border-radius: 22px; box-shadow: none; }
  .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 12px 14px; border-radius: 16px; text-align: left; }
  .tabs button[aria-current="page"] { background: rgba(227, 166, 20, 0.16); }
  .app:not(.is-session):not(.is-entrada)::after { display: none; }
  .app.is-will { width: min(100%, 1180px); grid-template-columns: minmax(0, 1fr); grid-template-areas: "marca" "view"; gap: 8px 0; padding-top: 28px; }
  .app.is-will .top { flex-direction: row; align-items: center; width: 100%; }
  .adm { grid-template-columns: 196px minmax(0, 1fr); }
}
