:root {
  --ink: #14231f;
  --muted: #6d7872;
  --paper: #f5f2e9;
  --surface: #fffdf8;
  --line: #dcd9cf;
  --pine: #164b3b;
  --pine-dark: #0b3026;
  --lime: #cce862;
  --coral: #ff6a4d;
  --gold: #f0b849;
  --blue: #5a8dee;
  --shadow: 0 18px 50px rgba(25, 48, 40, 0.14);
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.app-shell { height: 100%; display: grid; grid-template-rows: 76px 1fr; }
.topbar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 22px;
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 202px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; color: var(--pine); }
.brand-mark svg { width: 42px; height: 42px; }
.brand > span:last-child { display: flex; align-items: baseline; gap: 5px; font-family: "Bricolage Grotesque", sans-serif; font-size: 19px; letter-spacing: -0.7px; }
.brand strong { font-weight: 700; }
.brand em { color: var(--pine); font-style: normal; font-weight: 500; }

.territory-switcher { display: flex; align-items: center; gap: 10px; min-width: 172px; padding: 8px 12px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.territory-switcher small, .territory-switcher strong { display: block; }
.territory-switcher small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 1px; }
.territory-switcher strong { margin-top: 2px; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4db887; box-shadow: 0 0 0 4px #dbf1e7; }
.chevron { margin-left: auto; color: var(--muted); }

.top-stats { display: flex; align-items: center; justify-content: center; gap: 0; margin-left: auto; }
.top-stats div { min-width: 92px; padding: 2px 18px; border-left: 1px solid var(--line); }
.top-stats strong, .top-stats span { display: block; }
.top-stats strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 18px; }
.top-stats span { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.9px; }
.top-stats .value-stat strong { color: var(--pine); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .quiet-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 10px; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 17px; color: white; background: var(--pine); border: 0; border-radius: 10px; font-size: 12px; font-weight: 700; box-shadow: 0 7px 18px rgba(22, 75, 59, 0.18); }
.primary-button:hover { background: var(--pine-dark); }
.primary-button span { font-size: 17px; line-height: 0; }
.avatar { width: 38px; height: 38px; color: var(--pine); background: var(--lime); border: 0; border-radius: 50%; font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; }
.discover-button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; color: var(--pine); background: #e5f1e8; border: 1px solid #c9dfcf; border-radius: 10px; font-size: 11px; font-weight: 700; }
.discover-button span { color: var(--coral); }

