/* =====================================================================
   Mani Meogeo — paleta de Axolotlina: menta, coral y crema
   ===================================================================== */
:root {
  --bg: #fff6ec;
  --bg-2: #fdeee0;
  --surface: #ffffff;
  --surface-2: #fffaf4;
  --ink: #4a2f1c;
  --ink-2: #7a5b45;
  --ink-3: #a68b76;
  --line: #f0dfcf;
  --mint: #8fdccb;
  --mint-soft: #e2f7f1;
  --mint-ink: #1f7c6e;
  --coral: #ee7d92;
  --coral-soft: #fde6ea;
  --coral-ink: #b8435b;
  --butter: #ffe7a8;
  --danger: #c8402f;
  --danger-soft: #fde4df;
  --ok: #2f8f5b;
  --warn-soft: #fff3d1;
  --warn-ink: #8a5a00;
  --shadow: 0 1px 2px rgba(90, 50, 20, .06), 0 6px 24px rgba(90, 50, 20, .08);
  --shadow-lg: 0 2px 4px rgba(90, 50, 20, .06), 0 16px 40px rgba(90, 50, 20, .14);
  --radius: 22px;
  --radius-sm: 14px;
  --font: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d2524; --bg-2: #222c2b; --surface: #273231; --surface-2: #2c3837;
    --ink: #f6ece2; --ink-2: #cdbfb2; --ink-3: #94877c; --line: #3a4746;
    --mint: #5fc2ad; --mint-soft: #23413b; --mint-ink: #8fe6d3;
    --coral: #f08ea0; --coral-soft: #4a2c33; --coral-ink: #ffb3c1;
    --butter: #5c4a1c; --danger-soft: #4a2622; --warn-soft: #463a17; --warn-ink: #ffd889;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 16px 40px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink);
  background:
    radial-gradient(1200px 500px at 110% -10%, var(--coral-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, var(--mint-soft), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--mint-ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 900; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.12)); transition: transform .3s; }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.2rem; font-weight: 900; }
.brand-text small { font-size: .74rem; color: var(--ink-3); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a, .nav button {
  font: inherit; font-weight: 800; font-size: .92rem; color: var(--ink-2); text-decoration: none;
  padding: 8px 12px; border-radius: 999px; border: 0; background: none; cursor: pointer; white-space: nowrap;
}
.nav a:hover, .nav button:hover { background: var(--surface); color: var(--ink); }
.nav a.active { background: var(--mint-soft); color: var(--mint-ink); }
.nav .menu-btn { display: none; }
.nav .links { display: flex; gap: 4px; align-items: center; }
@media (max-width: 720px) {
  .brand-text small { display: none; }
  .nav .menu-btn { display: inline-flex; }
  .nav .links { display: none; position: absolute; top: 100%; right: 12px; left: 12px; flex-direction: column;
    background: var(--surface); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-lg); }
  .nav.open .links { display: flex; }
  .nav .links a, .nav .links button { padding: 12px 14px; text-align: left; }
}

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.footer { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 20px 16px 28px; color: var(--ink-3); font-size: .85rem; font-weight: 700; }

