/*!
 * Ecosistemas de Oaxaca — México Rojo
 * Tema oscuro con paleta rosa (análoga) + acento menta (complementario).
 * Todo está bajo .mxr para no chocar con el tema de WordPress.
 * Subir a: media.mexicorojo.com/descubriendo-todos-los-ecosistemas-de-oaxaca-de-montanas-a-manglares/ecosistemas-oaxaca.css
 */

.mxr {
  /* Neutros */
  --bg: #0a090c;
  --surface: #131117;
  --surface-2: #1b1820;
  --surface-3: #241f2a;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f5eff3;
  --muted: #b3a8b1;
  --faint: #7d727b;
  /* Rosas (análogos) */
  --pink: #ff4f9a;
  --pink-2: #ff7eb6;
  --rose: #ffb3d3;
  --blush: #ffe1ee;
  --magenta: #d81b6a;
  /* Complementario y apoyo */
  --mint: #4fe0b6;
  --amber: #ffbf69;
  --danger: #ff6b6b;
  --sky: #7cc4ff;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, .8);
  --glow: 0 0 0 1px rgba(255, 79, 154, .35), 0 18px 40px -18px rgba(255, 79, 154, .45);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 70ch;

  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(16px, 1.05vw + 11px, 18.5px);
  line-height: 1.72;
  letter-spacing: .005em;
  border-radius: 28px;
  overflow: hidden;
  overflow: clip; /* clip no rompe position: sticky */
  padding: 0 0 clamp(24px, 4vw, 56px);
  margin: 0 auto 2rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mxr *,
.mxr *::before,
.mxr *::after { box-sizing: border-box; }

.mxr ::selection { background: var(--pink); color: #fff; }

/* ---------- Tipografía ---------- */
.mxr h2,
.mxr h3,
.mxr h4 {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.18;
  letter-spacing: -.02em;
  margin: 0 0 .6em;
  font-weight: 800;
  text-transform: none;
  border: 0;
  padding: 0;
  background: none;
}
.mxr h2 {
  font-size: clamp(1.6rem, 2.6vw + .6rem, 2.45rem);
  margin-top: .2em;
  max-width: 24ch;
}
.mxr h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: .55em;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--rose));
}
.mxr h3 { font-size: clamp(1.15rem, 1vw + .8rem, 1.45rem); }
.mxr h4 { font-size: 1.05rem; font-weight: 700; }
.mxr h3 em,
.mxr h4 em { font-weight: 500; color: var(--rose); }

.mxr p { margin: 0 0 1.1em; color: var(--text); max-width: var(--measure); }
.mxr strong { color: #fff; font-weight: 700; }
.mxr em { color: inherit; }
.mxr ul,
.mxr ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.mxr li { margin: .35em 0; }

.mxr a {
  color: var(--rose);
  text-decoration: underline;
  text-decoration-color: rgba(255, 179, 211, .4);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color .2s, text-decoration-color .2s;
  box-shadow: none;
  border: 0;
}
.mxr a:hover,
.mxr a:focus-visible { color: #fff; text-decoration-color: var(--pink); }
.mxr :focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

.mxr sup { font-size: .68em; line-height: 0; vertical-align: super; }
.mxr sup a {
  text-decoration: none;
  color: var(--pink);
  font-weight: 700;
  padding: 0 .12em;
}

.mxr-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mxr-note { font-size: .82em; color: var(--muted); }

/* ---------- Barra de progreso ---------- */
.mxr-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}
.mxr-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--magenta), var(--pink), var(--rose));
  box-shadow: 0 0 12px rgba(255, 79, 154, .7);
}

