/* CambiosFrontera — Mesa de Cambio */

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

:root {
  /* Página (fuera de la mesa) */
  --bg: #e4ddd0;
  --bg-pattern: #d5cec0;
  --surface: #f7f3ea;
  --ink: #1a1713;
  --muted: #5a5348;
  --rail-page: rgba(42, 33, 24, 0.14);

  /* Mesa (siempre felt verde; texto claro encima) */
  --felt: #17633e;
  --felt-deep: #0f4229;
  --felt-line: #e6cc8f;
  --felt-line-soft: rgba(230, 204, 143, 0.4);
  --rail: #2a2118;
  --mesa-ink: #fff8ea;
  --mesa-muted: rgba(255, 248, 234, 0.72);
  --panel: rgba(8, 30, 18, 0.45);
  --plaza-bg: rgba(6, 28, 16, 0.4);
  --plaza-hover: rgba(6, 28, 16, 0.58);
  --input-bg: #f7f3ea;
  --buy: #8af0b8;
  --sell: #ffb0a4;
  --cta: #1f9b4c;
  --cta-ink: #ffffff;
  --live: #5ef0a5;
  --shadow: rgba(28, 25, 20, 0.3);
}

html.dark {
  --bg: #10140f;
  --bg-pattern: #171c15;
  --surface: #1c221a;
  --ink: #f0ebe1;
  --muted: #a39b8c;
  --rail-page: rgba(240, 235, 225, 0.1);

  --felt: #0c3220;
  --felt-deep: #071c12;
  --felt-line: #d2b474;
  --felt-line-soft: rgba(210, 180, 116, 0.35);
  --rail: #050504;
  --mesa-ink: #fff8ea;
  --mesa-muted: rgba(255, 248, 234, 0.7);
  --panel: rgba(0, 0, 0, 0.4);
  --plaza-bg: rgba(0, 0, 0, 0.42);
  --plaza-hover: rgba(0, 0, 0, 0.58);
  --input-bg: #141a14;
  --buy: #6dffa9;
  --sell: #ff9f93;
  --cta: #25d366;
  --cta-ink: #062012;
  --live: #5ef0a5;
  --shadow: rgba(0, 0, 0, 0.55);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, var(--bg-pattern), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-pattern) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--rail-page);
}

.site-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  color: var(--ink);
}

.brand__name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.1;
  margin: 0;
}

.brand__tag {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 0.65rem;
  border: 1px solid var(--rail-page);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink);
}

.nav-toggle:hover {
  background: var(--surface);
}

.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 1.05rem;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header.is-nav-open .nav-toggle__bars span:nth-child(1) {
  transform: translateY(0.34rem) rotate(45deg);
}

.site-header.is-nav-open .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-0.34rem) rotate(-45deg);
}

@media (max-width: 719px) {
  .brand__tag {
    display: none;
  }

  .brand__name {
    font-size: clamp(1.15rem, 5.2vw, 1.45rem);
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    min-width: 11.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.55rem;
    border-radius: 0.85rem;
    border: 1px solid var(--rail-page);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.18);
    z-index: 50;
  }

  .site-header.is-nav-open .header-nav {
    display: flex;
  }

  .header-nav__link {
    width: 100%;
    justify-content: flex-start;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-ghost {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink);
  border: 1px solid var(--rail-page);
  border-radius: 0.65rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
}

.btn-ghost:hover {
  background: var(--surface);
}

.btn-cta {
  background: var(--cta);
  color: var(--cta-ink);
  border-radius: 0.75rem;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  width: 100%;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--cta) 35%, transparent);
}

.btn-cta:hover {
  filter: brightness(1.05);
}

.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--rail-page);
  color: var(--ink);
  font-size: 1.1rem;
}

/* —— Stage / hands —— */
.stage {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 2.5rem;
  overflow: visible;
}

/*
  Ad stage: full viewport width (no 90rem cap).
  Flex row on desktop so side rails eat leftover space;
  core stays a readable ~48rem mesa in the center.
*/
.stage.stage--ads-preview {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  box-sizing: border-box;
}

.stage__core {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  min-width: 0;
  flex: 0 1 48rem;
}

.ad-rail {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-sizing: border-box;
  min-width: 0;
}

