:root {
  --red: #e8121c;
  --red-2: #ff3b3b;
  --red-soft: #fff1f1;
  --ink: #0a0a0b;
  --ink-2: #45464b;
  --ink-3: #85868e;
  --line: #ececef;
  --line-2: #f5f5f7;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --surface-3: #fcfcfd;
  --glass: rgba(255,255,255,.78);
  --grid-line: rgba(10,10,11,.038);
  --green: #12b76a;
  --amber: #f5a524;
  --busy: #d92d20;
  --bg-green: #e9f9f1; --fg-green: #067647;
  --bg-amber: #fff5e5; --fg-amber: #b54708;
  --bg-red: #fdeceb;   --fg-red: #b42318;
  --map-filter: grayscale(1) brightness(1.07) contrast(.88) opacity(.92);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(10,10,11,.05), 0 1px 1px rgba(10,10,11,.03);
  --shadow: 0 4px 18px -6px rgba(10,10,11,.10), 0 1px 3px rgba(10,10,11,.04);
  --shadow-lg: 0 32px 64px -24px rgba(10,10,11,.22), 0 2px 8px rgba(10,10,11,.05);
  --head: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar-h: 68px;
  --ledbar-h: 40px;
  /* Cintillo + barra: ambos quedan fijos arriba, uno debajo del otro. */
  --chrome-h: calc(var(--ledbar-h) + var(--topbar-h));
  color-scheme: light;
}

[data-theme="dark"] {
  --red-soft: #2b1013;
  --ink: #f4f4f6;
  --ink-2: #b6b7bf;
  --ink-3: #83848d;
  --line: #27272d;
  --line-2: #1e1e23;
  --bg: #0a0a0c;
  --surface: #131317;
  --surface-2: #17171c;
  --surface-3: #141419;
  --glass: rgba(10,10,12,.76);
  --grid-line: rgba(255,255,255,.045);
  --bg-green: #0d2a1d; --fg-green: #4ade80;
  --bg-amber: #2e2008; --fg-amber: #fbbf4c;
  --bg-red: #2e1211;   --fg-red: #fb7c72;
  --map-filter: grayscale(1) invert(1) brightness(.94) contrast(.92);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow: 0 4px 18px -6px rgba(0,0,0,.6), 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 32px 64px -24px rgba(0,0,0,.8), 0 2px 8px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.55;
  transition: background .2s, color .2s;
}
h1, h2, h3, h4 { font-family: var(--head); font-weight: 900; letter-spacing: -.022em; margin: 0; line-height: 1.1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--red); color: #fff; }

.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 110% 70% at 50% 0%, #000 20%, transparent 78%);
}
.bg-glow {
  position: fixed; z-index: -1; pointer-events: none;
  top: -320px; left: 50%; translate: -50% 0;
  width: 1100px; height: 620px;
  background: radial-gradient(closest-side, rgba(232,18,28,.10), transparent 72%);
  filter: blur(12px);
}

