/* =============================================================
   Yaya recetas
   Sistema de diseño editorial: Inter (UI) + Fraunces (titulares).
   Paleta reducida, mucho aire, acento sage y ámbar de apoyo.
   ============================================================= */

/* ----- Reset ligero ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; margin: 0; list-style: none; }
input, textarea, select { font: inherit; color: inherit; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ----- Variables ----- */
:root {
  --paper:        #FBFAF7;
  --paper-2:     #F3F1EB;
  --paper-3:     #E8E5DC;
  --ink:          #1A1A1A;
  --ink-2:        #4A4A48;
  --ink-3:        #8C8A84;
  --line:         #E3E1D9;
  --accent:       #7A8B6F;   /* verde salvia */
  --accent-ink:   #FBFAF7;
  --warm:         #D9622C;   /* uso ocasional, sin saturar */

  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    22px;

  --shadow-1:     0 1px 2px rgba(26,26,26,.04), 0 2px 8px rgba(26,26,26,.04);
  --shadow-2:     0 6px 24px rgba(26,26,26,.08);

  --ease:         cubic-bezier(.2,.7,.3,1);
  --dur:          220ms;

  --content:      min(720px, 100%);
  --pad:          20px;

  --font-ui:      'Inter', system-ui, sans-serif;
  --font-edit:    'Fraunces', 'Playfair Display', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #111110;
    --paper-2:    #191817;
    --paper-3:    #201E1B;
    --ink:        #F2F1ED;
    --ink-2:      #BFBCB5;
    --ink-3:      #83817B;
    --line:       #2A2824;
    --shadow-1:   0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25);
    --shadow-2:   0 6px 24px rgba(0,0,0,.35);
  }
}

/* Respeta prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   TIPOGRAFÍA
   ============================================================ */
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.05; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.125rem; line-height: 1.3; }
p  { margin: 0 0 1rem; }

.eyebrow {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 0 .5rem;
}

/* ============================================================
   LAYOUT GLOBAL
   ============================================================ */
.app {
  min-height: 100dvh;
  padding: calc(64px + env(safe-area-inset-top)) var(--pad) calc(96px + env(safe-area-inset-bottom));
  max-width: 960px;
  margin: 0 auto;
}
.view { padding-top: 8px; }

