.home-map-title { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.map-reading__header { display:contents; }
.map-reading__desktop-actions, .map-reading__trend-button, .map-reading__distribution { display:none; }
.map-reading__distribution-disclosure { display:none; }
/* Home map and its interpretation share a frame; analytics remain in normal flow. */
main .dashboard--map.dashboard--reading { margin-top:0; --map-overlap:0px; }
main .dashboard--reading .map-section {
  position:relative;
  top:auto;
  height:calc(100vh - var(--home-nav-offset, 72px));
  min-height:360px;
  overflow:hidden;
}
@supports (height:100svh) {
  main .dashboard--reading .map-section { height:calc(100svh - var(--home-nav-offset, 72px)); }
}
main .dashboard--reading .dashboard-content {
  order:0; margin-top:0; padding-top:24px; pointer-events:auto;
}
main .dashboard--reading .dashboard-content::before { content:none; }
main .dashboard--reading .dashboard-content > :first-child { margin-top:0; }
.dashboard--reading .map-stage { position:relative; --map-reading-closed-height:60px; }
.dashboard--reading .map-wrap { position:relative; }
.map-sidebar { display:contents; }
.dashboard--reading .map-toast { bottom:calc(var(--map-reading-closed-height) + 36px); }
.dashboard--reading .map-stage .map-empty {
  top:var(--map-controls-bottom, 140px);
  bottom:calc(var(--map-reading-height, 60px) + 8px);
}
.dashboard--reading .map-stage .map-empty__card { max-height:100%; overflow-y:auto; box-sizing:border-box; }
.dashboard--reading .map-empty__actions .chip { min-height:44px; }
.dashboard--reading .maplibregl-ctrl-bottom-left,
.dashboard--reading .maplibregl-ctrl-bottom-right { bottom:var(--map-reading-closed-height); }
.map-reading {
  position:absolute; left:8px; right:8px; bottom:0; z-index:950;
  display:flex; flex-direction:column; min-width:0;
  max-height:var(--reading-max-height, 60%);
  color:var(--fg); background:var(--card);
  border:1px solid var(--border); border-bottom:0; border-radius:14px 14px 0 0;
  box-shadow:0 -4px 18px rgba(0,0,0,.13); overflow:hidden;
  font-size:.84rem; line-height:1.5;
}
.map-reading [hidden], .map-reading[hidden] { display:none !important; }
.map-reading__toggle {
  display:flex; flex-shrink:0; align-items:center; gap:8px; width:100%;
  min-height:60px; padding:9px 14px; border:0; border-radius:0;
  background:transparent; color:inherit; cursor:pointer; text-align:left; font:inherit;
}
.map-reading__heading { display:flex; flex:1; min-width:0; flex-direction:column; gap:1px; }
.map-reading__pie { display:block; flex:0 0 24px; width:24px; height:24px; color:var(--muted); }
.map-reading__group-amount { display:block; color:var(--muted); font-size:.76rem; }
.map-reading__heading > strong { font-size:.94rem; }
#map-reading-count { color:var(--muted); font-size:.78rem; }
.map-reading__trend { flex-shrink:0; color:var(--brand); font-size:.73rem; font-weight:700; white-space:nowrap; }
.map-reading__trend[data-trend="equal"], .map-reading__trend[data-trend="empty"] { color:var(--muted); }
.map-reading__notice { display:inline-flex; flex-shrink:0; align-items:center; justify-content:center; font-size:.73rem; line-height:1.5; white-space:nowrap; border:1px solid var(--border); border-radius:12px; padding:2px 7px; }
.map-reading__chevron { flex-shrink:0; }
.map-reading.is-expanded .map-reading__chevron { transform:rotate(180deg); }
.map-reading__content { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 14px 16px; scrollbar-gutter:stable; }
.map-reading__content > section { padding:14px 0 0; margin-top:14px; border-top:1px solid var(--border); }
.map-reading h3 { font-size:.92rem; margin:0 0 10px; text-align:left; color:var(--fg); }
.map-reading p { margin:8px 0; }
.map-reading__scope, .map-reading__content p, .map-reading__alerts > li > span { color:var(--muted); }
.map-reading__status { border-left:3px solid var(--brand); padding-left:10px; }
.map-reading__groups, .map-reading__signals, .map-reading__alerts { list-style:none; padding:0; margin:12px 0; }
.map-reading__groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
.map-reading__groups > li { display:flex; align-items:center; gap:7px; min-width:0; }
.map-reading__groups small { white-space:nowrap; font-size:inherit; font-weight:700; }
.map-reading__swatch { display:block; width:12px; height:12px; flex-shrink:0; background:var(--marker-fill); border-radius:50%; outline:1px solid var(--muted); }
.map-reading__examples { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; }
.map-reading__examples > span { display:flex; align-items:center; gap:8px; font-size:.76rem; }
.map-reading__example-copy { display:flex; flex-direction:column; min-width:0; color:var(--muted); }
.map-reading__example-name { font-size:.84rem; }
.map-reading__example-name strong { font-weight:800; color:var(--fg); text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:2px; }
.map-reading__marker {
  --marker-fill:#2563EB; --marker-ring:#25CCE9;
  position:relative; display:inline-flex; width:33px; height:33px; flex-shrink:0;
  box-sizing:border-box; justify-content:center; align-items:center;
  background:var(--marker-fill); border:3.5px solid var(--marker-ring); border-radius:50%;
  color:#fff; font:700 13px Arial,sans-serif;
}
.map-reading__marker--group > span {
  position:absolute; top:-8px; right:-8px; display:grid; place-items:center;
  width:16px; height:16px; border:1px solid #fff; border-radius:50%;
  background:#0f172a; color:#fff; font-size:10px;
}
.map-reading--emoji .map-reading__marker {
  --marker-fill:#fff; font-size:0;
  background-image:url("../../icons/whale.6b31f9d2d29c.png");
  background-repeat:no-repeat; background-position:center; background-size:22px 22px;
}
.map-reading__cluster { display:grid; place-items:center; width:36px; height:36px; flex-shrink:0; border:2.2px solid #fff; border-radius:50%; background:#1e3a8a; color:#fff; font-size:12px; }
.map-reading__signals > li { display:flex; align-items:center; gap:14px; margin:12px 0; }
.map-reading__alerts > li { margin:0; overflow-wrap:anywhere; }
.map-reading__alerts > li + li { border-top:1px solid var(--border); }
.map-reading__alerts a { display:flex; align-items:center; gap:12px; min-height:44px; padding:12px 8px; border-radius:8px; color:var(--fg); text-decoration:none; }
.map-reading__alerts a:is(:hover,:focus-visible) { background:var(--border); text-decoration:none; }
.map-reading__alert-copy { display:flex; flex:1; min-width:0; flex-direction:column; gap:5px; }
.map-reading__alert-copy strong { font-size:.82rem; font-weight:600; line-height:1.45; }
.map-reading__alert-localities { color:var(--muted); font-size:.76rem; line-height:1.4; }
.map-reading__alert-localities:empty { display:none; }
.map-reading__alert-arrow { flex:0 0 18px; width:18px; height:18px; color:var(--muted); background:currentColor; mask:url("../../icons/arrow-up-right-outline.4cb080935672.svg") center / contain no-repeat; transform:rotate(45deg); }
.map-reading__alerts a:is(:hover,:focus-visible) .map-reading__alert-arrow { color:var(--brand); }
.map-reading__action, .map-reading summary { min-height:44px; cursor:pointer; }
.map-reading__action { color:var(--fg); background:transparent; border:1px solid var(--border); border-radius:8px; padding:8px 12px; font:inherit; }
.map-reading summary { display:list-item; padding:10px 0; }
.map-reading__probability { display:flex; align-items:center; flex-wrap:wrap; gap:12px; }
.map-reading__probability > strong { color:var(--fg); font-size:1.5rem; }
.map-reading :is(button,a,summary):focus-visible { outline:2px solid var(--brand); outline-offset:-3px; }
.map-reading__content:focus-visible { outline:2px solid var(--brand); outline-offset:-3px; }
@media (min-width:768px) {
  .map-reading { left:16px; right:16px; max-width:960px; margin-inline:auto; }
  .map-reading__groups { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .map-reading__content > section, .map-reading__scope, .map-reading__status { max-width:850px; }
}
@media (max-width:360px) { .map-reading__groups { grid-template-columns:minmax(0,1fr); } }
@media (max-width:360px) {
  .map-reading__toggle { gap:5px; padding-inline:8px; }
  .map-reading__pie { flex-basis:20px; width:20px; height:20px; }
  .map-reading__heading > strong { font-size:.82rem; }
  #map-reading-count { font-size:.7rem; line-height:1.35; }
  .map-reading__notice { font-size:.68rem; padding-inline:4px; }
}


/* Native dialogs have one scroll area; their background stays inert. */
.map-reading-dialog { width:min(640px, calc(100vw - 48px)); max-height:calc(100dvh - 64px); padding:0; margin:auto; box-sizing:border-box; border:1px solid var(--border); border-radius:16px; color:var(--fg); background:var(--card); overflow:hidden; font-size:14px; line-height:1.5; }
.map-reading-dialog[open] { display:flex; flex-direction:column; }
.map-reading-dialog::backdrop { background:rgba(8, 22, 36, .6); }
html.map-reading-open { overflow:hidden; scrollbar-gutter:stable; }
.map-reading-dialog__header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 24px; flex-shrink:0; }
.map-reading .map-reading-dialog h2 { margin:0; text-align:left; font-size:20px; line-height:1.4; }
.map-reading-dialog__close { display:grid; place-items:center; flex-shrink:0; width:44px; height:44px; border:0; border-radius:8px; color:var(--muted); background:transparent; font:inherit; font-size:26px; cursor:pointer; }
.map-reading-dialog__body { min-height:0; min-width:0; overflow-y:auto; overscroll-behavior:contain; padding:24px; overflow-wrap:anywhere; }
.map-reading-dialog__body > section { min-width:0; margin:0; }
.map-reading__inline-body .map-reading__groups { grid-template-columns:repeat(2,minmax(0,1fr)); }
.map-reading-dialog__body p { color:var(--muted); }
.map-reading-dialog__body h3 { font-size:16px; }
.map-reading-dialog__body .map-reading__signals > li > span:last-child { min-width:0; }
@media (min-width:1024px) {
  .dashboard--reading .map-stage > .map { position:absolute; inset:0; height:100%; }
  .map-sidebar { --fg:var(--silk-text); --muted:var(--silk-muted); --card:var(--silk-surface); display:grid; min-width:0; box-sizing:border-box; color:var(--silk-text); background:var(--silk-surface); border-left:1px solid var(--border); }
  .map-topbar.map-toolbar { position:relative; inset:auto; width:100%; max-width:none; box-sizing:border-box; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--card); box-shadow:none; }
  .map-topbar__toggle { display:none; }
  .map-topbar__territory-row { padding-right:0; }
  .map-topbar .map-territory,
  .map-topbar__filter-row > button,
  .map-topbar__territory-row > button { border-color:transparent; background:var(--silk-surface); box-shadow:var(--silk-inset); }
  .map-topbar .map-territory:focus-within { border-color:var(--brand); }
  .map-topbar button[aria-expanded="true"] { border-color:var(--brand); box-shadow:var(--silk-inset), inset 0 0 0 1px var(--brand); }
  .map-topbar__menu { inset-inline:0; max-width:100%; box-sizing:border-box; max-height:min(360px, var(--map-toolbar-menu-max-height, 55vh)); background:var(--silk-surface); box-shadow:var(--silk-raised-sm); }
  .map-sidebar .map-reading { position:relative; inset:auto; width:100%; max-width:none; height:auto; min-width:0; max-height:none; margin:0; border:0; border-radius:0; box-shadow:none; background:transparent; overflow:visible; font-size:14px; line-height:1.5; }
  .map-sidebar .map-reading__header { display:flex; align-items:center; gap:12px; min-width:0; }
  .map-sidebar .map-reading__toggle { flex:1; min-width:0; width:auto; gap:8px; padding:0; min-height:52px; cursor:default; opacity:1; }
  .map-sidebar .map-reading__heading > strong { font-size:16px; }
  .map-sidebar #map-reading-count { font-size:13px; overflow-wrap:anywhere; }
  .map-sidebar .map-reading__chevron,
  .map-sidebar .map-reading__toggle > .map-reading__notice:not(.map-reading__trend) { display:none; }
  .map-sidebar .map-reading__trend-button { display:block; flex-shrink:0; padding:8px 0 8px 8px; border:0; background:transparent; color:var(--brand); cursor:pointer; }
  .map-sidebar .map-reading__trend-button .map-reading__trend { font:inherit; font-size:12px; }
  .map-sidebar .map-reading__content { padding:8px 0 0; min-width:0; overflow:visible; scrollbar-gutter:auto; }
  .map-sidebar .map-reading__content > * { min-width:0; box-sizing:border-box; overflow-wrap:anywhere; }
  .map-sidebar .map-reading__scope { margin:0; font-size:13px; }
  .map-sidebar .has-reading-dialog .map-reading__desktop-actions { display:grid; gap:12px; margin-top:16px; padding-top:16px; border-top:1px solid var(--border); }
  .map-reading__link { display:flex; align-items:center; gap:12px; min-width:0; min-height:52px; padding:12px; border:0; border-radius:12px; background:var(--silk-surface); box-shadow:var(--silk-raised-sm); color:var(--fg); text-align:left; font:inherit; cursor:pointer; }
  .map-reading__link > span:first-child { flex:1; min-width:0; }
  .map-reading__link .map-reading__alert-arrow { margin-inline:4px; }
  .map-reading__link:is(:hover,:active) { color:var(--brand); box-shadow:var(--silk-inset); }
  .map-sidebar .map-reading__trend-button .map-reading__trend,
  .map-reading__link .map-reading__notice { border-color:transparent; background:var(--silk-surface); box-shadow:var(--silk-inset); }
  .map-sidebar .map-reading__distribution { display:grid; grid-template-columns:84px minmax(0,1fr); align-items:center; gap:8px 12px; margin:24px 0 0; padding-top:16px; border-top:1px solid var(--border); }
  .map-reading__distribution figcaption { grid-column:1 / -1; justify-self:start; font-size:14px; font-weight:700; }
  .map-reading__chart-slot .map-reading__pie { width:84px; height:84px; }
  .map-reading__chart-legend { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 12px; width:100%; min-width:0; margin:0; padding:0; list-style:none; font-size:12px; line-height:1.35; }
  .map-reading__chart-legend li { display:flex; align-items:center; gap:8px; min-width:0; }
  .map-reading__chart-legend li > span:last-child { min-width:0; overflow-wrap:anywhere; }
  .map-reading__chart-legend .map-reading__group-amount { font-size:11px; }
  .map-reading__chart-value { display:block; min-height:15px; }
  .map-reading__distribution > p { grid-column:1 / -1; margin:0; color:var(--muted); font-size:12px; }
  .dashboard--reading .maplibregl-ctrl-bottom-left,
  .dashboard--reading .maplibregl-ctrl-bottom-right { bottom:0; }
  .dashboard--reading .map-stage .map-empty { inset:8px; }
  .map-section.is-popup-open .map-sidebar .map-toolbar--overlay { opacity:1; visibility:visible; pointer-events:auto; }
}
/* One territory picker for desktop and mobile. */
  .map-topbar [data-map-menu] { z-index:4; box-sizing:border-box; padding:10px; border-radius:12px; background:var(--silk-surface); box-shadow:var(--silk-raised-sm); scrollbar-width:thin; scrollbar-color:var(--muted) transparent; }
  .map-topbar [data-map-menu] fieldset { gap:4px; }
  .map-topbar [data-map-menu] legend { padding:4px 12px 10px; color:var(--muted); font-size:12px; }
  .map-topbar [data-map-menu] label { min-height:44px; box-sizing:border-box; gap:10px; padding:10px 12px; border-radius:8px; font-size:14px; line-height:1.4; }
  .map-topbar [data-map-menu] label:is(:hover,:focus-within) { background:color-mix(in srgb,var(--brand) 15%,var(--silk-surface)); }
  .map-topbar [data-map-menu] label:has(input:checked) { background:color-mix(in srgb,var(--brand) 22%,var(--silk-surface)); font-weight:600; }
  .map-topbar [data-map-menu] input:is([type="checkbox"],[type="radio"]) { appearance:none; -webkit-appearance:none; flex:0 0 18px; width:18px; height:18px; border:1px solid var(--muted); border-radius:5px; background-color:var(--silk-surface); accent-color:var(--brand); cursor:pointer; }
  .map-topbar [data-map-menu] input[type="checkbox"]:checked { border-color:var(--brand); background:var(--brand) url("../../icons/check-white.3b4c6f61cc5f.svg") center / 14px 14px no-repeat; }
  .map-topbar [data-map-menu] input[type="radio"] { border-radius:50%; }
  .map-topbar [data-map-menu] input[type="radio"]:checked { border-color:var(--brand); background:var(--brand); box-shadow:inset 0 0 0 4px var(--silk-surface); }
  .map-topbar #map-groups-reset { margin-top:8px; min-height:44px; padding:10px 12px; border-color:transparent; background:var(--silk-surface); box-shadow:var(--silk-inset); font-size:13px; }
  .map-topbar .map-territory .map-territory__trigger { display:block; width:100%; height:46px; padding:15px 24px 2px 42px; border:0; background:transparent; box-shadow:none; text-align:left; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .map-topbar .map-territory__flag, .map-topbar .map-territory__label, .map-topbar .map-territory > .map-topbar__chevron { pointer-events:none; z-index:1; }
  .map-topbar .map-territory__menu { z-index:4; padding:10px; overflow:hidden; box-sizing:border-box; background:var(--silk-surface); box-shadow:var(--silk-raised-sm); }
  .map-topbar .map-territory__menu input { display:block; width:100%; height:42px; min-width:0; box-sizing:border-box; margin:0 0 8px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:var(--silk-surface); color:var(--fg); box-shadow:var(--silk-inset); font:inherit; font-size:14px; }
  .map-topbar .map-territory__search:focus-visible { outline:2px solid var(--brand); outline-offset:1px; }
  .map-topbar .map-territory__options { max-height:min(280px,var(--territory-options-max-height,calc(var(--map-toolbar-menu-max-height,55vh) - 80px))); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--muted) transparent; }
  .map-topbar .map-territory__options button { position:relative; padding:10px 30px 10px 12px; min-height:40px; border:0; font-size:14px; font-weight:400; overflow-wrap:anywhere; text-align:left; }
  .map-topbar .map-territory__options button:hover, .map-topbar .map-territory__options button:focus-visible { background:color-mix(in srgb,var(--brand) 15%,var(--silk-surface)); }
  .map-topbar .map-territory__options button[aria-pressed="true"] { color:var(--fg); background:color-mix(in srgb,var(--brand) 22%,var(--silk-surface)); font-weight:700; }
  .map-topbar .map-territory__options button[aria-pressed="true"]::after { content:'\2713'; position:absolute; right:12px; color:var(--brand); }
  .map-topbar .map-territory__empty { margin:8px 4px; font-size:14px; color:var(--muted); }
@media (max-width:1023px) {
  .dashboard--map .map-toolbar--overlay.map-topbar:not(.is-collapsed) { left:8px; right:8px; width:calc(100% - 16px); margin-inline:0; }
  .map-topbar .map-territory__menu input { font-size:16px; }
  .map-topbar .map-territory__options button { min-height:44px; }
}
@media (min-width:768px) and (max-width:1023px) {
  .dashboard--map .map-toolbar--overlay.map-topbar:not(.is-collapsed) { left:16px; right:16px; width:calc(100% - 32px); }
}
