/* Diseño "taller de cocina": estructura Apple (títulos grandes, tarjetas, barra inferior de cristal líquido)
   con toques de madera de nogal oscuro (botones, selectores, barra opcional), papel cálido para leer,
   latón de remate y líneas hechas a mano. Letra: la del sistema Apple (o cursiva, a elegir en Despensa > Apariencia).
   iPhone: una columna. Mac (>=1000px): tres columnas. En ambos, la barra de navegación va abajo. */
:root {
  --bg: #f2e8d6; --surface: #fbf4e6; --ink: #2f2218; --muted: #6a5640; --line: rgba(70, 45, 20, .17);
  --accent: #7a2330; --on-accent: #ffffff; --accent-soft: rgba(122, 35, 48, .09);
  --ok: #4d6e3a; --warn: #855410; --bad: #a8352b;
  --wood-0: #24160d; --wood-1: #3a2516; --brass: #d4a24f; --on-wood: #f7ecd8; --on-wood-2: #d9c4a0;
  --doodle: #5a2f1c;
  --tint-1: #f1d9b5; --tint-2: #f0cdc0; --tint-3: #dfe3c4; --tint-4: #d6dfe3; --tint-5: #ecd7e0;
  --pill: rgba(255, 250, 240, .72);
  --shadow: 0 1px 2px rgba(60, 35, 12, .1), 0 14px 28px -12px rgba(60, 35, 12, .32);
  --r-card: 26px 22px 25px 23px;       /* esquinas de "recortado a mano": una sola escala, ligeramente irregular */
  --r-field: 14px;
  --ease: cubic-bezier(.32, .72, 0, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --font-script: "Snell Roundhand", "Apple Chancery", "Zapfino", cursive;
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .25  0 0 0 0 .17  0 0 0 0 .08  0 0 0 .42 -.16'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --linen: repeating-linear-gradient(0deg, rgba(90, 60, 30, .03) 0 1px, transparent 1px 3px),
           repeating-linear-gradient(90deg, rgba(90, 60, 30, .025) 0 1px, transparent 1px 3px);
  --washi: repeating-linear-gradient(90deg, rgba(255, 255, 255, .3) 0 5px, transparent 5px 10px);
  /* Nogal: anillos y nudos sacados de las curvas de nivel de un ruido estirado (referencia: tablón de nogal oscuro) */
  --veta: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='700' height='300'><filter id='w' x='0' y='0' width='100%' height='100%' color-interpolation-filters='sRGB'><feTurbulence type='fractalNoise' baseFrequency='.0016 .0085' numOctaves='5' seed='12' stitchTiles='stitch' result='n'/><feColorMatrix in='n' type='matrix' values='1 0 0 0 0  1 0 0 0 0  1 0 0 0 0  0 0 0 0 1' result='g'/><feComponentTransfer in='g' result='s'><feFuncR type='linear' slope='2' intercept='-.5'/><feFuncG type='linear' slope='2' intercept='-.5'/><feFuncB type='linear' slope='2' intercept='-.5'/></feComponentTransfer><feComponentTransfer in='s' result='rings'><feFuncR type='discrete' tableValues='1 1 1 1 1 .55 1 1 1 1 .62 1 1 1 1 1 1 .55 1 1 1 1 .62 1 1 1 1 1 1 .55 1 1 1 1 .62 1'/><feFuncG type='discrete' tableValues='1 1 1 1 1 .55 1 1 1 1 .62 1 1 1 1 1 1 .55 1 1 1 1 .62 1 1 1 1 1 1 .55 1 1 1 1 .62 1'/><feFuncB type='discrete' tableValues='1 1 1 1 1 .55 1 1 1 1 .62 1 1 1 1 1 1 .55 1 1 1 1 .62 1 1 1 1 1 1 .55 1 1 1 1 .62 1'/></feComponentTransfer><feComponentTransfer in='s' result='tone'><feFuncR type='table' tableValues='.13 .24 .40 .29'/><feFuncG type='table' tableValues='.06 .11 .19 .13'/><feFuncB type='table' tableValues='.035 .06 .10 .07'/></feComponentTransfer><feTurbulence type='fractalNoise' baseFrequency='.004 .05' numOctaves='2' seed='3' stitchTiles='stitch' result='p'/><feColorMatrix in='p' type='matrix' values='0 0 0 0 .55  0 0 0 0 .5  0 0 0 0 .45  0 0 0 -1.1 1.05' result='pores'/><feBlend in='tone' in2='rings' mode='multiply' result='m'/><feBlend in='pores' in2='m' mode='multiply'/></filter><rect width='100%' height='100%' filter='url(%23w)'/></svg>");
  --barniz: linear-gradient(180deg, rgba(255, 214, 160, .13), rgba(255, 214, 160, 0) 42%, rgba(0, 0, 0, .22));
  /* Líneas rectas "a mano": casi rectas, con pulso */
  --ln-h1: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'><path d='M3 4.2 C30 3.3 58 5 95 4 S170 3 205 4.4 S265 4 297 3.6' fill='none' stroke='%23463018' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-h2: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'><path d='M2 3.8 C45 4.8 80 3 125 4.1 S200 5 240 3.7 S280 4.3 298 4.6' fill='none' stroke='%23463018' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-h3: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'><path d='M4 4.5 C38 3.6 70 3.9 110 4.7 S185 3.4 228 4.2 S272 4.9 296 3.9' fill='none' stroke='%23463018' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>");
  --ln-v1: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 400' preserveAspectRatio='none'><path d='M4.3 2 C3.5 70 5 130 4 200 S3.2 330 4.5 398' fill='none' stroke='%23463018' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-v2: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 400' preserveAspectRatio='none'><path d='M3.8 3 C4.8 80 3.3 150 4.2 210 S5 340 3.7 397' fill='none' stroke='%23463018' stroke-opacity='0.4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>");
  --ln-frame: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 140' preserveAspectRatio='none'><path d='M9 8 C80 5 150 9 291 6 C294 50 291 90 292 133 C210 136 110 132 7 134 C5 90 9 50 9 8 Z' fill='none' stroke='%23463018' stroke-opacity='0.34' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-brass: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'><path d='M2 4.5 C22 2.4 40 6.4 62 3.8 S102 5.6 128 3.2 S172 5.4 198 3.9' fill='none' stroke='%23b88a3a' stroke-opacity='0.8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>");
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #19120d; --surface: #261c14; --ink: #f3e8d4; --muted: #bfa98a; --line: rgba(240, 225, 200, .15);
    --accent: #e8a0a8; --on-accent: #1f1a15; --accent-soft: rgba(232, 160, 168, .13);
    --ok: #9cc28a; --warn: #e0b060; --bad: #f09a8c;
    --wood-0: #2a1a10; --wood-1: #4a3220; --doodle: #f0d9b8; --pill: rgba(60, 46, 36, .72);
    --tint-1: #4a3a24; --tint-2: #4d302a; --tint-3: #343a26; --tint-4: #2b3a42; --tint-5: #43303a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 28px -12px rgba(0, 0, 0, .65);
    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .93  0 0 0 0 .82  0 0 0 .26 -.1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    --linen: repeating-linear-gradient(0deg, rgba(255, 235, 205, .03) 0 1px, transparent 1px 3px),
             repeating-linear-gradient(90deg, rgba(255, 235, 205, .025) 0 1px, transparent 1px 3px);
    --ln-h1: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'><path d='M3 4.2 C30 3.3 58 5 95 4 S170 3 205 4.4 S265 4 297 3.6' fill='none' stroke='%23f0e1c8' stroke-opacity='0.34' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-h2: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'><path d='M2 3.8 C45 4.8 80 3 125 4.1 S200 5 240 3.7 S280 4.3 298 4.6' fill='none' stroke='%23f0e1c8' stroke-opacity='0.34' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-h3: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'><path d='M4 4.5 C38 3.6 70 3.9 110 4.7 S185 3.4 228 4.2 S272 4.9 296 3.9' fill='none' stroke='%23f0e1c8' stroke-opacity='0.34' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>");
    --ln-v1: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 400' preserveAspectRatio='none'><path d='M4.3 2 C3.5 70 5 130 4 200 S3.2 330 4.5 398' fill='none' stroke='%23f0e1c8' stroke-opacity='0.34' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-v2: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 400' preserveAspectRatio='none'><path d='M3.8 3 C4.8 80 3.3 150 4.2 210 S5 340 3.7 397' fill='none' stroke='%23f0e1c8' stroke-opacity='0.34' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); --ln-frame: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 140' preserveAspectRatio='none'><path d='M9 8 C80 5 150 9 291 6 C294 50 291 90 292 133 C210 136 110 132 7 134 C5 90 9 50 9 8 Z' fill='none' stroke='%23f0e1c8' stroke-opacity='0.3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' vector-effect='non-scaling-stroke'/></svg>"); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background-color: var(--bg); background-image: var(--grain); background-size: 220px 220px; min-height: 100%; }
body { margin: 0; color: var(--ink); font: 17px/1.4 var(--font); -webkit-text-size-adjust: 100%; min-height: 100vh;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
main { max-width: 640px; margin: 0 auto; padding-bottom: calc(130px + env(safe-area-inset-bottom)); }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; transition: transform .4s var(--spring), opacity .2s, box-shadow .3s; }
button:active { transform: scale(.96); opacity: .75; }
.hand { font-style: italic; font-weight: 500; }

/* ---------- Madera ---------- */
.wood-bg { background-color: var(--wood-1); background-image: var(--barniz), var(--veta); background-size: 100% 100%, 700px 300px; color: var(--on-wood); }

/* ---------- Papel ---------- */
.paper { background-color: var(--surface); background-image: var(--linen), var(--grain); background-size: auto, 220px 220px;
  border-radius: var(--r-card); box-shadow: var(--shadow); border: 1px solid var(--line); }
/* Marco "cosido": un rectángulo dibujado a mano, no un borde perfecto */
.stitch { position: relative; }
.stitch::after { content: ""; position: absolute; inset: 6px; background: var(--ln-frame) center / 100% 100% no-repeat; pointer-events: none; }

/* ---------- Cabecera de página (sin banner: título sobre el papel) ---------- */
.phead { position: relative; padding-top: env(safe-area-inset-top); }
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 0; min-height: 56px; }
.nav-side { display: flex; gap: 8px; }
.nav-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 42px; padding: 0 16px; border-radius: 99px; font-size: 15px; font-weight: 600;
  background: var(--pill); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(60, 35, 12, .12);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%); }
