:root {
  --ink: #16324a;
  --muted: #4d6474;
  --paper: #eef4f6;
  --card: #f7fbfc;
  --line: #d3e2e8;
  --terra: #1f7a8c;
  --terra-dark: #155e6e;
  --forest: #1f6b4a;
  --gold: #2f7d6a;
  --warn: #8a5a10;
  --danger: #8e2f2f;
  --shadow: 0 18px 40px rgba(22, 50, 74, 0.08);
  --sans: "Outfit", "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #d7ebe4 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #d5e4f2 0%, transparent 50%),
    var(--paper);
  font-family: var(--sans);
  font-size: 1.02rem;
  line-height: 1.5;
}
body:has(.tabbar) { padding-bottom: 0; }
a { color: var(--forest); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.1rem, 4vw, 4rem); margin: 0 0 0.4rem; }
h2 { font-size: 1.45rem; margin: 0 0 0.4rem; }
h3 { font-size: 1.25rem; margin: 0.2rem 0; }
p { margin: 0 0 0.8rem; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.shell { min-height: 100vh; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(16px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 16px max(22px, env(safe-area-inset-left));
  position: sticky;
  top: 0;
  z-index: 6;
  background: rgba(238, 244, 246, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--ink);
}
.top-actions { display: flex; gap: 10px; align-items: center; }
.top-actions a { text-decoration: none; }

.strip {
  margin: 0;
  padding: 10px 22px;
  background: #dceaf2;
  color: #1a4560;
  font-size: 0.92rem;
}
.strip a { color: #1a4560; }

main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}
.narrow { width: min(680px, 100%); margin: 0 auto; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 42rem; }
.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--gold);
}
.hint, .aside, .quiet, .quiet-block { color: var(--muted); font-size: 0.92rem; }
.lock { margin: 0 0 12px; color: var(--muted); }