/* ---------- cintillo LED ---------- */
.ledbar {
  position: sticky; top: 0; z-index: 720;
  display: flex; align-items: stretch;
  height: var(--ledbar-h);
  background: #08080a;
  border-bottom: 1px solid #1c1c22;
  overflow: hidden;
}
.ledbar::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(0,0,0,.55) 34%, transparent 36%);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}
.ledbar-viewport { flex: 1 1 auto; overflow: hidden; position: relative; display: flex; align-items: center; }
/* El contenido se duplica y se desplaza -50%: el margen (no gap) mantiene el bucle exacto. */
.ledbar-track {
  display: flex; align-items: center; white-space: nowrap;
  animation: ledroll 46s linear infinite;
  will-change: transform;
}
.ledbar:hover .ledbar-track { animation-play-state: paused; }
@keyframes ledroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ledbar-item {
  display: inline-flex; align-items: center; gap: 12px; margin-right: 64px;
  font-family: var(--head); font-weight: 700; font-size: 12.5px;
  letter-spacing: .1em; text-transform: uppercase;
  color: #ff3b3b; text-shadow: 0 0 9px rgba(255,59,59,.55);
}
.ledbar-item::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #ff3b3b; box-shadow: 0 0 7px rgba(255,59,59,.9); flex: none;
}
.ledbar-item.is-slot { color: #ffd24a; text-shadow: 0 0 9px rgba(255,210,74,.5); }
.ledbar-item.is-slot::before { background: #ffd24a; box-shadow: 0 0 7px rgba(255,210,74,.9); }

.ledbar-status {
  position: relative; z-index: 2; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(12px, 2.4vw, 22px);
  background: linear-gradient(90deg, transparent, #08080a 22%);
  font-size: 12px; color: #cfd0d6; white-space: nowrap;
}
.ledbar-status .st { display: inline-flex; align-items: center; gap: 6px; }
.ledbar-status .st svg { width: 14px; height: 14px; color: #85868e; }
.ledbar-status b { font-family: var(--head); font-weight: 600; color: #fff; letter-spacing: -.01em; }
.ledbar-status .sep { width: 1px; height: 15px; background: #26262d; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: var(--ledbar-h); z-index: 700;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 clamp(16px, 3vw, 40px);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-text { display: grid; line-height: 1; }
.brand-word { font-family: var(--head); font-weight: 700; font-size: 17px; letter-spacing: -.03em; }
.brand-word em { font-style: normal; color: var(--red); margin-left: 5px; }
.brand-sub { font-size: 9px; letter-spacing: .34em; color: var(--ink-3); font-weight: 600; margin-top: 3px; }

.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--ink-2); transition: background .16s, color .16s;
}
.topnav a:hover { background: var(--line-2); color: var(--ink); }
.topnav a.is-on { background: var(--ink); color: var(--bg); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; flex: none; transition: color .16s, border-color .16s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-btn .ico-sun { display: block; }
[data-theme="dark"] .icon-btn .ico-moon { display: none; }
.icon-btn .ico-sun { display: none; }

.usermenu { position: relative; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--ink); color: var(--bg); font-family: var(--head); font-weight: 700;
  font-size: 13px; cursor: pointer; display: grid; place-items: center;
}
.usermenu-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 268px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 800;
}
.usermenu-head { padding: 12px 12px 14px; border-bottom: 1px solid var(--line-2); display: grid; gap: 3px; margin-bottom: 6px; }
.usermenu-head strong { font-size: 14px; }
.usermenu-head span { font-size: 12.5px; color: var(--ink-3); }
.role-chip {
  justify-self: start; margin-top: 6px; padding: 3px 9px; border-radius: 999px;
  background: var(--line-2); font-size: 10.5px !important; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2) !important;
}
.role-chip.is-admin { background: var(--red-soft); color: var(--red) !important; }
.usermenu-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0;
  background: none; border-radius: var(--r-sm); cursor: pointer; font-size: 14px;
}
.usermenu-item:hover { background: var(--line-2); }
.usermenu-item.danger { color: var(--busy); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .12s, background .16s, border-color .16s, box-shadow .16s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover:not(:disabled) { opacity: .86; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: #c9101a; }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { border-color: var(--line); color: var(--busy); background: var(--surface); }
.btn-danger:hover:not(:disabled) { border-color: var(--busy); }

/* ---------- layout ---------- */
.view { padding: 0 clamp(16px, 3vw, 40px) 80px; max-width: 1560px; margin: 0 auto; }
.hero { padding: clamp(44px, 7vw, 86px) 0 34px; max-width: 780px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 0 20px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 11px;
  background: var(--surface);
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(18,183,106,.16); }
.hero h1 { font-size: clamp(38px, 6.2vw, 68px); font-weight: 700; }
.hero h1 .accent { color: var(--red); }
.lede { color: var(--ink-2); font-size: clamp(15px, 1.5vw, 17px); max-width: 60ch; margin: 18px 0 0; }
.page-head { padding: clamp(36px, 5vw, 60px) 0 26px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.kpi {
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px 20px;
  background: var(--surface); box-shadow: var(--shadow-sm); min-width: 132px;
}
.kpi b { display: block; font-family: var(--head); font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.kpi span { font-size: 12.5px; color: var(--ink-3); }
.kpi.green b { color: var(--green); }
.kpi.amber b { color: var(--amber); }
.kpi.red b { color: var(--busy); }

.workbar { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; flex-wrap: wrap; }
.workbar-info { font-size: 13px; color: var(--ink-3); }
.workbar .btn:last-child { margin-left: auto; }
.pill { background: var(--ink); color: var(--bg); border-radius: 999px; font-size: 10.5px; font-weight: 600; padding: 1px 7px; margin-left: 2px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; align-items: start; }
body.filters-open .workspace { grid-template-columns: 264px minmax(0, 1fr) 372px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
/* minmax(0,1fr) evita que un campo ancho estire la columna más allá del panel. */
.filters { display: none; grid-template-columns: minmax(0, 1fr); padding: 18px; position: sticky; top: calc(var(--chrome-h) + 14px); gap: 18px; }
body.filters-open .filters { display: grid; }
.filters-backdrop { display: none; position: fixed; inset: 0; background: rgba(10,10,11,.42); z-index: 940; }
/* Cabecera y botón de aplicar: solo tienen sentido cuando los filtros son hoja inferior. */
.filters-head, .filters-foot { display: none; }
.results { position: sticky; top: calc(var(--chrome-h) + 14px); display: flex; flex-direction: column; max-height: calc(100vh - var(--chrome-h) - 28px); }

.field { display: grid; gap: 8px; }
.field-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.search-field { position: relative; }
.search-field .ico { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; color: var(--ink-3); }
input[type="search"], input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); font-size: 14px; outline: none;
  transition: border-color .16s, box-shadow .16s;
}
/* Va después de la regla genérica a propósito: aquella usa el atajo `padding`,
   que reinicia este hueco y dejaba el texto debajo de la lupa. */
.search-field input { padding-left: 37px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(128,128,140,.18); }
textarea { resize: vertical; min-height: 84px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2385868e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 32px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  font-size: 13px; color: var(--ink-3); cursor: pointer; transition: all .16s;
}
.chip:hover { border-color: var(--ink-3); }
.chip.is-on { border-color: var(--ink); color: var(--ink); font-weight: 500; }
.sw { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.sw-green { background: var(--green); }
.sw-amber { background: var(--amber); }
.sw-red { background: var(--busy); }

/* ---------- map ---------- */
.map-panel { position: relative; overflow: hidden; }
#map { height: calc(100vh - var(--chrome-h) - 28px); min-height: 520px; border-radius: var(--r-lg); background: var(--surface-2); z-index: 1; }
.map-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 500;
  display: flex; gap: 14px; padding: 9px 14px; font-size: 12px; color: var(--ink-2);
  background: var(--glass); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-pulse i {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); flex: none;
}
.legend-pulse i::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--red); animation: latido 2.2s cubic-bezier(.2,.7,.4,1) infinite;
}
.map-hint {
  position: absolute; left: 50%; top: 14px; translate: -50% 0; z-index: 500;
  padding: 9px 18px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 13px; box-shadow: var(--shadow);
}
.leaflet-container { font: inherit; background: var(--surface); }
.leaflet-tile-pane { filter: var(--map-filter); }
.leaflet-control-attribution { font-size: 10px; background: var(--glass) !important; color: var(--ink-3); }
.leaflet-control-attribution a { color: var(--ink-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--surface-2); color: var(--ink); }

.pin { position: relative; width: 18px; height: 18px; }
.pin i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid var(--surface);
  box-shadow: 0 2px 6px rgba(10,10,11,.30);
  transition: transform .16s;
}
.pin.is-green i { background: var(--green); }
.pin.is-amber i { background: var(--amber); }
.pin.is-red i { background: var(--busy); }
.pin.is-led i { border-radius: 5px; }

/* Latido de los puntos premium: un halo que se expande y se apaga. */
.pin.is-featured::before,
.pin.is-featured::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--red); pointer-events: none;
  animation: latido 2.2s cubic-bezier(.2,.7,.4,1) infinite;
}
.pin.is-featured.is-led::before,
.pin.is-featured.is-led::after { border-radius: 7px; }
.pin.is-featured::after { animation-delay: 1.1s; }
@keyframes latido {
  0%   { transform: scale(.85); opacity: .9; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
.pin.is-featured i { box-shadow: 0 0 0 2px rgba(232,18,28,.55), 0 2px 6px rgba(10,10,11,.35); }
.leaflet-marker-icon:hover .pin i, .pin.is-active i { transform: scale(1.22); }
.pin.is-active i { box-shadow: 0 0 0 5px rgba(128,128,140,.22), 0 3px 8px rgba(10,10,11,.3); }

/* ---------- results ---------- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 18px 12px; border-bottom: 1px solid var(--line-2); }
.results-head h2 { font-size: 16px; font-weight: 600; }
.count { font-size: 12.5px; color: var(--ink-3); }
.result-list { overflow-y: auto; padding: 8px; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); align-content: start; }
.result-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center;
  padding: 12px 13px; border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; text-align: left; background: none; width: 100%;
  transition: background .14s, border-color .14s;
}
.result-item:hover, .result-item.is-active { background: var(--surface-2); border-color: var(--line); }
.result-item .ri-top { grid-column: 1; grid-row: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.result-item .ri-code { font-family: var(--head); font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; flex: none; }
.result-item .ri-name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item .ri-meta { grid-column: 1; grid-row: 2; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 9px; min-width: 0; }
.result-item .ri-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item .ri-price { grid-column: 2; grid-row: 1 / span 2; justify-self: end; font-family: var(--head); font-weight: 600; font-size: 14px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.b-green { background: var(--bg-green); color: var(--fg-green); }
.badge.b-amber { background: var(--bg-amber); color: var(--fg-amber); }
.badge.b-red { background: var(--bg-red); color: var(--fg-red); }
.badge.b-neutral { background: var(--line-2); color: var(--ink-2); }
.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------- notificaciones ---------- */
.notif { position: relative; }
.notif-dot {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.notif-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(380px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); z-index: 810; overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.notif-head strong { font-size: 14px; }
.notif-list { max-height: min(440px, 62vh); overflow-y: auto; }
.notif-item {
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 2px 11px;
  width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 13px 16px; border-bottom: 1px solid var(--line-2);
}
.notif-item:hover { background: var(--surface-2); }
.notif-item:last-child { border-bottom: 0; }
.notif-ico { grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.notif-ico svg { width: 16px; height: 16px; }
.notif-ico.is-lead { background: var(--bg-green); color: var(--fg-green); }
.notif-ico.is-ticket { background: var(--bg-amber); color: var(--fg-amber); }
.notif-ico.is-contract { background: var(--bg-red); color: var(--fg-red); }
.notif-ico.is-review { background: var(--red-soft); color: var(--red); }
.notif-item .n-title { font-size: 13.5px; font-weight: 600; }
.notif-item .n-body { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item.is-unread .n-title::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); margin-left: 7px; vertical-align: middle;
}
.notif-empty { padding: 34px 20px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

/* ---------- tablero arrastrable ---------- */
.board { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; align-items: start; }
.board-card {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); padding: 18px 20px 20px; position: relative;
  transition: box-shadow .18s, border-color .18s;
}
.board-card.is-wide { grid-column: span 2; }
.board.is-sorting { cursor: grabbing; user-select: none; }
.board-card.is-dragging {
  z-index: 20; transition: none; box-shadow: var(--shadow-lg);
  border-color: var(--red); cursor: grabbing;
}
.board-grip { touch-action: none; padding: 4px; margin: -4px -4px -4px auto; }
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.board-head h3 { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.board-grip { margin-left: auto; color: var(--line); cursor: grab; display: grid; place-items: center; }
.board-grip:active { cursor: grabbing; }
.board-grip svg { width: 16px; height: 16px; }
.board-card:hover .board-grip { color: var(--ink-3); }
.board-metric { font-family: var(--head); font-weight: 900; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.03em; line-height: 1.05; }
.board-sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.board-list { display: grid; gap: 9px; margin-top: 2px; }
.board-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.board-row .r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .r-value { color: var(--ink-3); white-space: nowrap; font-size: 12.5px; }
.bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--ink); }
.bar.b-green > i { background: var(--green); }
.bar.b-amber > i { background: var(--amber); }
.bar.b-red > i { background: var(--busy); }
.bar.b-brand > i { background: var(--red); }

/* ---------- tarifas por spot y paquetes ---------- */
.badge.b-verified { background: var(--bg-green); color: var(--fg-green); }
.rate-note { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-3); }
.rate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rate {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 14px;
  background: var(--surface-2);
}
.rate span { font-size: 13px; color: var(--ink-3); }
.rate b { font-family: var(--head); font-weight: 900; font-size: 18px; letter-spacing: -.02em; }

.pack {
  display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: clamp(20px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 30px);
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
  background: radial-gradient(circle at 92% 8%, rgba(232,18,28,.12), transparent 58%), var(--surface);
}
.pack-main h2 { font-size: clamp(21px, 2.6vw, 27px); font-weight: 900; margin: 12px 0 10px; }
.pack-main p { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 62ch; }
.pack-screens { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.pack-chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 6px 13px; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-chip:hover { border-color: var(--ink); color: var(--ink); }
.pack-rates { display: grid; gap: 8px; align-content: start; }
.pack-rates .btn { margin-top: 8px; }

/* ---------- barra de compra (inventario) ---------- */
.shopbar {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); padding: 18px 20px; margin-bottom: 16px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px;
}
.shop-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; min-width: 0; }
.shop-row > * { min-width: 0; }
.shop-row-controls { gap: 12px; padding-top: 16px; border-top: 1px solid var(--line-2); align-items: center; }
.shop-group { display: grid; gap: 8px; }
.shop-search { flex: 1 1 240px; min-width: 200px; }
.shop-row-controls select { width: auto; min-width: 168px; }
.shop-row-controls .btn { margin-left: auto; }
.price-range { display: flex; align-items: center; gap: 8px; }
.price-range .field-label { white-space: nowrap; }
.price-range input { width: 92px; }
.price-range .dash { color: var(--ink-3); }
.shop-count { margin: 0; font-size: 13px; color: var(--ink-3); }

