/*
VOICE   prático e animado, como um bom treinador: frases curtas, números grandes.
IDEA    a prancheta do ginásio: lista do dia, uma linha por série, visto ao lado.
PICTURE o boneco animado de cada exercício e a grelha de séries com toques grandes.
COLOUR  giz branco / grafite à noite; acento tomate para cargas e ação; verde só para "feito".
TYPE    system-ui (funciona offline), números tabulares e pesados; 4 tamanhos.
LAYOUT  coluna única até 560px, barra de navegação em baixo, temporizador fixo por cima.
*/
:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f2ee, #141517);
  --card: light-dark(#ffffff, #1f2124);
  --ink: light-dark(#17181a, #f1efea);
  --mut: light-dark(#6b6b6b, #a2a19c);
  --line: light-dark(#e3e0d9, #2e3034);
  --acc: #e8452c;
  --acc-ink: #ffffff;
  --acc-soft: light-dark(#fde6e1, #3a1f1a);
  --ok: light-dark(#1f8a4c, #3ccf7a);
  --ok-soft: light-dark(#e2f4e9, #173826);
  --fig: light-dark(#17181a, #f1efea);
  --far: light-dark(#a7a59f, #6a6964);
  --eq: light-dark(#d6d3cb, #3b3d42);
  --r: 16px;
}
:root[data-theme=light] { color-scheme: light }
:root[data-theme=dark] { color-scheme: dark }
* { box-sizing: border-box; min-width: 0 }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: clip; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)) }
h1, h2, h3 { margin: 0; line-height: 1.1; text-wrap: balance }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em }
h2 { font-size: 22px; font-weight: 750 }
h3 { font-size: 18px; font-weight: 700 }
p { margin: 0 }
.mut { color: var(--mut) }
.sm { font-size: 14px }
.num { font-variant-numeric: tabular-nums }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 18px }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 14px; white-space: nowrap }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px }
.hero { background: var(--acc); color: var(--acc-ink); border: 0; padding: 20px; position: relative; overflow: hidden }
.hero .mut { color: color-mix(in srgb, var(--acc-ink) 88%, transparent) }
.hero h2 { font-size: 40px; font-weight: 850; letter-spacing: -.02em; margin: 2px 0 6px }
.hero .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px }
.hero .chips span { background: rgb(255 255 255 / .18); padding: 3px 9px; border-radius: 99px; font-size: 14px }
.hero .hrow { display: flex; justify-content: space-between; align-items: center; gap: 8px }
.hero svg.deco { width: 120px; height: 96px; flex: none; margin: -12px -10px -6px 0; pointer-events: none }
.hero svg.deco .fig, .hero svg.deco .head { stroke: #fff; fill: none; stroke-linecap: round; stroke-linejoin: round }
.hero svg.deco .head { fill: #fff }
.hero svg.deco .far { fill: none; stroke: rgb(255 255 255 / .45); stroke-linecap: round; stroke-linejoin: round }
.hero svg.deco .eq, .hero svg.deco .gr { stroke: rgb(255 255 255 / .35); fill: rgb(255 255 255 / .25) }
.hero svg.deco .wt { fill: #ffd8cf; stroke: #ffd8cf }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 650; line-height: 1.2; text-align: center; text-decoration: none }
.btn.pri { background: var(--acc); color: var(--acc-ink); border-color: var(--acc) }
.btn.inv { background: #fff; color: #b22d17; border: 0; font-size: 18px; min-height: 54px; width: 100% }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok) }
.btn.ghost { background: transparent }
.btn.danger { color: #c0321b; border-color: color-mix(in srgb, #c0321b 40%, var(--line)) }
.btn.full { width: 100% }
.row { display: flex; gap: 8px; flex-wrap: wrap }
.row > .btn { flex: 1 1 140px }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden }
.bar > i { display: block; height: 100%; background: var(--acc); border-radius: 99px }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 12px; text-align: center }
.week div { font-size: 13px; color: var(--mut) }
.week b { display: grid; place-items: center; height: 36px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--mut); margin-top: 4px }
.week b.on { background: var(--ok); border-color: var(--ok); color: #fff }
.week b.today { border-color: var(--acc); border-width: 2px; color: var(--ink) }
.list { display: grid; gap: 0 }
.li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line) }
.li:first-child { border-top: 0 }
.li .r { text-align: right; white-space: nowrap }
.tag { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 10px; background: var(--acc-soft); color: var(--acc); font-weight: 800 }
.tag.C { background: var(--ok-soft); color: var(--ok) }

/* Treino em curso */
.wohead { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0 10px; margin: -16px 0 8px; border-bottom: 1px solid var(--line) }
.wohead .row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px }
.wohead .prog { margin-top: 8px }
.ex { scroll-margin-top: 100px }
.ex.done { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)) }
.ex header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start }
.ex .meta { color: var(--mut); font-size: 14px; margin-top: 4px }
.badge { font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 99px; white-space: nowrap; background: var(--acc-soft); color: var(--acc) }
.badge.ok { background: var(--ok-soft); color: var(--ok) }
.last { font-size: 14px; color: var(--mut); margin-top: 8px }
.howbtn { margin-top: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; font-weight: 600 }
.how { margin-top: 12px }
.how[hidden] { display: none }
.figbox { background: var(--bg); border-radius: 12px; aspect-ratio: 200 / 180; max-height: 240px; margin: 0 auto 12px; display: grid; place-items: center }
svg.rig { width: 100%; height: 100%; max-height: 240px }
svg.rig .fig, svg.rig .far { fill: none; stroke: var(--fig); stroke-linecap: round; stroke-linejoin: round }
svg.rig .far { stroke: var(--far) }
svg.rig .head { fill: var(--fig); stroke: none }
svg.rig .eq { fill: var(--eq); stroke: var(--eq); stroke-linecap: round }
svg.rig .gr { stroke: var(--eq) }
svg.rig .wt { fill: var(--acc); stroke: var(--acc); stroke-linecap: round }
svg.rig .wtc { fill: color-mix(in srgb, var(--acc) 30%, transparent); stroke: var(--acc); stroke-width: 2 }
svg.rig .cb { stroke: var(--far) }
svg.rig .ghost { opacity: .22 }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 6px }
.tips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 }
.tips span { font-size: 14px; padding: 4px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); font-weight: 600 }
.avoid { font-size: 15px; padding: 10px 12px; border-radius: 10px; background: var(--acc-soft); margin-bottom: 10px }
.links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 15px }
.links a { color: var(--acc); font-weight: 650 }