.workspace { min-height: 0; height: calc(100vh - 76px); display: grid; grid-template-columns: 352px minmax(0, 1fr); }
.lead-panel { position: relative; z-index: 600; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface); border-right: 1px solid var(--line); transition: width 0.25s ease, transform 0.25s ease; }
.lead-panel.collapsed { width: 0; overflow: hidden; transform: translateX(-100%); }
.workspace:has(.lead-panel.collapsed) { grid-template-columns: 0 minmax(0, 1fr); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 23px 22px 15px; }
.eyebrow { margin: 0 0 4px; color: var(--coral); font-size: 9px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Bricolage Grotesque", sans-serif; }
.panel-heading h1 { margin-bottom: 0; font-size: 25px; letter-spacing: -1px; }
.quiet-icon { width: 34px; height: 34px; font-size: 24px; }
.search-box { display: flex; align-items: center; gap: 9px; margin: 0 18px; padding: 10px 12px; background: #f3f2ed; border: 1px solid transparent; border-radius: 10px; }
.search-box:focus-within { border-color: var(--pine); background: white; }
.search-box svg { width: 17px; color: var(--muted); }
.search-box input { min-width: 0; flex: 1; background: transparent; border: 0; outline: none; font-size: 12px; }
.search-box kbd { padding: 2px 5px; color: #8e9691; background: white; border: 1px solid var(--line); border-radius: 4px; font: 9px "Manrope"; }
.pipeline-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin: 17px 18px 13px; border-bottom: 1px solid var(--line); }
.pipeline-tabs button { position: relative; padding: 9px 2px 12px; color: var(--muted); background: transparent; border: 0; font-size: 10px; font-weight: 700; }
.pipeline-tabs button.active { color: var(--pine); }
.pipeline-tabs button.active::after { position: absolute; right: 5px; bottom: -1px; left: 5px; height: 2px; background: var(--pine); content: ""; }
.pipeline-tabs span { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 2px; color: white; background: var(--pine); border-radius: 8px; font-size: 8px; }
.filter-row { display: flex; gap: 7px; padding: 0 18px; }
.filter-select { position: relative; display: grid; flex: 1; gap: 1px; padding: 4px 8px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 7px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.filter-select select { width: 100%; padding: 0 18px 0 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 10px; font-weight: 700; text-transform: none; cursor: pointer; }
.filter-select:focus-within { border-color: var(--pine); box-shadow: 0 0 0 2px rgba(22,75,59,.1); }
.filter-button, .sort-button { padding: 7px 10px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 600; }
.sort-button { width: 34px; }
.list-meta { display: flex; justify-content: space-between; padding: 14px 20px 8px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.7px; }
.list-meta span:last-child { display: flex; align-items: center; gap: 5px; }
.list-meta i { width: 6px; height: 6px; background: #4db887; border-radius: 50%; }
.lead-list { min-height: 0; flex: 1 1 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 2px 11px 80px; scrollbar-width: thin; scrollbar-color: #9eaaa3 transparent; }
.lead-list::-webkit-scrollbar { width: 9px; }.lead-list::-webkit-scrollbar-thumb { background: #c1c9c4; border: 2px solid transparent; border-radius: 10px; background-clip: padding-box; }
.lead-card { position: relative; display: grid; grid-template-columns: 43px 1fr auto; gap: 11px; width: 100%; padding: 12px 10px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 13px; text-align: left; transition: 0.16s ease; }
.lead-card:hover { background: #f5f5ef; }
.lead-card.active { background: #edf4ec; border-color: #cbdcca; box-shadow: inset 3px 0 var(--pine); }
.score-ring { display: grid; place-items: center; width: 41px; height: 41px; border: 4px solid var(--score-color); border-radius: 50%; background: white; font-family: "Bricolage Grotesque", sans-serif; font-size: 11px; font-weight: 700; }
.lead-main { min-width: 0; }
.lead-main strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.lead-main small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.lead-tags { display: flex; gap: 5px; margin-top: 7px; }
.tag { padding: 3px 6px; color: var(--pine); background: #e1eee5; border-radius: 5px; font-size: 7px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.tag.source { color: #9a5b1e; background: #fff0d2; }
.lead-value { color: var(--pine); font-family: "Bricolage Grotesque", sans-serif; font-size: 11px; font-weight: 700; }
.lead-arrow { position: absolute; right: 11px; bottom: 12px; color: #a4aaa6; font-size: 15px; }

.map-stage { position: relative; min-width: 0; overflow: hidden; background: #dfe7dc; }
#map { position: absolute; inset: 0; z-index: 1; background: transparent; }
.leaflet-container { background: #dfe7dc; }
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas { position: absolute; top: 0; left: 0; }
.leaflet-container { overflow: hidden; }
.leaflet-container .leaflet-tile { max-width: none !important; max-height: none !important; }
.leaflet-marker-icon, .leaflet-marker-shadow { display: block; user-select: none; -webkit-user-drag: none; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; }
.leaflet-right { right: 0; }
.leaflet-bottom { bottom: 0; }
.leaflet-left { left: 0; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; }
.leaflet-left .leaflet-control { float: left; clear: both; margin-left: 10px; }
.leaflet-right .leaflet-control { float: right; clear: both; margin-right: 10px; }
.leaflet-top .leaflet-control { margin-top: 10px; }
.leaflet-bottom .leaflet-control { margin-bottom: 10px; }
.leaflet-control-layers { min-width: 42px; padding: 6px; color: var(--ink); background: rgba(255, 253, 248, 0.96); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); font-size: 11px; line-height: 1.65; }
.leaflet-control-layers-toggle { display: block; width: 30px; height: 30px; color: var(--pine); text-align: center; cursor: pointer; }
.leaflet-control-layers-toggle::after { content: "◫"; font: 700 20px/30px "Manrope"; }
.leaflet-control-layers-list { display: none; }
.leaflet-control-layers-expanded { min-width: 170px; padding: 10px 12px; }
.leaflet-control-layers-expanded .leaflet-control-layers-toggle { display: none; }
.leaflet-control-layers-expanded .leaflet-control-layers-list { display: block; }
.leaflet-control-layers label { display: block; cursor: pointer; white-space: nowrap; }
.leaflet-control-layers input { margin-right: 7px; accent-color: var(--pine); }
.leaflet-control-layers-separator { display: block; height: 1px; margin: 6px 0; background: var(--line); }
.leaflet-geography-pane { z-index: 200 !important; pointer-events: none !important; }
.leaflet-leadMarkers-pane { z-index: 700 !important; pointer-events: none; }
.leaflet-leadMarkers-pane .leaflet-marker-icon { pointer-events: auto; }
.map-stage.leaflet-ready .territory-art, .map-stage.leaflet-ready .fallback-marker-layer { display: none; }
#map .leaflet-control-container { display: block; }
.territory-art { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #e8eee5; }
.territory-art svg { width: 100%; height: 100%; }
.territory-art .park, .territory-overlay .park { fill: #cedfc8; opacity: .72; }
.territory-art .water-glow, .territory-overlay .water-glow { fill: none; stroke: #bcdedb; stroke-width: 58; opacity: .75; filter: url(#softGlow); }
.territory-art .water, .territory-overlay .water { fill: none; stroke: #b4d7d5; stroke-width: 34; opacity: .9; }
.territory-art .arteries path, .territory-overlay .arteries path { fill: none; stroke: #fffdf8; stroke-width: 8; }
.territory-art .arteries path:nth-child(2n), .territory-overlay .arteries path:nth-child(2n) { stroke: #f4d59a; stroke-width: 6; }
.territory-art .local-roads path, .territory-overlay .local-roads path { fill: none; stroke: #c7d1cb; stroke-width: 2.2; opacity: .9; }
.territory-art .place-labels text, .territory-overlay .place-labels text { fill: #5f746b; font: 700 18px "Manrope", sans-serif; letter-spacing: 2px; opacity: .78; }
.territory-art .road-labels text, .territory-overlay .road-labels text { fill: #9c7d47; font: 700 10px "Manrope", sans-serif; letter-spacing: 1px; }
.fallback-marker-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.fallback-marker { position: absolute; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: white; background: var(--marker-color); border: 3px solid white; border-radius: 50% 50% 50% 12%; box-shadow: 0 5px 18px rgba(14,42,33,.28); transform: translate(-50%, -50%) rotate(-45deg); pointer-events: auto; transition: transform .18s ease, box-shadow .18s ease; }
.fallback-marker::after { width: 8px; height: 8px; background: white; border-radius: 50%; content: ""; }
.fallback-marker:hover, .fallback-marker.selected { z-index: 5; transform: translate(-50%, -50%) rotate(-45deg) scale(1.25); box-shadow: 0 0 0 7px rgba(255,255,255,.58), 0 8px 20px rgba(14,42,33,.35); }
.leaflet-control-zoom { overflow: hidden; border: 0 !important; border-radius: 10px !important; box-shadow: var(--shadow) !important; }
.leaflet-control-zoom a { color: var(--ink) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { font-size: 8px !important; }
.lead-marker { position: relative; display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid white; border-radius: 50% 50% 50% 10px; background: var(--marker-color); box-shadow: 0 5px 14px rgba(14, 42, 33, 0.28); transform: rotate(-45deg); transition: transform 0.15s ease; }
.lead-marker::after { width: 8px; height: 8px; background: white; border-radius: 50%; content: ""; }
.lead-marker.selected { z-index: 5; transform: rotate(-45deg) scale(1.28); box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.56), 0 8px 20px rgba(14, 42, 33, 0.35); }
.cluster-marker { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--pine); border: 4px solid rgba(255, 255, 255, 0.78); border-radius: 50%; font: 700 12px "Bricolage Grotesque"; box-shadow: 0 5px 18px rgba(14, 42, 33, 0.3); }

.genius-bar { position: absolute; z-index: 500; top: 18px; left: 50%; display: grid; grid-template-columns: auto 145px minmax(180px, 420px) 37px; align-items: center; width: min(720px, calc(100% - 170px)); padding: 7px 8px 7px 14px; background: rgba(255, 253, 248, 0.96); border: 1px solid rgba(255,255,255,.8); border-radius: 14px; box-shadow: var(--shadow); transform: translateX(-50%); backdrop-filter: blur(14px); }
.genius-spark { margin-right: 9px; color: var(--coral); font-size: 17px; }
.genius-bar label { color: var(--pine); font-family: "Bricolage Grotesque", sans-serif; font-size: 12px; font-weight: 700; }
.genius-bar input { min-width: 0; padding: 7px 10px; background: transparent; border: 0; border-left: 1px solid var(--line); outline: none; font-size: 11px; }
.genius-bar button { width: 34px; height: 34px; color: white; background: var(--coral); border: 0; border-radius: 9px; font-size: 18px; }
.map-tools { position: absolute; z-index: 500; top: 18px; right: 18px; display: flex; overflow: hidden; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); }
.map-tools button { width: 39px; height: 39px; background: transparent; border: 0; border-left: 1px solid var(--line); font-size: 17px; }
.map-tools button:first-child { border-left: 0; }
.map-legend { position: absolute; z-index: 500; right: 18px; bottom: 25px; display: flex; gap: 15px; padding: 9px 13px; background: rgba(255,253,248,.92); border-radius: 9px; box-shadow: 0 8px 26px rgba(25, 48, 40, 0.12); font-size: 9px; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.hot { background: var(--coral); }.legend-dot.warm { background: var(--gold); }.legend-dot.cool { background: var(--blue); }
.sync-card { position: absolute; z-index: 500; bottom: 24px; left: 20px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 13px; background: rgba(255,253,248,.94); border-radius: 12px; box-shadow: var(--shadow); }
.sync-icon { display: grid; place-items: center; width: 31px; height: 31px; color: var(--pine); background: #dff0e7; border-radius: 8px; }
.sync-card strong, .sync-card small { display: block; }
.sync-card strong { font-size: 10px; }.sync-card small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.sync-card button { padding: 7px 9px; color: var(--pine); background: transparent; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; font-weight: 700; }
.empty-detail { position: absolute; z-index: 400; right: 30px; top: 90px; width: 260px; padding: 22px; background: rgba(22, 75, 59, 0.92); color: white; border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.empty-detail span { color: var(--lime); font: 600 10px "Bricolage Grotesque"; letter-spacing: 1px; }
.empty-detail h2 { margin: 16px 0 7px; font-size: 20px; }.empty-detail p { margin-bottom: 0; color: #d9e7e1; font-size: 10px; line-height: 1.65; }

.detail-drawer { position: absolute; z-index: 700; top: 0; right: 0; bottom: 0; width: 460px; overflow-y: auto; padding: 28px 26px 90px; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 50px rgba(25,48,40,.12); transform: translateX(104%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.detail-drawer.open { transform: translateX(0); }
.drawer-close { display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted); background: #f1efe8; border: 0; border-radius: 50%; font-size: 21px; }
.detail-drawer > .drawer-close { position: absolute; top: 20px; right: 20px; }
.detail-kicker { display: flex; gap: 6px; margin-bottom: 13px; }
.detail-kicker span { padding: 5px 7px; color: var(--pine); background: #e4eee6; border-radius: 5px; font-size: 8px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.detail-kicker .intent { color: #a23d28; background: #ffe2db; }
.detail-kicker .crm-ready { color: #155d42; background: #dff3e8; }
.detail-kicker .needs-data { color: #7c551d; background: #fff1ce; }
.detail-drawer h2 { max-width: 280px; margin-bottom: 5px; font-size: 27px; letter-spacing: -.9px; }
.lead-role { margin-bottom: 17px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.score-banner { display: grid; grid-template-columns: 65px 1fr; gap: 13px; align-items: center; padding: 14px; background: var(--pine); border-radius: 13px; color: white; }
.score-banner .big-score { display: grid; place-items: center; width: 56px; height: 56px; border: 5px solid var(--lime); border-radius: 50%; font: 700 18px "Bricolage Grotesque"; }
.score-banner strong, .score-banner small { display: block; }.score-banner strong { font-size: 11px; }.score-banner small { margin-top: 4px; color: #cfe1da; font-size: 9px; line-height: 1.45; }
.enrichment-state { display: grid; gap: 3px; margin-top: 10px; padding: 10px 12px; color: #7c551d; background: #fff4db; border: 1px solid #ead5aa; border-radius: 10px; }
.enrichment-state.complete { color: var(--pine); background: #e8f3e9; border-color: #c7ddca; }
.enrichment-state strong { font-size: 9px; text-transform: uppercase; letter-spacing: .6px; }.enrichment-state span { font-size: 9px; line-height: 1.45; }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 15px 0; }
.quick-actions button { padding: 10px 4px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: 9px; font-weight: 700; }
.quick-actions button:hover { border-color: var(--pine); color: var(--pine); }
.detail-section { padding: 15px 0; border-top: 1px solid var(--line); }
.section-label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.contact-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 7px; align-items: center; margin: 8px 0; font-size: 10px; }
.contact-row i { display: grid; place-items: center; width: 21px; height: 21px; background: #eef1eb; border-radius: 6px; font-style: normal; }
.contact-row a { overflow: hidden; color: var(--ink); text-overflow: ellipsis; text-decoration: none; white-space: nowrap; }
.contact-row span { color: var(--muted); }
.evidence-list { display: grid; gap: 8px; }
.evidence { padding: 10px 11px; background: #f3f2ec; border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; }
.evidence strong { display: block; font-size: 9px; }.evidence small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.stage-select { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-select button { padding: 7px 9px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 7px; font-size: 8px; font-weight: 700; text-transform: capitalize; }
.stage-select button.active { color: white; background: var(--pine); border-color: var(--pine); }
.data-completeness { display: grid; gap: 7px; margin-top: 10px; padding: 12px; background: #f4f5ef; border: 1px solid var(--line); border-radius: 11px; }
.data-completeness > div:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.data-completeness strong { color: var(--pine); font: 700 18px "Bricolage Grotesque"; }
.data-completeness span, .data-completeness small { color: var(--muted); font-size: 9px; }
.completeness-track { height: 6px; overflow: hidden; background: #dfe4dc; border-radius: 999px; }
.completeness-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--lime), #3a9874); border-radius: inherit; }
.detail-tabs { position: sticky; z-index: 2; top: -28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 14px -4px 0; padding: 8px 4px; background: rgba(250,249,245,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.detail-tabs button { padding: 8px 4px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 8px; font-weight: 800; text-transform: capitalize; }
.detail-tabs button.active { color: white; background: var(--pine); }
[data-detail-panel][hidden] { display: none; }
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.quality-grid div { display: grid; gap: 3px; padding: 9px; background: #f3f2ec; border-radius: 8px; }
.quality-grid strong { color: var(--pine); font-size: 12px; }
.quality-grid span { color: var(--muted); font-size: 7px; text-transform: capitalize; }
.detail-chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.detail-chip-list span { padding: 5px 7px; color: #4e5c56; background: #edf0e9; border: 1px solid #dde3da; border-radius: 999px; font-size: 8px; }
.missing-value { color: #956b2d !important; font-size: 9px; font-style: italic; font-weight: 500 !important; }
.refresh-details, .export-details { width: 100%; margin-top: 10px; }
.data-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.data-field { position: relative; min-width: 0; padding: 9px 10px; background: #f5f4ef; border: 1px solid #e6e4dc; border-radius: 8px; }
.data-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.data-field > strong { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 9px; line-height: 1.4; }
.field-status { display: inline-flex; width: max-content; padding: 2px 5px; color: #7c551d; background: #fff1ce; border-radius: 999px; font-size: 6px !important; font-style: normal; font-weight: 800; text-transform: uppercase; }
.field-status.verified { color: #155d42; background: #dff3e8; }
.field-status.observed { color: #315885; background: #e6eff9; }
.field-status.inferred, .field-status.found { color: #7c551d; background: #fff1ce; }
.data-field .field-status { margin-top: 6px; }
.subsection-label { display: block; margin: 13px 0 7px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.source-evidence-list { display: grid; gap: 8px; }
.source-evidence-list article { padding: 10px; background: #f5f4ef; border: 1px solid #e4e2da; border-radius: 9px; }
.source-evidence-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.source-evidence-list article strong { font-size: 9px; }
.source-evidence-list article p { margin: 6px 0; color: #4f5a55; font-size: 8px; line-height: 1.45; }
.source-evidence-list article small { color: var(--muted); font-size: 7px; }
.provenance-root { display: grid; gap: 5px; margin-top: 10px; padding: 9px; background: #eef1eb; border-radius: 8px; }
.provenance-root span { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.provenance-root code { overflow-wrap: anywhere; font-size: 7px; }
.crm-readiness { margin-top: 10px; padding: 12px; background: #fff7e5; border: 1px solid #ead5aa; border-radius: 10px; }
.crm-readiness.ready { background: #e8f3e9; border-color: #c7ddca; }
.crm-readiness > strong { display: block; margin-bottom: 8px; font-size: 10px; }
.crm-readiness ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.crm-readiness li { color: var(--muted); font-size: 8px; }
.crm-readiness li::before { content: "○"; margin-right: 6px; color: #a68c5f; }
.crm-readiness li.complete { color: var(--pine); }
.crm-readiness li.complete::before { content: "✓"; color: #278262; font-weight: 900; }
.detail-input { display: grid; gap: 5px; margin: 10px 0; }
.detail-input > span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.detail-input input { width: 100%; padding: 9px 10px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 9px; }
.due-toggle { display: flex; align-items: center; gap: 7px; margin: 10px 0; color: var(--muted); font-size: 9px; }
.note-box { width: 100%; min-height: 72px; padding: 10px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; outline: none; font-size: 10px; }
.note-box:focus { border-color: var(--pine); }
.save-note { margin-top: 7px; }
.mobile-list-toggle { display: none; }

.lead-dialog { width: min(650px, calc(100% - 32px)); padding: 0; color: var(--ink); background: var(--surface); border: 0; border-radius: 18px; box-shadow: 0 30px 100px rgba(13,42,33,.35); }
.lead-dialog::backdrop { background: rgba(11, 48, 38, .48); backdrop-filter: blur(4px); }
.lead-dialog form { padding: 25px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; }.dialog-header h2 { margin-bottom: 0; font-size: 25px; }
.dialog-intro { max-width: 460px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.form-grid label { display: grid; gap: 6px; }.form-grid label span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.form-grid input, .form-grid select { width: 100%; padding: 10px 11px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; outline: none; font-size: 11px; }
.form-grid input:focus, .form-grid select:focus { border-color: var(--pine); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.source-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 20px 0 0; padding: 0; border: 0; }
.source-options legend { grid-column: 1 / -1; margin-bottom: 2px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.source-options label { display: flex; gap: 10px; padding: 12px; background: #f3f2ec; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.source-options input { accent-color: var(--pine); }
.source-options strong, .source-options small { display: block; }.source-options strong { font-size: 10px; }.source-options small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.scrape-status { align-items: center; gap: 11px; margin-top: 15px; padding: 12px; color: var(--pine); background: #e7f1e9; border-radius: 10px; }
.scrape-status:not([hidden]) { display: flex; }
.scrape-status strong, .scrape-status small { display: block; }.scrape-status strong { font-size: 10px; }.scrape-status small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.scrape-spinner { width: 22px; height: 22px; border: 3px solid #bdd8c5; border-top-color: var(--pine); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.secondary-button { padding: 10px 15px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 700; }
.toast { position: fixed; z-index: 2000; left: 50%; bottom: 26px; padding: 11px 16px; color: white; background: var(--pine-dark); border-radius: 10px; box-shadow: var(--shadow); font-size: 10px; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .top-stats div { min-width: 76px; padding: 2px 11px; }
  .top-actions .icon-button { display: none; }
  .workspace { grid-template-columns: 310px minmax(0,1fr); }
  .genius-bar { left: 20px; width: calc(100% - 150px); transform: none; }
  .genius-bar label { display: none; }
  .genius-bar { grid-template-columns: auto 1fr 37px; }
  .genius-bar input { border-left: 0; }
}

@media (max-width: 820px) {
  html, body { overflow: hidden; }
  .app-shell { grid-template-rows: 64px 1fr; }
  .topbar { gap: 12px; padding: 0 13px; }
  .brand { min-width: 0; }.brand > span:last-child { display: none; }.brand-mark { width: 38px; }
  .territory-switcher { min-width: 145px; }.territory-switcher small { display: none; }
  .top-stats { display: none; }
  .top-actions { margin-left: auto; }.top-actions .primary-button { padding: 10px; font-size: 0; }.top-actions .primary-button span { font-size: 20px; }.avatar { display: none; }
  .top-actions .discover-button { padding: 10px; font-size: 0; }.top-actions .discover-button span { font-size: 16px; }
  .workspace { display: block; }
  .lead-panel { position: absolute; z-index: 900; top: 64px; right: 0; bottom: 0; left: 0; width: 100%; transform: translateY(104%); }
  .lead-panel.mobile-open { transform: translateY(0); }
  .workspace { height: calc(100vh - 64px); }
  .map-stage { height: 100%; }
  .genius-bar { top: 13px; right: 13px; left: 13px; width: auto; }
  .map-tools { top: 70px; right: 13px; flex-direction: column; }
  .map-tools button { border-top: 1px solid var(--line); border-left: 0; }
  .map-tools button:first-child { border-top: 0; }
  .empty-detail, .map-legend, .sync-card { display: none; }
  .detail-drawer { width: 100%; top: 14%; border-radius: 20px 20px 0 0; }
  .mobile-list-toggle { position: absolute; z-index: 650; bottom: 25px; left: 50%; display: block; transform: translateX(-50%); }
  .mobile-list-toggle button { padding: 11px 17px; color: white; background: var(--pine); border: 0; border-radius: 20px; box-shadow: var(--shadow); font-size: 11px; font-weight: 700; }
  .form-grid { grid-template-columns: 1fr; max-height: 55vh; overflow-y: auto; }
  .source-options { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .territory-switcher { min-width: 0; flex: 1; }.territory-switcher .status-dot, .territory-switcher .chevron { display: none; }
  .genius-bar input::placeholder { color: transparent; }
  .detail-drawer { padding-right: 19px; padding-left: 19px; }
}

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