/* ---------- Hero ---------- */
.mxr-hero {
  position: relative;
  min-height: clamp(440px, 72vh, 680px);
  display: flex;
  align-items: flex-end;
  margin-bottom: clamp(28px, 5vw, 56px);
}
.mxr-hero__media { position: absolute; inset: 0; margin: 0; }
.mxr-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.05);
}
.mxr-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(255, 79, 154, .28), transparent 60%),
    linear-gradient(180deg, rgba(10, 9, 12, .15) 0%, rgba(10, 9, 12, .55) 45%, var(--bg) 98%);
}
.mxr-hero__media .mxr-credit {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 2;
  max-width: 70%;
  text-align: right;
  background: rgba(10, 9, 12, .55);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 99px;
}
.mxr-hero__content {
  position: relative;
  z-index: 1;
  padding: 0 clamp(20px, 5vw, 64px) clamp(8px, 2vw, 20px);
  max-width: 900px;
}
.mxr-kicker {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blush);
  background: rgba(255, 79, 154, .18);
  border: 1px solid rgba(255, 79, 154, .45);
  padding: .35em .9em;
  border-radius: 99px;
  margin-bottom: 1rem;
}
.mxr .mxr-hero__lead {
  font-size: clamp(1.25rem, 1.6vw + .8rem, 1.85rem);
  line-height: 1.38;
  font-weight: 300;
  letter-spacing: -.01em;
  max-width: 30ch;
  margin-bottom: 1.1rem;
}
.mxr-hero__lead strong {
  font-weight: 800;
  background: linear-gradient(90deg, var(--pink), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mxr .mxr-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.mxr .mxr-hero__meta li {
  margin: 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: .3em .85em;
}

/* ---------- Secciones ---------- */
.mxr-section {
  padding: clamp(28px, 4vw, 52px) clamp(20px, 5vw, 64px);
  scroll-margin-top: 80px;
}
.mxr-section + .mxr-section { border-top: 1px solid var(--line); }

.mxr-dropcap::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: .85;
  font-weight: 800;
  padding: .06em .12em 0 0;
  color: var(--pink);
}

/* ---------- Callouts ---------- */
.mxr-callout {
  position: relative;
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 1.1rem 1.4rem;
  margin: 1.6rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 820px;
}
.mxr-callout::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--accent, var(--pink));
}
.mxr-callout--key { --accent: var(--pink); background: linear-gradient(135deg, rgba(255, 79, 154, .12), rgba(255, 79, 154, .02)); }
.mxr-callout--info { --accent: var(--mint); background: linear-gradient(135deg, rgba(79, 224, 182, .10), rgba(79, 224, 182, .01)); }
.mxr-callout--alert { --accent: var(--amber); background: linear-gradient(135deg, rgba(255, 191, 105, .11), rgba(255, 191, 105, .01)); }
.mxr .mxr-callout__title {
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent, var(--pink));
  margin-bottom: .5rem;
}
.mxr-callout ul { margin-bottom: 0; }
.mxr-callout p:last-child { margin-bottom: 0; }