@media (min-width: 1100px) {
  .stage.stage--ads-preview {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
  }

  .ad-rail {
    display: flex;
    flex: 1 1 0;
    width: auto;
    min-width: 10rem;
    max-width: 20rem;
    position: sticky;
    top: 5.25rem;
  }

  .stage__core {
    margin: 0;
  }
}

.hands {
  display: flex;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.hands picture {
  display: block;
  width: 100%;
  max-width: min(100%, 28rem);
  margin: 0 auto;
  line-height: 0;
  min-width: 0;
}

.hands img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 9.5rem;
  object-fit: contain;
  object-position: center;
  min-width: 0;
}

.hands--cashier {
  margin-bottom: -0.75rem;
  z-index: 3;
  position: relative;
}

.hands--user {
  margin-top: -0.65rem;
  z-index: 3;
  position: relative;
}

@media (max-width: 720px) {
  .hands picture {
    max-width: min(100%, 18rem);
  }
  .hands img {
    max-height: 7.5rem;
  }
}

@media (min-width: 900px) {
  .hands picture {
    max-width: min(100%, 32rem);
  }
  .hands img {
    max-height: 10.5rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hands--cashier.is-dealing img {
    animation: deal-hands 0.65s ease-out;
  }
}

@keyframes deal-hands {
  0% { transform: translateY(-12px); opacity: 0.4; }
  60% { transform: translateY(2px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

/* —— Mesa —— */
.mesa {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, color-mix(in srgb, var(--felt) 88%, #fff) 0%, var(--felt) 55%, var(--felt-deep) 100%);
  border: 8px solid var(--rail);
  border-radius: 1.5rem;
  box-shadow:
    0 24px 60px var(--shadow),
    inset 0 0 0 2px var(--felt-line),
    inset 0 0 80px rgba(0, 0, 0, 0.22);
  padding: 1.35rem 1rem 1.5rem;
  color: var(--mesa-ink);
}

@media (min-width: 768px) {
  .mesa {
    border-width: 10px;
    border-radius: 1.75rem;
    padding: 1.6rem 1.4rem 1.75rem;
  }
}

.mesa__rail-glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mesa__live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mesa-muted);
  margin-bottom: 0.75rem;
}

.mesa__live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--live);
}

@media (prefers-reduced-motion: no-preference) {
  .mesa__live-dot {
    animation: live-pulse 1.8s ease-in-out infinite;
  }
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.mesa__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--mesa-ink);
  text-align: center;
  padding: 0 0.25rem;
}

.mesa__subtitle {
  text-align: center;
  margin: 0 0 1.35rem;
  color: var(--mesa-muted);
  font-size: 0.95rem;
}

/* Calculator */
.calc {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto 1.5rem;
}

.calc__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.5rem;
  align-items: end;
}

@media (max-width: 640px) {
  .calc__row {
    grid-template-columns: 1fr;
  }
  .calc__arrow {
    display: none;
  }
}

.calc__field {
  min-width: 0;
}

.calc__field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--felt-line);
  margin-bottom: 0.35rem;
}

.calc__controls {
  display: flex;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.calc__controls input,
.calc__controls select {
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.65rem;
  padding: 0.7rem 0.55rem;
  font-size: 0.9rem;
  font-family: inherit;
  min-width: 0;
}

.calc__controls input {
  flex: 1 1 auto;
  width: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.calc__controls select {
  flex: 0 0 auto;
  width: 5.75rem;
  max-width: 42%;
}

.calc__arrow {
  font-size: 1.4rem;
  color: var(--felt-line);
  padding-bottom: 0.7rem;
}

.calc__result {
  margin-top: 1rem;
  background: var(--panel);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  text-align: center;
}

.calc__result-label {
  font-size: 0.8rem;
  color: var(--mesa-muted);
  margin: 0 0 0.25rem;
}

.calc__result-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mesa-ink);
  margin: 0;
  line-height: 1.15;
  word-break: break-word;
  transition: transform 0.2s ease;
}

@media (prefers-reduced-motion: no-preference) {
  .calc__result-value.is-updating {
    animation: result-pop 0.35s ease;
  }
}

