/* =============================================================
   CartaRentable — styles.css
   1 Tokens · 2 Reset · 3 Utilidades · 4 Tipografía · 5 Componentes
   6 Secciones · 7 Efectos · 8 Responsive · 9 Reduced motion · 10 Print
   ============================================================= */

/* ============================== 1. Tokens ============================== */
:root {
  color-scheme: light;

  --ink:      #101820;
  --ink-2:    #33404c;
  /* Gris de apoyo: 5,6:1 sobre blanco y 5,0:1 sobre los grises de la interfaz */
  --muted:    #5d6975;
  --line:     #e2e8ee;
  --line-2:   #eef2f6;
  --bg:       #f5f7f9;
  --surface:  #ffffff;
  --surface-2:#fafbfc;

  /* ---- Naranja de marca, en cuatro papeles distintos ----------------------
     El naranja vivo (#d9532c) solo llega a 4,0:1 con blanco, por debajo del
     minimo AA de 4,5:1. Se reserva para lo que NO es texto (icono, bordes,
     puntos, anillos de foco) y para el texto se usan las variantes de abajo,
     todas dentro de la misma familia de color.
       --accent-text    texto naranja sobre fondo claro   5,6:1 / 5,0:1
       --accent-solid   fondo naranja con texto blanco    4,9:1
       --accent-on-dark texto naranja sobre fondo oscuro  7,2:1              */
  --accent:      #d9532c;
  --accent-text: #b7401e;
  --accent-solid: #c4471f;
  --accent-solid-hover: #a83a1a;
  --accent-solid-press: #9c3617;
  --accent-on-dark: #ef8a63;
  --accent-dark: #b7401e;
  --accent-soft: #fdf1ec;

  --green:  #157f4a;
  --green-soft: #e8f6ee;
  --amber:  #b4700c;
  --amber-text: #8f5a08;
  --amber-soft: #fdf3e2;
  --red:    #c02626;
  --red-soft: #fdeceb;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(16,24,32,.05), 0 1px 3px rgba(16,24,32,.04);
  --shadow:    0 2px 4px rgba(16,24,32,.04), 0 8px 24px rgba(16,24,32,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,32,.12);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1240px;
}

/* ============================== 2. Reset ============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================== 3. Utilidades ============================== */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: 780px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.is-hidden { display: none !important; }
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ============================== 4. Tipografía ============================== */
h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5.2vw, 3.05rem);
  letter-spacing: -0.03em;
}
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.45rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.06rem; font-weight: 650; letter-spacing: -0.01em; }
.eyebrow {
  font-size: .76rem; font-weight: 650; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent-text); margin-bottom: .55rem;
}
.mini-note { font-size: .78rem; color: var(--muted); line-height: 1.45; margin-top: .4rem; }
.mini-note a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

/* ============================== 5. Componentes ============================== */

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand-mark { color: var(--accent); flex: none; }
.brand-text { font-family: var(--display); font-size: 1.12rem; font-weight: 500; letter-spacing: -.02em; }
.brand-text strong { font-weight: 600; color: var(--accent-text); }
.header-nav { display: none; gap: 1.4rem; font-size: .88rem; font-weight: 500; color: var(--ink-2); }
.header-nav a { padding: .3rem 0; border-bottom: 1.5px solid transparent; transition: border-color .2s var(--ease-out), color .2s; }
.header-nav a:hover { color: var(--accent-text); border-bottom-color: var(--accent); }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .72rem 1.05rem; border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .18s var(--ease-out), border-color .18s, color .18s, transform .12s;
}
.btn:active { transform: translateY(1px); }
/* Boton principal: blanco puro sobre naranja oscurecido (4,9:1), 48px de alto,
   cambio de tono visible al pasar el cursor y al pulsar, y anillo de foco. */
.btn-primary {
  background: var(--accent-solid); color: #fff; font-weight: 650;
  min-height: 48px; padding: .8rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-solid-hover); }
