.traffic-image-map{position:relative;margin:16px 0;border:1px solid var(--aud-border,#c7cdd5);border-radius:22px;overflow:hidden;background:#e4e9e7;color:#243b44;isolation:isolate}
.traffic-map-viewport{position:relative;height:65dvh;min-height:320px;max-height:760px;overflow:hidden;touch-action:none;overscroll-behavior:contain;cursor:grab;user-select:none}
.traffic-map-viewport:active{cursor:grabbing}
.traffic-map-image{position:absolute!important;left:0;top:0;max-width:none!important;max-height:none!important;object-fit:fill!important;margin:0!important;border-radius:0!important;pointer-events:none;visibility:hidden}
.traffic-image-map.is-ready .traffic-map-image{visibility:visible}
.traffic-map-hotspots{position:absolute;inset:0;pointer-events:none;visibility:hidden}
.traffic-image-map.is-ready .traffic-map-hotspots{visibility:visible}
.traffic-map-point,.traffic-map-point.is-selected,.traffic-map-point.is-unavailable{position:absolute;transform:translate(-50%,-50%);width:44px;height:44px;min-width:44px;min-height:44px;padding:0!important;border:0!important;border-radius:8px!important;background:transparent!important;box-shadow:none!important;outline:none;color:transparent!important;pointer-events:auto;cursor:pointer}
.traffic-map-point>span{display:none!important}
.traffic-map-point:focus-visible{outline:2px solid #f9d868;outline-offset:2px}
.traffic-map-tools{position:absolute;right:10px;top:10px;display:flex;gap:5px;z-index:5}
.traffic-map-tools button{min-width:44px;min-height:44px;border:1px solid #becbd1;border-radius:10px;background:#fff;color:#183e51;font-size:17px;padding:7px;cursor:pointer}
.traffic-map-tools button:disabled{opacity:.5;cursor:default}
.traffic-map-status{position:absolute;bottom:10px;right:10px;z-index:5;max-width:calc(100% - 20px);box-sizing:border-box;padding:6px 10px;border-radius:10px;background:#fffE;box-shadow:0 2px 8px #0002;font-size:12px;font-weight:600;line-height:1.4;font-variant-numeric:tabular-nums;pointer-events:none}
.traffic-map-status button{display:inline-block;margin:4px;padding:10px;min-height:44px;border:1px solid #bccbd4;border-radius:8px;background:#fff;color:#173c50;pointer-events:auto}
.traffic-image-map .traffic-map-point{-webkit-tap-highlight-color:transparent}
.traffic-map-point::after{content:"";position:absolute;inset:4px;border-radius:50%;background:radial-gradient(circle,#fff7 0%,#fff3 55%,transparent 72%);opacity:0;transform:scale(.7);pointer-events:none}
.traffic-map-point:active::after{opacity:.7;transform:scale(.85);transition:transform 100ms ease-out,opacity 100ms ease-out}
.traffic-map-point.is-selected::after{animation:traffic-map-tap 260ms ease-out both}
@keyframes traffic-map-tap{0%{opacity:.7;transform:scale(.75)}100%{opacity:0;transform:scale(1.25)}}
@media(prefers-reduced-motion:reduce){.traffic-map-point:active::after{transition:none}.traffic-map-point.is-selected::after{animation:none;opacity:0}}
.traffic-image-map .traffic-map-selection{position:absolute;bottom:8px;left:8px;right:8px;z-index:6;box-sizing:border-box;border:1px solid var(--aud-border,#c7cdd5);border-radius:14px;padding:10px 12px;margin:0;background:var(--aud-card-bg,#fff);box-shadow:0 3px 16px #0002;max-height:60%;overflow:auto}
.traffic-map-selection h3{margin:0 0 4px;font-size:15px;line-height:1.35}.traffic-map-selection p{margin:4px 0;font-size:12px;line-height:1.4}
.traffic-image-map .traffic-map-selection .action-row{display:flex;gap:8px;margin-top:8px}
.traffic-image-map .traffic-map-selection .primary-action{flex:1;min-width:0;min-height:44px;padding:8px;font-size:13px;line-height:1.3;border-radius:10px}
.traffic-map-selection .action-row>span{flex:1;align-self:center;font-size:12px}
.traffic-image-map:has(.traffic-map-selection) .traffic-map-status{visibility:hidden}
.traffic-map-editor{padding:24px;border:1px solid #294762;border-radius:18px;margin:16px 0;background:#0c2036;color:#e0ecf8;color-scheme:dark}
.traffic-map-editor h5{margin:0 0 10px;font-size:18px;color:#edf6ff}
.traffic-map-editor>p{color:#a7bed3;font-size:14px;line-height:1.7}
.traffic-map-steps{display:flex;flex-wrap:wrap;gap:12px 24px;padding:0;margin:20px 0;list-style:none;color:#6ed8ef;font-size:14px}
.traffic-map-json{border:1px solid #294762;border-radius:12px;background:#08182a;padding:14px;margin:16px 0}
.traffic-map-json summary{cursor:pointer;font-size:14px;color:#e0ecf8}
.traffic-map-json summary span{margin-left:12px;font-size:12px;color:#9bb2c8}
.traffic-map-editor textarea{display:block;box-sizing:border-box;width:100%;height:260px;min-height:160px;max-height:480px;font:13px/1.65 monospace;margin:14px 0 0;padding:14px;resize:vertical;border:1px solid #35536c;border-radius:8px;background:#061221;color:#cce4f4;tab-size:2}
.traffic-map-editor-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:18px 0}
.traffic-map-editor button,.traffic-map-editor label.traffic-map-file{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;margin:0;padding:10px 16px;border:1px solid #365875;border-radius:10px;background:#17324d;cursor:pointer;font-size:14px;color:#e1edf8}
.traffic-map-editor [data-map-editor-action=apply]{background:#2465dc;border-color:#4b8dff;color:white;font-weight:600}
.traffic-map-editor [data-map-editor-action=cancel],.traffic-map-editor [data-map-editor-action=remove]{background:transparent;color:#a7bed3}
.traffic-map-editor button:hover,.traffic-map-editor label.traffic-map-file:hover{border-color:#6ed8ef}
.traffic-map-editor button:focus-visible,.traffic-map-editor summary:focus-visible,.traffic-map-file:focus-within,.traffic-map-editor textarea:focus-visible{outline:2px solid #6ed8ef;outline-offset:3px}
.traffic-map-editor input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden}
.traffic-map-editor [role=status][data-map-editor-status]{white-space:pre-wrap;font-size:13px;line-height:1.9;max-height:240px;overflow:auto;border-left:3px solid #4baac7;padding:10px 14px;background:#102a40;border-radius:0 8px 8px 0;color:#c7deed}
.traffic-map-editor .traffic-map-viewport{height:420px;min-height:280px}
@media(max-width:600px){.traffic-map-editor{padding:16px}.traffic-map-steps{gap:8px;font-size:12px}.traffic-map-editor-actions>*{flex:1 1 40%}.traffic-map-json summary span{display:block;margin:6px 0 0}.traffic-map-editor .traffic-map-viewport{height:360px}}

.traffic-image-map.is-choosing .traffic-map-selection{display:none}
.traffic-image-map.is-choosing .traffic-map-status{visibility:visible;left:8px;right:8px;bottom:8px;max-width:none;max-height:60%;overflow:auto}

/* Phone map pages use the space left by their actual header and copy, rather
   than adding 65dvh below them. Tall copy and landscape can still scroll. */
@media(max-width:600px){
  body.audience-ui:has(.traffic-map-screen){min-height:100dvh;place-items:start center}
  body.audience-ui .phone-shell:has(.traffic-map-screen){display:flex;flex-direction:column;height:100dvh;min-height:100dvh}
  body.audience-ui .phone-shell:has(.traffic-map-screen)>.mini-bar{flex-shrink:0;padding:max(6px,env(safe-area-inset-top)) 12px 6px!important}
  body.audience-ui .phone-shell:has(.traffic-map-screen)>.app-view{display:flex;flex:1;min-height:0;overflow-y:auto}
  body.audience-ui .phone-shell .screen.route-screen.traffic-map-screen:not(.home-screen):not(.summary-screen){display:flex;flex:1;flex-direction:column;min-height:100%;padding:10px 12px max(12px,env(safe-area-inset-bottom))!important;gap:8px!important;overflow:visible!important}
  body.audience-ui .phone-shell .traffic-map-screen>.screen-title,
  body.audience-ui .phone-shell .traffic-map-screen>.current-section-card{flex-shrink:0}
  body.audience-ui .phone-shell .screen.traffic-map-screen>.screen-title{margin:0!important;gap:4px!important}
  body.audience-ui .phone-shell .screen.route-screen.traffic-map-screen>.screen-title h2{margin:0;font-size:clamp(20px,5.2vw,22px)!important;line-height:1.25!important;overflow-wrap:anywhere}
  body.audience-ui .phone-shell .screen.route-screen.traffic-map-screen>.screen-title p{max-width:100%!important;margin:6px 0 0!important;font-size:13px!important;line-height:1.45!important;overflow-wrap:anywhere}
  body.audience-ui .phone-shell .traffic-map-screen>.current-section-card{margin:0;padding:6px 10px;gap:8px;border-radius:14px}
  body.audience-ui .phone-shell .traffic-map-screen>.current-section-card strong{font-size:16px;line-height:1.3}
  body.audience-ui .phone-shell .traffic-map-screen>.current-section-card button{min-width:44px;min-height:44px;padding:6px 8px;font-size:12px;gap:5px}
  body.audience-ui .phone-shell .traffic-map-screen>.traffic-image-map{display:flex;flex:1 0 260px;min-height:260px;margin:0;border-radius:16px}
  body.audience-ui .phone-shell .traffic-map-screen .traffic-map-viewport{flex:1;height:auto;min-height:260px;max-height:none}
  body.audience-ui .phone-shell .traffic-map-screen .traffic-map-tools{top:8px;right:8px;gap:8px}
  body.audience-ui .phone-shell .traffic-map-screen .traffic-map-tools button{min-width:44px;min-height:44px;padding:6px;font-size:15px}
  body.audience-ui .phone-shell .traffic-map-screen .traffic-map-status{padding:6px 8px;line-height:1.4}
  body.audience-ui .phone-shell .traffic-map-screen .traffic-map-selection{left:6px;right:6px;bottom:6px;max-height:75%;padding:8px 10px}
  body.audience-ui .phone-shell .screen.traffic-map-screen .traffic-map-selection .primary-action{min-height:44px!important;padding:8px;font-size:13px!important}
}

/* Keep loading feedback independent of the zoom badge and selected-point card. */
.traffic-map-loading{position:absolute;inset:0;z-index:7;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;background:var(--aud-card-bg,#f1f5f6);color:var(--aud-text,#243b44);text-align:center;font-size:15px;line-height:1.6}
.traffic-image-map.is-ready .traffic-map-loading{display:none}
.traffic-image-map:not(.is-ready) .traffic-map-status,.traffic-image-map:not(.is-ready) .traffic-map-selection{visibility:hidden}
.traffic-map-spinner{width:34px;height:34px;border:3px solid #8daeb555;border-top-color:#229bb7;border-radius:50%;animation:traffic-map-spin .9s linear infinite}
.traffic-image-map.is-error .traffic-map-spinner{display:none}
.traffic-map-loading [data-map-retry]{min-width:110px;min-height:44px;padding:10px 20px;border:1px solid #229bb7;border-radius:10px;background:#fff;color:#183e51;cursor:pointer}
.traffic-map-loading [hidden]{display:none!important}
@keyframes traffic-map-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.traffic-map-spinner{animation:none}}
