/* Body Health — design system
 * Layout: app shell com barra lateral (≥ 960px) e barra de abas inferior no celular.
 * Identidade: esmeralda profunda (energia + saúde) com detalhes em dourado (conquistas, premium),
 * neutros com leve viés verde, tipografia Sora (títulos/números) + Manrope (texto). */
:root {
  --bg: #f3f5f1;
  --card: #ffffff;
  --surface: #edf1eb;
  --surface-2: #e4eae2;
  --text: #0e1a16;
  --muted: #5f6e67;
  --border: #e0e6de;
  --accent: #0d7a5f;
  --accent-dark: #095c47;
  --accent-soft: rgba(13, 122, 95, 0.10);
  --on-accent: #ffffff;
  --gold: #b07a2a;
  --gold-soft: rgba(176, 122, 42, 0.12);
  --danger: #cf3f3f;
  --success: #1c9466;
  --warn: #c97d10;
  --info: #2b77b8;
  --blush: #f1eee6;
  --hero-from: #0b3d31;
  --hero-to: #0d7a5f;
  --on-hero: #f4fbf8;
  --shadow: 0 1px 2px rgba(14, 26, 22, 0.04), 0 8px 24px rgba(14, 26, 22, 0.06);
  --shadow-lg: 0 24px 60px rgba(14, 26, 22, 0.18);
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: "Sora", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar: 248px;
  --tabbar: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090e0c; --card: #111815; --surface: #17201c; --surface-2: #1e2924; --text: #eaf2ee; --muted: #93a39b;
    --border: #212d28; --accent: #3ccb9c; --accent-dark: #74e0bd; --accent-soft: rgba(60, 203, 156, 0.13); --on-accent: #03140d;
    --gold: #e2b467; --gold-soft: rgba(226, 180, 103, 0.14); --danger: #f07c7c; --success: #4fd39b; --warn: #f0b04f; --info: #6fb3ea;
    --blush: #1a231f; --hero-from: #0d2a22; --hero-to: #12523f; --on-hero: #eafaf3;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28); --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090e0c; --card: #111815; --surface: #17201c; --surface-2: #1e2924; --text: #eaf2ee; --muted: #93a39b;
  --border: #212d28; --accent: #3ccb9c; --accent-dark: #74e0bd; --accent-soft: rgba(60, 203, 156, 0.13); --on-accent: #03140d;
  --gold: #e2b467; --gold-soft: rgba(226, 180, 103, 0.14); --danger: #f07c7c; --success: #4fd39b; --warn: #f0b04f; --info: #6fb3ea;
  --blush: #1a231f; --hero-from: #0d2a22; --hero-to: #12523f; --on-hero: #eafaf3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28); --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5); color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; z-index: 400; }
.skip:focus { left: 1rem; }
.ico { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 120;
  background: var(--card); border-right: 1px solid var(--border);
  display: none; flex-direction: column; gap: .25rem; padding: 1.25rem .9rem;
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
}
.sidebar .logo { padding: .25rem .6rem 1.25rem; }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; }
.sidebar .nav-btn { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: .93rem; border: none; }
.sidebar .nav-btn:hover { background: var(--surface); color: var(--text); }
.sidebar .nav-btn.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .nav-sep { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 1rem .75rem .35rem; font-weight: 700; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .25rem 0; }
.premium-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); background: var(--gold-soft); padding: .25rem .6rem; border-radius: 999px; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-row { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem max(16px, env(safe-area-inset-right, 0px)) .7rem max(16px, env(safe-area-inset-left, 0px)); }
.logo { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: .55rem; }
.logo span { color: var(--accent); }
.logo img { width: 30px; height: 30px; border-radius: 9px; }
.header-tools { display: flex; gap: .4rem; align-items: center; }
.sync-badge { font-size: .72rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; background: var(--surface); color: var(--muted); text-decoration: none; white-space: nowrap; }
.sync-badge[data-state="ok"] { color: var(--success); }
.sync-badge[data-state="error"], .sync-badge[data-state="offline"] { color: var(--danger); }
.sync-badge[data-state="pending"], .sync-badge[data-state="syncing"] { color: var(--warn); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 130;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--border);
  padding: .35rem max(8px, env(safe-area-inset-right, 0px)) calc(.35rem + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
}
.tabbar .nav-btn { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem 0; color: var(--muted); text-decoration: none; font-size: .68rem; font-weight: 700; border: none; background: none; cursor: pointer; font-family: inherit; border-radius: 12px; }
.tabbar .nav-btn.active { color: var(--accent); }
.tabbar .nav-btn.active .ico { stroke-width: 2.2; }

main { max-width: 1120px; margin: 0 auto; padding: 1.4rem max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabbar) + 2rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); outline: none; }
footer { text-align: center; padding: 1.5rem 1rem calc(var(--tabbar) + 1.5rem + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: .78rem; }
footer p { max-width: 70ch; margin: 0 auto .3rem; }

@media (min-width: 960px) {
  .sidebar { display: flex; }
  .tabbar, .topbar .logo { display: none; }
  .topbar, main, footer { margin-left: var(--sidebar); }
  .topbar .header-row { justify-content: flex-end; }
  main { padding-bottom: 2.5rem; }
  footer { padding-bottom: 2rem; }
}

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.15rem); line-height: 1.15; margin-bottom: .35rem; font-weight: 700; }
h2 { font-size: 1.08rem; color: var(--text); margin-bottom: .8rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.eyebrow { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--accent); }
hr { border: none; border-top: 1px solid var(--border); margin: 1.1rem 0; }
.page-head { margin: .25rem 0 1.25rem; }
.page-head p { max-width: 68ch; }