/* ---------- Índice ---------- */
.mxr-toc {
  margin: 0 clamp(20px, 5vw, 64px);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.mxr-toc summary,
.mxr details > summary {
  cursor: pointer;
  list-style: none;
}
.mxr details > summary::-webkit-details-marker { display: none; }
.mxr-toc summary {
  padding: 1rem 1.3rem;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mxr-toc summary::after,
.mxr-faq summary::after,
.mxr-refs summary::after {
  content: "+";
  font-size: 1.3em;
  font-weight: 400;
  color: var(--pink);
  transition: transform .25s;
}
.mxr-toc details[open] summary::after,
.mxr-faq details[open] summary::after,
.mxr-refs details[open] summary::after { transform: rotate(45deg); }
.mxr-toc ol {
  columns: 2 260px;
  column-gap: 2rem;
  margin: 0;
  padding: 0 1.3rem 1.2rem 2.6rem;
  font-size: .92rem;
}
.mxr-toc li { break-inside: avoid; }
.mxr-toc a { text-decoration: none; color: var(--muted); }
.mxr-toc a:hover,
.mxr-toc a.is-current { color: var(--pink); }

.mxr-toc-fab {
  position: fixed;
  left: 16px;
  bottom: 18px;
  z-index: 9998;
  font: 700 .8rem/1 var(--font);
  letter-spacing: .06em;
  color: #fff;
  background: rgba(19, 17, 23, .85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 79, 154, .5);
  border-radius: 99px;
  padding: .8em 1.2em;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
}
.mxr-toc-fab.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.mxr-toc.is-floating {
  position: fixed;
  left: 16px;
  bottom: 70px;
  z-index: 9998;
  width: min(380px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  box-shadow: var(--shadow);
}
.mxr-toc.is-floating ol { columns: 1; }

/* ---------- Cifras ---------- */
.mxr-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr));
  gap: 14px;
  margin: 1.6rem 0 1.8rem;
}
.mxr-stat {
  position: relative;
  padding: 1.2rem 1.1rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.mxr-stat::before {
  content: "";
  position: absolute;
  width: 120px; height: 120px;
  right: -40px; top: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 79, 154, .35), transparent 70%);
  z-index: 0;
  pointer-events: none;
}
.mxr-stat > * { position: relative; z-index: 1; }
.mxr-stat:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: transparent; }
.mxr-stat__num {
  display: block;
  font-size: clamp(1.7rem, 1.2vw + 1.1rem, 2.25rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #fff, var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mxr-stat__label { display: block; font-weight: 600; font-size: .9rem; margin-top: .35rem; }
.mxr-stat__src { display: block; font-size: .72rem; color: var(--faint); margin-top: .5rem; }

/* ---------- Tarjetas de ecosistema ---------- */
.mxr-eco-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 18px;
  align-items: start;
  margin-top: 1.6rem;
}
.mxr-eco {
  --eco: var(--pink);
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  scroll-margin-top: 90px;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, border-color .35s;
}
.mxr-eco::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--eco), transparent);
  z-index: 2;
}
.mxr-eco:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--eco) 45%, transparent);
  box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--eco) 70%, transparent);
}
.mxr-eco.is-target { animation: mxr-pulse 1.6s ease 1; }
@keyframes mxr-pulse {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px var(--eco); }
}
.mxr-eco__head--plain {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 118px;
  padding: 1.1rem 1.25rem;
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--eco) 40%, transparent), transparent 70%),
    linear-gradient(160deg, var(--surface-3), var(--surface));
}
.mxr-eco__num {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1.2px color-mix(in srgb, var(--eco) 85%, #fff);
}
.mxr-eco__body > .mxr-eco__num { display: block; font-size: 1.6rem; margin-bottom: .2rem; }
.mxr-eco__alt {
  font-size: .75rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--eco);
  border-radius: 99px;
  padding: .3em .75em;
}
.mxr-eco__media { position: relative; margin: 0; }
.mxr-eco__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .8, .2, 1);
}
.mxr-eco:hover .mxr-eco__media img { transform: scale(1.04); }
.mxr-eco__body { padding: 1.15rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.mxr-eco__body h3 { margin-bottom: .45em; }
.mxr .mxr-eco__tldr { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.mxr-eco details { margin-top: auto; }
.mxr-eco summary {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: .55em 1.05em;
  transition: background .25s, border-color .25s, color .25s;
}
.mxr-eco summary::after { content: "↓"; transition: transform .25s; }
.mxr-eco summary:hover { border-color: var(--eco); color: var(--eco); }
.mxr-eco details[open] summary { background: var(--eco); border-color: var(--eco); color: var(--bg); }
.mxr-eco details[open] summary::after { transform: rotate(180deg); }
.mxr .mxr-keys {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  font-size: .9rem;
  animation: mxr-fade .35s ease;
}
.mxr .mxr-keys li {
  position: relative;
  padding: .55rem 0 .55rem 1.1rem;
  margin: 0;
  border-bottom: 1px dashed var(--line);
}
.mxr .mxr-keys li:last-child { border-bottom: 0; }
.mxr .mxr-keys li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.05rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--eco);
}
.mxr .mxr-eco__more { font-size: .85rem; color: var(--muted); margin: 1rem 0 0; }
@keyframes mxr-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Altitud interactiva ---------- */
.mxr-altitude {
  --t: .43;
  margin-top: 1.4rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(0deg, rgba(79, 209, 224, .10) 0%, rgba(255, 207, 107, .08) 30%, rgba(95, 211, 139, .08) 55%, rgba(255, 156, 204, .12) 85%, rgba(255, 255, 255, .06) 100%),
    var(--surface);
}
.mxr-altitude__readout { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.mxr-altitude__value { font-size: clamp(1.8rem, 3vw + .6rem, 2.8rem); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mxr-altitude__temp { color: var(--muted); font-size: .92rem; }
.mxr-altitude__temp strong { color: var(--pink); font-size: 1.2em; }
.mxr-altitude input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(90deg, #4fd1e0, #ffcf6b 25%, #5fd38b 45%, #ff9ccc 75%, #f5eff3);
  outline: none;
  margin: .4rem 0;
  border: 0;
  padding: 0;
}
.mxr-altitude input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 4px solid var(--pink);
  box-shadow: 0 0 0 6px rgba(255, 79, 154, .25);
  cursor: grab;
}
.mxr-altitude input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 4px solid var(--pink);
  box-shadow: 0 0 0 6px rgba(255, 79, 154, .25);
  cursor: grab;
}
.mxr-altitude__scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--faint); margin-bottom: 1.1rem; }
.mxr .mxr-altitude__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.mxr .mxr-altitude__list li { margin: 0; transition: opacity .3s, transform .3s, filter .3s; }
.mxr .mxr-altitude__list a {
  display: inline-block;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: .45em .95em;
  border-radius: 99px;
  border: 1px solid rgba(255, 79, 154, .55);
  background: rgba(255, 79, 154, .14);
  color: var(--blush);
}
.mxr .mxr-altitude__list li.is-off { opacity: .28; filter: grayscale(1); transform: scale(.96); }
.mxr .mxr-altitude__list li.is-off a { border-color: var(--line); background: transparent; color: var(--muted); }