.nav-btn svg { width: 10px; height: 17px; }
.nav-btn.bold, .nav-btn.round { color: var(--on-wood); border-color: transparent; background-color: var(--wood-1); background-image: var(--barniz), var(--veta);
  background-size: 100% 100%, 700px 300px; box-shadow: 0 2px 0 var(--brass), 0 6px 14px -6px rgba(40, 20, 5, .6); }
.nav-btn.round svg { width: 22px; height: 22px; }
.nav-btn.round { width: 46px; padding: 0; justify-content: center; }
h1.large { font: 700 34px/1.08 var(--font-display); letter-spacing: -.028em; margin: 6px 20px 4px; text-wrap: balance; }
.kicker { margin: 10px 22px 0; font-size: 17px; color: var(--accent); }
.subtitle { margin: 0 20px 14px; color: var(--muted); font-size: 15px; }
.mascota { position: absolute; right: 20px; top: calc(env(safe-area-inset-top) + 56px); width: 58px; height: 58px; color: var(--accent); }
.mascota svg { width: 100%; height: 100%; }
.hero { position: relative; display: block; width: 112px; height: 112px; margin: 14px 22px 0; padding: 0; color: var(--doodle);
  background-size: cover; background-position: center; overflow: hidden; transform: rotate(-2deg); }
