/* Alivio — tablero de precios.
   Fondo menta, tinta verde pino, Inter con cifras tabulares. Ver DESIGN.md. */

@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --mint: #e8fff2;
  --mint-2: #d5f3e2;
  --paper: #ffffff;
  --ink: #11261c;
  --ink-2: #3a5246;
  --ink-3: #4f675a;
  --line: #cde5d7;
  --line-2: #a9cbb8;
  --green: #2c6a4d;
  --green-hover: #22573e;
  --green-soft: #e3f6eb;
  --amber-bg: #fdf0d5;
  --amber-ink: #6e4a00;
  --ok-bg: #d9f2e4;
  --ok-ink: #1a5c3b;
  --rx-bg: #fff4ec;
  --rx-ink: #7a3412;
  --focus: #1f7a52;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-sm: 1rem;
  --t-base: 1.125rem;
  --t-lg: 1.3125rem;
  --t-xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --t-2xl: clamp(2.125rem, 1.35rem + 3vw, 3.5rem);
  --t-price: 1.5rem;

  --r: 10px;
  --r-lg: 14px;
  --gutter: 16px;
  --frame: 1180px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul[role="list"], ol { list-style: none; padding: 0; }
a { color: inherit; }
::selection { background: #bfe8d0; color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
input { caret-color: var(--green); }
html { scrollbar-color: var(--line-2) var(--mint); }

.frame { width: 100%; max-width: var(--frame); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Tipografía ---------- */
.h2 { font-size: var(--t-xl); line-height: 1.15; font-weight: 700; letter-spacing: -0.022em; text-wrap: balance; }
.h3 { font-size: var(--t-lg); line-height: 1.25; font-weight: 700; letter-spacing: -0.012em; }
.lead { font-size: var(--t-lg); line-height: 1.5; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.muted { color: var(--ink-2); }
.note { margin-top: 14px; font-size: var(--t-sm); color: var(--ink-3); max-width: 75ch; }
p { text-wrap: pretty; }
.link { color: var(--green); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.link--quiet { font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .link:hover { color: var(--green-hover); text-decoration-thickness: 2px; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; text-align: center; line-height: 1.25; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border: 0; border-radius: var(--r);
  font: 600 var(--t-base)/1.25 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease-out), transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--green); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--lg { min-height: 56px; padding: 0 28px; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--green-hover); }
  .btn--light:hover { background: var(--mint-2); }
}

/* ---------- Barra superior ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--mint) 92%, transparent); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .bar { backdrop-filter: blur(8px); } }
.bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.375rem; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.wordmark__dot { width: 24px; height: 24px; flex: none; }
.bar__nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.bar__nav a { padding: 10px 12px; border-radius: 8px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.bar__nav a[aria-current="page"] { color: var(--ink); background: var(--mint-2); }
@media (hover: hover) and (pointer: fine) { .bar__nav a:hover { color: var(--ink); background: var(--mint-2); } }
@media (max-width: 719px) { .bar__hide-sm { display: none; } .bar__nav a { padding: 10px 8px; } .wordmark { font-size: 1.25rem; } }
@media (max-width: 400px) { .bar__nav a:nth-child(1) { display: none; } }

/* ---------- Buscador ---------- */
.search { position: relative; }
.search__label { display: block; font-weight: 600; margin-bottom: 8px; }
.search__row { position: relative; display: flex; gap: 8px; }
.search__icon { position: absolute; left: 16px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search__input {
  flex: 1; min-width: 0; min-height: 56px; padding: 0 16px 0 48px;
  border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--paper);
  color: var(--ink); font: 400 var(--t-base) var(--font);
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.search__input::placeholder { color: #61786b; }
.search__input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px #c4ead5; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__btn { min-height: 56px; flex: none; }
.search__hint { margin-top: 8px; font-size: var(--t-sm); color: var(--ink-3); }
.search--hero .search__input { min-height: 64px; font-size: 1.1875rem; }
.search--hero .search__btn { min-height: 64px; padding: 0 28px; }
.search--compact .search__label, .search--compact .search__hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search--compact .search__input, .search--compact .search__btn { min-height: 48px; }
@media (max-width: 480px) {
  .search__row { flex-direction: column; }
  .search__icon { top: 28px; }
  .search--hero .search__icon { top: 32px; }
  .search--compact .search__row { flex-direction: row; }
  .search--compact .search__icon { top: 50%; }
}
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px;
  list-style: none; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 12px 32px -12px rgba(17, 38, 28, 0.28); max-height: 60vh; overflow-y: auto;
}
.suggest a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; text-decoration: none; }
.suggest a[aria-selected="true"] { background: var(--green-soft); }
@media (hover: hover) and (pointer: fine) { .suggest a:hover { background: var(--green-soft); } }
.suggest__name { display: block; font-weight: 600; }
.suggest__pres { display: block; font-size: var(--t-sm); color: var(--ink-3); }
.suggest__from { flex: none; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--green); }

/* ---------- Portada ---------- */
.hero { padding: 40px 0 56px; }
.hero__grid { display: grid; gap: 32px; }
.hero__title { font-size: var(--t-2xl); line-height: 1.06; font-weight: 800; letter-spacing: -0.035em; max-width: 15ch; text-wrap: balance; }
.hero__lead { margin: 18px 0 28px; font-size: var(--t-lg); color: var(--ink-2); max-width: 46ch; }
.hero__meta { margin-top: 16px; font-size: var(--t-sm); color: var(--ink-3); }
@media (max-width: 719px) { .hero__title br { display: none; } .hero { padding-top: 28px; } }
@media (min-width: 960px) {
  .hero { padding: 64px 0 88px; }
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; }
}

