/* KLAVEL & CO. — identidad exclusivamente en blanco y negro. El mapa es la única parte con color.
   Layout: cabecera negra, contenido sobre blanco, bordes finos en lugar de sombras. */
:root {
  --black: #000000;
  --ink: #000000;
  --white: #ffffff;
  --paper: #ffffff;
  --soft: #ffffff;
  --line: #000000;
  --muted: #000000;
  --on-black-muted: #ffffff;
  --map-land: #f2efe9;
  --map-street: #e4ddcf;
  --map-road: #d6cbb3;
  --map-water: #aad3df;
  --radius: 4px;
  --display: "Cormorant Garamond", "Didot", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .5rem; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 600; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

/* Cabecera: enlaces a la izquierda, logo al centro, cuenta a la derecha */
.topbar { background: var(--white); color: var(--black); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--white); }
.topbar-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; order: 2; color: var(--black); }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  font-family: var(--display); font-size: 1.45rem; font-weight: 500; line-height: 1;
}
.brand-name { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand-name-text { font-family: var(--display); font-weight: 600; font-size: 1.45rem; letter-spacing: .32em; margin-right: -.32em; }
.brand-co { font-family: var(--sans); font-size: .62rem; font-weight: 600; letter-spacing: .24em; }
.nav { display: contents; }
.nav-group { display: flex; align-items: center; gap: 24px; }
.nav-left { order: 1; justify-self: start; }
.nav-right { order: 3; justify-self: end; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .9rem; position: relative; white-space: nowrap; }
.nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 6px; }
.nav a.active:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -26px; height: 2px; background: var(--black); }
.nav .btn { color: var(--white); }
.nav .btn:hover { color: var(--black); }
.nav-account { border: 1px solid var(--line); padding: 7px 14px; border-radius: var(--radius); }
.badge { background: var(--black); color: var(--white); font-size: .68rem; padding: 1px 6px; font-weight: 700; margin-left: 2px; border-radius: 999px; }
.menu-btn { display: none; background: none; border: 0; color: var(--black); font-size: 1.5rem; cursor: pointer; order: 3; justify-self: end; }