.sets { margin-top: 14px; display: grid; gap: 8px }
.shead, .set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 52px; gap: 8px; align-items: center }
.shead.one, .set.one { grid-template-columns: minmax(0, 1fr) 52px }
.shead span { font-size: 13px; color: var(--mut); text-align: center }
.stp { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; height: 50px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg) }
.stp button { border: 0; background: transparent; font-size: 22px; font-weight: 600; color: var(--mut) }
.stp button:active { background: var(--line) }
.stp input { width: 100%; border: 0; background: transparent; text-align: center; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; padding: 0; -moz-appearance: textfield }
.stp input::-webkit-outer-spin-button, .stp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0 }
.chk { height: 50px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-size: 18px; font-weight: 800; color: var(--mut) }
.set.on .chk, .chk.on { background: var(--ok); border-color: var(--ok); color: #fff }
.fin .chk { width: 52px; flex: none }
.set.on .stp { background: var(--ok-soft); border-color: transparent }
.fin { display: flex; align-items: center; justify-content: space-between; gap: 12px }

.rest { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); transform: translateY(110%); visibility: hidden; transition: transform .25s, visibility .25s }
.rest.on { transform: none; visibility: visible }
.rest .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center }
.rest .t { font-size: 32px; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1 }
.rest .t small { font-size: 14px; font-weight: 600; opacity: .7; margin-left: 6px }
.rest .bt { display: flex; gap: 6px }
.rest .bt button { min-height: 44px; min-width: 52px; border-radius: 10px; border: 0; background: rgb(127 127 127 / .28); color: inherit; font-weight: 700 }
.rest .bar { grid-column: 1 / -1; height: 6px; background: rgb(127 127 127 / .3) }
.rest.end { background: var(--ok); color: #fff }

/* Navegação */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom) }
nav.tabs .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) }
nav.tabs a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; font-size: 13px; color: var(--mut); text-decoration: none; font-weight: 600 }
nav.tabs a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
nav.tabs a.on { color: var(--acc) }
body.wo nav.tabs { display: none }