@keyframes result-pop {
  0% { transform: scale(0.96); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.calc__rate {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--mesa-muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.calc__actions {
  margin-top: 1rem;
  display: grid;
  gap: 0.55rem;
}

.btn-secondary-mesa {
  background: transparent;
  color: var(--felt-line);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
  width: 100%;
}

.btn-secondary-mesa:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Plazas */
.plazas-label {
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--felt-line);
  margin: 0 0 0.85rem;
}

.plazas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  width: 100%;
}

@media (max-width: 720px) {
  .plazas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plaza {
  appearance: none;
  text-align: left;
  cursor: pointer;
  background: var(--plaza-bg);
  border: 1.5px solid var(--felt-line);
  border-radius: 0.85rem;
  padding: 0.75rem 0.65rem;
  color: var(--mesa-ink);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  font-family: inherit;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.plaza:hover {
  background: var(--plaza-hover);
}

.plaza.is-active {
  border-color: #fff3c8;
  box-shadow: 0 0 0 1px #fff3c8;
  background: var(--plaza-hover);
}

.plaza__top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.plaza__flag {
  font-size: 1.15rem;
}

.plaza__name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plaza__pair {
  margin-left: auto;
  font-size: 0.65rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.plaza__avg {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.35rem;
}

.plaza__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.plaza__buy { color: var(--buy); }
.plaza__sell { color: var(--sell); }

.plaza__note {
  margin: 0.35rem 0 0;
  font-size: 0.65rem;
  opacity: 0.75;
  overflow-wrap: anywhere;
}

.plaza--empty {
  opacity: 0.75;
  cursor: default;
}

.plaza--skeleton {
  min-height: 5.5rem;
  animation: skeleton 1.2s ease-in-out infinite;
}

@keyframes skeleton {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.75; }
}

/* Footer */
.site-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--rail-page);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.site-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

.site-footer h3,
.site-footer h4 {
  margin: 0 0 0.5rem;
  font-family: 'Fraunces', Georgia, serif;
}

.site-footer p,
.site-footer li,
.site-footer a {
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer a:hover {
  color: var(--ink);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: 0.35rem;
}

.site-footer__copy {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--rail) 12%, transparent);
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

/* —— House ads (IAB sizes, CambiosFrontera creatives) —— */
.house-ad {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.35rem;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  color: var(--mesa-ink);
  border-radius: 0.65rem;
  padding: 0.75rem 0.85rem;
  overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--felt-line) 70%, transparent);
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, color-mix(in srgb, var(--felt) 75%, #fff) 0%, var(--felt-deep) 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--felt-line) 25%, transparent);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.house-ad:hover {
  transform: translateY(-1px);
  border-color: #fff3c8;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff3c8 40%, transparent),
    0 8px 20px color-mix(in srgb, var(--shadow) 35%, transparent);
}

.house-ad--sell {
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, color-mix(in srgb, #3a2a12 40%, var(--felt)) 0%, #1a140c 100%);
  border-color: color-mix(in srgb, #e8b84a 65%, transparent);
}

.house-ad__eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--felt-line);
}

.house-ad__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--mesa-ink);
  letter-spacing: -0.02em;
}

.house-ad__body {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--mesa-muted);
  max-width: 16rem;
}

.house-ad__cta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff3c8;
  letter-spacing: 0.02em;
}

/* A — Medium Rectangle 300×250 */
.house-ad--a {
  width: 300px;
  height: 250px;
  max-width: 100%;
  margin: 1.15rem auto 0.35rem;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
}

.house-ad--a .house-ad__title {
  font-size: 1.25rem;
}

/* B — Leaderboard 728×90 */
.house-ad--b {
  width: min(728px, 100%);
  aspect-ratio: 728 / 90;
  height: auto;
  margin: 1rem auto 0;
  grid-auto-flow: row;
  padding: 0.35rem 0.85rem;
  gap: 0.15rem;
}

.house-ad--b .house-ad__title {
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
}

.house-ad--b .house-ad__body {
  font-size: 0.72rem;
  max-width: none;
}