/* ----- Top bar ----- */
.topbar {
  position: fixed; inset: 0 0 auto 0;
  height: calc(56px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: var(--pad); padding-right: var(--pad);
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.topbar__brand { display: inline-flex; align-items: center; gap: .5rem; }
.topbar__brand-serif {
  font-family: var(--font-edit);
  font-style: italic;
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: -.01em;
}
.topbar__nav { display: flex; gap: 4px; }
.topbar__icon {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  transition: background var(--dur) var(--ease);
}
.topbar__icon:hover { background: var(--paper-2); }
.topbar__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ----- Tab bar ----- */
.tabbar {
  position: fixed; inset: auto 0 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-top: 1px solid var(--line);
  z-index: 40;
}
.tabbar__item {
  display: grid; place-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 10px;
  font-size: .68rem; letter-spacing: .02em;
  color: var(--ink-3);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.tabbar__item svg {
  width: 22px; height: 22px; fill: none;
  stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.tabbar__item.is-active { color: var(--ink); }
.tabbar__item:hover { color: var(--ink-2); }

/* ============================================================
   HOME
   ============================================================ */
.hello {
  padding: 1.5rem 0 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
}
.hello__avatar {
  width: 72px; height: 72px;
  border-radius: 999px;
  object-fit: cover;
  object-position: 50% 22%;
  mix-blend-mode: multiply;
  flex: 0 0 auto;
}
.hello__text { min-width: 0; }
.hello__kicker {
  color: var(--ink-3); letter-spacing: .02em; margin: 0 0 .5rem;
  font-size: .95rem;
}
.hello__title {
  font-family: var(--font-edit);
  font-weight: 300;
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  color: var(--ink);
}
.hello__title em { font-style: italic; }

@media (prefers-color-scheme: dark) {
  .hello__avatar { mix-blend-mode: screen; filter: invert(1); }
}

.featured {
  margin-top: .5rem;
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.featured:active { transform: scale(.995); }
.featured__body { padding: 1rem 2px 2rem; }
.featured__title {
  font-family: var(--font-edit);
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.05; letter-spacing: -.015em;
  margin: .3rem 0 .6rem;
}
.featured__summary {
  color: var(--ink-2); max-width: 46ch; font-size: 1rem;
}
.featured__meta {
  color: var(--ink-3); font-size: .85rem; margin: .4rem 0 0;
  letter-spacing: .02em;
}

/* ----- Fila "cabecera" reusable ----- */
.row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 2rem 0 .9rem;
}
.row-head__title { font-family: var(--font-edit); font-size: 1.6rem; font-weight: 400; }
.row-head__link  { color: var(--ink-3); font-size: .85rem; letter-spacing: .02em; }
.row-head__link:hover { color: var(--ink); }

/* ----- Chips horizontales ----- */
.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--pad);
  scroll-padding-right: var(--pad);
  /* Solo gesto horizontal aquí; el vertical sigue su camino hacia el body */
  touch-action: pan-x;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll--bleed {
  margin: 0 calc(-1 * var(--pad));
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  padding: 10px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .85rem;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.chip:hover  { background: var(--paper-3); }
.chip:active { transform: scale(.97); }
.chip.is-active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

/* ----- Scroll horizontal de favoritos (home) ----- */
.fav-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--pad);
  scroll-padding-right: var(--pad);
  touch-action: pan-x;
}
.fav-scroll::-webkit-scrollbar { display: none; }
.fav-scroll--bleed {
  margin: 0 calc(-1 * var(--pad));
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.mini-card {
  flex: 0 0 auto;
  width: 150px;
  scroll-snap-align: start;
  transition: transform var(--dur) var(--ease);
}
.mini-card:active { transform: scale(.98); }
.mini-card__link { display: block; }
.mini-card__link .cover { aspect-ratio: 1 / 1; border-radius: var(--radius); }
.mini-card__body { padding: .55rem 2px 0; }
.mini-card__title {
  font-family: var(--font-edit); font-weight: 400;
  font-size: 1rem; line-height: 1.2; margin: .1rem 0 0;
  letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-card .eyebrow { margin: 0 0 .2rem; font-size: .65rem; }

/* ----- Grid de tarjetas ----- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.card-grid--tight { gap: 20px; }
@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; gap: 24px; }
}

.card {
  position: relative;
  transition: transform var(--dur) var(--ease);
}
.card:active { transform: scale(.99); }
.card__link { display: block; }
.card__body { padding: .8rem 4px 0; }
.card__title {
  font-family: var(--font-edit); font-weight: 400;
  font-size: 1.35rem; line-height: 1.15; margin: .1rem 0 .35rem;
  letter-spacing: -.01em;
}
.card__meta { color: var(--ink-3); font-size: .82rem; letter-spacing: .02em; margin: 0; }

/* ----- Portada editorial sin imagen ----- */
.cover {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: grid; grid-template-rows: 1fr auto;
  border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease);
}
.cover--hero  { aspect-ratio: 4 / 5; border-radius: 0; border: 0; }
.cover--xl    { aspect-ratio: 4 / 5; }
.cover--default { aspect-ratio: 4 / 5; }

.cover__mark {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: .22;
}
.cover__mark svg { width: 40%; max-width: 180px; }

/* Imagen real de portada — cubre la figura respetando el aspect-ratio.
   En cover--photo el caption queda sobre un gradiente oscuro para
   legibilidad tanto en fotos claras como oscuras. */
.cover__image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.cover--photo .cover__caption {
  background: linear-gradient(to top,
    rgba(0,0,0,.40) 0%,
    rgba(0,0,0,.18) 40%,
    transparent 100%);
  padding-top: 48px;
}
.cover--photo .cover__eyebrow,
.cover--photo .cover__title {
  color: #FBFAF7;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.cover--hero.cover--photo .cover__caption { display: none; }

.cover__caption {
  position: relative; z-index: 1;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
  align-self: end;
  background: linear-gradient(to top, rgba(0,0,0,.04), transparent);
}
.cover__eyebrow {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: color-mix(in oklab, var(--ink) 75%, transparent);
}
.cover__title {
  font-family: var(--font-edit);
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink);
}
.cover--hero .cover__caption { display: none; }

/* ----- Botón favorito flotante dentro de tarjeta / hero ----- */
.fav-btn {
  position: absolute; top: 10px; right: 10px;
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
  z-index: 2;
}
.fav-btn svg {
  width: 20px; height: 20px; fill: none;
  stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.fav-btn:hover { background: var(--paper); }
.fav-btn.is-active {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}
.fav-btn.is-active svg { fill: currentColor; }

/* ============================================================
   LISTADO / CATEGORÍAS
   ============================================================ */
.page-head {
  padding: 1rem 0 1.25rem;
  display: grid; gap: .3rem;
}
.page-title {
  font-family: var(--font-edit);
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 400; letter-spacing: -.015em;
  line-height: 1.05;
}
.page-head__actions { margin-top: .5rem; }

/* Estado vacío */
.empty { color: var(--ink-3); padding: 2rem 0; text-align: center; }
.empty--lg { padding: 3rem 0; }
.empty__title {
  font-family: var(--font-edit); font-size: 1.4rem; color: var(--ink);
  margin-bottom: .5rem;
}
.empty__text { max-width: 36ch; margin: 0 auto 1.5rem; }

/* ============================================================
   FICHA DE RECETA
   ============================================================ */
.recipe {
  margin: calc(-1 * (64px + env(safe-area-inset-top))) calc(-1 * var(--pad)) 0;
}
.recipe__hero {
  position: relative;
  width: 100%;
  height: min(75dvh, 600px);
}
.recipe__hero .cover--hero {
  width: 100%; height: 100%; border-radius: 0;
}
.recipe__back {
  position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 16px;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: color-mix(in oklab, var(--paper) 85%, transparent);
  backdrop-filter: blur(6px);
  border-radius: 999px; border: 1px solid var(--line); z-index: 3;
}
.recipe__back svg {
  width: 20px; height: 20px; fill: none;
  stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.recipe__hero .fav-btn {
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}

/* Corazón junto al título, siempre visible al scrollear */
.recipe__title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.recipe__title-row .recipe__title { flex: 1 1 auto; min-width: 0; }
.recipe__title-row .fav-btn {
  position: static;
  flex: 0 0 auto;
  margin-top: .35rem;
}

.recipe__body {
  max-width: 720px;
  margin: -40px auto 0;
  padding: 40px var(--pad) 0;
  background: var(--paper);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  position: relative;
}
.recipe__title {
  font-family: var(--font-edit);
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 300;
  line-height: 1.03;
  letter-spacing: -.02em;
  margin: .3rem 0 .8rem;
}
.recipe__summary { color: var(--ink-2); font-size: 1.02rem; max-width: 48ch; }

.recipe__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 1.5rem 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.recipe__meta div { text-align: center; }
.recipe__meta dt {
  font-size: .68rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-3); margin-bottom: 4px;
}
.recipe__meta dd {
  font-family: var(--font-edit); font-size: 1.1rem; margin: 0;
  letter-spacing: -.01em;
}

.recipe__section { margin: 2rem 0; }

.section-title {
  font-family: var(--font-edit);
  font-size: 1.6rem; font-weight: 400;
  margin: 0 0 1rem;
}

.ingredient-list { display: grid; gap: 10px; }
.ingredient-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.ingredient-list li:last-child { border-bottom: 0; }
.ingredient-list input[type="checkbox"] {
  appearance: none;
  width: 20px; height: 20px; border-radius: 4px;
  border: 1.5px solid var(--ink-3);
  display: grid; place-items: center;
  transition: all var(--dur) var(--ease);
  flex: 0 0 auto; cursor: pointer;
  background: transparent;
}
.ingredient-list input[type="checkbox"]:checked {
  background: var(--accent); border-color: var(--accent);
}
.ingredient-list input[type="checkbox"]:checked::after {
  content: ''; width: 5px; height: 9px;
  border-right: 2px solid var(--accent-ink);
  border-bottom: 2px solid var(--accent-ink);
  transform: rotate(45deg) translate(-1px, -1px);
}
.ingredient-list label { flex: 1; cursor: pointer; }
.ingredient-list li:has(input:checked) label {
  color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px;
}

.step-list { display: grid; gap: 1.5rem; counter-reset: step; }
.step-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: start;
}
.step-list__num {
  font-family: var(--font-edit);
  font-size: 1.5rem;
  color: var(--ink-3);
  line-height: 1;
  padding-top: 2px;
  letter-spacing: -.01em;
}
.step-list p {
  margin: 0;
  font-size: 1.05rem; line-height: 1.6;
  color: var(--ink);
}

/* Apunte de Tere */
.tere-note {
  margin: 2.5rem 0;
  padding: 1.8rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  align-items: start;
}
.tere-note::before {
  content: '';
  position: absolute; top: -1px; left: 24px;
  width: 48px; height: 2px;
  background: var(--accent);
}
.tere-note__avatar {
  width: 56px; height: 56px;
  border-radius: 999px;
  object-fit: cover;
  object-position: 50% 22%;
  mix-blend-mode: multiply;
  background: var(--paper-2);
}
.tere-note__body { min-width: 0; }
.tere-note__kicker {
  font-size: .68rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--accent);
  margin: 0 0 .6rem;
  font-weight: 500;
}
.tere-note__text {
  font-family: var(--font-edit);
  font-size: 1.1rem; line-height: 1.5;
  color: var(--ink); margin: 0;
  letter-spacing: -.005em;
}

@media (prefers-color-scheme: dark) {
  .tere-note__avatar { mix-blend-mode: screen; filter: invert(1); }
}

.note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--paper);
  resize: vertical;
  font-family: var(--font-ui);
  font-size: .95rem; line-height: 1.55;
  transition: border-color var(--dur) var(--ease);
}
.note:focus { outline: none; border-color: var(--ink); }
.note__hint { font-size: .75rem; color: var(--ink-3); margin: 6px 0 0; min-height: 1em; }

