@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('fonts/poppins-regular.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('fonts/poppins-medium.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('fonts/poppins-bold.woff') format('woff'); }

:root {
  --green: #4a701c;
  --green-600: #3d5d16;
  --green-100: #e8efdf;
  --green-50: #f3f7ee;
  --gray: #555555;
  --ink: #2b2b2b;
  --muted: #7a7a7a;
  --line: #e4e6e0;
  --bg: #f6f7f4;
  --card: #ffffff;
  --danger: #b3382c;
  --warn: #b7791f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(30, 40, 20, .06), 0 4px 14px rgba(30, 40, 20, .05);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
  --on-green: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #8fbe55;
    --green-600: #a3cf6c;
    --green-100: #26331a;
    --green-50: #1d2615;
    --gray: #c9c9c9;
    --ink: #ececec;
    --muted: #9a9a9a;
    --line: #2f332b;
    --bg: #141612;
    --card: #1e211b;
    --danger: #e0766a;
    --warn: #e0b060;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --on-green: #12170c;
  }
}
:root[data-theme="dark"] {
  --green: #8fbe55; --green-600: #a3cf6c; --green-100: #26331a; --green-50: #1d2615;
  --gray: #c9c9c9; --ink: #ececec; --muted: #9a9a9a; --line: #2f332b; --bg: #141612; --card: #1e211b;
  --danger: #e0766a; --warn: #e0b060; --shadow: 0 1px 2px rgba(0,0,0,.4); --on-green: #12170c;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  padding-top: 56px;
  overscroll-behavior-y: contain;
}
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }
.green { color: var(--green); }
.danger-text { color: var(--danger); }

/* topo */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
body { padding-top: calc(56px + env(safe-area-inset-top, 0px)); }
.mark { height: 26px; width: auto; }
.brand { font-size: 18px; color: var(--green); letter-spacing: .2px; }
.brand b { color: var(--gray); font-weight: 700; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: var(--on-green); border: 0; border-radius: 999px;
  padding: 5px 12px; font-weight: 500; font-variant-numeric: tabular-nums; font-size: 14px;
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

main { padding: 14px 14px calc(var(--tab-h) + var(--safe-b) + 24px); max-width: 640px; margin: 0 auto; }   /* o espaço no fim fica no main para a última linha não ficar atrás da barra de abas */

/* abas inferiores */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--card); border-top: 1px solid var(--line);
  display: flex;
}
.tab {
  flex: 1; min-width: 0;
  border: 0; background: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11.5px; font-weight: 500;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--green); }
.tab.on svg { stroke-width: 2.2; }

/* cartões */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 12px; border: 1px solid var(--line);
}
.card h3 { font-size: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; margin: 18px 4px 8px; }

/* botões */
.btn {
  border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 500;
  background: var(--green); color: var(--on-green); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
}
.btn:active { transform: scale(.98); }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.soft { background: var(--green-100); color: var(--green); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled] { opacity: .5; }
.icon-btn {
  border: 0; background: none; color: var(--muted); width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.icon-btn:active { background: var(--green-100); }

/* segmentado */
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 1px; border-radius: 9px; font-weight: 500; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button.on { background: var(--green); color: var(--on-green); }

/* campos */
label.f { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin: 12px 0 4px; }
.in, select.in, textarea.in {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--card); outline: none;
}
.in:focus { border-color: var(--green); }
textarea.in { min-height: 76px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted);
}
.chip.on { background: var(--green); border-color: var(--green); color: var(--on-green); }
.badge { display: inline-block; background: var(--green-100); color: var(--green); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 500; }