.hero.paper { display: grid; place-items: center; }
.hero svg { width: 74%; height: 74%; }
.hero .edit { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background-color: var(--wood-1); color: var(--on-wood); font-size: 13px; }
.hero.has-photo { border: 5px solid var(--surface); border-bottom-width: 14px; border-radius: 6px; }

/* ---------- Secciones ---------- */
.group-title { display: flex; align-items: center; gap: 10px; margin: 30px 22px 10px; font: 700 21px/1.2 var(--font-display); letter-spacing: -.015em; color: var(--ink); }
.group-title::after { content: ""; flex: 1; height: 8px; margin-top: 6px; background: var(--ln-brass) center / 100% 100% no-repeat; }
.group-foot { margin: 10px 24px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.group { margin: 0 16px; padding: 6px 4px; }
.group, .card { background-color: var(--surface); background-image: var(--linen), var(--grain); background-size: auto, 220px 220px;
  border-radius: var(--r-card); box-shadow: var(--shadow); border: 1px solid var(--line); }
.cell { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; text-align: left;
  min-height: 52px; padding: 13px 18px; position: relative; }
/* Separadores: rayas rectas hechas a mano, cada una un poco distinta */
.cell + .cell::before, .cook + .cook::before, .recent + .recent::before { content: ""; position: absolute; top: -4px; left: 16px; right: 16px; height: 8px;
  background: var(--ln-h1) center / 100% 100% no-repeat; pointer-events: none; }
.cell:nth-child(2n) + .cell::before, .cook:nth-child(2n) + .cook::before, .recent:nth-child(2n) + .recent::before { background-image: var(--ln-h2); }
.cell:nth-child(3n) + .cell::before { background-image: var(--ln-h3); }
.cook, .recent { position: relative; }
.cell .main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cell .sub { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; }
.cell .detail { color: var(--muted); max-width: 40%; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.cell .chev { display: none; }
.cell.col { flex-direction: column; align-items: stretch; gap: 6px; }
.cell.action { color: var(--accent); font-weight: 600; justify-content: flex-start; }
.cell.danger { color: var(--bad); font-weight: 600; }
.cell .lead { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #fff; }
.lead.ok { background: var(--ok); } .lead.swap { background: var(--accent); color: var(--on-accent); }
.lead.no { background: var(--bad); } .lead.q { background: var(--warn); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .muted { color: var(--muted); }
.label { flex: none; white-space: nowrap; }
.lab { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Recetas: biblioteca visual (buscador, colecciones y rejilla de portadas) ---------- */
.buscador { position: relative; display: block; margin: 4px 16px 0; color: var(--muted); }
.buscador svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; pointer-events: none; }
.buscador .field { padding: 12px 44px 12px 42px; -webkit-appearance: none; appearance: none; }
.buscador .field::-webkit-search-cancel-button, .buscador .field::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.buscador .borrar { position: absolute; right: 4px; top: 50%; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); }
/* Colecciones: una fila que se desplaza por dentro (la página nunca se va hacia los lados) */
.colecciones { display: flex; gap: 8px; margin: 11px 0 0; padding: 3px 16px 8px; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.colecciones::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 99px; font-size: 15px; font-weight: 600;
  white-space: nowrap; color: var(--ink); background: var(--pill); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(60, 35, 12, .1); position: relative; }
.chip::after { content: ""; position: absolute; inset: -4px 0; } /* se toca en 44 px de alto aunque mida 38 */
.chip span { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on { color: var(--on-wood); border-color: transparent; background-color: var(--wood-1); background-image: var(--barniz), var(--veta);
  background-size: 100% 100%, 700px 300px; box-shadow: 0 2px 0 var(--brass), 0 4px 10px -4px rgba(40, 20, 5, .5); }
.chip.on span { color: var(--on-wood-2); }
/* Rejilla: 2 columnas en iPhone; foto grande (o el dibujo) y el título debajo */
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; margin: 16px 16px 0; }
.portada { position: relative; display: block; align-self: start; min-width: 0; text-align: left; content-visibility: auto; contain-intrinsic-size: auto 250px; }
.foto { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; color: var(--doodle);
  border-radius: var(--r-card); background-color: var(--tint-1); background-size: cover; background-position: center; box-shadow: var(--shadow);
  transition: transform .5s var(--spring); }
.portada:nth-child(5n+2) .foto { background-color: var(--tint-2); } .portada:nth-child(5n+3) .foto { background-color: var(--tint-3); }
.portada:nth-child(5n+4) .foto { background-color: var(--tint-4); } .portada:nth-child(5n) .foto { background-color: var(--tint-5); }
.foto svg { width: 58%; height: 58%; }
.portada strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: 9px 4px 0;
  font: 600 16px/1.25 var(--font-display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.falta-1 { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--warn);
  background: var(--pill); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@media (hover: hover) { .portada:hover .foto { transform: rotate(-1.2deg) scale(1.02); } }
.portada.on .foto { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.portada.on strong { color: var(--accent); }
.sin-res { grid-column: 1 / -1; padding: 28px 16px; }
.sin-res .btn { margin: 4px auto 0; max-width: 260px; }
/* Miniaturas (Inicio: «Hoy puedes cocinar») */
.art { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px 18px 24px 19px; background: var(--tint-1); color: var(--doodle);
  background-size: cover; background-position: center; transition: transform .5s var(--spring); }
.art svg { width: 82%; height: 82%; }
.art.mini { flex: none; width: 48px; height: 48px; border-radius: 14px 12px 15px 13px; }
.card.hoy .cook { justify-content: flex-start; }
.card.hoy .cook > span:not(.art) { flex: 1; min-width: 0; }
.card.hoy .cook strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.card.hoy .cook:nth-child(5n+2) .art { background-color: var(--tint-2); } .card.hoy .cook:nth-child(5n+3) .art { background-color: var(--tint-3); }
.card.hoy .cook:nth-child(5n+4) .art { background-color: var(--tint-4); } .card.hoy .cook:nth-child(5n) .art { background-color: var(--tint-5); }
.cook.ver-col strong { color: var(--accent); font-size: 15px; }
/* Hoja «Imagen de la receta»: la foto entera */
.foto-entera { display: block; max-width: 100%; max-height: 38vh; margin: 0 auto 4px; border: 6px solid var(--surface); border-bottom-width: 16px;
  border-radius: 4px; box-shadow: var(--shadow); object-fit: contain; }

/* Control segmentado: pista de nogal, pieza de papel */
.segmented { display: flex; margin: 16px 16px 0; padding: 4px; border-radius: 99px; color: var(--on-wood);
  background-color: var(--wood-1); background-image: var(--barniz), var(--veta); background-size: 100% 100%, 700px 300px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); }
.segmented button { flex: 1; padding: 8px 4px; font-size: 14px; font-weight: 600; color: var(--on-wood-2); border-radius: 99px; min-height: 38px; position: relative; }
.segmented button::after { content: ""; position: absolute; inset: -3px 0; } /* 44 px de toque, dentro de la pista */
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.segmented.inline { margin: 0; width: 100%; }

/* Campos */
.field { width: 100%; background: var(--accent-soft); border: 0; outline: 0; border-radius: var(--r-field); padding: 12px 14px; min-height: 46px; font-size: 17px; }
.field:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.field::placeholder { color: var(--muted); opacity: .7; }
textarea.field { resize: none; min-height: 84px; line-height: 1.35; }
select.field { appearance: none; -webkit-appearance: none; text-align: left; color: var(--ink); width: 100%; }
.pair { display: flex; gap: 10px; width: 100%; }
.pair > * { flex: 1; min-width: 0; }
.pair > *:last-child { max-width: 120px; }
.cell .field.inline { width: auto; flex: 1; text-align: right; background: none; padding: 0; min-height: 24px; color: var(--muted); }
.cell-btn { position: relative; color: var(--bad); font-weight: 600; font-size: 15px; padding: 8px 4px; }
.cell-btn::after { content: ""; position: absolute; inset: -4px -2px; } /* 44 px de toque aunque mida 37 (Revisar, Descartar, Revocar) */
.aviso .cell-btn::after, .aviso-sync .cell-btn::after, .pie-hoja .cell-btn::after { content: none; } /* estos ya miden 44 */

/* Botón principal: cartel de nogal con filo de latón */
.btn { display: block; width: calc(100% - 32px); margin: 26px 16px 0; min-height: 56px; border-radius: 99px; color: var(--on-wood); font-weight: 700; font-size: 17px; text-align: center;
  background-color: var(--wood-1); background-image: var(--barniz), var(--veta); background-size: 100% 100%, 700px 300px;
  box-shadow: 0 3px 0 var(--brass), var(--shadow); }
.btn.soft { background: var(--accent-soft); color: var(--accent); box-shadow: none; margin-top: 12px; }
.btn:disabled { opacity: .4; box-shadow: none; }

.stepper { display: inline-flex; align-items: center; gap: 12px; }
.stepper b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-size: 18px; }
.stepper button { width: 44px; height: 44px; margin: -4px; padding: 4px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--accent);
  background: var(--accent-soft) content-box; } /* se ve de 36 px y se toca en 44 */

/* Interruptor */
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 99px;
  background: var(--line); position: relative; transition: background .3s var(--ease); cursor: pointer; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(50, 30, 10, .35); transition: transform .4s var(--spring); }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }

