.geo-header h1 { margin-bottom: .28rem; }
.geo-header { margin-bottom: 16px; }
.geo-workspace, .geo-insights { padding: 14px; margin-bottom: 14px; min-width: 0; }
.geo-toolbar, .geo-filters-row, .geo-map-footer, .geo-insights > header, .geo-confirm {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px;
}
.geo-toolbar { margin-bottom: 12px; }
.geo-toolbar > .btn, .geo-toolbar summary, .geo-map-footer .btn, .geo-export .btn, .location-picker .btn {
  min-height: 44px;
}
.geo-toolbar .field, .geo-filters-row .field { margin: 0; }
.geo-map-layout { position: relative; }
.geo-map { position: relative; isolation: isolate; overflow: hidden; border-radius: 9px; background: #e6efeb; }
.geo-map canvas {
  display: block; width: 100%; height: clamp(360px, 57vh, 690px); touch-action: none; cursor: grab;
}
.geo-map canvas:active { cursor: grabbing; }
.geo-map canvas.selecting, .location-picker canvas { cursor: crosshair; }
.geo-map canvas:focus-visible { outline: 3px solid #185747; outline-offset: -3px; }
.geo-map-buttons { position: absolute; inset: 12px 12px auto auto; display: grid; gap: 8px; }
.geo-map-buttons .btn { width: 44px; height: 44px; padding: 0; box-shadow: var(--shadow); }
.geo-attribution {
  position: absolute; inset: auto 0 0 auto; max-width: 100%; margin: 0; padding: 2px 6px;
  background: var(--surface); color: var(--ink); font-size: .75rem; border-radius: 4px 0 0;
}
.geo-map-footer { align-items: center; justify-content: flex-end; padding-top: 8px; }
.geo-map-footer p, .geo-status { margin: 0; }
.geo-map-help { margin: 4px 0 0; font-size: .84rem; }
.geo-status:not(:empty) { margin-top: 7px; color: var(--quiet); }
.geo-appearance, .geo-insights details, .geo-metric-details { margin-top: 10px; }
.geo-filters-row { align-items: end; }
[data-geo-primary] .geo-facet { align-self: stretch; }
.geo-facets { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)); gap: 8px; margin-top: 7px; }
.geo-facet { border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.geo-facet > summary { padding-inline: 9px; }
.geo-choice-list { padding: 0 8px 8px; max-height: 210px; overflow: auto; overscroll-behavior: contain; }
.geo-choice-list .check { display: flex; min-height: 36px; gap: 8px; overflow-wrap: anywhere; }
.geo-facets .field { margin-bottom: 0; }
.geo-insights > header { justify-content: space-between; margin-bottom: 12px; }
.geo-insights h2, .geo-insights header p { margin: 0; }
.geo-insights .table-wrap { min-width: 0; }
.geo-rank-count { display: flex; align-items: center; gap: 12px; }
.geo-rank-count meter { width: min(28vw, 210px); }
.geo-rank-count strong { margin-inline-start: auto; min-width: 3ch; text-align: end; }
.geo-kpis {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
}
.geo-kpis > div { min-width: 0; padding: 12px; border-inline-end: 1px solid var(--line); overflow-wrap: anywhere; }
.geo-kpis > div:last-child { border-inline-end: 0; }
.geo-kpis dt, .geo-restaurant-summary dt { color: var(--quiet); }
.geo-kpis dd { margin: 3px 0 0; font-size: clamp(1.05rem,2.2vw,1.55rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.geo-metric-details { margin: 3px 0 14px; }
.geo-side {
  position: absolute; z-index: 1; inset: 8px 68px 8px auto; width: min(360px,60%);
  display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
}
.geo-side header { display: flex; justify-content: space-between; align-items: start; gap: 8px; padding: 12px 16px; }
.geo-side h2, .geo-side h3 { margin: 0; }
.geo-side header .btn { flex: none; width: 44px; font-size: 1.25rem; }
.geo-side, .geo-report-block, .geo-report-head { overflow-wrap: anywhere; }
.geo-side .btn { min-height: 44px; }
.geo-side footer { padding: 8px 16px; border-top: 1px solid var(--line); }
.geo-side footer a { width: 100%; }
.geo-preview-body { overflow: auto; padding: 0 16px 8px; }
.geo-preview-period { color: var(--quiet); font-size: .88rem; }
.geo-side details, .geo-report-block details { border-top: 1px solid var(--line); }
.geo-side details p, .geo-report-block details p { padding-bottom: 8px; }
.geo-side details h3 { margin: 8px 0; }
.geo-sales-figures { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 12px 0 16px; }
.geo-sales-figures dt { color: var(--quiet); font-size: .88rem; }
.geo-sales-figures dd { margin: 0; font: 500 1.75rem/1.3 var(--display); font-variant-numeric: tabular-nums; }
.geo-report-head a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-dark); }
.geo-report-block { padding: clamp(16px,2vw,24px); margin-bottom: 16px; }
.geo-report-block h2 { margin-bottom: 12px; }
.geo-report-block .geo-sales-figures { gap: 16px 48px; }
.geo-report-block .geo-sales-figures dd { font-size: 2.25rem; }
.geo-report-block summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 600; }
.geo-report-block .table-wrap { max-height: 280px; overflow: auto; }
:is(.geo-preview-body,.geo-report-block) th[scope=row] { background: transparent; color: var(--ink); white-space: normal; }
:is(.geo-preview-body,.geo-report-block) .geo-rank-count meter { flex: 1; min-width: 24px; width: auto; }
:is(.geo-preview-body,.geo-report-block) meter::-webkit-meter-optimum-value { background: var(--accent); }
:is(.geo-preview-body,.geo-report-block) meter::-moz-meter-bar { background: var(--accent); }
:is(.geo-preview-body,.geo-report-block) thead th:last-child { text-align: end; }
.geo-restaurant-summary dl { margin: 2px 0 8px; }
.geo-restaurant-summary dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.geo-restaurant-summary dd { margin: 0; text-align: end; }
.geo-analysis-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(340px,100%),1fr)); gap: 0 16px; align-items: start; }
.geo-workspace:fullscreen, .geo-workspace.geo-fullscreen { background: var(--surface); overflow: auto; }
.geo-workspace.geo-fullscreen { position: fixed; inset: 0; z-index: 5; margin: 0; }
.geo-export, .geo-place-search { position: relative; }
.geo-export summary, .geo-place-search summary { white-space: nowrap; }
.geo-export > div {
  position: absolute; z-index: 4; inset: calc(100% + 6px) 0 auto auto; width: 150px;
  padding: 5px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 8px;
}
.geo-export > div button { width: 100%; justify-content: start; }
.geo-place-search[open] { flex: 1 0 100%; order: 4; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.geo-place-search [data-geo-locations], .geo-suggestions { display: grid; gap: 4px; }
.geo-place-search [data-geo-locations] button,.geo-suggestions button { justify-content: start; text-align: start; white-space: normal; }
.geo-workspace summary, .geo-insights summary, .geo-metric-details summary,
.geo-analysis-grid summary, .geo-restaurant-summary summary, .location-picker summary {
  min-height: 44px; align-content: center; font-weight: 600; cursor: pointer;
}
.location-picker { border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; }
.location-picker > summary strong { margin-inline-start: 6px; color: var(--quiet); font-size: .83rem; }
.location-body { display: grid; gap: 7px; padding-bottom: 10px; }
.location-body .field { margin: 0; }
.location-picker canvas { height: 245px; }
.geo-manual .field { margin-bottom: 8px; }
.geo-confirm { justify-content: space-between; align-items: center; }
.geo-confirm > p { flex: 1 1 175px; margin: 0; overflow-wrap: anywhere; }
#geo-intelligence [hidden], .location-picker [hidden] { display: none; }
@media (max-width: 610px) {
  .geo-workspace, .geo-insights { padding: 9px; }
  .geo-map canvas { height: 340px; }
  .location-picker canvas { height: 235px; }
  .geo-side { display: block; position: relative; inset: auto; width: 100%; margin-top: 8px; max-height: none; box-shadow: none; border: 1px solid var(--line); }
  .geo-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .geo-kpis > div { border-bottom: 1px solid var(--line); }
  .geo-export > div { inset-inline: 0 auto; }
}
.geo-workspace {
  --heat-1: #7CB8A5;
  --heat-2: #86B88A;
  --heat-3: #D4A451;
  --heat-4: #E49346;
  --heat-5: #C45F41;
  --heat-6: #974832;
  --geo-overlay-shadow: 0 6px 20px #26392d20;
}
.geo-workspace .geo-map { border: 1px solid #c8d6cb; border-radius: 17px; background: #ddebe9; }
.geo-workspace .geo-map canvas { height: clamp(410px, calc(100svh - 365px), 830px); }
.geo-workspace .geo-map canvas.over-restaurant:not(.selecting):not(:active) { cursor: pointer; }
.geo-workspace .geo-map-buttons {
  inset: 14px auto auto; inset-inline-end: 14px;
  gap: 0; padding: 3px; border: 1px solid #c9d8d1; border-radius: 13px;
  background: var(--surface); box-shadow: var(--geo-overlay-shadow);
}
.geo-workspace .geo-map-buttons .btn { border-color: transparent; font-size: 1.15rem; }
.geo-workspace .geo-map-buttons .btn + .btn { border-block-start-color: #e2e9e5; }
.geo-workspace .geo-map-buttons .icon { width: 18px; height: 18px; }
.geo-layer-panel, .geo-legend {
  position: absolute; z-index: 1; inset-inline-start: 14px;
  max-width: calc(100% - 84px); margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--geo-overlay-shadow);
}
.geo-layer-panel { inset-block-start: 14px; width: min(250px, 38%); padding: 8px 10px; }
.geo-layer-panel .field { margin: 0; }
.geo-layer-panel > .field > span { color: var(--quiet); font-size: .75rem; }
.geo-layer-panel select { min-block-size: 44px; font-weight: 650; cursor: pointer; }
.geo-appearance-panel { margin-block-start: 6px; border-block-start: 1px solid var(--line); }
.geo-appearance-panel > summary { padding-block: 9px; font-size: .84rem; font-weight: 650; cursor: pointer; }
.geo-appearance input[type=range] { width: 100%; accent-color: var(--accent); }
.geo-appearance { display: grid; gap: 8px; }
.geo-legend {
  inset-block-end: 32px; width: max-content; max-width: min(335px, calc(100% - 28px));
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  font-size: .8rem; line-height: 1.4; pointer-events: none;
}
.geo-legend.is-heat { display: grid; }
.geo-legend-pin {
  flex: none; display: inline-grid; place-items: center; inline-size: 1.7rem; block-size: 1.7rem;
  border: 2px solid #fff; border-radius: 50%; background: #185747; color: #fff;
  box-shadow: 0 0 0 1px #c9d8d1;
}
.geo-legend-pin .icon { width: 1rem; height: 1rem; }
.geo-legend-scale .icon { display: none; }
.geo-legend-scale {
  width: 100%; height: 7px; border-radius: 8px;
  background: linear-gradient(90deg,var(--heat-1),var(--heat-2),var(--heat-3),var(--heat-4),var(--heat-5),var(--heat-6));
}
:dir(rtl) .geo-legend-scale { transform: scaleX(-1); }
.geo-workspace .geo-side { z-index: 2; }
@media (min-width: 611px) {
  .geo-workspace .geo-side { inset-inline: auto 68px; }
}
:is(.geo-workspace:fullscreen,.geo-workspace.geo-fullscreen) .geo-map canvas { height: max(360px, calc(100dvh - 185px)); }
@media (max-width: 760px) {
  .geo-layer-panel { position: static; width: 100%; max-width: none; margin-bottom: 8px; box-shadow: none; }
  .geo-workspace .geo-map canvas { height: clamp(340px, 58svh, 570px); }
  .geo-legend { position: static; margin-top: 8px; width: 100%; max-width: none; box-shadow: none; }
}

#geo-intelligence .geo-toolbar {
  display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.5fr) repeat(2,minmax(9rem,.75fr)); gap: 12px;
}
.geo-tools, .geo-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.geo-tools { margin-bottom: 12px; }
.geo-tools > [open] { flex-basis: 100%; }
.geo-tools [data-geo-full] { margin-inline-start: auto; }
.geo-tools [data-geo-primary]:empty, .geo-scope p:empty { display: none; }
.geo-scope p { flex: 1 1 180px; margin-bottom: 8px; color: var(--quiet); font-size: .88rem; overflow-wrap: anywhere; }
.geo-scope button { margin-bottom: 8px; }
@media (max-width: 1050px) {
  #geo-intelligence .geo-toolbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