/* C — Footer Leaderboard 728×90 */
.house-ad--c {
  width: min(728px, 100%);
  aspect-ratio: 728 / 90;
  height: auto;
  margin: 0 auto 1.5rem;
  color: var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, #e8b84a), var(--surface));
  border-color: color-mix(in srgb, #e8b84a 55%, transparent);
  box-shadow: none;
}

.house-ad--c .house-ad__eyebrow {
  color: #9a7209;
}

.house-ad--c .house-ad__title {
  color: var(--ink);
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
}

.house-ad--c .house-ad__cta {
  color: #8a6508;
}

a.house-ad--c:hover {
  border-color: #c9a227;
}

/* D — Wide Skyscraper 160×600 */
.house-ad--d {
  width: 160px;
  height: 600px;
  max-width: 100%;
  flex-shrink: 0;
  padding: 1.25rem 0.75rem;
  gap: 0.55rem;
  align-content: center;
}

.house-ad--d .house-ad__title {
  font-size: 1.15rem;
}

.house-ad--d .house-ad__body {
  max-width: 8.5rem;
}

.house-ad--d[hidden] {
  display: none !important;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--surface);
  color: var(--ink);
  border-radius: 1rem;
  max-width: 24rem;
  width: 100%;
  padding: 1.25rem;
  box-shadow: 0 20px 50px var(--shadow);
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}


/* —— Publicitar (misma mesa) —— */
.stage--pub {
  max-width: 64rem;
  padding-top: 1.25rem;
}

.mesa--pub {
  max-width: 58rem;
  margin: 0 auto;
}

.pub-layout {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.35rem;
  align-items: start;
}

@media (min-width: 900px) {
  .pub-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 1.75rem;
  }
}

.pub-preview {
  background: var(--panel);
  border: 1px solid var(--felt-line-soft);
  border-radius: 1rem;
  padding: 1rem 0.9rem 1.1rem;
}

.pub-preview__title {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  color: var(--mesa-ink);
  text-align: center;
}

.pub-preview__lead {
  margin: 0.35rem 0 0.9rem;
  font-size: 0.8rem;
  color: var(--mesa-muted);
  text-align: center;
  line-height: 1.4;
}

.pub-map {
  display: grid;
  gap: 0.55rem;
}

.pub-map__stage {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) 1.6rem;
  gap: 0.35rem;
  align-items: stretch;
}

.pub-map__core {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.pub-map__hands {
  height: 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mesa-muted) 35%, transparent);
  opacity: 0.55;
}

.pub-map__hands--user {
  opacity: 0.4;
}