.recipe__cta { margin: 2rem 0 3rem; display: grid; }

/* ============================================================
   BUSCADOR
   ============================================================ */
.view--search { padding-top: 0; }
.search-head { padding: 1rem 0 1.5rem; }
.search-input {
  width: 100%;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line);
  padding: 14px 0;
  font-family: var(--font-edit);
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 300; letter-spacing: -.01em;
  color: var(--ink);
}
.search-input:focus { outline: none; border-color: var(--ink); }
.search-input::placeholder { color: var(--ink-3); }

.search-results { padding-top: .5rem; }
.result-list { display: grid; gap: 14px; }
.result__link {
  display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.result__thumb {
  width: 84px; height: 84px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.result__title { font-family: var(--font-edit); font-size: 1.2rem; font-weight: 400; margin: .15rem 0 .2rem; }
.result__meta { margin: 0; color: var(--ink-3); font-size: .8rem; letter-spacing: .02em; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: .92rem; font-weight: 500; letter-spacing: .01em;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border: 1px solid transparent;
  min-height: 44px;
}
.btn:active { transform: scale(.98); }
.btn--solid {
  background: var(--ink); color: var(--paper);
}
.btn--solid:hover { background: color-mix(in oklab, var(--ink) 85%, var(--accent)); }
.btn--ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--paper-2); }
.btn--inline {
  padding: 6px 14px; min-height: 32px;
  background: var(--ink); color: var(--paper);
  border-radius: 999px; font-size: .85rem;
}
.btn--lg { padding: 16px 24px; font-size: 1rem; }

