/* Portal Mar Andino — sistema visual */
:root {
  --navy: #0c1a2a;
  --navy-soft: #1a2c40;
  --ink: #16202c;
  --slate: #5c6670;
  --muted: #7a7368;
  --line: #e3ddd2;
  --line-strong: #cfc6b8;
  --paper: #f5f3ef;
  --white: #ffffff;
  --gold: #9a7b4f;
  --gold-line: #c6a36a;
  --ivory: #f4f0e6;
  --danger: #6e332c;
  --ok: #1e3a2f;
  --serif: "Cormorant Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --lh-display: 1;
  --lh-heading: 1.15;
  --lh-price: 1.02;
  --lh-body: 1.6;
  --ls-label: 0.14em;
  --type-display: clamp(2.5rem, 5vw, 4.25rem);
  --type-price: clamp(2rem, 2.8vw, 2.75rem);
  --type-h1: clamp(1.75rem, 2.2vw, 2.15rem);
  --type-h2: clamp(1.45rem, 1.8vw, 1.85rem);
  --type-h3: clamp(1.2rem, 1.35vw, 1.375rem);
  --type-body: 1rem;
  --type-small: 0.8125rem;
  --type-eyebrow: 0.6875rem;
  --type-label: var(--type-eyebrow);
  /* Espaciado áureo: φ⁰ = 1rem, potencias de φ = 1.618 */
  --phi-1: 0.618rem;
  --phi-2: 1rem;
  --phi-3: 1.618rem;
  --phi-4: 2.618rem;
  --phi-5: 4.236rem;
  --phi-6: 6.854rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;
  --container: 1180px;
  --header: 76px;
  --shadow: 0 18px 50px rgba(12, 26, 42, 0.08);
  --radius: 2px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--type-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11";
}
img, svg { max-width: 100%; }
img { display: block; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--navy-soft); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--navy); color: var(--ivory); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.15em; flex: none; }

.container { width: min(var(--container), calc(100% - 2.5rem)); margin: 0 auto; }
.narrow { width: min(520px, calc(100% - 2.5rem)); }

.demo-bar {
  background: var(--navy);
  color: var(--ivory);
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.4;
  text-transform: uppercase;
  text-align: center;
  padding: 0.55rem 1rem;
}
.demo-bar strong { font-weight: var(--fw-medium); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  gap: 1rem;
}
.brand { display: flex; align-items: center; text-decoration: none; color: var(--navy); min-width: 0; }
.brand:hover { text-decoration: none; color: var(--navy); }
.brand-lockup { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name {
  font-family: var(--serif);
  font-weight: var(--fw-medium);
  font-size: var(--type-h3);
  letter-spacing: 0.01em;
  line-height: var(--lh-heading);
  white-space: nowrap;
}
.links { display: flex; align-items: center; gap: 1.35rem; }
.links a {
  color: var(--ink);
  text-decoration: none;
  font-size: var(--type-label);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  font-weight: var(--fw-medium);
}
.links a:hover { color: var(--gold); text-decoration: none; }
.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--navy);
  position: relative;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }
.menu-open .menu-btn span { background: transparent; }
.menu-open .menu-btn span::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-btn span::after { top: 0; transform: rotate(-45deg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--navy);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-size: var(--type-label);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--navy); color: var(--navy); }
.links .btn, .btn-primary { background: var(--navy); color: var(--ivory); border-color: var(--navy); }
.links .btn:hover, .btn-primary:hover { background: var(--navy-soft); color: var(--ivory); border-color: var(--navy-soft); }
.btn-sm { padding: 0.4rem 0.65rem; letter-spacing: var(--ls-label); }
.btn-lg { padding: 0.95rem 1.4rem; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: #e4cfc9; background: var(--white); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-wa { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-wa:hover { background: var(--navy); color: var(--ivory); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.links .btn { padding: 0.65rem 0.9rem; }

.pill {
  display: inline-block;
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--line);
  color: var(--slate);
  border-radius: var(--radius);
  background: var(--white);
}
.pill-wa { border-color: #c9d4c8; color: var(--ok); }
.pill-star { border-color: var(--gold-line); color: var(--gold); }

h1, .h1, h2, .h2, h3, .h3, .section-title, .brand-name, .kpi strong, .specs strong, .broker-card strong, .footer-tag {
  font-family: var(--serif);
  font-weight: var(--fw-medium);
  letter-spacing: -0.015em;
  line-height: var(--lh-heading);
}
h1, .h1 { font-size: var(--type-h1); margin: 0; }
h2, .h2, .section-title { font-size: var(--type-h2); margin: 0; }
h3, .h3 { font-size: var(--type-h3); margin: 2rem 0 0.6rem; }
.price {
  font-family: var(--serif);
  font-weight: var(--fw-semibold);
  font-size: var(--type-price);
  line-height: var(--lh-price);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  margin: 0;
}
.price.big { font-size: var(--type-price); }
.muted { color: var(--slate); }
.small, .tiny { font-size: var(--type-small); line-height: 1.45; }
.nowrap { white-space: nowrap; }
.eyebrow, .kicker {
  font-family: var(--sans);
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.85rem;
}
.kicker { margin: 0; }
.rule { display: block; width: 2.5rem; height: 1px; background: var(--gold-line); margin: 0 0 1.1rem; }

/* Alto = viewport / φ² ≈ 38.2vh (1/φ²). En 900px da ~344px; el tope 460px evita un banner alto.
   En celular la alternativa ancho/φ² o 61.8%×(ancho/2) (~149px o ~120px) no cabe el título, así que se usa la misma fórmula. */
.hero {
  position: relative;
  height: clamp(300px, 38.2vh, 460px);
  min-height: 0;
  display: flex;
  align-items: flex-start;
  color: var(--ivory);
  overflow: hidden;
  background: var(--navy);
}
.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 42%;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 26, 42, 0.78) 0%, rgba(12, 26, 42, 0.42) 46%, rgba(12, 26, 42, 0.12) 100%),
    linear-gradient(180deg, rgba(12, 26, 42, 0.18) 0%, rgba(12, 26, 42, 0) 28%, rgba(12, 26, 42, 0.35) 100%);
}
.hero-copy { position: relative; z-index: 1; max-width: 720px; margin-top: var(--phi-4); padding: 0; }
.hero .eyebrow { margin-bottom: var(--phi-1); }
.hero .rule { margin: 0 0 var(--phi-1); }
.hero h1 {
  margin: 0;
  font-size: clamp(1.618rem, 2.8vw, 2.618rem);
  line-height: 1.08;
  font-weight: var(--fw-medium);
  color: var(--ivory);
  max-width: 12ch;
}
/* El solape real (38.2% de la altura del buscador) lo fija app.js en --search-overlap. */
.search-wrap { position: relative; z-index: 2; margin-top: calc(-1 * var(--search-overlap, var(--phi-4))); }
.search {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.25rem;
}
.seg { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.seg label {
  position: relative;
  cursor: pointer;
  padding: 0 0 0.7rem;
  margin: 0;
  font-size: var(--type-label);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--slate);
  font-weight: var(--fw-medium);
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { color: var(--navy); }
.seg label:has(input:checked)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--gold);
}
.search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}
.search-grid .lugar { grid-column: 1 / -1; position: relative; }
.search-grid .precio { grid-column: span 2; }
.suggest {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: 16rem;
  overflow: auto;
}
.suggest button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: var(--type-body);
  letter-spacing: 0;
  text-transform: none;
  font-weight: var(--fw-regular);
}
.suggest button:hover, .suggest button.is-active { background: var(--paper); }
.suggest .kind { color: var(--muted); font-size: var(--type-eyebrow); letter-spacing: var(--ls-label); text-transform: uppercase; }
label { display: block; font-size: var(--type-label); letter-spacing: var(--ls-label); line-height: 1.3; text-transform: uppercase; color: var(--slate); font-weight: var(--fw-medium); }
input, select, textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.72rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-size: var(--type-body);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--fw-regular);
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
}
.price-range { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1fr); gap: 0.4rem; }
.search-btn { min-height: 46px; padding-inline: 1.4rem; white-space: nowrap; }
.form label { margin-bottom: 0.9rem; }
.form .check { display: flex; gap: 0.55rem; align-items: center; text-transform: none; letter-spacing: 0; font-size: var(--type-body); font-weight: var(--fw-regular); line-height: var(--lh-body); color: var(--ink); }
.form .check input { width: auto; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }

.section { margin-top: var(--space-8); }
.section-head { margin-bottom: 1.5rem; max-width: 40rem; }
.section-title { margin: 0; }
.section-intro { margin: 0.6rem 0 0; color: var(--slate); }

.comuna-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.comuna-index a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0.2rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.comuna-index a:hover { color: var(--gold); text-decoration: none; }
.comuna-index .count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--type-small); }
.nearby-comuna {
  margin: 1.75rem 0 0.85rem;
  font-family: var(--sans);
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--gold);
}
.nearby .grid { margin-bottom: 0.25rem; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
.card {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--line);
  min-width: 0;
}
.card:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); }
.card-img { position: relative; overflow: hidden; background: #e7e2d8; aspect-ratio: 3 / 2; }
.card-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s ease;
}
.card:hover .card-media { transform: scale(1.035); }
.card-op, .card-flag {
  position: absolute;
  top: 0.8rem;
  z-index: 1;
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ivory);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.card-op { left: 0.85rem; }
.card-flag { right: 0.85rem; color: var(--gold-line); }
.card-body { padding: 1.05rem 1.05rem 1.2rem; }
.card h3 { margin: 0.55rem 0 0.3rem; }
.price small { display: block; font-family: var(--sans); font-size: var(--type-eyebrow); font-weight: var(--fw-medium); letter-spacing: var(--ls-label); line-height: 1.3; text-transform: uppercase; color: var(--muted); margin: 0.35rem 0 0; }
.price-alt { margin: 0.35rem 0 0; color: var(--muted); font-size: var(--type-small); line-height: 1.45; font-variant-numeric: tabular-nums; }
.loc { margin: 0; color: var(--muted); font-size: var(--type-small); line-height: 1.45; }
.feats { display: flex; flex-wrap: wrap; gap: 0.15rem 0; margin: 0.75rem 0 0; color: var(--muted); font-size: var(--type-small); line-height: 1.45; }
.feats span:not(:last-child)::after { content: "·"; margin: 0 0.45rem; color: var(--line-strong); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.proposition {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 2rem 1.75rem 1.75rem;
  min-width: 0;
}
.proposition h2 { margin: 0 0 0.75rem; }
.proposition p { margin: 0 0 1.25rem; color: var(--slate); max-width: 36rem; }

.results-head, .panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin: 0 0 1.25rem;
  flex-wrap: wrap;
}
.page-title { margin: 0 0 1rem; }
h2.section-title { margin: 2.5rem 0 1rem; }
.section-head .section-title { margin: 0; }
.sort label { display: flex; gap: 0.6rem; align-items: center; text-transform: none; letter-spacing: 0; font-size: var(--type-small); font-weight: var(--fw-regular); line-height: var(--lh-body); }
.sort select { width: auto; margin: 0; min-width: 11rem; }
.empty {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--slate);
  margin: 0.5rem 0 1rem;
}
.crumbs { margin: 0 0 1rem; font-size: var(--type-eyebrow); font-weight: var(--fw-medium); letter-spacing: var(--ls-label); line-height: 1.3; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--slate); text-decoration: none; }
.crumbs a:hover { color: var(--navy); }

