:root {
  --bg: #fbf7f1;
  --card: #ffffff;
  --ink: #1f2a26;
  --muted: #6f7a74;
  --brand: #2f5d50;
  --brand-dark: #234639;
  --brand-soft: #e6efe9;
  --accent: #e07a4f;
  --accent-soft: #fbe6dc;
  --line: #ece5da;
  --warn-bg: #fff3df;
  --warn: #9a5800;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(31, 42, 38, .06), 0 6px 18px rgba(31, 42, 38, .07);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; padding-bottom: calc(80px + env(safe-area-inset-bottom)); min-height: 100vh; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
button { font: inherit; }

/* ---------- barra superior ---------- */
.top { position: sticky; top: 0; z-index: 5; background: rgba(251, 247, 241, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 10px 18px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--brand-dark); font-family: var(--serif); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }

main { max-width: 760px; margin: 0 auto; padding: 18px 18px 8px; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.015em; color: var(--brand-dark); }
h1 { font-size: 1.75rem; margin: 4px 0 10px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 1.25rem; margin: 0; font-weight: 650; }
h3 { font-size: 1.05rem; margin: 0; }
p { line-height: 1.55; }
.muted { color: var(--muted); font-size: .92rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--accent); }

/* ---------- navegación inferior ---------- */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: .7rem; font-weight: 600; color: #8b948f; text-decoration: none; border-radius: 12px; }
.tabs svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--brand); }
.tabs a.on svg { stroke-width: 2.3; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; min-height: 48px; transition: transform .08s ease, background .15s; }
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--brand-dark); }
.btn.alt { background: var(--card); color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn.alt:hover { background: var(--brand-soft); }
.btn.orange { background: var(--accent); }
.btn.orange:hover { background: #c9663d; }
.btn.block { width: 100%; }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: .85rem; border-radius: 11px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; font-size: 1.15rem; color: var(--ink); text-decoration: none; }

/* ---------- foto o fondo de categoría ---------- */
.ph { position: relative; overflow: hidden; background: var(--c, #efe6d8); display: grid; place-items: center; }
.ph::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 25% 20%, rgba(255,255,255,.55), transparent 55%), radial-gradient(circle at 85% 90%, rgba(0,0,0,.06), transparent 50%); }
.ph .em { position: relative; font-size: 2.6rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,.12)); }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- inicio ---------- */
.hello { margin: 2px 0 16px; }
.hello h1 { margin: 2px 0 0; }
.today { display: block; text-decoration: none; color: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); position: relative; }
.today .ph { aspect-ratio: 16 / 10; }
.today .ph .em { font-size: 4rem; }
.today .over { position: absolute; inset: auto 0 0 0; padding: 60px 18px 16px; background: linear-gradient(transparent, rgba(20, 35, 30, .82)); }
.today .over .eyebrow { color: #ffd2bd; }
.today .over h2 { color: #fff; font-size: 1.45rem; margin-top: 4px; }
.today .over .sub { color: rgba(255,255,255,.85); font-size: .9rem; margin-top: 4px; }
.today-empty { background: var(--brand); color: #fff; border-radius: 24px; padding: 22px; }
.today-empty h2 { color: #fff; }
.today-empty .btn { background: #fff; color: var(--brand); margin-top: 12px; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 0 12px; }
.sec-head a { font-size: .88rem; font-weight: 650; text-decoration: none; }

.cats { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar, .row::-webkit-scrollbar, .days::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.cat { flex: none; width: 84px; text-align: center; text-decoration: none; color: var(--ink); font-size: .78rem; font-weight: 600; }
.cat .ph { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 6px; }
.cat .ph .em { font-size: 1.9rem; }

.row { display: flex; gap: 12px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.row .rcard { flex: none; width: 168px; scroll-snap-align: start; }

.banner { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding: 16px; border-radius: var(--radius); background: var(--accent-soft); text-decoration: none; color: var(--ink); }
.banner .em { font-size: 2.2rem; }
.banner b { display: block; font-family: var(--serif); font-size: 1.08rem; color: #8a3a17; }
.banner span { font-size: .88rem; color: #7a5543; }
.banner .go { margin-left: auto; font-size: 1.4rem; color: #c9663d; }

/* ---------- tarjeta de receta ---------- */
.rcard { display: block; text-decoration: none; color: var(--ink); }
.rcard .ph { aspect-ratio: 4 / 3; border-radius: 16px; box-shadow: var(--shadow); }
.rcard .t { font-weight: 650; font-size: .93rem; line-height: 1.3; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .m { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.rcard .badge { position: absolute; top: 8px; left: 8px; z-index: 1; }
.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 14px; margin-top: 14px; }
@media (min-width: 620px) { .grid-cards { grid-template-columns: repeat(3, 1fr); } }

.tag { display: inline-block; font-size: .7rem; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); margin-right: 4px; }
.tag.draft { background: var(--warn-bg); color: var(--warn); }
.tag.prem { background: var(--accent-soft); color: #a2421b; }
.tag.glass { background: rgba(255,255,255,.92); color: var(--warn); }

/* ---------- buscador ---------- */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 2; }
.search input { padding-left: 44px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -18px 0; padding: 0 18px 4px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; margin: 12px 0 0; padding: 0; }
.chip { flex: none; border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--brand); box-shadow: none; color: #fff; }

input[type=search], input[type=email], input[type=number], input[type=password] { width: 100%; font: inherit; padding: 13px 15px; border: 0; box-shadow: inset 0 0 0 1.5px var(--line); border-radius: 14px; background: var(--card); min-height: 48px; color: var(--ink); }
input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand); }
label { font-weight: 600; font-size: .92rem; }

/* ---------- receta ---------- */
.rhero { position: relative; margin: -18px -18px 0; }
.rhero .ph { aspect-ratio: 4 / 3; max-height: 420px; width: 100%; }
.rhero .ph .em { font-size: 5rem; }
.rhero .nav { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; z-index: 2; }
.sheet { position: relative; background: var(--bg); border-radius: 26px 26px 0 0; margin: -26px -18px 0; padding: 22px 18px 0; }
.sheet h1 { margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stat { background: var(--card); border-radius: 14px; padding: 10px 8px; text-align: center; box-shadow: var(--shadow); }
.stat .v { font-weight: 750; font-size: .98rem; }
.stat .l { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #efe9df; border-radius: 14px; padding: 4px; margin: 18px 0 14px; }
.seg button { border: 0; background: transparent; padding: 10px; border-radius: 11px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--brand-dark); box-shadow: var(--shadow); }
.scaler { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 14px; padding: 8px 10px; box-shadow: var(--shadow); margin-bottom: 10px; }
.scaler .ctl { display: flex; align-items: center; gap: 12px; }
.scaler button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand); font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.scaler b { min-width: 22px; text-align: center; font-size: 1.1rem; }
.ings { background: var(--card); border-radius: var(--radius); padding: 4px 14px; box-shadow: var(--shadow); }
.ing { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.ing:last-child { border-bottom: 0; }
.ing .q { min-width: 70px; font-weight: 750; color: var(--brand-dark); }
.ing .v { margin-left: auto; font-size: .66rem; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: paso; }
ol.steps li { counter-increment: paso; position: relative; padding: 0 0 18px 48px; line-height: 1.6; }
ol.steps li::before { content: counter(paso); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 750; display: grid; place-items: center; font-size: .9rem; }
ol.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 2px; background: var(--line); }
.tip { background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; margin: 10px 0; line-height: 1.5; }
.warnbox { background: var(--warn-bg); color: #5c3500; border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-size: .88rem; line-height: 1.5; }
.source { font-size: .8rem; color: var(--muted); margin: 22px 0 8px; }
.cta { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); padding: 12px 0 4px; background: linear-gradient(transparent, var(--bg) 35%); z-index: 3; }
.cta .btn { box-shadow: 0 8px 20px rgba(47, 93, 80, .3); }

/* ---------- modo cocina ---------- */
.cook { position: fixed; inset: 0; background: var(--brand-dark); color: #fff; z-index: 50; display: flex; flex-direction: column; padding: calc(24px + env(safe-area-inset-top)) 22px calc(24px + env(safe-area-inset-bottom)); }
.cook .bar { height: 5px; border-radius: 9px; background: rgba(255,255,255,.18); overflow: hidden; margin: 10px 0 0; }
.cook .bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .25s; }
.cook .step { flex: 1; display: flex; align-items: center; font-family: var(--serif); font-size: 1.65rem; line-height: 1.4; }
.cook .nav { display: flex; gap: 10px; }
.cook .btn { background: #fff; color: var(--brand-dark); flex: 1; }
.cook .btn[disabled] { opacity: .4; }

/* ---------- menú ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; margin: 6px -18px 16px; padding: 2px 18px 6px; scrollbar-width: none; }
.dpill { flex: none; width: 54px; padding: 9px 0; border-radius: 16px; border: 0; background: var(--card); box-shadow: var(--shadow); text-align: center; cursor: pointer; color: var(--ink); }
.dpill small { display: block; font-size: .68rem; color: var(--muted); font-weight: 600; }
.dpill b { font-size: 1.05rem; }
.dpill.on { background: var(--brand); color: #fff; }
.dpill.on small { color: rgba(255,255,255,.8); }
.dpill.hoy:not(.on) { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.meal { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); margin-bottom: 12px; text-decoration: none; color: var(--ink); }
.meal .ph { width: 92px; height: 92px; border-radius: 14px; flex: none; }
.meal .ph .em { font-size: 2rem; }
.meal .info { flex: 1; min-width: 0; }
.meal .lbl { font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.meal .ttl { display: block; font-weight: 650; margin-top: 3px; line-height: 1.3; color: var(--ink); text-decoration: none; }
.meal .swap { flex: none; }

/* ---------- lista ---------- */
.progress { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.progress .bar { height: 8px; border-radius: 9px; background: var(--brand-soft); overflow: hidden; margin-top: 8px; }
.progress .bar i { display: block; height: 100%; background: var(--brand); border-radius: 9px; transition: width .2s; }
.lsec { background: var(--card); border-radius: var(--radius); padding: 4px 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.lsec h3 { padding: 12px 0 6px; font-size: 1rem; }
.check { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.check.done span { text-decoration: line-through; color: var(--muted); }

/* ---------- cuenta e ingreso ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.login-hero { margin: -18px -18px 0; position: relative; }
.login-hero .mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 6px; }
.login-hero .mosaic .ph { aspect-ratio: 1; border-radius: 14px; }
.login-hero .mosaic .ph .em { font-size: 2.2rem; }
.login-card { position: relative; margin: -40px 0 0; }
.login-card h1 { margin-top: 0; }
.perks { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.perks li { display: flex; gap: 10px; align-items: center; font-size: .94rem; }
.perks li span { width: 30px; height: 30px; border-radius: 10px; background: var(--brand-soft); display: grid; place-items: center; flex: none; }

.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.loading { display: grid; gap: 12px; padding-top: 8px; }
.sk { border-radius: 16px; background: linear-gradient(90deg, #efe8dd 25%, #f6f1e9 50%, #efe8dd 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.foot-note { font-size: .75rem; color: var(--muted); text-align: center; margin: 20px 0 6px; }
.brand-sub { font-style: italic; font-weight: 600; color: var(--accent); font-size: .95rem; }
.view-in { animation: viewin .28s ease both; }
@keyframes viewin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Portadas con fotos reales */
.login-hero .login-photo { aspect-ratio: 10 / 7; max-height: 380px; overflow: hidden; }
.login-hero .login-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner .thumb { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; flex: none; }
.lhead { display: flex; justify-content: space-between; padding: 0 0 6px 34px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.check .nom { flex: 1; min-width: 0; }
.check .cant { flex: none; width: 96px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-align: center; font: inherit; font-weight: 600; font-size: 16px; color: var(--brand); }
.check .cant::placeholder { color: var(--muted); font-weight: 400; opacity: .7; }
.check .cant:focus { outline: 2px solid var(--brand); border-color: transparent; }
.check.done .cant { color: var(--muted); background: transparent; }
/* Guías */
.banner.kids { background: var(--brand-soft); margin-top: 12px; }
.banner.kids b { color: var(--brand-dark); }
.banner.kids span { color: var(--ink); }
.banner.kids .go { color: var(--brand); }
.gcard { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.gcard .em { font-size: 1.9rem; flex: none; }
.gcard b { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--brand-dark); }
.gcard span { font-size: .86rem; color: var(--muted); }
.gcard .go { margin-left: auto; font-size: 1.4rem; color: var(--brand); flex: none; }
.gcard.dest { background: var(--brand-soft); box-shadow: none; }
.back { display: inline-block; margin: 4px 0 10px; font-weight: 650; text-decoration: none; }
.ghero { margin-bottom: 8px; }
.gcard .thumb { width: 58px; height: 58px; border-radius: 14px; object-fit: cover; flex: none; }
.ghero .foto { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin-bottom: 12px; }
.ghero .em { font-size: 2.6rem; display: block; margin-bottom: 6px; }
.ghero .muted { margin-top: 0; }
.gh { margin: 22px 0 8px; }
.gp { line-height: 1.6; }
.gul { padding-left: 20px; line-height: 1.55; }
.gul li { margin-bottom: 8px; }
.grec:empty { display: none; }
.lock-card { margin-top: 14px; }
.lock-card b { font-family: var(--serif); font-size: 1.05rem; color: var(--brand-dark); }
.lock-card .btn { margin-top: 6px; }
