/* Existing visual cascade; purpose-driven motion is defined in styles.css and map.css. */
.school-map-canvas{position: relative; isolation: isolate; width: 100%; height: 100%; min-height: 0px; overflow: hidden; border-radius: 14px; background: rgb(255, 254, 250); color: rgb(35, 76, 59); font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif;}
.school-map-svg{display: block; width: 100%; height: 100%; min-height: 0px; touch-action: none; user-select: none;}
.school-map-canvas .map-county{fill: rgb(244, 245, 238); stroke: rgb(199, 210, 191); stroke-width: 1.15;}
.school-map-canvas .map-county.has-schools{fill: rgb(227, 236, 217);}
.school-map-canvas .map-city-label{font-family: inherit; font-size: var(--map-label-size,15px); font-weight: 600; fill: rgb(82, 107, 84); paint-order: stroke; stroke: rgb(255, 254, 250); stroke-width: 3px; stroke-linejoin: round; pointer-events: none;}
.school-map-canvas .map-inset-box{fill: rgb(255, 254, 250); stroke: rgb(224, 230, 219); stroke-width: 1.1;}
.school-map-canvas .map-inset-label{font-family: inherit; font-size: var(--map-inset-label-size,15px); font-weight: 600; fill: rgb(35, 76, 59); pointer-events: none;}
.school-map-canvas .map-inset-note{font-family: inherit; font-size: var(--map-note-size,14px); fill: rgb(108, 117, 103); pointer-events: none;}
.school-map-canvas .map-marker{cursor: pointer; outline: none;}
.school-map-canvas .map-marker-hit-area{fill: transparent; stroke: none; pointer-events: all;}
.school-map-canvas .map-dot{stroke: rgb(255, 254, 250); stroke-width: 2; filter: drop-shadow(rgba(35, 76, 59, 0.145) 0px 1px 2px);}
.school-map-canvas .map-marker:hover .map-dot, .school-map-canvas .map-marker:focus-visible .map-dot{stroke: rgb(35, 76, 59); stroke-width: 3;}
.school-map-canvas .map-selected-halo{fill: rgb(217, 197, 156); fill-opacity: 0.4; stroke: rgb(155, 120, 62); stroke-opacity: 0.85; stroke-width: 1.5; pointer-events: none;}
.school-map-canvas .map-cluster-count{font: 700 13px system-ui, sans-serif; fill: rgb(255, 254, 250); pointer-events: none;}
.school-map-canvas .map-controls{position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 7px; z-index: 3;}
.school-map-canvas .map-controls button{box-sizing: border-box; display: grid; place-items: center; width: 46px; min-width: 44px; height: 46px; min-height: 44px; padding: 0px; border: 1px solid rgb(211, 221, 204); background: rgb(255, 254, 250); color: rgb(35, 76, 59); font: 600 23px "Microsoft JhengHei", sans-serif; border-radius: 10px; cursor: pointer; box-shadow: rgba(35, 76, 59, 0.047) 0px 2px 8px;}
.school-map-canvas .map-controls button:last-child{font-size: 14px;}
.school-map-canvas .map-controls button:hover{background: rgb(239, 243, 233); border-color: rgb(169, 185, 159);}
.school-map-canvas .map-controls button:focus-visible, .school-map-canvas .map-school-chooser button:focus-visible{outline: rgb(173, 133, 71) solid 3px; outline-offset: 3px;}
.school-map-canvas .map-location-status{position: absolute; left: 16px; right: 16px; bottom: 13px; width: fit-content; max-width: calc(100% - 32px); padding: 4px 7px; border-radius: 5px; background: rgba(255, 254, 250, 0.91); color: rgb(91, 107, 87); font-size: 14px; line-height: 1.5; pointer-events: none;}
.school-map-canvas .map-legend{position: absolute; inset: 16px auto auto 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px; width: fit-content; max-width: calc(100% - 96px); height: auto; min-height: 0px; margin: 0px; padding: 8px 10px; border: 1px solid rgb(224, 230, 219); border-radius: 9px; background: rgba(255, 254, 250, 0.91); color: rgb(82, 101, 78); font-size: 14px; line-height: 1.5; pointer-events: none;}
.school-map-canvas .map-legend span{display: flex; align-items: center; gap: 7px; white-space: nowrap;}
.school-map-canvas .map-legend i{width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: rgb(255, 254, 250) 0px 0px 0px 2px; flex: 0 0 auto;}
.school-map-canvas .map-tooltip{position: absolute; z-index: 6; max-width: 240px; padding: 9px 12px; border-radius: 9px; box-shadow: rgba(35, 76, 59, 0.145) 0px 5px 20px; background: rgb(35, 76, 59); color: rgb(255, 254, 250); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; pointer-events: none;}
.school-map-canvas .map-tooltip[hidden], .school-map-canvas .map-school-chooser[hidden]{display: none;}
.school-map-canvas .map-school-chooser{box-sizing: border-box; position: absolute; z-index: 7; top: 76px; left: 50%; transform: translateX(-50%); width: min(420px, 100% - 28px); max-height: calc(100% - 128px); overflow: auto; overscroll-behavior: contain; padding: 10px 14px 12px; background: rgb(255, 254, 250); border: 1px solid rgb(211, 221, 204); border-radius: 14px; box-shadow: rgba(35, 76, 59, 0.145) 0px 14px 38px;}
.school-map-canvas .map-chooser-head{display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0px 0px 8px; color: rgb(35, 76, 59); font-size: 18px; line-height: 1.5;}
.school-map-canvas .map-chooser-head strong{font-weight: 600;}
.school-map-canvas .map-chooser-head button{flex: 0 0 auto; min-height: 44px; min-width: 52px; padding: 6px 8px; border: 0px; border-radius: 7px; background: transparent; color: rgb(91, 107, 87); font: 16px "Microsoft JhengHei", sans-serif; cursor: pointer;}
.school-map-canvas .map-chooser-head button:hover{background: rgb(239, 243, 233);}
.school-map-canvas .map-school-choice{box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 12px 8px; border-width: 1px 0px 0px; border-style: solid none none; border-color: rgb(224, 230, 219) currentcolor currentcolor; border-image: none; background: rgb(255, 254, 250); color: rgb(35, 76, 59); text-align: left; font: 18px / 1.6 "Microsoft JhengHei", sans-serif; cursor: pointer;}
.school-map-canvas .map-school-choice > span{min-width: 0px; overflow-wrap: anywhere;}
.school-map-canvas .map-school-choice > small{flex: 0 0 auto; color: rgb(108, 117, 103); font-size: 14px;}
.school-map-canvas .map-school-choice:hover{background: rgb(239, 243, 233);}
.school-map-canvas .map-fallback{margin: 0px; padding: 50px 24px; line-height: 1.8; font-size: 18px; color: rgb(91, 107, 87);}
@media (max-width: 520px) {
.school-map-canvas .map-controls{top: 12px; right: 12px;}
.school-map-canvas .map-legend{left: 12px; top: 12px; max-width: calc(100% - 84px); gap: 6px 10px; padding: 7px 9px;}
.school-map-canvas .map-location-status{left: 10px; right: 10px; bottom: 10px; max-width: calc(100% - 20px);}
.school-map-canvas .map-school-chooser{top: 72px; padding-left: 10px; padding-right: 10px;}
}
.school-map-canvas{display: flex; flex-direction: column;}
.school-map-canvas .map-toolbar{display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; min-height: 58px; padding: 8px 13px 4px;}
.school-map-canvas .school-map-svg{display: block; width: 100%; height: auto; flex: 1 1 0%; min-height: 0px;}
.school-map-canvas .school-map-svg:focus-visible{outline: rgb(173, 133, 71) solid 3px; outline-offset: -3px;}
.school-map-canvas .map-overview-key{color: rgb(98, 116, 91); font-size: 14px; line-height: 1.5;}
.school-map-canvas .map-toolbar .map-controls{position: static; top: auto; right: auto; display: flex; flex-direction: row; gap: 6px; flex: 0 0 auto; margin: 0px; padding: 0px;}
.school-map-canvas .map-toolbar .map-controls button{width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 9px;}
.school-map-canvas .map-toolbar .map-controls button:last-child{width: 52px; font-size: 14px;}
.school-map-canvas .map-toolbar .map-legend{position: static; inset: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; width: auto; max-width: none; height: auto; min-height: 0px; margin: 0px; padding: 0px; border: 0px; background: none; font-size: 14px;}
.school-map-canvas .map-location-status{position: static; left: auto; right: auto; bottom: auto; flex: 0 0 auto; width: auto; max-width: none; min-height: 34px; padding: 7px 14px 10px; margin: 0px; border-radius: 0px; font-size: 14px; line-height: 1.5; background: rgb(255, 254, 250);}
.school-map-canvas .map-county{cursor: pointer; stroke-linejoin: round;}
.school-map-canvas .map-county:hover{fill: rgb(205, 223, 189); stroke: rgb(118, 147, 102); stroke-width: 1.8;}
.school-map-canvas.is-county-view .map-county{fill: rgb(226, 235, 214); stroke: rgb(156, 175, 142); cursor: default;}
.school-map-canvas .map-county-line{stroke: rgb(130, 151, 124); stroke-width: 1; opacity: 0.65; pointer-events: none;}
.school-map-canvas .map-county-label{cursor: pointer; outline: none;}
.school-map-canvas .map-county-label rect{fill: rgb(255, 254, 250); stroke: rgb(211, 221, 204); stroke-width: 1; vector-effect: non-scaling-stroke;}
.school-map-canvas .map-county-label text{font-family: inherit; fill: rgb(49, 82, 58); pointer-events: none;}
.school-map-canvas .map-label-name{font-weight: 500;}
.school-map-canvas .map-label-count{font-weight: 700; font-variant-numeric: tabular-nums;}
.school-map-canvas .map-county-label.is-empty rect{fill: rgb(250, 251, 247);}
.school-map-canvas .map-county-label.is-empty text{fill: rgb(132, 145, 123);}
.school-map-canvas .map-county-label:hover rect, .school-map-canvas .map-county-label:focus-visible rect{fill: rgb(237, 243, 229); stroke: rgb(109, 140, 94); stroke-width: 2.5;}
.school-map-canvas .map-county-list{display: none;}
.school-map-canvas.is-compact-map:not(.is-county-view) .map-labels .map-county-label, .school-map-canvas.is-compact-map:not(.is-county-view) .map-county-lines{display: none;}
.school-map-canvas.is-compact-map:not(.is-county-view) .map-county-list{display: grid; grid-template-columns: repeat(3, minmax(0px, 1fr)); flex: 0 0 auto; gap: 5px; max-height: 142px; overflow: auto; padding: 5px 9px 8px; border-top: 1px solid rgb(224, 230, 219); overscroll-behavior: contain;}
.school-map-canvas .map-county-choice{display: flex; justify-content: space-between; align-items: center; gap: 5px; min-height: 40px; padding: 7px 9px; border: 1px solid rgb(224, 230, 219); border-radius: 7px; background: rgb(255, 254, 250); color: rgb(49, 82, 58); font: 14px / 1.5 "Microsoft JhengHei", sans-serif; cursor: pointer; white-space: nowrap;}
.school-map-canvas .map-county-choice:hover{background: rgb(239, 243, 233);}
.school-map-canvas .map-county-choice b{font-size: 16px;}
.school-map-canvas [hidden]{display: none !important;}
.school-map-canvas .map-controls button:focus-visible, .school-map-canvas .map-county-choice:focus-visible{outline: rgb(173, 133, 71) solid 3px; outline-offset: 2px;}
.school-mini-map-svg{display: block; width: 100%; height: 100%; min-height: 140px; background: rgb(247, 248, 240); border: 1px solid rgb(224, 230, 219); border-radius: 10px;}
.school-mini-map-svg .map-mini-county{fill: rgb(226, 235, 214); stroke: rgb(165, 181, 155); stroke-width: 1.2; stroke-linejoin: round;}
.school-mini-map-svg .map-mini-point{stroke: rgb(255, 254, 250); stroke-width: 2.5;}
@media (max-width: 520px) {
.school-map-canvas .map-toolbar{padding: 7px 9px 3px; gap: 7px;}
.school-map-canvas .map-overview-key{font-size: 13px;}
.school-map-canvas .map-toolbar .map-controls{gap: 4px;}
.school-map-canvas .map-location-status{padding: 5px 10px 8px; font-size: 13px;}
}
.school-map-canvas{background: rgb(247, 245, 239); color: rgb(23, 63, 53); font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;}
.school-map-canvas .map-county{fill: rgb(238, 238, 227); stroke: rgb(196, 204, 188);}
.school-map-canvas .map-county.has-schools{fill: rgb(220, 231, 210);}
.school-map-canvas.is-county-view .map-county:not(.is-current){fill: rgb(233, 236, 223); stroke: rgb(213, 220, 203);}
.school-map-canvas.is-county-view .map-county.is-current{fill: rgb(223, 235, 212); stroke: rgb(168, 137, 91); stroke-width: 1.4;}
.school-map-canvas .map-inset-box{fill: rgb(250, 249, 243); stroke: rgb(224, 225, 212);}
.school-map-canvas .map-county-label rect{fill: rgb(252, 251, 246); stroke: rgb(217, 222, 206); filter: drop-shadow(rgba(23, 63, 53, 0.024) 0px 2px 3px);}
.school-map-canvas .map-county-label .map-label-name{fill: rgb(33, 75, 59);}
.school-map-canvas .map-county-label .map-label-count{fill: rgb(157, 117, 69);}
.school-map-canvas .map-county-label:hover rect, .school-map-canvas .map-county-label:focus-visible rect{fill: rgb(239, 243, 230); stroke: rgb(184, 139, 85);}
.school-map-canvas .map-county-label.is-empty text{fill: rgb(140, 150, 130);}
.school-map-canvas .map-selected-halo{fill: rgb(217, 185, 124); fill-opacity: 0.24; stroke: rgb(184, 139, 85); stroke-opacity: 0.8; stroke-width: 1.5;}
.school-map-canvas .map-marker.is-selected .map-dot{stroke: rgb(184, 139, 85); stroke-width: 3;}
.school-map-canvas .map-toolbar .map-controls button{color: rgb(23, 63, 53); background: rgb(252, 251, 246); font-family: inherit;}
.school-map-canvas .map-toolbar .map-controls button:active{transform: scale(0.94); background: rgb(233, 237, 223);}
.school-map-canvas .map-location-status{background: rgb(247, 245, 239); color: rgb(99, 112, 92);}
.school-map-canvas.is-map-moving .map-location-status{color: rgb(154, 115, 68);}
.school-map-canvas .map-tooltip{background: rgb(23, 63, 53); color: rgb(252, 251, 246);}
.school-map-canvas .map-school-chooser{background: rgb(252, 251, 246); border-color: rgb(213, 221, 201); box-shadow: rgba(23, 63, 53, 0.145) 0px 16px 42px;}
.school-map-canvas .map-school-choice{background: rgb(252, 251, 246); font-family: inherit;}
.school-map-canvas .map-county-choice{font-family: inherit; background: rgb(252, 251, 246);}
.school-map-canvas .map-county-choice:active{transform: scale(0.97);}
/* Finite interaction feedback; the single optional idle cue is defined below. */
.school-map-canvas .map-marker-ripple{display:none}
.school-map-canvas .is-arrival-pending .map-county-visual{opacity:0}
.school-map-canvas .is-arriving .map-county-visual{animation:map-arrival var(--motion-enter) var(--motion-ease) both}
.school-map-canvas .is-arriving .map-label-name{animation:map-arrival var(--motion-enter) var(--motion-ease) both}
@keyframes map-arrival{from{opacity:0}to{opacity:1}}
.school-map-canvas .map-labels .map-county-pulse{opacity:0}
body.is-exhibiting .school-map-canvas .map-county.is-current{animation:map-selected-feedback var(--motion-map) var(--motion-ease) 2}
@keyframes map-selected-feedback{0%,100%{filter:none}50%{filter:brightness(1.12)}}
@media(prefers-reduced-motion:reduce){.school-map-canvas .is-arriving .map-county-visual,.school-map-canvas .is-arriving .map-label-name,body.is-exhibiting .school-map-canvas .map-county.is-current{animation:none}}

