/* NUTRIA — estilos por pantalla */
.link { color: var(--forest); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.reason { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--forest-3); background: var(--mint); padding: 7px 12px; border-radius: 99px; align-self: flex-start; }
.reason svg { width: 16px; height: 16px; }
.warn-box { display: flex; gap: 10px; align-items: flex-start; background: var(--apricot-soft); color: #5B2E12; padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; }
.warn-box svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

/* ── Inicio ── */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.home-sub { font-size: 18px; }
.week-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 28px; margin-bottom: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, #22452F 0%, #1F3D2B 55%, #2C5A3C 100%); color: #F4F1E8; border: 0; box-shadow: var(--shadow-2); position: relative; overflow: hidden; }
.week-card::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(224, 135, 79, .35), transparent 70%); }
.week-card .eyebrow { color: #F2B98E; }
.week-card .chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #F4F1E8; }
.wk-title { font-size: clamp(30px, 3.4vw, 42px); }
.wk-cta { position: relative; z-index: 1; min-width: 240px; }
.week-card .gen-step { color: rgba(244, 241, 232, .6); }
.week-card .gen-step.on { color: #fff; }
.week-card .gen-step.on i { border-color: #F2B98E; border-top-color: transparent; }

.hero-meal { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); overflow: hidden; }
.hero-img { display: block; min-height: 320px; }
.hero-img .rimg { height: 100%; }
.hero-img .rimg > img, .hero-img .rimg > svg { transition: transform 900ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .hero-img:hover .rimg > img, .hero-img:hover .rimg > svg { transform: scale(1.04); } }
.hero-body { display: flex; flex-direction: column; gap: 14px; padding: 30px 32px; justify-content: center; }
.hero-name { font-size: clamp(32px, 3.2vw, 46px); }
.hero-meta { margin: 2px 0 4px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tl { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); transition: background-color var(--t-micro) ease, opacity var(--t-ui) ease; }
.tl.now { background: var(--mint); }
.tl.done { opacity: .6; }
.tl.done .tl-name { text-decoration: line-through; text-decoration-color: var(--muted-2); }
.tl-check { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; color: transparent; transition: background-color var(--t-micro) ease, border-color var(--t-micro) ease, color var(--t-micro) ease, transform var(--t-micro) var(--ease-out); }
.tl-check svg { width: 16px; height: 16px; }
.tl-check:active { transform: scale(.9); }
.tl-check[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.tl-body { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.tl-thumb { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; flex: none; }
.tl-thumb .rimg { height: 100%; }
.tl-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.water .glasses { display: flex; gap: 8px; margin-top: 14px; }
.water .glasses i { flex: 1; height: 30px; border-radius: 6px 6px 10px 10px; border: 2px solid #BFDCE6; background: transparent; transition: background-color 400ms var(--ease-out); transition-delay: calc(var(--i) * 30ms); }
.water .glasses i.on { background: linear-gradient(to top, #7FB8CC, #B9DCE8); border-color: #7FB8CC; }
.nudge { background: var(--apricot-soft); border-color: #F2D2BC; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.link-card { transition: box-shadow var(--t-ui) var(--ease-out); }
.link-card svg { width: 20px; height: 20px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .link-card:hover { box-shadow: var(--shadow-2); } }

/* "¿Qué como ahora?" */
.wn-main { display: flex; flex-direction: column; gap: 14px; }
.wn-main .rimg { aspect-ratio: 16 / 10; border-radius: var(--r-md); }
.wn-name { font-size: 34px; }
.wn-alt .opt .tl-thumb { width: 48px; height: 48px; }

/* ── Recetas ── */
.rec-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; background: var(--forest); color: #F4F1E8; border-radius: var(--r-xl); padding: 34px 36px; overflow: hidden; min-height: 190px; }
.rec-hero.all { background: linear-gradient(115deg, #1F3D2B, #2A5139 60%, #35654A); }
.rec-hero .eyebrow { color: #F2B98E; }
.rec-hero .muted { color: #C9D6CB; max-width: 520px; margin-top: 8px; }
.rec-hero-img { width: min(38vw, 420px); height: 190px; object-fit: cover; border-radius: var(--r-lg); margin: -10px -10px -10px 0; box-shadow: var(--shadow-3); animation: rise 700ms var(--ease-out) both; }
.rec-tools { display: flex; flex-direction: column; gap: 12px; margin: 22px 0 8px; }
.cat-tabs, .filters, .sub-tabs { margin-top: 10px; }
.filters .chip { background: transparent; }
.filters .chip.on { background: var(--apricot-soft); color: var(--apricot-ink); border-color: #F2C8AA; }
.tools-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card { display: flex; align-items: center; gap: 14px; padding: 18px; transition: box-shadow var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out); }
.tool-card > svg { width: 20px; height: 20px; color: var(--muted); margin-left: auto; flex: none; }
.tool-ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--mint); color: var(--forest); flex: none; }
.tool-ic svg { width: 24px; height: 24px; }
@media (hover: hover) and (pointer: fine) { .tool-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); } }

/* ── Detalle de receta ── */
.rd-hero { position: relative; margin: -28px -32px 0; }
.rd-img { height: min(52vh, 480px); overflow: hidden; border-radius: 0 0 var(--r-xl) var(--r-xl); }
.rd-img .rimg { height: 100%; }
.rd-img .rimg > img, .rd-img .rimg > svg { animation: settle 900ms var(--ease-out) both; }
@keyframes settle { from { transform: scale(1.06); } }
.rd-back { position: absolute; left: 24px; top: 20px; background: rgba(251, 250, 246, .92); backdrop-filter: blur(8px); }
.rd-fav { right: 24px; top: 20px; width: 44px; height: 44px; }
.rd-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; margin-top: 30px; }
.rd-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rd-title { font-size: clamp(38px, 4.2vw, 58px); }
.rd-desc { font-size: 17px; }
.rd-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--muted); }
.rd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.rd-sec { margin-top: 18px; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.ing-list li:last-child { border-bottom: 0; }
.ing-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.ing-q { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ing-sub { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--forest); transition: background-color var(--t-micro) ease; }
.ing-sub svg { width: 16px; height: 16px; }
.ing-sub-sp { width: 32px; }
@media (hover: hover) and (pointer: fine) { .ing-sub:hover { background: var(--mint); } }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--forest); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; }
.steps p { padding-top: 3px; }
.steps .tag svg { width: 13px; height: 13px; }
.pairs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pair { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); text-align: center;
  transition: border-color var(--t-micro) ease, background-color var(--t-micro) ease, transform var(--t-micro) var(--ease-out); }
.pair:active { transform: scale(.96); }
.pair.on { border-color: var(--forest); background: var(--mint); }
.pair-img { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; transition: transform var(--t-ui) var(--ease-out); }
.pair.on .pair-img { transform: scale(1.08); box-shadow: 0 0 0 3px var(--forest); }
.pair-img .rimg { height: 100%; }
.pair-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.ask-box { display: flex; flex-direction: column; gap: 10px; background: var(--paper-2); border: 0; box-shadow: none; }

/* ── Plan semanal ── */
.plan-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.plan-head [data-genbox] .gen { min-width: 260px; }
.day-tabs { display: none; }
.week { display: grid; grid-template-columns: 92px repeat(7, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.week-corner { }
.week-day { text-align: center; padding: 8px 4px; border-radius: var(--r-sm); font-size: 13px; }
.week-day b { display: block; font-size: 13px; }
.week-day span { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.week-day.today { background: var(--forest); color: #fff; }
.week-slot { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; }
.meal { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; display: flex; flex-direction: column; min-height: 148px;
  transition: box-shadow var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out), opacity var(--t-ui) ease; cursor: grab; }
.meal.done { opacity: .55; }
.meal-img { height: 78px; overflow: hidden; }
.meal-img .rimg { height: 100%; }
.meal-body { padding: 8px 10px 10px; }
.meal-name { font-size: 13px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meal-link { position: absolute; inset: 0; z-index: 1; }
.meal-menu { position: absolute; right: 6px; top: 6px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; background: rgba(251, 250, 246, .92); display: grid; place-items: center; opacity: 0; transition: opacity var(--t-micro) ease; }
.meal-menu svg { width: 16px; height: 16px; }
.meal:focus-within .meal-menu { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .meal:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); } .meal:hover .meal-menu { opacity: 1; } }
@media (hover: none) { .meal-menu { opacity: 1; } }
.meal.dragging { opacity: .4; transform: scale(.97); }
.meal.drop { box-shadow: 0 0 0 3px var(--apricot); }
.meal.regen::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(242, 185, 142, .55) 50%, transparent 80%); background-size: 200% 100%; animation: shimmer .9s linear infinite; z-index: 3; }
.empty-cell { display: grid; place-items: center; background: transparent; border-style: dashed; cursor: default; }
.week-nut { font-size: 12px; text-align: center; color: var(--ink-2); padding: 6px 2px; }
.plan-hint { margin-top: 14px; }

/* ── Compras ── */
.buy-sum { background: linear-gradient(120deg, var(--paper), var(--paper-2)); }
.big-num { font-size: 52px; }
.aisles { columns: 2 340px; column-gap: 18px; margin-top: 12px; }
.aisle { break-inside: avoid; margin-bottom: 18px; padding: 8px 18px 10px; }
.aisle-h { padding: 12px 0 6px; }
.buy-list { list-style: none; margin: 0; padding: 0; }
.buy { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); transition: opacity var(--t-ui) ease; }
.buy.done { opacity: .5; }
.buy.done .buy-name { text-decoration: line-through; }
.buy-check { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; flex: none; transition: background-color var(--t-micro) ease, border-color var(--t-micro) ease, color var(--t-micro) ease, transform var(--t-micro) var(--ease-out); }
.buy-check svg { width: 16px; height: 16px; }
.buy-check:active { transform: scale(.88); }
.buy-check[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }
.buy-name { font-weight: 600; }
.buy-q { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }

/* ── Despensa ── */
.pantry-box { display: flex; flex-direction: column; gap: 14px; }
.pantry-list { list-style: none; margin: 0; padding: 4px 18px; }
.pantry-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pantry-list li:first-child { border-top: 0; }
.pantry-list .btn-icon svg { width: 18px; height: 18px; }

/* ── Modo cocina ── */
body.cooking .side, body.cooking .tabbar { display: none; }
body.cooking .app { grid-template-columns: 1fr; }
body.cooking .main { max-width: 980px; padding-top: 18px; }
.cook { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; }
.cook-top { display: flex; align-items: center; gap: 16px; }
.cook-prog { flex: 1; display: flex; gap: 6px; }
.cook-prog i { flex: 1; height: 6px; border-radius: 9px; background: var(--line); position: relative; overflow: hidden; }
.cook-prog i::after { content: ''; position: absolute; inset: 0; background: var(--forest); transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease-out); }
.cook-prog i.on::after { transform: scaleX(1); }
.cook-stage { flex: 1; display: flex; align-items: center; padding: 34px 0; overflow: hidden; }
.step-in { width: 100%; animation: step-in 480ms var(--ease-out) both; }
@keyframes step-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 36px)); } }
.cook-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.cook-img .rimg { aspect-ratio: 4 / 3; border-radius: var(--r-lg); }
.cook-title { font-size: clamp(38px, 4.6vw, 60px); }
.cook-ings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cook-ings label { display: flex; gap: 10px; align-items: center; font-size: 16px; cursor: pointer; }
.cook-ings input { width: 20px; height: 20px; accent-color: var(--forest); }
.cook-ings input:checked + span { text-decoration: line-through; color: var(--muted); }
.cook-step { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.cook-text { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.08; }
.timer { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.timer .ring { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--apricot); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.timer-mid { position: absolute; }
.timer { position: relative; }
.timer-mid { width: 150px; left: 0; top: 0; height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-mid b { font-size: 34px; font-variant-numeric: tabular-nums; }
.bg-timers { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 30; }
.bg-timers svg { width: 14px; height: 14px; }
.cook-nav { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg); }
.cook-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.done-ring { width: 88px; height: 88px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; animation: pop 600ms var(--ease-out); }
.done-ring svg { width: 40px; height: 40px; }
.fb-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.fb { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 132px; padding: 18px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); font-weight: 600;
  transition: border-color var(--t-micro) ease, background-color var(--t-micro) ease, transform var(--t-micro) var(--ease-out); }
.fb svg { width: 28px; height: 28px; color: var(--forest); }
.fb:active { transform: scale(.96); }
.fb.on { border-color: var(--forest); background: var(--mint); }
.fb-more { width: min(460px, 100%); display: flex; flex-direction: column; gap: 8px; text-align: left; }

/* ── Chat Nutria AI ── */
.chat-scrim { position: fixed; inset: 0; background: rgba(12, 22, 16, .28); opacity: 0; pointer-events: none; transition: opacity var(--t-ui) ease; z-index: 69; }
.chat { position: fixed; right: 16px; top: 16px; bottom: 16px; width: min(440px, calc(100% - 32px)); z-index: 70; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-3); border: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden; transform: translateX(calc(100% + 24px)); transition: transform 460ms var(--ease-drawer); visibility: hidden; }
#chat-root.open .chat { transform: none; visibility: visible; }
#chat-root.open .chat-scrim { opacity: 1; pointer-events: auto; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.chat-av { width: 38px; height: 38px; border-radius: 12px; background: var(--forest); color: #fff; display: grid; place-items: center; }
.chat-av svg { width: 22px; height: 22px; }
.chat-ctx { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 18px; background: var(--mint); color: var(--forest); }
.chat-ctx svg { width: 16px; height: 16px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.chat-welcome { display: flex; flex-direction: column; gap: 12px; padding: 8px 2px; }
.chat-hi { font-size: 36px; }
.msg { display: flex; gap: 10px; animation: rise 380ms var(--ease-out) both; }
.msg.me { justify-content: flex-end; }
.msg.me p { background: var(--forest); color: #fff; padding: 10px 14px; border-radius: 18px 18px 6px 18px; max-width: 85%; }
.msg-av { width: 30px; height: 30px; border-radius: 10px; background: var(--mint); color: var(--forest); display: grid; place-items: center; flex: none; }
.msg-av svg { width: 18px; height: 18px; }
.msg-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.msg.ai .msg-body > p:first-child { background: var(--paper-2); padding: 11px 14px; border-radius: 6px 18px 18px 18px; }
.msg.err .msg-body > p:first-child { background: var(--apricot-soft); }
.msg-act { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ok); }
.msg-act svg { width: 14px; height: 14px; }
.msg-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.msg-cards .rcard .desc { display: none; }
.msg-cards .rcard .name { font-size: 13.5px; }
.msg-cards .rcard .body { padding: 9px 10px 10px; }
.msg-cards .rcard .meta { font-size: 11.5px; gap: 8px; }
.msg-cards .fav { display: none; }
.dots { display: inline-flex; gap: 5px; padding: 12px 14px; background: var(--paper-2); border-radius: 6px 18px 18px 18px; align-self: flex-start; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); animation: bob 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 50% { transform: translateY(-4px); opacity: .5; } }
.chat-form { display: flex; align-items: flex-end; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.chat-in { flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 22px; padding: 11px 16px; min-height: 44px; max-height: 140px; background: #fff; outline: none; line-height: 1.4; }
.chat-in:focus { border-color: var(--forest-3); box-shadow: 0 0 0 4px rgba(59, 107, 76, .15); }

/* ── Onboarding ── */
body[data-view="onboarding"] .side, body[data-view="onboarding"] .tabbar { display: none; }
body[data-view="onboarding"] .app { grid-template-columns: 1fr; }
body[data-view="onboarding"] .main { max-width: 720px; }
.onb { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; gap: 20px; }
.onb-top { display: flex; align-items: center; gap: 16px; }
.onb-brand { display: flex; align-items: center; gap: 8px; color: var(--forest); letter-spacing: .18em; }
.onb-brand svg { width: 30px; height: 30px; }
.onb-prog { flex: 1; height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; }
.onb-prog i { display: block; height: 100%; background: var(--forest); transform-origin: left; transform: scaleX(var(--p)); transition: transform 500ms var(--ease-out); }
.onb-stage { flex: 1; }
.onb-lead { font-size: 18px; }
.onb-nav { display: flex; justify-content: space-between; align-items: center; position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: var(--bg); }
.goal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.goal { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); font-weight: 600; text-align: left;
  transition: border-color var(--t-micro) ease, background-color var(--t-micro) ease, transform var(--t-micro) var(--ease-out); }
.goal svg { width: 24px; height: 24px; color: var(--forest); }
.goal:active { transform: scale(.97); }
.goal.on { border-color: var(--forest); background: var(--mint); box-shadow: inset 0 0 0 1px var(--forest); }
.onb-sum { background: var(--paper-2); border: 0; box-shadow: none; }

/* ── Arma tu platillo ── */
.arma-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.picks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pick { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); font-weight: 600;
  transition: border-color var(--t-micro) ease, background-color var(--t-micro) ease, transform var(--t-micro) var(--ease-out); }
