/* =========================================================
   Recetario de mamá — identidad "talavera"
   Azulejo cobalto sobre cal, con jitomate, nopal y maíz.
   ========================================================= */
:root {
  --azulejo: #1D3F8F;
  --azulejo-2: #2B55B5;
  --azulejo-50: #E9EEF9;
  --cal: #F7F8FB;
  --papel: #FFFFFF;
  --tinta: #1B1F2A;
  --tinta-2: #4A5165;
  --tinta-3: #7A8197;
  --linea: #DFE3EE;
  --jitomate: #D6452B;
  --jitomate-50: #FCEBE7;
  --nopal: #3E8B5A;
  --nopal-50: #E6F3EA;
  --maiz: #F2B635;
  --maiz-50: #FDF4DC;

  --f-display: "Caprasimo", "Georgia", serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --sh-1: 0 1px 2px rgba(29, 63, 143, .06), 0 2px 8px rgba(29, 63, 143, .06);
  --sh-2: 0 6px 24px rgba(29, 63, 143, .12);
  --side-w: 264px;

  --talavera: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Crect width='48' height='48' fill='%23F7F8FB'/%3E%3Cg fill='%231D3F8F'%3E%3Cpath d='M24 7c4.5 6 4.5 11 0 17-4.5-6-4.5-11 0-17zM24 41c4.5-6 4.5-11 0-17-4.5 6-4.5 11 0 17zM7 24c6-4.5 11-4.5 17 0-6 4.5-11 4.5-17 0zM41 24c-6-4.5-11-4.5-17 0 6 4.5 11 4.5 17 0z'/%3E%3Ccircle cx='0' cy='0' r='7.5'/%3E%3Ccircle cx='48' cy='0' r='7.5'/%3E%3Ccircle cx='0' cy='48' r='7.5'/%3E%3Ccircle cx='48' cy='48' r='7.5'/%3E%3C/g%3E%3Ccircle cx='24' cy='24' r='3.4' fill='%23F2B635'/%3E%3Cg fill='%23D6452B'%3E%3Ccircle cx='24' cy='2' r='1.6'/%3E%3Ccircle cx='24' cy='46' r='1.6'/%3E%3Ccircle cx='2' cy='24' r='1.6'/%3E%3Ccircle cx='46' cy='24' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cal); color: var(--tinta);
  font: 16px/1.55 var(--f-body); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--azulejo); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1, .display { font-family: var(--f-display); font-weight: 400; letter-spacing: .005em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.7rem); color: var(--azulejo); }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--tinta-3); }
:focus-visible { outline: 3px solid var(--maiz); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--azulejo); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.ico { width: 20px; height: 20px; flex: none; }
.num { font-family: var(--f-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estructura ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 40;
  background: var(--azulejo); color: #fff; display: flex; flex-direction: column;
  padding: 0 14px 14px; overflow-y: auto;
}
.side__band { height: 22px; margin: 0 -14px 18px; background: var(--talavera) 0 0 / 22px 22px; border-bottom: 3px solid var(--maiz); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 42px; height: 42px; display: grid; place-items: center; font-size: 24px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 3px var(--maiz); }
.brand__name { font-family: var(--f-display); font-size: 1.3rem; line-height: 1.1; }
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: rgba(255,255,255,.82); font-weight: 500; }
.side__nav a:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.side__nav a.is-active { background: #fff; color: var(--azulejo); font-weight: 700; }
.side__cta { margin: 18px 4px 0; }
.side__user { margin-top: auto; padding-top: 18px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.15); }
.side__user .icon-btn { color: #fff; margin-left: auto; }
.side__who { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; min-width: 0; }
.side__who small { color: rgba(255,255,255,.65); font-weight: 400; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--maiz); color: var(--tinta); font-weight: 700; flex: none; }