/* ---------- Panel y tablero ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
@media (min-width: 720px) { .panel { padding: 24px 28px; } }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel__title { font-size: var(--t-lg); font-weight: 700; line-height: 1.25; letter-spacing: -0.012em; }
.panel__title a { text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .panel__title a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.panel__sub { color: var(--ink-3); font-size: var(--t-sm); }
.panel__law { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--green-soft); color: var(--ok-ink); font-size: var(--t-sm); }
.panel__foot { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: var(--t-sm); color: var(--ink-3); }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--mint); border: 1px solid var(--line); }
.seg__opt { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 9px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out); }
.seg__opt.is-active { background: var(--green); color: var(--paper); }
@media (hover: hover) and (pointer: fine) { .seg__opt:not(.is-active):hover { background: var(--mint-2); color: var(--ink); } }
@media (max-width: 400px) { .seg { width: 100%; } .seg__opt { flex: 1; justify-content: center; padding: 0 8px; } }

.board { width: 100%; border-collapse: collapse; }
.board__row th, .board__row td { padding: 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; font-weight: 400; }
.board__row:last-child th, .board__row:last-child td { border-bottom: 0; }
.board__chain { padding-right: 12px !important; }
.board__name { display: block; font-weight: 600; line-height: 1.3; }
.board__branch { display: block; font-size: var(--t-sm); color: var(--ink-3); }
.board__src { width: 1%; padding-right: 16px !important; white-space: nowrap; }
.board__price { width: 1%; white-space: nowrap; text-align: right !important; }
.board__price .odo { font-size: var(--t-price); font-weight: 700; letter-spacing: -0.02em; }
.board__was { display: block; font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.board__was[hidden] { display: none; }
.is-best .board__price .odo { color: var(--green); font-size: 1.75rem; }
.board__best { display: block; font-size: 0.875rem; font-weight: 600; color: var(--green); }
@media (max-width: 560px) {
  .board__row { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .board__row:last-child { border-bottom: 0; }
  .board__row th, .board__row td { padding: 0; border: 0; }
  .board__chain { grid-column: 1; grid-row: 1; }
  .board__src { grid-column: 1; grid-row: 2; padding-top: 4px !important; }
  .board__price { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* Odómetro: cada dígito es una columna 0–9 que rueda hacia el nuevo valor. */
.odo { font-variant-numeric: tabular-nums; display: inline-block; line-height: 1.1; }
.odo.is-ready { display: inline-flex; align-items: flex-end; }
.odo__digits { display: inline-flex; align-items: flex-start; }
.odo__col { display: inline-block; height: 1.1em; line-height: 1.1em; overflow: hidden; vertical-align: top; }
.odo__strip { display: block; transition: transform 700ms var(--ease-out); transition-delay: var(--delay, 0ms); }
.odo__strip span { display: block; height: 1.1em; line-height: 1.1em; }
@media (prefers-reduced-motion: reduce) { .odo__strip { transition: none; } }