.pub-map__felt {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, color-mix(in srgb, var(--felt) 88%, #fff) 0%, var(--felt) 55%, var(--felt-deep) 100%);
  border: 3px solid var(--rail);
  border-radius: 0.75rem;
  padding: 0.55rem 0.45rem 0.5rem;
  display: grid;
  gap: 0.35rem;
  box-shadow: inset 0 0 0 1px var(--felt-line);
}

.pub-map__calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.pub-map__calc span {
  height: 1.35rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, #fff 88%, transparent);
  opacity: 0.9;
}

.pub-map__cta {
  height: 0.85rem;
  border-radius: 0.35rem;
  background: var(--cta);
  opacity: 0.9;
}

.pub-map__plazas {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
}

.pub-map__plazas i {
  display: block;
  height: 1.1rem;
  border-radius: 0.3rem;
  border: 1px solid var(--felt-line);
  background: var(--plaza-bg);
}

.pub-map__slot {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.1rem;
  margin: 0;
  border: 1.5px dashed color-mix(in srgb, #e8b84a 80%, transparent);
  border-radius: 0.4rem;
  background:
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, #e8b84a 14%, transparent),
      color-mix(in srgb, #e8b84a 14%, transparent) 5px,
      color-mix(in srgb, #e8b84a 5%, transparent) 5px,
      color-mix(in srgb, #e8b84a 5%, transparent) 10px
    );
  color: var(--mesa-ink);
  cursor: pointer;
  font: inherit;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  overflow: hidden;
}

.pub-map__slot:hover {
  transform: translateY(-1px);
}

.pub-map__slot.is-selected {
  border-style: solid;
  border-color: #fff3c8;
  box-shadow: 0 0 0 2px color-mix(in srgb, #fff3c8 70%, transparent);
}

.pub-map__letter {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  color: #e8b84a;
  position: relative;
  z-index: 1;
}

.pub-map__size {
  font-size: 0.58rem;
  color: color-mix(in srgb, var(--mesa-ink) 75%, transparent);
  position: relative;
  z-index: 1;
}

.pub-map__heat {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
}

.pub-map__slot[data-heat='3'] .pub-map__heat {
  background: linear-gradient(180deg, color-mix(in srgb, #ff6b35 55%, transparent), color-mix(in srgb, #e8b84a 25%, transparent));
}

.pub-map__slot[data-heat='2'] .pub-map__heat {
  background: linear-gradient(180deg, color-mix(in srgb, #e8b84a 45%, transparent), transparent);
}

.pub-map__slot[data-heat='1'] .pub-map__heat {
  background: linear-gradient(180deg, color-mix(in srgb, #8fbc8f 40%, transparent), transparent);
}

.pub-map__slot--a {
  min-height: 3.4rem;
  aspect-ratio: 300 / 250;
  max-height: 5.5rem;
  width: min(100%, 7.5rem);
  justify-self: center;
}

.pub-map__slot--b {
  min-height: 1.55rem;
  width: 100%;
}

.pub-map__slot--c {
  min-height: 1.7rem;
  width: 100%;
}

.pub-map__slot--d {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  min-height: 100%;
  padding: 0.35rem 0.15rem;
}

.pub-map__slot--d .pub-map__letter {
  transform: rotate(180deg);
}

.pub-legend {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--mesa-muted);
}

.pub-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pub-legend__swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.pub-legend__swatch--3 {
  background: linear-gradient(135deg, #ff6b35, #e8b84a);
}

.pub-legend__swatch--2 {
  background: #e8b84a;
}

.pub-legend__swatch--1 {
  background: #8fbc8f;
}

.pub-form {
  max-width: none;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.pub-form__heading {
  margin: 0 0 0.25rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  color: var(--mesa-ink);
  text-align: center;
}

.pub-field label,
.pub-fieldset legend {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--felt-line);
  margin-bottom: 0.35rem;
}

.pub-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.pub-hint {
  margin: -0.15rem 0 0.65rem;
  font-size: 0.8rem;
  color: var(--mesa-muted);
}

.pub-field input,
.pub-field select {
  width: 100%;
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.65rem;
  padding: 0.75rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
}

.pub-field input:focus,
.pub-field select:focus {
  outline: 2px solid color-mix(in srgb, var(--felt-line) 55%, transparent);
  outline-offset: 1px;
}

.pub-formats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

@media (min-width: 520px) {
  .pub-formats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pub-format {
  display: block;
  cursor: pointer;
}

.pub-format input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pub-format__card {
  display: grid;
  gap: 0.25rem;
  background: var(--plaza-bg);
  border: 1.5px solid var(--felt-line);
  border-radius: 0.85rem;
  padding: 0.75rem 0.7rem;
  color: var(--mesa-ink);
  transition: background 0.2s ease, border-color 0.2s ease;
  min-height: 100%;
}

.pub-format__card:hover,
.pub-format__card.is-selected {
  background: var(--plaza-hover);
}

.pub-format__card.is-selected {
  border-color: #fff3c8;
  box-shadow: 0 0 0 1px #fff3c8;
}

.pub-format__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.pub-format__name {
  font-weight: 600;
  font-size: 0.88rem;
}

.pub-format__name strong {
  font-family: 'Fraunces', Georgia, serif;
  color: #e8b84a;
}

.pub-format__tag {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--felt-deep);
  background: var(--felt-line);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.pub-format__tag--hot {
  background: color-mix(in srgb, #ff6b35 75%, #fff);
  color: #3a1a0a;
}

.pub-format__meta {
  font-size: 0.72rem;
  color: var(--mesa-muted);
}

.pub-format__bar {
  display: block;
  margin-top: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--mesa-muted) 28%, transparent);
  overflow: hidden;
}

.pub-format__bar i {
  display: block;
  height: 100%;
  width: var(--w, 50%);
  border-radius: inherit;
  background: linear-gradient(90deg, #e8b84a, #ff6b35);
}

.pub-summary {
  margin-top: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
}

.pub-summary.hidden {
  display: none;
}

.pub-summary__label {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--felt-line);
}

.pub-summary__text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--mesa-ink);
}

.pub-countries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.pub-country {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--plaza-bg);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.65rem;
  padding: 0.55rem 0.65rem;
  color: var(--mesa-ink);
  font-size: 0.88rem;
  cursor: pointer;
}

.pub-country input {
  accent-color: var(--cta);
}

.pub-estado {
  min-height: 1.25rem;
}

.pub-error {
  margin: 0;
  color: var(--sell);
  font-size: 0.88rem;
  text-align: center;
}

/* —— Aprende / Términos (ofertas estilo mesa) —— */
.stage--offer {
  max-width: 48rem;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

.mesa--offer {
  max-width: 42rem;
  margin: 0 auto;
}

.offer-lead {
  margin: 0.85rem auto 1.35rem;
  max-width: 36rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--mesa-muted);
}

.offer-flyer {
  margin: 0 0 1.15rem;
  padding: 0;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--felt-line-soft);
  background: #0b1b32;
  box-shadow: 0 0.45rem 1.25rem rgba(0, 0, 0, 0.22);
}

.offer-flyer img {
  display: block;
  width: 100%;
  height: auto;
}

.offer-card .offer-flyer {
  margin-top: 0.85rem;
  margin-bottom: 1rem;
}

.offer-section-title {
  margin: 1.75rem 0 0.85rem;
  text-align: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mesa-ink);
}

.offer-split {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

@media (min-width: 640px) {
  .offer-split {
    grid-template-columns: 1fr 1fr;
  }
}

.offer-panel {
  background: var(--panel);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
}

.offer-panel--yes {
  border-color: color-mix(in srgb, #3d9b6a 45%, var(--felt-line-soft));
}

.offer-panel--no {
  border-color: color-mix(in srgb, var(--sell) 35%, var(--felt-line-soft));
}

.offer-panel__title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--felt-line);
}

.offer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.offer-list li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--mesa-ink);
}

.offer-panel--yes .offer-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #3d9b6a;
  font-weight: 700;
}

.offer-panel--no .offer-list li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: var(--sell);
  font-weight: 700;
}

.offer-note {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: color-mix(in srgb, #e8b84a 14%, var(--panel));
  border: 1px solid color-mix(in srgb, #e8b84a 40%, var(--felt-line-soft));
  text-align: center;
}

.offer-note__label {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8b84a;
}

.offer-note__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--mesa-ink);
}

.offer-destinations {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 560px) {
  .offer-destinations {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.offer-destinations li {
  background: var(--plaza-bg);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--mesa-ink);
}

.offer-pillars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (min-width: 640px) {
  .offer-pillars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.offer-pillar {
  background: var(--panel);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.75rem;
  padding: 0.75rem 0.65rem;
  text-align: center;
}

.offer-pillar h3 {
  margin: 0 0 0.3rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.95rem;
  color: var(--mesa-ink);
}

.offer-pillar p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--mesa-muted);
}

.offer-actions {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.55rem;
}

.offer-card {
  margin-top: 1.35rem;
  background: var(--panel);
  border: 1px solid var(--felt-line-soft);
  border-radius: 1rem;
  padding: 1.15rem 1.1rem 1.25rem;
}

.offer-card + .offer-card {
  margin-top: 1.1rem;
}

.offer-card__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--felt-line);
}