.shell { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px clamp(16px, 3vw, 40px); background: rgba(247, 248, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.top .top__menu { display: none; }
.search { flex: 1; max-width: 640px; position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 14px; color: var(--tinta-3); pointer-events: none; }
.search input { width: 100%; padding: 11px 44px 11px 44px; border-radius: 999px; border: 1.5px solid var(--linea); background: var(--papel); font: inherit; }
.search input:focus { border-color: var(--azulejo); outline: none; box-shadow: 0 0 0 4px var(--azulejo-50); }
.search kbd { position: absolute; right: 14px; font: 12px var(--f-mono); color: var(--tinta-3); border: 1px solid var(--linea); border-radius: 6px; padding: 1px 6px; }
.main { width: 100%; max-width: 1240px; margin: 0 auto; padding: clamp(18px, 3vw, 36px) clamp(16px, 3vw, 40px) 96px; flex: 1; }
.main--wide { max-width: 1480px; }
.scrim { display: none; }

.tabbar { display: none; }

@media (max-width: 1023px) {
  .side { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--sh-2); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(27,31,42,.45); z-index: 35; }
  .shell { margin-left: 0; }
  .top .top__menu { display: inline-grid; }
  .search kbd { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; justify-content: space-around; align-items: center;
    background: var(--papel); border-top: 1px solid var(--linea); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 11px var(--f-body); color: var(--tinta-3); background: none; border: 0; padding: 4px 8px; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .is-active { color: var(--azulejo); }
  .tabbar__add { width: 52px; height: 52px; border-radius: 50%; background: var(--jitomate) !important; color: #fff !important; justify-content: center; margin-top: -26px; box-shadow: 0 6px 16px rgba(214,69,43,.4); }
  .tabbar__add .ico { width: 26px; height: 26px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer;
  font: 600 15px/1 var(--f-body); background: var(--azulejo); color: #fff; transition: transform .12s, background .15s, box-shadow .15s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:hover { background: var(--azulejo-2); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--jitomate); }
.btn--accent:hover { background: #BF3920; }
.btn--green { background: var(--nopal); }
.btn--green:hover { background: #33774C; }
.btn--ghost { background: var(--papel); color: var(--azulejo); border-color: var(--linea); }
.btn--ghost:hover { background: var(--azulejo-50); border-color: var(--azulejo-50); }
.btn--danger { background: var(--papel); color: var(--jitomate); border-color: #F2C4BA; }
.btn--danger:hover { background: var(--jitomate-50); }
.btn--sm { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(29,63,143,.08); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .ico { width: 17px; height: 17px; }

/* ---------- Encabezados de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--tinta-2); max-width: 60ch; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--jitomate); margin-bottom: 6px; }
.section { margin-top: 40px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.45rem; color: var(--azulejo); }

/* ---------- Tarjetas ---------- */
.card { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r); padding: 20px; box-shadow: var(--sh-1); }
.card + .card { margin-top: 16px; }
.card__title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid--sm { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

/* Tarjeta de receta */
.rcard { position: relative; display: flex; flex-direction: column; background: var(--papel); border-radius: var(--r); overflow: hidden; border: 1px solid var(--linea); box-shadow: var(--sh-1); transition: transform .18s, box-shadow .18s; color: inherit; }
.rcard:hover { transform: translateY(-3px); box-shadow: var(--sh-2); text-decoration: none; }
.rcard__media { position: relative; aspect-ratio: 4 / 3; background: var(--azulejo-50); }
.rcard__media img { width: 100%; height: 100%; object-fit: cover; }
.rcard__cat { position: absolute; left: 10px; top: 10px; display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,.94); border-radius: 999px; color: var(--tinta); }
.rcard__fav { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; background: rgba(255,255,255,.94); border-radius: 50%; color: var(--jitomate); }
.rcard__fav .ico { width: 16px; height: 16px; fill: currentColor; }
.rcard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rcard__title { font-family: var(--f-display); font-size: 1.15rem; line-height: 1.2; color: var(--tinta); }
.rcard__meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13.5px; color: var(--tinta-3); margin-top: auto; }
.rcard__meta span { display: inline-flex; align-items: center; gap: 4px; }
.rcard__meta .ico { width: 15px; height: 15px; }
.badge-sub { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; background: var(--maiz); color: var(--tinta); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge-sub .ico { width: 14px; height: 14px; }

/* Placeholder talavera (firma visual) */
.tile-ph { width: 100%; height: 100%; min-height: 100%; background: var(--talavera) center / 44px 44px; display: grid; place-items: center; }
.tile-ph span { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 34px; box-shadow: 0 0 0 4px var(--maiz), var(--sh-2); }
.tile-ph--sm { background-size: 26px 26px; }
.tile-ph--sm span { width: 36px; height: 36px; font-size: 20px; box-shadow: 0 0 0 2px var(--maiz); }

/* ---------- Chips y etiquetas ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--papel); border: 1.5px solid var(--linea); color: var(--tinta-2); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.chip:hover { border-color: var(--azulejo); color: var(--azulejo); }
.chip.is-on, .chip:has(input:checked) { background: var(--azulejo); border-color: var(--azulejo); color: #fff; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip small { color: inherit; opacity: .7; font-weight: 500; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--azulejo-50); color: var(--azulejo); font-size: 13px; font-weight: 600; }
.tag::before { content: "#"; opacity: .5; margin-right: 1px; }

/* Estados de disponibilidad */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st--lista { background: var(--nopal-50); color: var(--nopal); }
.st--casi { background: var(--maiz-50); color: #9A6B00; }
.st--falta { background: var(--jitomate-50); color: var(--jitomate); }
.st--sin_datos { background: #EEF0F5; color: var(--tinta-3); }

.ring { --p: 0; --c: var(--nopal); width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(closest-side, var(--papel) 76%, transparent 78% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), #E6E9F1 0); }
.ring b { font: 500 13px var(--f-mono); }

/* ---------- Formularios ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
.form-grid > * { grid-column: span 12; }
@media (min-width: 720px) {
  .span-6 { grid-column: span 6 !important; } .span-4 { grid-column: span 4 !important; }
  .span-3 { grid-column: span 3 !important; } .span-8 { grid-column: span 8 !important; }
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--tinta-2); }
.field small { font-size: 13px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--linea); border-radius: var(--r-sm); background: var(--papel);
  font: inherit; color: var(--tinta); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--azulejo); box-shadow: 0 0 0 4px var(--azulejo-50); }
textarea { resize: vertical; min-height: 90px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--azulejo); }
.input-group { display: flex; }
.input-group > * { border-radius: 0 !important; }
.input-group > :first-child { border-radius: var(--r-sm) 0 0 var(--r-sm) !important; }
.input-group > :last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0 !important; margin-left: -1.5px; }

/* Zona de foto */
.photo-drop { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border: 2px dashed #B9C3DD; border-radius: var(--r); background: var(--azulejo-50); cursor: pointer; overflow: hidden; text-align: center; color: var(--azulejo); font-weight: 600; }
.photo-drop:hover, .photo-drop.is-drag { border-color: var(--azulejo); background: #DDE5F6; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop__hint { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; }
.photo-drop__hint .ico { width: 34px; height: 34px; }
.photo-drop--sq { aspect-ratio: 1; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r); box-shadow: var(--sh-1); }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--tinta-3); padding: 12px 14px; border-bottom: 1px solid var(--linea); background: #FAFBFD; white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFBFE; }
.table .right { text-align: right; }

/* ---------- Ingredientes (tarjeta) ---------- */
.icard { display: flex; gap: 12px; align-items: center; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r); padding: 10px; color: inherit; box-shadow: var(--sh-1); transition: border-color .15s, transform .15s; }
.icard:hover { border-color: var(--azulejo); text-decoration: none; transform: translateY(-2px); }
.icard__pic { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex: none; background: var(--azulejo-50); display: grid; place-items: center; font-size: 30px; }
.icard__pic img { width: 100%; height: 100%; object-fit: cover; }
.icard__name { font-weight: 700; line-height: 1.2; }
.icard small { display: block; }
.ing-emoji { font-size: 1.35em; line-height: 1; }

/* ---------- Stepper de inventario ---------- */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--linea); border-radius: 999px; background: var(--papel); }
.stepper button { width: 36px; height: 36px; border: 0; background: none; cursor: pointer; color: var(--azulejo); display: grid; place-items: center; border-radius: 50%; }
.stepper button:hover { background: var(--azulejo-50); }
.stepper input { width: 76px; border: 0; text-align: center; font: 500 15px var(--f-mono); background: transparent; padding: 6px 0; }
.stepper input:focus { outline: none; }
.stepper .unit { padding-right: 6px; font-size: 13px; color: var(--tinta-3); min-width: 34px; }
.bar { height: 6px; border-radius: 99px; background: #E6E9F1; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--nopal); border-radius: 99px; }
.bar--low i { background: var(--jitomate); }
.bar--mid i { background: var(--maiz); }
tr.is-saved td { animation: saved 1s ease; }
@keyframes saved { 0% { background: var(--nopal-50); } 100% { background: transparent; } }

/* ---------- Segmentos / tabs ---------- */
.seg { display: inline-flex; background: #E9ECF4; border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--tinta-2); border: 0; background: none; cursor: pointer; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.seg .is-on { background: var(--papel); color: var(--azulejo); box-shadow: var(--sh-1); }
.seg b { font: 500 12px var(--f-mono); background: rgba(29,63,143,.1); padding: 1px 7px; border-radius: 99px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }

/* ---------- Toasts ---------- */
.toast { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; background: var(--nopal-50); color: #245A38; border: 1px solid #BFE0CA; }
.toast--error { background: var(--jitomate-50); color: #9C2E1A; border-color: #F2C4BA; }
.toast--info { background: var(--azulejo-50); color: var(--azulejo); border-color: #C8D3EE; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast-stack .toast { margin: 0; box-shadow: var(--sh-2); animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 1023px) { .toast-stack { bottom: 88px; right: 16px; left: 16px; max-width: none; } }

/* ---------- Modal ---------- */
dialog.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(27,31,42,.3); color: var(--tinta); }
dialog.modal::backdrop { background: rgba(27,31,42,.5); backdrop-filter: blur(2px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal__head h2 { font-family: var(--f-display); font-weight: 400; color: var(--azulejo); font-size: 1.4rem; }
.modal__body { padding: 18px 22px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }

/* ---------- Vacíos ---------- */
.empty { text-align: center; padding: 48px 20px; background: var(--papel); border: 2px dashed var(--linea); border-radius: var(--r-lg); color: var(--tinta-2); }
.empty__art { font-size: 48px; margin-bottom: 8px; }
.empty h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.35rem; color: var(--azulejo); margin-bottom: 6px; }

/* ---------- Inicio ---------- */
.hero { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--azulejo); color: #fff; padding: clamp(24px, 4vw, 44px); display: grid; gap: 22px; grid-template-columns: 1.4fr 1fr; align-items: center; }
.hero::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 34%; background: var(--talavera) 0 0 / 56px 56px; opacity: .95; -webkit-mask: linear-gradient(90deg, transparent, #000 45%); mask: linear-gradient(90deg, transparent, #000 45%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem); }
.hero h1 em { font-style: normal; color: var(--maiz); }
.hero p { color: rgba(255,255,255,.82); font-size: 1.05rem; max-width: 46ch; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero__actions .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.hero__actions .btn--ghost:hover { background: rgba(255,255,255,.12); }
.hero__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hero__stat { background: rgba(255,255,255,.96); color: var(--tinta); border-radius: var(--r); padding: 14px 16px; }
.hero__stat b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 1.9rem; color: var(--azulejo); line-height: 1; }
.hero__stat span { font-size: 13.5px; color: var(--tinta-2); font-weight: 600; }
.hero__stat--ok b { color: var(--nopal); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero::after { width: 100%; height: 26px; inset: auto 0 0 0; -webkit-mask: none; mask: none; background-size: 26px 26px; } .hero { padding-bottom: 48px; } }

.cat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cat-tile { --c: var(--azulejo); display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r); background: var(--papel); border: 1px solid var(--linea); color: var(--tinta); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.cat-tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c); }
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-2); text-decoration: none; }
.cat-tile__ico { font-size: 30px; }
.cat-tile b { font-weight: 700; line-height: 1.2; }
.cat-tile small { font-family: var(--f-mono); }

.low-list { display: flex; flex-direction: column; gap: 8px; }
.low-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; }
.low-item .bar { flex: 1; }

.two-col { display: grid; gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.two-col--wide { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
@media (max-width: 960px) { .two-col, .two-col--wide { grid-template-columns: 1fr; } }

/* ---------- Detalle de receta ---------- */
.rhead { display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.rhead--ing { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
@media (max-width: 860px) { .rhead, .rhead--ing { grid-template-columns: 1fr; } }
.rhead__media { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--azulejo-50); box-shadow: var(--sh-2); }
.rhead__media img { width: 100%; height: 100%; object-fit: cover; }
.rhead__media .tile-ph span { width: 110px; height: 110px; font-size: 60px; box-shadow: 0 0 0 6px var(--maiz), var(--sh-2); }
.rhead h1 { margin: 6px 0 12px; }
.rhead__desc { font-size: 1.1rem; color: var(--tinta-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 18px 0; }
.fact { background: var(--papel); border: 1px solid var(--linea); border-radius: 14px; padding: 10px 14px; }
.fact small { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.fact small .ico { width: 15px; height: 15px; }
.fact b { font-size: 1.05rem; }
.gallery { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery a { flex: none; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; }
.gallery a:hover, .gallery a.is-on { border-color: var(--azulejo); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

.rbody { display: grid; gap: 28px; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); margin-top: 36px; align-items: start; }
@media (max-width: 860px) { .rbody { grid-template-columns: 1fr; } }
.ingr { position: sticky; top: 84px; }
.ingr__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.ingr__head h2, .steps h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; color: var(--azulejo); }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--linea); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list .qty { font-family: var(--f-mono); font-weight: 500; color: var(--azulejo); white-space: nowrap; min-width: 74px; }
.ing-list .have { margin-left: auto; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.ing-list .have .ico { width: 14px; height: 14px; }
.have--ok { background: var(--nopal-50); color: var(--nopal); }
.have--no { background: var(--jitomate-50); color: var(--jitomate); }
.ing-list li.is-checked > :not(.have) { text-decoration: line-through; opacity: .45; }
.ing-list .opt { font-size: 12px; color: var(--tinta-3); font-style: italic; }
.ing-sub { color: var(--tinta); font-weight: 700; }
.ing-sub small { font-weight: 500; }
.sec-label { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; font-weight: 700; color: var(--jitomate); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.sec-label::after { content: ""; flex: 1; height: 8px; background: var(--talavera) 0 50% / 8px 8px; opacity: .5; border-radius: 4px; }
.sec-label:first-child { margin-top: 0; }

.steps ol { list-style: none; counter-reset: paso; padding: 0; margin: 0; }
.steps li { counter-increment: paso; position: relative; padding: 4px 0 20px 56px; font-size: 1.05rem; cursor: pointer; }
.steps li::before { content: counter(paso); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--azulejo); color: #fff; font: 500 15px var(--f-mono); }
.steps li::after { content: ""; position: absolute; left: 18px; top: 42px; bottom: 4px; width: 2px; background: var(--linea); }
.steps li:last-child::after { display: none; }
.steps li.is-done { color: var(--tinta-3); }
.steps li.is-done::before { background: var(--nopal); content: "✓"; }
.steps .sec-label { margin-bottom: 14px; }

.cook-mode .main { max-width: 1100px; }
.cook-mode .steps li { font-size: 1.35rem; }
.cook-mode .ing-list li { font-size: 1.15rem; }

.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.comment:last-child { border-bottom: 0; }
.comment__body { flex: 1; }
.comment__meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.stars { color: var(--maiz); letter-spacing: 1px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 26px; color: #D5DAE6; cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--maiz); }

.avail-panel { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); margin: 16px 0; border: 1px solid var(--linea); background: var(--papel); }
.avail-panel p { margin: 0; }

/* ---------- Editor de receta ---------- */
.editor { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } }
.editor__aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.sec-block { border: 1.5px solid var(--linea); border-radius: var(--r); background: var(--papel); margin-bottom: 16px; overflow: hidden; }
.sec-block__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(90deg, var(--azulejo-50), var(--papel)); border-bottom: 1px solid var(--linea); }
.sec-block__head input { flex: 1; border: 0; background: transparent; font: 700 1.05rem var(--f-body); color: var(--azulejo); padding: 6px 4px; }
.sec-block__head input:focus { outline: none; border-bottom: 2px solid var(--azulejo); }
.sec-block__body { padding: 14px; display: grid; gap: 18px; }
.sec-block__body h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--tinta-3); }
.ing-row { display: grid; grid-template-columns: 22px 84px 104px minmax(0, 1fr) minmax(0, .8fr) auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.ing-row input, .ing-row select { padding: 9px 10px; border: 1.5px solid var(--linea); border-radius: 10px; font: inherit; font-size: 15px; background: var(--papel); width: 100%; min-width: 0; }
.ing-row input:focus, .ing-row select:focus { outline: none; border-color: var(--azulejo); }
.ing-row .drag { cursor: grab; color: var(--tinta-3); text-align: center; user-select: none; }
.ing-row .opt-toggle { font-size: 12px; display: flex; align-items: center; gap: 4px; color: var(--tinta-3); white-space: nowrap; }
@media (max-width: 720px) {
  .ing-row { grid-template-columns: 70px 90px 1fr auto; padding: 10px; border: 1px solid var(--linea); border-radius: 12px; }
  .ing-row .drag { display: none; }
  .ing-row .ac { grid-column: 1 / -1; order: -1; }
  .ing-row .note { grid-column: 1 / 3; }
}
.ac { position: relative; }
.ac__pick { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1.5px solid var(--nopal); background: var(--nopal-50); border-radius: 10px; font-weight: 600; min-height: 40px; cursor: pointer; }
.ac__pick.is-sub { border-color: var(--maiz); background: var(--maiz-50); }
.ac__pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac__menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; box-shadow: var(--sh-2); max-height: 280px; overflow-y: auto; padding: 6px; min-width: 240px; }
.ac__opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.ac__opt:hover, .ac__opt.is-hl { background: var(--azulejo-50); }
.ac__opt small { margin-left: auto; font-size: 12px; }
.ac__opt--new { color: var(--jitomate); font-weight: 700; border-top: 1px solid var(--linea); margin-top: 4px; }
.step-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; margin-bottom: 8px; }
.step-row .n { width: 30px; height: 30px; border-radius: 50%; background: var(--azulejo); color: #fff; display: grid; place-items: center; font: 500 13px var(--f-mono); margin-top: 6px; }
.step-row textarea { min-height: 56px; padding: 10px 12px; border: 1.5px solid var(--linea); border-radius: 10px; font: inherit; width: 100%; }
.step-row textarea:focus { outline: none; border-color: var(--azulejo); }
.add-line { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1.5px dashed #B9C3DD; color: var(--azulejo); padding: 8px 14px; border-radius: 999px; font: 600 14px var(--f-body); cursor: pointer; }
.add-line:hover { background: var(--azulejo-50); border-style: solid; }
.add-line .ico { width: 16px; height: 16px; }
.add-line--sub { border-color: #EACB7D; color: #8A6000; }
.add-line--sub:hover { background: var(--maiz-50); }
.gal-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.gal-edit label { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: block; cursor: pointer; }
.gal-edit img { width: 100%; height: 100%; object-fit: cover; }
.gal-edit input { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; accent-color: var(--jitomate); }
.gal-edit input:checked + img { opacity: .35; }

/* ---------- Disponibles ---------- */
.avcard { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: var(--papel); border: 1px solid var(--linea); border-radius: var(--r); padding: 12px; box-shadow: var(--sh-1); color: inherit; }
.avcard:hover { text-decoration: none; border-color: var(--azulejo); }
.avcard__pic { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--azulejo-50); }
.avcard__pic img { width: 100%; height: 100%; object-fit: cover; }
.avcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.avcard h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.1rem; color: var(--tinta); }
.avcard .missing { font-size: 13.5px; color: var(--tinta-2); margin-top: 6px; }
.avcard .missing b { color: var(--jitomate); font-weight: 600; }
.av-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 420px) { .av-grid { grid-template-columns: 1fr; } .avcard { grid-template-columns: 72px 1fr; } .avcard__pic { width: 72px; height: 72px; } }
.shop { background: var(--maiz-50); border: 1px solid #F1DDA4; border-radius: var(--r); padding: 18px; }
.shop h3 { display: flex; align-items: center; gap: 8px; }
.shop ul { list-style: none; padding: 0; margin: 10px 0 14px; }
.shop li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #EBD592; }
.shop li .num { margin-left: auto; }

/* ---------- Tips ---------- */
.tips { columns: 3 300px; column-gap: 16px; }
.tip { break-inside: avoid; margin-bottom: 16px; background: var(--papel); border-radius: var(--r); padding: 18px; border: 1px solid var(--linea); border-left: 6px solid var(--maiz); box-shadow: var(--sh-1); }
.tip h3 { margin-bottom: 6px; }
.tip p { color: var(--tinta-2); margin: 0; white-space: pre-line; }
.tip__foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; }
.tip__foot .actions { margin-left: auto; display: flex; }

/* ---------- Exportar ---------- */
.export-opts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.opt-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 2px solid var(--linea); border-radius: var(--r); background: var(--papel); cursor: pointer; }
.opt-card:has(input:checked) { border-color: var(--azulejo); background: var(--azulejo-50); }
.opt-card input { position: absolute; opacity: 0; }
.opt-card .big { font-size: 30px; }
.opt-card b { font-size: 1.05rem; }
.opt-panel { display: none; margin-top: 16px; }
.opt-panel.is-on { display: block; }

.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: var(--talavera) 0 0 / 72px 72px; position: relative; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(29,63,143,.5)); }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-form .card { width: min(420px, 100%); padding: 32px; }
@media (max-width: 820px) { .login-wrap { grid-template-columns: 1fr; grid-template-rows: 120px 1fr; } }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 160px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 32px; } .mb { margin-bottom: 16px; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--maiz-50); color: #8A6000; font-size: 13px; font-weight: 600; }

/* ---------- Equipo y utensilios ---------- */
.eqcard { gap: 12px; }
.eqcard:hover { transform: none; }
.eqcard.is-missing { border-style: dashed; background: #FAFBFD; box-shadow: none; }
.eqcard.is-missing .icard__pic { filter: grayscale(1); opacity: .55; }
.eqcard.is-missing .icard__name { color: var(--tinta-3); }
.switch { position: relative; flex: none; width: 46px; height: 26px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #D5DAE6; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--nopal); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--maiz); outline-offset: 2px; }
.switch input:disabled { cursor: default; }

/* Chips de equipo (receta y editor) */
.eq-list { display: flex; flex-wrap: wrap; gap: 8px; }
.eqchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--azulejo-50); color: var(--tinta); font-size: 14px; font-weight: 600; border: 1.5px solid transparent; text-decoration: none !important; }
.eqchip .e { font-size: 17px; line-height: 1; }
.eqchip small { font-weight: 500; }
.eqchip--no { background: var(--jitomate-50); border-color: #F2C4BA; color: #9C2E1A; }
.eqchip--opt { background: var(--papel); border: 1.5px dashed var(--linea); color: var(--tinta-2); }
a.eqchip:hover { border-color: var(--azulejo); }
.eq-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.eq-pick button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 9px; border-radius: 999px; border: 1.5px solid var(--linea); background: var(--papel); color: var(--tinta-2); font: 600 14px var(--f-body); cursor: pointer; }
.eq-pick button:hover { border-color: var(--azulejo); color: var(--azulejo); }
.eq-pick button[data-state="1"] { background: var(--azulejo); border-color: var(--azulejo); color: #fff; }
.eq-pick button[data-state="opt"] { background: var(--maiz-50); border: 1.5px dashed #D9A21B; color: #8A6000; }
.eq-pick button[data-state="opt"]::after { content: "opcional"; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.eq-pick button.is-hidden { display: none; }
.eq-warn { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: #9C2E1A; margin-top: 6px; }
