/* Shape 31/12 — interface mobile-first, linguagem visual inspirada no iOS */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-2: #f7f7fa;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .2);
  --text: #1c1c1e;
  --text-2: #6c6c70;
  --text-3: #8e8e93;
  --line: rgba(60, 60, 67, .14);
  --blue: #007aff;
  --blue-soft: rgba(0, 122, 255, .12);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, .15);
  --orange: #ff9500;
  --orange-soft: rgba(255, 149, 0, .15);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, .12);
  --purple: #af52de;
  --ring-1: #ff375f;
  --ring-2: #30d158;
  --ring-3: #0a84ff;
  --glass: rgba(249, 249, 252, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --r: 20px;
  --r-s: 12px;
  --tab-h: 56px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --fill: rgba(120, 120, 128, .24);
    --fill-2: rgba(120, 120, 128, .36);
    --text: #f5f5f7;
    --text-2: #aeaeb2;
    --text-3: #8e8e93;
    --line: rgba(84, 84, 88, .55);
    --blue: #0a84ff;
    --blue-soft: rgba(10, 132, 255, .2);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, .2);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, .2);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, .18);
    --purple: #bf5af2;
    --glass: rgba(22, 22, 24, .78);
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --fill: rgba(120, 120, 128, .24);
  --fill-2: rgba(120, 120, 128, .36);
  --text: #f5f5f7;
  --text-2: #aeaeb2;
  --text-3: #8e8e93;
  --line: rgba(84, 84, 88, .55);
  --blue: #0a84ff;
  --blue-soft: rgba(10, 132, 255, .2);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, .2);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, .2);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, .18);
  --purple: #bf5af2;
  --glass: rgba(22, 22, 24, .78);
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.4 var(--font);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--blue); text-decoration: none; }
b, strong { font-weight: 600; }
h1, h2, h3, h4, p { margin: 0; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--fill); padding: 1px 6px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.ic { width: 22px; height: 22px; flex: none; }