.pick:active { transform: scale(.96); }
.pick.on { border-color: var(--forest); background: var(--mint); box-shadow: inset 0 0 0 1px var(--forest); }
.pick[disabled] { opacity: .35; }
.pick-dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.arma-preview { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.arma-art { aspect-ratio: 4 / 3; border-radius: var(--r-md); overflow: hidden; }
.arma-art svg { width: 100%; height: 100%; }
.arma-art svg { animation: fade 400ms ease; }
.arma-name { font-size: 32px; }

/* ── Progreso y perfil ── */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat svg { width: 22px; height: 22px; color: var(--forest-3); }
.stat b { font-size: 46px; line-height: 1.05; }
.miles { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.miles li { display: flex; align-items: center; gap: 14px; }
.mile-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); color: var(--muted); flex: none; }
.mile-ic svg { width: 20px; height: 20px; }
.miles li.done .mile-ic { background: var(--apricot-soft); color: var(--apricot-ink); }
.miles .progress { margin-top: 6px; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.set-row { display: flex; align-items: center; gap: 14px; }

/* ── Responsive por pantalla ── */
@media (max-width: 1080px) {
  .home-grid, .rd-main, .arma-grid, .cook-intro { grid-template-columns: 1fr; }
  .rd-hero { margin: -24px -22px 0; }
  .set-grid { grid-template-columns: 1fr; }
  .tools-row { grid-template-columns: 1fr; }
  .arma-preview { position: static; }
}
@media (max-width: 860px) {
  .home-head { margin-bottom: 18px; }
  .home-head .btn-lg { min-height: 48px; padding: 0 18px; font-size: 15px; }
  .hero-meal { grid-template-columns: 1fr; }
  .hero-img { min-height: 0; aspect-ratio: 16 / 11; }
  .hero-body { padding: 20px; }
  .week-card { padding: 22px; }
  .wk-cta { min-width: 0; width: 100%; }
  .wk-cta .btn { width: 100%; }
  .rec-hero { grid-template-columns: 1fr; padding: 24px; border-radius: var(--r-lg); }
  .rec-hero-img { width: 100%; height: 150px; margin: 0; }
  .rd-hero { margin: -18px -16px 0; }
  .rd-img { height: 46vh; border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .rd-back { left: 14px; top: 14px; } .rd-fav { right: 14px; top: 14px; }
  .rd-actions .btn-lg { width: 100%; }
  .pairs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .day-tabs { display: flex; margin-bottom: 12px; }
  .week { grid-template-columns: 1fr; gap: 8px; }
  .week-corner, .week-day, .week-slot { display: none; }
  .meal, .week-nut { display: none; }
  .meal.sel, .week-nut.sel { display: flex; flex-direction: row; min-height: 84px; }
  .meal.sel .meal-img { width: 96px; height: auto; flex: none; }
  .meal.sel .meal-body { display: flex; flex-direction: column; justify-content: center; padding-right: 44px; }
  .meal.sel .meal-body::before { content: attr(data-slot); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--apricot-ink); }
  .meal-menu { top: 50%; transform: translateY(-50%); }
  .week-nut.sel { min-height: 0; justify-content: center; }
  .aisles { columns: 1; }
  .big-num { font-size: 42px; }
  .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 36px; }
  .cook-nav .btn { flex: 1; }
  .chat { inset: 0; width: 100%; border-radius: 0; transform: translateY(100%); }
  #chat-root.open .chat { transform: none; }
  .chat-log { padding: 14px; }
  .timer .ring, .timer-mid { width: 120px; height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat { transition: opacity var(--t-ui) ease, visibility var(--t-ui); transform: none !important; opacity: 0; }
  #chat-root.open .chat { opacity: 1; }
  .rd-img .rimg > img, .rd-img .rimg > svg, .rec-hero-img { animation: none; }
}

/* Transiciones de vista (elemento compartido tarjeta → detalle) */
::view-transition-group(*) { animation-duration: 520ms; animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; }
