/* ==========================================================================
   1.61.0 · Crea tu mezcla (rediseño del 3 nov, tableros C1–C4)
   Solo en /crea-tu-receta/ (web y app). Colores con los tokens de
   tnp-public.css (--tnp-*) para que el modo oscuro los cambie; los fijos van
   con su texto en la misma regla (el generador los oscurece juntos). Las hojas
   usan la pieza de la calculadora (.tnp-k-hoja, .tnp-k-btn, .tnp-k-casilla) y
   el puente al test, .tnp-k-puente.
   ========================================================================== */

.tnp-m { position: relative; max-width: 720px; margin: 0 auto; font-family: var(--tnp-font); color: var(--tnp-texto); scroll-margin-top: 88px; }
.tnp-m [hidden], .tnp-m-hoja [hidden] { display: none !important; }
.tnp-m-atras svg, .tnp-m-paso-b svg, .tnp-m .tnp-k-btn svg, .tnp-m-hoja .tnp-k-btn svg, .tnp-m-hoja .tnp-k-cerrar svg, .tnp-m-mia > svg, .tnp-m-nutri summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tnp-m-vista { display: flex; flex-direction: column; gap: 12px; }
.tnp-m-vista > * { margin: 0; }
.tnp-m-h1:focus, .tnp-m-grupo-tit:focus { outline: none; }

/* Cabecera: enlace atrás, etiqueta y titular */
.tnp-m-cab { display: flex; align-items: center; min-height: 52px; margin: 0 0 -4px -8px; }
.tnp-m-atras { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--tnp-verde); font: 600 15px/1 var(--tnp-font); text-decoration: none; cursor: pointer; }
.tnp-m-atras:hover { background: var(--tnp-menta); color: var(--tnp-verde); }
.tnp-m-atras:focus-visible { outline: 2px solid var(--tnp-verde); outline-offset: 2px; }
.tnp-m-etq { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tnp-terracota); }
.tnp-m-h1 { font-family: var(--tnp-display); font-weight: 600; font-size: 32px; line-height: 1.08; letter-spacing: -0.02em; color: var(--tnp-texto); margin: 0; }
.tnp-m-h1.is-receta { font-size: 30px; line-height: 1.1; }
.tnp-m-h2 { font-family: var(--tnp-display); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; color: var(--tnp-texto); margin: 0; }
.tnp-m-estado { font-size: 14px; line-height: 1.45; color: var(--tnp-texto-suave); }
.tnp-m-estado:empty { display: none; }

