:root {
  --bg: #080808;
  --bg-deep: #030303;
  --sidebar: #080808;
  --surface: #111113;
  --surface-raised: #1a1a1e;
  --surface-soft: #0d0d0f;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.22);
  --primary: #123f6d;
  --primary-strong: #0b2f55;
  --signal: #5f8fbd;
  --warning: #f4f4f5;
  --danger: #b65353;
  --text: #f7f7f7;
  --muted: #a8a8b0;
  --subtle: #74747d;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-panel: 0 18px 60px rgba(0, 0, 0, 0.22);
  --sidebar-width: 248px;
  --focus: 0 0 0 3px rgba(18, 63, 109, 0.58);
  --ease: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg-deep); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #f7f7f7;
  font-weight: 700;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--border);
  background: #080808;
}
.brand { display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 8px; }
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(102, 155, 188, 0.55);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--text);
}
.brand-logo { display: block; width: 29px; height: 29px; object-fit: contain; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-family: "Sora", sans-serif; font-size: 18px; letter-spacing: -0.04em; }
.brand-copy small { margin-top: 4px; color: var(--signal); font: 600 9px/1 "IBM Plex Mono", monospace; letter-spacing: 0.18em; }
.primary-nav { display: grid; gap: 6px; margin-top: 28px; }
.nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}
.nav-item:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-item.is-active { border-color: #234f7a; background: #123f6d; color: #fff; }
.nav-item small { margin-left: auto; color: var(--subtle); font-size: 10px; }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-count { min-width: 24px; margin-left: auto; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--text); font: 600 11px/1.5 "IBM Plex Mono", monospace; text-align: center; }
.sidebar-divider { height: 1px; margin: 22px 8px 16px; background: var(--border); }
.sidebar-label { margin: 0 12px 6px; color: var(--subtle); font: 600 10px/1.4 "IBM Plex Mono", monospace; letter-spacing: .12em; text-transform: uppercase; }
.nav-item-muted { opacity: .62; }
.sidebar-note { margin-top: auto; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.sidebar-note .note-kicker { color: var(--signal); font: 600 10px/1.4 "IBM Plex Mono", monospace; letter-spacing: .12em; }
.sidebar-note strong { display: block; margin-top: 9px; font-size: 13px; }
.sidebar-note p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.mobile-header { display: none; }
.main-content { min-width: 0; margin-left: var(--sidebar-width); padding: 34px 38px 56px; }
.view { width: min(1420px, 100%); margin: 0 auto; }
.view:not(.is-visible) { display: none; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-header h1 { margin: 3px 0 8px; font: 700 clamp(25px, 2.2vw, 34px)/1.15 "Sora", sans-serif; letter-spacing: -0.04em; }
.page-header p:not(.eyebrow) { margin: 0; color: var(--muted); }
.eyebrow, .step-label, .action-label { color: var(--signal); font: 600 10px/1.4 "IBM Plex Mono", monospace; letter-spacing: .14em; }
.api-status { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; }
.api-status::before { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); content: ""; }
.api-status.is-ready::before { background: var(--signal); box-shadow: 0 0 0 4px rgba(67,212,189,.08); }
.api-status.is-error::before { background: var(--danger); }

.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-panel); }
.location-panel { padding: 20px; }
.panel-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.panel-heading > * { min-width: 0; }
.panel-heading.compact { margin-bottom: 18px; }
.panel-heading h2 { margin: 4px 0 0; font: 600 17px/1.3 "Sora", sans-serif; letter-spacing: -0.025em; }
.location-summary { color: var(--muted); font: 500 12px/1.4 "IBM Plex Mono", monospace; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span, .priority-fieldset legend { color: #f7f7f7; font-size: 12px; font-weight: 600; }
.field small { color: var(--subtle); font-size: 11px; }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #080808;
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
input::placeholder { color: #74747d; }
input:hover, select:hover { border-color: var(--border-strong); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
.map-frame { position: relative; height: 330px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: #dce8ee; }
.lead-map { width: 100%; height: 100%; background: #dce8ee; }
.leaflet-container { font-family: "Manrope", system-ui, sans-serif; }
.leaflet-control-zoom a { color: #10213a; }
.map-caption { position: absolute; z-index: 500; right: 12px; bottom: 12px; display: flex; max-width: calc(100% - 24px); align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(3,3,3,.92); color: #f7f7f7; font-size: 11px; pointer-events: none; }
.map-caption span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-pin { width: 8px; height: 8px; border-radius: 50%; background: #5f8fbd; box-shadow: 0 0 0 4px rgba(18,63,109,.24); }
.radius-control { display: grid; gap: 7px; margin-top: 14px; }
.radius-control label { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.radius-control label strong { color: var(--text); font-family: "IBM Plex Mono", monospace; }
.radius-control input { min-height: 18px; height: 18px; padding: 0; accent-color: var(--primary); }
.radius-control small { color: var(--subtle); font-size: 11px; }

.search-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr); gap: 14px; margin-top: 14px; }
.niche-panel, .config-panel { padding: 20px; }
.selected-niches { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 38px; margin-top: 13px; }
.selected-niches > span { color: var(--subtle); font-size: 11px; }
.selected-niches button { min-height: 30px; padding: 4px 9px; border: 1px solid #234f7a; border-radius: 999px; background: #123f6d; color: #fff; font-size: 11px; }
.selected-niches .clear-niches { margin-left: auto; border-color: transparent; background: transparent; color: var(--muted); }
.niche-groups { display: grid; gap: 16px; max-height: 480px; margin-top: 14px; padding: 14px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; background: #080808; scrollbar-color: var(--border-strong) transparent; }
.niche-category h3 { margin: 0 0 8px; color: #a8a8b0; font: 600 10px/1.4 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.niche-category > div { display: flex; flex-wrap: wrap; gap: 7px; }
.no-niches { margin: 0; color: var(--muted); font-size: 12px; }
.niche-chip, .filter-chip, .status-tab {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.niche-chip:hover, .filter-chip:hover, .status-tab:hover { border-color: var(--border-strong); color: var(--text); }
.niche-chip.is-selected, .filter-chip[aria-pressed="true"] { border-color: #234f7a; background: #123f6d; color: #fff; }
.priority-fieldset { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; border: 0; }
.priority-fieldset legend { width: 100%; margin-bottom: 8px; }
.toggle-option { position: relative; }
.toggle-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-option span { display: inline-flex; min-height: 38px; align-items: center; padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); cursor: pointer; font-size: 12px; transition: var(--ease); }
.toggle-option input:checked + span { border-color: #234f7a; background: #123f6d; color: #fff; }
.toggle-option input:focus-visible + span { box-shadow: var(--focus); }
.cost-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 20px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #080808; }
.cost-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 6px; border-radius: 50%; background: var(--warning); }
.cost-note p { margin: 0; color: var(--muted); font-size: 11px; }
.cost-note strong { color: #f7f7f7; font-size: 12px; }
.search-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 14px; padding: 15px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.search-action-bar > div { display: grid; gap: 3px; min-width: 0; }
.search-action-bar strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.primary-button, .secondary-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 17px;
  border-radius: 10px;
  font-weight: 700;
  transition: background var(--ease), border-color var(--ease), opacity var(--ease);
}
.primary-button { border: 1px solid #234f7a; background: #123f6d; color: #fff; }
.primary-button:hover { background: #0b2f55; }
.primary-button:disabled { opacity: .5; }
.button-arrow { font-size: 18px; }
.secondary-button { border: 1px solid var(--border-strong); background: var(--surface-raised); color: var(--text); }
.secondary-button:hover { border-color: #5f8fbd; }
.form-feedback { min-height: 26px; padding: 8px 2px 0; color: var(--muted); font-size: 12px; }
.form-feedback.is-error { color: #f7f7f7; }
.form-feedback.is-success { color: #f7f7f7; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { display: flex; min-height: 76px; align-items: center; justify-content: space-between; padding: 15px 17px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { font: 600 24px/1 "IBM Plex Mono", monospace; }
.lead-workspace { overflow: hidden; }
.status-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 0; scrollbar-width: thin; }
.status-tab { flex: 0 0 auto; border-radius: 9px 9px 0 0; border-bottom-color: transparent; }
.status-tab span { margin-left: 5px; font: 600 10px/1 "IBM Plex Mono", monospace; }
.status-tab.is-active { border-color: var(--border); border-bottom-color: var(--surface-raised); background: var(--surface-raised); color: var(--text); }
.header-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(182,83,83,.62);
  border-radius: 10px;
  background: transparent;
  color: #f7f7f7;
  font-size: 12px;
  font-weight: 700;
}
.danger-button:hover { border-color: #b65353; background: rgba(182,83,83,.14); color: #fff; }
.danger-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.compact-button { min-height: 36px; padding: 6px 10px; }
.selection-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 54px; padding: 8px 16px; border-bottom: 1px solid #234f7a; background: #0b2f55; }
.selection-bar strong { font-size: 12px; }
.lead-filters { display: grid; grid-template-columns: minmax(220px, 1fr) auto 180px; gap: 10px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-raised); }
.search-field input, .sort-field select { min-height: 42px; }
.filter-chips { display: flex; gap: 7px; }
.filter-chip { min-height: 34px; padding: 6px 10px; }
.lead-table-header { display: grid; grid-template-columns: minmax(360px, 1.6fr) minmax(170px, .72fr) 120px minmax(300px, 1fr); gap: 20px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); background: #080808; color: var(--subtle); font: 600 10px/1.4 "IBM Plex Mono", monospace; letter-spacing: .08em; text-transform: uppercase; }
.select-heading { display: flex; align-items: center; gap: 16px; }
.select-heading input, .lead-selector { width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; flex: 0 0 auto; accent-color: #123f6d; cursor: pointer; }
.lead-list { display: grid; }
.lead-row { display: grid; grid-template-columns: minmax(360px, 1.6fr) minmax(170px, .72fr) 120px minmax(300px, 1fr); gap: 20px; align-items: center; min-height: 112px; padding: 16px 18px; border-bottom: 1px solid var(--border); background: var(--surface); transition: background var(--ease), box-shadow var(--ease); }
.lead-row:hover { background: var(--surface-raised); }
.lead-row.is-selected { background: color-mix(in srgb, #111113 72%, #123f6d); box-shadow: inset 3px 0 #5f8fbd; }
.lead-company { display: grid; grid-template-columns: 18px 34px minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; }
.company-copy { min-width: 0; }
.lead-company h3 { margin: 0 0 7px; overflow: hidden; color: #f7f7f7; font: 600 14px/1.35 "Sora", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.lead-meta { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.lead-meta > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-meta .status-badge { justify-self: start; margin-top: 2px; }
.favorite-button { display: grid; width: 34px; height: 34px; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: #080808; color: #a8a8b0; }
.favorite-button svg { width: 18px; height: 18px; fill: transparent; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.favorite-button.is-favorite { border-color: #f7c948; background: rgba(247,201,72,.12); color: #f7c948; }
.favorite-button.is-favorite svg { fill: #f7c948; stroke: #f7c948; }
.presence-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.presence-badge, .status-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 10px; }
.presence-badge.positive { border-color: var(--border-strong); background: #080808; color: #f7f7f7; }
.presence-badge.opportunity { border-color: #234f7a; background: #0b2f55; color: #fff; }
.potential { display: flex; align-items: center; gap: 9px; }
.potential-meter { width: 54px; height: 5px; overflow: hidden; border: 0; border-radius: 999px; appearance: none; background: rgba(255,255,255,.08); }
.potential-meter::-webkit-progress-bar { border-radius: 999px; background: rgba(255,255,255,.08); }
.potential-meter::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--signal)); }
.potential-meter::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--signal)); }
.potential-meter.score-low::-webkit-progress-value, .potential-meter.score-low::-moz-progress-bar { background: var(--warning); }
.potential strong { color: #f7f7f7; font: 600 13px/1 "IBM Plex Mono", monospace; }
.lead-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.action-button, .action-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.action-button:hover, .action-link:hover { border-color: var(--border-strong); background: rgba(255,255,255,.035); color: var(--text); }
.action-button.primary-action { border-color: #234f7a; color: #dceafb; }
.action-button.danger-action { border-color: #b65353; color: #f0d6d6; }
.icon-action { width: 40px; min-height: 40px; padding: 8px; }
.icon-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.whatsapp-action { color: #d7e6f4; }
.whatsapp-action svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.whatsapp-action:hover { border-color: #315e89; background: #123f6d; color: #fff; }
.empty-state { display: grid; min-height: 320px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.empty-mark { width: 46px; height: 46px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface-raised); }
.empty-state h2 { margin: 16px 0 5px; font: 600 18px/1.3 "Sora", sans-serif; }
.empty-state p { max-width: 390px; margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 1000; max-width: min(360px, calc(100vw - 32px)); padding: 12px 15px; border: 1px solid #234f7a; border-radius: 11px; background: #0b2f55; box-shadow: var(--shadow-panel); color: var(--text); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity var(--ease), transform var(--ease); }
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* Acesso local inspirado no fluxo dividido do FrameIA. */
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr); background: #030303; }
.auth-story { position: relative; display: flex; min-height: 100dvh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(28px, 5vw, 72px); border-right: 1px solid var(--border); background: radial-gradient(circle at 72% 30%, rgba(18,63,109,.3), transparent 32%), linear-gradient(145deg,#080808,#030303); }
.auth-story::after { display: none; content: ""; }
.auth-brand { position: relative; z-index: 1; padding: 0; }
.auth-story-copy { position: relative; z-index: 1; max-width: 700px; margin: auto 0; padding: 70px 0; }
.auth-story-copy h1 { max-width: 680px; margin: 12px 0 22px; font: 700 clamp(48px,6vw,82px)/.96 "Sora",sans-serif; letter-spacing: -.065em; }
.auth-story-copy > p:last-child { max-width: 570px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.auth-steps { position: relative; z-index: 1; display: flex; width: min(100%,430px); align-items: center; gap: 12px; color: var(--subtle); font: 600 10px "IBM Plex Mono",monospace; }
.auth-steps i { height: 1px; flex: 1; background: var(--border); }
.auth-panel { display: grid; min-height: 100dvh; place-items: center; padding: 32px; background: #080808; }
.auth-card { width: min(100%,440px); }
.auth-card h2 { margin: 8px 0 10px; font: 700 30px/1.16 "Sora",sans-serif; letter-spacing: -.045em; }
.auth-subtitle { margin: 0 0 24px; color: var(--muted); }
.local-notice { display: grid; gap: 3px; margin-bottom: 24px; padding: 13px 14px; border: 1px solid rgba(95,143,189,.32); border-radius: 11px; background: rgba(18,63,109,.12); }
.local-notice strong { font-size: 12px; }
.local-notice span { color: var(--muted); font-size: 10px; }
.auth-card form { display: grid; gap: 9px; }
.auth-card form > label { margin-top: 7px; color: #dedee2; font-size: 12px; font-weight: 700; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > svg { position: absolute; left: 13px; z-index: 1; width: 18px; height: 18px; fill: none; stroke: var(--subtle); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.auth-input-wrap input { min-height: 52px; padding-left: 43px; padding-right: 46px; background: #030303; }
.password-toggle { position: absolute; right: 4px; display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--surface-raised); color: #fff; }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.auth-feedback { min-height: 19px; color: var(--muted); font-size: 11px; }
.auth-submit { width: 100%; margin-top: 3px; }
.auth-links { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 18px; color: var(--subtle); font-size: 11px; }
.auth-links button { padding: 4px; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.auth-links button:hover { color: #fff; }

.app-topbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; width: min(1420px,100%); min-height: 46px; margin: 0 auto 22px; }
.app-topbar .api-status { margin-right: auto; }
.account-area { display: flex; align-items: center; gap: 8px; }
.credit-pill { display: flex; min-height: 40px; align-items: center; gap: 9px; padding: 6px 11px; border: 1px solid #234f7a; border-radius: 10px; background: rgba(18,63,109,.2); color: #fff; }
.credit-pill span { color: #8faeca; font: 600 8px "IBM Plex Mono",monospace; letter-spacing: .1em; }
.credit-pill strong { min-width: 24px; font: 600 16px "IBM Plex Mono",monospace; text-align: center; }
.buy-credits-button { min-height: 40px; padding: 7px 13px; border: 1px solid #234f7a; border-radius: 10px; background: #123f6d; color: #fff; font-size: 11px; font-weight: 700; }
.buy-credits-button:hover { background: #0b2f55; }
.logout-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--muted); }
.logout-button:hover { border-color: var(--border-strong); color: #fff; }
.logout-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

body.modal-open { overflow: hidden; }
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 22px; overflow-y: auto; background: rgba(0,0,0,.82); backdrop-filter: blur(8px); }
.paywall-modal { position: relative; width: min(1180px,100%); max-height: calc(100dvh - 44px); overflow-y: auto; padding: 30px; border: 1px solid var(--border-strong); border-radius: 20px; outline: none; background: #0b0b0d; box-shadow: 0 28px 100px rgba(0,0,0,.68); }
.modal-close { position: absolute; top: 18px; right: 18px; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: #111113; color: var(--muted); font-size: 24px; line-height: 1; }
.modal-close:hover { color: #fff; border-color: var(--border-strong); }
.paywall-header { max-width: 680px; margin-bottom: 25px; }
.paywall-header h2 { margin: 7px 0 8px; font: 700 clamp(28px,4vw,42px)/1.08 "Sora",sans-serif; letter-spacing: -.05em; }
.paywall-header p { margin: 0; color: var(--muted); }
.paywall-header p strong { color: var(--text); }
.pricing-sections { display: grid; gap: 25px; }
.pricing-section { display: grid; gap: 12px; }
.pricing-section + .pricing-section { padding-top: 23px; border-top: 1px solid var(--border); }
.pricing-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.pricing-section-heading > div > span { color: #6f9bc4; font: 600 8px "IBM Plex Mono",monospace; letter-spacing: .13em; }
.pricing-section-heading h3 { margin: 3px 0 0; font: 700 19px "Sora",sans-serif; letter-spacing: -.035em; }
.pricing-section-heading p { max-width: 520px; margin: 0; color: var(--muted); font-size: 10px; text-align: right; }
.pricing-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.price-card { position: relative; display: flex; min-width: 0; flex-direction: column; padding: 20px; border: 1px solid var(--border); border-radius: 15px; background: #111113; }
.price-card.is-featured { border-color: #315e89; background: linear-gradient(160deg,rgba(18,63,109,.34),#111113 56%); box-shadow: inset 0 0 0 1px rgba(95,143,189,.14); }
.popular-badge { position: absolute; top: 14px; right: 14px; padding: 5px 7px; border-radius: 6px; background: #123f6d; color: #fff; font: 600 7px "IBM Plex Mono",monospace; letter-spacing: .08em; }
.plan-kicker { color: #6f9bc4; font: 600 8px "IBM Plex Mono",monospace; letter-spacing: .12em; }
.price-card h3 { margin: 13px 0 5px; font: 700 20px "Sora",sans-serif; }
.price-card h3 small { display: block; margin-top: 5px; color: var(--muted); font: 500 10px/1.4 "IBM Plex Mono",monospace; letter-spacing: .01em; }
.plan-price { display: flex; min-height: 52px; align-items: baseline; gap: 4px; margin: 5px 0 8px; }
.plan-price small { color: var(--muted); font-weight: 700; }
.plan-price strong { font: 700 31px "Sora",sans-serif; letter-spacing: -.05em; }
.plan-price em { color: var(--subtle); font-size: 9px; font-style: normal; }
.price-card > p { min-height: 48px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.price-card ul { display: grid; gap: 8px; margin: 16px 0 19px; padding: 15px 0 0; border-top: 1px solid var(--border); list-style: none; color: #c7c7cc; font-size: 10px; }
.price-card li::before { margin-right: 7px; color: #6f9bc4; content: "✓"; }
.price-card > button { min-height: 44px; margin-top: auto; border: 1px solid #315e89; border-radius: 9px; background: #123f6d; color: #fff; font-size: 11px; font-weight: 700; }
.price-card > button:hover { background: #0b2f55; }
.price-card > button:disabled { opacity: .42; }
.discount-badge { align-self: flex-start; margin: -4px 0 7px; padding: 5px 8px; border: 1px solid #315e89; border-radius: 999px; background: rgba(18,63,109,.28); color: #d7e6f4; font: 600 8px/1.3 "IBM Plex Mono",monospace; letter-spacing: .06em; }
.starter-card { display: grid; grid-template-columns: minmax(230px,1.2fr) auto minmax(220px,.9fr) minmax(180px,.75fr); align-items: center; gap: 22px; padding: 17px 20px; border-color: rgba(255,255,255,.16); }
.starter-main h3 { margin: 7px 0 4px; }
.starter-main p { max-width: 440px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.starter-card .plan-price { min-width: 190px; margin: 0; }
.starter-card .plan-price em { display: block; max-width: 70px; line-height: 1.3; }
.starter-card ul { margin: 0; padding: 0 0 0 20px; border-top: 0; border-left: 1px solid var(--border); }
.starter-card > button { width: 100%; margin: 0; }
.paywall-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); }
.paywall-footer span { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.paywall-footer svg { width: 15px; height: 15px; fill: none; stroke: #6f9bc4; stroke-width: 1.7; }
.paywall-footer small { color: var(--subtle); font-size: 9px; text-align: right; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 214px; }
  .main-content { padding: 28px 24px 48px; }
  .search-grid { grid-template-columns: 1fr; }
  .lead-filters { grid-template-columns: 1fr 180px; }
  .filter-chips { grid-column: 1 / -1; grid-row: 2; }
  .lead-table-header { display: none; }
  .lead-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .lead-row { grid-template-columns: 1fr 110px; gap: 12px; min-height: 0; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); }
  .lead-company { grid-column: 1 / -1; }
  .lead-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .pricing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .starter-card { grid-template-columns: 1fr auto; }
  .starter-card ul { padding: 14px 0 0; border-top: 1px solid var(--border); border-left: 0; }
}

@media (max-width: 820px) {
  .sidebar { display: none; }
  .mobile-header { position: sticky; top: 0; z-index: 1000; display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 16px; border-bottom: 1px solid var(--border); background: rgba(8,8,8,.97); }
  .brand-mobile { min-height: 0; padding: 0; }
  .brand-mobile .brand-mark { width: 34px; height: 34px; }
  .mobile-nav { display: flex; gap: 4px; }
  .mobile-nav-button { min-height: 40px; padding: 7px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; }
  .mobile-nav-button.is-active { border-color: var(--border); background: var(--surface-raised); color: var(--text); }
  .main-content { margin-left: 0; padding: 24px 16px 42px; }
  .page-header { align-items: flex-start; }
  .map-frame { height: 225px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-list { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { padding: 24px; }
  .app-topbar { align-items: stretch; flex-wrap: wrap; }
  .app-topbar .api-status { margin-right: 0; }
  .account-area { margin-left: auto; }
}

@media (max-width: 560px) {
  body { font-size: 14px; }
  .brand-copy { display: none; }
  .main-content { padding-inline: 12px; }
  .page-header { display: grid; gap: 14px; }
  .header-actions { justify-content: stretch; }
  .header-actions > * { flex: 1 1 auto; }
  .page-header h1 { font-size: 25px; }
  .location-panel, .niche-panel, .config-panel { padding: 15px; }
  .location-summary { display: none; }
  .map-frame { height: 200px; }
  .search-action-bar { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 66px; padding: 12px; }
  .stat-card strong { font-size: 20px; }
  .lead-filters { grid-template-columns: 1fr; }
  .filter-chips { grid-column: auto; grid-row: auto; overflow-x: auto; }
  .lead-row { grid-template-columns: 1fr; }
  .lead-company, .lead-actions { grid-column: auto; }
  .lead-actions { justify-content: flex-start; }
  .selection-bar { align-items: stretch; flex-direction: column; }
  .selection-bar .danger-button { width: 100%; }
  .app-topbar .api-status { display: none; }
  .account-area { width: 100%; }
  .credit-pill { flex: 1; justify-content: center; }
  .buy-credits-button { flex: 1.4; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pricing-section-heading p { text-align: left; }
  .starter-card { grid-template-columns: 1fr; gap: 12px; }
  .starter-card .plan-price { min-width: 0; }
  .starter-card .plan-price em { max-width: none; }
  .paywall-modal { padding: 24px 15px 18px; }
  .paywall-header { padding-right: 42px; }
  .paywall-footer { align-items: flex-start; flex-direction: column; }
  .paywall-footer small { text-align: left; }
  .toast { right: 16px; bottom: 16px; left: 16px; }
}

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