/* SOY RICO — BODY SYSTEM · estilo oscuro, premium y minimalista.
   Todo el color sale de estas variables. */
:root {
  --bg: #0B0F12;
  --surface: #131A1F;
  --surface2: #1A2329;
  --raise: #212C33;
  --line: #26323B;
  --track: #222D35;
  --fg: #EEF2F5;
  --muted: #8E9BA7;
  --gold: #E2B33C;
  --gold-ink: #1B1404;
  --kcal: #E2B33C;
  --prot: #3CC8B2;
  --carb: #6E9CFF;
  --fat: #F08A6B;
  --over: #FF5C70;
  --ok: #49D17D;
  --warn: #F2B544;
  --focus: #8AB4FF;
  --radius: 18px;
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --line-hi: #33424D;
  --glow: rgba(226, 179, 60, .10);
  color-scheme: dark;
}

/* ---------- SKINS (Perfil → Estilo). «Imperio» es el de arriba. ---------- */
/* TITÁN · poder y ambición: negro carbón y rojo carmesí. */
:root[data-skin="titan"] {
  --bg: #09090B; --surface: #141417; --surface2: #1B1B1F; --raise: #232328;
  --line: #2C2C32; --line-hi: #3D3D45; --track: #25252A;
  --fg: #F4F2F2; --muted: #A09A9C;
  --gold: #F2464B; --gold-ink: #170203; --kcal: #F2464B;
  --prot: #3CC8B2; --carb: #6E9CFF; --fat: #F5A65B;
  --over: #FF8A3D; --warn: #F2B544; --focus: #FF9A9D;
  --glow: rgba(242, 70, 75, .13);
}
/* VITALIDAD · salud y energía: verde bosque profundo y esmeralda. */
:root[data-skin="vitalidad"] {
  --bg: #06110C; --surface: #0D1A14; --surface2: #12231B; --raise: #182D23;
  --line: #1E3A2D; --line-hi: #2A5040; --track: #193026;
  --fg: #EDF7F1; --muted: #8DA89A;
  --gold: #3DDC97; --gold-ink: #02150C; --kcal: #F5C451;
  --prot: #4FC3F7; --carb: #9AA5FF; --fat: #F08A6B;
  --ok: #3DDC97; --focus: #8EF0C4;
  --glow: rgba(61, 220, 151, .11);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; color: var(--fg);
  background: var(--bg) radial-gradient(130% 55% at 50% -12%, var(--glow), transparent 62%) no-repeat;
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.cap::first-letter { text-transform: uppercase; }
.center { text-align: center; justify-content: center; }
.right { text-align: right; }
.grow { flex: 1 1 auto; min-width: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.warn-text { color: var(--warn); }
.danger-text { color: var(--over) !important; }
.noscript { padding: 24px; }

/* ---------- arranque ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; text-align: center; gap: 6px; }
.boot strong { font: 800 26px/1 var(--display); letter-spacing: .04em; }

/* ---------- página ---------- */
#view { outline: none; }
.page {
  max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) max(16px, env(safe-area-inset-right)) calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 96px) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 16px;
}
.page > * { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding-bottom: 4px; }
.brand { display: block; font: 800 11px/1 var(--display); letter-spacing: .22em; color: var(--gold); margin-bottom: 6px; }
h1 { font: 800 28px/1.1 var(--display); letter-spacing: -.01em; }
.label { font: 700 11px/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.foot { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- botones ---------- */
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--fg);
}
.icon-btn.sm { width: 38px; height: 38px; border-radius: 12px; background: transparent; border-color: transparent; color: var(--muted); }
.icon-btn.sm:hover { color: var(--fg); background: var(--surface2); }
.primary, .secondary, .ghost {
  min-height: 50px; border-radius: 14px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; letter-spacing: .01em;
}
.primary { background: var(--gold); color: var(--gold-ink); width: 100%; }
.primary:active:not(:disabled) { transform: scale(.985); }
.primary.danger { background: var(--over); color: #fff; }
.primary.small, .ghost.small { min-height: 38px; width: auto; padding: 0 14px; font-size: 14px; }
.secondary { background: var(--surface2); border: 1px solid var(--line); }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--fg); min-height: 46px; font-weight: 550; }
.wide { width: 100%; }
.link-btn { color: var(--muted); font-size: 14px; padding: 6px 4px; font-weight: 600; }
.link-btn.strong { color: var(--fg); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions > * { flex: 1 1 140px; }
.actions .primary.grow { flex: 2 1 180px; }
.actions.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actions.three > * { min-width: 0; padding: 0 8px; gap: 6px; font-size: 14px; }
.repeat-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--gold) 12%, var(--surface2)); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); }
.repeat-btn > svg:first-child { color: var(--gold); flex: none; }
.fav-mark { color: var(--gold); margin-left: 6px; display: inline-flex; vertical-align: -1px; }
.fav-btn.on { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); }
.suggest { display: flex; flex-direction: column; gap: 8px; }
.suggest:empty { display: none; }
.hr-rows[hidden] { display: none; }
.hr-result { background: var(--surface2); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.hr-per100 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.hr-per100 strong { font: 800 22px/1.1 var(--display); }
.list-row[disabled] { opacity: .5; }
.big-cta { min-height: 58px; font: 800 16px/1 var(--display); letter-spacing: .14em; }
.file-btn { cursor: pointer; }

/* ---------- tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.link-card { display: block; }
.link-card:hover { border-color: var(--line-hi); }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; background: var(--surface2); border: 1px solid var(--line); }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.notice.ok svg { color: var(--ok); flex: none; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.notice.err { border-color: var(--over); }
.install { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* cumplimiento */
.comp { display: flex; gap: 16px; align-items: center; }
.comp-body { flex: 1; min-width: 0; }
.comp-body .label { margin-bottom: 2px; }
.comp-line { font-weight: 600; margin-bottom: 8px; }
.comp-pct { font: 800 26px/1 var(--display); }
.comp-pct small { font-size: 13px; color: var(--muted); margin-left: 1px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks li { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: var(--surface2); }
.checks li.ok { color: var(--fg); background: color-mix(in srgb, var(--ok) 16%, var(--surface2)); }
.checks li.ok svg { color: var(--ok); }
.checks .dot { width: 6px; height: 6px; border-radius: 50%; background: #45525C; display: inline-block; }

/* calorías + anillos */
.kcal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.kcal-head .label { margin-bottom: 4px; }
.kcal-big { font: 800 40px/1 var(--display); letter-spacing: -.02em; }
.kcal-big small { font: 500 14px var(--font); color: var(--muted); letter-spacing: 0; }
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; justify-items: center; }
.ring { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ring-svg { position: relative; display: grid; place-items: center; }
.ring-svg svg { display: block; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; font: 700 15px/1 var(--display); }
.ring-label { font-size: 12px; font-weight: 600; margin-top: 6px; }
.ring-sub { font-size: 11px; color: var(--muted); }
@media (max-width: 350px) { .rings .ring-svg svg { width: 58px; height: 58px; } .rings .ring { width: 58px !important; } }

/* tarjetas de hábitos */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 118px;
}
.tile:hover { border-color: var(--line-hi); }
.tile.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.tile-top { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tile-ok { margin-left: auto; color: var(--ok); display: inline-flex; }
.tile-val { font: 750 24px/1.1 var(--display); overflow-wrap: anywhere; }
.tile-val small { font: 500 13px var(--font); color: var(--muted); }
.tile-sub { font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: auto; }

/* barras */
.bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar.thin { height: 4px; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--gold); }
.tile .bar > i { background: var(--ok); }
@media (prefers-reduced-motion: no-preference) { .bar > i { transition: width .3s ease; } }
.macros { display: flex; flex-direction: column; gap: 14px; }
.mbar-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.mbar-head b { font-weight: 650; }
.mbar-head span { color: var(--muted); }
.mbar-head strong { color: var(--fg); font-weight: 650; }
.mbar-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mbar-note.over { color: var(--over); }

/* navegación de días */
.daynav { display: flex; gap: 8px; align-items: stretch; }
.day-btn { flex: 1; min-height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; padding: 0 10px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-checked="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 600; }
.chip.plate svg { color: var(--gold); }

/* registro */
.log { display: flex; flex-direction: column; gap: 14px; }
.meal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 4px; }
.meal-head { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.meal-head h3 { font: 700 16px/1.2 var(--display); }
.item { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.swipe { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); margin: 0 -14px; }
.swipe:last-child { border-bottom: 0; }
.swipe-bg { position: absolute; inset: 0; display: flex; justify-content: flex-end; align-items: center; gap: 6px; padding-right: 18px; background: color-mix(in srgb, var(--over) 55%, var(--surface)); color: #fff; font-weight: 700; font-size: 14px; }
.swipe-bg.armed { background: var(--over); }
.swipe .item { position: relative; background: var(--surface); border-bottom: 0; padding: 11px 14px; touch-action: pan-y; transition: transform .16s ease; }
.swipe .item.dragging { transition: none; }
.item-main { flex: 1; min-width: 0; }
.item-name { overflow-wrap: anywhere; font-weight: 550; }
.item-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item-kcal { font-weight: 700; white-space: nowrap; }
.item-kcal::after { content: " kcal"; font-weight: 400; color: var(--muted); font-size: 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.tag.gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); margin-left: 0; }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.row-title .tag.gold { margin-left: 8px; }
.empty { padding: 22px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; }

/* semana */
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; margin-bottom: 12px; }
.col { display: grid; grid-template-rows: 16px 1fr 18px; gap: 4px; min-width: 0; text-align: center; }
.col .val { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.track { position: relative; border-radius: 8px; background: var(--track); display: flex; align-items: flex-end; overflow: hidden; }
.track .fill { width: 100%; background: var(--kcal); opacity: .85; border-radius: 6px 6px 0 0; }
.track .fill.over { background: var(--over); }
.track .goal { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--fg); opacity: .5; }
.col .lab { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.col[aria-current="true"] .lab { color: var(--fg); font-weight: 700; }
.col[aria-current="true"] .track { outline: 2px solid var(--fg); outline-offset: 1px; }
.week-avg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.week-avg > div { display: flex; flex-direction: column; background: var(--surface2); border-radius: 12px; padding: 8px 10px; }
.week-avg strong { font: 700 16px/1.3 var(--display); }

/* ---------- hoja inferior ---------- */
.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; padding: 0;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--fg); overflow: hidden; display: flex; flex-direction: column;
}
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(3, 6, 8, .66); backdrop-filter: blur(2px); }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: up .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
}
.grab { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex; flex-direction: column; gap: 14px;
}
.sheet-body > * { flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; gap: 10px; min-height: 48px; position: sticky; top: -8px; background: var(--surface); z-index: 2; padding: 6px 0; margin-top: -6px; }
.sheet-title { flex: 1; min-width: 0; }
.sheet-title h2 { font: 750 19px/1.2 var(--display); overflow-wrap: anywhere; }
.sheet-head .icon-btn { width: 40px; height: 40px; background: var(--surface2); }

