:root {
  --ink: #15202e;
  --ink-2: #4a5668;
  --ink-3: #7b8696;
  --line: #e3e7ee;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --accent: #1d3f7a;
  --accent-2: #2b5aa8;
  --ok: #1f8a4c;
  --ok-bg: #e6f5ec;
  --warn: #a86a00;
  --warn-bg: #fff3dc;
  --bad: #b3392f;
  --bad-bg: #fde9e7;
  --muted-bg: #eef1f5;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(16, 32, 60, 0.14), 0 1px 3px rgba(16, 32, 60, 0.08);
  --top: calc(12px + env(safe-area-inset-top));
  --panel-w: 400px;
  --vivid: saturate(2) contrast(1.04);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: #e9edf2;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
#map { position: fixed; inset: 0; z-index: 1; background: #e9edf2; }

/* Filtro para realzar los pasteles de la zonificación oficial */
.vivid .leaflet-zon-pane, .vivid .swatch { filter: var(--vivid); }

/* ---------- Barra superior ---------- */
.topbar {
  position: fixed; z-index: 1200; top: var(--top); left: 12px; right: 12px;
  display: flex; gap: 8px; align-items: flex-start; pointer-events: none;
}
.brand {
  pointer-events: auto; flex: 0 0 46px; height: 46px; border-radius: 12px;
  background: var(--accent); display: grid; place-items: center; box-shadow: var(--shadow);
}
.brand svg { width: 22px; height: 22px; fill: #fff; }
.search {
  pointer-events: auto; position: relative; flex: 1 1 auto; min-width: 0; max-width: 520px;
  display: flex; align-items: center; background: var(--surface);
  border-radius: 12px; box-shadow: var(--shadow); height: 46px;
}
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; padding: 0 6px 0 14px; color: var(--ink); height: 100%;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--ink-3); }
.search-clear { border: 0; background: none; font-size: 22px; color: var(--ink-3); padding: 0 6px; height: 100%; }
.search-go {
  border: 0; background: var(--accent); width: 40px; height: 36px; margin-right: 5px;
  border-radius: 9px; display: grid; place-items: center;
}
.search-go svg { width: 20px; height: 20px; fill: #fff; }
.suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px;
  list-style: none; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 55vh; overflow: auto;
}
.suggestions li {
  padding: 10px 12px; border-radius: 9px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start;
}
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--surface-2); }
.suggestions .s-ico { flex: 0 0 18px; margin-top: 2px; fill: var(--ink-3); width: 18px; height: 18px; }
.suggestions .s-main { font-weight: 600; font-size: 14.5px; }
.suggestions .s-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.suggestions .s-empty { color: var(--ink-3); cursor: default; font-size: 14px; }
.suggestions .s-empty:hover { background: none; }

