:root {
  color-scheme: light;
  --paper: #f4f0e8;
  --paper-deep: #e9e3d8;
  --ink: #17213a;
  --ink-soft: #4e5668;
  --line: #cbc5ba;
  --line-dark: #9f9a91;
  --orange: #e95f2b;
  --orange-dark: #b83d16;
  --blue: #2759a5;
  --green: #1f7258;
  --amber: #a86800;
  --red: #a6372b;
  --white: #fffdf8;
  --shadow: 0 18px 45px rgba(23, 33, 58, .14);
  --radius: 14px;
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

::selection { background: var(--orange); color: #fff; }

:focus-visible {
  outline: 3px solid rgba(39, 89, 165, .45);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }

.loading-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--ink);
  color: var(--paper);
}

.loading-view p { margin: 0; color: #c9cddd; font-size: .9rem; }
.loading-mark { display: flex; align-items: flex-end; gap: 5px; height: 38px; }
.loading-mark span { display: block; width: 7px; background: var(--orange); animation: signal .75s ease-in-out infinite alternate; }
.loading-mark span:nth-child(1) { height: 15px; }
.loading-mark span:nth-child(2) { height: 27px; animation-delay: .12s; }
.loading-mark span:nth-child(3) { height: 38px; animation-delay: .24s; }

@keyframes signal { to { opacity: .38; transform: scaleY(.72); transform-origin: bottom; } }

.login-view {
  min-height: 100svh;
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 34px 22px 56px;
  background: var(--ink);
  color: var(--paper);
}

.login-view::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: min(66vw, 520px);
  height: 55vh;
  opacity: .15;
  background:
    linear-gradient(135deg, transparent 49.4%, #fff 49.5%, #fff 50.5%, transparent 50.6%) 0 0 / 58px 58px,
    linear-gradient(45deg, transparent 49.4%, #fff 49.5%, #fff 50.5%, transparent 50.6%) 0 0 / 58px 58px;
  transform: translate(24%, -18%) rotate(-6deg);
  pointer-events: none;
}

.login-panel { position: relative; z-index: 1; width: min(100%, 430px); margin: auto; }

.brand-lockup, .compact-brand { display: flex; align-items: center; gap: 11px; }
.brand-lockup svg { width: 48px; height: 48px; color: var(--paper); }
.brand-lockup div { display: grid; line-height: 1.02; }
.brand-lockup strong { font-size: 1.18rem; letter-spacing: -.025em; }
.brand-lockup span { color: #bac1d0; font-size: .86rem; }

.login-copy { margin: clamp(52px, 10vh, 96px) 0 35px; }
.login-copy h1 { margin: 0; max-width: 10ch; font-size: clamp(2.7rem, 13vw, 4.2rem); line-height: .96; letter-spacing: -.04em; }
.login-copy p { max-width: 37ch; margin: 22px 0 0; color: #c9cddd; font-size: 1rem; line-height: 1.55; }

.login-form { display: grid; gap: 10px; }
.login-form label { font-size: .78rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; color: #c9cddd; }
.password-field { position: relative; }
.password-field input {
  width: 100%; height: 56px; padding: 0 56px 0 16px;
  border: 1px solid #596178; border-radius: 12px;
  background: #222d49; color: #fff; caret-color: var(--orange);
  transition: border-color .18s ease, background-color .18s ease;
}
.password-field input:hover { border-color: #858ca0; }
.password-field input:focus { border-color: #9eadd0; background: #26324f; outline: 3px solid rgba(151, 170, 216, .25); }
.password-field button {
  position: absolute; inset: 6px 6px 6px auto; width: 44px; border: 0; border-radius: 9px; background: transparent; color: #aeb5c6; cursor: pointer;
}
.password-field button:hover { background: #303c5a; color: #fff; }
.password-field svg, .primary-button svg, .icon-button svg, .dialog-close svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.form-error { margin: 2px 0 4px; color: #ffb49f; font-size: .88rem; line-height: 1.45; }
.primary-button {
  min-height: 56px; margin-top: 7px; padding: 0 16px 0 19px;
  display: flex; justify-content: space-between; align-items: center;
  border: 0; border-radius: 12px; background: var(--orange); color: white; font-weight: 800; cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}
.primary-button:hover { background: #f06b35; }
.primary-button:active { transform: translateY(1px); background: var(--orange-dark); }
.primary-button:disabled { opacity: .58; cursor: wait; }
.login-note { margin: 17px 0 0; display: flex; gap: 8px; align-items: center; color: #8f98ad; font-size: .78rem; }
.login-note span { width: 7px; height: 7px; border-radius: 50%; background: #69caa3; box-shadow: 0 0 0 4px rgba(105, 202, 163, .12); }

.login-route {
  position: absolute; z-index: 0; left: 22px; right: 22px; bottom: 19px;
  display: flex; align-items: center; color: #69738d; font-size: .63rem; font-weight: 800; letter-spacing: .06em;
}
.login-route i { flex: 1; height: 1px; margin: 0 7px; background: #414b65; position: relative; }
.login-route i::after { content: ""; position: absolute; right: 0; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: #59657f; }

.dashboard-view { min-height: 100vh; }
.topbar {
  position: sticky; z-index: 20; top: 0;
  height: 62px; padding: 0 max(17px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(244, 240, 232, .95); border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(12px)) { .topbar { backdrop-filter: blur(14px); } }
.compact-brand { text-decoration: none; font-size: .93rem; letter-spacing: -.015em; }
.compact-brand svg { width: 34px; height: 34px; flex: none; }
.compact-brand strong { font-weight: 850; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.data-date { color: var(--ink-soft); font-size: .72rem; }
.fair-map-trigger {
  min-height: 42px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--ink); border-radius: 9px; background: var(--ink); color: white;
  font-size: .74rem; font-weight: 800; cursor: pointer;
}
.fair-map-trigger:hover { background: #27324f; }
.fair-map-trigger svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button, .dialog-close {
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.icon-button:hover, .dialog-close:hover { background: var(--paper-deep); }

.dashboard-content { width: min(100%, 1120px); margin: 0 auto; padding: 34px 17px calc(30px + var(--safe-bottom)); }
.radar-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.radar-head h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.5rem); line-height: 1; letter-spacing: -.038em; }
.radar-head p { max-width: 58ch; margin: 12px 0 0; color: var(--ink-soft); font-size: .94rem; line-height: 1.5; }
.live-indicator { display: none; align-items: center; gap: 9px; color: var(--ink-soft); font-size: .76rem; white-space: nowrap; }
.live-indicator span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(31, 114, 88, .12); }

.search-zone { margin-top: 28px; }
.search-field { position: relative; }
.search-field > svg { position: absolute; left: 15px; top: 50%; width: 21px; transform: translateY(-50%); fill: none; stroke: var(--ink-soft); stroke-width: 1.8; stroke-linecap: round; }
.search-field input {
  width: 100%; height: 57px; padding: 0 52px 0 47px;
  border: 1px solid var(--line-dark); border-radius: 13px;
  background: var(--white); color: var(--ink); caret-color: var(--orange); font-size: 1rem;
  box-shadow: 0 4px 16px rgba(23, 33, 58, .04);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search-field input::placeholder { color: #777b83; }
.search-field input:hover { border-color: #77736d; }
.search-field input:focus { border-color: var(--blue); outline: 3px solid rgba(39, 89, 165, .17); box-shadow: 0 8px 20px rgba(23, 33, 58, .08); }
.search-field kbd {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  min-width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line); border-bottom-color: var(--line-dark); border-radius: 6px; background: var(--paper); color: var(--ink-soft); font-size: .76rem;
}
.search-field button {
  position: absolute; right: 7px; top: 7px; width: 43px; height: 43px;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.search-field button:hover { background: var(--paper-deep); }
.search-field button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.filter-row { margin-top: 12px; display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 7px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.filter-chip:hover { border-color: var(--line-dark); color: var(--ink); }
.filter-chip.is-active { background: var(--ink); border-color: var(--ink); color: white; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.filter-chip.is-active .chip-dot.hot { background: var(--orange); }

.signal-strip {
  margin-top: 24px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(116px, 1fr);
  overflow-x: auto; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line-dark); scrollbar-width: thin; scrollbar-color: var(--line-dark) transparent;
}
.signal-item {
  min-height: 92px; padding: 16px 15px; display: grid; align-content: center; gap: 3px; text-align: left;
  border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer;
}
.signal-item:last-child { border-right: 0; }
.signal-item:hover { background: rgba(255, 253, 248, .55); }
.signal-item strong { font-size: 1.48rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.signal-item span { color: var(--ink-soft); font-size: .73rem; line-height: 1.25; }

.route-section { margin-top: 34px; }
.route-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-bottom: 13px; border-bottom: 2px solid var(--ink); }
.route-heading h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.route-heading p { margin: 4px 0 0; color: var(--ink-soft); font-size: .75rem; }
.sort-control { display: grid; gap: 3px; color: var(--ink-soft); font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sort-control select { min-width: 116px; height: 34px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-size: .77rem; text-transform: none; letter-spacing: 0; }

.lead-list { display: grid; }
.lead-row { position: relative; border-bottom: 1px solid var(--line); }
.lead-row::after { content: ""; position: absolute; left: 44px; bottom: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-dark); z-index: 1; }
.lead-row:last-child::after { display: none; }
.lead-open {
  width: 100%; min-height: 164px; padding: 19px 4px 19px 0;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 24px; gap: 10px; align-items: start;
  border: 0; background: transparent; text-align: left; cursor: pointer;
  transition: background-color .18s ease;
}
.lead-open:hover { background: rgba(255, 253, 248, .62); }
.lead-open:active { background: var(--paper-deep); }
.lead-route-marker { align-self: stretch; display: grid; grid-template-rows: 28px 1fr; justify-items: center; }
.lead-rank {
  width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); font-size: .68rem; font-weight: 850; font-variant-numeric: tabular-nums;
}
.lead-route-marker i { width: 2px; height: calc(100% + 23px); background: var(--line-dark); }
.lead-row:last-child .lead-route-marker i { background: linear-gradient(var(--line-dark) 30%, transparent); }
.lead-main { min-width: 0; }
.lead-meta { display: flex; align-items: center; gap: 7px; min-height: 21px; }
.lead-priority, .priority-stamp { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 6px; background: var(--ink); color: white; font-size: .7rem; font-weight: 900; }
.lead-priority[data-priority="A"], .priority-stamp[data-priority="A"] { background: var(--orange); }
.lead-priority[data-priority="B"], .priority-stamp[data-priority="B"] { background: var(--amber); }
.lead-stand { font-size: .72rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.lead-score { color: var(--ink-soft); font-size: .68rem; font-variant-numeric: tabular-nums; }
.lead-name { margin: 8px 0 0; font-size: 1.13rem; line-height: 1.2; letter-spacing: -.02em; }
.lead-segment { margin: 4px 0 0; overflow: hidden; color: var(--ink-soft); font-size: .78rem; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.lead-status { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.status-tag { padding: 4px 7px; border-radius: 5px; background: var(--paper-deep); color: var(--ink-soft); font-size: .66rem; font-weight: 750; }
.status-tag.bad { background: #f6dcd4; color: #862f1f; }
.status-tag.warn { background: #f3e3c4; color: #79500d; }
.status-tag.good { background: #dcebe4; color: #245f4c; }
.lead-offer { margin: 9px 0 0; color: var(--ink); font-size: .77rem; line-height: 1.43; }
.lead-offer::before { content: "Oferta: "; color: var(--orange-dark); font-weight: 800; }
.lead-chevron { align-self: center; width: 20px; fill: none; stroke: var(--line-dark); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.lead-open:hover .lead-chevron { transform: translateX(3px); stroke: var(--ink); }

.empty-state { padding: 60px 20px; text-align: center; }
.empty-state svg { width: 54px; fill: none; stroke: var(--line-dark); stroke-width: 1.7; }
.empty-state circle { fill: var(--orange); stroke: none; }
.empty-state h3 { margin: 18px 0 6px; font-size: 1.05rem; }
.empty-state p { margin: 0; color: var(--ink-soft); font-size: .86rem; }
.empty-state button { min-height: 44px; margin-top: 20px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 9px; background: transparent; font-weight: 750; cursor: pointer; }
.empty-state button:hover { background: var(--ink); color: white; }

.data-footnote { margin-top: 42px; padding-top: 17px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .7rem; }

.lead-dialog { width: min(100%, 690px); max-width: none; height: min(91svh, 900px); max-height: none; margin: auto 0 0 auto; padding: 0; border: 0; border-radius: 18px 18px 0 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
.lead-dialog::backdrop { background: rgba(8, 14, 29, .56); }
.dialog-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.dialog-header { position: relative; padding: 23px 20px 18px; border-bottom: 1px solid var(--line); }
.dialog-handle { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; border-radius: 4px; background: var(--line-dark); transform: translateX(-50%); }
.dialog-close { position: absolute; z-index: 2; top: 16px; right: 12px; }
.dialog-identity { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 13px; align-items: start; padding-right: 35px; }
.priority-stamp { width: 36px; height: 36px; border-radius: 8px; font-size: 1rem; }
.dialog-identity p { margin: 0; color: var(--ink-soft); font-size: .73rem; }
.dialog-identity h2 { margin: 3px 0 5px; font-size: 1.45rem; line-height: 1.12; letter-spacing: -.025em; }
.dialog-content { padding: 18px 20px 34px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-scoreline { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.score-number { width: 53px; height: 53px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font-size: 1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.score-copy strong { display: block; font-size: .82rem; }
.score-copy span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .72rem; line-height: 1.35; }
.detail-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h3 { margin: 0 0 10px; font-size: .74rem; letter-spacing: .055em; text-transform: uppercase; }
.detail-section p { margin: 0; font-size: .88rem; line-height: 1.58; }
.approach-box { padding: 15px; border-radius: 12px; background: var(--ink); color: var(--paper); }
.approach-box p { font-size: .91rem; }
.approach-box button { min-height: 40px; margin-top: 13px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #687088; border-radius: 8px; background: transparent; color: white; font-size: .75rem; font-weight: 750; cursor: pointer; }
.approach-box button:hover { background: #27324f; }
.approach-box button svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.detail-fact { min-width: 0; }
.detail-fact dt { color: var(--ink-soft); font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.detail-fact dd { margin: 4px 0 0; font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.audit-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.audit-list li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: .82rem; line-height: 1.45; }
.audit-list svg { width: 17px; margin-top: 1px; fill: none; stroke: var(--ink-soft); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px; }
.source-link { min-height: 38px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-size: .73rem; font-weight: 700; text-decoration: none; }
.source-link:hover { border-color: var(--ink); }
.source-link svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dialog-actions { padding: 12px 16px var(--safe-bottom); display: flex; flex-wrap: wrap; gap: 8px; background: var(--white); border-top: 1px solid var(--line); }
.dialog-action { flex: 1; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); border-radius: 10px; background: transparent; font-size: .8rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.dialog-action.primary { background: var(--orange); border-color: var(--orange); color: white; }
.dialog-action.fair-map-action { flex-basis: 100%; }
.dialog-action:hover { filter: brightness(.96); }
.dialog-action svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); padding: 11px 15px; border-radius: 9px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: .78rem; }

.fair-map-dialog {
  width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--paper); color: var(--ink);
}
.fair-map-dialog::backdrop { background: rgba(8, 14, 29, .7); }
.fair-map-shell { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.fair-map-header {
  min-height: calc(66px + env(safe-area-inset-top)); padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.fair-map-header h2 { margin: 2px 0 0; font-size: 1.13rem; line-height: 1.1; letter-spacing: -.02em; }
.fair-map-header p { margin: 0; color: var(--ink-soft); font-size: .67rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.map-back {
  width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
}
.map-back:hover { background: var(--paper-deep); }
.map-back svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-source { padding: 8px 4px; color: var(--blue); font-size: .71rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.fair-map-tools {
  padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  border-bottom: 1px solid var(--line); background: var(--white);
}
.map-search { position: relative; display: block; }
.map-search svg { position: absolute; left: 12px; top: 50%; width: 18px; transform: translateY(-50%); fill: none; stroke: var(--ink-soft); stroke-width: 1.8; stroke-linecap: round; }
.map-search input {
  width: 100%; height: 44px; padding: 0 12px 0 39px; border: 1px solid var(--line-dark); border-radius: 9px;
  background: var(--paper); color: var(--ink); font-size: .84rem; caret-color: var(--orange);
}
.map-search input:focus { border-color: var(--blue); outline: 3px solid rgba(39, 89, 165, .17); }
.map-zoom { display: grid; grid-template-columns: 42px auto 42px; }
.map-zoom button {
  min-height: 44px; border: 1px solid var(--line-dark); border-right-width: 0; background: var(--paper); color: var(--ink);
  font-weight: 850; cursor: pointer;
}
.map-zoom button:first-child { border-radius: 9px 0 0 9px; }
.map-zoom button:last-child { border-right-width: 1px; border-radius: 0 9px 9px 0; }
.map-zoom button:nth-child(2) { padding-inline: 10px; font-size: .7rem; }
.map-zoom button:hover { background: var(--paper-deep); }

.map-viewport {
  position: relative; min-height: 0; overflow: hidden; touch-action: none; overscroll-behavior: contain;
  background: var(--ink); cursor: grab; outline: none; user-select: none;
}
.map-viewport:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }
.map-viewport.is-dragging { cursor: grabbing; }
.map-stage {
  position: absolute; left: 0; top: 0; width: 1635px; height: 1022px; transform-origin: 0 0;
  will-change: transform; background: white; box-shadow: 0 12px 40px rgba(3, 8, 20, .34);
}
.map-stage.is-focusing { transition: transform .48s cubic-bezier(.16, 1, .3, 1); }
.map-stage > img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.map-pin {
  position: absolute; z-index: 2; padding: 0; display: flex; align-items: flex-end; gap: 7px;
  border: 0; background: transparent; color: var(--ink); transform: translate(-10px, -100%); cursor: pointer;
}
.map-pin[hidden] { display: none; }
.map-pin-dot {
  position: relative; width: 20px; height: 20px; flex: none; border: 5px solid white; border-radius: 50%; background: var(--orange);
  box-shadow: 0 4px 13px rgba(23, 33, 58, .42);
}
.map-pin-dot::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 20px; height: 20px;
  border: 2px solid var(--orange); border-radius: 50%; animation: mapPulse 1.8s ease-out infinite;
}
.map-pin-label {
  max-width: 195px; padding: 8px 10px; display: grid; gap: 2px; text-align: left;
  border-radius: 8px; background: var(--ink); color: white; box-shadow: 0 6px 18px rgba(23, 33, 58, .3);
}
.map-pin-label strong { overflow: hidden; font-size: .76rem; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
.map-pin-label small { color: #c9cddd; font-size: .63rem; }
@keyframes mapPulse { from { opacity: .72; transform: scale(.8); } to { opacity: 0; transform: scale(2.15); } }
.map-gesture-hint {
  position: absolute; z-index: 4; left: 50%; bottom: 14px; margin: 0; padding: 8px 11px;
  border-radius: 7px; background: rgba(23, 33, 58, .91); color: white; font-size: .67rem; font-weight: 750;
  transform: translateX(-50%); pointer-events: none; transition: opacity .25s ease;
}
.map-viewport.has-interacted .map-gesture-hint { opacity: 0; }

.map-selection {
  min-height: calc(70px + var(--safe-bottom)); padding: 11px 14px var(--safe-bottom);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border-top: 1px solid var(--line); background: var(--paper);
}
.map-selection div { min-width: 0; display: grid; gap: 3px; }
.map-selection span { color: var(--orange-dark); font-size: .68rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.map-selection strong { overflow: hidden; font-size: .82rem; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.map-selection button {
  min-height: 42px; padding: 0 13px; flex: none; border: 1px solid var(--ink); border-radius: 9px;
  background: var(--ink); color: white; font-size: .73rem; font-weight: 800; cursor: pointer;
}
.map-selection button:hover { background: #27324f; }

@media (min-width: 700px) {
  .topbar { padding-inline: 28px; }
  .dashboard-content { padding: 56px 28px 50px; }
  .live-indicator { display: flex; }
  .search-zone { display: grid; grid-template-columns: minmax(300px, .75fr) 1.25fr; gap: 16px; align-items: center; }
  .filter-row { margin-top: 0; justify-content: flex-end; }
  .signal-strip { grid-auto-columns: 1fr; overflow: visible; }
  .signal-item { min-height: 104px; padding: 18px 20px; }
  .signal-item strong { font-size: 1.75rem; }
  .lead-open { grid-template-columns: 54px minmax(0, 1fr) 28px; min-height: 150px; padding: 20px 12px 20px 0; }
  .lead-row::after { left: 50px; }
  .lead-main { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(150px, .5fr) minmax(280px, 1.1fr); column-gap: 24px; align-items: center; }
  .lead-meta { grid-column: 1; }
  .lead-name { grid-column: 1; }
  .lead-segment { grid-column: 1; }
  .lead-status { grid-column: 2; grid-row: 1 / span 3; margin: 0; align-content: center; }
  .lead-offer { grid-column: 3; grid-row: 1 / span 3; margin: 0; }
  .data-footnote { flex-direction: row; justify-content: space-between; }
  .lead-dialog { height: 100vh; margin: 0 0 0 auto; border-radius: 0; }
  .dialog-handle { display: none; }
  .dialog-header { padding-top: 28px; }
  .fair-map-dialog { width: min(94vw, 1380px); height: min(92vh, 940px); margin: auto; border-radius: 16px; box-shadow: var(--shadow); }
  .fair-map-header { padding: 12px 18px; }
  .fair-map-tools { padding: 12px 18px; }
  .map-selection { padding-inline: 18px; }
}

@media (max-width: 520px) {
  .data-date { display: none; }
  .fair-map-trigger span { display: none; }
  .fair-map-trigger { width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .fair-map-tools { grid-template-columns: 1fr; }
  .map-zoom { justify-self: stretch; grid-template-columns: 48px 1fr 48px; }
}

@media (min-width: 1000px) {
  .login-view { grid-template-columns: 1fr 1fr; }
  .login-panel { margin-left: max(7vw, 60px); }
  .login-view::before { width: 52vw; height: 110vh; opacity: .23; transform: translate(5%, -8%) rotate(0); }
  .login-route { left: max(7vw, 60px); right: max(7vw, 60px); }
  .route-section { margin-top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