/* ---------- Barras ---------- */
.mxr-bars { display: grid; gap: 14px; margin: 1.5rem 0 1rem; max-width: 860px; }
.mxr-bar {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) 2fr 8.5rem;
  align-items: center;
  gap: .4rem 1rem;
  font-size: .9rem;
}
.mxr-bar__label { font-weight: 600; }
.mxr-bar__track { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.mxr-bar__fill {
  display: block;
  height: 100%;
  width: calc(var(--v) * 1% / .3);
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--magenta), var(--pink), var(--rose));
  transform-origin: 0 50%;
  transition: transform 1.2s cubic-bezier(.2, .8, .2, 1);
}
.mxr.js .mxr-bars:not(.is-in) .mxr-bar__fill { transform: scaleX(0); }
.mxr-bar--muted .mxr-bar__fill { background: repeating-linear-gradient(45deg, #4a4350 0 6px, #3a3440 6px 12px); }
.mxr-bar__val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .82rem; white-space: nowrap; text-align: right; }
@media (max-width: 640px) {
  .mxr-bar { grid-template-columns: 1fr auto; }
  .mxr-bar__track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Tablas ---------- */
.mxr-table-wrap {
  overflow-x: auto;
  margin: 1.6rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.mxr .mxr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
.mxr-table caption {
  caption-side: top;
  text-align: left;
  padding: 1rem 1.1rem .4rem;
  font-weight: 800;
  color: var(--rose);
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.mxr .mxr-table th,
.mxr .mxr-table td {
  text-align: left;
  vertical-align: top;
  padding: .85rem 1.1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
}
.mxr .mxr-table thead th {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}
.mxr .mxr-table tbody tr { transition: background .2s; }
.mxr .mxr-table tbody tr:hover { background: rgba(255, 79, 154, .06); }
.mxr .mxr-table tbody th { font-weight: 700; color: #fff; white-space: nowrap; }
.mxr .mxr-table td strong { color: var(--pink); }
.mxr .mxr-table td.is-up { color: var(--mint); font-weight: 700; }
.mxr .mxr-table td.is-down { color: var(--danger); font-weight: 700; }
.mxr .mxr-table--taxa { min-width: 680px; }

/* ---------- Climas ---------- */
.mxr-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; margin-top: 1.4rem; }
.mxr-duo__card {
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.mxr-duo__card--cold { background: radial-gradient(120% 90% at 0% 0%, rgba(124, 196, 255, .2), transparent 60%), var(--surface); }
.mxr-duo__card--hot { background: radial-gradient(120% 90% at 100% 0%, rgba(255, 79, 154, .25), transparent 60%), var(--surface); }
.mxr .mxr-duo__tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3em .8em;
  border-radius: 99px;
  margin-bottom: .9rem;
}
.mxr-duo__card--cold .mxr-duo__tag { background: rgba(124, 196, 255, .18); color: var(--sky); }
.mxr-duo__card--hot .mxr-duo__tag { background: rgba(255, 79, 154, .18); color: var(--pink); }
.mxr-duo__card ul { font-size: .92rem; padding-left: 1.1em; }

/* ---------- Galería de especies ---------- */
.mxr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.2rem 0 1.4rem;
  position: sticky;
  top: 8px;
  z-index: 5;
  padding: .5rem;
  border-radius: 99px;
  background: rgba(10, 9, 12, .7);
  backdrop-filter: blur(10px);
  width: fit-content;
  max-width: 100%;
}
.mxr .mxr-filters button {
  font: 700 .82rem/1 var(--font);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: .7em 1.1em;
  cursor: pointer;
  transition: all .25s;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
}
.mxr .mxr-filters button:hover { color: #fff; border-color: var(--pink); }
.mxr .mxr-filters button.is-active { color: #fff; background: var(--pink); border-color: var(--pink); box-shadow: 0 8px 20px -8px rgba(255, 79, 154, .8); }

.mxr-species {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 18px;
}
.mxr-sp {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, border-color .35s, opacity .3s;
}
.mxr-sp:hover { transform: translateY(-5px); box-shadow: var(--glow); border-color: transparent; }
.mxr-sp.is-hidden { display: none; }
.mxr-sp__fig { margin: 0; }
.mxr .mxr-sp__media {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface-2);
  cursor: zoom-in;
  overflow: hidden;
}
.mxr-sp__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), filter .4s;
}
.mxr-sp:hover .mxr-sp__media img { transform: scale(1.06); }
.mxr-sp__rank {
  position: absolute;
  left: 10px; top: 10px;
  z-index: 1;
  font-size: .75rem;
  font-weight: 800;
  color: #fff;
  background: rgba(10, 9, 12, .65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 79, 154, .6);
  border-radius: 99px;
  padding: .25em .7em;
}
.mxr-sp__body { padding: 1rem 1.1rem 1.2rem; }
.mxr .mxr-sp__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .55rem;
}
.mxr .mxr-sp__name { font-size: 1.08rem; margin-bottom: .45rem; }
.mxr .mxr-sp__name em { display: block; font-size: .85rem; font-weight: 500; margin-top: .15rem; }
.mxr .mxr-sp__body p { font-size: .88rem; color: var(--muted); margin-bottom: 0; }

.mxr-iucn {
  font-size: .7rem;
  letter-spacing: .04em;
  padding: .25em .6em;
  border-radius: 6px;
  color: var(--bg);
  font-weight: 800;
}
.mxr-iucn--lc { background: var(--mint); }
.mxr-iucn--nt { background: #b5e48c; }
.mxr-iucn--vu { background: var(--amber); }
.mxr-iucn--en { background: #ff8a5c; }
.mxr-iucn--cr { background: var(--danger); color: #fff; }
.mxr-iucn--na { background: var(--surface-3); color: var(--rose); }

/* ---------- Créditos de foto ---------- */
.mxr .mxr-credit {
  display: block;
  font-size: .68rem;
  line-height: 1.45;
  color: var(--faint);
  padding: .45rem .8rem;
  margin: 0;
  text-align: left;
  font-style: normal;
  background: rgba(0, 0, 0, .25);
  border-bottom: 1px solid var(--line);
}
.mxr .mxr-credit a { color: var(--muted); text-decoration-color: rgba(179, 168, 177, .35); }

/* ---------- Invasoras ---------- */
.mxr-section > h3 { margin-top: 1.8rem; }
.mxr-inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin: 1rem 0 1.4rem;
}
.mxr-inv {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .3s, transform .3s;
}
.mxr-inv:hover { border-color: rgba(255, 191, 105, .45); transform: translateY(-3px); }
.mxr .mxr-inv h4 { margin: .7rem 0 .45rem; }
.mxr .mxr-inv h4 em { display: block; font-size: .85rem; margin-top: .1rem; }
.mxr .mxr-inv p { font-size: .88rem; color: var(--muted); margin: 0; }
.mxr-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3em .7em;
  border-radius: 99px;
}
.mxr-badge--wild { background: rgba(255, 79, 154, .16); color: var(--pink-2); border: 1px solid rgba(255, 79, 154, .4); }
.mxr-badge--risk { background: rgba(255, 191, 105, .14); color: var(--amber); border: 1px solid rgba(255, 191, 105, .4); }
.mxr-badge--info { background: rgba(79, 224, 182, .12); color: var(--mint); border: 1px solid rgba(79, 224, 182, .35); }

/* ---------- Línea de tiempo ---------- */
.mxr .mxr-timeline {
  list-style: none;
  padding: 0 0 0 1.6rem;
  margin: 1.6rem 0;
  border-left: 2px solid transparent;
  border-image: linear-gradient(180deg, var(--pink), rgba(255, 79, 154, .05)) 1;
  max-width: 820px;
}
.mxr .mxr-timeline li { position: relative; margin: 0 0 1.8rem; }
.mxr .mxr-timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.6rem - 7px);
  top: .3rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--pink);
  box-shadow: 0 0 0 5px rgba(255, 79, 154, .15);
}
.mxr-timeline__when {
  display: inline-block;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--pink);
  margin-bottom: .3rem;
}
.mxr .mxr-timeline h4 { margin: 0 0 .4rem; font-size: 1.15rem; }
.mxr .mxr-timeline p { color: var(--muted); font-size: .95rem; margin: 0; }