/* listas de treino */
.routine { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.routine:first-of-type { border-top: 0; }
.routine .name { font-weight: 500; }
.today-card { background: var(--green); color: var(--on-green); border: 0; }
.today-card h3 { color: inherit; font-size: 20px; }
.today-card .btn { background: var(--card); color: var(--green); }

/* treino ativo */
.ex-card { padding: 12px 12px 8px; }
.ex-head { display: flex; align-items: center; gap: 8px; }
.ex-head h3 { font-size: 15.5px; flex: 1; }
.ex-last { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.sets { width: 100%; border-collapse: collapse; }
.sets th { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 500; text-align: center; padding: 0 4px 4px; letter-spacing: .05em; }
.sets td { padding: 4px; text-align: center; }
.sets .n { width: 30px; font-weight: 700; color: var(--muted); }
.sets input { width: 100%; text-align: center; padding: 9px 4px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; font-variant-numeric: tabular-nums; }
.sets input:focus { outline: none; border-color: var(--green); background: var(--card); }
.sets tr.done input { background: var(--green-100); border-color: transparent; color: var(--green); font-weight: 700; }
.chk { width: 44px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--muted); font-size: 18px; }
.sets tr.done .chk { background: var(--green); border-color: var(--green); color: var(--on-green); }
.rest-note { font-size: 11px; color: var(--muted); }
.ex-actions { display: flex; gap: 6px; padding: 6px 0 2px; }

.restbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); z-index: 25;
  background: #262a22; color: #fff; border-radius: 16px; padding: 10px 12px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  max-width: 616px; margin: 0 auto;
}
.restbar .t { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 78px; }
.restbar .lbl { font-size: 11px; opacity: .7; line-height: 1.2; }
.restbar button { border: 0; background: rgba(255,255,255,.14); color: inherit; border-radius: 10px; padding: 8px 10px; font-weight: 500; font-size: 13px; min-height: 38px; }
.restbar.over { background: var(--danger); color: #fff; }
.restbar .bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.2); overflow: hidden; }
.restbar .bar i { display: block; height: 100%; background: var(--green); }
.restbar .bar i { background: #9ed65a; }
body.has-rest main { padding-bottom: 84px; }

/* histórico */
.hist-item { border-top: 1px solid var(--line); padding: 10px 0; }
.hist-item:first-child { border-top: 0; }
.hist-detail { margin-top: 8px; font-size: 13.5px; }
.hist-detail .exn { font-weight: 500; margin-top: 8px; }
.hist-detail .st { color: var(--muted); font-variant-numeric: tabular-nums; }

/* gráfico */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--green); opacity: .1; }
.chart .dot { fill: var(--card); stroke: var(--green); stroke-width: 2; }