/* C1 · los cuatro tipos */
.tnp-m-tipos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px !important; }
@media (min-width: 640px) { .tnp-m-tipos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tnp-m-tipo { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 44px; margin: 0; padding: 8px 8px 12px; box-sizing: border-box; border: 1.5px solid var(--tnp-borde); border-radius: 16px; background: var(--tnp-superficie); box-shadow: var(--tnp-sombra); color: var(--tnp-texto); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color .15s, background-color .15s; }
@media (hover: hover) { .tnp-m-tipo:hover { border-color: var(--tnp-verde); } }
.tnp-m-tipo:focus-visible { outline: 2px solid var(--tnp-verde); outline-offset: 2px; }
.tnp-m-tipo[aria-pressed="true"] { border-color: var(--tnp-verde); background: var(--tnp-menta); box-shadow: inset 0 0 0 1px var(--tnp-verde); }
.tnp-m-tipo[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 999px; background: var(--tnp-verde); color: #FFFFFF; font-size: 14px; font-weight: 700; line-height: 24px; text-align: center; }
.tnp-m-tipo-dib { display: block; height: 76px; border-radius: 12px; background: #F4E3DC; overflow: hidden; }
.tnp-m-tipo-dib svg, .tnp-m-mia-dib svg { display: block; width: 100%; height: 100%; }
.tnp-m-tipo-txt { display: grid; gap: 2px; padding: 0 6px; }
.tnp-m-tipo-txt strong { font-size: 16px; font-weight: 600; line-height: 1.25; }
.tnp-m-tipo-txt small { font-size: 13px; line-height: 1.35; color: var(--tnp-texto-suave); }

/* C1 · raciones */
.tnp-m-rac { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 8px 8px 16px; box-sizing: border-box; border-radius: 16px; background: var(--tnp-superficie); box-shadow: var(--tnp-sombra); scroll-margin-top: 80px; }
.tnp-m-rac-t { font-size: 16px; font-weight: 600; }
.tnp-m-paso { display: inline-flex; align-items: center; gap: 4px; }
.tnp-m-paso-b { width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--tnp-borde); border-radius: 999px; background: var(--tnp-superficie); color: var(--tnp-verde); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
@media (hover: hover) { .tnp-m-paso-b:hover { border-color: var(--tnp-verde); } }
.tnp-m-paso-b:focus-visible { outline: 2px solid var(--tnp-verde); outline-offset: 2px; }
.tnp-m-paso-b[aria-disabled="true"] { opacity: .4; cursor: default; }
.tnp-m-paso-n { min-width: 44px; text-align: center; font-family: var(--tnp-display); font-size: 26px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }

/* C1 · grupos y chips */
.tnp-m-grupos { display: grid; gap: 12px; }
.tnp-m-grupos:empty { display: none; }
.tnp-m-grupo { display: grid; gap: 12px; padding: 14px 16px 16px; border-radius: 16px; background: var(--tnp-superficie); box-shadow: var(--tnp-sombra); scroll-margin-top: 80px; scroll-margin-bottom: 120px; }
.tnp-m-grupo-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tnp-m-grupo-tit { margin: 0; font-family: var(--tnp-font); font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--tnp-texto); }
.tnp-m-regla { flex: none; font-size: 14px; color: var(--tnp-texto-suave); font-variant-numeric: tabular-nums; }
.tnp-m-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tnp-m-chip { position: relative; display: inline-flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 6px 16px; box-sizing: border-box; border: 1.5px solid var(--tnp-borde); border-radius: 22px; background: var(--tnp-superficie); color: var(--tnp-texto); font: 400 16px/1.2 var(--tnp-font); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color .15s, background-color .15s, opacity .15s; }
.tnp-m-chip-n { display: inline-flex; align-items: center; gap: 6px; }
@media (hover: hover) { .tnp-m-chip:not([aria-disabled="true"]):hover { border-color: var(--tnp-verde); } }
.tnp-m-chip:focus-visible { outline: 2px solid var(--tnp-verde); outline-offset: 2px; }
.tnp-m-chip-ok { display: none; position: absolute; left: 12px; top: 50%; margin-top: -10px; font-weight: 700; line-height: 20px; color: var(--tnp-verde); }
.tnp-m-chip[aria-pressed="true"] { padding-left: 32px; border-color: var(--tnp-verde); background: var(--tnp-menta); color: var(--tnp-texto); }
.tnp-m-chip[aria-pressed="true"] .tnp-m-chip-ok { display: block; }
.tnp-m-chip.is-lleno { opacity: .45; cursor: default; }
.tnp-m-chip.is-al { border-style: dashed; cursor: default; color: var(--tnp-texto-suave); }
.tnp-m-chip-al { font-size: 13px; line-height: 1.3; color: var(--tnp-terracota); }

/* Barra de abajo (fija) */
.tnp-m-barra { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px calc(-1 * var(--gutter, 20px)) 0 !important; padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; background: var(--tnp-superficie); box-shadow: 0 -4px 24px rgba(31, 42, 38, 0.10); }
.tnp-m-barra-txt { display: grid; gap: 2px; min-width: 0; }
.tnp-m-barra-n { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--tnp-texto); }
.tnp-m-barra-s { font-size: 14px; line-height: 1.4; color: var(--tnp-texto-suave); }
.tnp-m-barra.is-falta .tnp-m-barra-n { font-size: 15px; color: var(--tnp-terracota); }
.tnp-m-barra.is-falta .tnp-m-barra-s { color: var(--tnp-terracota); font-weight: 400; }
@media (min-width: 760px) { .tnp-m-barra { margin-left: 0 !important; margin-right: 0 !important; } }
/* En la app, encima de la barra de pestañas (abajo en el móvil); cuando se esconde al bajar, baja también. */
@media (max-width: 899px) {
	.app-herramienta .tnp-m-barra { bottom: calc(61px + env(safe-area-inset-bottom, 0px)); padding-bottom: 16px; }
	body:has(.tabbar.is-oculta) .app-herramienta .tnp-m-barra { bottom: 0; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
.tnp-m-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; box-sizing: border-box; border: 0; border-radius: 999px; background: var(--tnp-verde); color: #FFFFFF; font: 600 16px/1.2 var(--tnp-font); text-align: center; cursor: pointer; }
.tnp-m-btn:hover { background: #274F44; color: #FFFFFF; }
.tnp-m-btn:focus-visible { outline: 2px solid var(--tnp-verde); outline-offset: 3px; }
.tnp-m-btn[aria-disabled="true"] { background: var(--tnp-borde); color: var(--tnp-texto-suave); cursor: default; }

/* Tus mezclas (con plan) */
.tnp-m-mias { display: grid; gap: 10px; margin-top: 12px !important; }
.tnp-m-mias-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tnp-m-mias-lista li { margin: 0; }
.tnp-m-mia { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 8px 14px 8px 8px; box-sizing: border-box; border: 0; border-radius: 16px; background: var(--tnp-superficie); box-shadow: var(--tnp-sombra); color: var(--tnp-texto); font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .tnp-m-mia:hover { box-shadow: var(--tnp-sombra-elevada); } }
.tnp-m-mia:focus-visible { outline: 2px solid var(--tnp-verde); outline-offset: 2px; }
.tnp-m-mia-dib { flex: none; width: 64px; height: 56px; border-radius: 12px; background: #F4E3DC; overflow: hidden; }
.tnp-m-mia-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.tnp-m-mia-txt strong { font-size: 16px; font-weight: 600; line-height: 1.3; }
.tnp-m-mia-txt small { font-size: 14px; color: var(--tnp-texto-suave); }
.tnp-m-mia > svg { color: var(--tnp-texto-suave); }

/* C2/C3 · la receta */
.tnp-m-meta { font-size: 15px; line-height: 1.45; color: var(--tnp-texto-suave); margin-top: -4px !important; }
.tnp-m-rc { display: grid; gap: 12px; }
.tnp-m-rc > * { margin: 0; }
.tnp-m-cargando { margin: 0; padding: 18px 16px; border-radius: 16px; background: var(--tnp-superficie); color: var(--tnp-texto-suave); font-size: 15px; }
.tnp-m-error { display: grid; gap: 12px; justify-items: start; padding: 16px; border-radius: 16px; background: var(--tnp-superficie); box-shadow: var(--tnp-sombra); }
.tnp-m-error p { margin: 0; font-size: 15px; line-height: 1.5; }
.tnp-m-sec { padding: 16px; border-radius: 16px; background: var(--tnp-superficie); box-shadow: var(--tnp-sombra); }
.tnp-m-h3 { margin: 0 0 10px; font-family: var(--tnp-display); font-weight: 600; font-size: 20px; line-height: 1.2; color: var(--tnp-texto); }
.tnp-m-ings, .tnp-m-guardar { list-style: none; margin: 0; padding: 0; }
.tnp-m-ings li { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--tnp-borde); font-size: 16px; line-height: 1.4; }
.tnp-m-ings li:first-child { padding-top: 2px; }
.tnp-m-ings li:last-child { border-bottom: 0; padding-bottom: 0; }
.tnp-m-pasos { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; gap: 14px; }
.tnp-m-pasos li { position: relative; counter-increment: paso; margin: 0; padding-left: 40px; font-size: 16px; line-height: 1.55; }
.tnp-m-pasos li::before { content: counter(paso); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 999px; background: var(--tnp-menta); color: var(--tnp-verde); font-size: 14px; font-weight: 700; line-height: 28px; text-align: center; }
.tnp-m-guardar { display: grid; gap: 8px; }
.tnp-m-guardar li { position: relative; margin: 0; padding-left: 18px; font-size: 16px; line-height: 1.5; }
.tnp-m-guardar li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 999px; background: var(--tnp-verde); }
.tnp-m-nutri { border-radius: 16px; background: var(--tnp-superficie); box-shadow: var(--tnp-sombra); overflow: hidden; }
.tnp-m-nutri summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px; font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; }
.tnp-m-nutri summary::-webkit-details-marker { display: none; }
.tnp-m-nutri summary:focus-visible { outline: 2px solid var(--tnp-verde); outline-offset: -2px; border-radius: 16px; }
.tnp-m-nutri summary svg { color: var(--tnp-texto-suave); transition: transform .2s; }
.tnp-m-nutri[open] summary svg { transform: rotate(180deg); }
.tnp-m-nutri-in { padding: 0 16px 14px; }
.tnp-m-kcal { margin: 0 0 4px; font-size: 14px; color: var(--tnp-texto-suave); font-variant-numeric: tabular-nums; }
.tnp-m-nutri dl { margin: 0; }
.tnp-m-nutri dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--tnp-borde); font-size: 15px; }
.tnp-m-nutri dl > div:last-child { border-bottom: 0; }
.tnp-m-nutri dt, .tnp-m-nutri dd { margin: 0; }
.tnp-m-nutri dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.tnp-m-nota { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--tnp-texto-suave); }
.tnp-m-consejo { padding: 14px 16px; border-radius: 16px; background: #FDF6EE; color: #1F2A26; }
.tnp-m-consejo p { margin: 0; font-size: 15px; line-height: 1.5; }
.tnp-m-consejo .tnp-m-consejo-t { margin-bottom: 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #A85B16; }
.tnp-m-acc { display: grid; gap: 10px; margin-top: 6px !important; }
.tnp-m-acc > * { margin: 0; }
.tnp-m .tnp-m-acc .tnp-k-btn.is-borde { min-height: 52px; }
.tnp-m .tnp-m-puente { margin-top: 12px !important; padding: 28px 22px; }
.tnp-m .tnp-m-puente > * { margin: 0; }
.tnp-m .tnp-m-puente .tnp-k-aval { color: var(--tnp-texto-suave); }

/* Hojas: lo que añade a la de la calculadora (el asa y los campos fuera de .tnp-k) */
.tnp-m-hoja .tnp-k-hoja-in { padding-top: 12px; }
.tnp-m-asa { justify-self: center; display: block; width: 40px; height: 5px; border-radius: 999px; background: #E5DED4; }
.tnp-m-hoja .tnp-k-correo-form input[type="email"], .tnp-m-hoja .tnp-k-correo-form input[type="text"] { width: 100%; height: 52px; min-height: 0; margin: 0; padding: 0 16px; box-sizing: border-box; border: 1.5px solid var(--tnp-borde); border-radius: 12px; background: var(--tnp-superficie); box-shadow: none; color: var(--tnp-texto); font: 400 17px/1.2 var(--tnp-font); }
.tnp-m-hoja .tnp-k-correo-form input[type="email"]:focus, .tnp-m-hoja .tnp-k-correo-form input[type="text"]:focus { border-color: var(--tnp-verde); outline: 2px solid var(--tnp-verde); outline-offset: 1px; }
.tnp-m-hoja .tnp-k-peque a { display: inline-flex; align-items: center; min-height: 44px; }
.tnp-m-hoja .tnp-k-btn.is-texto { min-height: 44px; }

/* Aviso de abajo (guardada, borrada con «Deshacer», copiada) */
.tnp-m-toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 6px 8px 6px 18px; min-height: 48px; box-sizing: border-box; border-radius: 12px; background: var(--tnp-texto); color: #FFFFFF; font-size: 15px; line-height: 1.4; box-shadow: var(--tnp-sombra-elevada); }
.tnp-m-toast span { padding: 6px 10px 6px 0; }
.tnp-m-toast button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: 600 15px/1 var(--tnp-font); text-decoration: underline; cursor: pointer; }
.tnp-m-toast button:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
/* En la app, encima de la barra de la herramienta y de las pestañas. */
@media (max-width: 899px) { .app-herramienta .tnp-m-toast { bottom: calc(172px + env(safe-area-inset-bottom, 0px)); } }

/* Pantallas muy estrechas (320–359 px): más sitio para el nombre de la barra. */
@media (max-width: 359px) {
	.tnp-m-barra { gap: 10px; padding-left: 16px; padding-right: 16px; }
	.tnp-m-btn { padding: 0 14px; font-size: 15px; }
	.tnp-m-barra-n { font-size: 15px; }
}
@media (min-width: 700px) {
	.tnp-m-h1 { font-size: 36px; }
	.tnp-m-h1.is-receta { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
	.tnp-m-tipo, .tnp-m-chip, .tnp-m-nutri summary svg { transition: none; }
}

/* 1.62.0: «Guardar en Favoritas», con el marcador (relleno si ya está guardada). */
.tnp-k-btn .tnp-m-fav-ic { flex: none; }
.tnp-k-btn.is-guardada .tnp-m-fav-ic { fill: currentColor; }
