html { color-scheme: dark; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background-color: #110f0d; color: #e4dcd2; }
input[type="range"] { accent-color: #c49a6c; }
.glass-card { background: rgba(23,23,23,0.92); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.07); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6); }
.glass-card-dark { background: linear-gradient(135deg, #22180f 0%, #121212 70%); backdrop-filter: blur(12px); border: 1px solid rgba(196,154,108,0.25); box-shadow: 0 20px 40px -15px rgba(0,0,0,0.7); }
.mint-glow { box-shadow: 0 0 25px rgba(196,154,108,0.25); }
.rose-glow { box-shadow: 0 0 25px rgba(160,113,75,0.3); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #15120f; }
::-webkit-scrollbar-thumb { background: #3a332c; border-radius: 4px; }
input, select, textarea { color: #f2ede6; }
input::placeholder { color: #959595; } /* antes #9c9084: contraste 3:1, ahora 4,7:1 */
.ring-prog { transition: stroke-dashoffset .6s var(--ease-out); }
::-webkit-scrollbar-thumb:hover { background: #9a6b40; }
.num-input { width: 5.5rem; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .chev { transform: rotate(180deg); }
.chev { transition: transform .2s var(--ease-out); }
.food-chip[aria-pressed="true"] { background: #9a6b40; color: #fff; border-color: #9a6b40; }
.toast { transition: opacity .25s var(--ease-out), transform .25s var(--ease-out); }

@media print {
    header, main, footer, .no-print { display: none !important; }
    #printable-report { display: block !important; padding: 10px !important; background: white !important; color: #0f172a !important; }
    .print-avoid-break { break-inside: avoid; }
    #printable-report, #printable-report * { color: #15120f !important; background: transparent !important; border-color: #ccc !important; }
    body { background: #fff !important; }
}

/* ===== Añadido: botones de acción, asistente y animaciones ===== */
.cta-glow { box-shadow: 0 10px 30px -5px rgba(154,107,64,0.45); }
@keyframes ctaPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.cta-pulse { animation: ctaPulse 2.4s ease-in-out 3; } /* 3 pulsos y para: llama la atención sin distraer */
@keyframes wzIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.wz-anim { animation: wzIn .3s var(--ease-out); }
.wz-tile { transition: transform .15s var(--ease-out), border-color .15s ease, background-color .15s ease; }
.wz-tile:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .cta-pulse, .wz-anim { animation: none !important; } }
@media (max-width: 1023px) { #toast { bottom: 6rem; } }

/* ===== Añadido: sensación de app nativa en el móvil ===== */
/* Sin el destello gris/azul al tocar y sin que el texto se agrande al girar el móvil */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
/* El gesto de "tirar para recargar" no se cuela al hacer scroll dentro de la app */
html, body { overscroll-behavior-y: none; }
#food-grid, #dis-grid, #diary-results, #pdf-modal > div, #wizard { overscroll-behavior: contain; }
/* Respuesta inmediata al tocar (sin el retraso de 300 ms) y sin seleccionar el texto de los botones al mantener pulsado */
button, a, summary, label, [role="button"] { touch-action: manipulation; }
button, summary, [role="button"], .food-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Feedback al pulsar, como en una app (la propiedad scale se suma a cualquier transform existente) */
button { transition: scale .12s var(--ease-out); }
button:not(:disabled):active, summary:active { scale: .97; }
@media (prefers-reduced-motion: reduce) { button:not(:disabled):active, summary:active { scale: 1; } }
/* iPhone: no hace zoom al escribir en un campo si la letra mide al menos 16 px */
@media (pointer: coarse) { input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; } }
/* Muesca y barra de inicio del iPhone (app instalada a pantalla completa) */
body > header { padding-top: env(safe-area-inset-top, 0px); }
@media (max-width: 1023px) { #toast { bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); } }
/* Altura real de la pantalla en móvil (la barra del navegador no tapa las ventanas) */
@supports (height: 100dvh) { .max-h-[90vh] { max-height: 90dvh; } }
/* Efecto al pasar el ratón solo con ratón: en el móvil no se queda "pegado" tras tocar */
@media not all and (hover: hover) { .wz-tile:hover { transform: none; } }

/* ===== Añadido: movimiento (criterios de Emil Kowalski) ===== */
:root { --ease-out: cubic-bezier(0.23, 1, 0.32, 1); }
.wz-bar { transition: width .3s var(--ease-out); }
/* Ventanas (PDF, confirmar) y menú de perfil: entrada suave en vez de aparecer de golpe */
@keyframes nd-fade { from { opacity: 0; } }
@keyframes nd-pop { from { opacity: 0; transform: scale(.96); } }
#pdf-modal:not(.hidden), #confirm-modal:not(.hidden) { animation: nd-fade .15s ease-out; }
#pdf-modal:not(.hidden) > div, #confirm-modal:not(.hidden) > div { animation: nd-pop .2s var(--ease-out); }
#profile-menu:not(.hidden) { animation: nd-pop .15s var(--ease-out); transform-origin: top right; }
@media (prefers-reduced-motion: reduce) {
    #pdf-modal:not(.hidden) > div, #confirm-modal:not(.hidden) > div, #profile-menu:not(.hidden) { animation: nd-fade .15s ease-out; }
    .wz-bar { transition: none; }
}

/* ===== Añadido: criterios de Apple (hoja inferior, materiales) ===== */
:root { --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes nd-sheet { from { transform: translateY(100%); } }
@media (max-width: 639px) { #wizard:not(.hidden) > div, #food-sheet:not(.hidden) > div { animation: nd-sheet .4s var(--ease-drawer); } }
@media (min-width: 640px) { #wizard:not(.hidden) > div, #food-sheet:not(.hidden) > div { animation: nd-pop .22s var(--ease-out); } }
#food-sheet:not(.hidden) { animation: nd-fade .2s ease-out; }
#wizard:not(.hidden) { animation: nd-fade .2s ease-out; }
@media (prefers-reduced-motion: reduce) { #wizard:not(.hidden) > div { animation: nd-fade .15s ease-out; } }
/* Quien pide menos transparencia en su sistema ve la cabecera y la barra inferior opacas */
@media (prefers-reduced-transparency: reduce) {
    body > header, #sticky-cta { background: #110f0d !important; backdrop-filter: none !important; }
}
/* Titulares grandes con el espaciado algo más cerrado (las letras grandes se ven separadas) */
h1 { letter-spacing: -0.02em; }

/* Cifras que cambian (temporizador de descanso, anillos, kcal, macros, gramos): dígitos de ancho fijo para que no bailen */
#rest-pill, .ring-prog ~ text, #dashboard, #diary-summary, #diary-meals, #gym-app, #trk-stats, #res-tdee, svg text { font-variant-numeric: tabular-nums; }

/* ===== Pulido de diseño ===== */
/* Titulares sin palabras huérfanas y párrafos con mejor reparto de líneas */
h1, h2, h3 { text-wrap-style: balance; }
p, li, .text-xs, .text-sm { text-wrap-style: pretty; }
/* Textura muy suave sobre el fondo: rompe el negro plano sin restar contraste */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-reduced-transparency: reduce) { body::before { display: none; } }
/* Tarjetas: borde superior algo más claro, como si la luz viniera de arriba (profundidad sin sombras negras) */
.glass-card { box-shadow: inset 0 1px 0 rgba(255, 240, 220, .05), 0 10px 24px -12px rgba(20, 12, 4, .6); }
/* Resumen del menú: en móvil la 5.ª cifra (fibra) ocupa toda la fila en vez de quedarse sola */
/* Botones del menú: en móvil, rejilla de 2 × 2 con el mismo ancho */
/* Zona táctil invisible para enlaces-botón pequeños */
.nd-hit { position: relative; padding: 4px 2px; }
.nd-hit::after { content: ''; position: absolute; inset: -8px -4px; }
/* Saltar al contenido: oculto hasta que se usa el teclado */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: #9a6b40; color: #fff; font-weight: 800; font-size: 14px; transition: top .15s var(--ease-out); }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

/* ===== Calculadora: datos bloqueados hasta pulsar «Editar datos» ===== */
.nd-locked input[type="range"] { opacity: .45; pointer-events: none; }
.nd-locked .num-input { background: transparent !important; border-color: transparent !important; pointer-events: none; }

/* ===== Calculadora: estado sin datos ===== */
.calc-pending > :not(#calc-empty) { display: none !important; }
#sec-resultados:not(.calc-pending) > #calc-empty { display: none; }
.calc-empty { background: radial-gradient(120% 90% at 50% 0%, rgba(154, 107, 64, .22), transparent 60%), rgba(23, 23, 23, .9); border: 1px solid rgba(197, 154, 109, .25); }
.nd-invalid { border-color: #f43f5e !important; box-shadow: 0 0 0 2px rgba(244, 63, 94, .25); }
.num-input::placeholder { color: #a8937b; opacity: 1; }

/* ===== Gym nuevo ===== */
#rest-bar { bottom: 1.5rem; } @media (max-width: 1023px) { #rest-bar { bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)); } }
#rest-bar:not(.hidden), #nd-sheet:not(.hidden) { animation: nd-fade .2s ease-out; }
@media (max-width: 639px) { #nd-sheet:not(.hidden) > div { animation: nd-sheet .4s var(--ease-drawer); } }
@media (min-width: 640px) { #nd-sheet:not(.hidden) > div { animation: nd-pop .22s var(--ease-out); } }
html { scrollbar-color: #4a3b2c #110f0d; } input, textarea { caret-color: #c59a6d; }
.gset-grid input { transition: border-color .15s, background-color .15s; -moz-appearance: textfield; }
.gset-grid input:focus { outline: none; border-color: #c59a6d; background: #2a2219; }
.gset-grid input::-webkit-outer-spin-button, .gset-grid input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gset-grid input::placeholder { color: #a8937b; }
.gym-hero { background: radial-gradient(140% 120% at 100% 0%, rgba(154, 107, 64, .28), transparent 55%), linear-gradient(180deg, rgba(38, 30, 22, .95), rgba(20, 17, 14, .95)); border: 1px solid rgba(197, 154, 109, .28); box-shadow: inset 0 1px 0 rgba(255, 240, 220, .06), 0 18px 40px -20px rgba(20, 12, 4, .8); }
.gym-daybtn { background: rgba(38, 38, 38, .7); border: 1px solid #3a332c; color: #e4dcd2; transition: transform .16s var(--ease-out), background-color .2s, border-color .2s; }
@media (hover: hover) and (pointer: fine) { .gym-daybtn:hover { border-color: rgba(197, 154, 109, .6); background: rgba(154, 107, 64, .18); } }
.gym-bar { transition: width .5s var(--ease-out); }
.gym-tabs { scrollbar-width: none; } .gym-tabs::-webkit-scrollbar { display: none; }
.gset-grid { display: grid; grid-template-columns: 2.25rem 1fr 1fr 2.25rem; gap: .5rem; }
@media (min-width: 1024px) { #gym-ex { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; } #gym-ex > * { margin: 0 !important; } #gym-ex > :only-child { grid-column: 1 / -1; } }
#gym-records:not(.hidden) { animation: nd-fade .2s ease-out; }
@media (max-width: 639px) { #gym-records:not(.hidden) > div { animation: nd-sheet .4s var(--ease-drawer); } }
@media (min-width: 640px) { #gym-records:not(.hidden) > div { animation: nd-pop .22s var(--ease-out); } }
@media (prefers-reduced-motion: reduce) { #gym-records:not(.hidden) > div { animation: nd-fade .15s ease-out; } .gym-bar { transition: none; } }

/* ===== Añadido: accesibilidad ===== */
/* Anillo visible al moverse con el teclado (Tab); con ratón o dedo no aparece */
:focus-visible { outline: 2px solid #dcc19c; outline-offset: 2px; border-radius: 10px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
/* Botones pequeños (quitar un alimento, etc.): zona táctil invisible de 40 px sin cambiar su tamaño */
button.w-5.h-5, button.w-6.h-6, button.w-7.h-7 { position: relative; }
button.w-5.h-5::after, button.w-6.h-6::after, button.w-7.h-7::after { content: ''; position: absolute; inset: -10px; }
/* Quien pide menos movimiento en su sistema no tiene desplazamientos animados */
/* Legibilidad (aprobado por el usuario 2026-10-06): gris secundario con contraste ≥ 4,5:1 sobre las tarjetas
   y texto pequeño a 12 px como mínimo */
.text-neutral-500 { color: #959595; }
.text-[9px], .text-[10px], .text-[11px] { font-size: 12px; line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto !important; } .ring-prog, .chev, .toast { transition: none !important; } }


/* =====================================================================
   nutriDL 3.0 · Identidad: oscuro cálido, beige y marrón, tarjetas sobrias, una sola acción principal por bloque
   ===================================================================== */
:root { --nd-card: rgba(26, 23, 20, .92); --nd-line: rgba(255, 240, 220, .08); --nd-brand: #9a6b40; --nd-brand-hi: #7a5230; --nd-sand: #dcc19c; }

/* Tarjetas y bloques */
.nd-card { background: var(--nd-card); border: 1px solid var(--nd-line); border-radius: 1.5rem; box-shadow: inset 0 1px 0 rgba(255, 240, 220, .05), 0 12px 28px -18px rgba(0, 0, 0, .8); }
.nd-tile { background: var(--nd-card); border: 1px solid var(--nd-line); border-radius: 1.25rem; padding: 1rem; transition: border-color .2s ease; }
.nd-now { background: radial-gradient(130% 120% at 100% 0%, rgba(196, 154, 108, .22), transparent 60%), linear-gradient(180deg, rgba(40, 31, 22, .95), rgba(24, 20, 16, .95)); border: 1px solid rgba(197, 154, 109, .32); border-radius: 1.5rem; }
.nd-insight { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; background: var(--nd-card); border: 1px solid var(--nd-line); border-radius: 1.25rem; }
@media (hover: hover) and (pointer: fine) { .nd-tile:hover, .nd-insight:hover, .nd-quick:hover, .nd-wide:hover, .nd-goal:hover { border-color: rgba(197, 154, 109, .5); } }

/* Botones */
.nd-btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: 1rem 1.75rem; border-radius: 1.1rem; background: var(--nd-brand); color: #fff; font-weight: 800; font-size: 1rem; white-space: nowrap; box-shadow: 0 12px 30px -10px rgba(154, 107, 64, .6); transition: background-color .2s ease, scale .12s var(--ease-out); }
.nd-btn-primary:hover { background: var(--nd-brand-hi); }
.nd-btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; padding: 1rem 1.5rem; border-radius: 1.1rem; border: 1px solid rgba(255, 240, 220, .14); color: #e4dcd2; font-weight: 700; }
.nd-btn-ghost:hover { border-color: rgba(197, 154, 109, .55); }
.nd-mbtn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .6rem .75rem; border-radius: .9rem; background: #262321; border: 1px solid #3a3530; color: #f2ede6; font-size: .85rem; font-weight: 800; white-space: nowrap; }
.nd-mbtn:hover { border-color: rgba(197, 154, 109, .55); }
.nd-mbtn-main { background: var(--nd-brand); border-color: var(--nd-brand); color: #fff; }
.nd-mbtn-main:hover { background: var(--nd-brand-hi); }
.nd-quick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 4.6rem; border-radius: 1.1rem; background: var(--nd-card); border: 1px solid var(--nd-line); color: #e4dcd2; }
.nd-quick i { font-size: 1.2rem; color: var(--nd-sand); }
.nd-quick span { font-size: 12px; font-weight: 800; }
.nd-wide { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.25rem; border-radius: 1.1rem; background: var(--nd-card); border: 1px solid var(--nd-line); font-size: .875rem; font-weight: 800; color: #f2ede6; }
.nd-goal { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border-radius: 999px; background: var(--nd-card); border: 1px solid var(--nd-line); font-size: .875rem; font-weight: 800; color: #f2ede6; }
.nd-streak { display: inline-flex; align-items: center; gap: .3rem; padding: .45rem .8rem; border-radius: 999px; background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .32); color: #fde68a; font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; }

/* Barras de progreso */
.nd-kbar { height: 12px; border-radius: 999px; background: #2a2521; overflow: hidden; }
.nd-kbar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #c49a6c, #dcc19c); transition: width .6s var(--ease-out); }
.nd-grow { transition: width .6s var(--ease-out); }

/* Bienvenida (landing) */
.nd-hero { background: radial-gradient(110% 120% at 100% 0%, rgba(196, 154, 108, .25), transparent 55%), radial-gradient(90% 90% at 0% 100%, rgba(122, 82, 48, .22), transparent 60%), linear-gradient(180deg, #1b1612, #121110); border: 1px solid rgba(197, 154, 109, .22); }
.nd-eyebrow { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(196, 154, 108, .14); border: 1px solid rgba(196, 154, 108, .3); color: var(--nd-sand); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nd-phone { border-radius: 2.4rem; padding: .7rem; background: linear-gradient(160deg, #2b231b, #141210); border: 1px solid rgba(255, 240, 220, .1); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 240, 220, .08); }
.nd-phone-inner { border-radius: 1.9rem; padding: 1.1rem; background: #0e0d0c; border: 1px solid rgba(255, 255, 255, .04); }
.nd-feature { padding: 1.4rem; border-radius: 1.5rem; background: var(--nd-card); border: 1px solid var(--nd-line); }
.nd-feature h3 { margin-top: .9rem; font-size: 1.05rem; font-weight: 800; color: #faf7f3; }
.nd-feature p { margin-top: .35rem; font-size: .9rem; color: #aea396; line-height: 1.55; }
.nd-feature-ic { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: .95rem; background: rgba(196, 154, 108, .14); font-size: 1.35rem; }
.nd-step { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border-radius: 1.5rem; background: var(--nd-card); border: 1px solid var(--nd-line); }
.nd-step > span { flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 999px; background: var(--nd-brand); color: #fff; font-weight: 800; }
.nd-step h3 { font-weight: 800; color: #faf7f3; }
.nd-step p { font-size: .875rem; color: #aea396; margin-top: .15rem; }
.nd-faq { border-radius: 1.1rem; background: var(--nd-card); border: 1px solid var(--nd-line); }
.nd-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; font-weight: 800; color: #f2ede6; }
.nd-faq p { padding: 0 1.2rem 1.1rem; color: #bdb2a5; font-size: .925rem; line-height: 1.6; }
.nd-pro-badge { display: inline-flex; align-items: center; padding: .12rem .5rem; border-radius: 999px; background: linear-gradient(90deg, #c49a6c, #f5d9a8); color: #2b1d12; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }
.nd-price { padding: 1rem; border-radius: 1.1rem; background: var(--nd-card); border: 1px solid var(--nd-line); }
.nd-price-best { border-color: rgba(197, 154, 109, .55); background: linear-gradient(180deg, rgba(154, 107, 64, .18), var(--nd-card)); }

/* Coach */
.nd-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 1.1rem; background: #151312; border: 1px solid var(--nd-line); }
.nd-seg button { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.6rem; border-radius: .85rem; color: #aea396; font-size: .875rem; font-weight: 800; transition: background-color .2s ease, color .2s ease; }
.nd-seg button.on { background: var(--nd-brand); color: #fff; }
.nd-ctx { padding: .55rem .6rem; border-radius: 1rem; background: var(--nd-card); border: 1px solid var(--nd-line); text-align: center; }
.nd-ctx span { display: block; font-size: 11px; font-weight: 700; color: #aea396; text-transform: uppercase; letter-spacing: .03em; }
.nd-ctx b { display: block; font-size: .95rem; font-weight: 800; color: #faf7f3; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nd-msg-u { margin-left: auto; width: fit-content; max-width: 85%; padding: .7rem 1rem; border-radius: 1.25rem 1.25rem .4rem 1.25rem; background: var(--nd-brand); color: #fff; font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.nd-msg-c { width: fit-content; max-width: 100%; padding: .9rem 1rem; border-radius: 1.25rem 1.25rem 1.25rem .4rem; background: var(--nd-card); border: 1px solid var(--nd-line); color: #e4dcd2; font-size: 15px; line-height: 1.55; }
@media (min-width: 640px) { .nd-msg-c { max-width: 92%; } }
.nd-msg-c b { color: #faf7f3; }
.nd-msg-c, .nd-msg-u { scroll-margin-top: 5.5rem; scroll-margin-bottom: 9rem; }
.nd-msg-c p + p { margin-top: .4rem; }
.nd-typing { display: flex; gap: 5px; padding: 1rem 1.1rem; }
.nd-typing span { width: 7px; height: 7px; border-radius: 999px; background: #aea396; animation: nd-dot 1s infinite ease-in-out; }
.nd-typing span:nth-child(2) { animation-delay: .15s; } .nd-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes nd-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.nd-tag { display: inline-flex; align-items: center; gap: .3rem; margin: 0 .3rem .45rem 0; padding: .15rem .55rem; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.nd-tag i { font-size: 9px; }
.nd-tag-dato { background: rgba(196, 154, 108, .16); color: #eadcc6; }
.nd-tag-est { background: rgba(245, 158, 11, .14); color: #fcd34d; }
.nd-tag-rec { background: rgba(125, 211, 252, .1); color: #bae6fd; }
.nd-tag-base { background: rgba(255, 255, 255, .06); color: #cfc5b8; }
.nd-list { list-style: disc; padding-left: 1.15rem; margin-top: .4rem; }
.nd-list li + li { margin-top: .25rem; }
.nd-steps { list-style: decimal; padding-left: 1.2rem; margin-top: .3rem; font-size: .9rem; color: #cfc5b8; }
.nd-steps li + li { margin-top: .3rem; }
.nd-composer { position: sticky; bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); z-index: 20; display: flex; align-items: center; gap: .4rem; padding: .35rem; border-radius: 999px; background: rgba(24, 22, 20, .96); border: 1px solid rgba(255, 240, 220, .12); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8); backdrop-filter: blur(12px); }
@media (min-width: 1024px) { .nd-composer { bottom: 1rem; } }
.nd-noscroll { scrollbar-width: none; } .nd-noscroll::-webkit-scrollbar { display: none; }
.nd-crow { padding: .7rem .8rem; border-radius: 1rem; background: rgba(38, 36, 33, .6); border: 1px solid #34302b; }
.nd-gin { display: inline-flex; align-items: center; gap: .25rem; flex: none; }
.nd-gin input { width: 4.6rem; padding: .5rem .55rem; border-radius: .7rem; background: #151312; border: 1px solid #3a3530; text-align: right; font-weight: 800; -moz-appearance: textfield; }
.nd-gin input::-webkit-outer-spin-button, .nd-gin input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.nd-gin input:focus { outline: none; border-color: #c59a6d; }
.nd-gin span { font-size: 12px; font-weight: 700; color: #aea396; }
.nd-est { color: #fcd34d; font-weight: 700; }
.nd-done { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; font-size: .875rem; font-weight: 800; color: #eadcc6; }
.nd-meal { display: grid; gap: .75rem; padding: 1rem; border-radius: 1.25rem; background: rgba(30, 27, 24, .95); border: 1px solid var(--nd-line); }
.nd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 4px; vertical-align: 1px; }
.nd-recipe { padding-top: .75rem; border-top: 1px solid var(--nd-line); }
.nd-shop { display: flex; align-items: center; gap: .75rem; min-height: 3rem; padding: .55rem .7rem; border-radius: .9rem; cursor: pointer; color: #f2ede6; font-size: .95rem; font-weight: 600; }
.nd-shop:hover { background: rgba(255, 255, 255, .03); }
.nd-shop input { width: 1.25rem; height: 1.25rem; accent-color: #9a6b40; flex: none; }
.nd-shop.on > span { text-decoration: line-through; opacity: .5; }
.nd-bigmic { width: 5.5rem; height: 5.5rem; border-radius: 999px; background: var(--nd-brand); color: #fff; font-size: 2rem; box-shadow: 0 16px 40px -14px rgba(154, 107, 64, .8); }
.nd-rec { position: relative; background: #c2603f !important; color: #fff !important; }
.nd-rec::after { content: ''; position: absolute; inset: -6px; border-radius: 999px; border: 2px solid rgba(194, 96, 63, .6); animation: nd-ring 1.2s ease-out infinite; }
@keyframes nd-ring { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.nd-photo { display: flex; align-items: center; justify-content: center; min-height: 9rem; padding: 1.25rem; border-radius: 1.25rem; border: 2px dashed #3a3530; cursor: pointer; text-align: center; }
.nd-photo.has { padding: 0; border-style: solid; overflow: hidden; }
.nd-photo:focus-within { border-color: #c59a6d; }
.nd-ach { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; padding: .8rem .5rem; border-radius: 1rem; background: #151312; border: 1px solid var(--nd-line); opacity: .55; }
.nd-ach.on { opacity: 1; background: rgba(245, 158, 11, .06); border-color: rgba(245, 158, 11, .28); }

/* Barra inferior: el Coach destaca un poco */
.nd-coach-tab { display: grid; place-items: center; width: 2.2rem; height: 1.7rem; border-radius: .7rem; transition: background-color .2s ease; }
#tabbar-bottom .is-on .nd-coach-tab { background: rgba(196, 154, 108, .18); }
#tabbar-bottom button { min-height: 3.5rem; }

/* Celebraciones (proteína conseguida, día completado, racha, logros): arriba, discreto, 3 s */
#nd-celebrate { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 95; display: flex; align-items: center; gap: .75rem; max-width: calc(100% - 2rem); padding: .8rem 1.1rem; border-radius: 1.25rem; background: rgba(32, 26, 20, .97); border: 1px solid rgba(245, 158, 11, .38); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9); transform: translate(-50%, -140%); opacity: 0; pointer-events: none; transition: transform .35s var(--ease-out), opacity .25s ease; }
#nd-celebrate.show { transform: translate(-50%, 0); opacity: 1; }

/* Hojas y entrada del contenido */
[data-panel]:not(.hidden) { animation: nd-fade .18s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .nd-typing span, .nd-rec::after { animation: none; }
    #nd-celebrate { transition: opacity .2s ease; transform: translate(-50%, 0); }
    .nd-kbar > div, .nd-grow { transition: none; }
    [data-panel]:not(.hidden) { animation: none; }
}

/* Menú de perfil: en móviles bajos se desplaza en vez de salirse de la pantalla */
#profile-menu { max-height: calc(100dvh - 5.5rem); overflow-y: auto; overscroll-behavior: contain; }

/* Cabecera en portátiles (1024-1279 px): sin iconos en las pestañas para que nada parta línea */
#tabbar-top button { white-space: nowrap; }
@media (max-width: 1279px) { #tabbar-top i { display: none; } }
.nd-btn-ghost { white-space: nowrap; }

/* 3.1: candado PRO en los accesos rápidos */
.nd-quick { position: relative; }
.nd-lock { position: absolute; top: 5px; right: 6px; font-size: 9px; color: #fcd34d; }
@media (max-width: 380px) { .nd-quick span { font-size: 11px; } }
.nd-quick .nd-lock i { font-size: 9px; color: #fcd34d; }

/* =====================================================================
   nutriDL 3.2 · Acabado profesional
   Grises cálidos en toda la app, titulares con serifa (Newsreader), menos negrita,
   etiquetas en minúscula normal y superficies sobrias (sin brillos de colores)
   ===================================================================== */
:root {
    --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
    --nd-bg: #110f0d;
    --nd-card: #1a1714;
    --nd-raise: #211d19;
    --nd-line: rgba(255, 236, 214, .085);
    --nd-line-hi: rgba(255, 236, 214, .16);
    --nd-ink: #f2ede6;
    --nd-muted: #aea396;
    --nd-shadow: 0 1px 2px rgba(8, 5, 2, .45), 0 10px 24px -14px rgba(8, 5, 2, .7);
}
body { background-color: var(--nd-bg); color: #e4dcd2; }
::-webkit-scrollbar-track { background: var(--nd-bg); }
::-webkit-scrollbar-thumb { background: #3a332c; }
html { scrollbar-color: #3a332c var(--nd-bg); }
.text-neutral-500 { color: #9c9084; }

/* Tipografía: titulares grandes con serifa y peso medio; la negrita extra pasa a negrita normal */
h1, h2[class*="text-2xl"], h2[class*="text-3xl"], h2[class*="text-4xl"], .nd-display {
    font-family: var(--font-display); font-weight: 600 !important; letter-spacing: -0.015em; font-optical-sizing: auto;
}
h1 { line-height: 1.06; }
.font-extrabold { font-weight: 700; }
.font-black { font-weight: 800; }
/* Etiquetas pequeñas: en minúscula normal (las MAYÚSCULAS con espaciado son la firma de las plantillas) */
.uppercase.tracking-wider, .uppercase.tracking-wide, .uppercase.tracking-widest { text-transform: none; letter-spacing: .005em; font-weight: 600; }
.nd-ctx span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.nd-eyebrow { padding: 0; background: none; border: 0; border-radius: 0; text-transform: none; letter-spacing: .01em; font-size: 14px; font-weight: 600; color: var(--nd-sand); }

/* Superficies: un solo material cálido, borde fino y luz desde arriba; sin halos de color */
.glass-card, .nd-card, .nd-tile, .nd-insight, .nd-feature, .nd-step, .nd-faq, .nd-price, .nd-quick, .nd-wide, .nd-goal, .nd-ctx, .nd-msg-c {
    background: var(--nd-card); border-color: var(--nd-line); backdrop-filter: none;
}
.glass-card, .nd-card { box-shadow: inset 0 1px 0 rgba(255, 240, 220, .04), var(--nd-shadow); }
.glass-card-dark { background: var(--nd-raise); border: 1px solid var(--nd-line-hi); box-shadow: inset 0 1px 0 rgba(255, 240, 220, .05), var(--nd-shadow); backdrop-filter: none; }
.nd-hero { background: linear-gradient(180deg, #1d1915 0%, #161310 100%); border: 1px solid var(--nd-line); }
.nd-now, .gym-hero { background: var(--nd-raise); border: 1px solid rgba(197, 154, 109, .26); box-shadow: inset 0 1px 0 rgba(255, 240, 220, .05), var(--nd-shadow); }
.calc-empty { background: var(--nd-raise); border: 1px solid var(--nd-line-hi); }
.nd-price-best { background: var(--nd-raise); border-color: rgba(197, 154, 109, .5); }
.mint-glow, .rose-glow, .cta-glow { box-shadow: 0 8px 20px -12px rgba(8, 5, 2, .9); }
.nd-btn-primary { box-shadow: inset 0 1px 0 rgba(255, 240, 220, .18), 0 8px 18px -12px rgba(8, 5, 2, .9); font-weight: 700; letter-spacing: .005em; }
.nd-bigmic { box-shadow: inset 0 1px 0 rgba(255, 240, 220, .2), 0 14px 30px -16px rgba(8, 5, 2, .95); }
.nd-btn-ghost { border-color: var(--nd-line-hi); }
.nd-mbtn { background: var(--nd-raise); border-color: #3a332c; font-weight: 700; }
.nd-meal { background: var(--nd-raise); }
.nd-seg { background: #15120f; }
.nd-seg button, .nd-quick span, .nd-wide, .nd-goal { font-weight: 700; }
.nd-kbar { background: #2a2521; }
.nd-kbar > div { background: #c49a6c; }
.nd-feature-ic { background: none; width: auto; height: auto; place-items: start; font-size: 1.25rem; color: var(--nd-sand); }
/* Radios algo más contenidos: contenedores suaves, piezas interiores más rectas */
.rounded-3xl, .nd-card, .nd-feature, .nd-step, .nd-now { border-radius: 1.25rem; }
.rounded-\[2rem\] { border-radius: 1.5rem; }
.rounded-2xl { border-radius: .875rem; }

/* Portada: rejilla asimétrica y pasos con número grande en serifa */
.nd-feature-lead h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; }
.nd-feature-lead p { font-size: 1rem; max-width: 34rem; }
.nd-feature-row { display: flex; align-items: center; gap: 1rem; }
.nd-feature-row h3 { margin-top: 0; }
.nd-step { background: transparent; border: 0; border-top: 1px solid var(--nd-line-hi); border-radius: 0; padding: 1.25rem 0 0; }
.nd-step > span { width: auto; height: auto; background: none; border-radius: 0; font-family: var(--font-display); font-weight: 500; font-size: 2.25rem; line-height: 1; color: var(--nd-sand); }
.nd-brand { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.nd-logo { background: #9a6b40; box-shadow: inset 0 1px 0 rgba(255, 240, 220, .22); }
/* Iconos en cuadrado suave (sustituyen a los emojis grandes del panel) */
.nd-ic { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .75rem; background: rgba(196, 154, 108, .12); color: var(--nd-sand); font-size: 1.05rem; line-height: 1; }
.nd-ic-lg { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: rgba(196, 154, 108, .12); color: var(--nd-sand); font-size: 1.5rem; }
.gym-daybtn { background: var(--nd-raise); border-color: #3a332c; }
.uppercase:is(.text-\[10px\], .text-\[11px\], .text-xs) { text-transform: none; letter-spacing: 0; font-weight: 600; }
.text-neutral-600 { color: #928679; } /* texto apagado con contraste suficiente (≥ 4,5:1) */
#fs-tabs { flex-wrap: wrap; } /* pestañas del buscador: en móviles de 320 px pasan a dos líneas */
.shadow-2xl { --tw-shadow: 0 2px 6px rgba(8, 5, 2, .5), 0 18px 36px -18px rgba(8, 5, 2, .85); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } /* ventanas: sombra cálida y más corta */

/* =====================================================================
   nutriDL 3.3 · Sistema visual profesional
   Ideas de apps de datos serias, adaptadas a nuestra paleta: listas antes que tarjetas,
   cifras protagonistas, un solo acento, iconos de línea (nunca emojis) y controles de un solo tamaño.
   ===================================================================== */
:root { --nd-r-lg: 1rem; --nd-r-md: .75rem; --nd-r-sm: .5rem; --nd-p: #c49a6c; --nd-c: #e6d3b3; --nd-f: #f59e0b; }
::selection { background: rgba(196, 154, 108, .35); color: #faf7f3; }

/* Superficies: planas, borde fino, sin sombra que flote */
.glass-card, .nd-card { border-radius: var(--nd-r-lg); background: #17140f; border: 1px solid var(--nd-line); box-shadow: none; }
.nd-tile, .nd-insight, .nd-feature, .nd-faq, .nd-price, .nd-ctx, .nd-meal { border-radius: var(--nd-r-lg); box-shadow: none; }
.nd-now, .gym-hero { border-radius: var(--nd-r-lg); background: #1d1915; border-color: rgba(197, 154, 109, .22); box-shadow: none; }
.nd-hero { border-radius: 1.25rem; }
.rounded-3xl { border-radius: var(--nd-r-lg); }
.rounded-2xl { border-radius: var(--nd-r-md); }

/* Botones: misma altura y radio en toda la app */
.nd-btn-primary { min-height: 3rem; padding: .8rem 1.4rem; border-radius: var(--nd-r-md); font-size: .95rem; box-shadow: none; }
.nd-btn-ghost { min-height: 3rem; padding: .8rem 1.25rem; border-radius: var(--nd-r-md); }
.nd-mbtn { border-radius: var(--nd-r-sm); min-height: 2.75rem; }
.nd-wide, .nd-quick { border-radius: var(--nd-r-md); }
.nd-quick { background: #1d1915; border-color: transparent; }
.nd-quick span { color: #cfc5b8; font-weight: 600; }
.nd-goal { border-radius: var(--nd-r-md); padding: .5rem .85rem; font-weight: 600; }
.nd-streak { background: transparent; border-color: rgba(245, 158, 11, .35); color: #fcd34d; font-weight: 600; }
.cta-glow, .mint-glow { box-shadow: none; }

/* Cifras: serifa con dígitos alineados (se leen como un marcador, no como un texto) */
.nd-num, #dashboard .text-4xl.tabular-nums, #dashboard .nd-tile .text-xl, #dashboard .text-right > .text-2xl, .nd-ctx b {
    font-family: var(--font-display); font-weight: 500 !important; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em;
}
#dashboard .text-4xl.tabular-nums { font-size: 3rem; line-height: 1; }
#dashboard .nd-tile .text-xl { font-size: 1.5rem; }

/* Barras de progreso finas */
.nd-kbar { height: 8px; }
.h-2.rounded-full.bg-neutral-800 { height: 6px; }

/* Icono de alimento: cuadradito sobrio con glifo de línea, siempre del mismo tamaño */
.nd-fi { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-right: .45rem; vertical-align: -.45rem; border-radius: .45rem; background: rgba(220, 193, 156, .09); color: #cdb594; font-size: .72rem; line-height: 1; flex: none; }
.nd-list .nd-fi, .nd-msg-c .nd-fi { width: 1.35rem; height: 1.35rem; font-size: .62rem; vertical-align: -.3rem; margin-right: .35rem; }
.nd-ic-xl { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 1.1rem; background: rgba(196, 154, 108, .12); color: var(--nd-sand); font-size: 1.6rem; }
.nd-list { list-style: none; padding-left: 0; }

/* Macros con su punto de color (proteína, hidratos, grasa) */
.nd-m { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.nd-m::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.nd-m-p::before { background: var(--nd-p); } .nd-m-c::before { background: var(--nd-c); } .nd-m-f::before { background: var(--nd-f); }

/* Barra inferior: indicador fino arriba del apartado activo, sin fondo de píldora */
#tabbar-bottom button { position: relative; font-weight: 600; letter-spacing: .01em; }
#tabbar-bottom button.is-on::before { content: ''; position: absolute; top: 0; left: 50%; width: 1.75rem; height: 2px; margin-left: -.875rem; border-radius: 0 0 2px 2px; background: var(--nd-sand); }
#tabbar-bottom .is-on .nd-coach-tab { background: transparent; }
#tabbar-top { background: transparent; border-color: transparent; }
#tabbar-top button { font-weight: 600; }

/* Asistente: opciones planas con borde fino */
.wz-tile { border-radius: var(--nd-r-md); }
.wz-tile .nd-ic { width: 2.25rem; height: 2.25rem; }
.nd-mbtn.nd-mbtn-main { background: var(--nd-brand); border-color: var(--nd-brand); color: #fff; } .nd-mbtn.nd-mbtn-main:hover { background: var(--nd-brand-hi); }
/* Etiquetas BETA / PRO: rectangulares, finas y discretas (antes, píldora dorada) */
.nd-pro-badge { font-family: 'Plus Jakarta Sans', sans-serif; padding: .15rem .4rem; border-radius: .3rem; background: transparent; border: 1px solid rgba(220, 193, 156, .45); color: var(--nd-sand); font-size: 10px; font-weight: 700; letter-spacing: .08em; line-height: 1.2; }
/* Primera carga: el contenido se pinta tal cual, sin aparecer con transición (la animación queda para los cambios de pestaña) */
html:not(.nd-ready) [data-panel]:not(.hidden) { animation: none; }

/* =====================================================================
   3.6 · Gym: dropsets y cronómetro del entreno
   ===================================================================== */
/* Número de serie que se toca para cambiar entre normal y dropset */
.nd-settype { position: relative; width: 2.25rem; height: 2.25rem; margin: 0 auto; border-radius: .6rem; border: 1px solid transparent; background: transparent; color: #cfc5b8; font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; transition: background-color .15s ease, border-color .15s ease; }
@media (hover: hover) and (pointer: fine) { .nd-settype:hover { border-color: var(--nd-line-hi); } }
.nd-settype.is-drop { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .4); color: #fcd34d; }
.nd-settype small { position: absolute; right: 2px; bottom: 1px; font-size: 8px; font-weight: 800; line-height: 1; }
.nd-droprow { margin-top: -.15rem; }
.nd-adddrop { display: block; width: calc(100% - 2.75rem); margin: 0 0 .25rem 2.75rem; padding: .35rem; border-radius: .6rem; border: 1px dashed rgba(245, 158, 11, .35); color: #fcd34d; font-size: .72rem; font-weight: 700; }
.nd-droptag { display: inline-block; padding: 0 .3rem; border-radius: .25rem; border: 1px solid rgba(245, 158, 11, .4); color: #fcd34d; font-size: 10px; font-weight: 700; line-height: 1.5; vertical-align: 1px; }
/* Cronómetro: botón para empezar y barra fija mientras dura el entreno */
.nd-sess-start { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 2.75rem; border-radius: var(--nd-r-md); border: 1px solid var(--nd-line-hi); color: #f2ede6; font-size: .875rem; font-weight: 700; }
.nd-sess-start i { color: var(--nd-sand); font-size: .75rem; }
.nd-sess-start span { color: #aea396; font-weight: 600; }
.nd-sess { position: sticky; top: calc(4.25rem + env(safe-area-inset-top, 0px)); z-index: 15; display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem .55rem .85rem; border-radius: var(--nd-r-md); background: #241e18; border: 1px solid rgba(197, 154, 109, .35); box-shadow: 0 8px 20px -14px rgba(8, 5, 2, .9); }
.nd-sess > i { color: var(--nd-sand); }
.nd-sess-lbl { font-size: 11px; font-weight: 600; color: #aea396; }
.nd-sess-time { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.05; color: #f2ede6; font-variant-numeric: lining-nums tabular-nums; }
.nd-sess.is-paused .nd-sess-time { color: #aea396; }
.nd-sess .nd-mbtn { min-height: 2.5rem; padding: .5rem .7rem; }

/* Pie de página: zona táctil mínima de 32 px de alto en sus enlaces (WCAG 2.2, tamaño del objetivo) */
.nd-foot-links > a, .nd-foot-links > button { display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; }
