/* Forja — identidade "anilha olímpica"
 * Layout: app mobile-first de coluna única (máx. 640px), cabeçalho fixo, navegação inferior,
 * treino em "modo foco" (um exercício aberto por vez).
 * Paleta: giz (claro) / ferro (escuro); azul da anilha de 20 kg como destaque;
 * vermelho 25, amarelo 15 e verde 10 como cores de estado e da calculadora de anilhas.
 */
:root {
  /* tema claro — giz */
  --bg: #eceff2;
  --surface: #ffffff;
  --surface-2: #e2e6eb;
  --line: #cfd5dc;
  --ink: #14181e;
  --ink-2: #4d5664;
  --ink-3: #6e7785;
  --accent: #1f55d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 85, 214, .10);
  --hi: #e9a800;
  --hi-soft: rgba(233, 168, 0, .14);
  --ok: #12804a;
  --ok-soft: rgba(18, 128, 74, .11);
  --warn: #a8670d;
  --warn-soft: rgba(201, 132, 18, .13);
  --bad: #c3242b;
  --bad-soft: rgba(195, 36, 43, .10);
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 8px 24px rgba(20, 24, 30, .06);
  --scrim: rgba(12, 15, 19, .45);
  --media-bg: #ffffff;

  /* anilhas (cores fixas, iguais nos dois temas) */
  --p25: #d7262e; --p20: #1f55d6; --p15: #f2b705; --p10: #1e9e50; --p5: #f3f3f3; --p2: #2b2f36; --p1: #b9bec6;

  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
  --nav: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1115; --surface: #161a20; --surface-2: #1e232b; --line: #2a313b;
    --ink: #edf0f4; --ink-2: #a3acb8; --ink-3: #7d8794;
    --accent: #5089ff; --accent-ink: #06122e; --accent-soft: rgba(80, 137, 255, .15);
    --hi: #f5c531; --hi-soft: rgba(245, 197, 49, .14);
    --ok: #3ccb80; --ok-soft: rgba(60, 203, 128, .13);
    --warn: #e9a640; --warn-soft: rgba(233, 166, 64, .14);
    --bad: #f2646a; --bad-soft: rgba(242, 100, 106, .13);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    --scrim: rgba(0, 0, 0, .6);
    --media-bg: #f4f5f7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1115; --surface: #161a20; --surface-2: #1e232b; --line: #2a313b;
  --ink: #edf0f4; --ink-2: #a3acb8; --ink-3: #7d8794;
  --accent: #5089ff; --accent-ink: #06122e; --accent-soft: rgba(80, 137, 255, .15);
  --hi: #f5c531; --hi-soft: rgba(245, 197, 49, .14);
  --ok: #3ccb80; --ok-soft: rgba(60, 203, 128, .13);
  --warn: #e9a640; --warn-soft: rgba(233, 166, 64, .14);
  --bad: #f2646a; --bad-soft: rgba(242, 100, 106, .13);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  --scrim: rgba(0, 0, 0, .6);
  --media-bg: #f4f5f7;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--f-body); font-feature-settings: "cv11", "ss01";
  padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom, 0px) + 16px);
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 25; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, .display { font-family: var(--f-display); font-weight: 700; letter-spacing: .2px; line-height: 1.05; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; letter-spacing: .3px; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-3); }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 700; font-size: 1.35rem; letter-spacing: 1.5px; text-transform: uppercase; }
.brand svg { width: 28px; height: 28px; }
.topinfo { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.topinfo .live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.topinfo .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

main {
  max-width: 640px; margin: 0 auto;
  padding-block: 18px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
body.timing main { padding-bottom: 150px; }
.page-head { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--nav) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav button { flex: 1; min-width: 0; background: none; border: 0; color: var(--ink-3); font-size: .7rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav button .pill { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .2s; }
.nav button.on { color: var(--accent); }
.nav button.on .pill { background: var(--accent-soft); }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 6px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.input { min-width: 0; }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .74rem; color: var(--ink-2); line-height: 1.25; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .92rem; white-space: nowrap; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: transparent; }
.btn.block { width: 100%; }
.btn.xl { min-height: 56px; font-size: 1.05rem; border-radius: 14px; font-family: var(--f-display); font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .84rem; border-radius: var(--r-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); flex: none; }
.icon-btn.plain { border-color: transparent; background: transparent; }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.acc { background: var(--accent-soft); color: var(--accent); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.hi { background: var(--hi-soft); color: var(--warn); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .lbl { font-size: .78rem; font-weight: 700; color: var(--ink-2); letter-spacing: .4px; }
.input { width: 100%; min-height: 48px; padding: 0 14px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); font-size: 1rem; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.textarea { min-height: 88px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input-unit { position: relative; }
.input-unit .input { padding-right: 44px; font-variant-numeric: tabular-nums; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .85rem; font-weight: 600; pointer-events: none; }
.field-err { color: var(--bad); font-size: .8rem; font-weight: 600; }
.input.bad { border-color: var(--bad); }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); }
.seg label, .opt, .chip { position: relative; }
.seg label { flex: 1; min-width: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--ink-2); text-align: center; padding: 0 4px; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2.5px solid var(--accent); }

.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt > span { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); height: 100%; transition: border-color .15s, background .15s; }
.opt .oi { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.opt b { display: block; font-size: .95rem; }
.opt small { display: block; color: var(--ink-2); font-size: .8rem; margin-top: 2px; line-height: 1.35; }
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.opt input:checked + span .oi { background: var(--accent); color: var(--accent-ink); }
.opt input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .86rem; white-space: nowrap; color: var(--ink-2); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 2.5px solid var(--accent); }

/* ---------- Onboarding ---------- */
.wiz { display: flex; flex-direction: column; gap: 18px; }
.wiz-top { display: flex; flex-direction: column; gap: 12px; }
.steps-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps-bar i { height: 5px; border-radius: 3px; background: var(--line); }
.steps-bar i.on { background: var(--accent); }
.wiz h1 { font-size: 2.3rem; }
.wiz-body { display: flex; flex-direction: column; gap: 18px; }
.wiz-foot { display: flex; gap: 10px; position: sticky; bottom: 0; margin: 0 -4px; padding: 22px 4px calc(env(safe-area-inset-bottom, 0px) + 14px); background: linear-gradient(to bottom, transparent, var(--bg) 22px); }
.wiz { padding-bottom: 0; }
.wiz-foot .btn.primary { flex: 1; }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); font-size: .85rem; color: var(--ink-2); }
.hint .ic { color: var(--accent); margin-top: 1px; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .9rem; }
.summary dt { color: var(--ink-3); }
.summary dd { margin: 0; font-weight: 600; }

