/* Personal Trainer Digital — tema escuro premium com opção clara */
:root {
  --bg: #0a0d12; --bg2: #0f141b; --card: #141a23; --card2: #1a212c; --line: #252e3b; --line2: #313c4b;
  --text: #eef2f7; --muted: #8d9bb0; --dim: #5d6b7e;
  --accent: #c6f432; --accent-ink: #0a0d12; --accent2: #ff9f43; --danger: #ff5a67; --info: #5ab0ff; --ok: #3ddc97;
  --fig: #d3dbe6; --fig-prim: #c6f432; --fig-sec: #ff9f43; --eq: #3c4859; --eq-dark: #8796a8; --trail: #ff5fa2; --cable: #8796a8;
  --radius: 18px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 64px; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f8; --bg2: #eaeef3; --card: #ffffff; --card2: #f5f7fa; --line: #e1e6ed; --line2: #d2d9e2;
  --text: #121821; --muted: #5d6b7e; --dim: #9aa6b5;
  --accent: #7bb800; --accent-ink: #ffffff; --accent2: #f08a24;
  --fig: #3c4859; --fig-prim: #7bb800; --fig-sec: #f08a24; --eq: #b8c2cf; --eq-dark: #6f7d8f; --trail: #e0337f; --cable: #8796a8;
  --shadow: 0 8px 24px rgba(20,30,50,.08);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; } h2 { font-size: 18px; font-weight: 700; } h3 { font-size: 16px; font-weight: 700; } h4 { font-size: 14px; }
p { margin: 0 0 8px; }
small, .muted { color: var(--muted); } .dim { color: var(--dim); }
.ico { flex-shrink: 0; vertical-align: middle; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
#app { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.side { display: none; }
.main { flex: 1; min-width: 0; padding: calc(var(--sat) + 14px) 16px calc(var(--nav-h) + var(--sab) + 120px); max-width: 1180px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + var(--sab)); padding-bottom: var(--sab);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.bottom-nav a.on { color: var(--accent); }
@media (min-width: 960px) {
  .side { display: flex; flex-direction: column; width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--bg2); overflow-y: auto; }
  .side .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; padding: 0 10px 22px; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .side nav a:hover { background: var(--card); color: var(--text); }
  .side nav a.on { background: var(--card); color: var(--accent); }
  .side .num { margin-left: auto; font-size: 11px; color: var(--dim); }
  .bottom-nav { display: none; }
  .main { padding: 28px 32px 120px; }
  h1 { font-size: 28px; }
}
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }

/* ---------- Componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .md-2 { grid-template-columns: 1fr 1fr; } .md-21 { grid-template-columns: 2fr 1fr; } .md-12 { grid-template-columns: 1fr 1.4fr; } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; transition: transform .08s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.btn.lg { min-height: 56px; font-size: 17px; border-radius: 16px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); display: inline-grid; place-items: center; cursor: pointer; color: var(--text); flex-shrink: 0; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.icon-btn.danger { color: var(--danger); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; }
.tag.acc { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: transparent; }
.tag.warn { background: color-mix(in srgb, var(--accent2) 16%, transparent); color: var(--accent2); border-color: transparent; }
.tag.bad { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-color: transparent; }
.tag.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: transparent; }

.lbl { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; }
.inp { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); outline: none; transition: border-color .15s; }
.inp:focus { border-color: var(--accent); }
textarea.inp { min-height: 88px; resize: vertical; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line2); transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat .v small { font-size: 13px; font-weight: 600; }
.stat .d { font-size: 12px; margin-top: 2px; }
.up { color: var(--ok); } .down { color: var(--danger); } .neutral { color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; transition: width .4s; }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { position: absolute; inset: 0; }
.ring circle { transition: stroke-dashoffset .5s; }
.ring-txt { text-align: center; line-height: 1.1; }
.ring-txt b { display: block; font-size: 16px; }
.ring-txt small { font-size: 10px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .ico { opacity: .5; margin-bottom: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.hero { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--card)), var(--card) 60%); border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.kpi-big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.pill-tabs { display: flex; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.pill-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 9px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pill-tabs button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Gráficos ---------- */
.chart { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--dim); font-size: 11px; }
.chart .val { font-size: 12px; font-weight: 700; }
.chart .val.small { fill: var(--muted); font-size: 10px; }
.chart .goal-line { stroke: var(--accent2); stroke-dasharray: 5 5; stroke-width: 1.5; }
.chart .goal-txt { fill: var(--accent2); }
.chart .pt { cursor: pointer; }
.chart .tip { position: absolute; transform: translate(-50%, -100%); background: var(--text); color: var(--bg); padding: 4px 8px; border-radius: 8px; font-size: 12px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.chart .tip.on { opacity: 1; }
.chart-empty { color: var(--dim); text-align: center; padding: 30px 10px; font-size: 13px; border: 1px dashed var(--line); border-radius: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbars .hbar { display: grid; grid-template-columns: 110px 1fr 60px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.hbar-t { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.hbar-t span { display: block; height: 100%; border-radius: 99px; }
.hbar b { text-align: right; }
.hbar-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Figuras de exercício ---------- */
.fig { background: radial-gradient(circle at 50% 40%, var(--card2), var(--bg2)); border-radius: 14px; overflow: hidden; aspect-ratio: 6 / 5; }
.fig-svg { width: 100%; height: 100%; display: block; }
.fig-svg .floor { stroke: var(--line2); stroke-width: 2; }
.fig-svg .eq { fill: var(--eq); } .fig-svg .eq-dark { fill: var(--eq-dark); }
.fig-svg .plate { fill: var(--eq-dark); stroke: var(--bg2); stroke-width: 1.5; }
.fig-svg .pad { fill: var(--eq); stroke: var(--eq-dark); stroke-width: 1; }
.fig-svg .pulley { fill: var(--bg2); stroke: var(--eq-dark); stroke-width: 2; }
.fig-svg .joint { fill: var(--bg2); stroke: var(--text); stroke-width: 1.4; }
.fig-img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.frames figure { margin: 0; text-align: center; }
.frames figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.legend-fig { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend-fig i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.mmap { display: flex; gap: 10px; justify-content: center; }
.mmap figure { margin: 0; text-align: center; }
.mmap svg { width: var(--mm); height: auto; display: block; }
.mmap figcaption { font-size: 11px; color: var(--muted); }
.mm-sil { fill: var(--card2); }
.mm-off { fill: var(--line2); }
.mm-prim { fill: var(--fig-prim); }
.mm-sec { fill: var(--fig-sec); }

/* ---------- Exercícios ---------- */
.ex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .ex-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .ex-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ex-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; transition: border-color .15s, transform .1s; }
.ex-card:hover { border-color: var(--line2); }
.ex-card:active { transform: scale(.98); }
.ex-card h4 { margin: 10px 2px 4px; font-size: 14px; }
.ex-card small { margin: 0 2px; display: block; }
.steps { padding-left: 0; list-style: none; counter-reset: s; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 38px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--accent); }
.bullets { margin: 0; padding-left: 0; list-style: none; }
.bullets li { padding: 6px 0 6px 26px; position: relative; }
.bullets.ok li::before, .bullets.bad li::before { position: absolute; left: 0; top: 6px; font-weight: 900; }
.bullets.ok li::before { content: '✓'; color: var(--ok); }
.bullets.bad li::before { content: '✕'; color: var(--danger); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp figure { margin: 0; }
.cmp figcaption { font-size: 12px; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }

/* ---------- Treino em andamento ---------- */
.session-head { position: sticky; top: 0; z-index: 20; margin: calc(-14px - var(--sat)) -16px 14px; padding: calc(var(--sat) + 12px) 16px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
@media (min-width: 960px) { .session-head { margin: -28px -32px 18px; padding: 18px 32px; } }
.session-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; }
.ex-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.ex-block.done { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.ex-block.skipped { opacity: .65; }
.ex-block-head { display: flex; gap: 12px; padding: 12px; align-items: center; cursor: pointer; }
.ex-thumb { width: 64px; height: 54px; border-radius: 10px; flex-shrink: 0; overflow: hidden; }
.ex-thumb .fig { aspect-ratio: auto; height: 100%; border-radius: 0; }
.ex-block-body { padding: 0 12px 12px; }
.suggest { display: flex; gap: 8px; align-items: flex-start; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 12px; padding: 10px; font-size: 13px; margin-bottom: 10px; }
.prev { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.sets { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.sets th { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: 0 4px; }
.sets td { text-align: center; padding: 0 3px; }
.sets td:first-child { width: 34px; font-weight: 800; color: var(--muted); }
.sets .inp { min-height: 44px; text-align: center; padding: 6px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.sets tr.done .inp { border-color: color-mix(in srgb, var(--ok) 50%, var(--line2)); background: color-mix(in srgb, var(--ok) 8%, var(--bg2)); }
.set-check { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line2); background: var(--bg2); display: grid; place-items: center; cursor: pointer; color: transparent; }
.set-check.on { background: var(--ok); border-color: var(--ok); color: #06261a; }
.delta { font-size: 11px; font-weight: 700; display: block; margin-top: 2px; min-height: 14px; }
.ex-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.progress-line { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress-line span { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* ---------- Barra flutuante do cronômetro ---------- */
.timer-float { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--sab) + 10px); z-index: 45; background: var(--card); border: 1px solid var(--line2); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.timer-float.finished { border-color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); } }
.timer-float .t { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 84px; }
.timer-float .bar { flex: 1; }
@media (min-width: 960px) { .timer-float { left: auto; right: 24px; bottom: 24px; width: 420px; } }

/* ---------- Cronômetro (página) ---------- */
.big-timer { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin: 6px auto 18px; display: grid; place-items: center; }
.big-timer svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.big-timer .num { font-size: clamp(56px, 18vw, 84px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1; }
.big-timer .lab { color: var(--muted); font-weight: 600; text-align: center; margin-top: 6px; }
.big-timer.finished .num { color: var(--accent); }
.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.presets button { min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-weight: 800; cursor: pointer; }
.presets button.on { border-color: var(--accent); color: var(--accent); }
.timer-ctrl { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 14px 0; }
.round-btn { flex: none; aspect-ratio: 1; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.round-btn.big { width: 84px; height: 84px; background: var(--accent); color: var(--accent-ink); border: 0; }

/* ---------- Nutrição / receitas ---------- */
.meal { border-top: 1px solid var(--line); padding: 12px 0; }
.meal:first-child { border-top: 0; }
.meal-items .list-item { padding: 8px 0; font-size: 14px; }
.macro-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.macro-row b { display: block; font-size: 17px; }
.macro-row small { font-size: 11px; }
.recipe-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.recipe-card .cover { aspect-ratio: 10 / 7; background: var(--card2); position: relative; }
.recipe-card .cover img, .recipe-card .cover svg, .recipe-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-card .body { padding: 10px 12px 12px; }
.recipe-card h4 { font-size: 14px; margin-bottom: 4px; }
.fav { position: absolute; top: 8px; right: 8px; color: var(--accent2); }
.recipe-cover { border-radius: 16px; overflow: hidden; aspect-ratio: 10 / 7; background: var(--card2); max-height: 320px; width: 100%; }
.recipe-art { width: 100%; height: 100%; }
.ing { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.ing:last-child { border-bottom: 0; }
.search-results { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.search-results button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; text-align: left; padding: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; border-radius: 8px; }
.search-results button:hover, .search-results button.on { background: var(--card2); }

/* ---------- Fotos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 720px) { .photo-grid { grid-template-columns: repeat(5, 1fr); } }
.photo { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--card2); cursor: pointer; border: 2px solid transparent; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 11px; font-weight: 600; }
.photo.sel { border-color: var(--accent); }
.photo .selnum { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare figure { margin: 0; }
.compare img { width: 100%; border-radius: 12px; aspect-ratio: 3/4; object-fit: cover; background: var(--card2); }
.slider-cmp { position: relative; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; max-width: 460px; margin: 0 auto; touch-action: none; }
.slider-cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slider-cmp .after { clip-path: inset(0 0 0 50%); }
.slider-cmp .handle { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; left: 50%; transform: translateX(-50%); box-shadow: 0 0 8px rgba(0,0,0,.5); }
.slider-cmp .handle::after { content: '⇆'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-weight: 900; }
.slider-cmp .lb { position: absolute; top: 10px; padding: 4px 8px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; }
.timeline-date { font-weight: 800; margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }

/* ---------- Modal / toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.modal-back.show { opacity: 1; }
.modal { background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 0 18px calc(18px + var(--sab)); transform: translateY(30px); transition: transform .2s; border: 1px solid var(--line); }
.modal-back.show .modal { transform: none; }
.modal-wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--card); padding: 16px 0 10px; z-index: 2; }
@media (min-width: 720px) { .modal-back { align-items: center; } .modal { border-radius: 22px; } }
#toasts { position: fixed; top: calc(var(--sat) + 12px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--danger); color: #fff; }
.toast-success { background: var(--ok); color: #06261a; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth h1 { font-size: 30px; margin: 18px 0 6px; }
.loader { display: grid; place-items: center; min-height: 40vh; color: var(--muted); }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.disclaimer { font-size: 12px; color: var(--muted); border-left: 3px solid var(--accent2); padding: 8px 12px; background: var(--card2); border-radius: 0 10px 10px 0; }
.ach { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ach:last-child { border-bottom: 0; }
.ach .badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--card2); color: var(--dim); flex-shrink: 0; }
.ach.done .badge { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.day-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab { flex-shrink: 0; min-width: 76px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; }
.day-tab b { display: block; font-size: 13px; }
.day-tab small { font-size: 11px; }
.day-tab.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.day-tab.today b::after { content: ' •'; color: var(--accent); }
.plan-ex { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-ex:last-child { border-bottom: 0; }
.plan-ex .ex-thumb { width: 58px; height: 48px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
.num-col { text-align: right; font-variant-numeric: tabular-nums; }
