/* Lead research sits inside the shared CRM shell. */
.leads-view-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}
.leads-view-header h1{font-size:24px;line-height:1.25;margin:0}
.leads-view-header p{color:var(--ink-muted);font-size:13px;margin:6px 0 0}
.leads-view-switch{display:flex;gap:4px;padding:4px;border:1px solid var(--rule);border-radius:10px;background:var(--shell)}
.leads-view-switch a{padding:7px 18px;border-radius:7px;color:var(--ink-muted);font-size:13px;text-decoration:none}
.leads-view-switch a:hover{background:var(--surface)}
.leads-view-switch a[aria-current]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px #0001}
.lead-map{--rail-width:220px;--settings-width:320px;box-sizing:border-box;height:clamp(420px,calc(100dvh - 235px),1000px);flex:none;border:1px solid var(--rule);border-radius:16px;background:var(--surface);color:var(--ink)}
.lead-map .map-toolbar{height:58px;min-height:58px;margin:0;padding:10px 16px;border-bottom:1px solid var(--rule);background:var(--surface)}
.lead-map .graph-search{flex:1;min-width:0;margin:0}
.lead-map .graph-search input{width:100%;font-size:13px;min-height:36px;padding:8px 12px;background:var(--shell)}
.lead-map .map-toolbar button,.lead-map #map-open-settings{min-height:34px;padding:7px 12px;font-size:12px;border-radius:8px}
.lead-map .map-library{top:0;padding:14px 10px;background:var(--shell)}
.lead-map .map-workspace-title{height:auto;min-height:28px;padding:0 8px 10px;font-size:13px;margin:0 0 8px}
.lead-map .map-scope{flex:none;padding:0 8px 10px;font-size:12px}
.lead-map .library-folder,.lead-map .library-node,.lead-map .library-view{font-size:12px;padding:8px;border-radius:8px;line-height:1.4}
.lead-map .library-folder small,.lead-map .library-node small,.lead-map .graph-sort,.lead-map .graph-sort select{font-size:11px}
.lead-map .graph-sort{display:block;margin:4px 0 6px;padding:8px;border-top:1px solid var(--rule);color:var(--ink-muted)}
.lead-map .graph-sort span{display:block;margin:0 0 5px;font-size:10px}
.lead-map .graph-sort select{width:100%;max-width:none;min-height:30px;padding:5px 26px 5px 8px;border:1px solid var(--rule);border-radius:7px;background:var(--surface);color:var(--ink)}
.lead-map .library-node:hover,.lead-map .library-folder:hover{background:var(--surface)}
.lead-map .library-node[aria-current],.lead-map .library-folder[aria-pressed=true],.lead-map .map-view-choice[aria-pressed=true]{background:var(--surface);color:var(--ink)}
.lead-map .map-inspector{top:16px;right:16px;bottom:auto;width:300px;max-width:calc(100% - var(--rail-width) - 32px);max-height:calc(100% - 90px);padding:22px;border:1px solid var(--rule);border-radius:14px;background:var(--surface);color:var(--ink);box-shadow:0 8px 30px #0000000a;box-sizing:border-box}
.lead-map .map-inspector p,.lead-map .map-relationship small{font-size:12px;color:var(--ink-muted)}
.lead-map .map-inspector a{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.lead-map .map-camera,.lead-map .map-legend{background:var(--surface);border:1px solid var(--rule);border-radius:10px;color:var(--ink-muted)}
.lead-map .map-camera button{color:var(--ink);font-size:12px}
.lead-map .map-footer{font-size:11px;min-height:40px;box-sizing:border-box}
.lead-map .map-coverage{font-size:11px;padding:12px 16px}
.lead-map .map-coverage[open]{padding:18px;line-height:1.6;border-radius:12px;box-shadow:0 8px 28px #0001}
.lead-map .map-settings{background:var(--surface)}
.lead-map .map-settings>header{height:58px;padding:0 20px;background:var(--surface)}
.lead-map .map-settings-content{padding:20px}
.lead-map .map-settings label,.lead-map .map-settings select,.lead-map .map-settings p{font-size:12px}
.lead-map .map-settings label{margin:16px 0;gap:8px}
.lead-map .map-settings input[type=range]{accent-color:var(--ink)}
.lead-map .map-settings output{color:var(--ink-muted)}
.lead-map :is(button,a,input,select,summary):focus-visible{outline-color:var(--ink)}
@media(max-width:1100px){.lead-map{--rail-width:190px;--settings-width:290px}.lead-map.settings-open{padding-right:0}.lead-map .map-settings{z-index:12;box-shadow:-8px 0 28px #0001}}
@media(max-width:650px){.leads-view-header p{display:none}.lead-map{--rail-width:140px;height:660px}.lead-map .map-toolbar{height:58px;padding:8px;gap:8px}.lead-map .map-library{padding:10px 5px}.lead-map .map-inspector{top:12px;right:10px;bottom:auto;max-width:calc(100% - 20px);width:300px;max-height:calc(100% - 80px)}.lead-map .map-settings{top:0;bottom:0;height:auto;width:min(320px,100%)}.lead-map.settings-open .map-stage{margin-bottom:0}.lead-map .map-camera{left:150px;max-width:calc(100% - 160px);flex-wrap:wrap}.lead-map .map-footer{padding-right:16px}.lead-map .map-coverage{bottom:40px}.lead-map .map-footer #map-status{font-size:10px}}
.lead-map .map-settings .map-filter-panel{position:static;width:auto;max-width:none;padding:0;border:0;box-shadow:none;background:transparent}
.lead-map .map-settings .map-data-filters{padding-bottom:16px;margin-bottom:20px;border-bottom:1px solid var(--rule)}
.lead-map .map-settings .map-data-filters summary{font-size:13px;font-weight:600}

.lead-map .map-library{overflow-y:auto}.lead-map .map-library>.library-nodes{flex:0 0 auto;min-height:80px;overflow:visible}.lead-map .library-folder{padding:5px 8px}

.lead-fit-guide{border-top:1px solid var(--rule);margin-top:16px;padding-top:16px;font-size:12px}
.lead-fit-guide summary{align-items:center;cursor:pointer;display:flex;gap:8px;justify-content:space-between;list-style:none}
.lead-fit-guide summary::-webkit-details-marker{display:none}
.lead-fit-guide summary::after{align-items:center;border:1px solid var(--rule-strong);border-radius:6px;color:var(--ink-muted);content:'+';display:inline-flex;font-size:14px;height:20px;justify-content:center;line-height:1;width:20px}
.lead-fit-guide[open] summary::after{content:'−'}
.lead-fit-guide p{color:var(--ink-muted);line-height:1.6;margin-top:12px}

.map-highlights{flex-shrink:0;padding:4px 8px 8px;color:var(--ink-muted);font-size:12px}.map-highlights summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;padding:7px 0}.map-highlights summary::-webkit-details-marker{display:none}.map-highlights summary:after{content:'+';display:grid;place-items:center;width:18px;height:18px;border:1px solid var(--rule);border-radius:6px;color:var(--ink-muted);font-size:13px;line-height:1}.map-highlights[open] summary{margin-bottom:4px}.map-highlights[open] summary:after{content:'−'}.lead-map .map-settings .map-filter-panel .settings-check{justify-content:flex-start;gap:8px}
.lead-map .map-primary-link,.lead-map .map-lead-card{background:var(--shell);border:1px solid var(--rule);color:var(--ink);border-radius:8px}
.lead-map .map-inspector .map-eyebrow,.lead-map .map-lead-card summary{color:var(--ink-muted)}

/* Graph is the workspace canvas; navigation and research controls float above it. */
body:has(.lead-map){--graph-left:272px;--graph-top:0px;overflow:hidden}
body:has(.lead-map):has(.open-auth-banner){--graph-top:38px}
body:has(.lead-map) .app,body:has(.lead-map) .frame{background:transparent}
body:has(.lead-map) main{padding:0;max-width:none}
body:has(.lead-map) .open-auth-banner{position:relative;z-index:50}
body:has(.lead-map) .sidebar{z-index:30;background:color-mix(in srgb,var(--shell) 94%,transparent);backdrop-filter:blur(12px)}
body:has(.lead-map) .topbar{z-index:20;background:transparent;border:0;pointer-events:none}
body:has(.lead-map) .topbar>*{pointer-events:auto}
body:has(.lead-map) .topbar-actions{padding:6px;border:1px solid var(--rule);border-radius:12px;background:var(--surface);box-shadow:0 3px 16px #00000008}
body:has(.lead-map) .leads-view-header{position:fixed;top:calc(var(--graph-top) + 78px);left:var(--graph-left);right:20px;z-index:10;pointer-events:none;margin:0}
body:has(.lead-map) .leads-view-header>div{display:none}
body:has(.lead-map) .leads-view-switch{pointer-events:auto;margin-left:auto;background:var(--surface);box-shadow:0 4px 20px #0000000a}
.lead-map{position:fixed;inset:0;z-index:0;width:100%;height:100dvh;min-height:0;border:0;border-radius:0;overflow:hidden;padding:0;background:var(--surface)}
.lead-map .map-stage{position:absolute;inset:0;width:100%;height:100%;margin:0;background:var(--surface)}
.lead-map .map-stage canvas{width:100%;height:100%;margin:0}
.lead-map .map-toolbar{position:absolute;left:var(--graph-left);top:calc(var(--graph-top) + 78px);right:190px;width:auto;height:46px;min-height:46px;max-width:600px;margin:0;padding:5px 6px;z-index:8;gap:8px;border:1px solid var(--rule);border-radius:12px;background:var(--surface);box-shadow:0 4px 20px #0000000a}
.lead-map .graph-search input{border:0;background:transparent;box-shadow:none}
.lead-map .map-library{inset:calc(var(--graph-top) + 140px) auto auto var(--graph-left);width:220px;max-height:calc(100dvh - var(--graph-top) - 230px);height:480px;border:1px solid var(--rule);border-radius:14px;background:color-mix(in srgb,var(--surface) 96%,transparent);backdrop-filter:blur(12px);box-shadow:0 6px 28px #0000000a;padding:16px 10px}
.lead-map .map-inspector{top:calc(var(--graph-top) + 140px);right:20px;max-height:calc(100dvh - var(--graph-top) - 220px)}
.lead-map .map-camera{left:50%;transform:translateX(-50%);bottom:24px;max-width:calc(100% - 32px);flex-wrap:nowrap;z-index:4;box-shadow:0 4px 20px #0000000a}
.lead-map .map-legend{left:auto;right:20px;bottom:80px;max-width:350px}
.lead-map .map-footer{position:absolute;bottom:24px;left:var(--graph-left);padding:8px 12px;min-height:32px;border:1px solid var(--rule);border-radius:10px;background:var(--surface);z-index:3}
.lead-map .map-coverage{right:20px;bottom:24px;padding:8px 12px;border:1px solid var(--rule);border-radius:10px}
.lead-map.settings-open{padding:0}
.lead-map .map-settings{inset:calc(var(--graph-top) + 140px) 20px 80px auto;width:320px;height:auto;border:1px solid var(--rule);border-radius:14px;box-shadow:0 8px 32px #0002}
.lead-map .map-side-panel{position:absolute;inset:calc(var(--graph-top) + 140px) 20px 80px auto;width:360px;height:auto;z-index:12;overflow:hidden;border:1px solid var(--rule);border-radius:14px;background:var(--surface);color:var(--ink);box-shadow:0 8px 32px #0002}
.lead-map .map-side-panel[hidden]{display:none}
.lead-map .map-side-panel>header{height:58px;padding:0 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--rule);box-sizing:border-box}
.lead-map .map-side-panel>header button{min-height:28px;padding:0 5px;border:0;background:none;box-shadow:none;color:var(--ink-muted);font-size:20px}
.lead-map .map-side-panel-content{height:calc(100% - 58px);padding:16px;display:flex;flex-direction:column;box-sizing:border-box}
.lead-map .bill-index-search{display:block;margin:0 0 10px}
.lead-map .bill-index-search input{width:100%;min-height:38px;padding:8px 10px;background:var(--shell);font-size:12px}
.lead-map .map-bill-index .map-scope{padding:4px 2px 10px;font-size:11px}
.lead-map .map-bill-index .library-nodes{margin:0;min-height:0;overflow-y:auto}
.lead-map .map-bill-index .catalog-node{display:grid;grid-template-columns:1fr;gap:3px;padding:10px;border-radius:8px}
.lead-map .map-bill-index .catalog-node strong{font-size:12px;font-weight:600}
.lead-map .map-bill-index .catalog-node span{font-size:11px;color:var(--ink-muted)}
.lead-map.settings-open .map-coverage{right:20px}
.lead-map.settings-open .map-footer #map-status{display:block}
.lead-map #map-message{top:calc(var(--graph-top) + 140px);left:calc(var(--graph-left) + 240px)}
.leads-layout>.filters-rail{position:sticky;top:20px;align-self:start;max-height:calc(100dvh - 40px);overflow-y:auto}
@media(max-width:900px){body:has(.lead-map){--graph-left:16px}.lead-map .map-toolbar{right:174px}.lead-map .map-library{width:190px}.lead-map .map-footer{bottom:80px}.lead-map .map-camera{left:16px;transform:none}.lead-map #map-message{left:220px}.leads-layout>.filters-rail{position:static;max-height:none}}
@media(max-width:650px){.lead-map .map-toolbar{right:160px}.lead-map #map-open-settings{font-size:0;padding:8px}.lead-map #map-open-settings:after{content:'Settings';font-size:12px}.lead-map .map-library{top:calc(var(--graph-top) + 138px);width:170px;max-height:38dvh;padding:12px 8px}.lead-map .map-inspector,.lead-map .map-settings,.lead-map .map-side-panel{top:calc(var(--graph-top) + 138px);right:12px;width:calc(100% - 24px);max-width:none;max-height:calc(100dvh - var(--graph-top) - 220px);z-index:12}.lead-map .map-coverage{bottom:80px;right:12px}.lead-map #map-message{left:16px;top:calc(var(--graph-top) + 138px);max-width:calc(100% - 32px)}.lead-map .map-legend{bottom:126px;right:12px;max-width:180px}.lead-map .map-camera{bottom:20px;left:50%;transform:translateX(-50%)}.lead-map .map-footer{max-width:180px}.lead-map .map-footer #map-status{font-size:10px}}
body:has(.lead-map){position:fixed;inset:0;margin:0;height:100dvh}
body:has(.lead-map) .app{min-height:0;height:calc(100dvh - var(--graph-top))}
.lead-map .map-camera{left:calc(50% + 128px)}
@media(max-width:900px){.lead-map .map-camera{left:16px}}
@media(max-width:650px){.lead-map .map-camera{left:50%}}
/* Both views share the same header anchors; switching only replaces the content. */
body:has(.leads-view-header) .topbar{padding:0 24px}
body:has(.leads-layout) main{padding:16px 20px 64px}
body:has(.leads-layout) .leads-view-header{min-height:46px;margin-bottom:20px}
body:has(.leads-layout) .leads-view-header p{display:none}
body:has(.leads-layout) .leads-view-switch{background:var(--surface);box-shadow:0 4px 20px #0000000a}
body:has(.lead-map) .topbar{border-bottom:1px solid transparent}
body:has(.lead-map) .leads-view-header{min-height:46px}

/* Disclosures use quiet plus/minus controls instead of browser triangles. */
.lead-map :is(.map-legend,.map-coverage,.map-data-filters)>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px}
.lead-map :is(.map-legend,.map-coverage,.map-data-filters)>summary::-webkit-details-marker{display:none}
.lead-map :is(.map-legend,.map-coverage,.map-data-filters)>summary:after{content:'+';display:grid;place-items:center;width:18px;height:18px;flex:0 0 18px;border:1px solid var(--rule);border-radius:6px;color:var(--ink-muted);font-size:13px;line-height:1}
.lead-map :is(.map-legend,.map-coverage,.map-data-filters)[open]>summary:after{content:'−'}