/* formularios */
input[type="text"], input[type="search"], select {
  width: 100%; min-width: 0; font-size: 16px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px;
}
input::placeholder { color: #66737E; }
input[type="search"]::-webkit-search-cancel-button { filter: invert(.7); }
select { 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: 34px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field label, .field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .full { grid-column: 1 / -1; }
.sub-label { font: 700 11px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.field-row { display: flex; gap: 8px; align-items: flex-end; }
.field-row .field { flex: 1; }
.field-row .icon-btn { height: 48px; width: 48px; }
.form-msg { font-size: 14px; color: var(--warn); min-height: 0; }
.form-msg:empty { display: none; }
.title-input { font: 750 20px/1.2 var(--display) !important; background: transparent !important; border-color: transparent !important; padding-left: 0 !important; }
.title-input:focus { border-color: var(--line) !important; padding-left: 12px !important; }
.inline-form { display: flex; gap: 8px; }
.inline-form .secondary { min-height: 48px; flex: none; }
.scan-btn { padding: 0 12px; gap: 6px; font-size: 14px; }
p.small[role="status"]:empty { display: none; }

.num-row { display: flex; align-items: center; gap: 12px; justify-content: center; }
.round-btn { width: 52px; height: 52px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--line); font-size: 26px; line-height: 1; flex: none; }
.num-field { position: relative; display: flex; align-items: center; flex: 1; max-width: 240px; margin: 0 auto; width: 100%; }
.big-input { text-align: center; font: 750 34px/1 var(--display) !important; min-height: 66px !important; padding-right: 44px !important; padding-left: 44px !important; }
.num-field .unit { position: absolute; right: 16px; color: var(--muted); font-weight: 600; pointer-events: none; }
.preview { text-align: center; color: var(--muted); font-size: 14px; min-height: 20px; }
.per100 { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface2); }

/* búsqueda y listas */
.search-row { position: relative; display: flex; align-items: center; }
.search-row > svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search-input { padding-left: 42px !important; }
.results { display: flex; flex-direction: column; gap: 10px; }
.results > .label { margin: 6px 0 0; }
.off-box:empty { display: none; }
.off-box { display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; background: var(--surface2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.list-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); min-height: 58px; }
.list-row:last-child { border-bottom: 0; }
.list-row:not(.static):hover { background: var(--raise); }
.list-row > svg { color: var(--muted); flex: none; }
.list-row.selected { background: color-mix(in srgb, var(--gold) 12%, var(--surface2)); }
.list-row.selected > svg { color: var(--gold); }
.row-title { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--raise); display: grid; place-items: center; font: 750 16px/1 var(--display); color: var(--muted); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.grams-box { position: relative; width: 92px; flex: none; }
.grams-input { text-align: right; padding-right: 28px !important; min-height: 44px !important; }
.grams-box .unit { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.plain-list { display: flex; flex-direction: column; gap: 6px; padding-left: 18px; list-style: disc; color: var(--muted); font-size: 14px; }
.step-n { width: 36px; height: 36px; border-radius: 10px; background: var(--raise); display: grid; place-items: center; font: 700 13px/1 var(--display); color: var(--gold); flex: none; }

/* registrar */
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reg-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 16px; background: var(--surface2); border: 1px solid var(--line); text-align: left; min-height: 104px; }
.reg-item:first-child { grid-column: 1 / -1; min-height: 76px; background: color-mix(in srgb, var(--gold) 14%, var(--surface2)); border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.reg-item.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.reg-ic { color: var(--gold); }
.reg-item.ok .reg-ic { color: var(--ok); }
.reg-label { font-weight: 700; }
.reg-sub { font-size: 12px; color: var(--muted); }

/* escáner */
.scan-box { position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #000; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 28% 12%; border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

/* próximamente */
.soon { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.soon-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--surface2); display: grid; place-items: center; color: var(--gold); }
.soon-lead { font: 650 18px/1.35 var(--display); }

/* ---------- figura de demostración ---------- */
.figure { background: var(--bg); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; flex: none; }
.figure svg { display: block; width: 100%; height: auto; }
.figure-sm { width: 56px; height: 45px; flex: none; border-radius: 12px; }
.figure-lg { width: 100%; max-width: 360px; margin: 0 auto; }
.fig-ground { stroke: var(--line); stroke-width: 2; }
.fig-prop { fill: var(--raise); stroke: var(--line); stroke-width: 1.5; }
.fig-limb, .fig-torso { stroke: var(--fg); stroke-width: 6; stroke-linecap: round; }
.fig-torso { stroke-width: 9; }
.fig-limb.far { opacity: .35; }
.fig-head { fill: var(--fg); }
.fig-db { stroke: var(--gold); stroke-width: 7; stroke-linecap: round; }
.figure-sm .fig-limb, .figure-sm .fig-torso { stroke-width: 9; }
.figure-sm .fig-torso { stroke-width: 12; }

/* ---------- entrenamiento ---------- */
.gold-text { color: var(--gold); }

/* ---------- botón «Mis escaneados» ---------- */
.scanned-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; }
.scanned-btn .grow { display: flex; flex-direction: column; gap: 2px; }
.scanned-btn .ns-ic { color: var(--gold); font-size: 22px; }

/* ---------- comida rápida ---------- */
.ff-lines { display: flex; flex-direction: column; gap: 12px; }
.ff-line { display: flex; flex-direction: column; gap: 12px; }
.ff-line-head { display: flex; align-items: flex-start; gap: 10px; }
.ff-line-head h3 { font: 750 17px/1.2 var(--display); }
.ff-kcal { font: 750 17px/1.2 var(--display); color: var(--gold); white-space: nowrap; }
.ff-stepper { display: flex; align-items: center; gap: 10px; }
.ff-stepper .icon-btn { background: var(--surface2); border: 1px solid var(--line); }
.ff-qty { min-width: 92px; text-align: center; font-weight: 700; }
.ff-qs { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.ff-q { display: flex; flex-direction: column; gap: 6px; }
.ff-q-label { font-size: 14px; font-weight: 600; }
.ff-q .chip { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.ff-add { display: flex; flex-direction: column; gap: 10px; }
.ff-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom, 0px)); z-index: 2; display: flex; flex-direction: column; gap: 10px; padding: 16px 0 calc(20px + env(safe-area-inset-bottom, 0px)); margin-bottom: calc(-20px - env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, transparent, var(--surface) 16px); }
.ff-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ff-total strong { font: 800 22px/1 var(--display); color: var(--gold); }
.ff-total span { font-size: 13.5px; color: var(--muted); }
.ff-done { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.ff-done strong { font: 800 30px/1.1 var(--display); color: var(--gold); }
.ff-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.ff-close { font-weight: 700; color: var(--gold); }

/* ---------- coach IA ---------- */
.ai-tag { vertical-align: middle; margin-left: 8px; font-size: 11px; letter-spacing: .06em; }
.msg.typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; width: auto; align-self: flex-start; }
.msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite ease-in-out; }
.msg.typing span:nth-child(2) { animation-delay: .15s; }
.msg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- comunidad ---------- */
.contrib { display: flex; align-items: center; gap: 12px; border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.contrib-ic { font-size: 26px; line-height: 1; flex: none; }

/* ---------- escribir lo que comí ---------- */
.meal-area { width: 100%; min-height: 84px; resize: vertical; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); color: var(--fg); padding: 12px; font: inherit; line-height: 1.4; }
.meal-area:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.meal-out { display: flex; flex-direction: column; gap: 10px; }
.meal-row { gap: 10px; padding: 10px 4px; }
.meal-row .row-title { font-size: 14.5px; }
.meal-g-box { display: flex; align-items: center; gap: 3px; }
.meal-g { width: 58px; min-height: 38px; text-align: right; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); }
.meal-kcal { font-weight: 700; font-size: 14px; color: var(--gold); }
.meal-g-line { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.meal-row .meal-g-box { flex: none; }
.meal-row input.meal-g { width: 78px; min-width: 0; flex: none; }
.meal-row { align-items: flex-start; }
.write-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }

/* ---------- selector de skin ---------- */
.skins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.skin-opt {
  display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 10px; border-radius: 14px;
  background: var(--sk-bg); border: 1.5px solid var(--sk-line); color: var(--sk-fg); min-width: 0;
  transition: transform .15s ease, border-color .15s ease;
}
.skin-opt:active { transform: scale(.97); }
.skin-opt[aria-pressed="true"] { border-color: var(--sk-acc); box-shadow: 0 0 0 1px var(--sk-acc), 0 8px 22px -10px var(--sk-acc); }
.skin-prev { height: 54px; border-radius: 10px; background: var(--sk-surf) radial-gradient(120% 90% at 50% -20%, color-mix(in srgb, var(--sk-acc) 35%, transparent), transparent 70%); position: relative; overflow: hidden; }
.skin-prev i { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 12px; border-radius: 6px; background: var(--sk-acc); }
.skin-prev b { position: absolute; left: 8px; top: 8px; width: 40%; height: 5px; border-radius: 3px; background: var(--sk-acc); opacity: .8; }
.skin-name { font: 800 13px/1.1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--sk-acc); }
.skin-motto { font-size: 11.5px; line-height: 1.3; opacity: .78; }
.skin-check { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--sk-acc); min-height: 14px; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.plan-head .label { margin-bottom: 10px; }
.workout-clock { display: flex; flex-direction: column; align-items: flex-end; font: 750 22px/1.1 var(--display); }
.ex-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ex-card.open { padding-bottom: 14px; gap: 12px; }
.ex-card.open > :not(.ex-head) { margin: 0 14px; }
.ex-card.done:not(.open) { opacity: .7; }
.ex-card.open > .figure-lg { width: auto; max-width: 300px; align-self: center; margin: 0 auto; }
.ex-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; width: 100%; }
.ex-head > svg { color: var(--muted); flex: none; }
.step-n.ok { background: color-mix(in srgb, var(--ok) 22%, var(--raise)); color: var(--ok); }
.tips-box { background: var(--surface2); border-radius: 12px; padding: 0 12px; }
.tips-box summary { min-height: 44px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.tips-box .tips { padding-bottom: 12px; }
.tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sets { display: flex; flex-direction: column; gap: 6px; }
.set-row { display: grid; grid-template-columns: 34px 1fr 1fr 48px; gap: 8px; align-items: center; }
.set-row.set-head { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.set-row.set-head span { text-align: center; }
.set-n { width: 34px; height: 34px; border-radius: 10px; background: var(--surface2); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.set-in { text-align: center; font-weight: 700; min-height: 46px !important; padding: 8px !important; }
.set-check { width: 48px; height: 46px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.set-row.done .set-check { background: var(--ok); border-color: var(--ok); color: #06210F; }
.set-row.done .set-in { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.set-row.done .set-n { color: var(--ok); }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.ex-meta b { color: var(--fg); }
.progress { display: flex; flex-direction: column; gap: 8px; }
.spark { width: 100%; height: 70px; background: var(--surface2); border-radius: 12px; }
.hist { display: flex; flex-direction: column; }
.hist li { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist li > span:nth-child(2) { flex: 1; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center; }
.stat strong { font: 800 24px/1.1 var(--display); }
.rest {
  position: fixed; z-index: 12; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  width: min(528px, calc(100% - 24px)); background: var(--raise); border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
  border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.rest-row { display: flex; align-items: center; gap: 8px; }
.rest-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rest-time { font: 800 26px/1 var(--display); flex: 1; }
.rest-btn { min-height: 40px; min-width: 46px; padding: 0 10px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); font-weight: 650; font-size: 14px; }
.rest-btn.strong { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.rest .bar > i { background: var(--gold); }

/* ---------- progreso ---------- */
.prog-card { display: flex; flex-direction: column; gap: 12px; }
.prog-card .label { margin-bottom: 4px; }
.prog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.prog-big { font: 800 34px/1.1 var(--display); letter-spacing: -.01em; }
.prog-big small { font: 500 14px var(--font); color: var(--muted); }
.prog-rate { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.prog-rate strong { font: 750 18px/1.2 var(--display); }
.prog-rate.down strong { color: var(--ok); }
.prog-rate.up strong { color: var(--warn); }
.good-text { color: var(--ok); }
.trend { position: relative; }
.trend-svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.trend-grid { stroke: var(--line); stroke-width: 1; }
.trend-axis { fill: var(--muted); font: 500 10px var(--font); }
.trend-dot { fill: var(--muted); opacity: .55; }
.trend-line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trend-end { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.trend-cross { stroke: var(--fg); stroke-width: 1; opacity: .4; }
.trend-ring { fill: none; stroke: var(--fg); stroke-width: 2; }
.trend-tip { position: absolute; top: 0; width: 150px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 12px; pointer-events: none; z-index: 1; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.trend-tip[hidden] { display: none; }
.spark-mini { width: 110px; height: 30px; flex: none; }
.measure .spark-mini { width: 90px; height: 24px; }
.spark-mini-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.spark-mini-end { fill: var(--gold); }
.measures { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.measure { background: var(--surface2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.measure strong { font: 750 20px/1.2 var(--display); }
.photo-groups { display: flex; flex-direction: column; gap: 12px; }
.photo-group { display: flex; flex-direction: column; gap: 6px; }
.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-thumb { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface2); border: 1px solid var(--line); padding: 0; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.6); padding: 2px 6px; border-radius: 6px; }
.photo-full { width: 100%; border-radius: 14px; display: block; background: var(--surface2); }
.cmp-stage { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; }
.cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); transform: translateX(-1px); pointer-events: none; }
.cmp-tag { position: absolute; top: 8px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 6px; }
.cmp-tag.left { left: 8px; } .cmp-tag.right { right: 8px; }
.cmp-range { width: 100%; accent-color: var(--gold); }

/* ---------- fluidez: entradas, pulsaciones, gestos ---------- */
@media (prefers-reduced-motion: no-preference) {
  .page.enter > * { animation: rise .32s cubic-bezier(.2, .8, .2, 1) both; }
  .page.enter > *:nth-child(2) { animation-delay: .03s; }
  .page.enter > *:nth-child(3) { animation-delay: .06s; }
  .page.enter > *:nth-child(4) { animation-delay: .09s; }
  .page.enter > *:nth-child(5) { animation-delay: .12s; }
  .page.enter > *:nth-child(n+6) { animation-delay: .15s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  .ring-arc { transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
  .primary, .secondary, .ghost, .chip, .tile, .list-row, .reg-item, .icon-btn, .ns-chip, .set-check, .fab, .repeat-btn, .report-cta { transition: transform .12s ease, background-color .2s ease, border-color .2s ease; }
  .primary:active:not(:disabled), .secondary:active, .ghost:active, .chip:active, .tile:active, .list-row:active, .reg-item:active,
  .icon-btn:active, .ns-chip:active, .set-check:active, .repeat-btn:active, .report-cta:active { transform: scale(.97); }
  .fab:active { transform: translateX(-50%) scale(.96); }
  .toast:not([hidden]) { animation: toastIn .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
  .sheet { transition: transform .2s ease; }
  .sheet.dragging { transition: none; }
  .set-row.done .set-check { animation: pop .25s ease; }
  @keyframes pop { 50% { transform: scale(1.12); } }
}
.grab-zone { padding: 2px 0 8px; cursor: grab; flex: none; }
.nav a { position: relative; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; top: 3px; width: 44px; height: 30px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 16%, transparent); }
.nav a svg { position: relative; }

/* ---------- programa oficial ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.wk-day b { font: 800 15px/1 var(--display); }
.wk-day span { font-size: 9px; font-weight: 700; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-day.soft b { color: var(--muted); }
.wk-day.today { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.wk-day.on { background: var(--gold); border-color: var(--gold); }
.wk-day.on b, .wk-day.on span { color: var(--gold-ink); }
.session-head { display: flex; flex-direction: column; gap: 6px; }
.session-head .label { margin: 0; }
.session-name { font: 800 24px/1.15 var(--display); }
.plan { display: flex; flex-direction: column; gap: 12px; }
.check-box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: var(--gold-ink); }
.check-box.on { background: var(--ok); border-color: var(--ok); color: #06210F; }
.rules { margin-top: 4px; }
.obs { font-size: 14px !important; min-height: 0; }
.chips.weights { align-items: center; margin-top: 4px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stats.four .stat strong { font-size: 19px; }
.cmp-row { align-items: flex-start; }
.cmp-v { width: 26px; height: 26px; border-radius: 8px; background: var(--surface); display: grid; place-items: center; font-weight: 800; flex: none; }

/* ---------- inicio: racha y siguiente paso ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; }
.streak { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 18px; filter: grayscale(1); opacity: .6; }
.streak.on { filter: none; opacity: 1; border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.streak b { font: 800 17px/1 var(--display); color: var(--fg); }
.next-step { display: flex; flex-direction: column; gap: 10px; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 60%); }
.next-step.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--ok) 10%, var(--surface)), var(--surface) 60%); }
.next-step .label { margin-bottom: 0; }
.ns-main { display: flex; align-items: center; gap: 12px; }
.ns-main strong { font: 700 16px/1.25 var(--display); }
.ns-main p { margin-top: 2px; }
.ns-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface2); color: var(--gold); flex: none; }
.next-step.done .ns-ic { color: var(--ok); }
.ns-more { display: flex; flex-wrap: wrap; gap: 8px; }
.ns-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.ns-chip svg { color: var(--gold); }
.report-cta { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; }
.report-cta > svg:last-child { color: var(--muted); }

/* ---------- informe semanal ---------- */
.rep-score { display: flex; align-items: baseline; gap: 10px; }
.rep-score strong { font: 800 40px/1 var(--display); color: var(--gold); }
.rep-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rep-grid .stat { align-items: flex-start; }
.rep-sec { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface2); border-left: 4px solid var(--line); }
.rep-sec .label { margin: 0; }
.rep-sec.good { border-left-color: var(--ok); }
.rep-sec.bad { border-left-color: var(--warn); }
.rep-sec.goal { border-left-color: var(--gold); }
.rep-sec.adapt { border-left-color: var(--carb); }
.rep-list { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; list-style: disc; font-size: 14px; }
.prev-line { padding: 8px 10px; border-radius: 10px; background: var(--surface2); }

/* ---------- calidad de alimentos ---------- */
.q-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; flex: none; }
.q-dot.big { width: 14px; height: 14px; margin: 0; }
.q-pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border: 1px solid; border-radius: 999px; padding: 3px 10px; }
.q-card { border: 1px solid; border-left-width: 4px; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface2); }
.q-head { display: flex; align-items: center; gap: 10px; }
.q-ns { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font: 800 16px/1 var(--display); flex: none; }
.photo-fill { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; border: 1px dashed color-mix(in srgb, var(--gold) 45%, var(--line)); }
textarea { width: 100%; min-width: 0; font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical; }

.acc-row { display: flex; align-items: center; gap: 12px; }
.acc-row .ns-ic { color: var(--ok); }

/* ---------- créditos ---------- */
.credits { text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted); opacity: .7; letter-spacing: .02em; padding: 8px 0 4px; }
.credits p { margin: 0; }

/* ---------- bienvenida ---------- */
.welcome { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px); min-height: 100dvh; }
.wel-top { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.wel-top .brand { margin: 0; }
.wel-dots { display: flex; gap: 6px; }
.wel-dots i { width: 22px; height: 4px; border-radius: 99px; background: var(--line); }
.wel-dots i.on { background: var(--gold); }
.wel-body { display: flex; flex-direction: column; gap: 16px; }
.wel-title { font: 800 40px/1.05 var(--display); letter-spacing: .02em; margin-top: 8vh; }
.wel-lead { font: 600 18px/1.4 var(--display); color: var(--fg); }
.wel-sub { font: 700 13px/1 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-top: -8px; }
.welcome p a, .sheet p a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.country-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.country-opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); text-align: left; font-weight: 600; font-size: 14.5px; }
.country-opt .flag { font-size: 22px; line-height: 1; }
.country-opt[aria-pressed="true"] { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.hello-name { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 700; font-size: 14px; }
.wel-points { display: flex; flex-direction: column; gap: 14px; margin: 8px 0; }
.wel-points li { display: flex; gap: 12px; align-items: flex-start; }
.wel-points p { margin-top: 2px; }
.wel-nav { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.wel-kcal { display: flex; flex-direction: column; gap: 4px; border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.wel-kcal strong { font: 800 34px/1.1 var(--display); color: var(--gold); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------- coach ---------- */
.coach-page { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 96px); }
.coach-status { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; }
.coach-left { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.coach-left strong { font: 800 24px/1.2 var(--display); color: var(--gold); }
.chat { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.msg p { margin: 0; }
.msg.me { align-self: flex-end; max-width: 85%; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 18px 18px 4px 18px; font-weight: 550; }
.msg.coach > p { background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; border-radius: 18px 18px 18px 4px; align-self: flex-start; max-width: 92%; }
.ideas { display: flex; flex-direction: column; gap: 10px; }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.idea-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.idea-head h3 { font: 700 16px/1.25 var(--display); }
.idea-macros { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.idea-macros b { color: var(--gold); }
.idea-ing { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.idea-ing .g { display: inline-block; min-width: 58px; font-weight: 700; color: var(--fg); }
.idea .secondary { min-height: 44px; }
.chat-bar {
  position: fixed; z-index: 11; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  width: min(528px, calc(100% - 24px)); display: flex; gap: 8px; padding: 8px;
  background: var(--raise); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.chat-input { flex: 1; min-height: 46px !important; border-radius: 12px !important; }
.chat-send { width: 50px; min-height: 46px; padding: 0; flex: none; }

/* ---------- navegación inferior y REGISTRAR ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom, 0px) + 6px) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav[hidden] { display: none; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 12px; min-height: 52px; justify-content: center; }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"] svg { color: var(--gold); }
.fab {
  position: fixed; z-index: 11; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  height: 52px; padding: 0 26px; border-radius: 999px; background: var(--gold); color: var(--gold-ink);
  font: 800 14px/1 var(--display); letter-spacing: .16em; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(0, 0, 0, .2);
}
.fab span { font-size: 22px; font-weight: 600; letter-spacing: 0; margin-top: -2px; }
.fab[hidden] { display: none; }

/* ---------- aviso ---------- */
.toast {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 78px);
  width: min(520px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px;
  background: var(--fg); color: var(--bg); padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 550;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.toast[hidden] { display: none; }
.toast span { flex: 1; }
.toast-btn { font-weight: 800; color: var(--bg); text-decoration: underline; padding: 4px; }

@media (min-width: 700px) {
  .page { padding-top: 32px; }
  .sheet { margin-bottom: auto; border-radius: 22px; border-bottom: 1px solid var(--line); }
}