/* ---------- Descubrimientos y mundo ---------- */
.mxr-disc-grid,
.mxr-world {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin-top: 1.4rem;
}
.mxr-disc {
  position: relative;
  padding: 1.3rem 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(79, 224, 182, .08), transparent 55%), var(--surface);
  border: 1px solid var(--line);
}
.mxr-disc__year {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--bg);
  background: var(--mint);
  padding: .25em .7em;
  border-radius: 99px;
}
.mxr .mxr-disc h4 { margin: .9rem 0 .5rem; font-size: 1.1rem; }
.mxr .mxr-disc p { font-size: .9rem; color: var(--muted); margin: 0; }
.mxr-world__item {
  padding: 1.3rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.mxr-world__big {
  display: block;
  font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--pink);
  margin-bottom: .4rem;
}
.mxr .mxr-world__item p { font-size: .9rem; color: var(--muted); margin: 0; }

/* ---------- Checklist ---------- */
.mxr .mxr-checks { list-style: none; padding: 0; max-width: 820px; }
.mxr .mxr-checks li { position: relative; padding: .6rem 0 .6rem 2.1rem; margin: 0; border-bottom: 1px solid var(--line); }
.mxr .mxr-checks li::before {
  content: "✓";
  position: absolute;
  left: 0; top: .6rem;
  width: 1.45rem; height: 1.45rem;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--bg);
  background: var(--mint);
  border-radius: 50%;
}

