/* Shared selection for the existing directory and map. No global selectors. */
#company-map .workspace-map-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr);gap:16px;align-items:start}
#company-map .workspace-map-area,#company-map .workspace-map-list-panel{min-width:0}
#company-map .workspace-map-list-panel{border:1px solid var(--studio-line,#e2e7e4);border-radius:10px;background:var(--studio-surface,#fff);padding:14px}
#company-map .workspace-map-list-heading{font-size:16px;font-weight:650;margin:0 0 12px}
#company-map .workspace-map-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#company-map .company-map-toolbar{flex-wrap:wrap;gap:10px}
#company-map .workspace-map-canvas-wrap{position:relative;min-width:0}
#company-map .company-map-canvas{height:clamp(330px,56vh,640px)}
#company-map .workspace-map-empty{position:absolute;inset:0;z-index:450;display:flex;gap:12px;flex-direction:column;align-items:center;justify-content:center;padding:25px;text-align:center;background:var(--studio-bg,#f6f7f6);border:1px solid var(--studio-line,#e2e7e4);border-radius:10px;color:var(--studio-muted,#67716e)}
#company-map .workspace-map-empty[hidden],#company-map [hidden]{display:none!important}
#company-map .workspace-map-list{max-height:430px;overflow-y:auto;overscroll-behavior:contain;margin-bottom:10px}
#company-map .workspace-map-customer{display:grid;gap:4px;padding:10px;border-bottom:1px solid var(--studio-line,#e2e7e4);border-left:3px solid transparent;overflow-wrap:anywhere}
#company-map .workspace-map-customer.is-selected{background:var(--studio-violet-soft,#f4effc);border-left-color:var(--studio-violet,#6d32cc)}
#company-map .workspace-map-select{display:block;border:0;background:transparent;text-align:left;cursor:pointer;padding:3px 0;color:var(--studio-ink,#1d2424);font:inherit;font-weight:650;min-height:32px;overflow-wrap:anywhere}
#company-map .workspace-map-selected{padding:12px;background:var(--studio-blue-soft,#edf2ff);border-radius:8px;margin:0 0 12px}
#company-map .workspace-map-selected h3{margin:0 0 8px;font-size:16px}
#company-map .workspace-map-selected p{margin:0 0 8px;overflow-wrap:anywhere}
#company-map .workspace-map-muted{font-size:12px;line-height:1.5;color:var(--studio-muted,#67716e)}
#company-map .workspace-location{font-size:11px;line-height:1.45;color:var(--studio-muted,#67716e)}
#company-map .workspace-location--address{color:var(--studio-green,#08754f)}
#company-map .workspace-location--missing{color:var(--studio-warning,#805515)}
#company-map .workspace-map-relationship{font-size:11px;color:var(--studio-violet,#6d32cc)}
#company-map .workspace-map-next{font-size:13px;line-height:1.5}
#company-map .workspace-map-source{margin-top:12px;color:var(--studio-muted,#67716e);font-size:11px}
#company-map .workspace-map-source summary{cursor:pointer;padding:5px 0}
#company-map .workspace-map-source a{display:inline-block;margin:4px 12px 4px 0;color:var(--studio-blue,#2457d5)}
#company-map .workspace-map-source p{margin:5px 0}
#company-map .company-map-point{background:#596b6c;border-color:#fff}
#company-map .company-map-point.workspace-point--approximate{background:#fff;border-color:#596b6c;box-shadow:0 0 0 1px #fff}
#company-map .company-map-point.is-active{background:var(--studio-blue,#2457d5)}
#company-map .company-map-point.workspace-point--approximate.is-active{background:#fff;border-color:var(--studio-blue,#2457d5)}
#company-map .company-map-point.is-selected{outline:3px solid var(--studio-violet,#6d32cc);outline-offset:3px}
#company-map :is(button,a):focus-visible{outline:3px solid var(--studio-focus,#2457d5);outline-offset:3px}
.company-directory-filters .workspace-filter-primary,.company-directory-filters .workspace-filter-secondary{display:flex;gap:10px;flex-wrap:wrap;align-items:end;width:100%}
.company-directory-filters .workspace-filter-provenance{width:100%;font-size:12px;color:var(--text2)}
.company-directory-filters .workspace-filter-provenance summary{cursor:pointer;padding:8px 0}
.company-directory-filters .workspace-filter-provenance .workspace-filter-secondary{margin:8px 0}
.company-directory-filters .workspace-filter-hint{font-size:11px;color:var(--text3);margin:6px 0}
@media(max-width:1000px){#company-map .workspace-map-layout{grid-template-columns:minmax(0,1fr)}#company-map .workspace-map-list{max-height:330px}#company-map .company-map-canvas{height:380px;max-height:55vh}}
@media(pointer:coarse){#company-map .workspace-map-select,#company-map .workspace-map-actions button{min-height:44px}#company-map :is(.company-map-open,.company-map-cluster-open){position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:44px;height:44px;min-height:44px}}

/* November 6 proposal: one compact customer workspace, unchanged data semantics. */
.studio-crm .main:has(#pg-kartotek.active) .content{padding-top:12px}
.studio-crm .main:has(#pg-kartotek.active) .studio-section-banner{padding:10px 16px;margin-bottom:12px;border-radius:8px;min-height:44px}
.studio-crm .main:has(#pg-kartotek.active) .studio-section-banner p{display:none}
.studio-crm .main:has(#pg-kartotek.active) .studio-section-banner h1{font-size:22px;line-height:1.25}
.studio-crm .main:has(#pg-kartotek.active) .directory-tabs{margin-bottom:6px;gap:8px}
.studio-crm .main:has(#pg-kartotek.active) .directory-tabs #directory-customers{display:none}
.studio-crm .main:has(#pg-kartotek.active) .directory-tabs #directory-suppliers{font-size:11px}
.studio-crm .main:has(#pg-kartotek.active) .mobile-filter-toggle{min-height:36px;padding-block:4px;font-size:11px}
.studio-crm .main:has(#pg-kartotek.active) .af-bar{padding-block:4px;gap:6px;min-height:0}
.studio-crm .main:has(#pg-kartotek.active) .af-bar:has(.af-empty:not([style*="none"])) {display:none}
.studio-crm .directory-tag-active,.studio-crm .af-clear{font:inherit;font-size:11px;cursor:pointer;min-height:36px;padding:6px 9px;background:transparent;border:1px solid var(--studio-line);border-radius:6px}
.studio-crm .workspace-directory-toolbar{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:6px}
.studio-crm .workspace-directory-toolbar .company-directory-view{margin:0;flex:none}
.studio-crm .directory-quick-tags{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.studio-crm .directory-tag-search{display:flex;gap:8px;align-items:center;font-size:11px;font-weight:600}
.studio-crm .directory-tag-search input{width:155px;max-width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--studio-line);border-radius:6px;background:white;color:var(--studio-ink);font:inherit;font-weight:400}
.studio-crm .directory-tag-choices{display:flex;flex-wrap:wrap;gap:5px}
.studio-crm .directory-tag-choice{padding:7px 9px;border:1px solid var(--studio-line);border-radius:6px;background:white;color:var(--studio-ink);font:inherit;font-size:11px;min-height:40px;cursor:pointer}
.studio-crm .directory-tag-choice.is-active{background:var(--studio-violet-soft);border-color:var(--studio-violet);color:var(--studio-violet)}
.studio-crm .directory-tag-empty,.studio-crm .directory-filter-reason{font-size:11px;color:var(--studio-muted);line-height:1.5}
.studio-crm .directory-filter-reason{margin:5px 0 10px;padding-left:9px;border-left:2px solid var(--studio-violet)}
.studio-crm .studio-directory-filters{margin-bottom:8px}.studio-crm .studio-directory-filters>summary{padding-block:7px;min-height:36px}
.studio-crm #customer-worklists .wl-controls{margin-bottom:10px;gap:5px 10px}
.studio-crm #customer-worklists .wl-primary-filters{width:auto}
.studio-crm #customer-worklists .wl-followup-hint{font-size:10px}
.studio-crm #co-grid{grid-template-columns:repeat(auto-fill,minmax(min(270px,100%),1fr));gap:10px}
.studio-crm #co-grid .co-card{padding:12px 13px}
.studio-crm #co-grid .co-av{width:30px;height:30px;font-size:10px;flex:none}
.studio-crm #co-grid .cc-name{font-size:13px}.studio-crm #co-grid .cc-sub{font-size:11px}
.studio-crm #co-grid .company-commercial-brief{font-size:10px;gap:4px 9px}
.studio-crm #co-grid .directory-card-summary .company-directory-summary{margin:6px 0}
.studio-crm #co-grid .directory-card-summary p{font-size:11px;line-height:1.45;margin:3px 0}
.studio-crm #co-grid .directory-card-more{position:relative;z-index:2;font-size:11px;color:var(--studio-muted)}
.studio-crm #co-grid .directory-card-more summary{cursor:pointer;min-height:32px;display:flex;align-items:center}
.studio-crm #co-grid .directory-card-more summary::before{content:'＋';margin-right:5px}
.studio-crm #co-grid .directory-card-more[open] summary::before{content:'−'}
.studio-crm #co-grid .directory-status-help{font-size:11px;line-height:1.5;margin:6px 0}
.studio-crm #co-grid .directory-match-reason{color:var(--studio-violet);font-size:10px;padding:5px 0;line-height:1.4}
.studio-crm #co-grid .htag-row{margin-block:5px;gap:4px}
.studio-crm #co-grid .nasta{padding:7px 8px;font-size:11px;margin-top:7px}
.studio-crm #co-grid .customer-preview-button{margin-top:6px;font-size:11px;padding:5px 8px;min-height:32px}
.studio-crm .app-loading{align-items:flex-start;justify-content:flex-start;padding:24px 28px 24px calc(var(--studio-nav-width,196px) + 28px)}
.studio-crm .app-loading-card{width:min(880px,100%);padding:16px 20px;border-radius:8px;box-shadow:none;border:1px solid var(--studio-line);border-top:4px solid var(--studio-blue)}
.studio-crm .app-loading-card h2{font-size:22px;margin-bottom:8px}.studio-crm .app-loading-card p{font-size:13px;margin-bottom:0}
#company-map .workspace-map-layout{grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);gap:12px}
#company-map .workspace-map-list-panel{padding:10px}
#company-map .workspace-map-list-heading{font-size:13px;margin-bottom:9px}
#company-map .workspace-map-selected{padding:10px;margin-bottom:8px}
#company-map .workspace-map-selected h3{font-size:14px}
#company-map .workspace-map-customer{padding:7px 8px;gap:2px}
#company-map .workspace-map-signals{display:flex;gap:7px;align-items:center;flex-wrap:wrap;font-size:10px;color:var(--studio-muted)}
#company-map .workspace-priority{display:inline-flex;gap:3px;align-items:center}.workspace-priority i{width:6px;height:6px;border-radius:50%;display:inline-block}
#company-map .workspace-map-status{padding:2px 5px;border-radius:4px;background:var(--studio-blue-soft);color:var(--studio-blue)}
#company-map .workspace-map-status--line{background:var(--studio-violet-soft);color:var(--studio-violet)}
#company-map .workspace-map-tiles-status{font-size:11px;background:#fff7e6;color:#79551a;padding:8px 10px;margin:0;border:1px solid #e8d7b5;border-radius:6px}
#company-map .company-map-canvas{background:#eaf0f0;background-image:linear-gradient(#d9e3e3 1px,transparent 1px),linear-gradient(90deg,#d9e3e3 1px,transparent 1px);background-size:40px 40px}
@media(max-width:1100px){#company-map .workspace-map-layout{grid-template-columns:minmax(0,1.4fr) minmax(260px,1fr)}}
@media(max-width:899px){.studio-crm .app-loading{padding:18px 14px}.studio-crm .directory-quick-tags{width:100%}.studio-crm .workspace-directory-toolbar{gap:6px}#company-map .workspace-map-layout{grid-template-columns:minmax(0,1fr)}#company-map .workspace-map-canvas{height:330px}#company-map .workspace-map-list{max-height:360px}}
@media(max-width:600px){.studio-crm .main:has(#pg-kartotek.active) .content{padding-top:8px}.studio-crm .main:has(#pg-kartotek.active) .studio-section-banner{padding:9px 12px;margin-bottom:8px}.studio-crm .directory-tag-search span{display:none}.studio-crm .directory-tag-search input{width:128px}.studio-crm .directory-tag-choice{padding-inline:7px}.studio-crm .main:has(#pg-kartotek.active) .directory-tabs{margin:0}.studio-crm .main:has(#pg-kartotek.active) .directory-tabs button{min-height:36px}.studio-crm #customer-worklists .wl-primary-filters{gap:0}.studio-crm #customer-worklists .wl-choice{padding-inline:8px}}
@media(pointer:coarse){.studio-crm :is(.directory-tag-active,.directory-tag-choice,.directory-tag-search input,.af-clear),.studio-crm #co-grid :is(.directory-card-more summary,.customer-preview-button,.htag),.studio-crm .main:has(#pg-kartotek.active) :is(.mobile-filter-toggle,.studio-directory-filters>summary){min-height:44px}}
@media(max-width:899px){.studio-crm.studio-authenticated .studio-bottom-nav{grid-template-columns:repeat(5,minmax(0,1fr))}}
#company-map .directory-match-reason{color:var(--studio-violet);font-size:10px;line-height:1.45}

#company-map.workspace-map-offline .company-map-canvas{background:#dcebf0;background-image:none}
#company-map .workspace-map-tiles-status.is-offline{padding:5px 9px;border-color:#d7e4e3;background:#edf4f4;color:#496865;font-size:10px}

/* Command Central customer workspace: geography first, compact work below. */
#company-map .workspace-map-layout{display:flex;flex-direction:column;gap:12px}
#company-map .workspace-map-area,#company-map .workspace-map-list-panel{width:100%}
#company-map .workspace-map-area{border:1px solid var(--studio-line,#dbe4df);border-radius:14px;overflow:hidden;background:var(--studio-surface,#fff)}
#company-map .company-map-canvas{height:clamp(240px,31vh,340px);min-height:240px;border:0;border-radius:0}
#company-map .workspace-map-canvas-wrap{min-height:240px}
#company-map .company-map-toolbar{margin:0;padding:8px 12px;display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--studio-line,#e0e7e3);font-size:11px}
#company-map .company-map-toolbar .btn{min-height:30px;padding:5px 9px;font-size:11px}
#company-map .company-map-caption{margin:0;padding:6px 12px;font-size:10px;line-height:1.35;background:#f7f9f8}
#company-map .workspace-map-area>.workspace-map-source{margin:0;padding:0 12px;font-size:10px}
#company-map .workspace-map-list-panel{padding:0;background:transparent;border:0;border-radius:0}
#company-map .workspace-map-list-heading{font-size:13px;margin:1px 0 8px;color:var(--studio-ink,#223a33)}
#company-map .workspace-map-customer-body{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr);gap:12px;align-items:start}
#company-map .workspace-map-list-column{min-width:0;border:1px solid var(--studio-line,#dbe4df);border-radius:12px;background:var(--studio-surface,#fff);overflow:hidden}
#company-map .workspace-map-list{max-height:430px;min-height:100px;margin:0;overflow-y:auto;scrollbar-width:thin}
#company-map .workspace-map-list-column>.btn{display:block;margin:8px auto;min-height:32px;font-size:11px}
#company-map .workspace-map-customer{grid-template-columns:minmax(0,1fr) auto;gap:3px 12px;padding:9px 12px;min-height:67px;border-left-width:3px}
#company-map .workspace-map-customer-identity{min-width:0;grid-row:1/3}
#company-map .workspace-map-select{font-size:13px;line-height:1.35;min-height:23px;padding:0;font-weight:650}
#company-map .workspace-map-customer-identity>.workspace-map-muted{display:block;font-size:11px}
#company-map .workspace-map-signals{justify-content:flex-end;align-self:center;gap:7px}
#company-map .workspace-map-customer>.workspace-location{font-size:10px;justify-self:end}
#company-map .workspace-map-customer>.workspace-map-relationship{display:none}
#company-map .directory-match-reason{grid-column:1/-1;font-size:10px}
#company-map .workspace-map-customer.is-selected{background:#eef6f1;border-left-color:var(--studio-green,#08754f)}
#company-map .workspace-map-selected{position:sticky;top:12px;margin:0;padding:16px;background:var(--studio-surface,#fff);border:1px solid var(--studio-line,#dbe4df);border-top:3px solid var(--studio-green,#08754f);border-radius:12px;min-width:0}
#company-map .workspace-preview-eyebrow{display:block;font-size:9px;font-weight:700;letter-spacing:.11em;color:var(--studio-green,#08754f);margin-bottom:7px}
#company-map .workspace-map-selected h3{font-size:18px;line-height:1.25;margin:0 0 5px;overflow-wrap:anywhere}
#company-map .workspace-map-selected p{font-size:12px;line-height:1.5}
#company-map .workspace-map-selected .workspace-map-actions{margin-top:12px;gap:6px}
#company-map .workspace-map-selected .workspace-map-actions .btn{font-size:11px;min-height:34px;padding:7px 10px}
#company-map .workspace-map-selected .workspace-map-actions .btn-p{background:var(--studio-green,#08754f);border-color:var(--studio-green,#08754f);color:white}
#company-map .workspace-preview-tags{display:flex;gap:5px;flex-wrap:wrap;align-items:center;margin:7px 0}
#company-map .workspace-preview-tag{padding:3px 5px;font-size:10px;color:var(--studio-muted,#65736d);background:#f1f5f2;border-radius:4px}
#company-map .workspace-preview-purchases{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 12px;padding:10px 0;margin:9px 0;border-block:1px solid var(--studio-line,#dbe4df);font-size:11px}
#company-map .workspace-preview-purchases>span{color:var(--studio-muted,#65736d)}
#company-map .workspace-map-next{padding:9px 10px;background:#f5f3e9;border-radius:6px}
#company-map.is-map-hidden .workspace-map-list{max-height:calc(100vh - 290px)}
.studio-crm .company-directory-filters .workspace-filter-primary{gap:8px;align-items:end;flex-wrap:wrap}
.studio-crm .company-directory-filters .workspace-filter-primary>label{flex:1 1 135px;min-width:120px;max-width:240px}
.studio-crm .company-directory-filters label>span{font-size:10px;font-weight:600;color:var(--studio-muted,#65736d)}
.studio-crm .company-directory-filters select{width:100%;min-height:36px;padding:6px 26px 6px 9px;background:var(--studio-surface,#fff);border:1px solid var(--studio-line,#dbe4df);border-radius:7px;font:inherit;font-size:12px;color:var(--studio-ink,#223a33)}
.studio-crm .company-directory-filters .company-filter-more{margin:0;padding:0;border:0}
.studio-crm .company-directory-filters .company-filter-more>summary{min-height:30px;padding:7px 0;font-size:11px;cursor:pointer}
.studio-crm .company-directory-filters .company-filter-more-body{padding:10px;background:#f6f8f6;border:1px solid var(--studio-line,#dbe4df);border-radius:8px;margin-bottom:5px}
.studio-crm .company-directory-filters .workspace-filter-provenance{margin:0}
@media(max-width:1000px){#company-map .workspace-map-customer-body{grid-template-columns:minmax(0,1.3fr) minmax(245px,1fr)}#company-map .workspace-map-customer{grid-template-columns:minmax(0,1fr)}#company-map .workspace-map-customer-identity{grid-row:auto}#company-map .workspace-map-signals{justify-content:flex-start}#company-map .workspace-map-customer>.workspace-location{justify-self:start}}
@media(max-width:700px){#company-map .company-map-canvas{height:240px}#company-map .workspace-map-customer-body{display:flex;flex-direction:column-reverse}#company-map .workspace-map-selected,#company-map .workspace-map-list-column{width:100%;box-sizing:border-box}#company-map .workspace-map-selected{position:static;padding:12px}#company-map .workspace-map-list{max-height:390px}#company-map .workspace-map-customer{grid-template-columns:minmax(0,1fr) auto}#company-map .workspace-map-customer-identity{grid-row:1/3}#company-map .workspace-map-signals{justify-content:flex-end}#company-map .workspace-map-customer>.workspace-location{justify-self:end}.studio-crm .company-directory-filters .workspace-filter-primary>label{max-width:none;min-width:120px;flex-basis:calc(50% - 8px)}}
@media(pointer:coarse){#company-map .workspace-map-select,#company-map .workspace-map-actions .btn,#company-map .workspace-map-list-column>.btn,.studio-crm .company-directory-filters select{min-height:44px}}