/* ---------- Botones y formularios ---------- */
.btn {
  --b: var(--surface); --c: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: .95rem; line-height: 1;
  padding: 12px 18px; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--b); color: var(--c); cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { --b: var(--coral); --c: #fff; border-color: transparent; }
.btn.mint { --b: var(--mint); --c: #10443c; border-color: transparent; }
.btn.ghost { --b: transparent; border-color: transparent; }
.btn.danger { --c: var(--danger); }
.btn.small { padding: 8px 12px; min-height: 36px; font-size: .85rem; }
.btn.icon { padding: 0; width: 44px; }
.btn .ico { font-size: 1.1em; }

label { font-weight: 800; font-size: .9rem; color: var(--ink-2); display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  font: inherit; color: var(--ink); width: 100%;
  padding: 12px 14px; min-height: 46px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.field { margin-bottom: 14px; }
.hint { font-size: .85rem; color: var(--ink-3); margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.muted { color: var(--ink-3); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); white-space: nowrap;
}
.pill.mint { background: var(--mint-soft); color: var(--mint-ink); }
.pill.coral { background: var(--coral-soft); color: var(--coral-ink); }
.pill.butter { background: var(--butter); color: var(--warn-ink); }
a.pill { text-decoration: none; }
a.pill:hover { filter: brightness(.97); }

/* ---------- Hero de inicio ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-bottom: 22px; }
.hero-mascot { width: 150px; height: 150px; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(120, 60, 30, .18)); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .hero-mascot { animation: none; } }
.bubble { position: relative; background: var(--surface); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.bubble::before { content: ''; position: absolute; left: -10px; top: 50%; width: 20px; height: 20px; background: var(--surface); transform: translateY(-50%) rotate(45deg); border-radius: 3px; }
.bubble h1 { margin-bottom: .2em; }
.bubble p { margin: 0; color: var(--ink-2); font-weight: 600; }
@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero-mascot { width: 120px; height: 120px; }
  .bubble::before { left: 50%; top: -10px; transform: translateX(-50%) rotate(45deg); }
}

/* ---------- Buscador ---------- */
.search { padding: 16px; margin-bottom: 18px; }
.tabs { display: inline-flex; background: var(--bg-2); padding: 4px; border-radius: 24px; margin-bottom: 12px; gap: 2px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 800; font-size: .9rem; border: 0; background: none; color: var(--ink-2); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.searchbox { position: relative; }
.searchbox input { padding-left: 46px; font-size: 1.05rem; min-height: 52px; border-radius: 999px; }
.searchbox .ico { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 8px; margin-top: 12px; }
@media (max-width: 480px) { .filters { grid-template-columns: 1fr 1fr; } }
.filters select { min-height: 42px; padding-top: 8px; padding-bottom: 8px; font-size: .92rem; }

.chips-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px 6px 46px; min-height: 52px;
  border: 1.5px solid var(--line); border-radius: 26px; background: var(--surface); position: relative; cursor: text; }
.chips-input:focus-within { border-color: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.chips-input .ico { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); }
.chips-input input { border: 0; box-shadow: none !important; min-height: 36px; padding: 4px 6px; flex: 1; min-width: 140px; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--mint-soft); color: var(--mint-ink); font-weight: 800; font-size: .9rem; padding: 5px 6px 5px 12px; border-radius: 999px; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; width: 24px; height: 24px; border-radius: 50%; line-height: 1; }
.chip button:hover { background: rgba(0,0,0,.08); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 10; overflow: hidden; }
.suggest button { display: flex; width: 100%; justify-content: space-between; font: inherit; text-align: left; border: 0; background: none; padding: 10px 16px; cursor: pointer; color: var(--ink); }
.suggest button:hover, .suggest button.hl { background: var(--mint-soft); }
.quick-ings { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick-ings button { font: inherit; font-size: .85rem; font-weight: 700; border: 1.5px dashed var(--line); background: none; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.quick-ings button:hover { border-color: var(--mint); color: var(--mint-ink); }

.result-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.result-bar .count { font-weight: 800; color: var(--ink-2); }
.result-bar select { width: auto; min-height: 38px; padding: 6px 34px 6px 12px; font-size: .9rem; border-radius: 999px; }

/* ---------- Cursos: entrantes / principales / postres ---------- */
.course-tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.course-tabs::-webkit-scrollbar { display: none; }
.course-tabs button { font: inherit; font-weight: 900; font-size: .95rem; white-space: nowrap; border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow); }
.course-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.course-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 1.4rem; }
.course-head:first-child { margin-top: 0; }
.course-head::after { content: ''; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }

/* ---------- Selector de version pro / facil ---------- */
.version-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.version-switch button { font: inherit; text-align: left; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 10px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, background .15s; }
.version-switch button b { font-weight: 900; }
.version-switch button small { color: var(--ink-3); font-weight: 700; font-size: .78rem; }
.version-switch button[aria-checked="true"] { border-color: var(--coral); background: var(--coral-soft); }
.version-switch button[data-v="facil"][aria-checked="true"] { border-color: var(--mint); background: var(--mint-soft); }
@media (max-width: 560px) { .version-switch button small { display: none; } .version-switch button { text-align: center; padding: 10px 6px; font-size: .9rem; } }
.easy-badge { position: absolute; left: 10px; bottom: 10px; background: var(--mint); color: #10443c; font-weight: 900; font-size: .8rem; padding: 4px 10px; border-radius: 999px; box-shadow: var(--shadow); }

/* ---------- Tarjetas de receta ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.rcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit; transition: transform .18s, box-shadow .18s; }
.rcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.rcard .ph { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--mint-soft), var(--coral-soft)); position: relative; overflow: hidden; }
.rcard .ph > img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.rcard:hover .ph > img:not(.noimg) { transform: scale(1.04); }
.rcard .ph > .noimg { width: 46%; height: auto; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .5; filter: grayscale(.2); }
.rcard .flag { position: absolute; top: 10px; left: 10px; font-size: 1.4rem; background: var(--surface); border-radius: 12px; padding: 2px 7px; box-shadow: var(--shadow); line-height: 1.3; }
.rcard .fav { position: absolute; top: 10px; right: 10px; background: var(--surface); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; box-shadow: var(--shadow); color: var(--coral); }
.rcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rcard h3 { margin: 0; font-size: 1.12rem; }
.rcard p { margin: 0; color: var(--ink-2); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.match-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.match-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--coral)); }

/* ---------- Estado vacio con Axolotlina ---------- */
.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty img { width: 130px; margin: 0 auto 12px; opacity: .95; }
.empty h2 { margin-bottom: .3em; }

/* ---------- Detalle de receta ---------- */
.recipe-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; align-items: start; margin-bottom: 26px; }
@media (max-width: 860px) { .recipe-head { grid-template-columns: 1fr; } }
.recipe-photo { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: linear-gradient(135deg, var(--mint-soft), var(--coral-soft)); aspect-ratio: 4 / 3; }
.recipe-photo img.main { width: 100%; height: 100%; object-fit: cover; }
.recipe-photo .noimg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--ink-2); font-weight: 700; padding: 20px; }
.recipe-photo .noimg img { width: 120px; margin: 0 auto 8px; }
.recipe-photo .photo-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.recipe-info h1 { margin-bottom: .35em; }
.recipe-info .desc { font-size: 1.05rem; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow); text-align: center; }
.stat b { display: block; font-size: 1.15rem; font-weight: 900; }
.stat span { font-size: .78rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.recipe-body { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 860px) { .recipe-body { grid-template-columns: 1fr; } }
.ingredients { position: sticky; top: 84px; }
@media (max-width: 860px) { .ingredients { position: static; } }
.servings { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border-radius: 999px; padding: 4px; }
.servings button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); font: inherit; font-weight: 900; font-size: 1.1rem; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); }
.servings b { min-width: 86px; text-align: center; font-size: .92rem; }
.diners { background: var(--bg-2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.diners .label { font-weight: 900; }
.diners .servings { background: var(--surface); }
.quick-diners { display: flex; gap: 6px; margin: 8px 0 4px; flex-wrap: wrap; }
.quick-diners button { font: inherit; font-weight: 800; min-width: 38px; height: 34px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.quick-diners button.on { background: var(--mint); border-color: var(--mint); color: #10443c; }
.diners small { display: block; font-size: .8rem; font-weight: 700; }
.version-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.version-tabs a { flex: 1; min-width: 140px; text-decoration: none; color: var(--ink); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--surface); display: flex; flex-direction: column; }
.version-tabs a b { font-weight: 900; }
.version-tabs a small { color: var(--ink-3); font-weight: 700; font-size: .8rem; }
.version-tabs a[aria-selected="true"].pro { border-color: var(--coral); background: var(--coral-soft); }
.version-tabs a[aria-selected="true"].facil { border-color: var(--mint); background: var(--mint-soft); }
.ing-group { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--coral-ink); margin: 16px 0 6px; font-weight: 900; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { border-bottom: 1px dashed var(--line); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; margin: 0; cursor: pointer; font-weight: 600; color: var(--ink); font-size: .98rem; }
.ing-list input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--mint-ink); flex: none; }
.ing-list input:checked + span { text-decoration: line-through; color: var(--ink-3); }
.ing-list .qty { font-weight: 900; color: var(--mint-ink); }
.ing-list .note { color: var(--ink-3); font-size: .88rem; }
.ing-list .opt { font-size: .72rem; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 14px 16px 14px 62px; margin-bottom: 10px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); cursor: pointer; transition: opacity .2s; counter-increment: step; white-space: pre-line; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--coral-soft); color: var(--coral-ink); display: grid; place-items: center; font-weight: 900; }
.steps li.done { opacity: .5; }
.steps li.done::before { content: '✓'; background: var(--mint-soft); color: var(--mint-ink); }
.step-group { font-size: 1rem; color: var(--coral-ink); margin: 18px 0 10px; }
.notes { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 16px 18px; margin-top: 18px; }
.notes h3 { color: var(--warn-ink); }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }

.cook-mode .steps li { font-size: 1.2rem; }

/* ---------- Importador ---------- */
.steps-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.how { position: relative; background: var(--surface); border-radius: var(--radius); padding: 20px 18px 18px; box-shadow: var(--shadow); }
.how .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--mint); color: #10443c; margin-bottom: 10px; }
.how p { color: var(--ink-2); font-size: .94rem; margin-bottom: 12px; }
.drop { border: 2.5px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer; }
.drop.over { border-color: var(--mint); background: var(--mint-soft); }
.drop img { width: 90px; margin: 0 auto 8px; }
.drop b { display: block; font-size: 1.1rem; }

.pv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; border-left: 6px solid var(--mint); }
.pv.bad { border-left-color: var(--danger); }
.pv.dup { border-left-color: #e6b13c; }
.pv .thumb { width: 120px; aspect-ratio: 1; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-2); }
@media (max-width: 520px) { .pv { grid-template-columns: 1fr; } .pv .thumb { width: 100%; aspect-ratio: 16/9; } }
.pv h3 { margin: 0 0 6px; }
.msgs { list-style: none; padding: 0; margin: 8px 0 0; font-size: .88rem; }
.msgs li { padding: 6px 10px; border-radius: 10px; margin-bottom: 4px; }
.msgs .e { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.msgs .w { background: var(--warn-soft); color: var(--warn-ink); }
.msgs .i { background: var(--mint-soft); color: var(--mint-ink); font-weight: 700; }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .editor { grid-template-columns: 1fr; } }
.editor textarea { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .88rem; min-height: 64vh; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 2; }
.editor .side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }

/* ---------- Paises ---------- */
.region { margin-bottom: 26px; }
.countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.country { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-weight: 700; }
.country .f { font-size: 1.5rem; }
.country small { margin-left: auto; color: var(--ink-3); font-weight: 800; }
.country.zero { opacity: .45; box-shadow: none; background: var(--surface-2); }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }

/* ---------- Tablas (usuarios) ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
td select { min-height: 36px; padding: 4px 30px 4px 10px; width: auto; }

/* ---------- Login ---------- */
.auth { max-width: 420px; margin: 20px auto; text-align: center; }
.auth img { width: 140px; margin: 0 auto 6px; }
.auth form { text-align: left; }

/* ---------- Avisos ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow-lg); transition: transform .25s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700; margin-bottom: 14px; }
.alert.err { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--mint-soft); color: var(--mint-ink); }

.loading { display: grid; place-items: center; padding: 60px 0; color: var(--ink-3); font-weight: 800; }
.loading img { width: 80px; animation: bob 1.2s ease-in-out infinite; margin-bottom: 8px; }
.skel { background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 280px; }
@keyframes sk { to { background-position: -200% 0; } }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 22px; align-items: center; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.section-title h2 { margin: 0; }

@media print {
  .topbar, .footer, .actions, .photo-actions, .servings button { display: none !important; }
  body { background: #fff; }
  .recipe-body { grid-template-columns: 1fr 1.6fr; }
  .steps li, .card, .stat { box-shadow: none; border: 1px solid #ddd; }
}

[hidden] { display: none !important; }
.flagimg { display: inline-block; vertical-align: -0.15em; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); object-fit: cover; }
.flagimg.globe { box-shadow: none; }
.rcard .flag { padding: 5px 6px; line-height: 0; }
.country .f { line-height: 0; }
.pv .thumb.contain { object-fit: contain; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(30, 20, 10, .45); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-body { padding: 8px 20px 20px; overflow: auto; }

/* ---------- Planificador ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.plan-card { text-decoration: none; color: inherit; }
.plan-card h3 { margin-bottom: 4px; }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.day { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.day h3 { margin: 0 0 8px; font-size: 1.05rem; }
.meal { border-top: 1px dashed var(--line); padding: 8px 0 4px; }
.meal-name { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--coral-ink); display: flex; justify-content: space-between; align-items: center; }
.meal-name button { font: inherit; font-size: .8rem; font-weight: 800; border: 1.5px dashed var(--line); background: none; color: var(--ink-2); border-radius: 999px; padding: 3px 10px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.meal-name button:hover { border-color: var(--mint); color: var(--mint-ink); }
.pitem { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; }
.pitem img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: var(--bg-2); }
.pitem a { color: var(--ink); text-decoration: none; font-weight: 800; font-size: .92rem; line-height: 1.2; }
.pitem small { display: block; color: var(--ink-3); font-weight: 700; font-size: .78rem; }
.mini-srv { display: flex; align-items: center; gap: 2px; }
.mini-srv button { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bg-2); color: var(--ink); font-weight: 900; cursor: pointer; }
.mini-srv b { min-width: 18px; text-align: center; font-size: .9rem; }
.picker-list { display: grid; gap: 6px; margin-top: 10px; max-height: 50vh; overflow: auto; }
.picker-list button { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; text-align: left; font: inherit; border: 0; background: var(--surface); border-radius: var(--radius-sm); padding: 6px; cursor: pointer; color: var(--ink); }
.picker-list button:hover { background: var(--mint-soft); }
.picker-list img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.picker-list small { display: block; color: var(--ink-3); font-weight: 700; }
.shop { list-style: none; margin: 0; padding: 0; }
.shop li { border-bottom: 1px dashed var(--line); }
.shop label { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 2px; margin: 0; cursor: pointer; color: var(--ink); font-weight: 700; }
.shop input { width: 20px; height: 20px; accent-color: var(--mint-ink); margin-top: 2px; }
.shop .q { color: var(--mint-ink); font-weight: 900; }
.shop small { display: block; color: var(--ink-3); font-weight: 600; font-size: .8rem; }
.shop li.done label > span { opacity: .45; text-decoration: line-through; }
.progress { height: 10px; background: var(--bg-2); border-radius: 5px; overflow: hidden; margin: 8px 0 14px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--coral)); transition: width .3s; }
.see-all { grid-column: 1 / -1; display: flex; justify-content: center; margin-bottom: 8px; }
.course-head small { font-size: .95rem; font-weight: 800; }