/* ---------- Quiz ---------- */
.mxr-quiz {
  display: grid;
  gap: 14px;
  margin-top: 1.2rem;
  max-width: 860px;
}
.mxr-quiz__q {
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.mxr .mxr-quiz__title { font-weight: 700; margin-bottom: .8rem; }
.mxr-quiz__opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.mxr .mxr-quiz__opts button {
  font: 600 .88rem/1.2 var(--font);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: .75em 1.05em;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: all .2s;
  box-shadow: none;
}
.mxr .mxr-quiz__opts button:hover:not(:disabled) { border-color: var(--pink); color: #fff; }
.mxr .mxr-quiz__opts button.is-right { background: var(--mint); border-color: var(--mint); color: var(--bg); }
.mxr .mxr-quiz__opts button.is-wrong { background: rgba(255, 107, 107, .18); border-color: var(--danger); color: #ffd0d0; }
.mxr .mxr-quiz__opts button:disabled { cursor: default; }
.mxr .mxr-quiz__score {
  font-weight: 800;
  font-size: 1.05rem;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 79, 154, .2), rgba(255, 79, 154, .04));
  border: 1px solid rgba(255, 79, 154, .35);
  margin: 0;
}

/* ---------- FAQ y referencias ---------- */
.mxr-faq { display: grid; gap: 10px; max-width: 860px; margin-top: 1.2rem; }
.mxr-faq details {
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .25s;
}
.mxr-faq details[open] { border-color: rgba(255, 79, 154, .4); }
.mxr-faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-weight: 700;
}
.mxr .mxr-faq details p { padding: 0 1.2rem 1.1rem; margin: 0; color: var(--muted); animation: mxr-fade .3s ease; }