.btn-primary:active { background: var(--accent-solid-press); }
.btn-primary:focus-visible {
  outline: 3px solid var(--accent-solid-press);
  outline-offset: 3px;
}
/* Los botones pequenos mantienen su tamano; el minimo de 48px es para los grandes */
.btn-primary.btn-sm { min-height: 36px; padding: .48rem .75rem; }
/* Fila de acciones (guardar, PDF, compartir): misma altura y objetivo tactil comodo */
.actions .btn { min-height: 48px; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-2); }
.btn-sm { padding: .48rem .75rem; font-size: .8rem; }
.btn-add {
  width: 100%; margin-top: .75rem;
  background: var(--accent-soft); color: var(--accent-dark);
  border: 1px dashed rgba(217,83,44,.4);
}
.btn-add:hover { background: #fbe6dd; border-color: var(--accent); }
.btn-cta { background: var(--ink); color: #fff; padding: .8rem 1.4rem; white-space: nowrap; }
.btn-cta:hover { background: #24313d; }
.btn-link {
  font-size: .78rem; color: var(--muted); text-decoration: underline;
  text-underline-offset: 2px; background: none; padding: 0;
}
.btn-link:hover { color: var(--red); }

/* --- Campos --- */
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > label {
  font-size: .76rem; font-weight: 600; color: var(--ink-2);
  letter-spacing: .01em;
}
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field select {
  width: 100%; padding: .6rem .7rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); font-size: .92rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217,83,44,.13);
}
.field input[type="number"] { -moz-appearance: textfield; }
.field-grow { flex: 1 1 auto; }
.field-num { flex: 0 0 96px; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--ink-2); margin-top: .5rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.input-money { position: relative; display: flex; align-items: center; }
.input-money .money-sym {
  position: absolute; left: .7rem; font-size: .88rem; font-weight: 600;
  color: var(--muted); pointer-events: none;
}
.input-money input { padding-left: 2.35rem; font-size: 1.05rem; font-weight: 600; }

/* --- Barra de configuración --- */
.config-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .7rem;
  align-items: end; padding: .7rem .85rem; margin-bottom: .8rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.config-bar .field-inline { min-width: 0; }
.config-note { grid-column: 1 / -1; font-size: .74rem; color: var(--muted); }

/* --- Rejilla de la app --- */
.app-grid { display: grid; gap: 1rem; align-items: start; }

/* --- Tarjeta de herramienta --- */
.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 1.1rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.card-head h2 { font-size: 1.15rem; font-family: var(--sans); font-weight: 700; letter-spacing: -.02em; }
.plato-meta { display: flex; gap: .7rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line-2); }
.ing-head { padding: 1rem 0 .7rem; }
.ing-head h3 { font-size: .95rem; }
.ing-hint { font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* --- Fila de ingrediente --- */
.ing-list { display: flex; flex-direction: column; gap: .7rem; }
.ing-row {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2); padding: .8rem .8rem .7rem;
}
.ing-row.is-warn { border-color: #e6b98a; background: #fffaf3; }
.ing-row-top { display: flex; gap: .5rem; align-items: flex-end; margin-bottom: .6rem; }
.ing-del {
  flex: none; width: 32px; height: 32px; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface);
  transition: color .15s, border-color .15s, background-color .15s;
}
.ing-del:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.ing-groups { display: grid; grid-template-columns: 1fr; gap: .6rem; }
.ing-group { border-top: 1px dashed var(--line); padding-top: .55rem; }
.ing-group > .gl {
  display: block; font-size: .68rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .35rem;
}
.ing-fields { display: flex; gap: .45rem; }
.ing-fields .field-qty { flex: 1 1 70px; min-width: 0; }
.ing-fields .field-uni { flex: 0 0 86px; }
.ing-fields .field-price { flex: 1 1 90px; min-width: 0; }
.ing-fields .field-merma { flex: 0 0 82px; }
.merma-tip {
  display: block; font-size: .72rem; color: var(--amber-text);
  margin-top: .3rem; line-height: 1.35;
}
.merma-tip button { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.ing-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .4rem; margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--line-2);
}
.ing-cost { font-size: 1.02rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ing-detail { font-size: .74rem; color: var(--muted); }
.ing-share {
  font-size: .7rem; font-weight: 600; color: var(--muted);
  background: var(--line-2); padding: .1rem .4rem; border-radius: 99px;
}
.ing-warn { flex: 1 1 100%; font-size: .75rem; color: #9a5b12; font-weight: 500; }
.ing-warn:empty, .ing-alert:empty { display: none; }
.ing-alert {
  flex: 1 1 100%; font-size: .75rem; line-height: 1.45; font-weight: 500;
  color: #7d4e06; background: var(--amber-soft); border-radius: 6px; padding: .35rem .55rem;
}
.ing-share.is-high { background: var(--amber-soft); color: #7d4e06; }

/* --- Equivalencia peso / volumen / unidades --- */
.ing-conv {
  margin-top: .6rem; padding: .6rem .7rem;
  border: 1px solid #e6b98a; border-radius: var(--r-sm); background: #fffaf3;
}
.conv-msg { font-size: .78rem; line-height: 1.45; color: #7d4e06; }
.conv-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .45rem; font-size: .82rem; color: var(--ink-2); }
.conv-row label { font-weight: 600; font-size: .8rem; }
.conv-row input {
  width: 76px; padding: .45rem .55rem; border: 1px solid #e6b98a; border-radius: var(--r-sm);
  background: var(--surface); font-size: .9rem; font-variant-numeric: tabular-nums;
}
.conv-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,83,44,.13); }
.conv-hint { margin-top: .35rem; font-size: .72rem; color: var(--muted); line-height: 1.4; }

/* --- Porciones con + / - --- */
.field-porc { flex: 0 0 124px; }
.stepper { display: flex; align-items: stretch; }
.stepper button {
  flex: 0 0 34px; font-size: 1.1rem; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
}
.stepper button:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); border-right: 0; }
.stepper button:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 0; }
.stepper button:hover { color: var(--accent-text); background: var(--accent-soft); }
.field .stepper input { border-radius: 0; text-align: center; padding-inline: .2rem; min-width: 0; }

/* --- Tipo de receta --- */
.tipo-block { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; padding: .85rem 0; border-bottom: 1px solid var(--line-2); }
.tipo-label { font-size: .76rem; font-weight: 600; color: var(--ink-2); }
.tipo-switch {
  flex: 1 1 260px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px;
  background: var(--line-2); border-radius: var(--r-sm);
}
.tipo-btn {
  padding: .5rem .3rem; border-radius: 6px; font-size: .8rem; font-weight: 600;
  color: var(--muted); transition: background-color .18s, color .18s;
}
.tipo-btn em { font-style: normal; font-weight: 500; opacity: .75; }
.tipo-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --- Forma de uso --- */
.field-forma { margin-bottom: .45rem; }
.field-forma select { font-size: .86rem; }
.field input:disabled { background: var(--line-2); color: var(--muted); cursor: not-allowed; }
.principal-field { flex: 1 1 100%; }
.principal-field select { font-size: .86rem; }