.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 36px; align-items: center; padding-top: 18px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 36px; }
.steps-grid article, .panel, .card, .callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.steps-grid article { padding: 16px 16px 8px; box-shadow: var(--shadow); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.stats a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.stats b { font-family: var(--serif); font-size: 2rem; }
.stats span { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
}
.btn-primary { background: var(--terra); color: white; }
.btn-primary:hover { background: var(--terra-dark); }
.btn-ghost { border-color: var(--line); background: var(--card); color: var(--ink); }
.btn-danger { background: var(--danger); color: white; }
.btn-small { min-height: 38px; padding: 0 12px; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .choice:focus-within {
  outline: 3px solid #1f7a8c;
  outline-offset: 2px;
}

.card { padding: 16px; box-shadow: var(--shadow); }
.card-photo {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #e4eef2;
}
.ficha-photo {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 16px;
  margin: 0 0 14px;
  background: #e4eef2;
}
.photo-preview {
  display: block;
  width: min(280px, 100%);
  border-radius: 12px;
  margin-top: 8px;
}
.blurb {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
}
.card header { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.card-link { color: inherit; text-decoration: none; display: block; }
.card-link[hidden] { display: none; }
.card-link:hover .card { border-color: #8eb8c4; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e6f0f4;
  color: var(--ink);
  font-size: 0.78rem;
}
.badge.ok { background: #e5f2ec; color: var(--forest); }
.badge.warn { background: #fbf3df; color: var(--warn); }
.meta, .terms, .who, .vis { margin: 0.2rem 0; }
.terms { color: var(--forest); font-weight: 600; }
.overdue { border-color: #e3b4b4; }

.head { display: flex; justify-content: space-between; gap: 12px; align-items: end; }
.filters { display: grid; grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 8px; }
.filters-geo { grid-template-columns: 1.4fr 150px auto; align-items: end; margin-top: 0; }
.filters-geo .btn { width: 100%; }
.km { display: flex; flex-direction: column; gap: 6px; }
.km span { font-weight: 600; font-size: 0.85rem; }
.geo-manual { margin: 0 0 14px; }
.geo-manual summary { cursor: pointer; color: var(--muted); }
.where { margin: 0.2rem 0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span, legend { font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #c9d8e0;
  background: white;
}
textarea { resize: vertical; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea, .check.is-invalid { border-color: var(--danger); }
.err, .form-error { color: var(--danger); font-size: 0.88rem; }
.form-error { margin-top: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
}
.check input { width: 20px; height: 20px; margin-top: 3px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}
.choice input { position: static; width: 18px; height: 18px; margin: 0 0 6px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--terra); background: #e7f4f2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.chip {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
.terms-box { border: 1px solid var(--line); border-radius: 16px; margin: 8px 0 14px; padding: 12px; }
.callout { padding: 12px 14px; background: #e7f3f6; }
.empty { padding: 8px 0 20px; }
.kv { display: grid; gap: 10px; margin: 16px 0; }
.kv div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.panel { padding: 16px; margin-top: 16px; }
.danger-zone { border-color: #efc7c7; }
.block { margin-top: 22px; }
.loading { padding: 40px 0; }

.tabbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px 0;
  position: static;
  z-index: 5;
  background: rgba(238, 244, 246, 0.92);
}
.btn, .card-link, .chip, input, select, textarea { scroll-margin: 110px; }
.tabbar a {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
}
.tabbar a.on { background: var(--ink); color: white; }
.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--terra);
  color: white;
  font-style: normal;
  font-size: 0.72rem;
}
.tabbar a.on .count { background: white; color: var(--terra); }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto 8px;
  color: var(--muted);
  font-size: 0.92rem;
}
.copy {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 0.85rem;
}
.legal { width: min(720px, 100%); }
.legal h2 { margin-top: 1.4rem; }
.steps { padding-left: 1.1rem; }
.steps li { margin: 0 0 0.7rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }

.toast, .cookie {
  position: fixed;
  z-index: 8;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  width: min(520px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
}
.anuncio-tira {
  height: 28px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 0.8rem;
  line-height: 28px;
}
.anuncio-tira.con-foto { height: 44px; line-height: 44px; }
.anuncio-item { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.anuncio-foto, .anuncio-previa {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
}
.anuncio-previa { display: block; margin-top: 8px; }
.anuncio-capa {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(22, 50, 74, 0.28);
}
.anuncio-ventana {
  position: relative;
  width: min(280px, calc(100% - 32px));
  padding: 12px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.anuncio-ventana img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
}
.anuncio-ventana a { color: inherit; text-decoration: none; }
.anuncio-ventana span { display: block; margin-top: 8px; }
.anuncio-cerrar {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: white;
  cursor: pointer;
}
.anuncio-pista {
  display: inline-block;
  width: max-content;
  margin: 0;
  white-space: nowrap;
  padding-left: 100%;
  animation: anuncio-pasa 24s linear infinite;
}
.anuncio-tira a { color: inherit; text-decoration: none; }
@keyframes anuncio-pasa {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.share-float {
  position: fixed;
  z-index: 7;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.share-float svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shell:has(.toast) .share-float,
.shell:has(.cookie) .share-float { bottom: 86px; }
.toast { right: 12px; bottom: 18px; }
.toast p, .cookie p { margin: 0; }
.toast button, .cookie button { background: white; color: var(--ink); border: 0; border-radius: 999px; }
.cookie {
  left: 12px;
  bottom: 18px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

@media (max-width: 800px) {
  .hero, .steps-grid, .split, .filters, .filters-geo, .kv div { grid-template-columns: 1fr; }
  .choices { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .tabbar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(247, 251, 252, 0.96);
  }
  .tabbar a {
    padding: 8px 8px;
    font-size: 0.86rem;
  }
  .shell { padding-bottom: 118px; }
  .toast, .cookie { bottom: 126px; }
  .share-float { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .shell:has(.toast) .share-float,
  .shell:has(.cookie) .share-float { bottom: calc(196px + env(safe-area-inset-bottom)); }
  .foot { margin-bottom: 12px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .top { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  main { width: min(1080px, calc(100% - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .anuncio-pista { padding-left: 12px; }
}