details.lib { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px }
details.lib summary { list-style: none; padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer }
details.lib summary::-webkit-details-marker { display: none }
details.lib summary::after { content: "+"; font-size: 24px; color: var(--mut); line-height: 1 }
details.lib[open] summary::after { content: "−" }
details.lib .body { padding: 0 16px 16px }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px }
.seg button { min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-weight: 650; color: var(--mut) }
.seg button.on { background: var(--acc); color: var(--acc-ink) }
.spark { width: 96px; height: 34px; flex: none }
.spark path { fill: none; stroke: var(--acc); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round }
.spark circle { fill: var(--acc) }
table.h { width: 100%; border-collapse: collapse; font-size: 15px }
table.h td, table.h th { padding: 8px 4px; border-top: 1px solid var(--line); text-align: left }
table.h th { font-size: 13px; color: var(--mut); font-weight: 600; border-top: 0 }
table.h td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap }
label.f { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600 }
label.f input, textarea { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; font-size: 16px; font-weight: 500 }
textarea { width: 100%; min-height: 110px; font-family: ui-monospace, monospace; font-size: 13px }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px }
.tog input { width: 26px; height: 26px; accent-color: var(--acc) }

.sheet { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .45); display: grid; align-items: end }
.sheet[hidden] { display: none }
.sheet .pane { background: var(--card); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; max-height: 85vh; overflow: auto }
.sheet .pane h3 { margin-bottom: 8px }
.sheet .pane .row { margin-top: 16px }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 50; font-weight: 600; font-size: 15px; max-width: 90vw }
.toast[hidden] { display: none }
.warn { background: var(--acc-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px }
.big { font-size: 44px; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 }
.stats div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center }
.stats b { display: block; font-size: 24px; font-variant-numeric: tabular-nums }
.stats span { font-size: 13px; color: var(--mut) }
@media (prefers-reduced-motion: reduce) { .rest { transition: none } }

/* Utilitários (a CSP não permite estilos inline) */
.mt6 { margin-top: 6px } .mt8 { margin-top: 8px } .mt10 { margin-top: 10px } .mb6 { margin-bottom: 6px } .mb12 { margin-bottom: 12px }
.center { text-align: center }
.tr { text-align: right !important }
.hero .heroP { color: color-mix(in srgb, var(--acc-ink) 88%, transparent) }
.hero .btn.inv + .btn.inv { margin-top: 8px }
.hero > .heroP + .btn.inv { margin-top: 14px }
.lirow { display: flex; gap: 12px; align-items: center }
.sumli { flex: 1; padding: 0; border: 0 }
.libtn { width: 100%; background: none; border-width: 1px 0 0; border-style: solid; border-color: var(--line); text-align: left; padding: 12px 0 }
.list .libtn:first-child { border-top: 0 }
.libtns { display: flex; gap: 6px; flex: none }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px }
.libh { margin: 18px 0 10px }
.libsub { font-weight: 500 }
.lnk { color: var(--acc); font-weight: 650 }
.linkbtn { display: block; margin-top: 6px; padding: 6px 0; background: none; border: 0; color: var(--acc); font-weight: 700; text-decoration: underline }
.tag.opt { background: var(--ok-soft); color: var(--ok) }
.note { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)) }
.notetxt { color: var(--ink) }
.notef { margin: 12px 0 }
.exbtns { display: flex; gap: 8px; flex-wrap: wrap }
.warmup summary { padding: 10px 16px }
.finishbtn { margin: 8px 0 10px }
.errs { font-size: 15px; color: var(--ink) }
.seg4 { grid-template-columns: repeat(4, minmax(0, 1fr)) }
.seg4 button { font-size: 14px; padding: 0 2px }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px }
.formgrid label:first-child { grid-column: 1 / -1 }
.sparks { display: flex; gap: 6px }
.sparks .spark { width: 64px }
.goal { padding: 12px 0; border-top: 1px solid var(--line) }
.goal:first-child { border-top: 0; padding-top: 0 }
.goal:last-child { padding-bottom: 0 }
.okt { color: var(--ok); font-weight: 700 }
.okb > i { background: var(--ok) }
body.noplan nav.tabs a:not([data-nav=ajustes]):not([data-nav=hoje]) { display: none }
body.noplan nav.tabs .in { grid-template-columns: 1fr 1fr }
body.wo .wrap { padding-bottom: calc(120px + env(safe-area-inset-bottom)) }
.update { position: fixed; left: 12px; right: 12px; top: calc(8px + env(safe-area-inset-top)); z-index: 45; max-width: 536px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600 }
.update[hidden] { display: none }
.update button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--acc); color: #fff; font-weight: 700 }
