:root {
  --bg: #07080a;
  --bg-2: #0e1013;
  --card: #15171b;
  --card-2: #1c1f24;
  --line: rgba(255,255,255,.07);
  --text: #f4f5f7;
  --muted: #8b9099;
  --dim: #5b606a;
  --accent: #c6ff3d;
  --acc-rgb: 198,255,61;
  --accent-hi: #e6ff8f;
  --accent-ink: #0b0f02;
  --accent-2: #ff8a3d;
  --accent-soft: rgba(var(--acc-rgb),.12);
  --danger: #ff5a5f;
  --ok: #3ddc84;
  --warn: #ffc53d;
  --fig: #e9ecf1;
  --radius: 22px;
  --radius-s: 14px;
  --tabh: 64px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22,.8,.24,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, h4 { margin: 0; font-family: -apple-system, "SF Pro Display", system-ui, sans-serif; letter-spacing: -.02em; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
p { margin: 6px 0; }
small, .muted { color: var(--muted); }
.dim { color: var(--dim); }
.accent { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
svg { display: block; }

/* ---------- Layout ---------- */
#views { position: fixed; inset: 0; overflow: hidden; }
.view {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding: calc(var(--sat) + 12px) 16px calc(var(--tabh) + var(--sab) + 28px);
}
body.hide-tabs .view { padding-bottom: calc(var(--sab) + 120px); }
.view.pushed { box-shadow: -20px 0 40px rgba(0,0,0,.5); }
.view.behind { transform: translateX(-24%); opacity: .5; transition: transform .35s var(--ease), opacity .35s; pointer-events: none; }
.enter-slide { animation: slideIn .38s var(--ease) both; }
.leave-slide { animation: slideOut .3s var(--ease) both; pointer-events: none; }
.enter-fade { animation: fadeUp .32s var(--ease) both; }
.leave-fade { animation: fadeOut .22s ease both; pointer-events: none; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slideOut { to { transform: translateX(100%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; } }

.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.flex { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sp { width: 44px; height: 44px; display: inline-block; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt2 { margin-top: 24px; } .mb { margin-bottom: 12px; }

/* ---------- Header ---------- */
.bar { display: flex; align-items: center; gap: 8px; margin: -4px -6px 14px; position: sticky; top: calc(-1 * var(--sat) - 12px); z-index: 5;
  padding: calc(var(--sat) + 8px) 6px 8px; margin-top: calc(-1 * var(--sat) - 12px);
  background: linear-gradient(var(--bg) 70%, transparent); }
.bar-title { flex: 1; text-align: center; min-width: 0; }
.bar-title h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title small { display: block; font-size: 12px; }
.bar-right { min-width: 44px; display: flex; justify-content: flex-end; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); }
.icon-btn svg, .btn svg, .tab svg, .chip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.top-hello { padding: 8px 2px 4px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.phase-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 600; margin-top: 10px; border: 1px solid var(--line); }
.phase-pill .dotp { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* ---------- Cards ---------- */
.card { background: linear-gradient(180deg, var(--card-2), var(--card)); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 30px -12px rgba(0,0,0,.7); animation: fadeUp .45s var(--ease) both; }
.stack > .card:nth-child(2) { animation-delay: .04s } .stack > .card:nth-child(3) { animation-delay: .08s }
.stack > .card:nth-child(4) { animation-delay: .12s } .stack > .card:nth-child(5) { animation-delay: .16s }
.card.tap { transition: transform .15s; } .card.tap:active { transform: scale(.98); }
.card.hero { background: radial-gradient(120% 120% at 100% 0%, rgba(var(--acc-rgb),.18), transparent 55%), linear-gradient(180deg, var(--card-2), var(--card)); }
.card-title { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.mid { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.unit { font-size: .45em; color: var(--muted); font-weight: 600; margin-left: 3px; }
.stat { background: var(--card); border-radius: var(--radius-s); padding: 14px; border: 1px solid var(--line); }
.stat .lbl { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.stat .lbl svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.stat .val { font-size: 22px; font-weight: 750; margin-top: 4px; }
.list { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li.tap:active { background: var(--card-2); }
.li .chev { width: 18px; height: 18px; color: var(--dim); fill: none; stroke: currentColor; stroke-width: 2; }
.li-main { flex: 1; min-width: 0; }
.li-main b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main small { display: block; }

/* ---------- Botões ---------- */
.btn { min-height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card-2); border: 1px solid var(--line); transition: transform .12s, background .2s, opacity .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border: 0; box-shadow: 0 10px 30px -10px rgba(var(--acc-rgb),.6); }
.btn.orange { background: var(--accent-2); color: #1a0b00; border: 0; }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255,90,95,.15); color: var(--danger); border-color: rgba(255,90,95,.3); }
.btn.block { width: 100%; }
.btn.xl { min-height: 64px; font-size: 18px; border-radius: 20px; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .4; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line); font-weight: 650; font-size: 15px; transition: transform .12s; }
.chip:active { transform: scale(.94); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: rgba(var(--acc-rgb),.35); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.tag.acc { background: var(--accent-soft); color: var(--accent); border-color: rgba(var(--acc-rgb),.25); }
.tag.org { background: rgba(255,138,61,.14); color: var(--accent-2); border-color: rgba(255,138,61,.3); }
.tag.warn { background: rgba(255,197,61,.14); color: var(--warn); border-color: rgba(255,197,61,.3); }
.tag.danger { background: rgba(255,90,95,.14); color: var(--danger); }
.seg { display: flex; background: var(--card); border-radius: 14px; padding: 4px; border: 1px solid var(--line); gap: 4px; overflow-x: auto; }
.seg { scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; min-height: 40px; border-radius: 10px; font-weight: 650; font-size: 13px; color: var(--muted); white-space: nowrap; padding: 0 6px; }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* ---------- Form ---------- */
.field { width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); padding: 0 14px; font: inherit; font-size: 17px; outline: none; }
.field:focus { border-color: rgba(var(--acc-rgb),.5); }
textarea.field { padding: 12px 14px; min-height: 80px; resize: vertical; }
select.field { -webkit-appearance: none; appearance: none; }
label.lbl { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- Tab bar ---------- */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around;
  padding: 6px 6px calc(var(--sab) + 6px); height: calc(var(--tabh) + var(--sab));
  background: rgba(10,11,13,.82); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-top: 1px solid var(--line); transition: transform .35s var(--ease); }
body.hide-tabs #tabbar { transform: translateY(110%); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--dim); border-radius: 14px; transition: color .2s; }
.tab svg { width: 24px; height: 24px; transition: transform .25s var(--spring); }
.tab.on { color: var(--accent); }
.tab.on svg { transform: translateY(-2px) scale(1.08); }

/* ---------- Progresso ---------- */
.pbar { height: 10px; background: var(--bg-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.pbar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); transform-origin: left; animation: grow 1s var(--ease) both; }
.pbar.org > i { background: linear-gradient(90deg, var(--accent-2), #ffc08f); }
.pbar.blue > i { background: linear-gradient(90deg, #38bdf8, #a5f3fc); }
@keyframes grow { from { transform: scaleX(0); } }
.ring-bg { fill: none; stroke: var(--bg-2); }
.ring-fg { fill: none; stroke: var(--accent); stroke-linecap: round; animation: ringIn 1.1s var(--ease) both; }
.ring.org .ring-fg { stroke: var(--accent-2); } .ring.blue .ring-fg { stroke: #38bdf8; }
@keyframes ringIn { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--off); } }
.ring-label { fill: var(--text); font-size: 13px; font-weight: 700; }

/* ---------- Gráficos ---------- */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); }
.chart .axis { fill: var(--dim); font-size: 10px; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .ln.org { stroke: var(--accent-2); } .chart .ln.blue { stroke: #38bdf8; } .chart .ln.muted { stroke: var(--dim); stroke-width: 1.5; }
.chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .dot { fill: var(--accent); animation: pop .4s var(--spring) both; transform-box: fill-box; transform-origin: center; }
.chart .dot.muted { fill: rgba(255,255,255,.35); } .chart .dot.org { fill: var(--accent-2); } .chart .dot.blue { fill: #38bdf8; }
.chart .area { fill: rgba(var(--acc-rgb),.08); }
.chart .band { fill: rgba(61,220,132,.08); }
.chart .guide { fill: none; stroke: rgba(255,255,255,.25); stroke-dasharray: 4 4; stroke-width: 1.5; }
.chart .barr { fill: var(--accent); opacity: .9; }
.chart .grow { animation: barGrow .7s var(--ease) both; }
@keyframes barGrow { from { transform: scaleY(0); } }
@keyframes pop { from { transform: scale(0); } }
.empty-chart { height: 120px; display: grid; place-items: center; color: var(--dim); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--radius-s); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Ilustrações ---------- */
.fig { width: 100%; height: auto; }
.fig .limb { fill: none; stroke: var(--fig); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.fig .limb.torso { stroke-width: 9; }
.fig .limb.back { opacity: .35; }
.fig .head { fill: var(--fig); }
.fig .eq { fill: #2a2e35; } .fig .eq2 { fill: #20242a; }
.fig .eqs { stroke: #3a3f47; stroke-width: 4; stroke-linecap: round; fill: #2a2e35; }
.fig .padl { stroke: #353a42; stroke-width: 9; stroke-linecap: round; }
.fig .floor { stroke: #24282e; stroke-width: 2; }
.fig .wt { fill: var(--accent); }
.fig .wt2 { fill: var(--bg); }
.fig .pad { fill: #4a505a; }
.fig .cable { stroke: rgba(255,255,255,.35); stroke-width: 1.5; }
.fig .rope { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.fig .bar { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; fill: none; }
.fig-box .fig { max-height: 210px; margin: 0 auto; }
.fig-box { background: radial-gradient(80% 90% at 50% 100%, rgba(var(--acc-rgb),.08), transparent 70%), var(--bg-2); border-radius: var(--radius); border: 1px solid var(--line); padding: 8px 18px 4px; }
.fig-thumb { width: 64px; height: 52px; border-radius: 12px; background: var(--bg-2); flex: none; padding: 2px; border: 1px solid var(--line); overflow: hidden; }
.fig-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

/* ---------- Sessão ---------- */
.session-head { display: flex; align-items: center; gap: 14px; }
.session-clock { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.ex-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); transition: transform .15s, border-color .3s; }
.ex-card:active { transform: scale(.98); }
.ex-card.done { border-color: rgba(var(--acc-rgb),.35); background: linear-gradient(90deg, rgba(var(--acc-rgb),.07), var(--card)); }
.ex-card.cur { border-color: rgba(255,255,255,.2); }
.ex-card .prog { font-size: 13px; color: var(--muted); }
.ex-card .okmark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); flex: none; }
.ex-card.done .okmark { background: var(--accent); color: var(--accent-ink); }
.okmark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.biset-box { border-radius: 20px; border: 1px dashed rgba(255,138,61,.4); padding: 8px; }
.biset-box > .tag { margin: 2px 0 8px 4px; }
.biset-box .ex-card + .ex-card { margin-top: 8px; }

.target { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.target .stat { padding: 12px; text-align: center; }
.target .stat .val { font-size: 19px; }
.suggest { border-radius: 16px; padding: 14px; background: var(--accent-soft); border: 1px solid rgba(var(--acc-rgb),.25); }
.suggest.up { background: rgba(var(--acc-rgb),.14); }
.suggest.down, .suggest.deload { background: rgba(255,138,61,.1); border-color: rgba(255,138,61,.3); }
.suggest .line1 { font-size: 14px; color: var(--muted); }
.suggest .line2 { font-size: 18px; font-weight: 750; margin-top: 2px; }
.suggest .line3 { font-size: 13px; margin-top: 6px; color: var(--accent); font-weight: 600; }
.suggest.down .line3, .suggest.deload .line3 { color: var(--accent-2); }

.set-row { display: grid; grid-template-columns: 24px 1.3fr 1fr 54px; gap: 7px; align-items: center; padding: 10px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); transition: background .3s, border-color .3s, opacity .3s; }
.set-row + .set-row { margin-top: 8px; }
.set-row .sn { font-weight: 800; color: var(--muted); text-align: center; font-size: 15px; }
.set-row.done { background: linear-gradient(90deg, rgba(var(--acc-rgb),.1), var(--card)); border-color: rgba(var(--acc-rgb),.3); }
.set-row.next { border-color: rgba(255,255,255,.22); }
.set-row.bi-b { margin-left: 14px; }
.stepper { display: flex; align-items: center; background: var(--bg-2); border-radius: 14px; border: 1px solid var(--line); height: 56px; overflow: hidden; }
.stepper button { width: 34px; height: 100%; font-size: 24px; font-weight: 500; color: var(--muted); flex: none; }
.stepper button:active { background: var(--card-2); color: var(--text); }
.stepper input { flex: 1; min-width: 0; width: 100%; height: 100%; background: none; border: 0; color: var(--text); text-align: center; font: 700 19px system-ui; letter-spacing: -.02em; font-variant-numeric: tabular-nums; outline: none; padding: 0; }
.stepper .u { font-size: 10px; color: var(--dim); position: absolute; }
.stepper-wrap { position: relative; }
.stepper-wrap > small { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); font-size: 10px; background: var(--card); padding: 0 5px; color: var(--dim); font-weight: 600; z-index: 1; }
.check-btn { width: 54px; height: 56px; border-radius: 16px; background: var(--card-2); border: 2px solid var(--line); display: grid; place-items: center; color: var(--muted); transition: background .25s, transform .15s, border-color .25s; }
.check-btn svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.check-btn:active { transform: scale(.9); }
.set-row.done .check-btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.set-row.done .check-btn.anim { animation: checkPop .5s var(--spring); }
.set-row.done .check-btn.anim .ck { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ckDraw .35s .08s var(--ease) forwards; }
@keyframes checkPop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes ckDraw { to { stroke-dashoffset: 0; } }
.set-extra { grid-column: 2 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rir-pick button { min-width: 36px; height: 34px; border-radius: 10px; background: var(--bg-2); font-size: 13px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); }
.rir-pick button.on { background: var(--accent-soft); color: var(--accent); border-color: rgba(var(--acc-rgb),.35); }

details.fold { background: var(--card); border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
details.fold + details.fold { margin-top: 8px; }
details.fold summary { list-style: none; padding: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .25s; margin-top: -4px; }
details.fold[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
details.fold .fold-body { padding: 0 16px 16px; color: #cfd3da; animation: fadeUp .3s var(--ease); }
details.fold ol, details.fold ul { margin: 0; padding-left: 20px; } details.fold li { margin: 6px 0; }

.equip-photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.warn-box { padding: 12px 14px; border-radius: 14px; background: rgba(255,197,61,.1); border: 1px solid rgba(255,197,61,.3); color: var(--warn); font-weight: 600; font-size: 14px; }
.info-box { padding: 12px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; color: #cfd3da; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 12px 16px calc(var(--sab) + 12px);
  background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 10px; }

/* ---------- Timer de descanso ---------- */
.rest-sheet { text-align: center; }
.rest-ring { position: relative; width: min(72vw, 300px); aspect-ratio: 1; margin: 6px auto 12px; }
.rest-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rest-ring .bg { fill: none; stroke: var(--bg-2); stroke-width: 14; }
.rest-ring .fg { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round; transition: stroke .3s; }
.rest-ring.warn .fg { stroke: var(--accent-2); }
.rest-ring .tt { position: absolute; inset: 0; display: grid; place-content: center; }
.rest-ring .tt b { font-size: 68px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.rest-ring .tt small { margin-top: 6px; }
.rest-ring.warn .tt b { color: var(--accent-2); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.rest-next { padding: 12px 14px; border-radius: 16px; background: var(--bg-2); text-align: left; margin: 10px 0 14px; border: 1px solid var(--line); }
.rest-mini { position: fixed; left: 16px; right: 16px; bottom: calc(var(--sab) + 84px); z-index: 18; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: rgba(28,31,36,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 18px; border: 1px solid var(--line); animation: fadeUp .3s var(--ease); }
.rest-mini b { font-size: 24px; font-variant-numeric: tabular-nums; }

#flash { position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0; background: var(--accent); }
#flash.on { animation: flash 1.4s ease-out; }
#flash.warn { background: var(--accent-2); animation: flashSoft .6s ease-out; }
@keyframes flash { 0%, 30%, 60% { opacity: .85; } 15%, 45% { opacity: .1; } 100% { opacity: 0; } }
@keyframes flashSoft { 0% { opacity: .35; } 100% { opacity: 0; } }

/* ---------- Sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .3s; backdrop-filter: blur(2px); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 8px 18px calc(var(--sab) + 20px);
  transform: translateY(100%); transition: transform .38s var(--ease); border-top: 1px solid var(--line); }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: #3a3f47; margin: 4px auto 14px; }
.sheet h3 { font-size: 20px; }

/* ---------- Toast / confete ---------- */
.toast { position: fixed; left: 50%; top: calc(var(--sat) + 12px); transform: translate(-50%, -30px); opacity: 0; z-index: 120; background: #23272d; color: var(--text); padding: 12px 18px; border-radius: 16px; font-weight: 600; font-size: 14px; border: 1px solid var(--line); transition: all .3s var(--ease); max-width: 90vw; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.ok { border-color: rgba(var(--acc-rgb),.4); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* ---------- Resumo ---------- */
.trophy { width: 96px; height: 96px; margin: 8px auto 12px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; animation: trophy .8s var(--spring) both; box-shadow: 0 0 0 12px rgba(var(--acc-rgb),.12), 0 0 60px rgba(var(--acc-rgb),.5); }
.trophy svg { width: 50px; height: 50px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trophy .ck { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ckDraw .5s .4s var(--ease) forwards; }
@keyframes trophy { from { transform: scale(0) rotate(-30deg); } }
.delta-up { color: var(--ok); } .delta-down { color: var(--danger); }

/* ---------- Heatmap ---------- */
.heat { display: grid; grid-template-columns: 26px repeat(7, 1fr); gap: 5px; font-size: 10px; color: var(--dim); align-items: center; }
.heat .c { aspect-ratio: 1; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); animation: pop .35s var(--spring) both; }
.heat .c.t1 { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px rgba(var(--acc-rgb),.35); }
.heat .c.t2 { background: rgba(56,189,248,.6); border-color: transparent; }
.heat .c.today { outline: 2px solid #fff; outline-offset: 1px; }
.heat .c.out { opacity: .25; }

/* ---------- Fotos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid img, .photo-grid .ph { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.compare { position: relative; width: 100%; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; background: var(--bg-2); touch-action: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--x, 50%)); }
.compare .knob { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 3px; background: var(--accent); transform: translateX(-50%); }
.compare .knob::after { content: '⇆'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.compare .lb { position: absolute; top: 10px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.6); font-size: 12px; font-weight: 700; }

/* ---------- Diet ---------- */
.protein-hero { display: flex; align-items: center; gap: 18px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick .chip { justify-content: center; }
.checklist .li { cursor: pointer; }
.cbox { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--dim); display: grid; place-items: center; flex: none; transition: all .25s var(--spring); }
.cbox svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.on .cbox { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }
.on .cbox svg { opacity: 1; }
.on .cbox .ck { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ckDraw .3s var(--ease) forwards; }

/* ---------- Cardio ---------- */
.cardio-big { font-size: 76px; font-weight: 800; letter-spacing: -.04em; text-align: center; font-variant-numeric: tabular-nums; line-height: 1; }
.tips li { margin: 6px 0; }


/* ---------- Componentes novos (v2) ---------- */
.hello-line { color: #cfd3da; font-size: 14px; margin: 10px 2px 0; line-height: 1.45; }
.plan-note { font-size: 14px; color: #cfd3da; margin: 6px 0 2px; }
.set-hint { grid-column: 2 / -1; font-size: 12px; color: var(--muted); padding: 0 4px; font-variant-numeric: tabular-nums; }
.chip.xs { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 12px; }

.week-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ws { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ws small { font-size: 11px; line-height: 1.2; }
.ws-dot { width: 40px; height: 40px; border-radius: 50%; border: 2px dashed var(--dim); display: grid; place-items: center; color: var(--accent-ink); }
.ws-dot svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ws.on .ws-dot { background: var(--accent); border: 0; box-shadow: 0 0 14px rgba(var(--acc-rgb), .45); animation: pop .4s var(--spring) both; }
.ws.on small { color: var(--text); font-weight: 650; }

.reminder { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.reminder b { display: block; }
.reminder small { display: block; line-height: 1.35; }
.rem-ico { font-size: 26px; width: 44px; height: 44px; border-radius: 14px; background: var(--bg-2); display: grid; place-items: center; flex: none; }

.quote { padding: 18px 20px; border-radius: var(--radius); border: 1px solid rgba(var(--acc-rgb), .25); background: linear-gradient(135deg, rgba(var(--acc-rgb), .1), transparent 70%); font-size: 17px; font-weight: 650; line-height: 1.4; }
.quote small { display: block; margin-top: 8px; font-weight: 500; font-size: 12px; }

.feel-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feel { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); transition: transform .15s var(--spring), border-color .2s; }
.feel span { font-size: 26px; filter: grayscale(.6); transition: filter .2s; }
.feel small { font-size: 10px; }
.feel.on { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.05); }
.feel.on span { filter: none; }

.ach-ico { font-size: 26px; line-height: 1; }
.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ach { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); text-align: center; }
.ach small { font-size: 10px; line-height: 1.2; color: var(--dim); }
.ach .ach-ico { filter: grayscale(1); opacity: .35; }
.ach.on { border-color: rgba(var(--acc-rgb), .35); background: linear-gradient(180deg, rgba(var(--acc-rgb), .12), var(--bg-2)); }
.ach.on .ach-ico { filter: none; opacity: 1; }
.ach.on small { color: var(--text); font-weight: 600; }
.ach i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); opacity: .7; }

.profile-head { display: flex; align-items: center; gap: 14px; padding: 8px 2px 0; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 24px; font-weight: 800; flex: none; box-shadow: 0 0 0 4px rgba(var(--acc-rgb), .15); }

.theme-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sw { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border-radius: 14px; }
.sw i { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--card), 0 0 0 4px transparent; transition: box-shadow .2s; }
.sw small { font-size: 10px; }
.sw.on i { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c); }
.sw.on small { color: var(--text); font-weight: 650; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row b { display: block; font-size: 15px; }
.toggle-row small { display: block; font-size: 12px; }
.switch { width: 52px; height: 32px; border-radius: 99px; background: #3a3f47; position: relative; flex: none; transition: background .25s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .25s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

.dow-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow-pick .chip { padding: 0; justify-content: center; }
.quick-edit { display: grid; grid-template-columns: 1fr 64px 76px; gap: 6px; margin-top: 8px; }
.quick-edit .field { min-height: 46px; font-size: 16px; padding: 0 10px; }

.wk-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wk-row:last-child { border-bottom: 0; }
.wk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; margin-top: 8px; }
.wk-grid span { display: flex; flex-direction: column; }
.wk-grid small { font-size: 11px; }
.wk-grid b { font-size: 14px; }
.wk-grid em { font-style: normal; font-size: 11px; }

.chart .goal { stroke: var(--accent-2); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .goal-t { fill: var(--accent-2); }
.chart .barr.miss { opacity: .35; }

.update-bar { position: fixed; left: 16px; right: 16px; top: calc(var(--sat) + 10px); z-index: 130; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px 10px 16px; border-radius: 16px; background: rgba(28,31,36,.95); border: 1px solid rgba(var(--acc-rgb), .35); font-weight: 650; font-size: 14px; animation: fadeUp .35s var(--ease); }

@media (min-width: 600px) {
  .view { max-width: 560px; margin: 0 auto; left: 0; right: 0; }
  .dock, .rest-mini { max-width: 560px; margin: 0 auto; }
}

/* re-render (ex.: +250 ml) não repete animações de entrada */
.view.static .card, .view.static .pbar > i, .view.static .ring-fg, .view.static .chart *, .view.static .heat .c, .view.static .trophy { animation: none !important; }
.view.static .chart .draw { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .chart .draw { stroke-dashoffset: 0; }
}