/* --- Precio con / sin impuesto --- */
.verdict-sub { display: block; margin-top: .15rem; font-size: .7rem; color: var(--muted); font-weight: 500; }

/* --- Forma de uso fija (envasado, seco, dosificacion) --- */
.forma-fija {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem;
  padding: .55rem .7rem; border-radius: var(--r-sm);
  background: var(--line-2); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 600; color: var(--ink-2);
}
.forma-fija .btn-link, .forma-auto { font-size: .74rem; font-weight: 500; color: var(--accent-text); }
.forma-auto { margin-top: .3rem; align-self: flex-start; }
.saved-tipo { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-left: .2rem; }

/* --- Filtro de la ingenieria de menu --- */
.menu-filtro {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; max-width: 480px;
  background: var(--line-2); border-radius: var(--r-sm); margin-bottom: 1rem;
}

/* --- Simulador de promociones --- */
.promo-tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.promo-btn {
  padding: .6rem .4rem; border-radius: var(--r-sm); font-size: .82rem; font-weight: 600;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
  transition: background-color .15s, border-color .15s, color .15s;
}
.promo-btn:hover { border-color: var(--ink-2); }
.promo-btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.promo-params { margin-top: .9rem; }
.promo-param .field { max-width: 360px; }
.combo-list { display: grid; gap: .35rem; margin: .5rem 0 .8rem; grid-template-columns: 1fr; }
.combo-item {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: .86rem; color: var(--ink);
}
.combo-item input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.combo-item em { font-style: normal; color: var(--muted); font-size: .76rem; }
.promo-sujeto { margin-top: .9rem; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.promo-sujeto:empty { display: none; }
.promo-error {
  margin-top: .9rem; padding: .8rem .95rem; border-radius: var(--r);
  background: var(--line-2); color: var(--ink-2); font-size: .88rem;
}
.promo-verdict {
  display: flex; align-items: flex-start; gap: .6rem; margin: .9rem 0;
  padding: .75rem .9rem; border-radius: var(--r); font-size: .9rem; font-weight: 500; line-height: 1.45;
  background: var(--line-2); color: var(--ink-2);
}
.promo-verdict .pv-dot { flex: none; width: 14px; height: 14px; margin-top: .2rem; border-radius: 50%; background: #d2d9e0; }
.promo-verdict[data-zona="ok"]   { background: var(--green-soft); color: #0f5c36; }
.promo-verdict[data-zona="ok"] .pv-dot { background: var(--green); }
.promo-verdict[data-zona="warn"] { background: var(--amber-soft); color: #7d4e06; }
.promo-verdict[data-zona="warn"] .pv-dot { background: var(--amber); }
.promo-verdict[data-zona="bad"]  { background: var(--red-soft); color: #8e1b1b; }
.promo-verdict[data-zona="bad"] .pv-dot { background: var(--red); }
.promo-alerta {
  margin-top: .8rem; padding: .85rem 1rem; border-radius: var(--r);
  background: var(--red); color: #fff; font-size: .9rem; line-height: 1.5;
}
.promo-explica { margin-top: 1rem; font-size: .84rem; line-height: 1.55; color: var(--ink-2); }
.promo-leyenda { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.pv-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .85rem;
  padding: .65rem .7rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
}
.pv-base { border-left: 1px dashed var(--line); padding-left: .6rem; }
.pv-value { display: block; font-size: 1.12rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pv-base .pv-value { color: var(--accent-dark); }
.vg-pct { font-size: .88rem; font-weight: 600; color: var(--muted); }
.base-nota { margin-top: .6rem; font-size: .74rem; line-height: 1.45; color: var(--ink-2); }
.base-nota:empty { display: none; }
.envase-line {
  margin-top: .7rem; padding: .55rem .65rem; border-radius: var(--r-sm);
  background: var(--accent-soft); color: #7a2f14; font-size: .78rem; line-height: 1.5;
}

/* --- Precio sugerido de carta --- */
.carta { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.carta-title { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.carta-base { font-size: .78rem; color: var(--ink-2); margin: .25rem 0 .6rem; line-height: 1.45; }
.carta-opts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.carta-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; text-align: left;
  padding: .6rem .65rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  border-top: 3px solid #d2d9e0; transition: border-color .15s, background-color .15s;
}
.carta-opt[data-zona="ok"] { border-top-color: var(--green); }
.carta-opt[data-zona="warn"] { border-top-color: var(--amber); }
.carta-opt[data-zona="bad"] { border-top-color: var(--red); }
.carta-opt:hover { background: var(--surface-2); border-color: var(--ink-2); }
.co-label { font-size: .68rem; font-weight: 600; color: var(--muted); }
.co-price { font-size: 1.2rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.co-sub, .co-fc { font-size: .7rem; color: var(--muted); line-height: 1.35; font-variant-numeric: tabular-nums; }
.co-fc { color: var(--ink-2); }
.co-use { margin-top: .3rem; font-size: .72rem; font-weight: 600; color: var(--accent-text); }

/* --- Alertas del plato --- */
.alertas { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--amber-soft); }
.alertas-title { font-size: .78rem; font-weight: 700; color: #7d4e06; margin-bottom: .3rem; }
.alertas ul { margin: 0; padding-left: 1.05rem; display: grid; gap: .3rem; }
.alertas li { font-size: .8rem; line-height: 1.45; color: #6b4306; }

/* --- Indirectos --- */
.indirectos {
  display: flex; gap: .8rem; align-items: flex-start;
  margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line-2);
}
.indirectos-note { font-size: .77rem; color: var(--muted); line-height: 1.45; }

/* --- Panel de resultados --- */
.results-inner {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
}
.cost-block { padding: 1rem 1.1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cost-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: .32rem 0; font-size: .88rem; color: var(--ink-2);
}
.cost-row strong { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.cost-row em { font-style: normal; color: var(--muted); font-size: .8rem; }
.cost-row-total { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .55rem; font-weight: 600; }
.cost-row-hero { margin-top: .3rem; }
.cost-row-hero span { font-weight: 600; color: var(--ink); }
.cost-row-hero strong { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--accent-dark); }

.price-block { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.mode-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px;
  background: var(--line-2); border-radius: var(--r-sm); margin-bottom: .85rem;
}
.mode-btn {
  padding: .5rem .3rem; border-radius: 6px; font-size: .79rem; font-weight: 600;
  color: var(--muted); transition: background-color .18s, color .18s;
}
.mode-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --- Semáforo --- */
.verdict { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.verdict-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.verdict-label { display: block; font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.verdict-value {
  display: block; font-size: 2.5rem; font-weight: 700; line-height: 1.05;
  letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.verdict-light { display: flex; flex-direction: column; gap: 5px; padding: 6px; background: var(--line-2); border-radius: 99px; }
.verdict-light span { width: 13px; height: 13px; border-radius: 50%; background: #d2d9e0; transition: background-color .25s var(--ease-out); }
.verdict[data-zona="ok"]   .verdict-light span:nth-child(1) { background: var(--green); }
.verdict[data-zona="warn"] .verdict-light span:nth-child(2) { background: var(--amber); }
.verdict[data-zona="bad"]  .verdict-light span:nth-child(3) { background: var(--red); }
.verdict[data-zona="ok"]   .verdict-value { color: var(--green); }
.verdict[data-zona="warn"] .verdict-value { color: var(--amber-text); }
.verdict[data-zona="bad"]  .verdict-value { color: var(--red); }
.verdict-msg {
  margin-top: .55rem; padding: .55rem .7rem; border-radius: var(--r-sm);
  font-size: .82rem; line-height: 1.45; font-weight: 500;
  background: var(--line-2); color: var(--ink-2);
}
.verdict[data-zona="ok"]   .verdict-msg { background: var(--green-soft); color: #0f5c36; }
.verdict[data-zona="warn"] .verdict-msg { background: var(--amber-soft); color: #7d4e06; }
.verdict[data-zona="bad"]  .verdict-msg { background: var(--red-soft); color: #8e1b1b; }
.verdict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .85rem; }
.vg-label { display: block; font-size: .73rem; color: var(--muted); font-weight: 600; }
.vg-value { display: block; font-size: 1.28rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.vg-sub { display: block; font-size: .73rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.verdict-extra { margin-top: .7rem; font-size: .78rem; color: var(--muted); line-height: 1.45; }

.field-ventas { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.1rem .6rem; }
.actions .btn { flex: 1 1 auto; }
.foto-field { display: flex; align-items: center; gap: .7rem; padding: 0 1.1rem .8rem; }
.foto-label {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  font-size: .78rem; color: var(--muted); font-weight: 500;
}
.foto-label:hover { color: var(--accent-text); }
.privacy-badge {
  margin: 0; padding: .75rem 1.1rem; font-size: .78rem; line-height: 1.5;
  color: var(--ink-2); background: var(--surface-2); border-top: 1px solid var(--line);
}

/* --- Explicación de la merma --- */
.merma-explainer {
  margin-top: 1rem; padding: 1.1rem;
  background: linear-gradient(180deg, #fffdfb, var(--surface));
  border: 1px solid #f0dcd2; border-radius: var(--r-lg);
}
.merma-explainer h3 { font-size: 1.02rem; margin-bottom: .75rem; }
.merma-cols { display: grid; gap: .8rem; }
.merma-cols p { font-size: .86rem; line-height: 1.5; }
.me-tag {
  display: inline-block; margin-bottom: .3rem; padding: .16rem .5rem;
  border-radius: 99px; font-size: .68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--line-2); color: var(--muted);
}
.me-tag-alt { background: var(--accent-soft); color: var(--accent-dark); }
.merma-punch {
  margin-top: .85rem; padding-top: .8rem; border-top: 1px dashed #ecd5c9;
  font-size: .86rem; line-height: 1.55; color: var(--ink-2);
}
.merma-punch strong { color: var(--accent-dark); }

/* --- Anuncios --- */
.ad-slot {
  position: relative; display: grid; place-items: center;
  border: 1px dashed #cfd8e0; border-radius: var(--r);
  background: repeating-linear-gradient(45deg, #fbfcfd, #fbfcfd 10px, #f4f6f8 10px, #f4f6f8 20px);
}
.ad-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .16em;
  color: var(--muted); text-transform: uppercase;
}
.ad-leaderboard { min-height: 100px; margin: 1.5rem 0 .5rem; }
.ad-incontent { min-height: 250px; max-width: 336px; margin: 1.5rem auto; }
.ad-modal-slot { min-height: 250px; width: 100%; margin: .8rem 0; }
.ad-toast-slot { min-height: 100px; width: 100%; }

.ad-modal {
  width: min(340px, calc(100vw - 4rem)); padding: 1.1rem;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); background: var(--surface);
  overflow: visible;                     /* el boton de cerrar sobresale por fuera */
  margin: auto;                          /* el reset global quita el centrado nativo del <dialog> */
  max-height: calc(100dvh - 4rem);
}
.ad-modal::backdrop { background: rgba(16,24,32,.45); }
.ad-modal-head { font-size: .88rem; font-weight: 600; color: var(--ink); padding-right: 1.4rem; }
.ad-modal .btn { width: 100%; }

/* Boton de cerrar de los anuncios
   - area tactil de 44x44 (accesibilidad movil)
   - circulo oscuro solido con aspa blanca: contrasta sobre cualquier fondo
   - sobresale de la esquina superior derecha, FUERA del recuadro del anuncio,
     para no provocar clics accidentales (politicas de AdSense)
   - siempre por encima del anuncio */
.ad-close {
  position: absolute; top: -24px; right: -24px; z-index: 5;
  width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 50%;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ad-close span {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 1.25rem; font-weight: 500; line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(16,24,32,.35), 0 0 0 1px rgba(16,24,32,.12);
  transition: transform .15s var(--ease-out), background-color .15s;
}
.ad-close:hover span { background: var(--accent-dark); transform: scale(1.1); }
.ad-close:active span { transform: scale(.92); background: #000; }
.ad-close:focus-visible { outline: none; }
.ad-close:focus-visible span { outline: 3px solid var(--accent); outline-offset: 2px; }

.ad-toast {
  position: fixed; right: 1.6rem; bottom: 1.2rem; z-index: 70;
  width: min(300px, calc(100vw - 3.2rem));
  padding: 1.75rem .6rem .6rem;          /* aire arriba: el anuncio empieza lejos del boton de cerrar */
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg);
  animation: toastIn .4s var(--ease-out) both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }

/* --- Avisos flotantes de la app --- */
.toast-stack {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: .4rem;
  pointer-events: none; width: max-content; max-width: calc(100vw - 2rem);
}
.toast {
  padding: .6rem .9rem; border-radius: 99px; font-size: .84rem; font-weight: 500;
  background: var(--ink); color: #fff; box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease-out) both;
}
.toast-ok { background: var(--green); }
.toast-err { background: var(--red); }

/* --- Barra móvil --- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: none; align-items: center; gap: 1rem;
  padding: .55rem var(--gutter) calc(.55rem + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.mobile-bar div { display: flex; flex-direction: column; }
.mobile-bar span { font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.mobile-bar strong { font-size: 1.05rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.mb-dot { margin-left: auto; width: 14px; height: 14px; border-radius: 50%; background: #d2d9e0; }
.mb-dot[data-zona="ok"] { background: var(--green); }
.mb-dot[data-zona="warn"] { background: var(--amber); }
.mb-dot[data-zona="bad"] { background: var(--red); }

/* ============================== 6. Secciones ============================== */
.hero { padding: clamp(1rem, 4vw, 2.8rem) 0 .9rem; }
.hero-sub { max-width: 62ch; margin-top: .55rem; font-size: clamp(.9rem, 2.2vw, 1.06rem); color: var(--ink-2); }
.hero-sub strong { color: var(--ink); font-weight: 600; }
.noscript-msg {
  padding: .9rem 1rem; margin-bottom: 1rem; border-radius: var(--r);
  background: var(--amber-soft); color: #7d4e06; font-size: .9rem;
}

.section { padding: clamp(2.2rem, 6vw, 3.6rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 68ch; margin-bottom: 1.4rem; }
.section-sub { margin-top: .5rem; color: var(--ink-2); font-size: .97rem; }

/* --- Simulador --- */
.sim-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 1.1rem;
}
.sim-controls { display: flex; flex-wrap: wrap; gap: .9rem; align-items: flex-end; }
.sim-controls .field { flex: 1 1 210px; }
.sim-controls .btn { flex: none; }
.sim-controls label strong { color: var(--accent-dark); font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%;
  height: 26px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--green) 0%, #e2e8ee 37.5%, var(--red) 100%); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--green) 0%, #e2e8ee 37.5%, var(--red) 100%); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.sim-scale { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sim-story {
  margin: 1rem 0; padding: .8rem .95rem; border-radius: var(--r);
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  font-size: .92rem; line-height: 1.55; color: #7a2f14;
}
.sim-story strong { color: var(--accent-dark); }
.sim-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.sim-cell {
  padding: .75rem .8rem; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface-2);
}
.sim-cell-hero { background: var(--ink); border-color: var(--ink); }
.sim-cell-hero .sc-label { color: rgba(255,255,255,.62); }
.sim-cell-hero .sc-now { color: #fff; }
.sim-cell-hero .sc-before { color: rgba(255,255,255,.55); }
.sc-label { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); }
.sc-now { display: block; font-size: 1.3rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sc-before { display: block; font-size: .73rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- Ingeniería de menú --- */
.menu-empty {
  padding: 1.6rem; text-align: center; border: 1px dashed var(--line);
  border-radius: var(--r-lg); background: var(--surface-2);
  color: var(--muted); font-size: .9rem;
}
.menu-wrap { display: grid; gap: 1rem; }
.matrix-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1rem; box-shadow: var(--shadow-sm);
}
.matrix-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.lg { font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; }
.lg-estrella { background: var(--green-soft); color: #0f5c36; }
.lg-caballo  { background: #e8f1fb; color: #1a4f80; }
.lg-puzzle   { background: var(--amber-soft); color: #7d4e06; }
.lg-perro    { background: var(--red-soft); color: #8e1b1b; }
.chart-holder { width: 100%; }
.chart-holder canvas { width: 100%; height: auto; }
.chart-axis-note { margin-top: .6rem; font-size: .76rem; color: var(--muted); }

.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.menu-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 720px; }
.menu-table th, .menu-table td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--line-2); }
.menu-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.menu-table td { font-variant-numeric: tabular-nums; }
.menu-table tbody tr:last-child td { border-bottom: 0; }
.menu-table .t-name { font-weight: 600; color: var(--ink); font-variant-numeric: normal; }
.menu-table .t-action { font-variant-numeric: normal; color: var(--ink-2); max-width: 24ch; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .16rem .5rem; border-radius: 99px; white-space: nowrap; }
.tag-estrella { background: var(--green-soft); color: #0f5c36; }
.tag-caballo  { background: #e8f1fb; color: #1a4f80; }
.tag-puzzle   { background: var(--amber-soft); color: #7d4e06; }
.tag-perro    { background: var(--red-soft); color: #8e1b1b; }

.saved-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; margin-top: 1.8rem; }
.saved-bar h3 { font-size: 1rem; }
.saved-bar .count { color: var(--muted); font-weight: 500; }
.saved-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.saved-list { display: grid; gap: .6rem; margin-top: .9rem; grid-template-columns: 1fr; }
.saved-card {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.saved-main { flex: 1 1 auto; min-width: 0; }
.saved-name { font-weight: 600; color: var(--ink); font-size: .92rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-meta { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.saved-card .btn { flex: none; }
.storage-note {
  margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .8rem; line-height: 1.5; color: var(--ink-2);
}

/* --- Bloque promocional propio (se construye desde lib/sitio.js) --- */
.cta-block {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  margin: 2rem 0; padding: 1.2rem 1.3rem;
  background: var(--accent-soft); border: 1px solid #f2d9cd;
  border-radius: var(--r-lg);
}
.cta-text { flex: 1 1 260px; }
.cta-text h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.cta-text p { font-size: .84rem; color: var(--muted); }

/* --- Pasos --- */
.steps { display: grid; gap: 1rem; list-style: none; padding: 0; counter-reset: s; grid-template-columns: 1fr; }
.steps li {
  position: relative; padding: 1.1rem 1.1rem 1.1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.step-n {
  display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: .6rem;
  border-radius: 50%; background: var(--ink); color: #fff;
  font-size: .85rem; font-weight: 700;
}
.steps h3 { margin-bottom: .3rem; }
.steps p { font-size: .88rem; color: var(--ink-2); }

/* --- Usos --- */
.uses { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.uses article { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.uses h3 { font-size: .95rem; margin-bottom: .25rem; }
.uses p { font-size: .85rem; color: var(--ink-2); }

/* --- Guía SEO --- */
#guia p { margin-top: .85rem; font-size: .97rem; }
#guia h3 { margin-top: 1.8rem; font-size: 1.12rem; }
#guia strong { color: var(--ink); }

/* --- Glosario --- */
.glossary dt { font-weight: 700; color: var(--ink); margin-top: 1.1rem; font-size: .97rem; }
.glossary dd { margin: .25rem 0 0; font-size: .92rem; color: var(--ink-2); }
.glossary .dd-extra { font-size: .85rem; color: var(--muted); margin-top: .3rem; }

/* --- FAQ --- */
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: .55rem; overflow: hidden;
}
.faq summary {
  padding: .9rem 2.4rem .9rem 1rem; font-weight: 600; color: var(--ink);
  cursor: pointer; list-style: none; position: relative; font-size: .94rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1rem; top: 50%;
  width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 1rem 1rem; font-size: .9rem; color: var(--ink-2); }

/* --- Footer --- */
/* Pie unificado: enlaces arriba, marca y año, nota. Identico en todas las paginas. */
.site-footer { background: var(--ink); color: #b7c2cd; padding: 2.2rem 0 1.8rem; }
.footer-inner { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; }
.footer-links {
  display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; font-size: .92rem; font-weight: 500;
  padding-bottom: 1rem; margin-bottom: .3rem; width: 100%; border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-links a { color: #e6ebf0; display: inline-flex; align-items: center; min-height: 44px; }
.footer-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-brand { font-family: var(--display); font-size: 1.1rem; color: #fff; }
.footer-brand strong { color: var(--accent-on-dark); }
.footer-year { font-family: var(--sans); font-size: .82rem; color: #8b98a5; margin-left: .3rem; }
.footer-note { font-size: .85rem; max-width: 60ch; color: #9aa6b2; }

/* Descargo discreto bajo el panel de resultados */
.descargo {
  margin: 0; padding: .6rem 1.1rem .8rem; font-size: .7rem; line-height: 1.45;
  color: var(--muted); background: var(--surface-2);
}

/* --- Paginas legales y de contacto --- */
/* ~70 caracteres por linea: 35em con Inter a ~0,5em por letra media */
.legal { max-width: calc(35em + 2 * var(--gutter)); font-size: 1.02rem; }
.legal h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.legal h1 { margin-bottom: .4rem; }
.legal-fecha { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.legal h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.25;
  margin: 2.6rem 0 .8rem;
}
.legal p { font-size: 1rem; line-height: 1.75; color: var(--ink-2); }
.legal p + p { margin-top: 1rem; }
.legal a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.legal a:hover { color: var(--accent-solid); }
.legal strong { color: var(--ink); }
.contacto-email { margin: 1.4rem 0 .4rem; }
.contacto-email a { font-size: 1.3rem; font-weight: 600; text-decoration: none; }
.contacto-email a:hover { text-decoration: underline; }

/* --- Guias: indice y articulos --- */
/* Mismo aire de lectura que las paginas legales: ~70 caracteres por linea */
.art { max-width: calc(35em + 2 * var(--gutter)); }
.art h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); margin-bottom: .7rem; }
.art h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.62rem); line-height: 1.25;
  margin: 2.6rem 0 .8rem; scroll-margin-top: 78px;
}
.art h3 { font-size: 1.02rem; font-weight: 650; margin: 1.6rem 0 .5rem; }
.art p { font-size: 1rem; line-height: 1.75; color: var(--ink-2); }
.art p + p { margin-top: 1rem; }
.art a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.art a:hover { color: var(--accent-solid); }
.art strong { color: var(--ink); font-weight: 600; }
.art .lead { font-size: 1.08rem; line-height: 1.7; color: var(--ink); }
.art ol, .art ul { margin: 1rem 0 0 1.15rem; padding: 0; }
.art li { font-size: 1rem; line-height: 1.7; color: var(--ink-2); }
.art li + li { margin-top: .6rem; }

/* Cabecera del articulo: tiempo de lectura y fecha */
.art-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem;
  font-size: .84rem; color: var(--muted); margin-bottom: 1.6rem;
}
.art-meta .sep { color: var(--muted); }

/* Un enlace con aspecto de boton dentro de un articulo o de una pagina legal
   mantiene los colores del boton: si no, la regla de enlaces (.art a / .legal a)
   le pone el texto naranja sobre el fondo naranja y no se lee. */
.art a.btn, .legal a.btn { text-decoration: none; }
.art a.btn-primary, .legal a.btn-primary,
.art a.btn-primary:hover, .legal a.btn-primary:hover,
.art a.btn-primary:focus, .legal a.btn-primary:focus { color: #fff; }
.art a.btn-cta, .legal a.btn-cta { color: #fff; }
.art a.btn-secondary, .legal a.btn-secondary,
.art a.btn-secondary:hover, .legal a.btn-secondary:hover { color: var(--ink); }

/* Indice de contenidos */
.toc {
  margin: 0 0 2rem; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.toc-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .6rem;
}
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { font-size: .93rem; line-height: 1.5; color: var(--ink-2); }
.toc li + li { margin-top: .35rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }

/* Tabla del ejemplo: se desplaza en horizontal sin romper la pagina */
.tabla-scroll {
  margin: 1.2rem 0 .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
/* min-width: cabe entera en escritorio y se desplaza en el movil */
.tabla-scroll table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: .88rem; }
.tabla-scroll caption { caption-side: top; padding: .7rem .8rem 0; font-size: .8rem; color: var(--muted); text-align: left; }
.tabla-scroll th, .tabla-scroll td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line-2); }
.tabla-scroll thead th { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tabla-scroll tbody tr:last-child td { border-bottom: 0; }
.tabla-scroll .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla-scroll tfoot td { font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); border-bottom: 0; }
.tabla-scroll tfoot tr.total td { background: var(--surface-2); }
.tabla-hint { font-size: .78rem; color: var(--muted); margin-top: .4rem; }

/* Bloque de cifras del ejemplo */
.art-figures {
  margin: 1.2rem 0 .5rem; padding: 1rem 1.1rem;
  background: var(--accent-soft); border-radius: var(--r); border: 1px solid #f3ddd3;
}
.art-figures dl { display: grid; gap: .4rem; margin: 0; }
.art-figures div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.art-figures dt { color: var(--ink-2); }
.art-figures dd { margin: 0; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.art-figures .destaca dt, .art-figures .destaca dd { color: var(--accent-dark); font-weight: 700; }

/* Un unico anuncio a mitad del articulo.
   La X va FUERA del recuadro del anuncio, como en el resto del sitio. */
/* El hueco reserva 36px arriba para el boton: asi la X queda POR ENCIMA del
   recuadro del anuncio y no sobre el, que es lo que provoca clics accidentales. */
.ad-inline { position: relative; margin: 2.4rem auto; max-width: 336px; padding-top: 46px; }
.ad-inline .ad-slot { min-height: 250px; }
.ad-inline .ad-close { top: -2px; right: -6px; }

/* Cierre del articulo */
.art-cta {
  margin: 2.4rem 0 0; padding: 1.2rem 1.2rem 1.3rem;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--accent); border-radius: var(--r);
}
.art-cta p { margin-bottom: .9rem; }

/* Indice de guias */
.guias-list { display: grid; gap: 1rem; margin-top: 1.6rem; }
.guia-card {
  display: block; padding: 1.1rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color .18s var(--ease-out), transform .18s var(--ease-out), box-shadow .18s;
}
.guia-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.guia-card h2 { font-family: var(--display); font-size: 1.22rem; font-weight: 600; margin: .3rem 0 .4rem; }
.guia-card p { font-size: .93rem; line-height: 1.6; color: var(--ink-2); }
.guia-meta { font-size: .78rem; color: var(--muted); margin-top: .6rem; }

/* Marcadores sin rellenar: imposibles de pasar por alto */
.pendiente {
  color: var(--accent-dark) !important; background: var(--accent-soft);
  outline: 1px dashed var(--accent); outline-offset: 1px; border-radius: 3px;
  padding: 0 .2em; font-weight: 700;
}

/* ============================== 8. Responsive ============================== */
/* Compra y uso lado a lado solo cuando la tarjeta tiene ancho de verdad */
.tool-card { container-type: inline-size; }
@container (min-width: 640px) {
  .ing-groups { grid-template-columns: 1fr 1fr; }
  .ing-group { border-top: 0; padding-top: 0; }
  .ing-group + .ing-group { border-left: 1px dashed var(--line); padding-left: .7rem; }
}

@media (max-width: 719px) {
  .mobile-bar { display: flex; }
  body { padding-bottom: 62px; }
  .toast-stack { bottom: 76px; }
  .ad-toast { bottom: 72px; }
}

@media (min-width: 540px) {
  .merma-cols { grid-template-columns: 1fr 1fr; }
  .uses { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .saved-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 720px) {
  .header-nav { display: flex; }
  .tool-card { padding: 1.4rem; }
  .sim-grid { grid-template-columns: repeat(4, 1fr); }
  .promo-tipos { grid-template-columns: repeat(6, 1fr); }
  .combo-list { grid-template-columns: 1fr 1fr; }
  .config-bar { grid-template-columns: 230px 170px minmax(0, 1fr); gap: .85rem; padding: .85rem 1rem; }
  .config-note { grid-column: auto; justify-self: end; text-align: right; }
  .toc { padding: 1.2rem 1.4rem; }
}

@media (min-width: 960px) {
  .app-grid { grid-template-columns: minmax(0, 1fr) 372px; gap: 1.2rem; }
  .results-inner { position: sticky; top: 74px; }
  .uses { grid-template-columns: repeat(4, 1fr); }
  .saved-list { grid-template-columns: repeat(3, 1fr); }
  .merma-explainer { padding: 1.4rem; }
}

@media (min-width: 1280px) {
  .app-grid { grid-template-columns: minmax(0, 1fr) 400px; }
}

/* ============================== 9. Reduced motion ============================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ad-toast, .toast { animation: none; }
}

/* ============================== 10. Print ============================== */
@media print {
  .site-header, .ad-slot, .ad-toast, .mobile-bar, .actions,
  .cta-block, .site-footer, .section-head .eyebrow { display: none !important; }
  body { background: #fff; }
}

/* ============================== 11. Guia del porcentaje de food cost ============================== */
/* Reglas nuevas que solo usa el articulo /guias/porcentaje-de-food-cost-ideal/.
   No duplican nada: reutilizan .tabla-scroll y .art que ya existian arriba. */

/* Tablas estrechas (2 o 3 columnas). Las tablas anchas llevan min-width: 500px
   y se desplazan en el movil; estas caben enteras, asi que se les quita. */
.tabla-scroll.tabla-compacta table { min-width: 0; }
.tabla-scroll.tabla-compacta tbody th,
.tabla-scroll.tabla-compacta tfoot th {
  text-align: left; font-size: .88rem; font-weight: 400; color: var(--ink-2);
}
.tabla-scroll.tabla-compacta tfoot th { font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); border-bottom: 0; }
.tabla-scroll.tabla-compacta tfoot tr.total th { background: var(--surface-2); }

/* Comparativa de dos productos: la cabecera de cada columna, alineada a la derecha
   como sus numeros, y la fila del resultado destacada igual que en las otras tablas. */
.tabla-comp thead th.num { text-align: right; }
.tabla-comp thead td { border-bottom: 1px solid var(--line-2); }

/* A 360 px la comparativa todavia cabe entera si se aprieta un poco. */
@media (max-width: 480px) {
  .tabla-scroll.tabla-compacta table { font-size: .8rem; }
  .tabla-scroll.tabla-compacta th,
  .tabla-scroll.tabla-compacta td { padding: .45rem .4rem; }
  .tabla-scroll.tabla-compacta tbody th,
  .tabla-scroll.tabla-compacta tfoot th { font-size: .8rem; }
}

/* Dos listas enfrentadas: "puedes aceptar mas" / "necesitas menos".
   Apiladas en el movil, lado a lado desde 620 px. */
.listas-par { display: grid; gap: 1rem; margin: 1.3rem 0 .5rem; }
.lista-par {
  padding: 1rem 1.1rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r);
}
.lista-par h3 { margin: 0; font-size: .95rem; }
.lista-par.mas { border-left: 4px solid var(--green); }
.lista-par.menos { border-left: 4px solid var(--amber); }
.lista-par.mas h3 { color: var(--green); }
.lista-par.menos h3 { color: var(--amber-text); }
.lista-par ul { margin: .7rem 0 0 1.1rem; }
.lista-par li { font-size: .93rem; line-height: 1.6; color: var(--ink-2); }
.lista-par li + li { margin-top: .4rem; }

@media (min-width: 620px) {
  .listas-par { grid-template-columns: 1fr 1fr; }
}