/* ---------- Botones flotantes ---------- */
.fab-stack {
  position: fixed; z-index: 900; right: 12px; top: calc(var(--top) + 58px);
  display: flex; flex-direction: column; gap: 8px;
}
.fab {
  width: 46px; height: 46px; border: 0; border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow); display: grid; place-items: center;
}
.fab svg { width: 22px; height: 22px; fill: var(--accent); }
.fab.on { background: var(--accent); }
.fab.on svg { fill: #fff; }
.icon-btn {
  border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 10px;
  font-size: 22px; line-height: 1; color: var(--ink-2); display: grid; place-items: center;
}

/* ---------- Panel de capas ---------- */
.layers-panel {
  position: fixed; z-index: 1100; right: 12px; top: calc(var(--top) + 58px);
  width: 320px; max-height: calc(100vh - var(--top) - 80px); overflow: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.lp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 6px 16px; position: sticky; top: 0; background: var(--surface); }
.lp-head h2 { font-size: 16px; margin: 0; }
.lp-body { padding: 4px 16px 16px; }
.lp-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 8px; font-weight: 600; }
.lp-group { display: flex; flex-direction: column; gap: 2px; }
.ov-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-radius: 9px; cursor: pointer; }
.ov-row:hover { background: var(--surface-2); }
.ov-row input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.ov-row .ov-dot { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 12px; }
.ov-row .ov-label { flex: 1; font-size: 14.5px; font-weight: 500; }
.ov-row .ov-hint { font-size: 11.5px; color: var(--ink-3); }
.lp-row { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); }
.lp-row input[type=range] { accent-color: var(--accent); width: 100%; }
.switch-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 4px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 5px; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 9px; }
.legend .swatch { width: 22px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); flex: 0 0 22px; }
.legend b { color: var(--ink); font-weight: 600; min-width: 40px; display: inline-block; }
.legend.lines .ln { width: 22px; height: 0; border-top: 3px solid var(--c); flex: 0 0 22px; }
.legend.lines .ln.thin { border-top-width: 1.5px; }
.lp-note { font-size: 12px; color: var(--ink-3); margin: 16px 0 6px; line-height: 1.45; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-2); font-weight: 600; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Panel de información ---------- */
.panel {
  position: fixed; z-index: 1050; left: 12px; top: calc(var(--top) + 58px); bottom: 12px;
  width: var(--panel-w); background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.panel-handle { display: none; }
.panel-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.panel-body { overflow: auto; padding: 18px 18px 24px; -webkit-overflow-scrolling: touch; }

.p-addr { padding-right: 40px; }
.p-addr h2 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.p-addr p { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }

.zone-card {
  margin-top: 14px; border-radius: 12px; padding: 14px; background: var(--surface-2);
  display: flex; gap: 12px; align-items: center;
}
.zone-chip {
  flex: 0 0 auto; min-width: 58px; height: 58px; padding: 0 8px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 700; font-size: 17px; color: var(--ink);
  border: 1px solid rgba(0,0,0,.1); position: relative; overflow: hidden;
}
.zone-chip .bg { position: absolute; inset: 0; }
.zone-chip span { position: relative; }
.zone-card h3 { margin: 0; font-size: 16px; }
.zone-card p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.kpi small { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi strong { display: block; font-size: 20px; margin-top: 2px; letter-spacing: -.01em; }
.kpi em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

.section { margin-top: 18px; }
.section > h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.dl { margin: 0; display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dl > div { padding: 10px 12px; border-top: 1px solid var(--line); }
.dl > div:first-child { border-top: 0; }
.dl dt { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.dl dd { margin: 2px 0 0; font-size: 14px; line-height: 1.4; }

.svc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.svc-card { border-radius: 12px; padding: 12px; border: 1px solid var(--line); }
.svc-card .svc-top { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.svc-card .svc-top svg { width: 18px; height: 18px; }
.svc-card .pill { display: inline-block; margin-top: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.svc-card p { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.pill.si { background: var(--ok-bg); color: var(--ok); }
.pill.proyectado, .pill.cerca, .pill.sin_servicio { background: var(--warn-bg); color: var(--warn); }
.pill.no { background: var(--bad-bg); color: var(--bad); }
.pill.nd { background: var(--muted-bg); color: var(--ink-2); }

.banda { border-left: 4px solid #8a5fb0; background: #f6f1fa; border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; line-height: 1.45; }
.banda strong { display: block; font-size: 14px; margin-bottom: 2px; }

.calc { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.calc label { font-size: 12.5px; color: var(--ink-2); display: block; margin-bottom: 6px; }
.calc .in { display: flex; align-items: center; gap: 8px; }
.calc input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; }
.calc input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(43,90,168,.15); }
.calc .unit { color: var(--ink-3); font-size: 14px; }
.calc .out { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.calc .out div { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.calc .out small { display: block; font-size: 11.5px; color: var(--ink-3); }
.calc .out strong { font-size: 16px; }
.calc .note { font-size: 11.5px; color: var(--ink-3); margin: 8px 0 0; line-height: 1.4; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.btn { border: 0; border-radius: 11px; padding: 11px 12px; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn.primary { background: #1f9d55; color: #fff; grid-column: 1 / -1; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }

.disclaimer { font-size: 11.5px; color: var(--ink-3); margin-top: 16px; line-height: 1.5; }
.warn-box { background: var(--warn-bg); color: #6b4700; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; line-height: 1.45; }

.skeleton { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Marcador ---------- */
.pin { width: 34px; height: 44px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.pin svg { width: 34px; height: 44px; }

/* ---------- Modal tabla ---------- */
.dlg { border: 0; padding: 0; border-radius: 16px; width: min(1100px, 96vw); max-height: 90vh; box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(15, 25, 45, .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.dlg-head h2 { margin: 0; font-size: 16px; }
.dlg-body { overflow: auto; max-height: calc(90vh - 64px); padding: 0 0 12px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); z-index: 1; }
.tbl td.num { text-align: center; white-space: nowrap; }
.tbl tr.grp td { background: #f0f4fa; font-weight: 700; color: var(--accent); font-size: 12px; }
.tbl tr.hl td { background: #fff6d6; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom)); background: #18243a; color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow);
}

/* Leaflet ajustes */
.leaflet-control-attribution { font-size: 10px; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--accent) !important; }
.leaflet-bottom.leaflet-right { margin-bottom: env(safe-area-inset-bottom); }

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .search { max-width: none; }
  .layers-panel { left: 12px; right: 12px; width: auto; }
  .panel {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 18px 18px 0 0;
    max-height: 42vh; transition: max-height .25s ease; padding-bottom: env(safe-area-inset-bottom);
  }
  .panel.expanded { max-height: calc(100vh - var(--top) - 64px); }
  .panel-handle {
    display: block; border: 0; background: none; width: 100%; padding: 8px 0 2px; flex: 0 0 auto;
  }
  .panel-handle span { display: block; width: 42px; height: 5px; border-radius: 3px; background: #cfd5de; margin: 0 auto; }
  .panel-close { top: 14px; }
  .panel-body { padding-top: 6px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi strong { font-size: 18px; }
  .leaflet-bottom.leaflet-right { bottom: var(--sheet-h, 0px); }
  .leaflet-control-zoom, .leaflet-control-scale { display: none; }
  .leaflet-control-attribution { max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 380px) {
  .svc { grid-template-columns: 1fr; }
}

/* Mapa base "Claro": OSM desaturado y aclarado para que resalte la zonificación */
.base-claro { filter: grayscale(1) brightness(1.12) contrast(0.82); }

/* Indicador de carga de capas */
.loading-pill {
  position: fixed; z-index: 950; left: 50%; transform: translateX(-50%);
  top: calc(var(--top) + 58px); background: rgba(24, 36, 58, .88); color: #fff;
  font-size: 12.5px; font-weight: 500; padding: 6px 12px 6px 10px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px; pointer-events: none; box-shadow: var(--shadow);
}
.loading-pill .spin {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 761px) { .loading-pill { left: calc(50% + 100px); } }

/* ---------- Lote: superficie y medidas destacadas ---------- */
.lot-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; margin-top: 14px; }
.lot-hero > div { border-radius: 14px; padding: 12px 14px 11px; }
.lh-sup { background: var(--accent); color: #fff; }
.lh-med { background: #e9eef8; color: var(--ink); }
.lot-hero small { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .78; }
.lot-hero strong { display: block; font-size: 30px; line-height: 1.1; margin-top: 4px; letter-spacing: -.02em; font-weight: 700; }
.lot-hero strong span { font-size: 16px; font-weight: 600; opacity: .85; letter-spacing: 0; }
.lot-hero .lh-med strong { font-size: 22px; margin-top: 8px; }
.lot-hero strong.nd { font-size: 18px; opacity: .7; margin-top: 8px; }
.lot-hero em { display: block; font-style: normal; font-size: 11.5px; margin-top: 5px; opacity: .75; }
.lh-lados { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin-top: 6px; }
.lot-hero > div strong.lh-carg { display: flex; align-items: center; gap: 7px; font-size: 15px; white-space: nowrap; margin-top: 10px; }
.lh-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: lhspin .8s linear infinite; flex: none; opacity: .9; }
@keyframes lhspin { to { transform: rotate(360deg); } }
.chip-carg { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .lh-spin { animation-duration: 2.4s; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--ink-2); }
.chip b { color: var(--ink); font-weight: 600; }

/* ---------- Lote en venta en la ficha ---------- */
.venta { margin-top: 14px; border-radius: 14px; padding: 12px 14px; background: #e9f7ef; border: 1px solid #bfe6cd; }
.venta.star { background: linear-gradient(135deg, #fff6d8, #ffeec0); border-color: #f0d27a; }
.v-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.v-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #15803d; }
.venta.star .v-tag { color: #9a6b00; }
.v-tag svg { width: 15px; height: 15px; fill: currentColor; }
.v-precio { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; }
.v-tit { font-weight: 600; font-size: 14px; margin-top: 2px; }
.v-desc { font-size: 13px; color: var(--ink-2); margin: 6px 0 0; line-height: 1.45; white-space: pre-line; }
.v-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent-2); }
.lc-estado { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--muted-bg); color: var(--ink-2); }
.lc-estado.reservado { background: var(--warn-bg); color: var(--warn); }
.lc-estado.vendido { background: var(--bad-bg); color: var(--bad); }

.svc-card .svc-src { font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.svc-card .svc-src.verified { color: var(--ok); font-weight: 600; }

/* ---------- Botón flotante lotes ---------- */
.fab { position: relative; }
.fab-lotes svg { fill: #16a34a; }
.fab-lotes.on { background: #16a34a; }
.fab-badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #16a34a; color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}

/* ---------- Panel lotes en venta ---------- */
.lotes-panel { width: 360px; display: flex; flex-direction: column; }
.lotes-panel .lp-body { overflow: auto; padding-bottom: 14px; }
.lp-count { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.filtros { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.f-in { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); outline: 0; }
.f-in:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(43,90,168,.12); }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-grid label { font-size: 11.5px; color: var(--ink-3); display: flex; flex-direction: column; gap: 3px; font-weight: 500; }
.f-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.f-chip { display: inline-flex; align-items: center; cursor: pointer; }
.f-chip input { position: absolute; opacity: 0; pointer-events: none; }
.f-chip span { font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: #fff; }
.f-chip input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.f-chip.star input:checked + span { background: #e0a100; border-color: #e0a100; }
#filtrosAvanzados { display: flex; flex-direction: column; gap: 8px; }
#filtrosAvanzados[hidden] { display: none !important; }
.f-actions { display: flex; justify-content: space-between; }
.link-btn.muted { color: var(--ink-3); }
.lotes-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lote-card { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; position: relative; transition: box-shadow .15s, border-color .15s; }
.lote-card:hover { border-color: #b9c6dc; box-shadow: 0 2px 10px rgba(16,32,60,.08); }
.lote-card.star { border: 1.5px solid #f0c94e; background: linear-gradient(180deg, #fffaf0, #fff); }
.lote-card.sold { opacity: .6; }
.lc-star { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: #9a6b00; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.lc-star svg { width: 13px; height: 13px; fill: #e0a100; }
.lc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lc-precio { font-size: 17px; }
.lc-tit { font-weight: 600; font-size: 13.5px; margin-top: 2px; }
.lc-dir { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.lc-meta b { color: var(--ink); font-size: 14px; }
.lc-zona { display: inline-flex; align-items: center; gap: 5px; }
.lc-zona .swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.lc-svc { display: flex; gap: 5px; margin-top: 7px; }
.mini { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.mini.ok { background: var(--ok-bg); color: var(--ok); }
.mini.bad { background: var(--bad-bg); color: var(--bad); }
.mini.nd { background: var(--muted-bg); color: var(--ink-3); }
.lc-empty { color: var(--ink-3); font-size: 13.5px; padding: 18px 4px; text-align: center; }

/* ---------- Marcadores de lotes ---------- */
.lote-pin span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: #16a34a; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.lote-pin svg { width: 15px; height: 15px; fill: #fff; }
.lote-pin.star span { background: linear-gradient(135deg, #c9d1dc, #8792a6 55%, #6b7588); animation: starpulse 2.2s ease-out infinite; }
.lote-pin.oro span { background: linear-gradient(135deg, #ffd65a, #e0a100 55%, #b97f00); }
.lote-pin.oro.star span { animation: starpulse 2.2s ease-out infinite; box-shadow: 0 0 0 3px rgba(224,161,0,.35), 0 2px 6px rgba(0,0,0,.3); }
.lote-pin.star svg { width: 20px; height: 20px; }
.lote-pin.sold span { background: #7b8696; }
@keyframes starpulse {
  0% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 0 rgba(224,161,0,.55); }
  70% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 12px rgba(224,161,0,0); }
  100% { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 0 rgba(224,161,0,0); }
}

.btn[disabled] { opacity: .7; cursor: progress; }
.spin.dark { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0,0,0,.15); border-top-color: var(--ink); animation: spin .8s linear infinite; display: inline-block; }

@media (max-width: 760px) {
  .lotes-panel { width: auto; max-height: calc(100vh - var(--top) - 70px); }
  .lot-hero strong { font-size: 26px; }
  .lot-hero .lh-med strong { font-size: 19px; }
}

/* ---------- Registro obligatorio ---------- */
body.gated .topbar, body.gated .fab-stack, body.gated .panel { visibility: hidden; }
.gate {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px;
  background: rgba(16, 28, 50, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: auto;
}
.gate-card {
  width: 100%; max-width: 560px; background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(10, 20, 40, .35); margin: auto;
}
.gate-top { background: var(--accent); color: #fff; padding: 20px 24px 18px; }
.gate-top h1 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.gate-top p { margin: 6px 0 0; font-size: 13.5px; color: #c9d6ee; line-height: 1.45; }
.gate-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 12px; }
.gate-tabs button { flex: 1; border: 0; background: none; padding: 13px 6px 11px; font-weight: 600; font-size: 14px; color: var(--ink-3); border-bottom: 2.5px solid transparent; }
.gate-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.gate-form { padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.g-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-grid .full { grid-column: 1 / -1; }
.g-f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.g-f > span { font-size: 12.5px; }
.g-f input { font: inherit; font-size: 15px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); width: 100%; }
.g-f input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(43,90,168,.14); }
.g-f small, .g-err-solo { color: var(--bad); font-size: 11.5px; min-height: 0; font-weight: 500; }
.g-f.bad input, .g-f.bad .ms-btn { border-color: var(--bad); }
.g-check { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; cursor: pointer; }
.g-check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.g-submit { margin-top: 4px; width: 100%; background: var(--accent) !important; }
.g-msg { margin: 0; background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.g-hint { margin: 0; font-size: 12px; color: var(--ink-3); text-align: center; }

/* desplegable de selección múltiple */
.ms { position: relative; }
.ms-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left;
  font: inherit; font-size: 15px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-3);
}
.ms-btn.has { color: var(--ink); }
.ms-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-btn svg { width: 20px; height: 20px; fill: var(--ink-3); flex: 0 0 auto; }
.ms-panel {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.ms-panel label { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; font-size: 14px; color: var(--ink); cursor: pointer; font-weight: 500; }
.ms-panel label:hover { background: var(--surface-2); }
.ms-panel input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- Usuario ---------- */
.user-btn {
  pointer-events: auto; flex: 0 0 46px; height: 46px; border-radius: 50%; border: 0; background: var(--surface);
  box-shadow: var(--shadow); font-weight: 700; font-size: 14px; color: var(--accent); display: grid; place-items: center;
}
.user-menu {
  pointer-events: auto; position: absolute; top: 54px; right: 0; width: 250px; background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.um-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.um-head b { display: block; font-size: 14px; }
.um-head span { font-size: 12px; color: var(--ink-3); }
.user-menu button { border: 0; background: none; text-align: left; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.user-menu button:hover { background: var(--surface-2); }
#umSalir { color: var(--bad); }
.topbar { justify-content: flex-start; }
.topbar .user-btn { margin-left: auto; }

/* botón guardar en la ficha */
.btn.save-btn { background: #fff7e0; color: #8a6100; grid-column: 1 / -1; border: 1px solid #f0d27a; }
.btn.save-btn svg { fill: none; stroke: #c58a00; stroke-width: 2; }
.btn.save-btn.on { background: #e0a100; color: #fff; border-color: #e0a100; }
.btn.save-btn.on svg { fill: #fff; stroke: #fff; }
.qrm { border: 0; background: var(--surface-2); width: 26px; height: 26px; border-radius: 8px; font-size: 17px; color: var(--ink-3); line-height: 1; }

@media (max-width: 560px) {
  .g-grid { grid-template-columns: 1fr; }
  .gate { padding: 0; place-items: stretch; }
  .gate-card { border-radius: 0; min-height: 100%; }
}

/* Guardar lote, arriba de la ficha */
.save-top {
  margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid #f0d27a; background: #fff8e4; color: #8a6100; border-radius: 12px; padding: 10px 12px;
  font-weight: 700; font-size: 14.5px;
}
.save-top svg { width: 19px; height: 19px; fill: none; stroke: #c58a00; stroke-width: 2; }
.save-top:hover { background: #fff1c9; }
.save-top.on { background: #e0a100; border-color: #e0a100; color: #fff; }
.save-top.on svg { fill: #fff; stroke: #fff; }
.save-top[disabled] { opacity: .7; }

/* Acciones arriba de la ficha: guardar + unificar */
.top-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.top-actions .save-top { margin-top: 0; }
.top-actions .save-top:only-child { grid-column: 1 / -1; }
.union-top {
  display: flex; align-items: center; gap: 6px; border: 1.5px solid #d8c8fb; background: #f5f0ff; color: #5b21b6;
  border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.union-top svg { width: 17px; height: 17px; fill: #7c3aed; }
.union-top:hover { background: #ede4ff; }
@media (max-width: 380px) { .union-top span { display: none; } }

/* Prefactibilidad */
.pf-tag { font-size: 10.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-3); background: var(--muted-bg); padding: 2px 7px; border-radius: 999px; margin-left: 4px; }
.prefa .out { grid-template-columns: 1fr 1fr 1fr; }
.prefa .out strong { font-size: 15px; }
#pfSupWrap[hidden] + .out { margin-top: 0; }
.pf-res { margin-top: 10px; border-radius: 12px; padding: 12px 14px; }
.pf-res small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.pf-res strong { display: block; font-size: 26px; letter-spacing: -.02em; margin: 3px 0 2px; }
.pf-res span { font-size: 12.5px; }
.pf-res.ok { background: #e6f5ec; color: #14532d; }
.pf-res.bad { background: var(--bad-bg); color: var(--bad); }
.pf-res.empty { background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.pf-cmp { margin-top: 8px; font-size: 13px; padding: 8px 11px; border-radius: 10px; line-height: 1.4; }
.pf-cmp.ok { background: #f0faf4; color: #166534; }
.pf-cmp.bad { background: #fff5f4; color: var(--bad); }
.pf-det { margin-top: 8px; font-size: 13px; }
.pf-det summary { cursor: pointer; color: var(--accent-2); font-weight: 600; font-size: 12.5px; }
.pf-det .dl { margin-top: 6px; }
.pf-toggle { margin-top: 10px; display: inline-block; }
.pf-sup { margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.pf-in { display: flex; align-items: center; gap: 5px; }
.pf-in .f-in { font-size: 14px; padding: 7px 9px; }
.pf-in em { font-style: normal; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 420px) { .prefa .out { grid-template-columns: 1fr 1fr; } }

/* Unificación */
.union-bar {
  position: fixed; z-index: 1100; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; background: #2e1065; color: #fff; border-radius: 14px; padding: 9px 9px 9px 14px;
  box-shadow: var(--shadow); max-width: calc(100vw - 24px);
}
.ub-txt { display: flex; flex-direction: column; min-width: 0; }
.ub-txt b { font-size: 14px; }
.ub-txt span { font-size: 12px; opacity: .8; }
.union-bar .btn.sm { padding: 8px 12px; font-size: 13px; background: #8b5cf6; grid-column: auto; white-space: nowrap; }
.union-bar .icon-btn { background: rgba(255,255,255,.12); color: #fff; }
@media (min-width: 761px) { .union-bar { left: calc(50% + 206px); } }
@media (max-width: 760px) { .union-bar { top: calc(var(--top) + 58px); bottom: auto; left: 12px; transform: none; width: calc(100vw - 80px); } .union-bar .btn.sm { padding: 8px 9px; } }
.lot-hero.union { grid-template-columns: 1fr; }
.lh-union { background: #5b21b6 !important; }
.union-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.union-list li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; }
.union-list li > div { flex: 1; min-width: 0; }
.union-list b { display: block; font-size: 13.5px; }
.union-list small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.ul-n { width: 24px; height: 24px; border-radius: 50%; background: #ede4ff; color: #5b21b6; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.union-help { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; background: #f5f0ff; border-radius: 12px; padding: 12px; color: #4c1d95; font-size: 13.5px; line-height: 1.45; }
.union-help svg { width: 26px; height: 26px; fill: #7c3aed; flex: none; }
.union-help p { margin: 0; }
.lote-card.union .lc-tit svg { width: 14px; height: 14px; fill: #7c3aed; vertical-align: -2px; }
.lote-card.union { border-color: #d8c8fb; }

/* Radar */
.fab-radar svg { fill: #ea580c; }
.fab-radar.on { background: #ea580c; }
.r-zonas { font-size: 13px; }
.r-zonas summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.r-zonas-list { display: flex; flex-wrap: wrap; gap: 5px; max-height: 150px; overflow: auto; padding: 4px 0; }
.f-chip.sm span { font-size: 11.5px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 4px; }
.f-chip.sm span i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.r-go { margin-top: 4px; background: #ea580c !important; }
.r-go[disabled] { opacity: .5; cursor: not-allowed; }
.r-go .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; display: inline-block; }
.r-hint { margin: 0; font-size: 11.5px; color: var(--ink-3); }
.r-sum { margin-top: 12px; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.r-sum b { font-size: 18px; color: #c2410c; }
.r-sum span { color: var(--ink-3); font-size: 12px; }
.r-sum .link-btn { margin-left: auto; font-size: 12px; }
.lote-card.radar { border-left: 3px solid #fb923c; }
.lc-zona { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.lc-zona i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.aprox { font-weight: 500; color: var(--ink-3); font-size: 11px; }
.r-cta { margin-top: 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #7c2d12; }
.r-cta .btn { margin-top: 6px; background: #fff; border: 1px solid #fdba74; color: #9a3412; }

/* Búsqueda personalizada */
.busq-dlg { width: min(520px, 96vw); }
.busq-dlg .dlg-head h3 { margin: 0; font-size: 16px; }
.busq-dlg .dlg-body { padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.bq-intro { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.bq-crit { display: flex; flex-wrap: wrap; gap: 6px; }
.bq-crit span { font-size: 12px; background: #fff7ed; color: #9a3412; padding: 3px 8px; border-radius: 999px; }
.bq-f { font-size: 11.5px; color: var(--ink-3); display: flex; flex-direction: column; gap: 3px; font-weight: 500; }
.bq-f textarea { resize: vertical; }
.dlg-foot { padding: 10px 18px 16px; }
.dlg-foot .btn { width: 100%; }
.lc-estado.bq-nueva { background: #e8effb; color: var(--accent); }
.lc-estado.bq-en_proceso { background: var(--warn-bg); color: var(--warn); }
.lc-estado.bq-ofrecido { background: var(--ok-bg); color: var(--ok); }
/* En escritorio, los paneles laterales no tapan los botones flotantes */
@media (min-width: 761px) { body:not(.admin) .layers-panel { right: 68px; } }

/* Lote en propiedad horizontal */
.ph-box { margin-top: 10px; background: #fff7e6; border: 1px solid #f5d38a; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: #6b4a00; line-height: 1.45; }
.ph-box b { display: block; font-size: 13.5px; color: #8a5a00; margin-bottom: 2px; }

/* Rótulos de zonas (capa vectorial) */
.zona-lbl { background: none; border: 0; }
.zona-lbl span {
  display: inline-block; transform: translate(-50%, -50%); white-space: nowrap;
  font: 700 13px/1 Inter, system-ui, sans-serif; color: #c0392b; letter-spacing: .02em;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff;
}

/* Lotes exclusivos (dorado) y destacados (plateado) */
.lote-card.star .lc-star { background: #eef1f5; color: #4b5567; }
.lote-card.star .lc-star svg { fill: #8792a6; }
.lote-card.oro { border-color: #f1cf6b; }
.lote-card .lc-star.oro { background: #fff4d6; color: #8a5a00; }
.lote-card .lc-star.oro svg { fill: #e0a100; }
.venta.oro .v-tag { background: #fff4d6; color: #8a5a00; }
.venta.oro .v-tag svg { fill: #e0a100; }
.venta.star:not(.oro) .v-tag { background: #eef1f5; color: #4b5567; }
.venta.star:not(.oro) .v-tag svg { fill: #8792a6; }

/* ---------- Asistente de lotes (IA) ---------- */
:root { --ia: #c2187a; --ia-2: #9d1464; --ia-soft: #fbeaf3; --ia-line: #f2c7de; }
/* botón del asistente: abajo a la izquierda, con anillos que laten */
.ia-fab {
  position: fixed; z-index: 1130; left: 20px; bottom: 40px; width: 62px; height: 62px; border-radius: 50%; border: 0;
  background: linear-gradient(140deg, #c2187a, #7a1d9c); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 22px rgba(122, 29, 156, .38), 0 2px 6px rgba(0,0,0,.18); transition: transform .15s ease, left .2s ease;
}
.ia-fab:hover { transform: scale(1.06); }
.ia-fab:focus-visible { outline: 3px solid #f2c7de; outline-offset: 3px; }
.ia-fab svg { width: 30px; height: 30px; fill: #fff; position: relative; z-index: 1; }
.ia-fab-badge {
  position: absolute; z-index: 2; top: -3px; right: -3px; background: #fff; color: #9d1464; font: 800 10.5px/1 Inter, system-ui, sans-serif;
  padding: 4px 5px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,.2); letter-spacing: .03em;
}
.ia-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(194, 24, 122, .55); animation: iaRing 2.4s ease-out infinite; pointer-events: none; }
.ia-ring.r2 { animation-delay: 1.2s; }
@keyframes iaRing { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.75); opacity: 0; } }
.ia-fab.on .ia-ring { animation: none; opacity: 0; }
.ia-fab.on { background: linear-gradient(140deg, #9d1464, #5b1475); }
@media (prefers-reduced-motion: reduce) { .ia-ring { animation: none; opacity: .5; transform: scale(1.15); } }
.ia-hint {
  position: fixed; z-index: 1129; left: 96px; bottom: 52px; display: flex; align-items: center; gap: 2px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 4px 4px 2px; animation: iaHintIn .35s ease;
}
.ia-hint::before { content: ''; position: absolute; left: -6px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left: 0; border-right-color: var(--surface); }
.ia-hint-txt { border: 0; background: none; font-size: 13.5px; color: var(--ink-2); padding: 6px 4px 6px 10px; white-space: nowrap; cursor: pointer; }
.ia-hint-txt b { color: var(--ia-2); }
.ia-hint-x { border: 0; background: none; color: var(--ink-3); font-size: 18px; width: 28px; height: 28px; border-radius: 8px; }
.ia-hint-x:hover { background: var(--surface-2); }
@keyframes iaHintIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
/* con la ficha abierta (escritorio) el botón y el chat se corren a la derecha del panel */
@media (min-width: 761px) {
  .panel:not([hidden]) ~ .ia-fab { left: calc(var(--panel-w) + 26px); }
  .panel:not([hidden]) ~ .ia-hint { left: calc(var(--panel-w) + 102px); }
}

.ia-panel {
  position: fixed; z-index: 1120; left: 20px; bottom: 116px; top: auto; height: min(680px, calc(100vh - var(--top) - 190px));
  width: 420px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.ia-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.ia-head-t { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ia-head h2 { font-size: 15.5px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia-spark { color: var(--ia); font-size: 17px; }
.ia-back { font-size: 26px; padding-bottom: 3px; }
.ia-hbtn { border: 0; background: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); }
.ia-hbtn svg { width: 20px; height: 20px; fill: currentColor; }
.ia-hbtn:hover { background: var(--surface-2); }
.ia-body { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; min-height: 0; }
.ia-view { padding: 14px 16px 16px; }
.ia-chatview { padding: 0; flex: 1; display: flex; min-height: 0; }
.ia-hola { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.ia-hola b { color: var(--ink); display: block; font-size: 16px; margin-bottom: 2px; }
.ia-lbl { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ia-2); margin-bottom: 6px; }
.ia-rapida-box { display: flex; align-items: flex-end; gap: 8px; border: 1.5px solid var(--ia-line); background: var(--ia-soft); border-radius: 14px; padding: 8px 8px 8px 12px; }
.ia-rapida-box:focus-within { border-color: var(--ia); box-shadow: 0 0 0 3px rgba(194,24,122,.12); }
.ia-rapida-box textarea, .ia-composer textarea {
  flex: 1; border: 0; background: transparent; resize: none; font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink); outline: none; min-height: 24px; padding: 4px 0;
}
.ia-go { border: 0; width: 38px; height: 38px; border-radius: 11px; background: var(--ia); display: grid; place-items: center; flex: 0 0 auto; }
.ia-go svg { width: 19px; height: 19px; fill: #fff; }
.ia-go:disabled { opacity: .45; }
.ia-ctx { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.ia-ctx b { color: var(--ink-2); font-weight: 600; }
.ia-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.ia-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 11px; font-size: 12.5px; text-align: left; }
.ia-chip:hover { border-color: var(--ia); color: var(--ia-2); }
.btn.ia-irchat { width: 100%; margin-top: 14px; background: var(--surface); color: var(--ia-2); border: 1.5px solid var(--ia); }
.btn.ia-irchat:hover { background: var(--ia-soft); }
.ia-h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 20px 0 6px; font-weight: 600; }
.ia-histlist { list-style: none; margin: 0; padding: 0; }
.ia-hist { position: relative; padding: 10px 40px 10px 12px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; }
.ia-hist:hover { background: var(--surface-2); border-color: var(--line); }
.ia-hist-t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ia-hist-m { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ia-del { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--ink-3); font-size: 20px; padding: 4px 8px; border-radius: 8px; }
.ia-del:hover { background: var(--bad-bg); color: var(--bad); }
.ia-del.confirm { font-size: 12px; font-weight: 600; color: var(--bad); background: var(--bad-bg); }
.ia-empty { color: var(--ink-3); font-size: 13px; padding: 8px 2px; list-style: none; }

.ia-msgs { flex: 1; overflow: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
.ia-msg { display: flex; gap: 8px; max-width: 100%; }
.ia-msg.yo { justify-content: flex-end; }
.ia-msg.yo .ia-bub { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; padding: 9px 13px; font-size: 14.5px; line-height: 1.45; max-width: 85%; overflow-wrap: anywhere; }
.ia-av { flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--ia-soft); color: var(--ia); display: grid; place-items: center; font-size: 14px; margin-top: 2px; }
.ia-cont { flex: 1; min-width: 0; }
.ia-txt { font-size: 14.5px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.ia-txt p { margin: 0 0 8px; }
.ia-txt p:last-child { margin-bottom: 0; }
.ia-txt ul, .ia-txt ol { margin: 4px 0 8px; padding-left: 20px; }
.ia-txt li { margin: 3px 0; }
.ia-msg.err .ia-txt { color: var(--bad); }
.ia-q { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14.5px; margin-bottom: 14px; overflow-wrap: anywhere; }
.ia-wait .ia-cont { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13.5px; padding-top: 4px; }
.ia-dots { display: inline-flex; gap: 4px; }
.ia-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ia); opacity: .3; animation: iaDot 1.2s infinite; }
.ia-dots i:nth-child(2) { animation-delay: .2s; }
.ia-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes iaDot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .ia-dots i { animation: none; opacity: .7; } }

.ia-recos { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ia-reco { display: flex; gap: 10px; border: 1px solid var(--ia-line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; }
.ia-reco:hover { border-color: var(--ia); background: var(--ia-soft); }
.ia-n { flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--ia); color: #fff; font-weight: 700; font-size: 12.5px; display: grid; place-items: center; margin-top: 1px; }
.ia-reco-b { flex: 1; min-width: 0; }
.ia-reco-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ia-reco-top b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ia-reco-p { font-weight: 700; font-size: 13.5px; color: var(--ok); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ia-reco-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.ia-reco-why { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.ia-reco-acc { display: flex; gap: 14px; margin-top: 6px; }
.ia-reco-acc .link-btn { font-size: 12.5px; color: var(--ia-2); }
.ia-reco-acc .link-btn.muted { color: var(--ink-3); }
.ia-mapall { margin-top: 8px; border: 0; background: none; color: var(--ia-2); font-weight: 600; font-size: 13px; padding: 4px 0; display: inline-flex; align-items: center; gap: 6px; }
.ia-mapall::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--ia); opacity: .7; }
.ia-roman { margin-top: 12px; border-radius: 12px; background: var(--ok-bg); padding: 12px; display: grid; gap: 10px; }
.ia-roman b { display: block; font-size: 14px; }
.ia-roman span { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.ia-roman .btn { width: 100%; }
.ia-roman .btn svg { width: 18px; height: 18px; fill: #fff; }
.ia-bienvenida { margin: auto 0; padding: 10px 4px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.ia-bienvenida b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.ia-rap-acc { display: grid; gap: 10px; justify-items: center; margin-top: 6px; }
.ia-composer { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.ia-composer textarea { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 11px; background: var(--surface-2); max-height: 140px; }
.ia-composer textarea:focus { border-color: var(--ia); background: #fff; }
.ia-legal { flex: 0 0 auto; margin: 0; padding: 0 14px 10px; font-size: 11px; color: var(--ink-3); line-height: 1.35; }
.ia-composer:not([hidden]) + .ia-legal { padding-top: 0; }

.btn.ia-ask { grid-column: 1 / -1; background: var(--ia-soft); color: var(--ia-2); border: 1px solid var(--ia-line); }
.btn.ia-ask span { font-size: 15px; }

/* pines numerados de lotes recomendados */
.ia-pin span {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ia); color: #fff;
  font: 700 13px Inter, system-ui, sans-serif; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(120, 10, 70, .45);
}
.ia-mapbar {
  position: fixed; z-index: 940; left: 50%; transform: translateX(-50%); bottom: 22px;
  display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow);
  padding: 6px 6px 6px 14px; font-size: 13px; max-width: calc(100vw - 32px);
}
.ia-mapbar .ia-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ia); flex: 0 0 auto; }
.ia-mapbar #iaMapTxt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ia-mapbar .link-btn { color: var(--ia-2); white-space: nowrap; font-size: 13px; }
.ia-mapbar .icon-btn { width: 30px; height: 30px; font-size: 19px; border-radius: 50%; }

@media (min-width: 761px) {
  .panel:not([hidden]) ~ .ia-panel { left: calc(var(--panel-w) + 26px); }
  .ia-panel:not([hidden]) ~ .ia-hint { display: none; }
}
@media (max-width: 760px) {
  .ia-panel {
    left: 0; right: 0; width: auto; top: auto; bottom: 0; height: min(82vh, calc(100vh - var(--top) - 50px));
    border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); transition: height .22s ease;
  }
  .ia-panel.mini { height: calc(58px + env(safe-area-inset-bottom)); }
  .ia-panel.mini .ia-body, .ia-panel.mini .ia-composer, .ia-panel.mini .ia-legal, .ia-panel.mini .ia-hbtn, .ia-panel.mini .ia-back { display: none !important; }
  .ia-panel.mini .ia-head { border-bottom: 0; cursor: pointer; }
  .ia-panel.mini .ia-head-t::after { content: 'Tocá para abrir'; font-size: 12px; color: var(--ink-3); margin-left: auto; white-space: nowrap; }
  .ia-mapbar { top: calc(var(--top) + 58px); bottom: auto; left: 12px; right: 68px; transform: none; max-width: none; }
  .ia-panel:not([hidden]) ~ .ia-mapbar { display: none; }
  .ia-fab { left: 14px; bottom: calc(22px + env(safe-area-inset-bottom)); width: 58px; height: 58px; }
  .ia-hint { left: 84px; bottom: calc(31px + env(safe-area-inset-bottom)); }
  .ia-hint-txt { font-size: 13px; }
  .panel:not([hidden]) ~ .ia-fab, .panel:not([hidden]) ~ .ia-hint,
  .ia-panel:not([hidden]) ~ .ia-fab, .ia-panel:not([hidden]) ~ .ia-hint { display: none; }
  .ia-msg.yo .ia-bub { max-width: 90%; }
}
.ia-panel:not([hidden]):not(.mini) ~ .ia-mapbar { display: none; }

/* ---------- Tickets: propuestas de cambios y Mis pedidos ---------- */
:root { --tk: #0f766e; --tk-soft: #e6f5f3; }
.btn.tk-prop { grid-column: 1 / -1; color: var(--tk); border-color: #b9e1dc; background: #fff; }
.btn.tk-prop svg { width: 17px; height: 17px; fill: var(--tk); }
.btn.tk-prop:hover { background: var(--tk-soft); }
.tk-dlg { width: min(520px, 96vw); }
.tk-dlg .dlg-head { justify-content: flex-start; }
.tk-dlg .dlg-head h3 { flex: 1; margin: 0; font-size: 16px; }
.tk-back { font-size: 26px; padding-bottom: 3px; }
.tk-body { padding: 14px 18px 6px; display: flex; flex-direction: column; gap: 10px; }
.tk-lugar { margin: 0; font-size: 14px; color: var(--ink-2); }
.tk-lugar b { color: var(--ink); }
.tk-intro, .tk-hoy { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.tk-ops { display: grid; gap: 8px; margin-top: 2px; }
.tk-op { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 12px; cursor: pointer; }
.tk-op:hover { border-color: var(--tk); background: var(--tk-soft); }
.tk-op:focus-visible { outline: 2px solid var(--tk); outline-offset: 2px; }
.tk-op b { display: block; font-size: 14.5px; color: var(--ink); }
.tk-op small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; line-height: 1.35; }
.tk-ic { flex: 0 0 36px; height: 36px; border-radius: 10px; background: var(--tk-soft); color: var(--tk); display: grid; place-items: center; font-size: 17px; font-weight: 700; }
.tk-op.tk-comentario .tk-ic { background: #fff4d6; color: #8a5a00; }
.tk-precio { grid-template-columns: 1fr 110px; }
.tk-parts { border: 1px dashed #9fd3cc; border-radius: 12px; padding: 10px 12px; background: #f6fbfa; }
.tk-parts-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.tk-parts-h .link-btn { color: var(--tk); font-size: 13px; }
.tk-parts ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.tk-parts li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.tk-parts li > span { flex: 0 0 20px; height: 20px; border-radius: 50%; background: var(--tk); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.tk-parts li .qrm { margin-left: auto; }
.tk-punto { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px dashed #9fd3cc; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; background: #f6fbfa; }
.tk-punto .btn { grid-column: auto; padding: 8px 12px; font-size: 13px; }
.tk-radios { display: grid; gap: 6px; }
.tk-radio { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; cursor: pointer; font-size: 14px; }
.tk-radio:has(input:checked) { border-color: var(--tk); background: var(--tk-soft); }
.tk-radio input { accent-color: var(--tk); width: 17px; height: 17px; margin: 0; }
.tk-dlg .dlg-foot .g-msg { margin: 0 0 8px; }
.tk-dlg .btn.primary { background: var(--tk); }
.tk-ok { text-align: center; padding: 18px 6px 12px; display: grid; gap: 8px; justify-items: center; }
.tk-ok-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--tk-soft); color: var(--tk); font-size: 26px; display: grid; place-items: center; }
.tk-ok b { font-size: 16px; }
.tk-ok p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; max-width: 36ch; }
.tk-bar { background: #134e4a; }
.tk-bar .btn.sm { background: #14b8a6; }
body.tk-picking .leaflet-container { cursor: crosshair; }
/* Mis pedidos */
.tk-panel .lp-head { gap: 4px; }
.tk-panel .lp-head h2 { flex: 1; }
.btn.tk-nueva { width: 100%; background: var(--tk); }
.tk-card.unread { border-color: var(--tk); box-shadow: 0 0 0 1px var(--tk) inset; }
.tk-card .lc-tit { font-size: 13.5px; }
.tk-nuevo { color: var(--tk); font-weight: 700; }
.tk-ult { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lc-estado.tk-e-nuevo { background: #e8effb; color: var(--accent); }
.lc-estado.tk-e-en_revision { background: var(--warn-bg); color: var(--warn); }
.lc-estado.tk-e-esperando_cliente { background: var(--tk-soft); color: var(--tk); }
.lc-estado.tk-e-resuelto { background: var(--ok-bg); color: var(--ok); }
.lc-estado.tk-e-rechazado { background: var(--bad-bg); color: var(--bad); }
.tk-det-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.tk-cat { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }
.tk-tabla { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
.tk-tabla th, .tk-tabla td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tk-tabla thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.tk-tabla tbody th { color: var(--ink-2); font-weight: 500; width: 28%; }
.tk-tabla td b { color: var(--tk); }
.tk-res { margin-top: 12px; border-radius: 10px; padding: 9px 11px; font-size: 13.5px; font-weight: 600; background: var(--ok-bg); color: var(--ok); }
.tk-res.tk-res-rechazado { background: var(--bad-bg); color: var(--bad); }
.tk-res.tk-res-archivado { background: var(--muted-bg); color: var(--ink-2); }
#tkpMapa { margin-top: 10px; font-size: 13px; }
.tk-hilo { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.tk-m { border-radius: 12px; padding: 8px 11px; max-width: 92%; }
.tk-m small { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.tk-m p { margin: 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.tk-m.yo { align-self: flex-end; background: #eef3fb; }
.tk-m.admin { align-self: flex-start; background: var(--tk-soft); }
.tk-resp { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; align-items: end; }
.tk-resp .btn { grid-column: auto; background: var(--tk); padding: 10px 14px; }
.tk-idea { display: grid; gap: 10px; }
.um-n { background: var(--tk); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 4px; }
.user-btn.tk-dot { position: relative; }
.user-btn.tk-dot::after { content: ''; position: absolute; top: 4px; right: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--tk); border: 2px solid #fff; }
.tk-vacio { margin: 0; font-size: 13px; color: var(--ink-3); }