.tier-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; display: inline-block; rotate: 45deg; }
.t-premium { background: linear-gradient(135deg, var(--red), #ff7a45); }
.t-alto { background: var(--amber); }
.t-estandar { background: var(--ink-3); }

.badge.b-premium { background: var(--red-soft); color: var(--red); }
.badge.b-alto { background: var(--bg-amber); color: var(--fg-amber); }
.badge.b-estandar { background: var(--line-2); color: var(--ink-2); }
.card-media .badge.tier-badge { left: auto; right: 10px; }

/* ---------- cards ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.card {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden;
  cursor: pointer; text-align: left; padding: 0; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink-3); }
.card-media { aspect-ratio: 16 / 10; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; position: relative; }
.card-media .ph { width: 40px; color: var(--line); }
.card-media .badge { position: absolute; top: 10px; left: 10px; }
.card-body { padding: 14px 16px 16px; display: grid; gap: 7px; }
.card-body .c-code { font-family: var(--head); font-size: 11px; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.card-body h3 { font-size: 15.5px; font-weight: 600; }
.card-body .c-sector { font-size: 13px; color: var(--ink-3); }
.card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid var(--line-2); }
.card-foot .price { font-family: var(--head); font-weight: 600; }

/* ---------- stars ---------- */
.stars { display: inline-flex; gap: 2px; align-items: center; flex: none; }
.stars svg { width: 15px; height: 15px; flex: none; }
.stars .on { fill: var(--amber); }
.stars .off { fill: var(--line); }
.stars-input button { background: none; border: 0; padding: 1px; cursor: pointer; line-height: 0; }
.stars-input svg { width: 26px; height: 26px; transition: transform .12s; }
.stars-input button:hover svg { transform: scale(1.14); }
.rating-note { font-size: 12.5px; color: var(--ink-3); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,10,11,.42); z-index: 900; backdrop-filter: blur(2px); animation: fade .2s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  background: var(--surface); z-index: 950; box-shadow: var(--shadow-lg);
  overflow-y: auto; animation: slideIn .26s cubic-bezier(.22,.9,.32,1);
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.drawer-close, .modal-close {
  position: absolute; top: 14px; right: 16px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); font-size: 21px; line-height: 1; cursor: pointer; color: var(--ink-2);
}
.drawer-close:hover, .modal-close:hover { background: var(--line-2); }
.drawer-body { padding: 0 0 40px; }
.d-hero { padding: 30px 30px 22px; border-bottom: 1px solid var(--line-2); }
.d-hero .d-code { font-family: var(--head); font-size: 11.5px; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.d-hero h2 { font-size: 27px; font-weight: 700; margin: 6px 0 10px; }
.d-hero .d-addr { color: var(--ink-2); font-size: 14px; }
.d-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.d-section { padding: 24px 30px; border-bottom: 1px solid var(--line-2); }
.d-section h3 { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.spec { display: grid; gap: 2px; }
.spec dt { font-size: 12px; color: var(--ink-3); }
.spec dd { margin: 0; font-weight: 500; font-size: 14.5px; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-row b { font-family: var(--head); font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.price-row span { color: var(--ink-3); font-size: 13px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shot { position: relative; margin: 0; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.shot.is-cover { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.shot img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.shot-flag {
  position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.shot-tools {
  position: absolute; inset: auto 0 0 0; display: flex; gap: 6px; padding: 7px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  opacity: 0; transition: opacity .16s;
}
.shot:hover .shot-tools, .shot:focus-within .shot-tools { opacity: 1; }
.shot-tools button {
  flex: 1; border: 0; border-radius: 6px; padding: 4px 6px; cursor: pointer;
  background: rgba(255,255,255,.92); color: #0a0a0b; font-size: 11px; font-weight: 600;
}
.shot-tools button:hover { background: #fff; }
.gallery .add-photo {
  aspect-ratio: 1; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2);
  display: grid; place-items: center; gap: 4px; cursor: pointer; color: var(--ink-3); font-size: 12px;
}
.gallery .add-photo:hover { border-color: var(--ink-3); color: var(--ink-2); }
.comment { display: grid; gap: 5px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.comment:last-child { border-bottom: 0; }
.comment-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.comment-head strong { font-size: 14px; }
.comment-head .who { font-size: 12.5px; color: var(--ink-3); }
.comment p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.comment-actions { display: flex; gap: 12px; margin-top: 2px; }
.comment-replies { display: grid; gap: 8px; margin: 12px 0 2px 16px; padding-left: 14px; border-left: 2px solid var(--line); }
.comment.reply { padding: 11px 13px; border-bottom: 0; border-radius: var(--r-sm); background: var(--surface-2); }
.comment.reply.is-staff { background: var(--red-soft); }
.comment.reply p { font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0; font-size: 12.5px; color: var(--ink-3); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--busy); }
.composer { display: grid; gap: 10px; margin-top: 12px; }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.locked-note { padding: 16px; border: 1px dashed var(--line); border-radius: var(--r); text-align: center; color: var(--ink-3); font-size: 13.5px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,10,11,.5); z-index: 1000; display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); animation: fade .2s; }
.modal {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 34px;
  animation: pop .24s cubic-bezier(.2,.9,.3,1);
}
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: scale(.97) translateY(8px); opacity: 0; } }
.modal h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.modal .sub { color: var(--ink-3); font-size: 14px; margin: 0 0 22px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.clave-fila { display: flex; gap: 8px; align-items: center; }
.clave-fila input { flex: 1; min-width: 0; }
.clave-fila .icon-action.is-on { color: var(--red); border-color: var(--red); }

.spot-fields { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px 14px; margin: 0; }
.spot-fields legend { padding: 0 6px; }
.spot-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.spot-row label { display: grid; gap: 5px; }
.spot-row span { font-size: 12px; color: var(--ink-3); }
@media (max-width: 860px) { .spot-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-error { color: var(--busy); font-size: 13.5px; min-height: 20px; }
.account-rows { display: grid; gap: 2px; margin-bottom: 22px; }
.account-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.account-rows > div:last-child { border-bottom: 0; }
.account-rows span { color: var(--ink-3); font-size: 13.5px; }
.account-rows strong { font-weight: 500; font-size: 14.5px; }
.stack-actions { display: grid; gap: 9px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }
.auth-switch button { background: none; border: 0; color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: underline; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab { padding: 11px 16px; border: 0; background: none; cursor: pointer; font-size: 14.5px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.is-on { color: var(--ink); border-bottom-color: var(--red); font-weight: 500; }
.pane-head { display: flex; gap: 12px; margin-bottom: 16px; }
.pane-head input { max-width: 320px; }
.pane-head .btn { margin-left: auto; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; background: var(--surface); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 16px; font-size: 11px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
  border-bottom: 1px solid var(--line); background: var(--surface-3); position: sticky; top: 0; white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Tabla que cabe en pantalla: anchos fijos y texto truncado en vez de scroll lateral. */
.table-fit { table-layout: fixed; }
.table-fit td, .table-fit th { padding: 10px 12px; overflow: hidden; text-overflow: ellipsis; }
.table-fit .c-code { width: 78px; }
.table-fit .c-type { width: 132px; }
.table-fit .c-state { width: 156px; }
.table-fit .c-num { width: 84px; text-align: right; }
.table-fit th.c-num, .table-fit td.c-num { text-align: right; }
.table-fit .c-acts { width: 124px; }
.table-fit th.c-acts { text-align: right; }
.table-fit .actions { flex-wrap: nowrap; }
.table-fit .badge { max-width: 100%; overflow: hidden; }
.cell-stack { display: grid; gap: 3px; align-content: center; min-width: 0; }
.cell-stack strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-stack span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-stack .badge { justify-self: start; }

.icon-action {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; flex: none; transition: color .16s, border-color .16s;
}
.icon-action svg { width: 15px; height: 15px; }
.icon-action:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-action.is-danger:hover { color: var(--busy); border-color: var(--busy); }
.table td .stars { vertical-align: middle; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--ink-2); }

/* ---------- secciones comerciales ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0 0; }
.section-head { max-width: 660px; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(27px, 3.6vw, 40px); font-weight: 700; margin-bottom: 14px; }
.section-head .lede { margin-top: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 14px; }
.feature { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 24px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--red-soft); color: var(--red); margin-bottom: 16px; }
.feature-ico svg { width: 23px; height: 23px; }
.feature h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.feature p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 14px; }
.steps li { border-top: 2px solid var(--ink); padding-top: 20px; }
.steps li:nth-child(2) { border-top-color: var(--amber); }
.steps li:nth-child(3) { border-top-color: var(--red); }
.step-n { font-family: var(--head); font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--ink-3); }
.steps h3 { font-size: 19px; font-weight: 600; margin: 10px 0 8px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* ---------- contacto ---------- */
.contact { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.contact-aside h2 { font-size: clamp(27px, 3.4vw, 38px); font-weight: 700; margin-bottom: 14px; }
.contact-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 4px; }
.contact-list a, .contact-list span {
  display: flex; align-items: center; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--line-2); font-size: 14.5px; color: var(--ink-2);
}
.contact-list a:hover { color: var(--ink); }
.contact-list svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.contact-form { border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(22px, 3vw, 32px); background: var(--surface); box-shadow: var(--shadow-sm); }
.contact-form .form-grid.two { gap: 14px; }
.contact-note { font-size: 12.5px; color: var(--ink-3); margin: 14px 0 0; }

.cta {
  margin-top: clamp(56px, 8vw, 96px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(30px, 4vw, 48px);
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  background: radial-gradient(circle at 88% 20%, rgba(232,18,28,.12), transparent 58%), var(--surface);
  box-shadow: var(--shadow-sm);
}
.cta h2 { font-size: clamp(23px, 3vw, 32px); font-weight: 700; max-width: 20ch; }
.cta p { margin: 12px 0 0; color: var(--ink-2); max-width: 46ch; font-size: 14.5px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- tabbar ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 930;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1 1 0; min-width: 0; border: 0; background: none; cursor: pointer;
  display: grid; justify-items: center; gap: 3px; padding: 5px 2px;
  color: var(--ink-3); border-radius: var(--r-sm); transition: color .16s;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button span { font-size: 10.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tabbar button.is-on { color: var(--ink); }
.tabbar button.is-on svg { color: var(--red); }
.tabbar button:active { background: var(--line-2); }

/* ---------- toasts / footer ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; translate: -50% 0; z-index: 1100; display: grid; gap: 8px; justify-items: center; }
.toast { padding: 11px 20px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow-lg); animation: pop .2s; }
.toast.err { background: var(--busy); color: #fff; }
.toast.ok { background: var(--green); color: #fff; }

.footer {
  border-top: 1px solid var(--line); padding: 34px clamp(16px, 3vw, 40px) 40px;
  display: grid; grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr)); gap: 26px;
  font-size: 13px; color: var(--ink-3); max-width: 1560px; margin: 0 auto;
}
.footer-col { display: grid; gap: 7px; align-content: start; }
.footer-col strong { color: var(--ink); font-size: 12px; letter-spacing: .09em; text-transform: uppercase; }
.footer-col a { color: var(--ink-3); }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }
.footer-marca { font-family: var(--head); font-weight: 900; letter-spacing: .05em; color: var(--ink); font-size: 14px; }
.footer-marca b { color: var(--red); }

/* ---------- páginas legales ---------- */
.legal { max-width: 760px; margin: 0 auto; padding-bottom: 40px; }
.legal-head { padding: clamp(36px, 5vw, 60px) 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.legal-head h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; margin: 14px 0 12px; }
.legal-fecha { font-size: 12.5px; color: var(--ink-3); margin: 0 0 28px; }
.legal h2 { font-size: 18px; font-weight: 900; margin: 30px 0 10px; }
.legal p, .legal li { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 7px; }
.legal strong { color: var(--ink); }
.legal a { color: var(--red); text-decoration: underline; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.legal-nav a {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
  font-size: 13.5px; color: var(--ink-2); text-decoration: none;
}
.legal-nav a:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- encendido de TV (1.1 s, solo la primera carga de la sesión) ---------- */
.tv-intro { position: fixed; inset: 0; z-index: 2000; background: #000; pointer-events: none; animation: tvOff .34s ease-in .76s forwards; }
.tv-beam {
  position: absolute; left: 0; right: 0; top: 50%; height: 3px;
  background: #fff; box-shadow: 0 0 26px 8px rgba(255,255,255,.85), 0 0 90px 24px rgba(232,18,28,.42);
  transform-origin: center; animation: tvBeam .52s cubic-bezier(.6,0,.2,1) forwards;
}
.tv-flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: tvFlash .3s ease-out .46s forwards; }
.tv-scan {
  position: absolute; inset: 0; opacity: .5;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.34) 0 1px, transparent 1px 3px);
  animation: tvOff .3s ease-in .7s forwards;
}
@keyframes tvBeam {
  0%   { transform: scaleX(0) scaleY(1); opacity: 0; }
  22%  { transform: scaleX(1) scaleY(1); opacity: 1; }
  100% { transform: scaleX(1) scaleY(260); opacity: .95; }
}
@keyframes tvFlash { 0% { opacity: 0; } 30% { opacity: .92; } 100% { opacity: 0; } }
@keyframes tvOff { to { opacity: 0; visibility: hidden; } }

/* ---------- botón flotante de WhatsApp ---------- */
:root { --wa: #25d366; --wa-oscuro: #128c7e; }

.wa { position: fixed; right: 22px; bottom: 22px; z-index: 1050; display: grid; justify-items: end; gap: 12px; }
/* Sube cuando la barra del comparador ocupa la parte baja. */
body.cmp-abierto .wa { bottom: 84px; }

.wa-fab {
  position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--wa); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 8px 22px -6px rgba(37,211,102,.65), 0 2px 8px rgba(10,10,11,.25);
  transition: transform .18s, box-shadow .18s;
}
.wa-fab svg { width: 32px; height: 32px; position: relative; z-index: 1; }
.wa-fab:hover { transform: scale(1.06); }
.wa-fab::before,
.wa-fab::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--wa); animation: waLatido 2.4s cubic-bezier(.2,.7,.4,1) infinite;
}
.wa-fab::after { animation-delay: 1.2s; }
@keyframes waLatido {
  0%   { transform: scale(1); opacity: .8; }
  75%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
.wa.is-open .wa-fab::before, .wa.is-open .wa-fab::after { animation: none; opacity: 0; }

.wa-panel {
  width: min(330px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .22s cubic-bezier(.2,.9,.3,1);
}
.wa-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: center;
  padding: 14px 16px; background: var(--wa-oscuro); color: #fff;
}
.wa-avatar { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.wa-avatar svg { width: 20px; height: 20px; }
.wa-who { display: grid; gap: 1px; min-width: 0; }
.wa-who strong { font-size: 14px; }
.wa-who span { font-size: 11.5px; opacity: .82; }
.wa-x { width: 28px; height: 28px; border: 0; background: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; opacity: .85; }
.wa-x:hover { opacity: 1; }

.wa-hola {
  margin: 0; padding: 16px 16px 4px; font-size: 13.5px; color: var(--ink-2);
  background: var(--surface-2);
}
.wa-form { display: grid; gap: 10px; padding: 12px 16px 16px; background: var(--surface-2); }
.wa-form label { display: grid; gap: 5px; }
.wa-form span { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.wa-form textarea { min-height: 60px; }
.wa-send {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 16px; margin-top: 2px;
  background: var(--wa); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .16s;
}
.wa-send:hover { background: var(--wa-oscuro); }
.wa-send svg { width: 16px; height: 16px; }

@media (max-width: 900px) {
  .wa { right: 14px; bottom: calc(88px + env(safe-area-inset-bottom)); }
  body.cmp-abierto .wa { bottom: calc(152px + env(safe-area-inset-bottom)); }
  .wa-fab { width: 52px; height: 52px; }
  .wa-fab svg { width: 29px; height: 29px; }
}

/* ---------- lista de espera y marcas ---------- */
.d-cta { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 16px; }
.d-cta .btn { width: 100%; }

.cola { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 8px; }
.cola li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
}
.cola li.is-mine { border-color: var(--red); background: var(--red-soft); }
.cola-pos {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); font-family: var(--head); font-weight: 900; font-size: 13px;
}
.cola li.is-mine .cola-pos { background: var(--red); color: #fff; }
.cola-marca { display: grid; gap: 2px; min-width: 0; }
.cola-marca strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cola-marca span { font-size: 12px; }

.marca-ahora { display: grid; gap: 10px; }
.marca { display: flex; align-items: center; gap: 11px; }
.marca > span { display: grid; gap: 2px; }
.marca strong { font-size: 15px; }
.marca-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--busy); flex: none;
  box-shadow: 0 0 0 4px var(--bg-red);
}
.marca-titulo {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 20px 0 10px;
}
.marca-historial { display: flex; flex-wrap: wrap; gap: 6px; }
.marca-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 5px;
  font-size: 12.5px; color: var(--ink-2); background: var(--surface-2);
}
.marca-nota { margin: 10px 0 0; }

/* Logos de marca. Sin logo cargado se muestran las iniciales, para que la
   ficha se vea pareja en vez de quedar con huecos. */
.marca-logo, .marca-chip-logo {
  flex: none; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
}
.marca-logo { width: 42px; height: 42px; padding: 4px; }
.marca-chip-logo { width: 22px; height: 22px; padding: 2px; border-radius: 999px; }
.sin-logo {
  display: grid; place-items: center; background: var(--line-2); color: var(--ink-3);
  font-family: var(--head); font-weight: 900; letter-spacing: .02em;
}
.marca-logo.sin-logo { font-size: 14px; }
.marca-chip-logo.sin-logo { font-size: 9.5px; }

/* Aviso del formulario de contrato: dice qué le hará al semáforo del punto. */
.contract-aviso {
  margin: 0; padding: 10px 13px; border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.45; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
}
.contract-aviso:empty { display: none; }
.contract-aviso.es-historico { background: var(--line-2); color: var(--ink-2); }
.contract-aviso.es-futuro { background: var(--bg-amber); color: var(--fg-amber); border-color: transparent; }
.contract-aviso.es-vigente { background: var(--bg-red); color: var(--fg-red); border-color: transparent; }

/* ---------- recorrido guiado ---------- */
.tour { position: fixed; inset: 0; z-index: 1150; pointer-events: none; }
/* El recuadro no se pinta: el sombreado gigante oscurece todo menos su hueco. */
.tour-spot {
  position: fixed; border-radius: var(--r);
  box-shadow: 0 0 0 9999px rgba(8,8,10,.72), 0 0 0 2px var(--red) inset;
  outline: 2px solid var(--red); outline-offset: 0;
  transition: top .3s cubic-bezier(.22,.9,.32,1), left .3s cubic-bezier(.22,.9,.32,1),
              width .3s cubic-bezier(.22,.9,.32,1), height .3s cubic-bezier(.22,.9,.32,1);
}
.tour-tip {
  position: fixed; pointer-events: auto; z-index: 2;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 20px 22px; display: grid; gap: 8px;
  animation: pop .24s cubic-bezier(.2,.9,.3,1);
}
.tour-tip::before {
  content: ''; position: absolute; top: -7px; left: 50%; translate: -50% 0;
  width: 13px; height: 13px; rotate: 45deg;
  background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line);
}
.tour-tip.is-above::before { top: auto; bottom: -7px; rotate: 225deg; }
.tour-step { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.tour-tip h3 { font-size: 17px; font-weight: 900; }
.tour-tip p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.tour-dots { display: flex; gap: 5px; margin-top: 4px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tour-dots i.is-on { background: var(--red); width: 16px; border-radius: 999px; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tour-actions .link-btn { margin-right: auto; }

@media (max-width: 640px) {
  .tour-tip {
    left: 12px; right: 12px; width: auto;
    bottom: calc(88px + env(safe-area-inset-bottom)); top: auto !important;
  }
  .tour-tip::before { display: none; }
}

/* ---------- galería a pantalla completa ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1200; display: grid;
  grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: clamp(12px, 4vw, 40px);
  background: rgba(6,6,8,.94); backdrop-filter: blur(6px); animation: fade .2s;
}
.lb-stage { margin: 0; display: grid; gap: 12px; justify-items: center; min-width: 0; }
.lb-stage img { max-width: 100%; max-height: 78vh; border-radius: var(--r); object-fit: contain; }
.lb-stage figcaption { color: #cfd0d6; font-size: 13px; text-align: center; }
.lb-close {
  position: absolute; top: 16px; right: 18px; width: 42px; height: 42px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}
.lb-nav {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.lb-nav svg { width: 22px; height: 22px; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.2); }

.d-cover { margin: 0; position: relative; cursor: zoom-in; }
.d-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.d-cover figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 20px 12px;
  font-size: 12px; color: #fff; text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,.62));
}

/* ---------- comparador ---------- */
.compare-bar {
  position: fixed; left: 50%; translate: -50% 0; bottom: 22px; z-index: 935;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: min(760px, calc(100vw - 24px));
  padding: 11px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: pop .22s;
}
.cmp-count { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.cmp-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cmp-chip {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  padding: 5px 11px; font-size: 12.5px; cursor: pointer; font-family: var(--head); font-weight: 700;
}
.cmp-chip:hover { border-color: var(--busy); color: var(--busy); }
.cmp-toggle {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--glass); border: 1px solid var(--line); color: var(--ink-2);
  backdrop-filter: blur(6px); cursor: pointer;
}
.cmp-toggle:hover { border-color: var(--ink); color: var(--ink); }
.card.is-comparing { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-soft); }
.card.is-comparing .cmp-toggle { background: var(--red); color: #fff; border-color: var(--red); }

.cmp-table-wrap { overflow-x: auto; margin-bottom: 4px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cmp-table th, .cmp-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.cmp-table thead th { border-bottom: 1px solid var(--line); }
.cmp-table tbody th { color: var(--ink-3); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.cmp-table .cmp-code { display: block; font-family: var(--head); font-size: 11px; color: var(--ink-3); letter-spacing: .05em; }
.cmp-table thead strong { font-size: 14px; }

/* ---------- carga y vacío ---------- */
.card.is-skeleton { cursor: default; pointer-events: none; }
.card.is-skeleton .card-media { border-radius: 0; }
.card.is-skeleton .card-body { gap: 9px; }
.empty-state {
  grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px;
  padding: 52px 20px; text-align: center; color: var(--ink-3);
}
.empty-state svg { width: 38px; height: 38px; color: var(--line); margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: 14px; }
.empty-state strong { color: var(--ink); font-size: 15px; }
.empty-state .btn { margin-top: 12px; }

/* ---------- hoja imprimible ---------- */
.print-sheet { display: none; }
@media print {
  body.printing > *:not(.print-sheet) { display: none !important; }
  body.printing { padding: 0; background: #fff; }
  .print-sheet { display: block; color: #111; font-family: var(--body); }
  .pf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid #e8121c; padding-bottom: 12px; }
  .pf-brand { font-family: var(--head); font-weight: 900; letter-spacing: .06em; font-size: 12px; }
  .pf-brand b { color: #e8121c; }
  .pf-head h1 { font-size: 25px; margin: 8px 0 4px; }
  .pf-head p { margin: 0; color: #555; font-size: 12.5px; }
  .pf-code { font-family: var(--head); font-weight: 900; font-size: 20px; white-space: nowrap; }
  .pf-photo { width: 100%; max-height: 320px; object-fit: cover; margin: 16px 0; border-radius: 6px; }
  .pf-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
  .pf-cols h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: #777; margin: 0 0 8px; }
  .pf-cols h2 + h2 { margin-top: 18px; }
  .pf-specs, .pf-rates { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .pf-specs th, .pf-rates th { text-align: left; color: #666; font-weight: 400; padding: 5px 0; width: 46%; }
  .pf-specs td, .pf-rates td { padding: 5px 0; font-weight: 600; }
  .pf-price { font-family: var(--head); font-weight: 900; font-size: 26px; margin: 0; }
  .pf-price span { font-size: 12px; font-weight: 400; color: #666; }
  .pf-foot { margin-top: 26px; padding-top: 10px; border-top: 1px solid #ddd; font-size: 10.5px; color: #666; display: grid; gap: 3px; }
  @page { size: A4; margin: 14mm; }
}

/* ---------- movimiento ---------- */
.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .6s cubic-bezier(.22,.9,.32,1), transform .6s cubic-bezier(.22,.9,.32,1);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* Entrada de las tarjetas del revisor. */
@keyframes entra-suave { from { opacity: 0; transform: translateY(10px); } }

.hero > * { animation: riseIn .75s cubic-bezier(.22,.9,.32,1) backwards; }
.hero > *:nth-child(1) { animation-delay: .04s; }
.hero > *:nth-child(2) { animation-delay: .12s; }
.hero > *:nth-child(3) { animation-delay: .2s; }
.hero > *:nth-child(4) { animation-delay: .28s; }
.hero > *:nth-child(5) { animation-delay: .36s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } }

.kpi b { font-variant-numeric: tabular-nums; }
.badge, .chip, .btn, .card, .feature, .result-item { will-change: auto; }
.map-panel, .results { animation: riseIn .7s cubic-bezier(.22,.9,.32,1) backwards; animation-delay: .1s; }

/* ---------- tickets ---------- */
.ticket-list { display: grid; gap: 10px; }
.ticket-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 18px 20px; cursor: pointer; text-align: left; width: 100%;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s;
}
.ticket-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-3); }
.ticket-card h3 { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-card .t-meta { grid-column: 1; font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 10px; }
.ticket-card .t-right { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 6px; justify-items: end; align-content: center; }
.ticket-thread { display: grid; gap: 12px; }
.ticket-msg { padding: 13px 15px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); }
.ticket-msg.is-staff { background: var(--red-soft); border-color: transparent; }
.ticket-msg .m-head { display: flex; gap: 9px; align-items: baseline; margin-bottom: 5px; }
.ticket-msg strong { font-size: 13.5px; }
.ticket-msg .who { font-size: 12px; color: var(--ink-3); }
.ticket-msg p { margin: 0; font-size: 14.5px; color: var(--ink-2); white-space: pre-wrap; }

.skeleton { background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 37%, var(--line-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .workspace, body.filters-open .workspace { grid-template-columns: 236px minmax(0, 1fr); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; }
  .results { grid-column: 1 / -1; position: static; max-height: 560px; }
  .contact { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .workspace, body.filters-open .workspace { grid-template-columns: minmax(0, 1fr); }
  /* En móvil los filtros son una hoja inferior: deja ver el mapa detrás y se
     cierra con el gesto habitual, en vez de tapar la pantalla como un panel. */
  .filters, body.filters-open .filters {
    display: grid; grid-template-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; max-height: 76vh; z-index: 960;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    align-content: start; overflow-y: auto;
    padding: 0 18px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(101%); transition: transform .3s cubic-bezier(.22,.9,.32,1);
    box-shadow: var(--shadow-lg);
  }
  body.filters-open .filters { transform: none; }
  body.filters-open .filters-backdrop { display: block; }

  .filters-head {
    display: grid; grid-template-columns: 1fr auto; align-items: center;
    position: sticky; top: 0; z-index: 2; margin: 0 -18px 4px;
    padding: 14px 18px 12px; background: var(--surface);
    border-bottom: 1px solid var(--line-2);
  }
  .filters-grab {
    grid-column: 1 / -1; justify-self: center; width: 42px; height: 4px;
    border-radius: 999px; background: var(--line); margin-bottom: 12px;
  }
  .filters-head strong { font-size: 16px; font-family: var(--head); font-weight: 900; }
  .filters-close {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-2); font-size: 20px; line-height: 1; cursor: pointer;
  }
  .filters-foot {
    display: block; position: sticky; bottom: 0; z-index: 2;
    margin: 6px -18px 0; padding: 12px 18px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line-2);
  }

  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; }
  .topnav, #btn-login, .usermenu { display: none; }
  .workbar #btn-filters { display: none; }
  .view { padding-bottom: 40px; }

  .drawer {
    top: auto; left: 0; right: 0; width: 100%;
    max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0;
    animation: sheetIn .28s cubic-bezier(.22,.9,.32,1);
  }
  .drawer-body { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
  .drawer::before { content: ''; position: sticky; top: 0; display: block; z-index: 4; width: 42px; height: 4px; border-radius: 999px; background: var(--line); margin: 10px auto 0; }
  .drawer-close { top: 18px; }
  .modal { max-height: 86vh; }
}
@keyframes sheetIn { from { transform: translateY(30px); opacity: .5; } }

@media (max-width: 860px) {
  :root { --topbar-h: 60px; --ledbar-h: 36px; }
  .topbar { gap: 12px; padding: 0 16px; }
  .btn { padding: 8px 13px; font-size: 13.5px; }
  .hero { padding-top: 34px; }
  .kpi { flex: 1 1 138px; min-width: 0; padding: 12px 16px; }
  .kpi b { font-size: 23px; }
  #map { height: 60vh; min-height: 380px; }
  .map-legend { font-size: 11px; gap: 9px; padding: 8px 11px; left: 10px; bottom: 10px; }
  .modal { padding: 22px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .d-hero, .d-section { padding-left: 20px; padding-right: 20px; }
  .d-hero h2 { font-size: 22px; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .pane-head { flex-wrap: wrap; }
  .pane-head .btn { margin-left: 0; width: 100%; }
  .pane-head input { max-width: none; }
  .cta { flex-direction: column; align-items: flex-start; }
  .table-fit { table-layout: auto; min-width: 720px; }
  .board-card.is-wide { grid-column: span 1; }
  /* La tira de pestañas se desliza de borde a borde y avisa que hay más a la derecha. */
  .tabs {
    margin-left: calc(clamp(16px, 3vw, 40px) * -1);
    margin-right: calc(clamp(16px, 3vw, 40px) * -1);
    padding: 0 clamp(16px, 3vw, 40px);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .shopbar { padding: 16px; }
  .shop-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .shop-row-controls > * { flex: none; width: 100%; min-width: 0; }
  .shop-search { flex: none; width: 100%; min-width: 0; }
  .shop-row-controls select { min-width: 0; width: 100%; }
  .shop-row-controls .btn { margin-left: 0; }
  .price-range { flex-wrap: nowrap; }
  .price-range input { flex: 1 1 0; width: auto; min-width: 0; }
  .pack { grid-template-columns: minmax(0, 1fr); }
  .compare-bar { left: 12px; right: 12px; translate: none; bottom: calc(84px + env(safe-area-inset-bottom)); border-radius: var(--r-lg); max-width: none; }
  .cmp-chips { flex: 1 1 100%; order: 3; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-nav { position: absolute; top: 50%; translate: 0 -50%; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .ledbar-item { font-size: 11px; letter-spacing: .08em; }
}

@media (max-width: 560px) {
  .kpis { gap: 8px; }
  .result-list { grid-template-columns: minmax(0, 1fr); }
  .map-legend { position: static; margin: 10px; justify-content: center; flex-wrap: wrap; border-radius: var(--r); }
  .footer { grid-template-columns: 1fr; gap: 22px; }
  .ledbar-status .st-day { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .ledbar-track { animation: none !important; }
}

/* =================================================================== revisor */

.rev-privacidad {
  display: flex; gap: 12px; align-items: flex-start; margin: 0 0 20px;
  padding: 14px 16px; border-radius: var(--r); font-size: 14px; line-height: 1.5;
  background: var(--bg-green); color: var(--fg-green);
}
.rev-privacidad svg { width: 21px; height: 21px; flex: none; margin-top: 1px; }
.rev-privacidad strong { font-weight: 800; }

.rev-zona {
  border: 2px dashed var(--line); border-radius: var(--r-lg); background: var(--surface-2);
  padding: clamp(30px, 6vw, 54px) 24px; text-align: center;
  transition: border-color .18s, background .18s, transform .18s;
}
.rev-zona.is-over { border-color: var(--red); background: var(--red-soft); transform: scale(1.006); }
.rev-zona-ico { width: 60px; height: 60px; color: var(--ink-3); margin-bottom: 14px; }
.rev-zona h3 { font-size: 19px; font-weight: 700; margin-bottom: 7px; }
.rev-zona p { margin: 0 0 18px; color: var(--ink-3); font-size: 13.5px; }

.rev-progreso { margin: 18px 0 4px; }
.rev-progreso p { margin: 0 0 9px; font-size: 14px; color: var(--ink-2); }
.rev-barra { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rev-barra i { display: block; height: 100%; width: 4%; border-radius: 99px; background: var(--red); transition: width .3s ease; }

.rev-listo { animation: entra-suave .3s cubic-bezier(.2,.7,.3,1) both; }
.rev-eyebrow { margin: 0 0 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--ink-3); }

.rev-ficha {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: start;
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px; background: var(--surface-2); margin-bottom: 20px;
}
.rev-ficha img { width: 100%; border-radius: var(--r-sm); display: block; background: #000; }
.rev-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px 18px; margin: 0; }
.rev-datos dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.rev-datos dd { margin: 2px 0 0; font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere; }

.rev-form-intro { margin: 0 0 18px; color: var(--ink-2); font-size: 14.5px; }
.rev-q { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 10px; background: var(--surface); }
.rev-q legend { font-weight: 700; font-size: 14.5px; padding: 0 4px; }
.rev-norma { display: block; font-size: 12px; color: var(--ink-3); margin: 4px 0 10px; }
.rev-opts { display: flex; gap: 9px; }
.rev-opts label { cursor: pointer; }
.rev-opts input { position: absolute; opacity: 0; pointer-events: none; }
.rev-opts span {
  display: grid; place-items: center; min-width: 62px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 99px; font-size: 14px; font-weight: 700;
  color: var(--ink-2); background: var(--surface-2); transition: all .15s;
}
.rev-opts label:hover span { border-color: var(--ink-3); }
.rev-opts input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.rev-opts input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

.rev-form-foot { margin-top: 18px; display: grid; gap: 14px; }
.rev-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.rev-check input { margin-top: 3px; accent-color: var(--red); width: 16px; height: 16px; flex: none; }

.rev-card {
  border: 1px solid var(--line); border-left: 4px solid var(--ink-3);
  border-radius: var(--r-lg); background: var(--surface); padding: clamp(20px, 3.4vw, 30px);
  box-shadow: var(--shadow); animation: entra-suave .38s cubic-bezier(.2,.7,.3,1) both;
}
.rev-card.t-green { border-left-color: var(--green); }
.rev-card.t-amber { border-left-color: var(--amber); }
.rev-card.t-red { border-left-color: var(--busy); }
.rev-card-head { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; align-items: center; margin-bottom: 22px; }
.rev-card-head h3 { font-size: clamp(21px, 3vw, 27px); margin-bottom: 7px; }
.rev-resumen { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }

.rev-anillo { width: 132px; height: 132px; }
.rev-anillo-base { fill: none; stroke: var(--line); stroke-width: 11; }
.rev-anillo-val {
  fill: none; stroke-width: 11; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 60px 60px;
  animation: rev-anillo 1s cubic-bezier(.2,.75,.3,1) both;
}
.rev-anillo.t-green .rev-anillo-val { stroke: var(--green); }
.rev-anillo.t-amber .rev-anillo-val { stroke: var(--amber); }
.rev-anillo.t-red .rev-anillo-val { stroke: var(--busy); }
@keyframes rev-anillo { from { stroke-dashoffset: 327; } }
.rev-anillo-num { text-anchor: middle; font-family: var(--head); font-weight: 900; font-size: 34px; fill: var(--ink); }
.rev-anillo-pct { text-anchor: middle; font-size: 12px; font-weight: 700; fill: var(--ink-3); }

.rev-conteo { display: flex; flex-wrap: wrap; gap: 7px; }
.rev-conteo span { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.rev-conteo .c-red { background: var(--bg-red); color: var(--fg-red); }
.rev-conteo .c-amber { background: var(--bg-amber); color: var(--fg-amber); }
.rev-conteo .c-blue { background: var(--line-2); color: var(--ink-2); }

.rev-ia { margin: 0 0 18px; font-size: 13px; color: var(--ink-3); }
.rev-ia.ok { color: var(--fg-green); }

.rev-grupo { margin-bottom: 18px; }
.rev-grupo h4 { font-size: 15px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.rev-grupo h4 span {
  display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px;
  border-radius: 99px; font-size: 11.5px; background: var(--line-2); color: var(--ink-2);
}
.rev-grupo.g-red h4 span { background: var(--bg-red); color: var(--fg-red); }
.rev-grupo.g-amber h4 span { background: var(--bg-amber); color: var(--fg-amber); }
.rev-grupo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.rev-grupo li { border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; background: var(--surface-2); }
.rev-grupo.g-red li { border-left: 3px solid var(--busy); }
.rev-grupo.g-amber li { border-left: 3px solid var(--amber); }
.rev-grupo li strong { display: block; font-size: 14.5px; font-weight: 700; }
.rev-grupo li p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

.rev-limpio { padding: 18px; border-radius: var(--r); background: var(--bg-green); color: var(--fg-green); font-weight: 700; margin: 0 0 18px; }
.rev-card-foot { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.rev-legal { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

.rev-marco { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: 14px 18px; }
.rev-marco summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
.rev-marco p { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }

@media (max-width: 900px) {
}
@media (max-width: 620px) {
  .rev-ficha { grid-template-columns: minmax(0, 1fr); }
  .rev-ficha img { max-width: 190px; }
  .rev-card-head { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .rev-conteo { justify-content: center; }
  .rev-card-foot .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .rev-listo, .rev-card, .rev-anillo-val { animation: none; }
}

/* ============================================ acceso al revisor desde el home */

.revisor-cta {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 20px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
  padding: clamp(20px, 3vw, 28px);
}
.revisor-cta-ico {
  display: grid; place-items: center; width: 56px; height: 56px;
  border-radius: 15px; background: var(--red-soft); color: var(--red);
}
.revisor-cta-ico svg { width: 30px; height: 30px; }
.revisor-cta h2 { font-size: clamp(19px, 2.4vw, 24px); font-weight: 700; margin-bottom: 7px; }
.revisor-cta p { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 62ch; }
.revisor-cta .btn { white-space: nowrap; }

.revisor-cuerpo { padding-top: 0; }

@media (max-width: 760px) {
  .revisor-cta { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .revisor-cta .btn { width: 100%; justify-content: center; }
}