/* ---------- Etiquetas ---------- */
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.tag--est { background: var(--amber-bg); color: var(--amber-ink); }
.tag--ok { background: var(--ok-bg); color: var(--ok-ink); }

/* ---------- Secciones ---------- */
.section { padding: 56px 0; }
.section--paper { background: var(--paper); border-block: 1px solid var(--line); }
@media (min-width: 960px) { .section { padding: 88px 0; } }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section__lead { margin: -8px 0 24px; }

/* Lo más buscado */
.groups { display: grid; gap: 28px; }
@media (min-width: 760px) { .groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; } }
.group__title { font-size: var(--t-base); font-weight: 700; color: var(--ink-2); padding-bottom: 8px; border-bottom: 2px solid var(--ink); }

.mlist { margin-top: 0; }
.mlist > li + li { border-top: 1px solid var(--line); }
.mlist--panel { margin-top: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 16px; }
.mrow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 72px; padding: 10px 0; text-decoration: none; }
.mrow__thumb { width: 48px; height: 48px; border-radius: 8px; background: var(--mint); display: grid; place-items: center; overflow: hidden; }
.mrow__thumb img { width: 100%; height: 100%; object-fit: contain; background: var(--paper); }
.mrow__name { display: block; font-weight: 600; line-height: 1.3; }
.mrow__desc { display: block; font-size: var(--t-sm); color: var(--ink-3); overflow-wrap: anywhere; }
.mrow__price { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrow__from { font-size: var(--t-sm); color: var(--ink-3); }
.mrow__amount { font-weight: 700; font-size: var(--t-lg); letter-spacing: -0.01em; }
.mrow__est { display: block; font-size: 0.875rem; color: var(--amber-ink); }
.mrow__none { font-size: var(--t-sm); color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .mrow:hover .mrow__name { color: var(--green); text-decoration: underline; text-underline-offset: 3px; } }
@media (max-width: 400px) { .mrow { grid-template-columns: minmax(0, 1fr) auto; } .mrow__thumb { display: none; } }

/* Descuentos */
.split { display: grid; gap: 32px; }
@media (min-width: 960px) { .split { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; } }
.split--tight { margin-top: 32px; gap: 16px; }
@media (min-width: 760px) { .split--tight { grid-template-columns: 1fr 1fr; gap: 20px; } }
.split__intro .lead { margin-top: 12px; }
.ilus { margin-top: 32px; width: min(320px, 80%); height: auto; }
@media (max-width: 959px) { .ilus { display: none; } }
.facts { display: grid; }
.fact { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 20px; padding: 20px 0; border-top: 1px solid var(--line); }
.fact:last-child { border-bottom: 1px solid var(--line); }
.fact__num { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.fact__num--word { font-size: 1.375rem; padding-top: 6px; letter-spacing: -0.02em; }
.fact dd { color: var(--ink-2); }
.fact dd strong { color: var(--ink); }
.facts--wide { margin-top: 16px; }
@media (max-width: 480px) { .fact { grid-template-columns: 1fr; gap: 8px; } }

/* Tabla de beneficios */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); }
.btable { width: 100%; border-collapse: collapse; min-width: 640px; }
.btable th, .btable td { padding: 16px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.btable tbody tr:last-child > * { border-bottom: 0; }
.btable thead th { font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); background: #f4fcf7; }
.btable__card { display: block; font-weight: 600; }
.btable__bank { display: block; font-size: var(--t-sm); color: var(--ink-3); font-weight: 400; }
.btable__benefit { font-weight: 700; color: var(--green); white-space: nowrap; }
.btable__detail { font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 680px) {
  .table-wrap { border: 0; background: none; overflow: visible; }
  .btable { min-width: 0; }
  .btable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .btable tr { display: block; margin-bottom: 12px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .btable th, .btable td { display: block; padding: 0; border: 0; }
  .btable td { margin-top: 6px; }
  .btable__benefit { font-size: var(--t-lg); }
}

/* Pasos */
.steps { display: grid; gap: 0; margin-top: 28px; counter-reset: s; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; } }
.step { padding: 20px 0; border-top: 2px solid var(--ink); }
.step__n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--green-soft); color: var(--ok-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.step__t { margin: 12px 0 6px; font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.012em; }
.step p { color: var(--ink-2); }

/* Preguntas */
.faq { display: grid; gap: 24px; }
@media (min-width: 960px) { .faq { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; } }
.qa { border-top: 1px solid var(--line-2); }
.qa:last-child { border-bottom: 1px solid var(--line-2); }
.qa__q { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; padding: 14px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: var(--t-lg); line-height: 1.3; }
.qa__q::-webkit-details-marker { display: none; }
.qa__q::after { content: ""; flex: none; width: 12px; height: 12px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: translateY(-3px) rotate(45deg); transition: transform 220ms var(--ease-out); }
.qa[open] .qa__q::after { transform: translateY(3px) rotate(-135deg); }
.qa__a { padding: 0 0 20px; color: var(--ink-2); max-width: 65ch; }

/* Cierre */
.cta { background: var(--ink); color: var(--mint); padding: 56px 0; }
.cta__grid { display: grid; gap: 24px; align-items: center; }
@media (min-width: 860px) { .cta__grid { grid-template-columns: 1fr auto; gap: 48px; } }
.cta__title { font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; color: var(--paper); margin-bottom: 8px; }
.cta p { color: #c7e6d4; max-width: 58ch; }

/* Pie */
.foot { background: var(--paper); border-top: 1px solid var(--line); padding: 48px 0 24px; }
.foot__grid { display: grid; gap: 32px; }
@media (min-width: 860px) { .foot__grid { grid-template-columns: 1.2fr 1fr 0.8fr; } }
.foot__brand p { margin: 10px 0 16px; color: var(--ink-2); }
.foot__brand .btn--light { border: 1px solid var(--line-2); }
.foot__links { display: grid; align-content: start; gap: 2px; }
.foot__links a { padding: 8px 0; color: var(--ink-2); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .foot__links a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; } }
.foot__last { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: var(--t-sm); color: var(--ink-3); }

/* ---------- Páginas interiores ---------- */
.page { padding: 32px var(--gutter) 72px; }
.page--narrow { max-width: 820px; }
.page__title { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 16px; text-wrap: balance; }
.page__count { margin-top: 24px; color: var(--ink-2); }
.page .search { margin-top: 24px; }
.block { margin-top: 48px; }
.block > p, .block > .h2 + p { margin-top: 12px; max-width: 70ch; }
.block .table-wrap { margin-top: 20px; }
.doc section { margin-top: 36px; }
.doc section p { margin-top: 10px; color: var(--ink-2); max-width: 68ch; }
.ticks { margin-top: 12px; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 12px; height: 7px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.empty-state { margin-top: 32px; padding: 28px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--paper); }
.empty-state p { margin-top: 8px; color: var(--ink-2); }

.topline { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; }
.topline > *, .search, .med__head > * { min-width: 0; }
@media (min-width: 860px) { .topline { grid-template-columns: 1fr minmax(320px, 420px); align-items: center; } }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: var(--t-sm); color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }

.med { padding-top: 28px; padding-bottom: 72px; }
.med__head { display: grid; gap: 16px 24px; align-items: end; }
@media (min-width: 720px) { .med__head { grid-template-columns: auto minmax(0, 1fr) auto; } .med__head:not(:has(.med__img)) { grid-template-columns: minmax(0, 1fr) auto; } }
.med__img { width: 120px; height: 120px; object-fit: contain; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; }
.med__title { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; overflow-wrap: anywhere; }
.med__pres { margin-top: 6px; font-size: var(--t-lg); color: var(--ink-2); }
.med__generic { margin-top: 4px; color: var(--ink-3); }
.med__generic strong { color: var(--ink); font-weight: 600; }
.med__range { display: grid; justify-items: start; }
@media (min-width: 720px) { .med__range { justify-items: end; text-align: right; } }
.med__range-label { font-size: var(--t-sm); color: var(--ink-3); }
.med__range-num { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--green); font-variant-numeric: tabular-nums; }
.med__range-sub { font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.med__board { margin-top: 28px; }
.med__board .notice { margin-top: 14px; }
.notice { margin-top: 20px; padding: 14px 16px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.notice--est { background: var(--amber-bg); border-color: #f1dcab; color: var(--amber-ink); }
.notice--rx { background: var(--rx-bg); border-color: #f5d3bd; color: var(--rx-ink); }
.empty { margin-top: 16px; color: var(--ink-2); }
.plist { margin-top: 16px; display: grid; gap: 8px; }
.plist li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.plist__name { font-weight: 600; }
.plist__detail { flex: 1; color: var(--ink-2); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.block .mlist { margin-top: 12px; }

/* A–Z */
.az__letters { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; margin: 24px 0 8px; padding: 10px 0; background: var(--mint); }
.az__letter { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .az__letter:hover { border-color: var(--green); color: var(--green); } }
.az__group { margin-top: 28px; }
.az__head { font-size: var(--t-xl); font-weight: 800; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.az__list { columns: 1; column-gap: 40px; margin-top: 8px; }
@media (min-width: 720px) { .az__list { columns: 2; } }
@media (min-width: 1040px) { .az__list { columns: 3; } }
.az__list li { break-inside: avoid; }
.az__list a { display: block; padding: 10px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.az__name { font-weight: 600; }
.az__pres { display: block; font-size: var(--t-sm); color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .az__list a:hover .az__name { color: var(--green); } }

/* Red pública */
.near { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.near[hidden] { display: none; }
.near__status { font-size: var(--t-sm); color: var(--ink-3); max-width: 60ch; }
.regions { margin-top: 24px; display: grid; gap: 8px; }
.region { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.region__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 60px; padding: 12px 20px; cursor: pointer; list-style: none; }
.region__head::-webkit-details-marker { display: none; }
.region__name { font-weight: 700; font-size: var(--t-lg); }
.region__count { color: var(--ink-3); font-size: var(--t-sm); margin-right: auto; }
.region__near { padding: 2px 10px; border-radius: 999px; background: var(--green); color: var(--paper); font-size: 0.875rem; font-weight: 600; }
.region__near[hidden] { display: none; }
.region__list { margin: 0; padding: 4px 20px 16px; list-style: none; columns: 1; column-gap: 32px; }
@media (min-width: 720px) { .region__list { columns: 2; } }
.region__list li { break-inside: avoid; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink-2); }

/* Entradas: suaves y desde un estado ya visible. */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__board { animation: rise 600ms var(--ease-out) both 120ms; }
  @keyframes rise { from { opacity: 0.001; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* Ajustes de especificidad (listas con role="list"). */
.region .region__list { padding: 4px 20px 16px; }
.panel .h3 + p, .panel .h3 + ul { margin-top: 10px; }
.mlist.mlist--panel { padding: 4px 18px; }
.mrow--noimg { grid-template-columns: minmax(0, 1fr) auto; }

/* Receta */
.upload, .manual { margin-top: 28px; display: grid; gap: 12px; justify-items: start; }
.upload__label { font-weight: 600; }
.upload__input { width: 100%; min-height: 56px; padding: 12px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--mint); font: inherit; color: var(--ink-2); }
.upload__input::file-selector-button { margin-right: 12px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--green); color: var(--paper); font: 600 var(--t-sm) var(--font); cursor: pointer; }
.upload__hint { font-size: var(--t-sm); color: var(--ink-3); }
.manual__list { width: 100%; display: grid; gap: 10px; margin: 4px 0 8px; }
.manual__row { display: flex; align-items: center; gap: 10px; }
.manual__input { flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: var(--r); background: var(--paper); font: 400 var(--t-base) var(--font); color: var(--ink); }
.manual__input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px #c4ead5; }
.hero__alt { margin-top: 10px; font-size: var(--t-sm); }

/* Cerca de ti (ficha) */
.near-med { margin-top: 24px; }
.near-med[hidden] { display: none; }
.near-med__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.near-med .near__status { margin-top: 10px; }
.near-med__list { margin: 12px 0 0; padding: 0; list-style: none; }
.near-med__item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.near-med__name { display: block; font-weight: 600; }
.near-med__meta { display: block; font-size: var(--t-sm); color: var(--ink-3); }
.near-med__right { display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
.near-med__price { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Precio por unidad */
.panel__controls { display: flex; flex-wrap: wrap; gap: 8px; }
.board__per { font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.board__per[hidden], .board__pack[hidden], .panel__unitnote[hidden] { display: none; }
.board__pack { display: block; font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.panel__unitnote { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--mint); border: 1px solid var(--line); color: var(--ink-2); font-size: var(--t-sm); }
.mrow__unit { display: block; font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 400px) { .panel__controls { width: 100%; } .panel__controls .seg { width: 100%; } }

/* Franja de ubicación (se muestra con un clic; la ubicación queda en este navegador) */
.loc { background: var(--paper); border-bottom: 1px solid var(--line); }
.loc[hidden] { display: none; }
.loc__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-block: 10px; }
.loc__ask, .loc__now { margin: 0; font-size: var(--t-sm); color: var(--ink); }
.loc__ask[hidden], .loc__now[hidden] { display: none; }
.loc__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loc__btn { min-height: 40px; padding-block: 8px; }
.loc__select { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-size: var(--t-sm); max-width: 100%; }
.loc__close { min-width: 40px; min-height: 40px; border: 0; background: transparent; color: var(--ink-3); font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: 8px; }
.loc__close:hover { background: var(--mint); }
.loc__status { flex-basis: 100%; margin: 0; font-size: 0.875rem; color: var(--ink-3); }
.loc__status:empty { display: none; }
.loc--set .loc__inner { padding-block: 6px; }
@media (max-width: 560px) { .loc__actions { width: 100%; } .loc__select { flex: 1; } }
.loc-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; max-width: 42vw; padding: 6px 12px; margin-left: auto; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.9375rem; font-weight: 500; cursor: pointer; }
.loc-chip[hidden] { display: none; }
.loc-chip svg { width: 18px; height: 18px; flex: none; color: var(--green); }
.loc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-chip:hover { background: var(--mint-2); }
.loc-chip[aria-expanded="true"] { border-color: var(--green); }
@media (max-width: 460px) {
  .loc-chip { padding: 8px; max-width: none; }
  .loc-chip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.err__code { margin: 0 0 8px; font-size: var(--t-sm); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--green); }
.est-more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.est-more summary { cursor: pointer; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; }
.est-more summary:hover { color: var(--green); }
.est-more[open] summary { margin-bottom: 8px; }
.est-more .board .is-best .board__best { display: none; }
.res-brands { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.res-brands__chip { font-size: 0.8125rem; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-3); background: var(--paper); }
.upload__pick { display: none; gap: 10px; flex-wrap: wrap; width: 100%; }
.upload--js .upload__pick { display: flex; }
.upload--js .upload__input, .upload--js .upload__fallback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.upload__fallback { font-size: var(--t-sm); color: var(--ink-3); }
.upload__btn { flex: 1 1 180px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; }
.upload__btn svg { width: 22px; height: 22px; flex: none; }
.upload__chosen { margin: 0; font-weight: 600; color: var(--green); overflow-wrap: anywhere; }
.basket { margin: 20px 0 28px; }
.basket__title { margin: 0 0 4px; }
.basket__lead { margin: 0 0 14px; color: var(--ink-3); font-size: var(--t-sm); }
.basket__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.basket__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.basket__row.is-best { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.basket__chain { font-weight: 600; }
.basket__meta { display: block; font-size: 0.875rem; color: var(--ink-3); font-weight: 400; }
.basket__total { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.25rem; white-space: nowrap; text-align: right; }
.basket__save { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--green); }
.basket__note { margin-top: 10px; font-size: 0.875rem; color: var(--ink-3); }
.upload__btn.btn--light { border: 1.5px solid var(--line-2); }
.basket:empty { display: none; }
.mrow__per { margin-left: 4px; font-size: 0.8125rem; color: var(--ink-3); font-weight: 500; }
.mrow__group { margin: 18px 0 6px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); }

/* Un producto, una tarjeta: presentaciones dentro y el precio de cada farmacia */
.mrow__stores { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: var(--t-sm); color: var(--ink-3); }
.mrow__text { min-width: 0; }
.mrow__store { overflow-wrap: anywhere; }
.mrow__store b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fam { padding: 12px 0 4px; }
.fam__head { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 14px; }
.fam--noimg .fam__head { grid-template-columns: minmax(0, 1fr); }
.fam__rows { margin: 8px 0 0 62px; }
.fam--noimg .fam__rows { margin-left: 0; padding-left: 14px; border-left: 2px solid var(--line); }
.fam__rows > li + li { border-top: 1px solid var(--line); }
.fam__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 56px; padding: 8px 0; text-decoration: none; }
.fam__pres { display: block; font-weight: 600; font-size: var(--t-sm); color: var(--ink); line-height: 1.3; }
.fam__row .mrow__amount { font-size: var(--t-base); }
@media (hover: hover) and (pointer: fine) { .fam__row:hover .fam__pres { color: var(--green); text-decoration: underline; text-underline-offset: 3px; } }
@media (max-width: 400px) { .fam__head { grid-template-columns: minmax(0, 1fr); } .fam__head .mrow__thumb { display: none; } .fam__rows, .fam--noimg .fam__rows { margin-left: 0; padding-left: 12px; border-left: 2px solid var(--line); } }

/* Caja y unidad, siempre los dos números */
.board__each { display: block; margin: 2px 0 0 auto; width: max-content; max-width: 19rem; white-space: normal; text-wrap: balance; font-size: var(--t-sm); font-weight: 400; line-height: 1.35; color: var(--ink-3); }
.board__pack { white-space: normal; width: max-content; max-width: 19rem; margin-left: auto; }
@media (max-width: 640px) { .board__each, .board__pack { max-width: 8.25rem; margin-left: 0; text-align: left; } .board__price { text-align: left !important; } }
.board__each [data-each] { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mrow__loose { color: var(--ink-3); font-weight: 400; }

/* Red pública: aviso con botón, siempre que el medicamento esté en el cuadro básico */
.pubnote { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 16px 0; padding: 16px 18px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green); }
.pubnote__text { flex: 1 1 22rem; min-width: 0; }
.pubnote__title { font-weight: 600; color: var(--ink); line-height: 1.35; }
.pubnote__detail { margin-top: 4px; font-size: var(--t-sm); color: var(--ink-2); }
.pubnote__btn { flex: 0 0 auto; white-space: nowrap; }
.mrow__pub { color: var(--green); font-weight: 500; }
@media (max-width: 520px) { .pubnote__btn { width: 100%; text-align: center; } }

/* Grupos que se abren y se cierran: «Combinaciones», «Otros parecidos», «Sin precio comprobado» */
.fold { margin-top: 18px; }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "Mostrar"; flex: 0 0 auto; font-size: var(--t-sm); font-weight: 600; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.fold[open] > summary::after { content: "Ocultar"; }
.fold > summary:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.fold[open] > summary { margin-bottom: 10px; }
.fold > .note { margin: 0 0 8px; }

/* Precios oficiales del MINSA */
.pubnote__prices { margin: 6px 0 2px; }
.pubnote__prices li { color: var(--ink); line-height: 1.45; }
.pubnote__prices strong { color: var(--green); font-variant-numeric: tabular-nums; }
.fam__pub { font-weight: 500; }
.ptable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.ptable { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.ptable th, .ptable td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-weight: 400; }
.ptable thead th { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ptable tbody tr:last-child th, .ptable tbody tr:last-child td { border-bottom: 0; }
.ptable td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable__unit { color: var(--ink-3); }

/* Aviso de red pública: dos botones (disponibilidad en el MINSA y farmacias cercanas) */
.pubnote__actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; width: 19rem; max-width: 100%; }
.pubnote__actions .pubnote__btn { width: 100%; padding: 0 16px; text-align: center; justify-content: center; }
.pubnote__actions .btn--light { border: 1px solid var(--line-2); }
.pubnote__hint { font-size: var(--t-xs, 0.8125rem); color: var(--ink-3); line-height: 1.35; }
@media (max-width: 520px) { .pubnote__actions { width: 100%; } }

/* Franja del ambiente de calidad (nunca aparece en producción) */
.envbar { padding: 8px 16px; background: #fde68a; color: #5b4300; font-size: var(--t-sm); font-weight: 600; text-align: center; }