/* ============================================================
   BOTTOM SHEET (filtros)
   ============================================================ */
.sheet {
  position: fixed; inset: 0; z-index: 80;
  display: block;
}
.sheet[hidden] { display: none; }
.sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,18,.32);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.sheet.is-open .sheet__backdrop { opacity: 1; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 10px var(--pad) calc(20px + env(safe-area-inset-bottom));
  max-height: 80dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease);
}
.sheet.is-open .sheet__panel { transform: translateY(0); }
.sheet__handle {
  width: 44px; height: 4px; background: var(--paper-3);
  border-radius: 2px; margin: 6px auto 16px; cursor: grab;
}
.sheet__title {
  font-family: var(--font-edit);
  font-size: 1.5rem; font-weight: 400;
  margin: 0 0 1rem;
}
.sheet__actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 1.2rem;
}
.filter-group { margin: 1rem 0; }
.filter-group__label {
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-3); margin: 0 0 .6rem;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: .85rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.pill:hover { background: var(--paper-3); }
.pill.is-active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

/* ============================================================
   INSTALL BANNER · UPDATE BANNER · OFFLINE PILL
   ============================================================ */
.install-banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 60;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  animation: rise var(--dur) var(--ease);
}
.install-banner__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
}
.install-banner__title { margin: 0; font-weight: 500; font-size: .95rem; }
.install-banner__text  { margin: 2px 0 0; font-size: .8rem; color: color-mix(in oklab, var(--paper) 70%, transparent); }
.install-banner__share {
  display: inline-block;
  width: 14px; height: 14px;
  vertical-align: -2px;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  margin: 0 2px;
}
.install-banner__actions { display: flex; gap: 8px; flex: 0 0 auto; }
.install-banner .btn--ghost { color: var(--paper); border-color: color-mix(in oklab, var(--paper) 30%, transparent); }
.install-banner .btn--ghost:hover { background: rgba(255,255,255,.08); }
.install-banner .btn--solid { background: var(--paper); color: var(--ink); }

