/* A single map surface owns overview metrics, search and view controls. */
.market-workspace{--market-panel-width:320px;--market-float-gap:16px;display:flex;flex-direction:column;height:clamp(580px,calc(100dvh - 112px),1000px);min-width:0;border:1px solid var(--border-subtle);border-radius:14px;background:#f8fafc;isolation:isolate}
.market-workspace [hidden]{display:none!important}
.market-workspace svg:not(.market-world-map){width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.market-workspace .market-toolbar{position:relative;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:88px;padding:12px 20px;background:#fff;border-bottom:1px solid var(--border-subtle);border-radius:14px 14px 0 0;flex-shrink:0}
/* Scoped dimensions supersede the former full-size KPI cards. */
.dashboard-page .market-overview .market-workspace .map-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;flex:1;max-width:480px;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:transparent}
.dashboard-page .market-overview .market-workspace .map-metrics button.metric-card{display:flex;flex-direction:column;align-items:flex-start;gap:5px;position:relative;min-height:60px;min-width:0;padding:7px 12px;border:0;border-radius:8px;background:transparent;box-shadow:none;cursor:pointer}
.dashboard-page .market-overview .market-workspace .map-metrics button.metric-card::before,.dashboard-page .market-overview .market-workspace .map-metrics button.metric-card::after{display:none}
.dashboard-page .market-overview .market-workspace .map-metrics button.metric-card:hover{background:var(--surface-subtle);border:0;box-shadow:none}
.dashboard-page .market-overview .market-workspace .map-metrics .metric-title{display:block;font-size:12px;line-height:1.5;font-weight:400;color:var(--text-tertiary);margin:0;white-space:nowrap}
.dashboard-page .market-overview .market-workspace .map-metrics .metric-value{display:block;font-size:24px;line-height:1.2;font-weight:550;letter-spacing:-.035em;color:var(--text-primary);margin:0;font-variant-numeric:tabular-nums}
.market-workspace .market-toolbar-actions{display:flex;align-items:center;gap:10px;flex-shrink:0;min-width:0}
.market-workspace .country-search{position:relative;display:flex;align-items:center;width:clamp(180px,18vw,260px);height:40px;gap:8px;padding:0 11px;border:1px solid var(--border-default);border-radius:8px;background:#fafbfc;color:var(--text-tertiary);min-width:0}
.market-workspace .country-search:focus-within{background:#fff;border-color:var(--field-focus-border,#c4cfda);box-shadow:none}
.market-workspace .country-search>svg{width:16px;height:16px;flex-shrink:0}
.market-workspace .country-search input{font:inherit;font-size:13px;line-height:1.6;border:0;outline:0;width:100%;min-width:0;padding:8px 0;color:var(--text-primary);background:transparent}
.market-workspace .country-search input::placeholder{color:#858e9a}
.market-workspace .country-search input::-webkit-search-cancel-button{display:none}
.market-workspace .country-search-results{position:absolute;top:calc(100% + 7px);left:0;right:0;padding:5px;margin:0;list-style:none;max-height:min(310px,45dvh);overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid var(--border-default);border-radius:10px;box-shadow:0 8px 28px #10182312;z-index:8;scrollbar-width:thin}
.market-workspace .country-search-results button{display:flex;align-items:center;justify-content:space-between;gap:15px;border:0;border-radius:6px;background:transparent;width:100%;min-height:38px;padding:9px 10px;color:var(--text-primary);font-size:13px;text-align:left}
.market-workspace .country-search-results button:hover,.market-workspace .country-search-results button.is-active,.market-workspace .country-search-results button[aria-selected="true"]{background:var(--surface-hover)}
.market-workspace .country-search-results small{color:var(--text-tertiary);font-size:12px}
.market-workspace .country-search-empty{padding:12px 6px;font-size:12px;color:var(--text-secondary)}
.market-workspace .market-create-task{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:9px 14px;border:1px solid var(--text-primary);border-radius:8px;background:var(--text-primary);color:#fff;font:inherit;font-size:13px;font-weight:500;white-space:nowrap;cursor:pointer}
.market-workspace .market-create-task svg{width:16px;height:16px}
.market-workspace .market-create-task:hover{background:#35383d;border-color:#35383d}
.market-workspace .map-overview-error{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-shrink:0;margin:0;padding:9px 20px;border-bottom:1px solid #eadcd5;background:#fff;font-size:12px;line-height:1.7;color:#8a5743}
.market-workspace .map-overview-error button{font:inherit;min-height:30px;text-underline-offset:3px;cursor:pointer}
.market-workspace .market-map-panel,.market-workspace .market-map-panel.is-drawer-closed{position:relative;display:block;flex:1;min-height:0;height:auto;overflow:hidden;border-radius:0 0 14px 14px}
.market-workspace .market-map-surface{position:relative;width:100%;height:100%;min-width:0;min-height:0;background:radial-gradient(ellipse at 44% 48%,#fff 0,#f8fafc 78%);overflow:hidden}
.market-workspace .market-world-map{display:block;width:100%;height:100%;padding:30px 22px 46px;touch-action:pan-y pinch-zoom;user-select:none;cursor:pointer}
.market-workspace .market-world-map.is-zoomed{touch-action:none;cursor:grab}
.market-workspace .market-world-map.is-zoomed:active{cursor:grabbing}
.market-workspace .country-shape{fill:#dce2e9;stroke:#f8fafc;stroke-width:.7;cursor:pointer;outline:none;transition:fill .16s,stroke .16s}
.market-workspace .country-shape:hover{fill:#c8d1dc}
.market-workspace .small-country{fill:#b9c4d1;stroke:#f8fafc;stroke-width:.6;cursor:pointer;transition:fill .16s,stroke .16s}
.market-workspace .country-shape.has-customers,.market-workspace .small-country.has-customers{fill:#e7a17e}
.market-workspace .country-shape.has-customers:hover,.market-workspace .small-country.has-customers:hover{fill:#db906b}
.market-workspace .country-shape[aria-pressed="true"],.market-workspace .small-country[aria-pressed="true"]{fill:#dce2e9;stroke:#b45c3b;stroke-width:1.7}
.market-workspace .country-shape.has-customers[aria-pressed="true"],.market-workspace .small-country.has-customers[aria-pressed="true"]{fill:#df966f;stroke:#a54b2b;stroke-width:1.8}
.market-workspace .country-shape:focus-visible,.market-workspace .small-country:focus-visible{stroke:var(--text-primary);stroke-width:2}
.market-workspace .map-activity-status{position:absolute;left:20px;top:17px;display:flex;align-items:center;gap:9px;max-width:calc(100% - 100px);background:transparent;border:0;padding:0;color:#7f8997;font-size:12px;line-height:1.7;pointer-events:none}
.market-workspace .map-activity-status button{font:inherit;color:#945237;background:#fff;border:1px solid var(--border-default);border-radius:6px;padding:4px 8px;cursor:pointer;pointer-events:auto}
.market-workspace .map-legend{position:absolute;left:19px;bottom:18px;display:flex;align-items:center;gap:10px;max-width:calc(100% - 90px);font-size:11px;line-height:1.6;color:#8892a0}
.market-workspace .map-legend-items{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px}
.market-workspace .map-legend-items>span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.market-workspace .map-legend i{display:block;width:8px;height:8px;border-radius:2px;box-sizing:border-box}
.market-workspace .map-legend-lit{background:#e7a17e}
.market-workspace .map-legend-empty{background:#dce2e9}
.market-workspace .map-legend-selected{background:transparent;border:1.5px solid #b45c3b}
.market-workspace .map-basis-help{display:grid;place-items:center;width:28px;height:28px;padding:5px;border:0;border-radius:6px;background:transparent;color:#9aa3ae;cursor:pointer;flex-shrink:0}
.market-workspace .map-basis-help:hover{color:var(--text-secondary);background:#fff}
.market-workspace .map-basis-help svg{width:16px;height:16px}
.market-workspace .map-controls{position:absolute;right:16px;top:16px;bottom:auto;display:flex;flex-direction:column;gap:2px;padding:4px;border:1px solid var(--border-default);border-radius:10px;background:#fffffff2;box-shadow:0 2px 8px #10182304}
.market-workspace .map-controls button{display:grid;place-items:center;width:34px;height:34px;min-width:34px;min-height:34px;padding:8px;border:0;border-radius:6px;background:transparent;color:#788493;line-height:0;cursor:pointer}
.market-workspace .map-controls button:hover,.market-workspace .map-controls button[aria-pressed="true"]{background:var(--surface-hover);color:var(--text-primary)}
.market-workspace .map-controls button svg{width:17px;height:17px;flex-shrink:0}
.market-workspace :is(button,summary,input):focus-visible{outline:2px solid var(--field-keyboard,#7d97b0);outline-offset:2px}
.market-workspace .country-search input:focus-visible{outline:none;box-shadow:none}
.map-is-expanded{overflow:hidden}
.market-workspace.is-expanded,.market-workspace:fullscreen{position:fixed;inset:0;z-index:200;width:100vw;height:var(--product-viewport-height,100dvh);max-height:none;border:0;border-radius:0;display:flex;flex-direction:column;background:#f8fafc}
.market-workspace.is-expanded .market-toolbar,.market-workspace:fullscreen .market-toolbar{border-radius:0}
.market-workspace.is-expanded .market-map-panel,.market-workspace:fullscreen .market-map-panel{flex:1;height:auto;min-height:0;border-radius:0;overflow:hidden}
.market-workspace.is-expanded .market-map-surface,.market-workspace:fullscreen .market-map-surface{height:100%;min-height:0}
@media(max-width:1150px){
 .market-workspace{--market-panel-width:300px}
 .market-workspace .market-toolbar{gap:14px;padding-inline:15px}
 .dashboard-page .market-overview .market-workspace .map-metrics{gap:2px}
 .dashboard-page .market-overview .market-workspace .map-metrics button.metric-card{padding-inline:8px}
 .market-workspace .country-search{width:190px}
}
@media(max-width:900px){
 .market-workspace .market-toolbar{flex-wrap:wrap;gap:12px;padding:12px 16px 15px}
 .dashboard-page .market-overview .market-workspace .map-metrics{flex-basis:100%;width:100%;max-width:none}
 .market-workspace .market-toolbar-actions{width:100%;gap:10px}
 .market-workspace .country-search{width:auto;flex:1}
 .market-workspace .market-create-task{min-height:42px;padding-inline:16px}
 .market-workspace .market-world-map{padding:34px 12px 44px}
}
@media(max-width:700px){
 .market-workspace{height:max(590px,calc(100svh - 112px));border-radius:12px}
 .market-workspace .market-toolbar{padding:10px 12px 13px;gap:10px;border-radius:12px 12px 0 0}
 .dashboard-page .market-overview .market-workspace .map-metrics{grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}
 .dashboard-page .market-overview .market-workspace .map-metrics button.metric-card{min-height:58px;padding:5px 4px;gap:6px}
 .dashboard-page .market-overview .market-workspace .map-metrics .metric-title{font-size:11px}
 .dashboard-page .market-overview .market-workspace .map-metrics .metric-value{font-size:22px}
 .market-workspace .country-search{height:44px}
 .market-workspace .country-search input{font-size:16px}
 .market-workspace .country-search-results button{min-height:44px}
 .market-workspace .market-create-task{min-height:44px;padding-inline:14px;font-size:13px}
 .market-workspace .market-map-panel{border-radius:0 0 12px 12px}
 .market-workspace .market-world-map{padding:32px 3px 48px}
 .market-workspace .map-activity-status{left:13px;top:14px;max-width:calc(100% - 80px);font-size:11px}
 .market-workspace .map-legend{left:12px;bottom:13px;gap:4px;max-width:calc(100% - 24px);font-size:10px}
 .market-workspace .map-legend-items{gap:7px 10px}
 .market-workspace .map-basis-help{width:28px;height:28px}
 .market-workspace .map-controls{right:12px;top:12px;padding:3px}
 .market-workspace .map-controls button{width:40px;height:40px;min-width:40px;min-height:40px}
 .market-workspace .map-controls button svg{width:18px;height:18px}
 .market-workspace .market-map-panel:not(.is-drawer-closed) .map-legend{visibility:hidden}
 .market-workspace .map-overview-error{padding-inline:13px;font-size:12px}
}
@media(prefers-reduced-motion:reduce){.market-workspace .country-shape,.market-workspace .small-country{transition:none}}
@media(forced-colors:active){
 .market-workspace .country-shape{fill:Canvas;stroke:CanvasText}
 .market-workspace .country-shape.has-customers{fill:Highlight}
 .market-workspace .country-shape[aria-pressed="true"],.market-workspace .small-country[aria-pressed="true"]{stroke:Highlight;stroke-width:3}
 .market-workspace .map-legend-selected{border-color:Highlight}
}