/* ---------- Hoje ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700; color: var(--ink-3); }
.week i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed var(--line); font-style: normal; color: transparent; }
.week .done i { background: var(--accent); border: 0; color: var(--accent-ink); }
.week .today { color: var(--ink); }
.week .today i { border-style: solid; border-color: var(--ink); }
.week .today.done i { border: 0; }

.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.hero-top { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.hero h2 { font-size: 2.4rem; line-height: .95; text-transform: uppercase; letter-spacing: .5px; }
.hero-list { padding: 4px 18px 6px; }
.hero-foot { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }

.exrow { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; }
.exrow:first-child { border-top: 0; }
.exrow .nm { font-weight: 600; font-size: .93rem; line-height: 1.3; }
.exrow .meta { font-size: .8rem; color: var(--ink-2); }
.thumb { width: 56px; height: 42px; border-radius: 9px; object-fit: cover; background: var(--media-bg); flex: none; border: 1px solid var(--line); }
.thumb.lg { width: 76px; height: 56px; border-radius: 11px; }
.more-row { font-size: .82rem; color: var(--ink-2); padding: 8px 0 2px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: var(--r-md); font-size: .88rem; background: var(--hi-soft); color: var(--ink); }
.banner .ic { color: var(--warn); }
.banner.ok { background: var(--ok-soft); }
.banner.ok .ic { color: var(--ok); }

/* ---------- Treino (modo foco) ---------- */
.wk-head { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 55px); z-index: 15; margin: -18px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0; padding: 12px max(16px, env(safe-area-inset-left, 0px)) 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.wk-head h1 { font-size: 1.6rem; text-transform: uppercase; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }

.wex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.wex.open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wex.done:not(.open) { background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface)); }
.wex-head { display: flex; gap: 12px; align-items: center; padding: 12px; width: 100%; text-align: left; background: none; border: 0; }
.wex-head .t { font-weight: 700; font-size: .98rem; line-height: 1.25; }
.wex-head .s { font-size: .8rem; color: var(--ink-2); margin-top: 2px; }
.wex-head .st { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); flex: none; font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
.wex.done .wex-head .st { background: var(--ok); color: #fff; }
.wex.open .wex-head .st { background: var(--accent); color: var(--accent-ink); }
.wex-body { padding: 0 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.media { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--media-bg); border: 1px solid var(--line); }
.media img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: contain; max-width: 100%; }
.media .btn { position: absolute; right: 8px; bottom: 8px; background: color-mix(in srgb, var(--surface) 92%, transparent); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv div { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; }
.kv b { display: block; font-family: var(--f-display); font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kv span { font-size: .7rem; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.grip { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.grip .ic { color: var(--accent); margin-top: 1px; }
.sug { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: var(--r-md); font-size: .86rem; background: var(--accent-soft); }
.sug .ic { color: var(--accent); margin-top: 1px; }
.sug b { display: block; }
.sug.subir { background: var(--ok-soft); } .sug.subir .ic { color: var(--ok); }
.sug.reduzir { background: var(--bad-soft); } .sug.reduzir .ic { color: var(--bad); }
.sug.variacao { background: var(--hi-soft); } .sug.variacao .ic { color: var(--warn); }

.sets { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-variant-numeric: tabular-nums; }
.sets th { font-size: .68rem; color: var(--ink-3); text-transform: uppercase; font-weight: 700; letter-spacing: .6px; padding: 0 4px; text-align: center; }
.sets td { padding: 0 3px; text-align: center; }
.sets td.n { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; width: 30px; }
.sets td.prev { color: var(--ink-3); font-size: .78rem; width: 58px; }
.sets input { width: 100%; min-width: 0; height: 46px; text-align: center; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--r-sm); font-size: 1.05rem; font-weight: 700; }
.sets input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.sets input::placeholder { color: var(--ink-3); font-weight: 500; }
.sets tr.ok input { background: var(--ok-soft); color: var(--ok); }
.chk { width: 48px; height: 46px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3); display: grid; place-items: center; }
.chk.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk.next { border-color: var(--accent); color: var(--accent); }

.warm { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-md); border: 1px dashed var(--line); }
.warm .lbl { display: flex; align-items: center; gap: 6px; color: var(--warn); }
.cal { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cal-row:first-child { border-top: 0; }
.cal-row.today .dow { background: var(--ink); color: var(--bg); }
.dow { display: grid; place-items: center; height: 40px; border-radius: 10px; background: var(--surface-2); font-family: var(--f-display); font-weight: 700; font-size: 1rem; letter-spacing: .5px; }
.cal-items { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.cal-items .rest { color: var(--ink-3); font-size: .86rem; }
.meter { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 5px; }
.week .cardio i { border: 2px solid var(--ok); border-style: solid; color: var(--ok); }
.adj { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.adj .lbl { line-height: 1.3; }

.plates { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-md); border: 1px dashed var(--line); }
.bar-viz { display: flex; align-items: center; height: 56px; }
.bar-viz .sleeve { width: 26px; height: 8px; background: var(--p1); border-radius: 2px; }
.bar-viz .collar { width: 6px; height: 18px; background: var(--ink-3); border-radius: 2px; margin-right: 2px; }
.bar-viz .pl { width: 11px; margin-right: 2px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .25); }
.bar-viz .shaft { flex: 1; height: 6px; background: var(--p1); border-radius: 3px; max-width: 80px; }
.pl.p25 { background: var(--p25); height: 54px; } .pl.p20 { background: var(--p20); height: 54px; }
.pl.p15 { background: var(--p15); height: 46px; } .pl.p10 { background: var(--p10); height: 40px; }
.pl.p5 { background: var(--p5); height: 30px; } .pl.p2 { background: var(--p2); height: 24px; width: 8px !important; }
.pl.p1 { background: var(--p1); height: 20px; width: 7px !important; }

.effort { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.effort.ask { background: var(--hi-soft); }
.effort .opts3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.effort button { min-height: 52px; padding: 6px 4px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: .84rem; line-height: 1.2; }
.effort button small { display: block; font-weight: 500; color: var(--ink-3); font-size: .7rem; }
.effort button.on.facil { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.effort button.on.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.effort button.on.limite { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.wex-foot { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Timer ---------- */
.timer {
  position: fixed; z-index: 40; left: 0; right: 0;
  bottom: calc(var(--nav) + env(safe-area-inset-bottom, 0px) + 10px);
  margin: 0 auto; max-width: 616px; width: calc(100% - 24px);
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--ink); color: var(--bg); border-radius: 20px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
}
.timer.end { background: var(--ok); color: #fff; }
.ring { width: 66px; height: 66px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: color-mix(in srgb, var(--bg) 22%, transparent); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 326.7; transition: stroke-dashoffset .25s linear; }
.timer.end .ring-fg { stroke: #fff; }
.timer-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.timer-label { font-size: .7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: .7; }
.timer-time { font-family: var(--f-display); font-size: 2.3rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.timer-sub { font-size: .78rem; opacity: .85; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.timer-btns { display: flex; flex-direction: column; gap: 6px; }
.timer-btns .r { display: flex; gap: 6px; }
.timer-btns button { min-width: 50px; height: 36px; border-radius: 10px; border: 0; background: color-mix(in srgb, var(--bg) 16%, transparent); color: inherit; font-weight: 700; font-size: .82rem; }
.timer-btns button.primary { background: var(--accent); color: var(--accent-ink); }
.timer.end .timer-btns button.primary { background: #fff; color: var(--ok); }

/* ---------- Sheets / modal ---------- */
.modal, .confirm { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.confirm { z-index: 60; }
.modal-card, .confirm-card {
  width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 14px; animation: up .22s ease-out;
}
.confirm-card { background: var(--surface); gap: 10px; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 2px; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
@media (min-width: 700px) { .modal, .confirm { align-items: center; } .modal-card, .confirm-card { border-radius: 22px; } .grabber { display: none; } }
.modal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gifbig { width: 100%; max-width: 100%; border-radius: var(--r-md); background: var(--media-bg); display: block; border: 1px solid var(--line); aspect-ratio: 3 / 2; object-fit: contain; }
ol.steps { padding-left: 0; margin: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 10px; }
ol.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: .92rem; }
ol.steps li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem; }
.chain { display: flex; flex-direction: column; gap: 6px; }
.chain button { text-align: left; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.chain button.cur { border-color: var(--accent); background: var(--accent-soft); }
.chain .n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; }
.chain button.cur .n { background: var(--accent); color: var(--accent-ink); }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: .87rem; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.note .ic { color: var(--accent); margin-top: 1px; }

/* ---------- Plano ---------- */
.daytabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -2px; }
.daytabs::-webkit-scrollbar { display: none; }
.daytabs button { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.daytabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.prow { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.prow .main { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; }

.vrow { display: grid; grid-template-columns: 88px 1fr 70px; align-items: center; gap: 10px; font-size: .84rem; }
.vtrack { position: relative; height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.vrange { position: absolute; top: 0; bottom: 0; background: var(--ok-soft); box-shadow: inset 1px 0 var(--ok), inset -1px 0 var(--ok); }
.vfill { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 3px; background: var(--ok); }
.vfill.low { background: var(--hi); } .vfill.high { background: var(--bad); }
.vval { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.vval small { color: var(--ink-3); font-weight: 500; font-size: .72rem; }
.vval.low { color: var(--warn); } .vval.high { color: var(--bad); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Biblioteca ---------- */
.searchbar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 55px); z-index: 12; display: flex; flex-direction: column; gap: 10px; margin: -6px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0; padding: 8px max(16px, env(safe-area-inset-left, 0px)) 10px; background: var(--bg); }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search .input { padding-left: 42px; }
.scrollx { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.scrollx::-webkit-scrollbar { display: none; }
.libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.libcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; }
.libcard img { width: 100%; max-width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--media-bg); display: block; }
.libcard div { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 3px; }
.libcard b { font-size: .86rem; line-height: 1.25; }
.libcard small { color: var(--ink-2); font-size: .74rem; }

/* ---------- Progresso ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { fill: var(--accent-soft); }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .pt.last { fill: var(--accent); }
.chart text { fill: var(--ink-3); font-size: 10px; font-family: var(--f-body); }
.chart .bar { fill: var(--accent); }
.chart .bar.dim { fill: var(--accent-soft); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 10px; color: var(--ink-2); font-size: .88rem; }
.empty .ic { width: 34px; height: 34px; color: var(--ink-3); }
details.hist { border-top: 1px solid var(--line); padding: 10px 0; }
details.hist:first-of-type { border-top: 0; }
details.hist summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
details.hist summary::-webkit-details-marker { display: none; }
details.hist[open] summary .ic { transform: rotate(90deg); }
table.mini { width: 100%; font-size: .84rem; border-collapse: collapse; margin-top: 8px; }
table.mini td, table.mini th { padding: 6px 4px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.mini th { color: var(--ink-3); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; }
table.mini td:last-child { font-variant-numeric: tabular-nums; }

/* ---------- Perfil ---------- */
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle:first-of-type { border-top: 0; padding-top: 0; }
.toggle small { display: block; color: var(--ink-3); font-size: .76rem; margin-top: 2px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.toast { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 66px); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; gap: 8px; align-items: center; background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: .88rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); max-width: calc(100vw - 32px); animation: up .2s ease-out; }

@media (max-width: 380px) {
  h1 { font-size: 1.75rem; }
  .hero h2 { font-size: 2rem; }
  .sets td.prev { width: 46px; font-size: .72rem; }
  .timer-time { font-size: 2rem; }
  .ring { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