.offer-card__title {
  margin: 0 0 0.35rem;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--mesa-ink);
}

.offer-card__tagline {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--mesa-muted);
}

.offer-card__ideal {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--mesa-ink);
}

.offer-card__foot {
  margin: 0.85rem 0 1rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--mesa-muted);
}

.offer-tags {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.offer-tags li {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--mesa-ink);
  background: color-mix(in srgb, #e8b84a 16%, var(--plaza-bg));
  border: 1px solid color-mix(in srgb, #e8b84a 35%, var(--felt-line-soft));
  border-radius: 0.45rem;
  padding: 0.28rem 0.55rem;
}

.offer-tags--muted li {
  background: var(--plaza-bg);
  border-color: var(--felt-line-soft);
  color: var(--mesa-muted);
}

.offer-meta {
  margin: 0.85rem 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (min-width: 560px) {
  .offer-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.offer-meta > div {
  background: var(--plaza-bg);
  border: 1px solid var(--felt-line-soft);
  border-radius: 0.65rem;
  padding: 0.55rem 0.6rem;
  text-align: center;
}

.offer-meta dt {
  margin: 0 0 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--felt-line);
}

.offer-meta dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--mesa-ink);
}

.offer-card .btn-cta {
  width: 100%;
}

.privacy-text {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--mesa-muted);
  text-align: left;
}