/* ---------- Superfícies ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 1.35rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); min-width: 0; border: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.card.highlight { background: var(--accent-soft); box-shadow: none; border-color: transparent; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.card-head h2, .card-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 0 1.1rem; }

/* Hero (início) */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 1.6rem; margin-bottom: 1.1rem; color: var(--on-hero);
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--hero-to) 85%, #ffffff 15%) 0%, var(--hero-to) 35%, var(--hero-from) 100%);
  box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; align-items: center;
}
.hero::after { content: ""; position: absolute; inset: auto -10% -60% 40%; height: 120%; background: radial-gradient(closest-side, rgba(255, 255, 255, 0.10), transparent); pointer-events: none; }
.hero h1 { color: var(--on-hero); margin-bottom: .25rem; }
.hero .muted { color: color-mix(in srgb, var(--on-hero) 72%, transparent); }
.hero .eyebrow { color: color-mix(in srgb, var(--on-hero) 80%, transparent); }
.hero .btn.primary { background: var(--on-hero); color: var(--hero-from); }
.hero .btn.primary:hover { background: #ffffff; }
.hero .btn.ghost { color: var(--on-hero); border-color: color-mix(in srgb, var(--on-hero) 35%, transparent); }
.hero-chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.16); padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.hero .actions { margin-top: 1.1rem; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: rgba(255, 255, 255, 0.16); }
.ring .bar { stroke: var(--on-hero); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-family: var(--font-display); font-size: 1.75rem; line-height: 1; }
.ring-label span { font-size: .7rem; opacity: .8; text-transform: uppercase; letter-spacing: .06em; margin-top: .25rem; }

/* Métricas */
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: .65rem; }
.metric { padding: .9rem 1rem; background: var(--surface); border-radius: 16px; min-width: 0; }
.metric .label { color: var(--muted); font-size: .76rem; font-weight: 600; }
.metric .value { font-family: var(--font-display); font-size: 1.42rem; font-weight: 650; color: var(--text); line-height: 1.25; word-break: break-word; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.small-metrics .value { font-size: 1.15rem; }
.metric .sub { font-size: .74rem; color: var(--muted); display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .1rem; }
.delta { font-weight: 800; }
.delta.good { color: var(--success); }
.delta.bad { color: var(--danger); }

.progress-wrap { margin-top: 1.1rem; }
.progress-label { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; margin-bottom: .4rem; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); border-radius: 999px; transition: width .6s; }