/* One restrained idle cue, requested for a living but quiet home screen. */
#school-map{animation:map-quiet-light var(--motion-idle) ease-in-out infinite}
@keyframes map-quiet-light{0%,100%{box-shadow:inset 0 0 24px rgba(71,121,181,.025)}50%{box-shadow:inset 0 0 42px rgba(71,121,181,.12)}}
body.school-detail-open #school-map,body:has(dialog[open]) #school-map{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){#school-map{animation:none}}

.school-map-canvas .map-interaction-pulse{opacity:0;transform-box:fill-box;transform-origin:center;pointer-events:none}

/* Stronger hover ripples; no black browser focus rectangle on county shapes. */
#school-map .map-county-pulse,#school-map .map-interaction-pulse{stroke-width:2.5}
#school-map .map-county,#school-map .map-county-label{outline:none}
#school-map .map-county:focus-visible{outline:none;stroke:var(--region-color,#4779b5);stroke-width:1.6}


/* --- improved county hover highlight --- */
.school-map-canvas:not(.is-county-view).is-county-previewing .map-land .map-county{
  transition: fill-opacity .22s ease, filter .22s ease, stroke-width .22s ease;
}
.school-map-canvas:not(.is-county-view) .map-land .map-county.is-bubble-dimmed{
  fill-opacity: 0.18 !important;
  filter: grayscale(0.35) brightness(1.05);
  stroke-opacity: 0.35;
}
.school-map-canvas:not(.is-county-view) .map-land .map-county.is-bubble-active{
  fill-opacity: 0.92 !important;
  stroke: #ffffff !important;
  stroke-width: 2.6 !important;
  filter: brightness(1.08) saturate(1.15);
  paint-order: stroke fill;
}
.school-map-canvas:not(.is-county-view) .map-labels .map-county-label.is-bubble-dimmed{
  opacity: 0.38;
  transition: opacity .22s ease;
}
.school-map-canvas:not(.is-county-view) .map-labels .map-county-label.is-bubble-active .map-county-bubble{
  transform: scale(1.18);
  stroke: #fff;
  stroke-width: 3.2;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.55));
}
.school-map-canvas:not(.is-county-view) .map-labels .map-county-label.is-bubble-active .map-county-pulse{
  opacity: 1 !important;
  stroke-width: 2.8;
}