@media (max-width: 1180px) {
  .topbar-inner { grid-template-columns: 1fr auto; height: 64px; }
  .brand { order: 1; }
  .menu-btn { display: block; order: 2; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--white);
    flex-direction: column; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav-group { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav a.active::after { display: none; }
  .nav .btn, .nav-account { margin-top: 10px; text-align: center; border-bottom: 1px solid var(--black); }
  .nav-account { border: 1px solid var(--line); }
}

/* Botones y formularios */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius); border: 1px solid var(--black);
  font: inherit; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  cursor: pointer; text-decoration: none;
  background: var(--black); color: var(--white); transition: background .2s, color .2s, opacity .2s;
}
.btn:hover { background: var(--white); color: var(--black); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-gold { background: var(--black); color: var(--white); }
.btn-outline { background: transparent; color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-ghost { background: transparent; color: var(--black); border-color: var(--line); }
.btn-ghost:hover { background: var(--white); border-color: var(--black); }
.btn-danger { background: transparent; color: var(--black); border-color: var(--line); text-decoration: underline; text-underline-offset: 3px; }
.btn-danger:hover { background: var(--white); border-color: var(--black); }
.btn-sm { padding: 8px 12px; font-size: .72rem; }
.btn-block { width: 100%; }

label { display: block; font-weight: 600; font-size: .78rem; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
input, select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
textarea { min-height: 100px; resize: vertical; }
.field { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .9rem; }
.check input { width: auto; accent-color: var(--black); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* Portada y filtros */
.hero {
  margin: 0 0 28px; padding-block: 64px 48px; color: var(--white); background: var(--black);
  position: relative;
}
.hero::before { content: ""; position: absolute; inset: 0 calc(50% - 50vw); background: var(--black); z-index: -1; }
.hero .eyebrow { color: var(--on-black-muted); margin-bottom: 14px; display: block; }
.hero h1 { max-width: 760px; font-weight: 500; }
.hero p { color: var(--on-black-muted); max-width: 620px; margin: 0; }
.hero .stats { display: flex; gap: 48px; margin-top: 36px; flex-wrap: wrap; border-top: 1px solid #000000; padding-top: 24px; }
.hero .stats b { display: block; font-size: 1.8rem; font-family: var(--display); font-weight: 500; font-variant-numeric: tabular-nums; }
.hero .stats span { font-size: .72rem; color: var(--on-black-muted); text-transform: uppercase; letter-spacing: .14em; }
main#app { overflow-x: clip; }

.filters {
  border: 1px solid var(--line); padding: 18px; display: grid; gap: 14px;
  grid-template-columns: 2fr repeat(4, 1fr);
  margin-bottom: 24px; background: var(--white);
}
.filters label { font-size: .68rem; color: var(--muted); letter-spacing: .14em; }
@media (max-width: 1000px) { .filters { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 600px) { .filters { grid-template-columns: 1fr 1fr; } .filters .f-search { grid-column: 1 / -1; } }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }

/* Tarjetas de propiedad */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-bottom: 48px; }
.card { background: var(--white); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transition: box-shadow .2s, border-color .2s; min-width: 0; }
.card:hover { box-shadow: none; border-color: #000000; }
.card.flash { border-color: var(--black); box-shadow: 0 0 0 2px var(--black); }
.card-media { position: relative; aspect-ratio: 3 / 2; max-width: 100%; background: var(--soft); overflow: hidden; }
.card-media a { display: block; height: 100%; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.tag { background: var(--white); color: var(--black); padding: 4px 9px; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; border-radius: 3px; }
.tag-dark { background: var(--black); color: var(--white); }
.save {
  position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--black);
}
.save:hover { background: var(--white); }
.save.on, .save-inline.on { --heart-fill: var(--black); }
.card-body { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; text-decoration: none; color: inherit; }
.price { font-family: var(--sans); font-size: 1.4rem; font-weight: 700; color: var(--black); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price small { font-size: .8rem; color: var(--muted); font-weight: 500; }
.specs { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; color: var(--ink); }
.specs span { white-space: nowrap; }
.specs b { font-weight: 700; }
.addr { font-size: .9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; gap: 10px; align-items: center; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.avatars { display: flex; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: .66rem; font-weight: 600; color: var(--white); background: var(--black); border: 2px solid var(--white); margin-left: -8px; letter-spacing: .04em;
}
.avatars .avatar:first-child { margin-left: 0; }
.avatar.lg { width: 48px; height: 48px; font-size: .9rem; margin: 0; border: 0; }

.empty { text-align: center; padding: 60px 20px; border: 1px solid var(--line); border-radius: 8px; }

/* Ficha de propiedad */
.back { display: inline-block; margin: 24px 0 14px; color: var(--muted); text-decoration: none; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }
.back:hover { color: var(--black); }
.detail { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 32px; margin-bottom: 56px; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.gallery-main { overflow: hidden; aspect-ratio: 16 / 10; max-width: 100%; background: var(--soft); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button { border: 1px solid transparent; padding: 0; overflow: hidden; cursor: pointer; flex: none; width: 92px; height: 64px; background: none; opacity: .6; }
.thumbs button.active { border-color: var(--black); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.panel { background: var(--white); border: 1px solid var(--line); padding: 24px; margin-top: 24px; }
.panel:first-child { margin-top: 0; }
.panel h3 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; margin-bottom: 14px; }
.panel h1 { margin-top: 6px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 16px; }
.feature { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature b { display: block; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.feature span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.amenities { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 0; }
.amenities li { border: 1px solid var(--line); padding: 5px 12px; font-size: .85rem; }

.sidebar { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sticky { position: sticky; top: 96px; }
@media (max-width: 960px) { .sticky { position: static; } }
.advisor { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contact-line { font-size: .85rem; color: var(--muted); margin: 0 0 14px; user-select: all; word-break: break-all; }

.broker-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.broker {
  display: flex; gap: 12px; align-items: center; border: 1px solid var(--line);
  padding: 12px; cursor: pointer; transition: border-color .15s; text-transform: none; letter-spacing: 0; font-size: 1rem; font-weight: 400;
}
.broker:hover { border-color: var(--muted); }
.broker.selected { border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
.broker input { width: auto; accent-color: var(--black); }
.broker-info { flex: 1; min-width: 0; }
.broker-info b { display: block; font-weight: 600; }
.broker-info span { font-size: .8rem; color: var(--muted); }
.stars { color: var(--black); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.slot {
  padding: 8px 4px; border: 1px solid var(--line); background: var(--white); color: var(--ink);
  font: inherit; font-size: .82rem; cursor: pointer; font-variant-numeric: tabular-nums; border-radius: var(--radius);
}
.slot:hover:not(:disabled) { border-color: var(--black); }
.slot.selected { background: var(--black); color: var(--white); border-color: var(--black); }
.slot:disabled { background: var(--soft); color: #000000; text-decoration: line-through; cursor: not-allowed; }

/* Visitas */
.page-head { margin: 36px 0 24px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.page-head p { margin: 0; }
.visit {
  background: var(--white); border: 1px solid var(--line);
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px; margin-bottom: 12px;
}
.visit img { width: 120px; height: 84px; object-fit: cover; }
.visit h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.visit-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .visit { grid-template-columns: 1fr; } .visit img { width: 100%; height: 160px; } .visit-actions { justify-content: flex-start; } }
.status { display: inline-block; font-size: .66rem; font-weight: 600; padding: 3px 9px; text-transform: uppercase; letter-spacing: .12em; border: 1px solid var(--black); }
.status.ok { background: var(--black); color: var(--white); }
.status.pending { background: var(--white); color: var(--black); }
.status.cancel { border-color: var(--line); color: var(--muted); text-decoration: line-through; }
.tabs { display: flex; gap: 0; margin-bottom: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; font: inherit; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button.active { color: var(--black); border-bottom-color: var(--black); font-weight: 600; }

.broker-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 48px; }
.broker-card { border: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .72rem; border: 1px solid var(--line); padding: 3px 9px; }

/* Planes */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0; margin-bottom: 36px; border: 1px solid var(--line); }
.plan { padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); }
.plan:last-child { border-right: 0; }
@media (max-width: 800px) { .plan { border-right: 0; border-bottom: 1px solid var(--line); } .plan:last-child { border-bottom: 0; } }
.plan.featured { background: var(--black); color: var(--white); position: relative; }
.plan.featured::before { content: "Más elegido"; font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: var(--on-black-muted); }
.plan.featured .amount { color: var(--white); }
.plan.featured .amount small { color: var(--on-black-muted); }
.plan.featured .btn { background: var(--white); color: var(--black); border-color: var(--white); }
.plan.featured .btn:hover { background: transparent; color: var(--white); }
.plan .amount { font-family: var(--display); font-size: 2.4rem; font-weight: 500; color: var(--black); font-variant-numeric: tabular-nums; }
.plan .amount small { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.plan ul { padding-left: 18px; margin: 0; flex: 1; }
.plan li { margin-bottom: 6px; }
.free-box { border-left: 2px solid var(--black); padding: 4px 0 4px 16px; margin-bottom: 28px; }

/* Publicar */
.form-card { border: 1px solid var(--line); padding: 28px; margin-bottom: 20px; background: var(--white); }
.form-card h3 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; margin-bottom: 18px; }
.form-card h2 { margin-bottom: 8px; }
.steps { display: flex; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.step i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-weight: 600; font-size: .78rem; }
.step.done i { background: var(--black); color: var(--white); border-color: var(--black); }
.step.current { color: var(--black); font-weight: 600; }
.step.current i { border-color: var(--black); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.photo-grid figure { margin: 0; position: relative; aspect-ratio: 4/3; max-width: 100%; overflow: hidden; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid button { position: absolute; top: 4px; right: 4px; border: 0; background: var(--black); color: var(--white); border-radius: 50%; width: 24px; height: 24px; cursor: pointer; }
.dropzone { border: 1px dashed var(--muted); padding: 28px; text-align: center; cursor: pointer; color: var(--muted); }
.dropzone:hover, .dropzone.drag { border-color: var(--black); color: var(--black); background: var(--soft); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.check-grid label { border: 1px solid var(--line); padding: 10px; display: flex; gap: 10px; align-items: center; font-weight: 400; cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; font-size: .9rem; }
.check-grid label:has(input:checked) { border-color: var(--black); }
.check-grid input { width: auto; accent-color: var(--black); }
details summary { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }

.auth-wrap { max-width: 540px; margin: 40px auto 56px; }

/* Aviso y ventana modal */
.toast {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(140px);
  background: var(--black); color: var(--white); padding: 12px 20px; font-size: .9rem;
  transition: transform .25s; z-index: 100; max-width: calc(100% - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.modal { border: 1px solid var(--black); border-radius: 0; padding: 0; width: min(560px, calc(100% - 32px)); background: var(--white); color: var(--ink); }
.modal::backdrop { background: rgba(0, 0, 0, .6); }
.modal-inner { padding: 28px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin: 14px 0; font-size: .92rem; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.summary div span:first-child { color: var(--muted); }
.summary b { text-align: right; min-width: 0; overflow-wrap: anywhere; }


/* ---------- Portada ---------- */
main[data-view="inicio"], main[data-view="buscar"] { overflow-x: clip; }
.landing-hero { position: relative; margin-inline: calc(50% - 50vw); min-height: 460px; display: grid; place-items: center; overflow: hidden; background: var(--black); }
.landing-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.landing-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)); }
.landing-hero-inner { position: relative; z-index: 1; width: 100%; max-width: 760px; text-align: center; color: var(--white); padding-block: 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.landing-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 500; margin-bottom: 12px; }
.landing-hero p { margin: 0 auto 28px; max-width: 560px; color: rgba(255,255,255,.85); }
.hero-search { background: var(--white); color: var(--black); border-radius: 8px; padding: 8px; text-align: left; box-shadow: none; }
.hero-tabs { display: flex; gap: 4px; padding: 4px 4px 8px; }
.hero-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; }
.hero-tabs button.active { color: var(--black); border-bottom-color: var(--black); }
.hero-field { display: flex; gap: 8px; }
.hero-field input { flex: 1; min-width: 0; border: 1px solid var(--line); font-size: 1.05rem; padding: 14px 16px; }
.hero-go { display: inline-flex; align-items: center; gap: 8px; background: var(--black); color: var(--white); border: 0; border-radius: var(--radius); padding: 0 22px; font: inherit; font-weight: 600; cursor: pointer; }
.hero-go:hover { background: #000000; }
@media (max-width: 520px) { .hero-go span { display: none; } .hero-go { padding: 0 16px; } }

.home-section { padding-block: 48px 8px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 4px; }
.section-head p { margin: 0; }
.row-arrows { display: flex; gap: 8px; }
.arrow { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--black); }
.arrow:hover { border-color: var(--black); }
.card-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
@media (min-width: 1100px) { .card-row { grid-auto-columns: calc((100% - 60px) / 4); } }
.card-row .card { scroll-snap-align: start; }
.link-more { display: inline-block; margin-top: 16px; font-weight: 600; text-underline-offset: 4px; }

.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.help-card { border: 1px solid var(--line); border-radius: 8px; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.help-card h3 { font-family: var(--sans); font-weight: 700; font-size: 1.1rem; margin: 6px 0 0; }
.help-card p { margin: 0 0 8px; max-width: 30ch; flex: 1; }

.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.zone-tile { position: relative; display: block; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--white); background: var(--black); }
.zone-tile img { width: 100%; height: 100%; object-fit: cover; opacity: .75; transition: transform .5s, opacity .3s; }
.zone-tile:hover img { transform: scale(1.04); opacity: .6; }
.zone-info { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; flex-direction: column; }
.zone-info b { font-family: var(--display); font-size: 1.35rem; font-weight: 500; }
.zone-info span { font-size: .82rem; }

.cta-band { margin: 56px calc(50% - 50vw) 0; background: var(--black); color: var(--white); display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; padding-block: 44px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.cta-text { max-width: 560px; }
.cta-text h2 { font-weight: 500; margin-bottom: 6px; }
.cta-text p { margin: 0; color: var(--on-black-muted); }
.btn-invert { background: var(--white); color: var(--black); border-color: var(--white); }
.btn-invert:hover { background: transparent; color: var(--white); }

/* ---------- Resultados con mapa ---------- */
main[data-view="buscar"] { max-width: none; }
.search-bar { position: sticky; top: calc(72px + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--white); display: flex; flex-wrap: wrap; gap: 8px; padding-block: 12px; border-bottom: 1px solid var(--line); margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.search-bar select { width: auto; padding: 9px 10px; font-size: .9rem; }
.search-input { position: relative; flex: 1 1 260px; min-width: 0; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-input input { padding: 9px 12px 9px 40px; }
@media (max-width: 1180px) { .search-bar { top: calc(64px + env(safe-area-inset-top, 0px)); } }
@media (max-width: 640px) { .search-bar select { flex: 1 1 45%; } }

.results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 44%); gap: 24px; padding-top: 20px; }
.results-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.results-head h1 { font-family: var(--sans); font-weight: 700; font-size: 1.4rem; margin: 0; }
.results-head select { width: auto; font-size: .9rem; }
.results .cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.results-map { position: sticky; top: calc(72px + 66px + env(safe-area-inset-top, 0px)); height: calc(100vh - 160px); min-height: 420px; }
.map { position: relative; height: 100%; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--map-land); }
.pin {
  position: absolute; transform: translate(-50%, -100%); background: var(--black); color: var(--white); border: 2px solid var(--white);
  border-radius: 999px; padding: 3px 9px; font: 700 .75rem/1.3 var(--sans); cursor: pointer; box-shadow: none; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pin::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--black); border-bottom: 0; }
.pin:hover, .pin.hot { background: var(--white); color: var(--black); border-color: var(--black); z-index: 2; }
.pin:hover::after, .pin.hot::after { border-top-color: var(--black); }
.map-toggle { display: none; }
@media (max-width: 900px) {
  .results { grid-template-columns: 1fr; }
  .results-map { display: none; position: static; height: 70vh; }
  .results.show-map .results-map { display: block; }
  .results.show-map .results-list { display: none; }
  .map-toggle {
    display: block; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 40;
    background: var(--black); color: var(--white); border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 600; box-shadow: none; cursor: pointer;
  }
}

/* ---------- Ficha: galería en mosaico ---------- */
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.save-inline { gap: 6px; }
.save-inline svg { width: 16px; height: 16px; }
.gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-bottom: 28px; border-radius: 8px; overflow: hidden; }
.gallery .gallery-main { position: relative; aspect-ratio: auto; height: clamp(260px, 42vw, 480px); }
.photo-count { position: absolute; right: 12px; bottom: 12px; background: var(--white); color: var(--black); font-size: .78rem; font-weight: 600; padding: 5px 10px; border-radius: 3px; }
.gallery .thumbs { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; margin: 0; padding: 0; overflow: hidden; }
.gallery .thumbs button { width: auto; height: auto; opacity: .85; border: 0; }
.gallery .thumbs button.active { opacity: 1; outline: 2px solid var(--black); outline-offset: -2px; }
@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery .thumbs { grid-template-columns: repeat(4, 1fr); grid-template-rows: 64px; }
}

/* ---------- Pie de página ---------- */
.footer { background: var(--black); color: var(--on-black-muted); margin-top: 64px; padding-block: 48px 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer .brand { color: var(--white); }
.footer-brand p { max-width: 34ch; margin-top: 14px; }
.footer h4 { color: var(--white); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 12px; }
.footer-grid a { display: block; color: var(--on-black-muted); text-decoration: none; font-size: .9rem; padding: 4px 0; }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid #000000; margin-top: 36px; padding-top: 20px; font-size: .82rem; }

/* ---------- Mapa interactivo (map.js) ---------- */
.map { position: relative; }
.map-canvas { position: absolute; inset: 0; }
.map-canvas.leaflet-container { font-family: var(--sans); background: var(--map-land); }
.map-loading, .map-error {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .9rem; background: var(--map-land); z-index: 5;
}
.map-loading[hidden] { display: none; }
.map-status {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1000; display: flex; align-items: flex-start; gap: 10px;
  background: var(--white); color: var(--ink); border: 1px solid var(--black); border-radius: 6px; padding: 10px 12px; font-size: .82rem; box-shadow: none;
}
.map-status span { flex: 1; }
.map-status-close, .schematic-close { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--black); padding: 0 2px; }

.map-search { position: absolute; top: 12px; left: 12px; z-index: 1000; width: min(340px, calc(100% - 80px)); }
.map-search-input { padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); box-shadow: none; font-size: .9rem; }
.map-autocomplete { width: 100%; color-scheme: light; border-radius: 6px; box-shadow: none; }
.map-suggest { list-style: none; margin: 4px 0 0; padding: 4px 0; background: var(--white); border: 1px solid var(--line); border-radius: 6px; box-shadow: none; max-height: 240px; overflow-y: auto; }
.map-suggest button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--ink); }
.map-suggest button:hover, .map-suggest button:focus-visible { background: var(--soft); }
.map-suggest-empty { padding: 8px 12px; font-size: .85rem; color: var(--muted); }

/* Pin con el precio (Google, Leaflet y vista esquemática) */
.map-pin {
  display: inline-block; background: var(--black); color: var(--white); border: 2px solid var(--white);
  border-radius: 999px; padding: 3px 9px; font: 700 .75rem/1.3 var(--sans); cursor: pointer; white-space: nowrap;
  box-shadow: none; font-variant-numeric: tabular-nums; position: relative;
}
.map-pin::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--black); border-bottom: 0; }
.map-pin:hover, .map-pin.hot { background: var(--white); color: var(--black); border-color: var(--black); }
.leaflet-pin { background: none; border: 0; }
.leaflet-pin .map-pin { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 6px)); }
.schematic-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.schematic-pins .map-pin { position: absolute; transform: translate(-50%, calc(-100% - 6px)); }
.schematic-pins .map-pin.hot { z-index: 2; }
.schematic-card { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 10; background: var(--white); border-radius: 8px; box-shadow: none; max-width: 320px; }
.schematic-card .schematic-close { position: absolute; right: 6px; top: 6px; z-index: 1; background: var(--white); border-radius: 50%; width: 28px; height: 28px; }

/* Ventanita de información */
.map-info { width: 240px; font-family: var(--sans); color: var(--ink); }
.map-info img { width: 100%; height: 130px; object-fit: cover; display: block; border-radius: 6px 6px 0 0; }
.map-info-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.map-info-price { font-size: 1.15rem; font-weight: 700; color: var(--black); }
.map-info-specs { font-size: .82rem; }
.map-info-addr { font-size: .8rem; color: var(--muted); }
.map-info-actions { display: flex; gap: 6px; margin-top: 8px; }
.map-info-actions .btn { flex: 1; padding: 8px 6px; font-size: .64rem; letter-spacing: .06em; }
.map-popup .leaflet-popup-content-wrapper { padding: 0; border-radius: 8px; overflow: hidden; }
.map-popup .leaflet-popup-content { margin: 0; width: 240px !important; }
.map-popup a.leaflet-popup-close-button { background: var(--white); border-radius: 50%; top: 6px; right: 6px; width: 24px; height: 24px; line-height: 22px; }
.leaflet-control-layers, .leaflet-bar { border-radius: 6px !important; }
@media (max-width: 900px) { .map-search { width: calc(100% - 70px); } }

/* Correcciones del mapa */
.map-status[hidden], .map-search[hidden], .map-suggest[hidden], .schematic-card[hidden] { display: none; }
.map-search { left: 56px; }               /* deja libres los botones de zoom de la izquierda */
.tiles-gray { filter: grayscale(1) contrast(.92) brightness(1.04); }
.results-map { min-height: 420px; }
.map { min-height: 360px; }
@media (max-width: 900px) { .map-search { left: 52px; width: calc(100% - 110px); } }

/* ---------- Solo blanco y negro (sin grises) ---------- */
::placeholder { color: #000; opacity: 1; font-style: italic; }
.btn:disabled { opacity: 1; background: #fff; color: #000; border-style: dashed; }
.slot:disabled { background: #fff; color: #000; }
.card:hover { box-shadow: 0 0 0 1px #000; }
.save { background: #fff; border: 1px solid #000; }
.thumbs button, .gallery .thumbs button { opacity: 1; }
.landing-hero::after { display: none; }
.landing-hero p { color: #fff; }
.hero-search { border: 1px solid #fff; }
.hero-go:hover { background: #fff; color: #000; outline: 1px solid #000; }
.zone-tile { border: 1px solid #000; }
.zone-tile img, .zone-tile:hover img { opacity: 1; }
.zone-info { left: 0; right: 0; bottom: 0; background: #000; padding: 10px 14px; }
.modal::backdrop { background: #fff; }
.modal { border: 2px solid #000; }
.map-search-input, .map-suggest, .schematic-card, .hero-search, .map-toggle { box-shadow: none; }
.map-search-input, .map-suggest { border: 1px solid #000; }
.map-pin { box-shadow: none; }
.footer-bottom, .footer .nav-account { border-color: #fff; }
.tabs, .page-head, .card-foot, .summary { border-color: #000; }
.status.cancel { border-color: #000; color: #000; }

/* ---------- Mapa con geografía incluida (a color) ---------- */
.geo-map.leaflet-container { background: #aad3df; }
.geo-label { white-space: nowrap; pointer-events: none; }
.geo-label i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #333; border: 1px solid #fff; margin-right: 4px; vertical-align: middle; }
.geo-label { font: 600 11px/1 var(--sans); color: #333; text-shadow: 0 0 3px #fff, 0 0 3px #fff; transform: translate(-3px, -6px); }
.geo-capital { font-size: 12px; font-weight: 700; }
.geo-capital i { width: 8px; height: 8px; background: #c0392b; }
.geo-volcano i { width: 0; height: 0; border-radius: 0; background: none; border: 5px solid transparent; border-bottom: 9px solid #8b5a2b; border-top: 0; }
.geo-volcano { color: #6b4423; font-style: italic; font-weight: 500; }
.geo-province { font: 600 10px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #6b7d55; transform: translate(-50%, -50%); text-shadow: 0 0 3px #e8f0d8; }
.geo-neighbor { font: 500 12px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #9a907c; transform: translate(-50%, -50%); text-shadow: none; }
.geo-town { display: none; }
.geo-zoomed .geo-town { display: block; }

/* =====================================================================
   KLAVEL & CO. — componentes nuevos (blanco y negro)
   ===================================================================== */
.brand-mark { background: var(--black); color: var(--white); }
.footer .brand-mark { background: var(--white); color: var(--black); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nav-group { gap: 20px; }
.nav a .badge { margin-left: 4px; }
.nav-account .badge { background: var(--black); color: var(--white); }
.hero-kicker { font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; margin-bottom: 14px; }
.landing-hero h1, .advisory-hero h1, .studio-hero h1, .profile-hero h1 { font-weight: 500; letter-spacing: 0; }
.link-row { display: flex; gap: 24px; flex-wrap: wrap; }
.help-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.join-band { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border: 1px solid var(--black); padding: 28px; }
.join-band h2 { margin: 0 0 4px; }
.join-band p { margin: 0; }
.notice { border: 1px solid var(--black); padding: 10px 14px; margin-top: 20px; font-size: .9rem; }
.detail-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.advisor-link { text-decoration: none; color: inherit; }
.advisor-link:hover b { text-decoration: underline; }
.avatar.photo { object-fit: cover; padding: 0; background: var(--white); filter: grayscale(1); }
.card-foot .avatar { margin-left: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--black); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal-wide { width: min(860px, calc(100% - 32px)); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 40px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* Segmentos (Comprar / Alquilar, filtros) */
.seg { display: inline-flex; border: 1px solid var(--black); border-radius: var(--radius); overflow: hidden; flex: none; }
.seg a, .seg button { padding: 10px 14px; font: inherit; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; text-decoration: none; color: var(--black); background: var(--white); border: 0; cursor: pointer; white-space: nowrap; }
.seg a + a, .seg button + button { border-left: 1px solid var(--black); }
.seg a.active, .seg button.active { background: var(--black); color: var(--white); }
.seg-sm a, .seg-sm button { padding: 7px 10px; font-size: .66rem; }
.seg-wrap { flex-wrap: wrap; }
.search-bar-plain { position: static; margin: 0 0 20px; border-bottom: 0; padding: 0; }
.tabs a { padding: 10px 16px; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--black); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { border-bottom-color: var(--black); font-weight: 600; }

/* Agentes */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-bottom: 48px; }
.agent-card { display: flex; flex-direction: column; border: 1px solid var(--black); text-decoration: none; color: inherit; background: var(--white); min-width: 0; }
.agent-card:hover { box-shadow: 0 0 0 1px var(--black); }
.agent-photo, .profile-photo { aspect-ratio: 4 / 5; background: var(--black); color: var(--white); display: grid; place-items: center; overflow: hidden; }
.agent-photo img, .profile-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.agent-photo span, .profile-photo span { font-family: var(--display); font-size: 3.2rem; letter-spacing: .08em; }
.agent-card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.agent-name { font-family: var(--display); font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.agent-meta { font-variant-numeric: tabular-nums; }
.profile-hero { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 36px; align-items: end; margin: 32px 0 8px; padding-bottom: 28px; border-bottom: 1px solid var(--black); }
.profile-hero h1 { margin: 6px 0 4px; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.profile-title { font-size: 1.05rem; }
.profile-stats { display: flex; gap: 0; margin: 20px 0; border: 1px solid currentColor; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.profile-stats div { padding: 10px 18px; display: flex; flex-direction: column; }
.profile-stats div + div { border-left: 1px solid currentColor; }
.profile-stats b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.profile-stats span { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-facts { display: grid; gap: 14px; margin-top: 18px; }
.profile-facts > div > span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.social-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: .88rem; }
@media (max-width: 700px) { .profile-hero { grid-template-columns: 1fr; } .profile-photo { max-width: 240px; } }
.profile-edit { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile-edit .profile-photo { width: 140px; flex: none; }

/* Proyectos y Development & Advisory */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; margin-bottom: 40px; }
.project-card { display: flex; flex-direction: column; border: 1px solid var(--black); text-decoration: none; color: inherit; background: var(--white); min-width: 0; }
.project-card:hover { box-shadow: 0 0 0 1px var(--black); }
.project-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--black); }
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.project-name { font-family: var(--display); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.project-line { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; margin-top: 6px; flex-wrap: wrap; }
.bar { height: 6px; border: 1px solid var(--black); background: var(--white); flex: 1; min-width: 40px; }
.bar i { display: block; height: 100%; background: var(--black); }
.advisory-hero, .studio-hero { margin: 0 calc(50% - 50vw); background: var(--black); color: var(--white); text-align: center; padding: 72px max(16px, env(safe-area-inset-left, 0px)) 64px; }
.advisory-hero h1, .studio-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 8px 0 14px; }
.advisory-hero p, .studio-hero p { max-width: 640px; margin: 0 auto 8px; }
.advisory-hero .eyebrow, .studio-hero .eyebrow { color: var(--white); letter-spacing: .32em; }
.advisory-hero .profile-stats { margin: 28px auto; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); border-top: 1px solid var(--black); border-left: 1px solid var(--black); }
.service { padding: 22px; border-right: 1px solid var(--black); border-bottom: 1px solid var(--black); }
.service h3 { font-size: 1.3rem; margin: 10px 0 6px; }
.service p { margin: 0; font-size: .92rem; }
.service-n { font-family: var(--display); font-size: 1.8rem; }
.process { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border: 1px solid var(--black); }
.process li { counter-increment: step; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.process li + li { border-left: 1px solid var(--black); }
.process li::before { content: counter(step, decimal-leading-zero); font-family: var(--display); font-size: 1.6rem; }
.process span { font-size: .9rem; }
@media (max-width: 700px) { .process li + li { border-left: 0; border-top: 1px solid var(--black); } }
.advisory-form { max-width: 820px; margin: 0 auto; }

/* Tablas */
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--black); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; padding: 10px 12px; border-bottom: 1px solid var(--black); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--black); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: inherit; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover { box-shadow: inset 3px 0 0 var(--black); }
.cell-input { padding: 6px 8px; font-size: .85rem; min-width: 110px; }

/* Paneles privados (agente y Master Admin) */
main[data-view="panel"], main[data-view="admin"] { max-width: 1320px; }
.dash { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; margin-top: 28px; align-items: start; }
.dash-nav { position: sticky; top: 96px; border: 1px solid var(--black); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.dash-who b { font-family: var(--display); font-size: 1.35rem; line-height: 1.15; display: block; }
.dash-nav nav { display: flex; flex-direction: column; border-top: 1px solid var(--black); }
.dash-nav nav a { padding: 10px 0; border-bottom: 1px solid var(--black); text-decoration: none; font-size: .85rem; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.dash-nav nav a.active { font-weight: 700; }
.dash-nav nav a.active::before { content: "→ "; }
.dash-main .page-head { margin-top: 0; }
.dash-main > .back:first-child { margin-top: 0; }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; gap: 20px; }
  .dash-nav { position: static; }
  .dash-nav nav { flex-direction: row; flex-wrap: wrap; border: 0; gap: 6px; }
  .dash-nav nav a { border: 1px solid var(--black); padding: 7px 10px; font-size: .78rem; }
  .dash-nav nav a.active { background: var(--black); color: var(--white); }
  .dash-nav nav a.active::before { content: ""; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border-top: 1px solid var(--black); border-left: 1px solid var(--black); margin-bottom: 24px; }
.kpi { padding: 16px; border-right: 1px solid var(--black); border-bottom: 1px solid var(--black); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; }
a.kpi:hover { background: var(--black); color: var(--white); }
.kpi b { font-family: var(--display); font-size: 2.1rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; }
.kpis-sm .kpi b { font-size: 1.5rem; }
.dash-cols { gap: 24px; align-items: start; }
.dash-cols .panel { margin-top: 0; }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } }
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.alert { border: 1px solid var(--black); background: var(--black); color: var(--white); padding: 10px 14px; text-decoration: none; font-weight: 600; font-size: .9rem; }
.alert:hover { background: var(--white); color: var(--black); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 100px 1fr 28px; gap: 10px; align-items: center; font-size: .85rem; }
.funnel-row b { text-align: right; font-variant-numeric: tabular-nums; }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--black); font-size: .9rem; flex-wrap: wrap; }
.todo li:last-child { border-bottom: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 16px; border-left: 1px solid var(--black); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 16px; width: 7px; height: 7px; background: var(--black); }
.timeline li div { font-size: .92rem; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.toolbar-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-filters input, .toolbar-filters select { width: auto; min-width: 180px; }
.listing-row .visit-actions { flex-wrap: wrap; }
.admin-entry { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.status.lead-nuevo { background: var(--black); color: var(--white); }
.status.lead-cerrado { background: var(--black); color: var(--white); border-style: double; border-width: 3px; }
.status.lead-perdido { text-decoration: line-through; }
.status.lead-contactado, .status.lead-calificado, .status.lead-visita, .status.lead-negociacion { background: var(--white); }
.photo-grid figure { position: relative; }
.photo-grid .cover { position: absolute; left: 6px; bottom: 6px; background: var(--black); color: var(--white); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; padding: 2px 6px; }
.photo-grid .mk { position: absolute; left: 6px; bottom: 6px; width: 26px; height: 26px; border: 1px solid var(--black); background: var(--white); cursor: pointer; }

/* AI Media Studio */
.studio-hero .fidelity { border: 1px solid var(--white); display: inline-block; padding: 10px 16px; margin-top: 16px; font-size: .88rem; }
.studio-picks { margin-top: 16px; }
.studio-pick { text-decoration: none; color: inherit; }
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 460px); gap: 32px; margin-bottom: 56px; align-items: start; }
@media (max-width: 960px) { .studio { grid-template-columns: 1fr; } }
.studio-controls .form-card:first-child { margin-top: 0; }
.studio-preview .sticky { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 12px; }
.canvas-wrap { background: var(--black); border: 1px solid var(--black); display: grid; place-items: center; }
.canvas-wrap canvas { display: block; width: 100%; height: auto; }
.canvas-wrap.vertical canvas { max-height: 70vh; width: auto; max-width: 100%; }
.studio-bar { display: flex; align-items: center; gap: 12px; }
.studio-bar .small { white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }
.progress { flex: 1; height: 4px; border: 1px solid var(--black); }
.progress i { display: block; height: 100%; width: 0; background: var(--black); }
.studio-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.studio-actions .btn { flex: 1; }
.fidelity { border-left: 2px solid var(--black); padding-left: 10px; margin: 0; }
.studio-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.studio-photos figure { margin: 0; position: relative; aspect-ratio: 4 / 3; border: 1px dashed var(--black); overflow: hidden; }
.studio-photos figure.on { border: 2px solid var(--black); }
.studio-photos figure:not(.on) img { opacity: .45; }
.studio-photos img { width: 100%; height: 100%; object-fit: cover; }
.studio-photos .pick { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--black); background: var(--white); font: 700 .75rem var(--sans); cursor: pointer; }
.studio-photos figure.on .pick { background: var(--black); color: var(--white); border-color: var(--white); }
.studio-photos .order { position: absolute; left: 4px; bottom: 4px; display: flex; gap: 2px; }
.studio-photos .order button { width: 24px; height: 22px; border: 1px solid var(--black); background: var(--white); cursor: pointer; line-height: 1; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.style-opt { text-align: left; border: 1px solid var(--black); background: var(--white); color: var(--black); padding: 12px 14px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.style-opt b { font-family: var(--display); font-size: 1.25rem; font-weight: 600; }
.style-opt span { font-size: .8rem; }
.style-opt.active { background: var(--black); color: var(--white); }
.result video { width: 100%; max-height: 60vh; background: var(--black); margin-bottom: 12px; }
.result video.vertical { width: auto; max-width: 100%; display: block; margin-inline: auto; }
input[type="range"] { padding: 0; border: 0; accent-color: var(--black); }

/* Ajustes: números legibles en la tipografía serif, menú del panel y legibilidad del hero */
h1, h2, h3, .kpi b, .agent-name, .project-name, .service-n, .dash-who b, .style-opt b { font-variant-numeric: lining-nums; }
.dash-nav nav a { justify-content: flex-start; gap: 6px; }
.dash-nav nav a .badge { margin-left: auto; }
.landing-hero-inner h1, .landing-hero-inner > p, .hero-kicker { background: var(--black); display: inline-block; padding: 4px 14px; }
.landing-hero-inner h1 { padding: 8px 18px; }

/* Logotipo oficial (assets/klavel-logo.png: letras blancas sobre negro).
   En la cabecera blanca se invierte a negro sobre blanco. */
.brand-logo { height: 30px; width: auto; display: block; }
.topbar .brand-logo { filter: invert(1); }
.footer .brand-logo { height: 34px; }
.hero-logo { width: min(560px, 86%); height: auto; margin: 0 auto 18px; display: block; }
@media (max-width: 1180px) { .topbar .brand-logo { height: 24px; } }
@media (max-width: 420px) { .topbar .brand-logo { height: 20px; } }

/* Portada: logotipo, y debajo la casa (assets/hero-casa.jpg) detrás del buscador.
   La foto se funde en negro por los cuatro lados para que solo se lea la casa. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.landing-hero { display: block; min-height: 0; background: #000; }
.landing-hero-inner { padding-block: 56px 8px; max-width: 760px; margin: 0 auto; }
.landing-hero-inner .hero-kicker { background: none; padding: 0; color: #fff; }
.hero-logo { margin-bottom: 14px; }
.hero-stage { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero-house {
  display: block; width: min(680px, 96%); height: auto; margin-top: 28px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 62%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent 0, #000 18%, #000 82%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 62%, transparent 100%);
          mask-composite: intersect;
}
.hero-stage-inner { position: relative; z-index: 1; width: 100%; max-width: 760px; margin-top: -120px; padding-block: 0 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); text-align: center; }
.hero-stage .hero-search { border: 1px solid #fff; }
.hero-sub { color: #fff; margin: 16px auto 0; max-width: 560px; font-size: .95rem; }
@media (max-width: 640px) {
  .landing-hero-inner { padding-block: 40px 0; }
  .hero-stage-inner { margin-top: -70px; }
  .hero-house { margin-top: 16px; }
}

/* ---------- Usuarios y ofertas ---------- */
.dash-main > .grid-2 + .form-card, .dash-main > .form-card + .panel, .dash-main > .panel + .grid-2 { margin-top: 20px; }
.form-error { border: 1px solid var(--black); padding: 10px 12px; font-size: .9rem; font-weight: 600; margin: 0 0 14px; }
.offer-box { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--black); padding: 12px 14px; margin: 6px 0 16px; }
.offer-box .tag { flex: none; margin-top: 2px; }
.offer-price { font-weight: 700; }
.offer-list { list-style: none; padding: 0; margin: 0 0 16px; }
.offer-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); padding: 10px 12px; margin-bottom: 8px; }
.offer-actions { display: flex; gap: 6px; }

/* Estado de la sincronización con el servidor (solo visible mientras guarda o sin conexión) */
.sync-status { position: fixed; left: 16px; bottom: 16px; z-index: 60; background: #000; color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
.sync-status[data-s="offline"] { background: #fff; color: #000; border: 1px solid #000; }
.sync-status[hidden] { display: none; }