.update-banner {
  position: fixed;
  left: 12px; right: 12px;
  top: calc(12px + env(safe-area-inset-top) + 56px);
  z-index: 70;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: var(--shadow-2);
  font-size: .88rem;
  animation: rise var(--dur) var(--ease);
}
.update-banner .btn--inline { background: var(--ink); color: var(--paper); }

.offline-pill {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top) + 56px);
  left: 50%; transform: translateX(-50%);
  z-index: 70;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
  font-size: .78rem; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-1);
}
.offline-pill__dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--warm);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--warm) 25%, transparent);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MODO COCINA
   ============================================================ */
body.cook-mode .topbar,
body.cook-mode .tabbar,
body.cook-mode .offline-pill,
body.cook-mode .install-banner { display: none !important; }
body.cook-mode .app { padding: 0; max-width: none; }

.cook {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: var(--paper);
  color: var(--ink);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
body.cook-dark .cook { background: #0A0A09; color: #F4F2EC; }
body.cook-dark .cook .btn--ghost { color: #F4F2EC; border-color: rgba(244,242,236,.22); }
body.cook-dark .cook .btn--solid { background: #F4F2EC; color: #0A0A09; }
body.cook-dark .cook__timer-display { color: #F4F2EC; }

.cook__head {
  display: grid; grid-template-columns: 48px 1fr 48px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in oklab, currentColor 10%, transparent);
}
.cook__title {
  text-align: center;
  font-family: var(--font-edit);
  font-size: 1rem; font-weight: 400; margin: 0;
  color: color-mix(in oklab, currentColor 70%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cook__back, .cook__icon {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 999px; justify-self: center;
}
.cook__back svg, .cook__icon svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.cook__stage {
  padding: 2rem 24px;
  display: grid; align-content: center;
  user-select: none;
  -webkit-user-select: none;
}
.cook__count {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .16em;
  color: color-mix(in oklab, currentColor 55%, transparent);
  margin: 0 0 1.2rem;
}
.cook__text {
  font-family: var(--font-edit);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0;
  max-width: 22ch;
}

.cook__timer {
  padding: 1rem 20px;
  border-top: 1px solid color-mix(in oklab, currentColor 10%, transparent);
}
.cook__timer-display {
  font-family: var(--font-edit);
  font-weight: 300;
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: .8rem;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.cook__timer-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.cook__timer-row .btn { padding: 10px 8px; font-size: .82rem; min-height: 40px; }
.cook__timer.is-done .cook__timer-display {
  color: var(--warm);
  animation: pulse 600ms var(--ease);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.cook__nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid color-mix(in oklab, currentColor 10%, transparent);
}

/* ============================================================
   RESPONSIVE · TABLET / ESCRITORIO
   ============================================================ */
@media (min-width: 768px) {
  .app { --pad: 40px; padding-top: calc(76px + env(safe-area-inset-top)); }
  .topbar { height: calc(68px + env(safe-area-inset-top)); padding-left: 40px; padding-right: 40px; }
  .tabbar { display: none; }
  .app { padding-bottom: 60px; }
  .recipe__body { padding-top: 56px; }
  .featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: stretch; }
  .featured .cover { height: 100%; }
}

@media (min-width: 1024px) {
  .app { max-width: 1100px; --pad: 56px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .recipe__hero { height: min(70dvh, 680px); }
}

/* ============================================================
   ACCESIBILIDAD
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