.mxr-refs details { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.mxr-refs summary { display: flex; justify-content: space-between; padding: 1rem 1.3rem; font-weight: 700; }
.mxr .mxr-refs ol { padding: 0 1.3rem 1.2rem 3rem; margin: 0; font-size: .8rem; color: var(--muted); }
.mxr .mxr-refs li { margin: 0 0 .75rem; padding-left: .3rem; scroll-margin-top: 90px; word-break: break-word; }
.mxr .mxr-refs li:target { color: #fff; background: rgba(255, 79, 154, .12); border-radius: 8px; outline: 1px solid rgba(255, 79, 154, .4); outline-offset: 4px; }
.mxr .mxr-refs li::marker { color: var(--pink); font-weight: 800; }

/* ---------- Conclusión y compartir ---------- */
.mxr-conclusion {
  background: radial-gradient(90% 70% at 50% 0%, rgba(255, 79, 154, .14), transparent 70%);
}
.mxr-share {
  margin-top: 1.6rem;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  max-width: 820px;
}
.mxr .mxr-share p { font-weight: 700; margin-bottom: .8rem; }
.mxr-share__btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.mxr .mxr-btn {
  display: inline-flex;
  align-items: center;
  font: 700 .85rem/1 var(--font);
  color: #fff;
  text-decoration: none;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: .75em 1.2em;
  cursor: pointer;
  transition: all .2s;
  text-transform: none;
  letter-spacing: 0;
}
.mxr .mxr-btn:hover { background: var(--pink); border-color: var(--pink); color: #fff; }

/* ---------- Botón arriba ---------- */
.mxr-totop {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 9998;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  font: 800 1.1rem/1 var(--font);
  color: #fff;
  background: var(--pink);
  box-shadow: 0 10px 25px -8px rgba(255, 79, 154, .9);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
}
.mxr-totop.is-visible { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Lightbox ---------- */
.mxr-lightbox {
  border: 0;
  padding: 0;
  max-width: min(1100px, 94vw);
  width: 100%;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.mxr-lightbox::backdrop { background: rgba(5, 4, 6, .9); backdrop-filter: blur(6px); }
.mxr-lightbox img {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
  background: #000;
}
.mxr .mxr-lightbox__cap { text-align: center; font-size: .82rem; color: var(--muted); margin: .8rem auto 0; }
.mxr .mxr-lightbox__cap a { color: var(--rose); }
.mxr .mxr-lightbox__close {
  position: absolute;
  top: -14px; right: -6px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--pink);
  color: #fff;
  font: 400 1.6rem/1 var(--font);
  cursor: pointer;
  z-index: 2;
}

/* ---------- Animación de entrada ---------- */
.mxr.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.mxr.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Móvil ---------- */
@media (max-width: 640px) {
  .mxr { border-radius: 0; }
  .mxr-hero { min-height: 520px; }
  .mxr-hero__media .mxr-credit { left: 10px; right: 10px; max-width: none; text-align: left; border-radius: 10px; }
  .mxr-toc ol { columns: 1; }
  .mxr-filters { border-radius: 18px; }
  .mxr .mxr-table tbody th { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .mxr *,
  .mxr *::before,
  .mxr *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .mxr.js .reveal { opacity: 1; transform: none; }
  .mxr.js .mxr-bars:not(.is-in) .mxr-bar__fill { transform: none; }
}

@media print {
  .mxr { background: #fff; color: #000; }
  .mxr-progress, .mxr-totop, .mxr-toc-fab, .mxr-filters, .mxr-lightbox, .mxr-share { display: none !important; }
}
