/* ==========================================================================
   CosteoChef — calculadora de costeo de platos
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f2efe7;
  --ink: #1c2321;
  --ink-2: #4a524f;
  --muted: #6f7773;
  --line: #e3ded2;
  --line-2: #d4cdbd;
  --brand: #1d6b4f;
  --brand-ink: #ffffff;
  --brand-soft: #e3f0ea;
  --accent: #e0662f;
  --accent-soft: #fbe9df;
  --danger: #b3261e;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 35, 33, .05), 0 8px 28px rgba(28, 35, 33, .07);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 .8em; }
button, input, select { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.brand b { color: var(--brand); font-weight: 800; }
.brand-mark { width: 30px; height: 30px; color: var(--brand); }
.top-nav { display: flex; gap: 22px; }
.top-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .94rem; }
.top-nav a:hover { color: var(--brand); }
@media (max-width: 640px) { .top-nav { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-top: 26px; padding-bottom: 16px; }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.55rem, 4.2vw, 2.45rem); letter-spacing: -.015em; max-width: 22ch; }
.hero .sub { margin-top: 10px; color: var(--ink-2); max-width: 70ch; font-size: clamp(.95rem, 1.8vw, 1.05rem); }
@media (max-width: 640px) {
  .hero { padding-top: 16px; padding-bottom: 12px; }
  .hero .sub { font-size: .9rem; line-height: 1.5; }
}

/* ---------- Tool card ---------- */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}
@media (max-width: 640px) { .tool-card { padding: 14px; border-radius: 14px; } }
.noscript { background: var(--accent-soft); padding: 12px; border-radius: 10px; }
fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.step-legend { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.02rem; margin-bottom: 10px; padding: 0; }
.step-legend small { font-weight: 500; color: var(--muted); }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .82rem; font-weight: 800; flex: none; }
.hint { color: var(--muted); font-size: .88rem; margin: -2px 0 10px; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span, .lbl { font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
input[type="text"], select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
select { padding-right: 6px; cursor: pointer; }
input[type="text"]:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input.invalid { border-color: var(--danger); background: #fdf3f2; }
input::placeholder { color: #a3a79f; }

.dish-grid { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 12px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) {
  .dish-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dish-grid .f-name { grid-column: 1 / -1; }
  .pricing-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pricing-grid .field:last-child { grid-column: 1 / -1; }
}

/* Ingredient rows */
.ing-head, .ing-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.05fr) minmax(0, 1.55fr) minmax(0, 1.55fr) minmax(0, .75fr) minmax(0, .95fr) 34px;
  gap: 8px;
  align-items: center;
}
.ing-head { padding: 0 2px 6px; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ing-head .r { text-align: right; }
.ing-list { display: flex; flex-direction: column; gap: 8px; }
.ing-row { padding: 6px; margin: 0 -6px; border-radius: 10px; }
.ing-row:hover { background: var(--surface-2); }
.ing-row .lbl { display: none; }
.cell { min-width: 0; }
.qty { display: flex; gap: 4px; min-width: 0; }
.qty input { flex: 1 1 auto; }
.qty select { flex: 0 0 62px; width: 62px; padding: 0 2px 0 6px; font-size: .9rem; }
.row-cost { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-cost.err { color: var(--danger); font-weight: 600; font-size: .8rem; white-space: normal; }
.del {
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; font-size: 1.3rem; line-height: 1;
}
.del:hover { background: #f8e3e1; color: var(--danger); }

@media (max-width: 760px) {
  .ing-head { display: none; }
  .ing-list { gap: 10px; }
  .ing-row {
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "price waste"
      "bought used"
      "cost del";
    gap: 8px 10px;
    position: relative;
  }
  .ing-row:hover { background: var(--surface); }
  .ing-row .lbl { display: block; margin-bottom: 3px; font-size: .7rem; }
  .c-name { grid-area: name; padding-right: 36px; }
  .c-price { grid-area: price; }
  .c-bought { grid-area: bought; }
  .c-used { grid-area: used; }
  .c-waste { grid-area: waste; }
  .row-cost { grid-area: cost; text-align: left; }
  .row-cost::before { content: "Costo: "; font-weight: 600; color: var(--muted); }
  .del { position: absolute; top: 6px; right: 6px; }
  .qty select { flex-basis: 58px; width: 58px; }
}

.ing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 11px; cursor: pointer; font-weight: 700;
  padding: 10px 16px; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 14px 22px; font-size: 1.02rem; }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 14px rgba(29, 107, 79, .28); }
.btn-primary:hover { background: #175a42; }
.btn-secondary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(224, 102, 47, .25); }
.btn-secondary:hover { background: #c9551f; }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.btn-ghost:hover { background: #d3e8de; }
.btn-link { background: transparent; color: var(--brand); padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { opacity: .6; cursor: progress; }

.form-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px dashed var(--line-2); padding-top: 16px;
}
.live-total { margin: 0; color: var(--ink-2); }
.live-total strong { color: var(--ink); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .form-foot .btn { width: 100%; }
}
.form-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: var(--danger); font-weight: 600; font-size: .92rem; }

/* ---------- Result ---------- */
.tool-card[data-state="done"] #costForm { display: none; }
.result:focus { outline: none; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.eyebrow { margin: 0 0 2px; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.result-head h2 { font-family: var(--display); font-size: clamp(1.35rem, 3.5vw, 1.8rem); }
.muted { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.kpi.hl { background: var(--brand); color: #fff; }
.kpi.hl .k-lbl, .kpi.hl .k-note { color: rgba(255, 255, 255, .82); }
.kpi.warn { background: var(--accent-soft); }
.k-lbl { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.k-val { display: block; font-size: clamp(1.2rem, 3vw, 1.55rem); font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.k-note { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }

.breakdown h3 { font-size: 1rem; margin-bottom: 8px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.b-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.b-table th, .b-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.b-table th { background: var(--surface-2); font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.b-table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.b-table tbody tr:last-child td { border-bottom: 0; }
.b-table tfoot td { font-weight: 800; background: var(--surface-2); border-bottom: 0; border-top: 1px solid var(--line-2); }
.b-table tfoot tr + tr td { border-top: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.bar i { display: block; height: 6px; border-radius: 3px; background: var(--accent); min-width: 2px; max-width: 70px; }
@media (max-width: 480px) { .bar i { display: none; } .b-table th, .b-table td { padding: 8px 9px; } }
.insight { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: #134a37; font-size: .92rem; }
.insight:empty { display: none; }

.downloads { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
@media (max-width: 640px) { .downloads .btn-lg { flex: 1 1 100%; } }
.dl-status { margin: 8px 0 0; font-size: .88rem; color: var(--muted); min-height: 1.3em; }

.privacy { display: flex; gap: 8px; align-items: flex-start; margin: 12px 2px 0; color: var(--ink-2); font-size: .86rem; }
.privacy svg { width: 16px; height: 16px; color: var(--brand); flex: none; margin-top: 3px; }

/* ---------- Ad placeholders ---------- */
.ad-slot {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 2px dashed #c9c2b1;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, #f1ede4 0 10px, #ece7dc 10px 20px);
  color: #8b8472;
  text-align: center;
}
.ad-label { font-weight: 800; letter-spacing: .18em; font-size: .9rem; }
.ad-size { font-size: .72rem; opacity: .8; }
.ad-leaderboard { min-height: 100px; max-width: 970px; margin: 28px auto 8px; }
@media (max-width: 640px) { .ad-leaderboard { min-height: 100px; } }
.ad-incontent { min-height: 250px; grid-column: 1 / -1; }
.ad-rect { width: 300px; max-width: 100%; height: 250px; margin: 0 auto; }
.ad-mini { height: 100px; width: 100%; }

/* Pop-up after download */
.ad-modal {
  border: 0; border-radius: 16px; padding: 22px 18px 18px; width: min(360px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); text-align: center; background: var(--surface); color: var(--ink);
}
.ad-modal::backdrop { background: rgba(20, 24, 22, .55); }
.ad-modal-title { font-weight: 800; margin: 0 24px 12px; }
.ad-modal .btn { margin-top: 14px; width: 100%; }
.ad-close {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--ink); font-size: 1.35rem; line-height: 1; cursor: pointer; z-index: 2;
}
.ad-close:hover { background: var(--line); }
.ad-close.sm { width: 26px; height: 26px; font-size: 1.05rem; top: -10px; right: -10px; background: var(--ink); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }

/* Corner notification */
.ad-toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 300px; max-width: calc(100vw - 32px);
  background: var(--surface); border-radius: 14px; padding: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .2);
  transform: translateY(20px); opacity: 0; transition: transform .3s ease, opacity .3s ease;
}
.ad-toast.show { transform: none; opacity: 1; }
@media (max-width: 480px) { .ad-toast { width: 250px; right: 12px; bottom: 12px; } .ad-toast .ad-mini { height: 70px; } }
@media (prefers-reduced-motion: reduce) { .ad-toast { transition: none; } }

/* ---------- Content sections ---------- */
.section { padding-top: 44px; padding-bottom: 8px; }
.section-title { font-family: var(--display); font-size: clamp(1.35rem, 3.2vw, 1.9rem); font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.section-sub { color: var(--ink-2); margin-bottom: 20px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.step-ic svg { width: 24px; height: 24px; }
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { color: var(--ink-2); margin: 0; font-size: .94rem; }

.prose { max-width: 820px; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.formula { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin: 4px 0 16px; font-size: .95rem; }
.formula p { margin: 4px 0; color: var(--ink); }

.articles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 760px) { .articles { grid-template-columns: 1fr; } }
.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.article h3 { font-size: 1.1rem; margin: 6px 0 8px; }
.article p, .article li { color: var(--ink-2); font-size: .94rem; }
.article p:last-child { margin-bottom: 0; }
.article ul { margin: 0; padding-left: 18px; }
.article li { margin-bottom: 3px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }

.faq { max-width: 820px; display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 24px 14px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 11px; font-size: 1.4rem; color: var(--brand); font-weight: 600; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-2); padding-bottom: 14px; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; background: #1c2321; color: #cfd4d1; padding: 26px 0 90px; font-size: .9rem; }
.footer-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-in p { margin: 0; max-width: 60ch; }
.footer-in nav { display: flex; gap: 18px; }
.site-footer a { color: #fff; }

/* ---------- Legal pages ---------- */
.legal { max-width: 780px; padding-top: 30px; }
.legal h1 { font-family: var(--display); font-size: 2rem; margin-bottom: 14px; }
.legal h2 { font-size: 1.2rem; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.todo { background: #fff4c2; padding: 0 4px; border-radius: 4px; }

/* ---------- Descripción para la carta ---------- */
.menu-desc { margin-top: 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px; background: #fffdf9; }
.md-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.md-head h3 { font-size: 1.02rem; }
.md-head .muted { margin-top: 2px; }
.md-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.md-chip { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.md-chip:hover { border-color: var(--accent); color: var(--accent); }
.md-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.md-label { position: absolute; left: -9999px; }
#mdText { width: 100%; min-height: 84px; resize: vertical; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 10px; font: italic 500 1.02rem/1.55 var(--font); color: var(--ink); background: #fff; }
#mdText:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.md-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.md-actions .btn { padding: 8px 14px; font-size: .9rem; }
.md-note { color: var(--muted); font-size: .82rem; }

/* ---------- Tarjetas de guías (home + índice) ---------- */
.g-toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chip { border: 1.5px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .86rem; cursor: pointer; color: var(--ink-2); transition: all .15s; }
.g-chip:hover { border-color: var(--brand); color: var(--brand); }
.g-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.g-search { position: relative; flex: 0 1 280px; }
.g-search input { height: 40px; padding-left: 36px; border-radius: 999px; }
.g-search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.g-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease; }
.g-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(28, 35, 33, .12); }
.g-card[hidden] { display: none; }
.g-cover { position: relative; height: 128px; display: grid; place-items: center; overflow: hidden; }
.g-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.35), transparent 55%); }
.g-emoji { font-size: 3.1rem; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); transition: transform .3s ease; }
.g-card:hover .g-emoji { transform: scale(1.14) rotate(-6deg); }
.g-cat { position: absolute; left: 12px; top: 12px; z-index: 1; background: rgba(255,255,255,.92); color: var(--ink); font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.g-num { position: absolute; right: 12px; bottom: 8px; z-index: 1; font: 700 1.6rem/1 var(--display); color: rgba(255,255,255,.55); }
.g-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.g-body h3 { font-size: 1.05rem; line-height: 1.3; }
.g-body p { color: var(--ink-2); font-size: .9rem; margin: 0; }
.g-meta { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); font-weight: 600; }
.g-meta b { color: var(--brand); }
.g-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 24px; }
.g-more { text-align: center; margin-top: 20px; }
.g-grid .ad-slot { grid-column: 1 / -1; min-height: 120px; }
.c-costeo { background: linear-gradient(135deg, #1d6b4f, #3fa37a); }
.c-precios { background: linear-gradient(135deg, #e0662f, #f2a043); }
.c-compras { background: linear-gradient(135deg, #2b5f9e, #4f9bd9); }
.c-cocina { background: linear-gradient(135deg, #7a4a2b, #c9864a); }
.c-menu { background: linear-gradient(135deg, #6b3fa0, #b074d6); }

/* ---------- Página de artículo ---------- */
.read-progress { position: fixed; left: 0; top: 0; height: 4px; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); z-index: 60; transition: width .1s linear; }
.art-hero { color: #fff; padding: 34px 0 40px; }
.crumbs { font-size: .85rem; margin-bottom: 14px; opacity: .92; }
.crumbs a { color: #fff; }
.art-hero .g-cat { position: static; display: inline-block; margin-bottom: 10px; }
.art-hero h1 { font-family: var(--display); font-size: clamp(1.7rem, 4.4vw, 2.7rem); max-width: 26ch; line-height: 1.15; }
.art-lead { font-size: clamp(1rem, 2vw, 1.15rem); max-width: 62ch; margin: 12px 0 0; opacity: .95; }
.art-meta { margin-top: 14px; font-size: .88rem; opacity: .9; display: flex; gap: 16px; flex-wrap: wrap; }
.art-hero-in { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.art-hero .g-emoji { font-size: clamp(3.5rem, 9vw, 6rem); }
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; margin-top: 30px; align-items: start; }
.art-body { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 4vw, 40px); min-width: 0; }
.art-body h2 { font-family: var(--display); font-size: clamp(1.3rem, 2.8vw, 1.65rem); margin: 34px 0 12px; scroll-margin-top: 20px; }
.art-body h2:first-of-type { margin-top: 8px; }
.art-body h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.art-body p, .art-body li { color: #2f3633; font-size: 1.04rem; line-height: 1.75; }
.art-body ul, .art-body ol { padding-left: 22px; margin: 0 0 1em; }
.art-body li { margin-bottom: 6px; }
.art-body a { font-weight: 600; }
.art-body .ad-slot { margin: 26px 0; min-height: 110px; }
.callout { border-radius: 14px; padding: 16px 18px; margin: 20px 0; border: 1px solid; }
.callout p:last-child { margin-bottom: 0; }
.callout-t { display: block; font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.callout.tip { background: var(--brand-soft); border-color: #bfdccf; }
.callout.tip .callout-t { color: var(--brand); }
.callout.ejemplo { background: #fff7ef; border-color: #f3d4b8; }
.callout.ejemplo .callout-t { color: var(--accent); }
.callout.formula { background: #f3f1fb; border-color: #d9d2f0; }
.callout.formula .callout-t { color: #5b3fa0; }
.callout.formula p { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .98rem; }
.callout.alerta { background: #fdf0ee; border-color: #f2c9c3; }
.callout.alerta .callout-t { color: var(--danger); }
.tbl-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 460px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { background: var(--surface-2); font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.tbl tr:last-child td { border-bottom: 0; }
.art-cta { margin: 32px 0 6px; padding: 22px; border-radius: 16px; background: var(--ink); color: #fff; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.art-cta p { margin: 0; color: #d9dedb; }
.art-cta strong { display: block; font-size: 1.15rem; color: #fff; margin-bottom: 2px; }
.art-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.toc-t { font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: flex; gap: 8px; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: .9rem; font-weight: 600; line-height: 1.35; }
.toc a::before { content: counter(t); color: var(--muted); font-weight: 800; min-width: 1.1em; }
.toc a:hover { background: var(--surface-2); }
.toc a.is-active { background: var(--brand-soft); color: var(--brand); }
.ad-sky { min-height: 600px; }
.side-cta { background: var(--brand); color: #fff; border-radius: 16px; padding: 18px; }
.side-cta strong { display: block; margin-bottom: 4px; }
.side-cta p { color: rgba(255,255,255,.88); font-size: .92rem; }
.side-cta .btn { background: #fff; color: var(--brand); width: 100%; }
.share-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-2); color: var(--muted); font-size: .9rem; }
.related { margin-top: 44px; }
@media (max-width: 980px) {
  .art-layout { grid-template-columns: 1fr; }
  .art-side { position: static; }
  .ad-sky { min-height: 250px; }
  .toc { order: -1; }
}
@media (max-width: 640px) {
  .art-hero-in { grid-template-columns: 1fr; }
  .art-hero .g-emoji { display: none; }
  .g-toolbar { flex-direction: column; align-items: stretch; }
  .g-search { flex-basis: auto; }
  .g-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g-cover { height: 92px; }
  .g-emoji { font-size: 2.3rem; }
  .g-body { padding: 12px; }
  .g-body h3 { font-size: .95rem; }
  .g-body p { display: none; }
  .g-num { font-size: 1.2rem; }
  .g-cat { font-size: .62rem; left: 8px; top: 8px; }
}
@media (max-width: 360px) { .g-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .g-card, .g-emoji { transition: none; } .g-card:hover { transform: none; } }