.onboarding { border: 1px dashed var(--accent); box-shadow: none; }
.steps { padding-left: 1.25rem; display: grid; gap: .35rem; margin-bottom: .5rem; }
.steps li.done { color: var(--muted); text-decoration: line-through; }
.tips { padding-left: 1.2rem; color: var(--muted); margin-bottom: 1rem; display: grid; gap: .2rem; }

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .15rem 1rem; }
.field { min-width: 0; }
.full { grid-column: 1 / -1; }
label { display: block; margin: .7rem 0 .3rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
label.check { display: flex; gap: .55rem; align-items: center; color: var(--text); cursor: pointer; font-weight: 600; }
label.check input { width: auto; accent-color: var(--accent); }
input, select, textarea {
  width: 100%; padding: .75rem .9rem; background: var(--surface); border: 1.5px solid transparent;
  border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 1rem; min-width: 0; transition: border-color .15s, background .15s;
}
input:hover, select:hover, textarea:hover { background: var(--surface-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .65; }
.inline { display: flex; gap: .5rem; align-items: center; }
.inline.wrap { flex-wrap: wrap; }
.inline input, .inline select { width: auto; flex: 1 1 180px; }
.inline label.inline { margin: 0; color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1.5px solid transparent; padding: .72rem 1.2rem; border-radius: 999px; font-weight: 750; letter-spacing: -0.005em;
  cursor: pointer; font-size: .93rem; font-family: inherit; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.gold { background: var(--gold); color: #1d1406; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.small { padding: .42rem .85rem; font-size: .83rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.file-btn { cursor: pointer; }
.icon-btn { display: inline-grid; place-items: center; background: transparent; border: none; border-radius: 10px; cursor: pointer; padding: .35rem .5rem; font-size: .95rem; color: var(--muted); min-width: 34px; min-height: 34px; }
.icon-btn:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.row-actions { display: flex; gap: .25rem; align-items: center; white-space: nowrap; justify-content: flex-end; }

.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); padding: .12rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 800; vertical-align: middle; letter-spacing: .01em; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0; }
.chip { background: var(--surface); border: 1.5px solid transparent; color: var(--text); padding: .4rem .85rem; border-radius: 999px; cursor: pointer; font-size: .83rem; font-weight: 650; font-family: inherit; }
.chip:hover { border-color: var(--border); }
.chip.active { background: var(--text); color: var(--bg); }

/* Tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .65rem .55rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.table tbody tr:hover { background: var(--surface); }

/* Gráficos */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.chart-container { position: relative; height: 260px; margin-top: .5rem; min-width: 0; }

/* Volume muscular */
.volume-list { display: grid; gap: .5rem; margin-top: .5rem; }
.vol-row { display: grid; grid-template-columns: 95px 1fr 40px; gap: .6rem; align-items: center; font-size: .88rem; }
.vol-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.vol-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.vol-fill { height: 100%; border-radius: 999px; }
.vol-fill.ok { background: var(--success); }
.vol-fill.low { background: var(--warn); }
.vol-fill.high { background: var(--danger); }
.vol-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .3; }

.analysis ul { padding-left: 1.2rem; display: grid; gap: .55rem; }

/* Fotos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.photo-slot { border: 2px dashed var(--border); border-radius: 18px; aspect-ratio: 3 / 4; position: relative; overflow: hidden; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.photo-slot.has { border-style: solid; border-color: transparent; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-label { position: absolute; top: .55rem; left: .55rem; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(6px); padding: .15rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 800; z-index: 1; }
.photo-empty { color: var(--muted); text-align: center; font-size: .88rem; }
.photo-del { position: absolute; top: .45rem; right: .45rem; z-index: 2; background: var(--card); }
.photo-pick { display: flex; gap: .4rem; margin-top: .55rem; }
.photo-pick .btn { flex: 1; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.compare figure { background: var(--surface); border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: center; }
.compare img { width: 100%; flex: 1; object-fit: cover; min-height: 0; }
.compare figcaption { text-align: center; padding: .35rem; font-size: .82rem; color: var(--muted); }

/* Biblioteca */
.ex-list { display: grid; gap: .55rem; }
.ex-item, .workout-item { background: var(--surface); border-radius: 16px; padding: .85rem 1rem; }
.ex-item summary, .workout-item summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.workout-item summary > span:first-of-type { margin-right: auto; }
.ex-item[open] summary, .workout-item[open] summary { margin-bottom: .6rem; }
.ex-item p { margin: .35rem 0; }
.workout-item { margin-bottom: .5rem; }
.workout-item ul { padding-left: 1.2rem; margin: .4rem 0; }
.log { white-space: pre-wrap; font-family: inherit; color: var(--muted); margin: .4rem 0; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›"; color: var(--muted); margin-right: .35rem; transition: transform .2s; display: inline-block; font-weight: 800; }
details[open] > summary::before { transform: rotate(90deg); }
.card > details > summary { margin-top: .75rem; color: var(--muted); font-weight: 650; cursor: pointer; }

/* Plano */
.plan-list { list-style: none; counter-reset: ex; display: grid; gap: .45rem; }
.plan-list li { counter-increment: ex; display: flex; justify-content: space-between; align-items: center; gap: .6rem; background: var(--surface); border-radius: 14px; padding: .6rem .75rem; }
.plan-list li::before { content: counter(ex); font-family: var(--font-display); font-weight: 700; color: var(--accent); min-width: 1.4rem; text-align: center; }
.plan-ex { flex: 1; display: flex; flex-wrap: wrap; gap: .1rem .6rem; align-items: baseline; min-width: 0; }
.presc { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 750; font-size: .88rem; }
.add-row { margin-top: .8rem; }

/* Sessão */
.sets { display: grid; gap: .4rem; margin: .6rem 0; }
.set-row { display: grid; grid-template-columns: 2.4rem 1fr 1fr 3rem; gap: .5rem; align-items: center; }
.set-row.head { font-size: .72rem; color: var(--muted); text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.set-row span:first-child { text-align: center; font-weight: 800; font-family: var(--font-display); }
.set-row input { text-align: center; padding: .6rem .4rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.set-row.done input { background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.check-btn { height: 2.7rem; border-radius: 12px; border: none; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1.05rem; transition: background .15s, transform .1s; }
.check-btn:active { transform: scale(.94); }
.check-btn.on { background: var(--success); color: #fff; }
.rest-timer {
  position: fixed; bottom: calc(var(--tabbar) + 1rem + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 150;
  background: var(--text); color: var(--bg); padding: .6rem .6rem .6rem 1.2rem; border-radius: 999px;
  display: flex; gap: .7rem; align-items: center; box-shadow: var(--shadow-lg); font-size: .92rem; font-weight: 700;
}
.rest-timer strong { font-family: var(--font-display); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.rest-timer .icon-btn { color: var(--bg); }
.rest-timer.done { background: var(--success); color: #fff; }
.rest-timer[hidden] { display: none; }
@media (min-width: 960px) { .rest-timer { bottom: 1.5rem; margin-left: calc(var(--sidebar) / 2); } }

/* Consciência corporal (músculos trabalhados + foco mental) */
.ex-head { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: center; }
.mini-map { display: flex; gap: 2px; background: var(--surface); border-radius: 14px; padding: .35rem .4rem; }
.mini-map svg { width: 34px; height: 68px; display: block; }
.mini-map.lg svg { width: 70px; height: 140px; }
.focus-cue { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; background: var(--accent-soft); border-radius: 14px; padding: .65rem .8rem; margin: .5rem 0 .2rem; font-size: .86rem; }
.focus-cue strong { color: var(--accent); }
.muscle-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .25rem; }
.mtag { font-size: .72rem; font-weight: 750; padding: .12rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.mtag.pri { background: var(--accent); color: var(--on-accent); }

/* Câmera */
.cam-wrap { position: relative; max-width: 640px; margin-top: .75rem; }
.cam-wrap canvas { width: 100%; border-radius: 18px; background: #000; aspect-ratio: 4 / 3; display: block; transform: scaleX(-1); }
.cam-hud { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .5rem; }
.cam-hud > div { background: rgba(0, 0, 0, .6); color: #fff; padding: .35rem .75rem; border-radius: 12px; text-align: center; }
.hud-num { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.hud-lbl { font-size: .68rem; opacity: .85; }
.feedback { margin-top: 1rem; padding: 1rem; background: var(--blush); border-radius: 16px; min-height: 60px; display: grid; gap: .35rem; }
.fb { padding-left: 1.5rem; position: relative; }
.fb::before { position: absolute; left: 0; }
.fb-ok::before { content: "✅"; }
.fb-warn::before { content: "⚠️"; }
.fb-bad::before { content: "❌"; }
.fb-info::before { content: "ℹ️"; }

/* Abas */
.tabs { display: flex; gap: .2rem; background: var(--surface); padding: .25rem; border-radius: 999px; margin: 1rem 0 .5rem; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { background: none; border: none; padding: .42rem .95rem; border-radius: 999px; cursor: pointer; color: var(--muted); font: inherit; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.tabs.compact { margin: 0; }

/* Toasts */
#toasts { position: fixed; top: calc(1rem + env(safe-area-inset-top, 0px)); right: max(1rem, env(safe-area-inset-right, 0px)); left: max(1rem, env(safe-area-inset-left, 0px)); z-index: 300; display: grid; gap: .5rem; justify-items: end; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: .75rem 1.05rem; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 420px; font-size: .9rem; font-weight: 600; transition: opacity .4s, transform .4s; pointer-events: auto; }
.toast-error { background: var(--danger); color: #fff; }
.toast.hide { opacity: 0; transform: translateY(-8px); }

/* ---------- Coach, modais e gamificação ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 12, 9, .5); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 250; padding: 1rem; animation: fade .2s ease; }
.modal { background: var(--card); color: var(--text); border-radius: 24px; padding: 1.6rem; max-width: 460px; width: 100%; max-height: 88vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); outline: none; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal-x { position: absolute; top: .6rem; right: .6rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.celebrate { text-align: center; display: grid; gap: .65rem; justify-items: center; }
.celebrate .metrics { width: 100%; }
.big-emoji { font-size: 3rem; line-height: 1; }
.stack { display: grid; gap: .5rem; width: 100%; }
.actions.center { justify-content: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 260; }
.loading { color: var(--muted); padding: .5rem 0; }
.loading::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .5rem; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.coach-card { border: 1.5px solid var(--accent-soft); }
.mission-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; }
.level-row { display: grid; grid-template-columns: auto 1fr auto; gap: .75rem; align-items: center; margin-top: 1rem; font-size: .88rem; font-weight: 650; }
.alert { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: 16px; margin-top: .6rem; background: var(--surface); flex-wrap: wrap; position: relative; padding-left: 1.25rem; }
.alert::before { content: ""; position: absolute; left: .55rem; top: .8rem; bottom: .8rem; width: 4px; border-radius: 4px; background: var(--info); }
.alert p { margin-top: .15rem; }
.alert > div { flex: 1 1 240px; }
.alert-bad::before { background: var(--danger); }
.alert-warn::before { background: var(--warn); }
.status-pill { font-size: .76rem; font-weight: 800; padding: .25rem .75rem; border-radius: 999px; background: var(--surface); }
.status-pill.good { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.status-pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.indicators { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
.indicator { background: var(--surface); border-radius: 16px; padding: .8rem .9rem; display: grid; gap: .1rem; position: relative; overflow: hidden; }
.indicator::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--border); }
.indicator .label { font-size: .76rem; color: var(--muted); font-weight: 650; }
.indicator strong { font-family: var(--font-display); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.indicator.good::after { background: var(--success); }
.indicator.warn::after { background: var(--warn); }
.indicator.bad::after { background: var(--danger); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: .5rem; margin-top: .85rem; }
.badge-item { text-align: center; padding: .6rem .25rem; border-radius: 14px; background: var(--surface); opacity: .4; filter: grayscale(1); }
.badge-item.earned { opacity: 1; filter: none; background: var(--gold-soft); }
.badge-item span { font-size: 1.5rem; display: block; }
.badge-item small { font-size: .66rem; line-height: 1.2; display: block; font-weight: 650; }
.review { display: flex; gap: 1rem; align-items: center; }
.grade { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: #fff; background: var(--muted); flex-shrink: 0; }
.grade-A { background: var(--success); }
.grade-B { background: var(--accent); }
.grade-C { background: var(--warn); }
.grade-D { background: var(--danger); }
.checkin { display: grid; gap: .4rem; }
.scale-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .88rem; font-weight: 600; }
.scale-btns { display: flex; gap: .25rem; }
.scale-btns label { margin: 0; }
.scale-btns input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale-btns span { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 10px; background: var(--surface); cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--text); }
.scale-btns input:checked + span { background: var(--accent); color: var(--on-accent); }
.scale-btns input:focus-visible + span { outline: 2px solid var(--accent); }

.import-card { border: 1.5px dashed var(--accent); box-shadow: none; }
.field.imported input { border-color: var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); }
.days-pick { border: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.days-pick legend { color: var(--muted); font-size: .82rem; font-weight: 650; margin: .7rem 0 .35rem; width: 100%; }
.day-chip { margin: 0; }
.day-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-chip span { display: inline-block; padding: .45rem .85rem; border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; font-weight: 700; font-size: .85rem; }
.day-chip input:checked + span { background: var(--accent); color: var(--on-accent); }
.day-chip input:focus-visible + span { outline: 2px solid var(--accent); }
.photo-findings .findings { list-style: none; display: grid; gap: .3rem; margin-top: .5rem; font-size: .8rem; }
.ai-result h4 { margin: .75rem 0 .25rem; font-size: .95rem; }
.ai-result ul { padding-left: 1.2rem; }
.meso-bar { display: flex; gap: .35rem; margin-bottom: .6rem; }
.meso-bar span { flex: 1; text-align: center; padding: .35rem 0; border-radius: 10px; background: var(--surface); font-size: .78rem; font-weight: 800; color: var(--muted); }
.meso-bar span.past { background: var(--accent-soft); color: var(--accent); }
.meso-bar span.on { background: var(--accent); color: var(--on-accent); }
.why { padding-left: 1.2rem; display: grid; gap: .4rem; margin-bottom: .6rem; }
.refs { padding-left: 1.2rem; display: grid; gap: .25rem; }
.ev-forte { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.ev-moderada { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.ev-pratica { background: var(--surface-2); color: var(--muted); }

/* Mapa do corpo */
.bodymap { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin: .5rem 0; }
.bodymap-fig { width: min(150px, 42%); text-align: center; }
.bodymap-fig svg { width: 100%; height: auto; display: block; }
.bodymap-fig figcaption { font-size: .78rem; color: var(--muted); margin-top: .25rem; font-weight: 650; }
.bm-base > * { fill: var(--surface-2); stroke: none; }
.bm-region { stroke: var(--card); stroke-width: 1.2; transition: fill .3s; }
.bm-none, .bm-l0 { fill: color-mix(in srgb, var(--muted) 22%, var(--surface)); }
.bm-l1 { fill: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
.bm-l2 { fill: color-mix(in srgb, var(--accent) 58%, var(--surface)); }
.bm-l3 { fill: var(--accent); }
.bm-l4 { fill: var(--warn); }
.bm-rec { fill: var(--danger); }
.bm-mid { fill: var(--warn); }
.bm-ok { fill: var(--success); }
.bm-pri { fill: var(--accent); }
.bm-sec { fill: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.mini-map .bm-region { stroke-width: 2; }

.heatmap-wrap { overflow-x: auto; padding-bottom: .25rem; }
.heatmap { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; width: max-content; }
.hm { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); }
.hm.on { background: var(--success); }
.hm.empty { visibility: hidden; }

.chat { display: grid; gap: .5rem; max-height: 420px; overflow-y: auto; margin: .5rem 0; }
.chat:empty { display: none; }
.msg { padding: .65rem .9rem; border-radius: 18px; max-width: 85%; font-size: .9rem; line-height: 1.5; }
.msg.me { background: var(--accent); color: var(--on-accent); justify-self: end; border-bottom-right-radius: 6px; }
.msg.bot { background: var(--surface); justify-self: start; border-bottom-left-radius: 6px; }
.msg.error { color: var(--danger); }
.chat-form { display: flex; gap: .5rem; }
.chat-form input { flex: 1; }

.warmup { background: var(--gold-soft); padding: .45rem .75rem; border-radius: 12px; }
.swap-box { background: var(--surface); border-radius: 14px; padding: .55rem .8rem; margin-bottom: .5rem; }
.swap-box .chips { margin: .4rem 0 0; }
.plates { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.plate { display: inline-grid; place-items: center; min-width: 2.4rem; padding: 0 .4rem; border-radius: 6px; color: #fff; font-weight: 800; font-size: .82rem; background: #6b7280; }
.plate.p25 { height: 4.2rem; background: #c0392b; }
.plate.p20 { height: 3.9rem; background: #2563eb; }
.plate.p15 { height: 3.5rem; background: #ca8a04; }
.plate.p10 { height: 3.1rem; background: #15803d; }
.plate.p5 { height: 2.6rem; background: #4b5563; }
.plate.p2_5 { height: 2.2rem; background: #111827; }
.plate.p1_25 { height: 1.8rem; background: #9ca3af; color: #111827; }
.row-actions .btn.small { padding: .32rem .7rem; }

/* ---------- Prints da balança (várias vagas) ---------- */
.print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; margin: .5rem 0; }
.print-thumb { position: relative; margin: 0; }
.print-zoom { display: block; width: 100%; aspect-ratio: 9 / 16; border: none; padding: 0; border-radius: 14px; overflow: hidden; background: var(--surface); cursor: zoom-in; }
.print-zoom img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.print-thumb figcaption { font-size: .72rem; color: var(--muted); text-align: center; margin-top: .25rem; font-weight: 700; }
.print-del { position: absolute; top: .3rem; right: .3rem; background: var(--card); min-width: 28px; min-height: 28px; padding: .15rem; box-shadow: var(--shadow); }
.print-add { display: grid; place-content: center; justify-items: center; gap: .15rem; aspect-ratio: 9 / 16; margin: 0; border-radius: 14px; border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent); cursor: pointer; font-weight: 800; font-size: .8rem; text-align: center; padding: .4rem; }
.print-add .plus { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; }
.print-add small { color: var(--muted); font-weight: 700; }
.print-full { width: 100%; height: auto; border-radius: 14px; }

/* ---------- Menu "Mais" (celular) ---------- */
.sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .5rem; }
.sheet a { display: grid; justify-items: center; gap: .35rem; padding: .9rem .5rem; border-radius: 16px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-size: .8rem; text-align: center; }
.sheet a .ico { color: var(--accent); width: 26px; height: 26px; }

/* ---------- Onboarding (primeiro acesso) ---------- */
body.wizard .sidebar, body.wizard .tabbar, body.wizard footer { display: none; }
body.wizard .topbar, body.wizard main, body.wizard footer { margin-left: 0; }
body.wizard main { max-width: 640px; padding-bottom: 3rem; }
.wiz { display: grid; gap: 1rem; }
.wiz-progress { display: flex; gap: .35rem; }
.wiz-progress span { flex: 1; height: 5px; border-radius: 999px; background: var(--surface-2); }
.wiz-progress span.on { background: var(--accent); }
.wiz h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.3rem); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.option { position: relative; display: grid; gap: .25rem; padding: 1rem; border-radius: 18px; background: var(--card); border: 1.5px solid var(--border); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.option strong { font-family: var(--font-display); font-size: 1rem; }
.option span { color: var(--muted); font-size: .82rem; }
.option .opt-ico { font-size: 1.5rem; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); }
.wiz-nav { display: flex; justify-content: space-between; gap: .5rem; margin-top: .5rem; }
.value-list { display: grid; gap: .7rem; margin: .5rem 0; }
.value-list li { list-style: none; display: grid; grid-template-columns: auto 1fr; gap: .75rem; align-items: start; }
.value-list .vi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* ---------- Minha balança ---------- */
.scale-hero { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
.scale-art { width: 120px; height: 120px; border-radius: 28px; background: linear-gradient(145deg, #1b1f1e, #050606); position: relative; box-shadow: var(--shadow); }
.scale-art::before { content: "77.6"; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-family: var(--font-display); font-size: .9rem; color: #7ef3c9; background: #0b1512; padding: .1rem .5rem; border-radius: 6px; letter-spacing: .05em; }
.scale-art::after { content: ""; position: absolute; inset: 52px 14px 14px; border-radius: 50% 50% 14px 14px; border: 2px solid rgba(255, 255, 255, .18); }
.how { counter-reset: how; display: grid; gap: .8rem; list-style: none; }
.how li { counter-increment: how; display: grid; grid-template-columns: 2.2rem 1fr; gap: .8rem; align-items: start; }
.how li::before { content: counter(how); width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-family: var(--font-display); font-weight: 700; }
.metric-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.metric-chips span { background: var(--surface); border-radius: 999px; padding: .25rem .7rem; font-size: .78rem; font-weight: 700; }

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .card { padding: 1.1rem; border-radius: 18px; }
  .hero { grid-template-columns: 1fr; padding: 1.35rem; border-radius: 22px; }
  .ring { width: 108px; height: 108px; position: absolute; top: 1.1rem; right: 1.1rem; }
  .ring-label strong { font-size: 1.35rem; }
  .hero > div:first-child { padding-right: 110px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric .value { font-size: 1.2rem; }
  .compare { gap: .5rem; }
  .chart-container { height: 220px; }
  .btn { white-space: normal; }
  .level-row { grid-template-columns: 1fr; gap: .35rem; }
  .modal { padding: 1.3rem 1.1rem; border-radius: 22px; }
  .card-head .row-actions { flex-wrap: wrap; }
  .scale-hero { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .topbar, .sidebar, .tabbar, footer, .actions, .row-actions, .add-row, #toasts { display: none !important; }
  main { margin: 0 !important; }
  .card { box-shadow: none; break-inside: avoid; }
}
.field.corrected input { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.fb ul { padding-left: 1.1rem; margin-top: .25rem; }

/* ---------- Mapa de foco (gordura por região) ---------- */
.fm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: .5rem 0 1rem; }
.fm-stats > div { background: var(--accent-soft); border-radius: 14px; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.fm-stats span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fm-stats strong { font-family: Sora, Manrope, sans-serif; font-size: 1.35rem; }
.fm-stats small { font-size: .72rem; color: var(--muted); }
@media (max-width: 640px) { .fm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fm-regions { display: grid; gap: .45rem; margin: .5rem 0 1rem; }
.fm-region { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; --lvl: var(--success); }
.fm-region.lvl-alta { --lvl: var(--danger); }
.fm-region.lvl-media { --lvl: var(--warn); }
.fm-region summary { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) minmax(60px, 30%) auto; align-items: center; gap: .6rem; padding: .65rem .8rem; cursor: pointer; list-style: none; }
.fm-region summary::-webkit-details-marker { display: none; }
.fm-region > summary::before { content: none; }
.fm-rank { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--lvl); color: #fff; font-weight: 700; font-size: .85rem; }
.fm-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.fm-bar { height: .5rem; border-radius: 99px; background: var(--border); overflow: hidden; }
.fm-bar i { display: block; height: 100%; background: var(--lvl); border-radius: inherit; }
.fm-score { font-weight: 700; color: var(--lvl); white-space: nowrap; }
.fm-score small { font-weight: 500; color: var(--muted); }
.fm-body { padding: 0 .9rem .8rem 3.2rem; }
.fm-body p { margin: .35rem 0; }
.fm-image { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 14px; display: block; margin: .5rem 0; }
@media (max-width: 480px) { .fm-region summary { grid-template-columns: 1.6rem minmax(0, 1fr) auto; } .fm-bar { display: none; } .fm-body { padding-left: .9rem; } }

/* ---------- Medidas com fita ---------- */
.tape-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 560px) { .tape-layout { grid-template-columns: 1fr; } .tape-fig-wrap { max-width: 160px; margin: 0 auto; } }
.tape-fig { width: 100%; height: auto; display: block; }
.tape-fig .tf-body { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
.tape-fig .tp { cursor: pointer; }
.tape-fig .tp line { stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 4 3; }
.tape-fig .tp circle { fill: var(--card); stroke: var(--muted); stroke-width: 1.5; }
.tape-fig .tp text { font: 700 11px Manrope, sans-serif; fill: var(--muted); text-anchor: middle; }
.tape-fig .tp.ess line, .tape-fig .tp.ess circle { stroke: var(--accent); }
.tape-fig .tp.ess text { fill: var(--accent); }
.tape-fig .tp.on line { stroke: var(--gold); stroke-width: 4; stroke-dasharray: none; }
.tape-fig .tp.on circle { fill: var(--gold); stroke: var(--gold); }
.tape-fig .tp.on text { fill: #1b1405; }
.tape-field small { display: block; margin-top: .25rem; line-height: 1.35; }
.tp-num { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .72rem; font-weight: 800; }
.tape-last { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; margin: .5rem 0 .75rem; }
.tape-last > div { background: var(--surface); border-radius: 12px; padding: .55rem .7rem; display: flex; flex-direction: column; }
.tape-last span { font-size: .72rem; color: var(--muted); }
.tape-last strong { font-family: Sora, Manrope, sans-serif; font-size: 1.1rem; }
.tape-last small.good { color: var(--success); font-weight: 700; }
.tape-last small.bad { color: var(--danger); font-weight: 700; }

/* ---------- Alimentação ---------- */
.nut-kcal { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem .6rem; margin: .25rem 0 .9rem; }
.nut-kcal strong { font-family: Sora, Manrope, sans-serif; font-size: 2.6rem; line-height: 1; }
.nut-kcal span { font-weight: 700; color: var(--muted); }
.nut-kcal small { flex-basis: 100%; color: var(--accent); font-weight: 700; }
.nut-macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-bottom: .75rem; }
.nm { background: var(--surface); border-radius: 14px; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .2rem; --c: var(--accent); }
.nm-c { --c: var(--gold); } .nm-f { --c: var(--info); }
.nm span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nm strong { font-family: Sora, Manrope, sans-serif; font-size: 1.3rem; }
.nm i { display: block; height: .4rem; border-radius: 99px; background: linear-gradient(90deg, var(--c) var(--w), var(--border) var(--w)); }
.nm small { font-size: .72rem; color: var(--muted); }
@media (max-width: 480px) { .nut-macros { grid-template-columns: 1fr; } }
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; background: var(--surface); padding: .3rem; border-radius: 14px; margin-bottom: .8rem; }
.seg label, .seg button { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg button { display: block; padding: .5rem .85rem; border-radius: 10px; font-weight: 700; font-size: .85rem; color: var(--muted); border: none; background: none; font-family: inherit; }
.seg input:checked + span, .seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.seg-sm { margin: .4rem 0; } .seg-sm button { padding: .35rem .65rem; font-size: .78rem; }
.check { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; font-weight: 600; }
.chips-pick { border: 0; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips-pick legend { margin-bottom: .35rem; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: .4rem .8rem; border-radius: 999px; background: var(--surface); font-size: .8rem; font-weight: 650; cursor: pointer; border: 1.5px solid transparent; }
.chip-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); }
.hands { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: .5rem 0; }
.hand { background: var(--surface); border-radius: 16px; padding: .85rem; display: flex; flex-direction: column; gap: .2rem; }
.hand-ico { font-size: 1.8rem; }
.hand small { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.meals { display: grid; gap: .7rem; }
.meal { border: 1px solid var(--border); border-radius: 16px; padding: .8rem .9rem; }
.meal-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.meal-items { list-style: none; padding: 0; margin: .3rem 0 0; display: grid; gap: .3rem; }
.food { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .6rem; text-align: left; background: var(--surface); border: none; border-radius: 10px; padding: .5rem .7rem; cursor: pointer; font-family: inherit; color: var(--text); }
.food small { grid-column: 1 / -1; }
.food:hover { outline: 1.5px solid var(--accent); }
.meal-tot { padding: .2rem .2rem 0; }
.shop { list-style: none; padding: 0; margin: .3rem 0 .6rem; display: grid; gap: .25rem; }
.shop li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .6rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.shop li small { grid-column: 1 / -1; }
.flex-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .6rem; }
.flex-rules > div { background: var(--surface); border-radius: 14px; padding: .75rem .85rem; }
.flex-rules p { margin: .25rem 0 0; }
.meal-items[hidden] { display: none; }

/* ---------- Treino personalizado ---------- */
.why-list { list-style: none; padding: 0; margin: .3rem 0 .6rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .4rem; }
.why-list li { display: flex; gap: .55rem; align-items: flex-start; background: var(--surface); border-radius: 12px; padding: .55rem .7rem; font-size: .85rem; line-height: 1.35; }
.why-list li span { flex: none; }
.warmup { background: var(--gold-soft); border-radius: 10px; padding: .45rem .7rem; margin: .2rem 0 .5rem; }

/* ---------- Técnicas avançadas ---------- */
.tech-badge { display: inline-block; font-size: .74rem; font-weight: 700; color: var(--gold); background: var(--gold-soft); border-radius: 999px; padding: .15rem .55rem; margin-left: .25rem; }
.tech-badge.ss { color: var(--info); background: rgba(111, 179, 234, .14); }
.tech-badge em { font-weight: 500; color: var(--muted); }
details.tech-badge { display: block; border-radius: 12px; margin: .35rem 0 0; padding: .35rem .65rem; }
details.tech-badge summary { cursor: pointer; }
details.tech-badge p { color: var(--text); font-weight: 500; margin: .3rem 0 0; }
.ss-tag { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.25rem; border-radius: 6px; background: var(--info); color: #fff; font-size: .7rem; font-weight: 800; padding: 0 .25rem; vertical-align: 1px; }

/* ---------- Fase de teste (beta) ---------- */
.beta-pill { font: inherit; font-size: .75rem; font-weight: 800; letter-spacing: .02em; color: var(--gold); background: var(--gold-soft); border: 1px solid transparent; border-radius: 999px; padding: .35rem .7rem; cursor: pointer; white-space: nowrap; }
.beta-pill:hover { border-color: var(--gold); }
.sidebar-foot .beta-pill { width: 100%; }
.stars-pick { display: flex; gap: .25rem; margin: .25rem 0 .5rem; flex-direction: row-reverse; justify-content: flex-end; }
.stars-pick input { position: absolute; opacity: 0; pointer-events: none; }
.stars-pick label { margin: 0; cursor: pointer; font-size: 2rem; line-height: 1; color: var(--border); }
.stars-pick label:hover, .stars-pick label:hover ~ label, .stars-pick input:checked ~ span, .stars-pick label:has(input:checked), .stars-pick label:has(input:checked) ~ label { color: var(--gold); }
.stars-pick input:focus-visible + span { outline: 2px solid var(--accent); border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 420px) { .beta-pill { font-size: .7rem; padding: .3rem .55rem; } }
/* cabeçalho no celular: tudo cabe numa linha, sem empurrar a página para o lado */
.header-row { min-width: 0; gap: .5rem; }
.header-row .logo { min-width: 0; flex: 0 1 auto; white-space: nowrap; }
.header-tools { display: flex; align-items: center; gap: .35rem; min-width: 0; flex: 0 1 auto; }
@media (max-width: 480px) {
  .bp-long { display: none; }
  .header-tools .sync-badge { max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 360px) { .header-row .logo span { display: none; } }
/* entradas escondidas dos chips/estrelas/segmentos: não podem ocupar largura (empurravam a página no celular) */
.chip-check, .seg label, .stars-pick label { position: relative; }
.chip-check input, .seg input, .stars-pick input { width: 1px; height: 1px; margin: 0; padding: 0; inset: 0; }
@media (max-width: 420px) { .header-tools .sync-badge[data-state="local"] { display: none; } }

/* prescrição em linguagem simples */
.presc-plain { display: block; color: var(--text); line-height: 1.45; margin-top: .15rem; }
.presc-plain strong { color: var(--accent); }
.todo { background: var(--accent-soft); border-radius: 12px; padding: .6rem .75rem; margin: .4rem 0 .5rem; line-height: 1.45; }
.todo strong { color: var(--accent); }
@media (max-width: 520px) {
  .plan-list li { flex-wrap: wrap; }
  .plan-list li .plan-ex { flex: 1 1 calc(100% - 2.2rem); min-width: 0; }
  .plan-list li .row-actions { flex: 1 1 100%; justify-content: flex-end; margin-top: .25rem; }
}

/* ---------- Como fazer ---------- */
.ex-meta { display: block; color: var(--muted); margin-top: .1rem; line-height: 1.35; }
.ex-meta strong { color: var(--text); }
.howto h3 { margin: 1rem 0 .3rem; font-size: 1rem; }
.howto-head { margin: .3rem 0 .6rem; }
.howto-steps { padding-left: 1.3rem; display: grid; gap: .35rem; }
.howto-steps li::marker { color: var(--accent); font-weight: 800; }
.howto-err { padding-left: 1.2rem; display: grid; gap: .25rem; }
.howto-err li::marker { content: "✕  "; color: var(--danger); font-weight: 800; }
.modal:has(.howto) { max-width: 560px; }

/* ---------- Triagem de saúde ---------- */
.parq { border: 1px solid var(--border); border-radius: 16px; padding: .8rem .9rem; margin: 1rem 0 .5rem; display: grid; gap: .55rem; }
.parq legend { padding: 0 .3rem; }
.parq-q { display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .88rem; line-height: 1.4; }
.parq-q[hidden] { display: none; }
.parq-q .seg { margin: 0; flex: none; }
@media (max-width: 480px) { .parq-q { flex-direction: column; align-items: flex-start; } }
.health-card { border-left: 4px solid var(--warn); }
.health-card.stop { border-left-color: var(--danger); }
.health-card p { margin: .3rem 0 0; }
.parq-q .seg label { margin: 0; }