/* Historial */
.version-head { display: flex; justify-content: space-between; align-items: baseline; margin: 28px 22px 10px; }
.version-head strong { font: 700 21px/1.2 var(--font-display); letter-spacing: -.015em; }
.version-head span { color: var(--muted); font-size: 13px; }
.diff-add { color: var(--ok); font-weight: 600; } .diff-del { color: var(--bad); text-decoration: line-through; }

/* Una palabra enorme (un enlace, ruido de un ticket) se parte: nunca empuja la pantalla hacia los lados */
main, .sheet, .aviso-sync { overflow-wrap: anywhere; }
.recent > small { flex: none; }

/* Aviso de un cambio que no se pudo guardar: encima de la barra, hasta que se toca */
.aviso-sync { display: grid; gap: 4px; padding: 12px 16px; text-align: left; color: var(--bad); font-size: 15px; font-weight: 600; line-height: 1.35;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); }
.aviso-sync p { margin: 0; }
.aviso-sync .cell-btn { justify-self: end; padding: 12px 8px; margin: -8px -4px; }
.nologin .aviso-sync { display: none; }
/* Avisos encima de la barra, apilados: el de sincronización y el breve («Guardada: X», «2 recetas nuevas») */
.pila-avisos { position: fixed; left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 20; display: grid; gap: 8px;
  max-width: 480px; margin: 0 auto; pointer-events: none; }