.detail { padding-bottom: 2rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
.detail-grid > * { min-width: 0; max-width: 100%; }
.gallery, .gallery-main { min-width: 0; max-width: 100%; }
.gallery-main { position: relative; background: var(--navy); aspect-ratio: 3 / 2; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; max-width: 100%; object-fit: cover; }
.gnav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gnav svg { width: 18px; height: 18px; }
.gnav.prev { left: 0.75rem; }
.gnav.prev svg { transform: rotate(180deg); }
.gnav.next { right: 0.75rem; }
.gcount {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgba(12, 26, 42, 0.72);
  color: var(--ivory);
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  padding: 0.25rem 0.5rem;
}
.thumbs { display: flex; gap: 0.45rem; overflow-x: auto; padding: 0.7rem 0 0.2rem; scrollbar-width: thin; }
.thumbs img {
  width: 92px;
  height: 64px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.72;
  border: 1px solid transparent;
  flex: none;
}
.thumbs img.active { opacity: 1; border-color: var(--navy); }
.detail-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-end; margin-top: 1.25rem; }
.detail-head > div { min-width: 0; }
.detail-head h1 { margin: 0.35rem 0 0.4rem; overflow-wrap: anywhere; }
.price-box { text-align: right; flex: none; }
.specs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.specs div { padding: 0.9rem 0.6rem; min-width: 0; }
.specs div + div { border-left: 1px solid var(--line); }
.specs strong { display: block; font-size: var(--type-h3); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.specs span { display: block; margin-top: 0.2rem; font-family: var(--sans); font-size: var(--type-eyebrow); font-weight: var(--fw-medium); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.description {
  white-space: pre-line;
  font-size: var(--type-body);
  line-height: var(--lh-body);
  max-width: 65ch;
  color: var(--ink);
}
.sidebar { position: sticky; top: calc(var(--header) + 1rem); display: grid; gap: 1rem; }
.box { background: var(--white); border: 1px solid var(--line); padding: 1.25rem; }
.sidebar h3, .box h3 { margin: 0 0 0.9rem; }
.broker-mini { display: flex; gap: 0.8rem; align-items: center; color: var(--ink); text-decoration: none; margin-bottom: 0.6rem; }
.broker-mini:hover { text-decoration: none; }
.broker-mini img, .broker-card img, .profile-logo, .logo-edit img {
  width: 56px; height: 56px; object-fit: cover; background: var(--paper); border: 1px solid var(--line);
}
.profile { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 1.75rem; align-items: center; margin-bottom: 1.5rem; padding: 1.5rem; }
.profile-logo { width: 140px; height: 140px; }
.profile h1 { margin: 0 0 0.25rem; }
.profile-phone { margin: 0.7rem 0; font-size: var(--type-body); line-height: var(--lh-body); }
.profile-phone a { text-decoration: none; }
.broker-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.broker-card { display: flex; gap: 0.9rem; align-items: center; color: var(--ink); text-decoration: none; min-width: 0; }
.broker-card:hover { text-decoration: none; border-color: var(--line-strong); }
.broker-card strong { display: block; font-size: var(--type-h3); }

.footer { background: var(--navy); color: rgba(244, 240, 230, 0.78); margin-top: var(--space-8); padding: 3.5rem 0 1.5rem; }
.footer a { color: var(--ivory); text-decoration: none; }
.footer a:hover { color: var(--gold-line); }
.footer-brand .brand-name { color: var(--ivory); }
.footer-tag { margin: 0.8rem 0 0.2rem; font-size: var(--type-h3); color: var(--ivory); }
.footer-domain { margin: 0; font-size: var(--type-small); line-height: 1.45; text-transform: lowercase; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 2rem; }
.footer h2 { margin: 0 0 0.8rem; font-family: var(--sans); font-size: var(--type-eyebrow); font-weight: var(--fw-medium); letter-spacing: var(--ls-label); line-height: 1.3; text-transform: uppercase; color: var(--gold-line); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer-legal {
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(244, 240, 230, 0.15);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: var(--type-small);
  line-height: 1.45;
  letter-spacing: 0;
}

.alert { padding: 0.85rem 1rem; margin: 0 0 1rem; border: 1px solid var(--line); background: var(--white); font-size: var(--type-small); line-height: 1.45; }
.alert-ok { background: #f3f6f3; border-color: #d3ddd4; color: var(--ok); }
.alert-error { background: #f8f4f2; border-color: #e4d2cc; color: var(--danger); }
.is-warn { color: var(--danger); }
.note {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  padding: 0.9rem 1rem;
  color: var(--slate);
  font-size: var(--type-small);
  line-height: 1.45;
  margin: 0 0 1.25rem;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1em; background: var(--paper); padding: 0.05rem 0.3rem; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 1.25rem; }
.kpi { background: var(--white); border: 1px solid var(--line); padding: 1rem 1rem 0.9rem; min-width: 0; }
.kpi strong { display: block; font-size: var(--type-h1); line-height: var(--lh-price); font-variant-numeric: tabular-nums; }
.kpi span { display: block; margin-top: 0.35rem; color: var(--muted); font-family: var(--sans); font-size: var(--type-eyebrow); font-weight: var(--fw-medium); letter-spacing: var(--ls-label); line-height: 1.3; text-transform: uppercase; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: var(--type-small); line-height: 1.45; font-variant-numeric: tabular-nums; min-width: 680px; }
.table th, .table td { padding: 0.75rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th {
  font-family: var(--sans);
  font-size: var(--type-eyebrow);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: var(--fw-medium);
  background: #faf9f6;
}
.table tr.total td { font-weight: var(--fw-semibold); background: #faf9f6; }
.table .msg { max-width: 280px; color: var(--slate); }
.thumb { width: 72px; height: 48px; object-fit: cover; background: var(--paper); }
.actions { white-space: nowrap; }
.actions form { display: inline; }
.status {
  display: inline-block;
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.st-activo { color: var(--ok); border-color: #c9d4c8; }
.st-pendiente { color: #7a5b2e; border-color: #e4d3b0; }
.st-pausado { color: var(--slate); }
.st-arrendado, .st-vendido { color: #243e62; border-color: #cfd8e6; }
.st-rechazado { color: var(--danger); border-color: #e4d2cc; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.7rem; margin: 0.6rem 0; }
.photo-item { border: 1px solid var(--line); padding: 0.4rem; background: var(--white); }
.photo-item img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.photo-item .check { margin-top: 0.35rem; font-size: var(--type-small); }
.photo-item .danger { color: var(--danger); }
.upload input { border-style: dashed; background: #faf9f6; }
.logo-edit { display: flex; gap: 1rem; align-items: center; }
.logo-edit img { width: 84px; height: 84px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin: 0 0 1.25rem; border-bottom: 1px solid var(--line); }
.admin-nav a {
  padding: 0.55rem 0 0.7rem;
  text-decoration: none;
  color: var(--slate);
  font-size: var(--type-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-label);
  line-height: 1.3;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}
.admin-nav a.on, .admin-nav a:hover { color: var(--navy); border-bottom-color: var(--gold); text-decoration: none; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; align-items: end; margin-bottom: 1.25rem; }
.filter-btns { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.cols3 h3 { margin: 0 0 0.8rem; }
.bar { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 2rem; gap: 0.55rem; align-items: center; font-size: var(--type-small); line-height: 1.45; margin: 0.4rem 0; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar div { background: var(--paper); height: 2px; }
.bar i { display: block; height: 2px; background: var(--navy); }
.auth { padding-top: 1rem; }
.auth h1 { margin-bottom: 0.4rem; }
.auth .intro { margin-top: 0; color: var(--slate); }

main > .container { padding-top: 2.25rem; padding-bottom: 0.5rem; }
main > .search-wrap .container { padding-top: 0; padding-bottom: 0; }
main > .hero .hero-copy { padding: 0; }

@media (max-width: 1020px) {
  .search-grid { grid-template-columns: 1fr 1fr; }
  .search-btn { grid-column: 1 / -1; }
  .grid, .broker-list { grid-template-columns: 1fr 1fr; }
  .comuna-index { grid-template-columns: 1fr 1fr; }
  .detail-grid, .split, .footer-grid, .cols3 { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .search-grid .precio { grid-column: auto; }
  :root { --header: 64px; }
  .container, .narrow { width: min(var(--container), calc(100% - 1.5rem)); }
  .menu-btn { display: flex; }
  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem 0 0.8rem;
  }
  .menu-open .links { display: flex; }
  .links a { padding: 0.85rem 1.15rem; }
  .links .btn { margin: 0.4rem 1.15rem 0; width: calc(100% - 2.3rem); }
  .hero h1 { max-width: none; }
  .search-grid, .row2, .row3, .row4, .grid, .broker-list, .comuna-index, .kpis { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr 1fr; }
  .specs div:nth-child(odd) { border-left: 0; }
  .detail-head { flex-direction: column; align-items: flex-start; }
  .profile, .footer-legal { display: block; }
  .price-box { order: -1; text-align: left; margin: 0 0 0.85rem; }
  .profile-logo { margin-bottom: 1rem; }
  .demo-bar { letter-spacing: 0.04em; }
  .search-btn { width: 100%; }
}