/* ---------- estrutura ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--sat) + 52px) 16px calc(var(--tab-h) + var(--sab) + 32px);
}
.app.wide { max-width: 760px; }
body.bare .app { padding: calc(var(--sat) + 24px) 16px calc(var(--sab) + 24px); }

.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  padding-top: var(--sat);
  background: transparent;
  transition: background .2s, box-shadow .2s;
}
.navbar.scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 .5px 0 var(--line);
}
.navbar-in {
  max-width: 560px; margin: 0 auto; height: 48px; padding: 0 8px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.nb-t { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
.navbar.scrolled .nb-t { opacity: 1; }
.nb-r { justify-self: end; }
.nb-back { display: inline-flex; align-items: center; gap: 2px; padding: 8px; color: var(--blue); font-size: 17px; }
.nb-back .ic { width: 22px; height: 22px; margin-left: -6px; }

.title-block { padding: 8px 4px 14px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); }
.title { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; margin-top: 2px; }
.lead { color: var(--text-2); margin-top: 6px; font-size: 15px; }

/* ---------- barra de abas ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  display: flex; justify-content: center; gap: 0;
  padding: 6px 8px calc(var(--sab) + 4px);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 -.5px 0 var(--line);
}
.tab {
  flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0; color: var(--text-3); font-size: 10.5px; font-weight: 500; letter-spacing: 0;
}
.tab .ic { width: 25px; height: 25px; stroke-width: 1.7; }
.tab.on { color: var(--blue); }
.tab.on .ic { stroke-width: 2.1; }

/* ---------- cartões ---------- */
.card {
  background: var(--card); border-radius: var(--r); padding: 18px;
  margin-bottom: 14px; box-shadow: var(--shadow); display: block; color: inherit;
}
.card.flush { padding: 0; overflow: hidden; }
.card.empty { text-align: center; padding: 28px 20px; }
.card.empty .btn { margin-top: 14px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-h .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.card-h .ic { width: 16px; height: 16px; }
.h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.h3 { font-size: 17px; font-weight: 600; line-height: 1.25; }
.h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); margin: 14px 0 6px; }
.section-h { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); margin: 24px 6px 8px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }
.center { text-align: center; }
.pad { padding: 20px 0; }
.pad-x { padding: 0 6px 10px; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 4px; display: block; }
.link { font-size: 15px; }
.right { text-align: right; display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.right.col { flex-direction: column; align-items: flex-end; gap: 0; }
.stack { display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { background: linear-gradient(135deg, var(--blue-soft), transparent 70%), var(--card); }
.tip p { margin-top: 4px; font-size: 15px; }

.card.hero { padding-bottom: 14px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.big-num { font-size: 64px; line-height: .95; font-weight: 700; letter-spacing: -.04em; }
.stat { display: flex; flex-direction: column; text-align: right; }
.stat-n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat-n small { font-size: 14px; font-weight: 500; color: var(--text-2); }
.stat .muted { font-size: 13px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: left; }
.stats3 .stat { text-align: left; }
.stats3 .stat-n { font-size: 22px; }
.goals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.goals div { display: flex; flex-direction: column; }
.goals b { font-size: 22px; letter-spacing: -.02em; }
.goal-row { display: flex; justify-content: space-between; margin: 14px 0 6px; }

/* ---------- barra de progresso ---------- */
.bar { height: 10px; background: var(--fill); border-radius: 99px; overflow: hidden; }
.bar.thin { height: 6px; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar.k i { background: var(--orange); }
.bar.p i { background: var(--green); }

/* ---------- anéis ---------- */
.rings-row { display: flex; align-items: center; gap: 18px; }
.rings { flex: none; }
.ring-t, .ring-p { fill: none; stroke-width: 13; stroke-linecap: round; }
.ring-t { opacity: .2; }
.ring-p { stroke-dasharray: var(--c); stroke-dashoffset: var(--o); transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; flex: 1; min-width: 0; }
.legend li { display: flex; gap: 10px; align-items: center; }
.legend i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.legend b { font-size: 15px; }
.legend span { font-size: 14px; color: var(--text-2); }

/* ---------- semana ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 10px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 600; }
.wk i {
  width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill); font-style: normal; font-size: 14px; color: var(--text-2); font-weight: 700;
}
.wk i .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.wk.plan i { background: var(--blue-soft); color: var(--blue); }
.wk.done i { background: var(--green); color: #fff; }
.wk.missed i { background: var(--red-soft); color: var(--red); }
.wk.today span { color: var(--blue); }
.wk.today i { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--blue); }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--blue); color: #fff; font-weight: 600; font-size: 17px; text-align: center;
  transition: transform .12s, opacity .12s, filter .12s;
}
.btn:active { transform: scale(.97); opacity: .85; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: var(--fill); color: var(--blue); }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn .ic { width: 20px; height: 20px; }
.btn:focus-visible, .input:focus-visible, .tab:focus-visible, .row:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue-soft); outline-offset: 1px;
}
.icon-btn { background: transparent; border: 0; color: var(--text-3); padding: 6px; border-radius: 8px; cursor: pointer; }
.icon-btn:active { background: var(--fill); }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 0; border-radius: 12px;
  background: var(--fill); font-size: 17px; appearance: none; -webkit-appearance: none;
}
textarea.input { resize: vertical; line-height: 1.4; }
.input.mono { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.input::placeholder { color: var(--text-3); }
.input.file { padding: 10px 12px; font-size: 15px; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- controle segmentado ---------- */
.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; margin-bottom: 16px; gap: 2px; }
.seg a, .seg button {
  flex: 1; text-align: center; padding: 7px 8px; border-radius: 8px; border: 0; background: transparent;
  color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer;
}
.seg .on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); font-weight: 600; }
:root[data-theme="dark"] .seg .on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg .on { background: #636366; } }

/* ---------- chips e avisos ---------- */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; background: var(--fill); color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.chip.accent { background: var(--blue-soft); color: var(--blue); }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.warn { background: var(--orange-soft); color: var(--orange); margin-bottom: 12px; }
.chip.block { display: flex; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.banner { padding: 13px 16px; border-radius: 14px; margin-bottom: 14px; font-size: 15px; background: var(--green-soft); color: var(--text); border-left: 4px solid var(--green); }
.banner.err { background: var(--red-soft); border-left-color: var(--red); }
.banner.info { background: var(--blue-soft); border-left-color: var(--blue); }

/* ---------- listas ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { position: relative; }
.list > li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--line); }
.list.tight > li { padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row > .ic:last-child { color: var(--text-3); width: 18px; height: 18px; }
.row:active, .row-check:active, .meal:active { background: var(--fill); }
.row-i { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; }
.row-i .ic { width: 18px; height: 18px; }
.i-blue { background: var(--blue); } .i-green { background: var(--green); } .i-orange { background: var(--orange); } .i-gray { background: #8e8e93; } .i-purple { background: var(--purple); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.card:not(.flush) .list.tight > li + li::before { left: 0; }
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; }
.kv-row > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.card:not(.flush) .kv-row { padding-left: 0; padding-right: 0; }
.pos { color: var(--green); font-weight: 600; } .neg { color: var(--red); font-weight: 600; }
.bul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }

/* itens marcáveis */
.row-check, .meal { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); }
.row-check .lbl { flex: 1; }
.meal { align-items: flex-start; }
.box { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--fill-2); display: grid; place-items: center; flex: none; color: transparent; transition: .18s; margin-top: 1px; }
.box .ic { width: 15px; height: 15px; stroke-width: 3; }
.on > .box { background: var(--green); border-color: var(--green); color: #fff; }
.row-check.on .lbl { color: var(--text-2); }
.meal-b { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.meal-t { display: flex; justify-content: space-between; gap: 10px; }
.time { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 14px; }
.macro { display: grid; gap: 14px; margin-bottom: 10px; }
.m-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.m-top b { font-size: 24px; letter-spacing: -.02em; }
.macro-s { display: flex; gap: 16px; flex-wrap: wrap; }

/* cartão de link (treinos) */
.link-card { display: flex; align-items: center; gap: 14px; transition: transform .12s; }
.link-card:active { transform: scale(.985); }
.link-card.locked { opacity: .5; pointer-events: none; }
.link-card.is-today { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.lc-badge { width: 46px; height: 46px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.lc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lc-go { color: var(--text-3); width: 18px; height: 18px; }

/* ---------- sanfona ---------- */
.fold { padding: 0; overflow: hidden; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; font-weight: 600; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary > span { display: inline-flex; align-items: center; gap: 8px; }
.fold > summary > span.stk { flex-direction: column; align-items: flex-start; gap: 0; }
.fold > summary .ic { width: 18px; height: 18px; }
.fold-i { color: var(--text-3); transition: transform .2s; }
.fold[open] > .fold-i, .fold[open] > summary .fold-i { transform: rotate(90deg); }
.fold > :not(summary) { padding: 0 18px 4px; }
.fold > p:last-child, .fold > ul:last-child { padding-bottom: 18px; }
.fold.in { background: transparent; box-shadow: none; margin: 0; border-radius: 0; }
.fold.in > summary { padding: 12px 0; color: var(--blue); font-weight: 500; font-size: 15px; }
.fold.in > :not(summary) { padding: 0 0 8px; font-size: 15px; }
.fold.in > p + p { margin-top: 8px; }
.phase.done { opacity: .75; }
.card.fold.phase summary small { font-weight: 400; font-size: 13px; }

/* ---------- treino (sessão) ---------- */
.ss-tag { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--orange); font-weight: 600; margin: 4px 8px 6px; }
.ss-tag .ic { width: 16px; height: 16px; }
.ex.in-ss { border-left: 4px solid var(--orange); }
.ex-h { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.ex-n { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.ex-t { flex: 1; min-width: 0; }
.ex-count { font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 14px; font-weight: 600; }
.ex.complete .ex-n { background: var(--green); color: #fff; }
.ex.complete .ex-count { color: var(--green); }
.last { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); margin: 4px 0 8px; }
.last .ic { width: 16px; height: 16px; }
.sets { display: grid; gap: 8px; margin: 8px 0 6px; }
.sets-h, .set { display: grid; grid-template-columns: 34px 1fr 1fr 48px; gap: 8px; align-items: center; }
.sets-h { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; text-align: center; }
.set-n { text-align: center; font-weight: 700; color: var(--text-3); }
.set .input, .set input { min-height: 46px; text-align: center; font-size: 19px; font-weight: 600; padding: 8px; border: 0; border-radius: 12px; background: var(--fill); width: 100%; font-variant-numeric: tabular-nums; }
.set input::placeholder { color: var(--text-3); font-weight: 400; }
.set-ok { width: 48px; height: 46px; border-radius: 12px; border: 0; background: var(--fill); color: var(--text-3); display: grid; place-items: center; cursor: pointer; transition: .15s; }
.set-ok .ic { stroke-width: 2.6; }
.set.done .set-ok { background: var(--green); color: #fff; }
.set.done input { background: var(--green-soft); }
.set-ok:active { transform: scale(.92); }

.scale { display: flex; gap: 8px; }
.scale label { flex: 1; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span { display: grid; place-items: center; height: 46px; border-radius: 12px; background: var(--fill); font-weight: 600; cursor: pointer; transition: .15s; }
.scale input:checked + span { background: var(--blue); color: #fff; }
.scale input:focus-visible + span { outline: 3px solid var(--blue-soft); }

.rest-timer {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + var(--sab) + 12px); z-index: 40;
  max-width: 536px; margin: 0 auto; padding: 12px 14px 12px 18px; border-radius: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .22), 0 0 0 .5px var(--line);
}
.rest-timer > div:first-child { display: flex; flex-direction: column; line-height: 1.1; }
.rest-timer b { font-size: 30px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rest-actions { display: flex; gap: 6px; }
.rest-timer.end b { color: var(--green); }

/* ---------- gráficos ---------- */
.chart { width: 100%; height: auto; display: block; }
.gl { stroke: var(--line); stroke-width: .6; }
.gt { fill: var(--text-3); font-size: 10px; font-family: var(--font); }
.gt.acc { fill: var(--green); }
.goal { stroke: var(--green); stroke-width: 1; stroke-dasharray: 3 3; }
.ln-d { fill: none; stroke: var(--fill-2); stroke-width: 1.5; stroke-linejoin: round; }
.ln-w { fill: none; stroke: var(--blue); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dt { fill: var(--card); stroke: var(--text-3); stroke-width: 1.5; }
.key { font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.key i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.k-d { background: var(--fill-2); } .k-w { background: var(--blue); }
.spark { width: 60px; height: 22px; }
.spark polyline { fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; align-items: end; margin-bottom: 10px; }
.bcol { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); }
.bcol b { font-size: 15px; color: var(--text); }
.btrack { width: 100%; max-width: 26px; height: 90px; background: var(--fill); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.btrack i { display: block; width: 100%; background: var(--blue); border-radius: 8px; min-height: 0; }

.advice { border-left: 4px solid var(--blue); }
.advice.good { border-left-color: var(--green); }
.advice.warn { border-left-color: var(--orange); }

/* ---------- login / instalação ---------- */
.auth { min-height: calc(100dvh - 48px); display: grid; place-items: center; }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 28px; padding: 32px 24px; text-align: center; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 520px; text-align: left; }
.auth-card h1 { font-size: 28px; letter-spacing: -.02em; margin: 14px 0 6px; }
.auth-card p { margin-bottom: 20px; }
.auth-card .stack, .auth-card .field { text-align: left; }
.auth-icon { border-radius: 20px; display: block; margin: 0 auto; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.auth-card.wide .auth-icon { margin: 0; }
.diag { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.diag li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.diag li div { display: flex; flex-direction: column; }
.diag small { color: var(--red); margin-top: 2px; font-size: 13px; }
.diag-i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.diag-i .ic { width: 14px; height: 14px; stroke-width: 3; }
.diag .ok .diag-i { background: var(--green); } .diag .bad .diag-i { background: var(--red); }

.user-row { padding: 12px 16px; }
.ur-h { display: flex; justify-content: space-between; align-items: center; }
.ur-h > div { display: flex; flex-direction: column; gap: 2px; }
.user-row .fold.in > summary { padding: 8px 0 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--sab) + 20px); transform: translate(-50%, 20px);
  background: rgba(40, 40, 42, .94); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(215, 40, 30, .95); }

/* ---------- telas maiores ---------- */
@media (min-width: 760px) {
  .app { padding-top: 70px; }
  .title { font-size: 40px; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; border-radius: 22px; padding: 6px 10px; width: 480px; box-shadow: 0 8px 30px rgba(0, 0, 0, .16), 0 0 0 .5px var(--line); }
  .app { padding-bottom: 110px; }
  .rest-timer { bottom: 100px; }
}

@media (max-width: 360px) {
  .title { font-size: 30px; }
  .big-num { font-size: 54px; }
  .goals b { font-size: 19px; }
  .rings { width: 124px; height: 124px; }
  .sets-h, .set { grid-template-columns: 26px 1fr 1fr 44px; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ===== v2: gráficos ===== */
.ln { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ln.s1, .lg.s1 { stroke: var(--blue); background: var(--blue); }
.ln.s2, .lg.s2 { stroke: var(--green); background: var(--green); }
.ln.s3, .lg.s3 { stroke: var(--text-3); background: var(--text-3); }
.ln.s4, .lg.s4 { stroke: var(--orange); background: var(--orange); }
.ln { background: none !important; }
.dt.s1 { fill: var(--blue); stroke: var(--card); stroke-width: 1.5; }
.dt.s2 { fill: var(--green); stroke: var(--card); stroke-width: 1.5; }
.dt.s3 { fill: var(--fill-2); stroke: var(--text-3); }
.dt.s4 { fill: var(--orange); stroke: var(--card); stroke-width: 1.5; }
.dt { cursor: pointer; }
.dt:hover, .dt.on { stroke: var(--text); stroke-width: 2; }
.bar-r { fill: var(--blue); cursor: pointer; transition: opacity .15s; }
.bar-r:hover, .bar-r.on { opacity: .75; }
.gt.v { fill: var(--text-2); font-weight: 600; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.lg.miss { background: var(--red-soft); border: 1px solid var(--red); }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 6px 10px; border-radius: 8px; max-width: 260px; opacity: 0; transition: opacity .12s; transform: translate(-50%, -120%); white-space: nowrap; }
.chart-tip.show { opacity: 1; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: 110px 1fr 56px; align-items: center; gap: 10px; font-size: 14px; }
.hb-t { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.hb-t i.low { background: var(--orange); }
.hb-t i.high { background: var(--red); }
.hb-v { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.mini { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.mini th, .mini td { text-align: left; padding: 6px 0; border-top: 1px solid var(--line); }
.advice.inner { margin-top: 12px; padding: 12px 14px; border-radius: 12px; }

/* ===== v2: formulários e utilidades ===== */
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row form { display: contents; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
label.row-check { padding: 6px 0; cursor: pointer; gap: 10px; align-items: flex-start; }
label.row-check input[type=checkbox], .chipcheck input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; margin-top: 1px; }
.scale.days { flex-wrap: wrap; }
.scale.days label { flex: 1 0 12%; min-width: 44px; }
.scale input[type=checkbox]:checked + span { background: var(--blue); color: #fff; }
.chipcheck { display: flex; flex-wrap: wrap; gap: 8px; }
.chipcheck label { position: relative; }
.chipcheck input { position: absolute; opacity: 0; }
.chipcheck span { display: inline-block; padding: 7px 12px; border-radius: 99px; background: var(--fill); font-size: 14px; cursor: pointer; }
.chipcheck input:checked + span { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.chipcheck input:focus-visible + span { outline: 3px solid var(--blue-soft); }
.steps { padding-left: 20px; margin: 4px 0; display: flex; flex-direction: column; gap: 8px; }
.steps li::marker { color: var(--blue); font-weight: 700; }
.terms { max-height: 55vh; overflow: auto; text-align: left; font-size: 14px; color: var(--text-2); margin: 12px 0; line-height: 1.5; }
.calc-out { padding: 12px 14px; background: var(--card-2); border-radius: 12px; margin: 10px 0; line-height: 1.6; }
.kv-row.head { padding-bottom: 4px; }
.neg { color: var(--red); }
.thead-note { font-size: 12px; }

/* ===== v2: calendário e mapa de calor ===== */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; text-align: center; }
.cal-h { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; }
.cal-d { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-size: 14px; color: var(--text-2); }
.cal-d.done { background: var(--blue); color: #fff; font-weight: 700; }
.cal-d.miss { background: var(--red-soft); color: var(--red); }
.cal-d.today { outline: 2px solid var(--blue); outline-offset: 1px; }
.heat { display: flex; gap: 4px; justify-content: space-between; }
.heat-c { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.heat i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--fill); }
.heat i.h1 { background: color-mix(in srgb, var(--blue) 45%, var(--fill)); }
.heat i.h2 { background: color-mix(in srgb, var(--blue) 75%, var(--fill)); }
.heat i.h3 { background: var(--blue); }
.heat i.fut { opacity: .35; }

/* ===== v2: conquistas ===== */
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.badge { background: var(--card); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); opacity: .75; }
.badge.on { opacity: 1; }
.badge-i { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--fill); color: var(--text-3); margin-bottom: 4px; }
.badge.on .badge-i { background: var(--green-soft); color: var(--green); }
.badge .ic { width: 20px; height: 20px; }

/* ===== v2: fotos ===== */
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ph { margin: 0; background: var(--card); border-radius: var(--r-s); overflow: hidden; box-shadow: var(--shadow); }
.ph img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: var(--fill); }
.ph figcaption { padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.ph-act { width: 100%; font-size: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare figure { margin: 0; text-align: center; }
.compare img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: var(--fill); }
.compare figcaption { font-size: 12px; color: var(--text-2); margin-top: 4px; }

@media print {
  .tabbar, .navbar, .btn, .seg, .toast, [data-print] { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
[hidden] { display: none !important; }