.pila-avisos > * { pointer-events: auto; }
.nologin .pila-avisos { display: none; }
.aviso { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-radius: var(--r-card);
  color: var(--on-wood); font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere;
  background-color: var(--wood-1); background-image: var(--barniz), var(--veta); background-size: 100% 100%, 700px 300px;
  box-shadow: 0 2px 0 var(--brass), var(--shadow); animation: up .45s var(--spring) both; }
.aviso p { margin: 0; min-width: 0; }
.aviso .cell-btn.accion { flex: none; color: var(--brass); padding: 12px 8px; margin: -6px -6px; }
.aviso.bad { box-shadow: 0 2px 0 var(--bad), var(--shadow); }

/* ---------- Dashboard ---------- */
.board { columns: 2; column-gap: 14px; margin: 14px 16px 0; }
.polaroid { position: relative; display: block; width: 100%; margin: 0 0 16px; padding: 8px 8px 26px; break-inside: avoid; text-align: left;
  background: var(--surface); border-radius: 4px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.polaroid:nth-child(3n+1) { transform: rotate(-1.8deg); } .polaroid:nth-child(3n+2) { transform: rotate(1.4deg); } .polaroid:nth-child(3n) { transform: rotate(-.6deg); }
.polaroid:hover { transform: rotate(0) scale(1.03); z-index: 2; }
.polaroid .img { display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 2px; background-size: cover; background-position: center; background-color: var(--tint-1); }
.polaroid:nth-child(even) .img { aspect-ratio: 1; }
.polaroid::before, .note::before { content: ""; position: absolute; top: -9px; left: 50%; width: 62px; height: 20px; margin-left: -31px; transform: rotate(-3deg);
  background: var(--washi), color-mix(in srgb, var(--accent) 42%, transparent); opacity: .85; }
.add-photo { display: grid; place-items: center; gap: 6px; width: calc(100% - 32px); margin: 14px 16px 0; padding: 28px 18px; text-align: center; color: var(--muted);
  background: var(--ln-frame) center / 100% 100% no-repeat; }
.add-photo b { color: var(--accent); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 16px 0; }
.stat { padding: 14px 8px; text-align: center; }
.stat:nth-child(1) { transform: rotate(-1.2deg); } .stat:nth-child(2) { transform: rotate(.8deg); } .stat:nth-child(3) { transform: rotate(-.5deg); }
.stat b { display: block; font: 700 30px/1 var(--font-display); letter-spacing: -.03em; color: var(--accent); }
.stat span { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.card { margin: 0 16px; padding: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.cook { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 0; text-align: left; }
.cook small { display: block; font-size: 13px; }
.cook .chev { width: 8px; height: 14px; color: var(--muted); flex: none; }
.card.cook { display: flex; }
.cook:hover strong { color: var(--accent); }
.note { position: relative; margin: 0 16px; padding: 22px 22px 18px; transform: rotate(.6deg); background-color: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.note textarea { width: 100%; min-height: 120px; resize: none; border: 0; outline: 0; background: none; font: italic 500 19px/1.5 var(--font); color: var(--ink); }
.note textarea::placeholder { color: var(--muted); opacity: .7; }
.tip { position: relative; margin: 0 16px; padding: 20px 22px; transform: rotate(-.8deg); background: color-mix(in srgb, var(--brass) 26%, var(--surface)); }
.tip p { margin: 0; font: italic 500 18px/1.45 var(--font); color: var(--ink); }
.tip::before { content: ""; position: absolute; top: -9px; right: 28px; width: 56px; height: 18px; transform: rotate(5deg); background: var(--washi), color-mix(in srgb, var(--accent) 42%, transparent); opacity: .85; }
.recent { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; text-align: left; }
.recent small { display: block; color: var(--muted); font-size: 13px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* Hojas y visor */
.overlay { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(30, 18, 8, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s var(--ease) both; }
.sheet { max-width: 640px; width: 100%; margin: 0 auto; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0;
  background-color: var(--surface); background-image: var(--linen), var(--grain); background-size: auto, 220px 220px; animation: up .45s var(--spring) both; }
.sheet h2 { margin: 0 0 14px 6px; font: 700 22px/1.2 var(--font-display); letter-spacing: -.02em; }
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 4px; }
.picker button { display: grid; place-items: center; aspect-ratio: 1; border-radius: 18px 16px 19px 17px; color: var(--doodle); background: var(--tint-1); border: 2px solid transparent; }
.picker button:nth-child(4n+2) { background: var(--tint-2); } .picker button:nth-child(4n+3) { background: var(--tint-3); } .picker button:nth-child(4n) { background: var(--tint-4); }
.picker button.on { border-color: var(--accent); }
.picker svg { width: 80%; height: 80%; }
.sheet .btn { width: 100%; margin: 12px 0 0; }
.sheet.alta { max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 4px 0; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 72px; height: 72px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px 12px 15px 13px; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.thumb button { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; line-height: 1;
  color: var(--on-wood); background: var(--wood-1); box-shadow: var(--shadow); }
.viewer { justify-content: center; align-items: center; padding: 20px; gap: 16px; }
.viewer .photo { max-width: 100%; max-height: 70vh; border: 8px solid var(--surface); border-bottom-width: 22px; border-radius: 4px; box-shadow: var(--shadow); }
.viewer .row { display: flex; gap: 10px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Barra inferior: cristal líquido (por defecto) o madera ---------- */
.tabbar { --lx: 0px; --lw: 0px; position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 99px; isolation: isolate; color: var(--muted);
  background: linear-gradient(135deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .14) 55%, rgba(255, 255, 255, .34));
  -webkit-backdrop-filter: blur(16px) saturate(190%) brightness(1.04); backdrop-filter: blur(16px) saturate(190%) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .95), inset 0 -1.5px 1px rgba(255, 255, 255, .3), inset 0 0 22px rgba(255, 255, 255, .25),
    0 16px 36px -10px rgba(40, 22, 8, .42), 0 2px 6px rgba(40, 22, 8, .14); }
@media (prefers-color-scheme: dark) {
  .tabbar { color: var(--muted); background: linear-gradient(135deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .05) 55%, rgba(255, 255, 255, .12));
    border-color: rgba(255, 255, 255, .22);
    box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .35), inset 0 -1.5px 1px rgba(255, 255, 255, .08), inset 0 0 22px rgba(255, 255, 255, .06),
      0 16px 36px -10px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .3); }
}
.tabbar .lens { position: absolute; z-index: -1; top: 6px; bottom: 6px; left: 0; width: var(--lw); transform: translateX(var(--lx)); border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .34));
  box-shadow: inset 0 1px 1px #fff, inset 0 -1px 2px rgba(255, 255, 255, .5), 0 4px 14px rgba(40, 22, 8, .22), 0 0 0 1px rgba(255, 255, 255, .5); }
.tabbar.ready .lens { transition: transform .6s var(--spring), width .6s var(--spring); }
@media (prefers-color-scheme: dark) {
  .tabbar .lens { background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .1));
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5), 0 4px 14px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .22); }
}
.tabbar button { display: flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 48px; border-radius: 99px; font-size: 15px; font-weight: 600; color: inherit; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button span { display: none; }
.tabbar button.active { color: var(--accent); padding: 0 20px; }
.tabbar button.active span { display: inline; }
.tabbar .bar-end { display: none; }
.bar-new { width: 44px; justify-content: center; padding: 0; font-size: 26px; font-weight: 400; line-height: 1; }
.nologin .tabbar { display: none; }
@media (max-width: 999px) { .immersive .tabbar { display: none; } }

/* Variante madera de la barra */
html[data-barra="madera"] .tabbar { color: var(--on-wood-2); border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  background-color: var(--wood-1); background-image: var(--barniz), var(--veta); background-size: 100% 100%, 700px 300px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, .2), 0 0 0 2px var(--brass), var(--shadow); }
html[data-barra="madera"] .tabbar .lens { background: var(--brass); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
html[data-barra="madera"] .tabbar button.active { color: var(--wood-0); }

/* ---------- Despensa con cantidades y tickets ---------- */
.cell button.main { text-align: left; overflow-wrap: anywhere; padding: 10px 0; margin: -10px 0; } /* toque de 44 px en la fila */
.cell .sub.ok { color: var(--ok); } .cell .sub.warn { color: var(--warn); } .cell .sub.bad { color: var(--bad); } /* caducidad y avisos con su color */
.stepper.qty { gap: 8px; flex: none; }
.stepper.qty b { min-width: 64px; font-size: 15px; font-weight: 600; }
.stepper button:disabled { opacity: .35; }
.acciones { display: flex; gap: 12px; flex: none; }
.cell-btn.accion { color: var(--accent); }
.cell-btn:disabled { opacity: .4; }
.tk-fila .pair > *:last-child { max-width: 150px; }
.tk-fila.ignorada .field { opacity: .45; }
.tk-opts { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.tk-op { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); cursor: pointer; }
.casilla { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
input[type="date"].field { -webkit-appearance: none; appearance: none; display: block; }
.pair > .nav-btn { flex: none; max-width: none; } /* «Sin fecha» junto a la fecha */
.segmented.auto button { flex: auto; } /* el ancho de cada opción, según su texto */

/* ---------- Lista de la compra ---------- */
.marca { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -8px -10px -12px; cursor: pointer; } /* casilla fácil de tocar */
.compra-fila.hecho .main { color: var(--muted); text-decoration: line-through; }
.compra-fila.hecho .detail { opacity: .6; }
.pick { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.cell:disabled { opacity: .4; }
/* Texto que llegó con el borrador (Atajo o pegado) */
details.texto-origen { margin-top: 10px; font-size: 14px; color: var(--muted); }
details.texto-origen summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.texto-origen p { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; }
/* Ajustes: «Códigos anteriores» plegado bajo «Conectar con Instagram» */
details.codigos-ant { margin-top: 14px; }
details.codigos-ant > summary { margin: -12px 24px -2px; padding: 12px 0; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; }
/* Ingrediente: «Más (opcional)» plegado (importancia, función y sustitutos) */
details.ing-mas > summary { margin: -12px 0; padding: 12px 0; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 15px; }
details.ing-mas[open] > summary { margin-bottom: 0; }
/* «Ver el reel» / «Ver el original»: se toca en 44 px de alto sin mover el texto (ni tapar el botón de debajo, a 14 px) */
.ver-orig { display: inline-block; line-height: 20px; padding: 10px 8px 14px; margin: -10px -8px -14px; color: var(--accent); font-weight: 600; }
/* El + también en el iPhone: al final de la barra, con las pestañas algo más juntas para que quepa */
@media (max-width: 999px) {
  .tabbar button { padding: 0 12px; }
  .tabbar button.active { padding: 0 16px; }
  .tabbar .bar-end { display: flex; align-items: center; margin-left: 2px; }
  .tabbar .bar-new { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; color: var(--on-accent); background: var(--accent); box-shadow: 0 2px 8px rgba(40, 22, 8, .3); }
  html[data-barra="madera"] .tabbar .bar-new { background: var(--brass); color: var(--wood-0); }
}
@media (max-width: 360px) { .tabbar button { padding: 0 9px; } .tabbar button.active { padding: 0 12px; } .tabbar .bar-new { width: 40px; min-height: 40px; } } /* móviles estrechos */

/* ---------- Por revisar: solo lo dudoso, marcado ---------- */
.revisa + .revisa { margin-top: 12px; }
.card .btn { width: 100%; margin: 12px 0 0; }
.card p + .btn, .card .cook + .btn { margin-top: 14px; }
.cell.duda { border-radius: 14px; background: color-mix(in srgb, var(--warn) 9%, transparent); }
.field.cant { flex: none; width: 112px; min-height: 40px; padding: 8px 12px; text-align: right; }
.card p.texto-plano { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
/* Pie de la hoja «Añadir»: «Escribirla yo», discreto, y «Cancelar» */
.pie-hoja { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 4px 0; }
.pie-hoja .cell-btn { color: var(--muted); padding: 12px 6px; margin: -4px -2px; } /* 44 px de toque */
.pie-hoja .cell-btn.accion { color: var(--accent); }
/* Mac: campo oculto que recibe ⌘V fuera de un campo, y aviso sobrio al arrastrar algo encima */
.trampa { position: fixed; top: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; resize: none; pointer-events: none; font-size: 16px; }
.soltar { position: fixed; inset: 12px; z-index: 40; display: grid; place-items: center; pointer-events: none; border-radius: var(--r-card);
  background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.soltar::after { content: ""; position: absolute; inset: 10px; background: var(--ln-frame) center / 100% 100% no-repeat; }
.soltar p { margin: 0; font: 700 21px/1.2 var(--font-display); letter-spacing: -.015em; color: var(--ink); }

.empty { display: grid; justify-items: center; gap: 14px; text-align: center; color: var(--muted); padding: 44px 32px; text-wrap: balance; }
.empty svg { width: 104px; height: 104px; color: var(--doodle); }

/* ---------- Vida: dibujos que se mueven ---------- */
.vapor { animation: vapor 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes vapor { 0%, 100% { transform: translateY(1px) scaleY(.9); opacity: .45; } 50% { transform: translateY(-3px) scaleY(1.08); opacity: 1; } }
.boil .d1 { filter: url(#lapiz-b); } .boil .d2 { filter: url(#lapiz2-b); }
.cook:hover .art { transform: rotate(-6deg) scale(1.08); }
.mascota svg { animation: balanceo 5s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes balanceo { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: no-preference) {
  main.entra > *, main.entra .cols > .colwrap { animation: rise .6s var(--ease) both; } /* solo al cambiar de pantalla */
  main.entra .cols > .colwrap:nth-child(2) { animation-delay: .07s; } main.entra .cols > .colwrap:nth-child(3) { animation-delay: .14s; }
  @keyframes rise { from { opacity: 0; translate: 0 10px; } } /* sin «to»: al acabar vale la opacidad propia (p. ej. la de un botón desactivado) */
}
@media (prefers-reduced-motion: reduce) { .vapor, .mascota svg { animation: none; } }

/* ---------- Letra cursiva (opción en Despensa > Apariencia) ---------- */
html[data-letra="cursiva"] h1.large, html[data-letra="cursiva"] .group-title, html[data-letra="cursiva"] .stat b, html[data-letra="cursiva"] .sheet h2,
html[data-letra="cursiva"] .version-head strong { font-family: var(--font-script); letter-spacing: 0; font-weight: 700; }
html[data-letra="cursiva"] h1.large { font-size: 42px; line-height: 1.05; }
html[data-letra="cursiva"] .group-title { font-size: 25px; }
html[data-letra="cursiva"] .portada strong { font-style: italic; }

main.single { max-width: 640px; }

/* ---------- Mac: tres columnas ---------- */
@media (min-width: 1000px) {
  main { max-width: none; margin: 0; padding: 0; }
  main.single { max-width: 640px; margin: 0 auto; padding: 36px 0 150px; }
  .tabbar button span { display: inline; }
  .tabbar button { padding: 0 20px; }
  .tabbar .bar-end { display: flex; align-items: center; margin-left: 4px; padding-left: 6px; }
  .tabbar .bar-new { background: var(--accent); color: var(--on-accent); border-radius: 50%; min-height: 44px; box-shadow: 0 2px 8px rgba(40, 22, 8, .3); }
  html[data-barra="madera"] .tabbar .bar-new { background: var(--brass); color: var(--wood-0); }
  .cols { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.3fr) minmax(320px, 1.1fr); height: 100vh; }
  .colwrap { position: relative; min-width: 0; height: 100vh; }
  section.col { height: 100%; overflow-y: auto; padding: 14px 6px 150px; }
  section.col h1.large { margin-top: 18px; }
  section.col .hero { margin: 16px 22px 0; }
  /* Biblioteca en la primera columna: rejilla compacta, la seleccionada resaltada */
  section.col .rejilla { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 12px; }
  section.col .portada { contain-intrinsic-size: auto 170px; }
  section.col .foto { aspect-ratio: 1; border-radius: 18px 16px 19px 17px; }
  section.col .foto svg { width: 62%; height: 62%; }
  section.col .portada strong { -webkit-line-clamp: 2; margin: 7px 2px 0; font-size: 14px; line-height: 1.2; }
  section.col .falta-1 { top: 6px; left: 6px; padding: 2px 7px; font-size: 11px; }
  main.entra.quieta .cols > .colwrap:first-child { animation: none; } /* elegir otra receta no mueve la biblioteca */
  .card.revisa.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); } /* el borrador abierto al lado */
}
@media (max-width: 999px) { .cols { display: block; } }

/* Pantalla de acceso: sin animaciones de entrada que puedan interferir con el teclado */
.nologin main > * { animation: none !important; }
.nologin .field { -webkit-user-select: text; user-select: text; -webkit-appearance: none; }

/* Campo de clave como texto enmascarado (evita el menú de Contraseñas de Safari) */
.field.clave { -webkit-text-security: disc; text-security: disc; }
.field.clave.ver { -webkit-text-security: none; text-security: none; }
