/* Estilo "claro y fresco": fondo blanco suave, verde salvia como color principal, naranja Jean Fitness como acento.
   Barlow para textos; Barlow Condensed solo para números grandes y la marca. */
:root {
  --bg: #F5F4EE;
  --surface: #FFFFFF;
  --surface2: #F0EFE7;
  --tx: #1D2A22;
  --mu: #6B756D;
  --bd: rgba(29, 42, 34, .09);
  --sage: #4F7D5C;
  --sage-d: #3B6447;
  --sage-l: #E3EEE5;
  --or: #E8661A;
  --prot: #3A7BC8;
  --carb: #D49117;
  --fat: #D44F6C;
  --ok: #2E9D5B;
  --shadow: 0 8px 24px rgba(29, 42, 34, .07);
  --r: 18px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--mu); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }

/* encabezado */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; background: rgba(245, 244, 238, .9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.logo { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .14em; text-transform: uppercase; color: var(--tx); }
.logo span { color: var(--or); }
.daynav { display: flex; align-items: center; gap: 4px; }
.daynav span { font-weight: 600; font-size: 15px; min-width: 7.5em; text-align: center; }
.daynav button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); font-size: 20px; line-height: 1; }
.daynav button:disabled { opacity: .35; cursor: default; box-shadow: none; }

main { max-width: 560px; margin: 0 auto; padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 96px); }
.view { display: grid; gap: 18px; }
h2 { font-weight: 700; font-size: 20px; margin: 0; letter-spacing: -.01em; }
h3 { font-weight: 700; font-size: 17px; margin: 0; }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }

/* resumen del día */
.summary { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.ring { position: relative; width: 120px; height: 120px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--sage-l); }
.ring .bar { stroke: url(#rg); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .6s ease; }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-in b { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-in span { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--mu); }
.goal { margin: 0 0 12px; font-size: 14px; color: var(--mu); }
.goal b { color: var(--tx); }
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.macros > div { display: grid; gap: 2px; }
.macros span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mu); }
.macros b { font-family: var(--display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.macros b small { font-family: var(--body); font-size: 12px; font-weight: 500; color: var(--mu); }
.macros .p b { color: var(--prot); } .macros .c b { color: var(--carb); } .macros .g b { color: var(--fat); }
@media (max-width: 360px) { .summary { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

/* campos */
input[type="search"], input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea {
  width: 100%; min-width: 0; font-size: 16px; color: var(--tx); background: var(--surface); border: 1px solid var(--bd); border-radius: 12px; padding: 12px 14px;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input:focus, textarea:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 3px var(--sage-l); }

/* acciones rápidas: foto del plato y código de barras */
.quick { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; }
.snap, .barbtn { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); cursor: pointer; text-align: left; border: 0; }
.snap { background: linear-gradient(135deg, #5E8F6B, var(--sage-d)); color: #fff; box-shadow: 0 10px 24px rgba(59, 100, 71, .28); }
.snap:active { filter: brightness(1.06); }
.barbtn { background: var(--surface); color: var(--tx); box-shadow: var(--shadow); }
.snap svg, .barbtn svg { width: 28px; height: 28px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.snap b, .barbtn b { display: block; font-size: 16px; font-weight: 700; line-height: 1.15; }
.snap small, .barbtn small { display: block; font-size: 12.5px; opacity: .85; line-height: 1.25; margin-top: 2px; }
.snap input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.snap:focus-within { outline: 2px solid var(--tx); outline-offset: 2px; }

/* ideas saludables */
.ideas { display: grid; gap: 10px; }
.ideas-row { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.ideas-row::-webkit-scrollbar { display: none; }
.idea { scroll-snap-align: start; display: grid; gap: 0; padding: 0; border: 0; text-align: left; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.idea img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; max-width: 100%; }
.idea span { padding: 8px 10px 0; font-weight: 600; font-size: 14px; line-height: 1.25; }
.idea small { padding: 2px 10px 10px; color: var(--mu); font-size: 12.5px; }

/* buscador */
.search { display: grid; gap: 8px; }
.results { list-style: none; margin: 0; padding: 0; border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.results li + li { border-top: 1px solid var(--bd); }
.results button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: center; text-align: left; background: transparent; border: 0; padding: 12px 14px; }
.results button:active, .results button:hover { background: var(--surface2); }
.r-name { font-weight: 600; }
.r-por { grid-column: 1; font-size: 13px; color: var(--mu); }
.r-kcal { grid-column: 2; grid-row: 1 / span 2; font-family: var(--display); font-weight: 700; font-size: 20px; }
.r-kcal small { font-family: var(--body); font-size: 12px; color: var(--mu); font-weight: 500; }
.results .none { padding: 12px 14px; color: var(--mu); font-size: 14px; }
.pick { display: grid; gap: 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1.5px solid var(--sage); padding: 16px; }
.pick-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.pick-head img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.pick b { display: block; font-size: 17px; }
.pick span { font-size: 13px; }
#pickPor { color: var(--mu); }
.pick-row { display: flex; align-items: center; gap: 14px; }
.stepper { display: inline-grid; grid-template-columns: 44px 72px 44px; border-radius: 12px; overflow: hidden; background: var(--surface2); }
.stepper button { background: transparent; border: 0; font-size: 22px; color: var(--sage-d); }
.stepper input { border: 0; border-radius: 0; text-align: center; padding: 10px 4px; background: var(--surface); box-shadow: none; }
.pick-macros { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--mu); }
.pick-macros b { display: inline; font-family: var(--display); font-size: 20px; color: var(--tx); }
.pick-macros .k b { color: var(--sage-d); }

/* análisis de la foto */
.scan { display: grid; gap: 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1.5px solid var(--sage); padding: 16px; }
.scan-top { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; }
.scan-top img { width: 76px; height: 76px; object-fit: cover; border-radius: 14px; }
.scan-top b { font-size: 17px; }
.scan-top p { margin: 2px 0 0; }
.scan.loading #scanTitle::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; border: 2px solid var(--sage-l); border-top-color: var(--sage); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-desc { display: grid; gap: 6px; }
.scan-desc label { font-size: 13px; font-weight: 600; color: var(--mu); }
.scan-list { list-style: none; margin: 0; padding: 0; display: grid; }
.scan-list .s-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--bd); }
.scan-list input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--sage); margin: 0; }
.scan-list .s-name { width: 100%; font-weight: 600; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; background: var(--surface2); }
.scan-list .s-name:focus { background: var(--surface); }
.scan-list .s-k { font-family: var(--display); font-weight: 700; font-size: 20px; white-space: nowrap; }
.scan-list .s-edit { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--mu); }
.scan-list .s-mac { margin-left: 6px; }
input.grams { width: 76px; padding: 6px 8px; font-size: 16px; border-radius: 8px; text-align: right; color: var(--tx); background: var(--surface2); border: 1px solid transparent; }
.m-mac input.grams { width: 64px; padding: 3px 6px; font-size: 14px; margin-right: 2px; }

/* lector de código de barras */
.barsheet { position: fixed; inset: 0; z-index: 20; display: grid; align-content: start; gap: 14px; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 20px); background: var(--bg); overflow-y: auto; }
.barsheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.barsheet video { width: 100%; max-width: 100%; aspect-ratio: 3 / 4; max-height: 52vh; object-fit: cover; border-radius: var(--r); background: #111; }
.barframe { position: relative; }
.barframe::after { content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: var(--or); box-shadow: 0 0 12px var(--or); }
.bar-manual { display: flex; gap: 8px; }
.bar-manual input { flex: 1; }
.label-snap { position: relative; display: block; text-align: center; }
.label-snap input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#barStatus { margin: 0; min-height: 1.4em; }

/* botones */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions.wide .btn { flex: 1 1 140px; }
.btn { border-radius: 999px; padding: 12px 20px; font-weight: 700; font-size: 15px; letter-spacing: .02em; border: 1px solid transparent; }
.btn.primary { background: var(--sage); color: #fff; box-shadow: 0 6px 16px rgba(59, 100, 71, .22); }
.btn.primary:active { background: var(--sage-d); }
.btn.primary:disabled { opacity: .6; }
.btn.ghost { background: var(--surface); border-color: var(--bd); color: var(--tx); }
.btn.soft { background: var(--sage-l); color: var(--sage-d); }
.link { background: none; border: 0; color: var(--sage-d); font-weight: 700; padding: 6px 0; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); font-size: 22px; line-height: 1; }

/* comidas */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 4px; }
.manual { display: grid; gap: 10px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.manual-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.manual-nums span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mu); margin-bottom: 3px; }
.manual-nums input { padding: 10px 8px; }
.meals { list-style: none; margin: 0; padding: 4px 16px; display: grid; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.meals:empty { display: none; }
.meals li { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px; gap: 2px 12px; align-items: center; padding: 12px 0; }
.meals li + li { border-top: 1px solid var(--bd); }
.m-name { font-weight: 600; overflow-wrap: anywhere; }
.m-mac { grid-column: 1; font-size: 13px; color: var(--mu); font-variant-numeric: tabular-nums; }
.m-k { grid-column: 2; grid-row: 1 / span 2; font-family: var(--display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.m-k small { font-family: var(--body); font-size: 12px; font-weight: 500; color: var(--mu); }
.m-del { grid-column: 3; grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface2); color: var(--mu); font-size: 18px; }
.m-del:active { color: var(--fat); }
.empty { display: grid; gap: 10px; justify-items: center; text-align: center; color: var(--mu); margin: 0; padding: 4px 8px 8px; }
.empty img { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); box-shadow: var(--shadow); }
.empty p { margin: 0; max-width: 34ch; }

/* tarjeta para redes */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .chip-upload { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--bd); font-weight: 600; font-size: 14px; }
.chips button[aria-pressed="true"] { background: var(--sage); color: #fff; border-color: var(--sage); }
.chip-upload { border-style: dashed; cursor: pointer; }
.chip-upload input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.card-frame { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: grid; place-items: center; }
#out { display: block; width: 100%; max-width: 330px; height: auto; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }

/* ajustes */
.field { display: grid; gap: 6px; }
.field span, .field > label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; text-transform: uppercase; letter-spacing: .08em; }
.code-row .btn { padding: 10px 16px; }
#codeStatus { margin: 0; }
#codeStatus.ok { color: var(--ok); }
#codeStatus.bad { color: var(--fat); }
.install { display: grid; gap: 10px; background: var(--sage-l); border-radius: var(--r); padding: 16px; }
.install p { margin: 0; color: var(--sage-d); }
.danger { display: grid; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--bd); }
.danger p { margin: 0 0 8px; color: var(--mu); }
.danger-btn { background: #B3261E; color: #fff; }
.account { display: grid; gap: 6px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.account p { margin: 0; }

/* barra de pestañas */
.tabs {
  position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: 536px; margin: 0 auto; padding: 6px; background: rgba(255, 255, 255, .92); border-radius: 999px; box-shadow: 0 10px 30px rgba(29, 42, 34, .14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tabs button { background: none; border: 0; padding: 11px 4px; font-weight: 700; font-size: 14px; color: var(--mu); border-radius: 999px; }
.tabs button[aria-current="page"] { color: var(--sage-d); background: var(--sage-l); }

@media (prefers-reduced-motion: reduce) { .ring .bar { transition: none; } }

/* cuenta y cuestionario */
.screen { max-width: 480px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px 48px; display: grid; gap: 16px; }
.screen h1 { font-weight: 800; font-size: 30px; line-height: 1.08; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.screen > p, .form-grid > p { margin: 0; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: 220px; }
.hero img { width: 100%; height: 100%; max-width: 100%; object-fit: cover; border-radius: 16px; display: block; }
.hero img:first-child { grid-row: 1 / span 2; }
.onb-hero { width: 100%; max-width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: var(--r); display: block; }
.small-chips button { padding: 5px 10px; font-size: 12px; }
.form-grid { display: grid; gap: 14px; }
.error { color: var(--fat); margin: 0; min-height: 1em; font-size: 14px; }
.error:empty { min-height: 0; }
.field .pass-row { display: flex; align-items: center; gap: 10px; font: inherit; text-transform: none; letter-spacing: 0; color: var(--tx); }
.pass-row input { flex: 1; }
.pass-row .link { font-size: 14px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.unit-in { display: flex; align-items: center; gap: 8px; }
.field .unit-in span { font-size: 14px; text-transform: none; letter-spacing: 0; }
.chips.days { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.chips.days button { padding: 10px 0; text-align: center; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; gap: 2px; text-align: left; padding: 13px 15px; border-radius: 14px; background: var(--surface); border: 1.5px solid transparent; box-shadow: var(--shadow); }
.opt b { font-size: 16px; }
.field .opt span { font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--mu); }
.opt[aria-pressed="true"] { border-color: var(--sage); background: var(--sage-l); }
.plan { display: grid; gap: 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border: 1.5px solid var(--sage); padding: 20px; }
.plan-k b { font-family: var(--display); font-weight: 800; font-size: 58px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--sage-d); }
.plan-k span { margin-left: 6px; font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--mu); }

/* Pro, legales y borrar cuenta */
.pro-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; padding: 16px; border: 0; border-radius: var(--r); color: #fff; background: linear-gradient(135deg, #5E8F6B, var(--sage-d)); box-shadow: 0 10px 24px rgba(59, 100, 71, .25); }
.pro-card b { display: block; font-size: 16px; }
.pro-card small { display: block; font-size: 13px; opacity: .9; }
.pro-card > span:last-child { font-size: 26px; line-height: 1; }
.pro-badge { display: inline-block; padding: 4px 9px; border-radius: 999px; background: var(--or); color: #fff; font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .1em; }
.pro-sheet h1 { font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -.02em; margin: 0; }
.pro-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pro-list li { position: relative; padding-left: 28px; }
.pro-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--sage-l); color: var(--sage-d); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-opt { position: relative; display: grid; gap: 2px; text-align: left; padding: 16px 14px 14px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--bd); box-shadow: var(--shadow); }
.plan-opt b { font-size: 15px; }
.plan-opt span:not(.save) { font-family: var(--display); font-weight: 800; font-size: 26px; }
.plan-opt small { color: var(--mu); font-size: 12.5px; }
.plan-opt[aria-checked="true"] { border-color: var(--sage); background: var(--sage-l); }
.plan-opt .save { position: absolute; top: -10px; right: 10px; padding: 2px 8px; border-radius: 999px; background: var(--or); color: #fff; font-size: 11px; font-weight: 700; }
.legal-note a, .legal-links a { color: var(--sage-d); font-weight: 600; }
.legal-links { margin: 0; font-size: 14px; }
.danger-text { color: #B3261E; border-color: rgba(179, 38, 30, .3); }

/* mensaje del día, recordatorio dentro de la app, agua y recordatorios */
.motiv { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r); background: var(--sage-l); }
.motiv-k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sage-d); }
.motiv p { margin: 0; font-size: 15.5px; line-height: 1.45; color: var(--tx); }
.nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: #FFF1E6; color: #8A3E0B; font-size: 14.5px; font-weight: 600; }
.nudge .link { color: #8A3E0B; white-space: nowrap; }
.water { display: grid; gap: 10px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.water-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.water-k { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.water-k svg { width: 20px; height: 20px; fill: #3A9AD9; }
#waterAmt { font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
#waterAmt small { font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--mu); }
.water-bar { height: 10px; border-radius: 999px; background: #E3EFF7; overflow: hidden; }
.water-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #7CC4EE, #3A9AD9); transition: width .4s ease; }
.water-btns { display: flex; gap: 8px; }
.water-btns .btn { flex: 1; padding: 10px 12px; background: #E3EFF7; color: #1F6A9C; }
.water .muted { margin: 0; }
.reminders .rem-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 600; }
.reminders .rem-row input { width: 20px; height: 20px; accent-color: var(--sage); margin: 0; }
.rem-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-left: 30px; }
.rem-times label { display: grid; gap: 4px; font-size: 12px; color: var(--mu); font-weight: 600; }
.rem-times input { font: inherit; font-size: 15px; padding: 8px; border-radius: 10px; border: 1px solid var(--bd); background: var(--surface); color: var(--tx); width: 100%; min-width: 0; }
.reminders .btn { justify-self: start; margin-top: 6px; }
#remStatus { margin: 0; }
@media (prefers-reduced-motion: reduce) { .water-bar span { transition: none; } }

/* Perfil */
.prof-main { display: grid; gap: 14px; }
.prof-head { display: flex; align-items: center; gap: 14px; padding: 4px 2px 6px; }
.avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #5E8F6B, var(--sage-d)); color: #fff; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .04em; }
.prof-id { display: grid; gap: 2px; min-width: 0; }
.prof-id b { font-size: 19px; overflow-wrap: anywhere; }
.small-badge { justify-self: start; font-size: 11px; padding: 2px 8px; }
.menu-h { margin: 8px 2px 0; font-size: 15px; }
.menu { display: grid; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.menu-item { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 15px 16px; border: 0; background: transparent; text-align: left; color: var(--tx); font-size: 16px; font-weight: 500; text-decoration: none; }
.menu-item + .menu-item { border-top: 1px solid var(--bd); }
.menu-item:active { background: var(--surface2); }
.menu-item svg { width: 22px; height: 22px; fill: none; stroke: var(--sage-d); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-val { color: var(--mu); font-size: 14px; white-space: nowrap; }
.chev { color: var(--mu); font-size: 22px; line-height: 1; }
.logout-btn { margin-top: 6px; }
.subpage { display: grid; gap: 14px; }
.back-link { justify-self: start; font-size: 16px; padding: 4px 0; }
.pf-list { display: grid; margin: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.pf-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.pf-list > div + div { border-top: 1px solid var(--bd); }
.pf-list dt { color: var(--mu); }
.pf-list dd { margin: 0; font-weight: 600; text-align: right; }

/* agua: botones rápidos y cantidad a mano */
.water-btns { flex-wrap: wrap; }
.water-btns .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.water-custom { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.water-custom input { padding: 10px 12px; }
.water-custom select { font: inherit; font-size: 15px; padding: 10px 8px; border-radius: 12px; border: 1px solid var(--bd); background: var(--surface); color: var(--tx); }
.water-custom .btn { padding: 10px 14px; background: #E3EFF7; color: #1F6A9C; }

/* pestaña Hidratación */
.tabs { grid-template-columns: repeat(4, 1fr); }
.tabs button { font-size: 13px; padding: 11px 2px; }
#view-agua .water { gap: 14px; padding: 20px; }
#view-agua #waterAmt { font-size: 34px; }
#view-agua .water-bar { height: 16px; }
.water-week-card { display: grid; gap: 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.water-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 140px; }
.ww-col { display: grid; grid-template-rows: 1fr auto auto; gap: 4px; height: 100%; text-align: center; min-width: 0; }
.ww-track { position: relative; background: #E3EFF7; border-radius: 8px; overflow: hidden; }
.ww-fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #3A9AD9, #7CC4EE); border-radius: 8px; }
.ww-col.ok .ww-fill { background: linear-gradient(0deg, var(--sage-d), #A7CF8A); }
.ww-val { font-size: 11px; color: var(--mu); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ww-day { font-size: 12px; font-weight: 700; color: var(--mu); text-transform: capitalize; }
.ww-col.sel .ww-day { color: var(--tx); }
#waterRemLink { justify-self: start; }

/* pestaña Progreso */
.tabs { grid-template-columns: repeat(5, 1fr); padding: 5px; }
.tabs button { font-size: 12.5px; padding: 11px 0; letter-spacing: 0; }
.pcard { display: grid; gap: 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.pcard .muted { margin: 0; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chips.mini { gap: 6px; }
.chips.mini button { padding: 5px 11px; font-size: 13px; }
.prow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prow .btn { padding: 11px 18px; flex: 1 1 auto; }
.unit-box { position: relative; flex: 1 1 120px; min-width: 0; }
.unit-box input { padding-right: 44px; }
.unit-box span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--mu); font-weight: 600; font-size: 14px; pointer-events: none; }
input[type="date"], .cmp-sel select { font: inherit; font-size: 15px; color: var(--tx); background: var(--surface); border: 1px solid var(--bd); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.pc-head input[type="date"] { padding: 6px 10px; font-size: 14px; }
.w-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.w-stats div { background: var(--surface2); border-radius: 12px; padding: 10px; display: grid; gap: 2px; min-width: 0; }
.w-stats span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); }
.w-stats b { font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-stats b small { font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--mu); }
.w-stats .good b { color: var(--ok); } .w-stats .bad b { color: var(--or); }
.w-chart svg { width: 100%; height: auto; display: block; }
.w-chart .empty { margin: 0; padding: 26px 8px; text-align: center; color: var(--mu); font-size: 14px; background: var(--surface2); border-radius: 12px; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; }
.hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--bd); font-size: 15px; }
.hist li b { font-variant-numeric: tabular-nums; }
.hist .x { border: 0; background: none; color: var(--mu); font-size: 18px; width: 32px; height: 32px; border-radius: 50%; }
.m-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.m-form { display: grid; gap: 12px; }
.m-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.m-table th { text-align: right; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); padding: 0 0 6px; }
.m-table th:first-child, .m-table td:first-child { text-align: left; }
.m-table td { text-align: right; padding: 8px 0; border-top: 1px solid var(--bd); font-variant-numeric: tabular-nums; }
.m-table .good { color: var(--ok); font-weight: 700; } .m-table .bad { color: var(--or); font-weight: 700; }
.ph-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ph-slot { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface2); border: 1px dashed rgba(29, 42, 34, .2); display: grid; place-items: center; text-align: center; cursor: pointer; }
.ph-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-slot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ph-add { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--sage-d); padding: 6px; }
.ph-add i { font-style: normal; font-size: 24px; line-height: 1; }
.ph-tag { position: absolute; left: 6px; bottom: 6px; z-index: 1; background: rgba(29, 42, 34, .7); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.ph-del { position: absolute; right: 6px; top: 6px; z-index: 1; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(29, 42, 34, .7); color: #fff; font-size: 16px; line-height: 1; }
.ph-slot.busy::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, .6); }
.cmp-box { display: grid; gap: 10px; padding-top: 6px; border-top: 1px solid var(--bd); }
.cmp-sel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp figure { margin: 0; display: grid; gap: 4px; }
.cmp .frame { aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface2); display: grid; place-items: center; color: var(--mu); font-size: 13px; text-align: center; padding: 6px; }
.cmp .frame img { width: 100%; height: 100%; object-fit: cover; }
.cmp figcaption { font-size: 13px; font-weight: 600; color: var(--mu); text-align: center; }
.reco { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reco li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 12px; border-radius: 12px; background: #FFF4EB; font-size: 14.5px; line-height: 1.4; }
.reco li.ok { background: var(--sage-l); }
.reco li i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; background: var(--or); color: #fff; }
.reco li.ok i { background: var(--sage); }
.ajuste { display: grid; gap: 8px; padding: 14px; border-radius: 14px; border: 2px solid var(--sage); background: #F7FBF6; }
.ajuste p { margin: 0; font-size: 15px; }
.ajuste .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ajuste .btn { padding: 10px 16px; }
.tip-k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--or); }
.tip-hoy { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border: 0; border-left: 4px solid var(--or); font-size: 15px; line-height: 1.4; }
.tip-hoy::after { content: attr(data-more); font-size: 13px; font-weight: 700; color: var(--sage-d); }
.w-stats em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--mu); white-space: nowrap; }
.hist .m-names { font-weight: 500; font-size: 13px; color: var(--mu); text-align: right; }
/* aviso de "guardado" */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); z-index: 30; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  padding: 13px 20px; border-radius: 14px; background: #2E5E3D; color: #fff; font-weight: 700; font-size: 15px; text-align: center; box-shadow: 0 12px 30px rgba(29, 42, 34, .28); }
.toast.show { animation: toastIn .25s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .toast.show { animation: none; } }
.ph-slot.busy::after { content: attr(data-busy); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--sage-d); background: rgba(255, 255, 255, .8); z-index: 2; }

/* consentimiento al crear la cuenta */
.consent { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13.5px; line-height: 1.45; color: var(--mu); }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--sage); }
.consent a { color: var(--sage-d); font-weight: 700; }

/* Pro: etiqueta y candados */
.barbtn { position: relative; }
.pro-tag { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #fff; background: var(--or); padding: 2px 7px; border-radius: 999px; }
.pro-lock { display: grid; gap: 10px; justify-items: start; padding: 14px; border-radius: 14px; background: #FFF4EB; }
.pro-lock p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.pro-lock .btn { padding: 10px 18px; }
.reco li.lock { background: #FFF4EB; cursor: pointer; }
.reco li.lock i { background: var(--tx); font-size: 11px; }

/* Panel de coach */
.select { font: inherit; font-size: 16px; color: var(--tx); background: var(--surface); border: 1px solid var(--bd); border-radius: 12px; padding: 12px 14px; width: 100%; }
.coach-new { display: grid; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--sage-l); }
.coach-new .big { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: .06em; color: var(--sage-d); user-select: all; }
.coach-new .actions, .coach-list .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.coach-new .btn, .coach-list .btn { padding: 8px 14px; font-size: 14px; }
.coach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.coach-list li { display: grid; gap: 8px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; }
.coach-list .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.coach-list .code { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: .05em; }
.coach-list .who { font-size: 14px; color: var(--mu); overflow-wrap: anywhere; }
.st { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface2); color: var(--mu); }
.st.on { background: var(--sage-l); color: var(--sage-d); } .st.off { background: #FDE8E4; color: #A63A20; } .st.new { background: #E3EFF7; color: #1F6A9C; }
.code-pro { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--sage-l); color: var(--sage-d); font-weight: 700; }
a.btn { text-decoration: none; display: inline-block; text-align: center; }

.plan-opt .plan-title { font-style: normal; font-size: 12px; font-weight: 600; color: var(--sage-d); }