/* macros */
.kcal-big { font-size: 34px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pbar { height: 9px; background: var(--green-100); border-radius: 6px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--green); border-radius: 6px; transition: width .3s; }
.pbar.over i { background: var(--warn); }
.macro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.macro-grid .v { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.macro-grid .l { font-size: 12px; color: var(--muted); }
.entry { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.entry:first-of-type { border-top: 0; }
.entry .m { font-size: 12px; color: var(--muted); }
.datenav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.datenav .d { font-weight: 700; text-align: center; }

/* sheet */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  background: var(--card); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet .grab { width: 38px; height: 4px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet h3 { font-size: 18px; margin-bottom: 4px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
.ex-edit { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.ex-edit .in { padding: 8px 8px; }
.ex-edit-top { display: flex; align-items: center; gap: 8px; }
.ex-edit-top .exthumb-slot:empty { display: none; }
.ex-edit-mid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.ex-edit-bot { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.ex-edit-bot .in { flex: 1; min-width: 0; }
.mini { font-size: 11px; color: var(--muted); font-weight: 500; display: block; }
.mini .in { margin-top: 2px; }
.foodpick { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.foodpick button { display: flex; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.foodpick button:last-child { border-bottom: 0; }
.foodpick button.on { background: var(--green-100); }
.preview { background: var(--green-50); border-radius: 12px; padding: 10px 12px; margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 4px; }
.preview b { display: block; font-size: 16px; }
.preview span { font-size: 11px; color: var(--muted); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 90px); z-index: 80; background: #262a22; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90%; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .big { font-size: 34px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.stat { background: var(--green-50); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); }
.hormone { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 10px; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.status-dot.ok { background: #4caf50; }

@media print {
  .topbar, .tabbar, .restbar, .no-print, .seg { display: none !important; }
  body { padding: 0; background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* biblioteca de exercícios */
.hscroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .chip { flex: none; }
.libgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.libcard { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; padding: 0; text-align: left; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.libcard img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--green-100); }
.libcard .lc-t { font-weight: 500; font-size: 13.5px; line-height: 1.25; padding: 8px 10px 0; }
.libcard .lc-s { font-size: 11.5px; color: var(--muted); padding: 2px 10px 9px; }
.exthumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; border: 0; padding: 0; background: var(--green-100); flex: none; position: relative; }
.exthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.exthumb::after { content: '▶'; position: absolute; right: 3px; bottom: 3px; font-size: 8px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 1px 4px; }
.ex-edit .exthumb { width: 44px; height: 44px; }
.exanim { position: relative; border-radius: 14px; overflow: hidden; background: #222; aspect-ratio: 3 / 2; }
.exanim img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.exanim img + img { animation: exflip 1.8s infinite; }
@keyframes exflip { 0%, 45% { opacity: 0; } 50%, 95% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .exanim img + img { animation: none; opacity: 0; } }
.exstills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.exstills figure { margin: 0; }
.exstills img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; display: block; }
.exstills figcaption { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 2px; }
.exsteps { margin: 0; padding-left: 20px; line-height: 1.55; }
.exsteps li { margin-bottom: 6px; }
.pick-list { max-height: 46vh; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.pick-row:last-child { border-bottom: 0; }
.pick-row img { width: 60px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.pick-row b { display: block; font-weight: 500; font-size: 14px; }
.pick-row small { color: var(--muted); font-size: 12px; }

/* conta, assinatura, personal */
body.gated .tabbar { display: none; }
.acc-chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 500; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--green-100); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.ex-obs { font-size: 12.5px; background: var(--green-50); border-radius: 10px; padding: 6px 10px; margin: 0 0 8px; }
.plan-card { border: 2px solid var(--green); border-radius: 18px; padding: 18px; text-align: center; background: var(--card); }
.price-big { font-size: 38px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--green); }
.strike { text-decoration: line-through; color: var(--muted); font-size: 15px; }
.perks { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; }
.perks li { padding: 5px 0 5px 24px; position: relative; font-size: 14px; }
.perks li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.demo-note { margin-top: 14px; padding: 8px 12px; border-radius: 10px; background: var(--green-50); font-size: 12px; color: var(--muted); text-align: center; }
.code-box { font-size: 26px; font-weight: 700; letter-spacing: .12em; text-align: center; padding: 12px; border: 2px dashed var(--green); border-radius: 14px; color: var(--green); user-select: all; }
.play { text-align: center; }
.play .pp { font-size: 30px; font-weight: 700; margin: 6px 0; }
.lock-note { font-size: 13px; color: var(--muted); padding: 8px 0; }
.toggle-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.toggle-row:first-of-type { border-top: 0; }
.toggle-row input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.pill-ok { background: var(--green-100); color: var(--green); }
.pill-warn { background: #f6e7c8; color: #8a5a00; }
.pill-bad { background: #f5d6d2; color: #8e2b20; }

/* privacidade */
.linkbtn { background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; font: inherit; cursor: pointer; }
.consent-text { background: var(--green-100); border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.5; }
.policy { max-height: 52vh; overflow: auto; margin-top: 10px; padding-right: 4px; }
.policy h4 { margin: 14px 0 4px; font-size: 14px; }
.policy p, .policy li { font-size: 13px; line-height: 1.55; margin: 0 0 6px; }
.policy ul { padding-left: 18px; margin: 0; }

/* ---------- fotos de evolução ---------- */
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ph-slot { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.ph-th { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; background: var(--green-100); cursor: pointer; }
.ph-empty { width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; border: 1.5px dashed var(--line); background: var(--green-50, var(--green-100)); color: var(--green); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ph-empty.small { font-size: 12px; cursor: default; text-align: center; padding: 8px; }
.ph-fig { height: 82%; width: auto; opacity: .75; }
.ph-name { font-size: 13px; font-weight: 500; margin: 6px 2px; display: flex; align-items: center; gap: 4px; }
.ph-thumbs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ph-mini { width: 54px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--green-100); cursor: pointer; }
.ph-big { width: 100%; max-height: 68vh; object-fit: contain; border-radius: 10px; background: #111; display: block; }
.ph-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-cell { aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--green-100); display: flex; }
.ph-cell img { width: 100%; height: 100%; object-fit: cover; }
.ph-guide { width: 120px; margin: 8px auto 12px; color: var(--green); }
.ph-guide .ph-fig { height: auto; width: 100%; opacity: 1; }
details summary { cursor: pointer; color: var(--green); }

/* ---------- vídeos do personal ---------- */
.vd-player { width: 100%; max-height: 62vh; border-radius: 10px; background: #000; display: block; }

/* nutricionista: cardápio e editor */
.dk-meal { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.dk-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px dashed var(--line); padding: 9px 2px; color: inherit; font: inherit; cursor: pointer; }
.dk-row:first-of-type { border-top: 0; }
.dk-box { flex: none; width: 24px; height: 24px; border: 2px solid var(--green); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--on-green); }
.dk-row.on .dk-box { background: var(--green); }
.dk-row.on .grow > span:first-child { text-decoration: line-through; opacity: .7; }
.dd-meal { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 10px; }

/* plano gratuito */
.free-banner { background: var(--green-50); border-color: var(--green-100); }
.locked { padding-top: 22px; padding-bottom: 20px; }

/* escolha de plano (anual / semestral / mensal) */
.plan-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 8px; text-align: left; }
.plan-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.plan-opt.on { border-color: var(--green); background: var(--green-50); }
.plan-price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--green); }
.plan-price s { font-weight: 400; }

/* meus exercícios */
.libcard .lc-b { position: absolute; top: 6px; left: 6px; background: var(--green-600, #16a34a); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.cx-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cx-ph { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.cx-cap { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.cx-ph img, .cx-empty { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); background: var(--green-100); display: flex; align-items: center; justify-content: center; font-size: 30px; }

/* ---------- cardio ---------- */
.ex-edit:not(.cardio) .only-car { display: none; }
.ex-edit.cardio .only-str { display: none; }
.ex-edit-car { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.ex-edit-car .zone { grid-column: 1 / -1; }
.cardio-chk { display: inline-flex; align-items: center; gap: 2px; font-size: 16px; flex: none; padding: 0 4px; cursor: pointer; }
.cardio-chk input { width: 18px; height: 18px; accent-color: var(--green); }
.sets.car th { text-transform: none; font-size: 12px; }
.sets.car .cs-row[hidden] { display: none; }
.cardio-card .ex-last b { color: var(--green); }

/* ---------- cor do app ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--card); background: var(--sw); box-shadow: 0 0 0 1.5px var(--line); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2.5px var(--ink); }
.locked-sw .swatch { opacity: .85; }

/* ---------- amigos e ranking ---------- */
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.rk-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-top: 1px solid var(--line); border-radius: 10px; }
.rk-row:first-child { border-top: 0; }
.rk-row.me { background: var(--green-50); border-top-color: transparent; box-shadow: inset 0 0 0 1.5px var(--green); }
.rk-row .m { font-size: 12px; color: var(--muted); }
.rk-pos { width: 30px; text-align: center; font-size: 20px; font-weight: 700; flex: none; }
.rk-val { font-size: 15px; white-space: nowrap; text-align: right; }
.fr-found { border: 1.5px solid var(--green); }
.tabbar .tab span { white-space: nowrap; }
@media (max-width: 440px) { .tabbar .tab { font-size: 10.5px; } }
@media (max-width: 380px) { .tabbar .tab { font-size: 10px; } }
.fr-entry { flex-wrap: wrap; }
.fr-entry .grow { min-width: 130px; }
.fr-acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* =========================================================
   LAYOUT DE NAVEGADOR (computador): menu lateral, conteúdo em colunas, janelas no centro
   Liga com body.desk (Mais › Visualização, ou automático em telas de 1000 px ou mais)
   ========================================================= */
body.desk { --side-w: 232px; padding-left: var(--side-w); padding-top: 60px; }
body.desk .topbar { height: 60px; padding: 0 28px; }
body.desk .mark { height: 30px; }
body.desk .brand { font-size: 20px; }
body.desk .tabbar {
  top: 60px; bottom: 0; left: 0; right: auto; width: var(--side-w); height: auto; padding: 18px 12px 18px;
  flex-direction: column; gap: 4px; border-top: 0; border-right: 1px solid var(--line); overflow-y: auto; z-index: 15;
}
body.desk .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 16px; border-radius: 12px; font-size: 15px; text-align: left; }
body.desk .tab:hover { background: var(--green-50); color: var(--ink); }
body.desk .tab.on { background: var(--green-100); color: var(--green); font-weight: 700; }
body.desk main { max-width: 1120px; padding: 28px 32px 48px; margin: 0 auto; }
body.desk .card { padding: 18px; }
body.desk .btn:hover:not(:disabled) { filter: brightness(.94); }
body.desk .seg { max-width: 680px; }
body.desk .restbar { left: calc(var(--side-w) + 24px); right: 24px; bottom: 18px; max-width: 720px; margin: 0 auto; }
body.desk .toast { bottom: 40px; }
/* janelas: no computador abrem no centro, não embaixo */
body.desk .backdrop { align-items: center; }
body.desk .sheet { max-width: 560px; border-radius: 20px; padding: 22px 24px; max-height: 86vh; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: pop .16s ease-out; }
body.desk .sheet .grab { display: none; }
@keyframes pop { from { transform: scale(.97); opacity: .5; } }
/* telas em colunas: os cartões se distribuem em 2 colunas; o que é "faixa" (abas internas, avisos, datas) ocupa a linha toda */
body.desk[data-vtab="treino"] #view, body.desk[data-vtab="comida"] #view, body.desk[data-vtab="corpo"] #view, body.desk[data-vtab="mais"] #view,
body.desk[data-vtab="amigos"] #view, body.desk[data-vtab="buscar"] #view, body.desk[data-vtab="alunos"] #view, body.desk[data-vtab="pacientes"] #view { column-width: 400px; column-gap: 24px; }
body.desk #view > * { break-inside: avoid; }
body.desk #view > .btn { width: 100%; }
body.desk #view > .seg, body.desk #view > .today-card, body.desk #view > .datenav, body.desk #view > .chips, body.desk #view > .free-banner,
body.desk #view > .demo-note, body.desk #view > .empty, body.desk #view > .card.empty { column-span: all; }
body.desk #view > .section-label { break-after: avoid; margin-top: 4px; }
/* treino em andamento e telas de edição: uma coluna só, mais legível */
body.desk.working #view { column-width: auto !important; column-count: 1 !important; max-width: 780px; margin: 0 auto; }
body.desk.gated main { max-width: 600px; padding-top: 36px; }
body.desk.gated { padding-left: 0; }
body.desk.gated .tabbar { display: none; }
/* computador forçado em tela estreita: menu só com os ícones */
@media (max-width: 760px) {
  body.desk { --side-w: 68px; }
  body.desk .tab span { display: none; }
  body.desk .tab { justify-content: center; padding: 12px 0; }
  body.desk main { padding: 16px 14px 40px; }
  body.desk .topbar { padding: 0 14px; }
  body.desk #view { column-width: auto !important; column-count: 1 !important; }
}
@media print { body.desk { padding-left: 0; padding-top: 0; } body.desk main { max-width: none; padding: 0; } }

/* ===== fotos de treino dos amigos ===== */
.po-card { break-inside: avoid; }
.po-img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: cover; border-radius: 14px; margin-top: 10px; background: var(--green-50); cursor: zoom-in; }
.po-img.po-wait { min-height: 220px; animation: po-pulse 1.2s ease-in-out infinite; }
@keyframes po-pulse { 50% { opacity: .55; } }
.po-big { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: var(--green-50); }
.po-acts { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-height: 36px; }
.po-like { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink, inherit); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.po-like .po-heart { font-size: 17px; line-height: 1; }
.po-like.on { border-color: #d83a52; color: #d83a52; background: rgba(216, 58, 82, .08); }
.po-like:active { transform: scale(.96); }
.po-liken { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.po-liken .po-heart { color: #d83a52; }
.po-cap { margin-top: 10px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.po-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.po-sum span { background: var(--green-100); color: var(--green); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; }
.po-prev { border-radius: 14px; overflow: hidden; background: var(--green-50); display: flex; align-items: center; justify-content: center; min-height: 160px; }
.po-stage { position: relative; flex: none; max-width: 100%; line-height: 0; overflow: hidden; }
.po-prev .po-photo { display: block; width: 100%; height: 100%; max-height: 46vh; object-fit: contain; }
.po-tag { position: absolute; transform: translate(-50%, -50%); height: auto; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; border-radius: 8px; outline: 1.5px dashed rgba(255, 255, 255, .85); outline-offset: -1px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .28); }
.po-tag.drag { cursor: grabbing; outline-style: solid; }
.po-tagbar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.po-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.po-chip { font: inherit; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.po-chip.on { background: var(--green); border-color: var(--green); color: var(--on-green, #fff); }
.po-tagopts { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.po-tagopts label { flex: 1; display: flex; align-items: center; gap: 8px; }
.po-tagopts input[type="range"] { flex: 1; min-width: 0; accent-color: var(--green); }
.po-ph { text-align: center; padding: 24px 12px; font-size: 34px; }
@media (prefers-reduced-motion: reduce) { .po-img.po-wait { animation: none; } }
.po-card .m { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ===== Dashboard, gráficos 3D e edição de treino ===== */
.g3 { width: 100%; height: auto; display: block; margin: 6px 0 2px; }
.g3-grid { stroke: var(--line); stroke-dasharray: 3 3; }
.g3-t { fill: var(--muted); font-size: 8.5px; font-family: inherit; }
.g3-v { fill: var(--gray); font-size: 9px; font-weight: 700; font-family: inherit; }
.g3-pr { fill: #8a6a10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g3-pr { fill: #e0b94e; } }
:root[data-theme="dark"] .g3-pr { fill: #e0b94e; }
.g3-ok { fill: var(--green); font-size: 10px; font-weight: 700; font-family: inherit; }
.g3-ref { stroke: var(--green); stroke-width: 1.2; }
.g3-reft { fill: var(--green); font-size: 8.5px; font-weight: 700; font-family: inherit; }
.g3-trk { stroke: var(--green-50); }
.g3-trk2 { stroke: var(--line); }
.g3-ring { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: inherit; }
.g3-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.g3-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; }
.db-ringlbl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; font-size: 10.5px; color: var(--muted); }
.db-ringlbl b { display: block; color: var(--ink); font-size: 12px; }
.db-donut { display: flex; align-items: center; gap: 10px; }
.db-donut .g3 { max-width: 190px; flex: none; }
.evo-tg { display: inline-flex; background: var(--green-50); border-radius: 999px; padding: 2px; }
.evo-tg button { border: 0; background: none; color: var(--muted); font-size: 11px; padding: 4px 11px; border-radius: 999px; }
.evo-tg button.on { background: var(--green); color: var(--on-green); font-weight: 700; }

.db-mh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.db-mh b { font-size: 16px; }
.db-dow, .db-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.db-dow { text-align: center; font-size: 10px; color: var(--muted); font-weight: 500; margin-bottom: 3px; }
.dbc { aspect-ratio: 1 / 1; border-radius: 10px; border: 0; background: none; color: var(--muted); position: relative; display: flex; flex-direction: column; align-items: center; padding: 3px 0 0; font-family: inherit; min-width: 0; }
.dbc.empty { pointer-events: none; }
.dbc .n { font-size: 10px; line-height: 1.1; }
.dbc .dbi { width: 54%; height: auto; margin-top: 2px; }
.dbc.f { color: var(--ink); }
.dbc.f-forca { background: var(--green-50); }
.dbc.f-cardio { background: rgba(217, 100, 43, .14); }
.dbc.f-misto { background: rgba(122, 79, 176, .14); }
.dbc.plan { border: 1.5px dashed var(--line); }
.dbc.plan .dbi { opacity: .45; }
.dbc.missed { border-color: var(--warn); }
.dbc.today { box-shadow: inset 0 0 0 1.5px var(--green); }
.dbc.sel { box-shadow: inset 0 0 0 2.5px var(--green); background: var(--card); }
.dbc.sel.f-forca, .dbc.sel.f-cardio, .dbc.sel.f-misto { background: var(--green-50); }
.dbi { stroke: var(--green); }
.dbi-cardio { stroke: #d9642b; }
.dbi-misto { stroke: #8a62c0; }
.dbpr { position: absolute; top: -3px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: #d9a21b; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--card); }
.dbpr svg { width: 8px; height: 8px; }
.db-leg { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: 10.5px; color: var(--muted); margin-top: 10px; }
.db-leg span { display: flex; align-items: center; gap: 4px; }
.db-leg .dbi { width: 15px; height: 15px; }
.db-leg .dbpr { position: static; border: 0; width: 14px; height: 14px; }
.dbpl { display: inline-block; width: 14px; height: 14px; border: 1.5px dashed #9bb27c; border-radius: 4px; }
.db-stats { margin-top: 10px; grid-template-columns: repeat(4, 1fr); }
.db-dayh { font-weight: 700; margin-bottom: 8px; }
.db-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: var(--green-50); margin-bottom: 6px; }
.db-row.done { cursor: pointer; }
.db-row .dbi { width: 24px; height: 24px; flex: none; }
.db-row.plan { background: var(--card); border: 1.5px dashed var(--line); }
.dbwarn { color: var(--warn); font-weight: 500; }
.badge.pb { background: rgba(60, 100, 190, .12); color: #3b66b8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.pb { color: #8fb0ee; } }
:root[data-theme="dark"] .badge.pb { color: #8fb0ee; }
.db-today { border-left: 4px solid var(--green); }
.db-opts { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.db-opt { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 9px 10px; font-family: inherit; }
.db-opt .dbi { width: 24px; height: 24px; flex: none; }
.db-opt .db-ck { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.db-opt.on { border-color: var(--green); background: var(--green-50); }
.db-opt.on .db-ck { background: var(--green); border-color: var(--green); }
.he-warn { background: rgba(183, 121, 31, .12); color: var(--warn); font-size: 12.5px; }
.he-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.he-set { display: grid; grid-template-columns: 26px 1fr 1fr 28px; gap: 6px; align-items: center; margin-top: 5px; font-size: 11px; color: var(--muted); }
.he-set.he-car { grid-template-columns: 26px repeat(4, 1fr) 28px; }
.he-set .n { font-size: 12px; }
.he-set .in { padding: 7px 6px; text-align: center; min-width: 0; }
.he-x { color: var(--danger); }
.pa-cal { margin-top: 4px; }
.he-meta > div:first-child { grid-column: 1 / -1; }

.twa .mp-only{display:none}
