/* Existing visual cascade; purpose-driven motion is defined in styles.css and map.css. */
:root{--ink: #202c3b; --muted: #687789; --line: #e2e8ef; --accent: #426da5;}
.observatory{color: var(--ink); background: rgb(237, 242, 248);}
.observatory .site-header{background: rgba(255, 255, 255, 0.93); border-bottom: 1px solid var(--line); box-shadow: none;}
.observatory .brand-mark{color: rgb(66, 109, 165); background: rgb(237, 243, 252); border: 1px solid rgb(225, 233, 245); border-radius: 12px;}
.observatory .brand-copy strong{color: rgb(45, 64, 88);}
.observatory .brand-copy > span{color: rgb(115, 128, 147);}
.observatory .site-header .count-totals strong{font-variant-numeric: tabular-nums; min-width: 2ch; color: rgb(32, 37, 45) !important;}
.observatory .site-header .count-totals span{color: rgb(101, 114, 133);}
.observatory .quiet-button{color: rgb(101, 114, 133);}
.observatory .filter-bar{background: rgba(255, 255, 255, 0.875); border: 1px solid var(--line); box-shadow: none; border-radius: 12px;}
.observatory .filter-field > label{color: rgb(104, 119, 137);}
.observatory .filter-field select, .observatory .search-control{background: rgb(247, 249, 252); color: rgb(38, 55, 77); border-color: rgb(229, 235, 242); border-radius: 8px;}
.observatory .search-control:focus-within{border-color: rgb(138, 169, 209); box-shadow: rgba(66, 109, 165, 0.063) 0px 0px 0px 3px;}
.observatory .filter-field select:focus{outline-color: rgb(138, 169, 209);}
.observatory .reset-button{background: rgb(239, 244, 251); color: rgb(66, 101, 143); border: 1px solid rgb(221, 230, 243); border-radius: 8px;}
.observatory .filter-chip, .observatory .filter-chip:nth-child(2n){color: rgb(61, 96, 137); background: rgb(237, 243, 251); border: 1px solid rgb(220, 231, 245);}
.observatory #search-feedback, .observatory .dashboard-footer{color: rgb(115, 128, 147);}
.observatory .map-panel{background: rgba(249, 251, 255, 0.7); border: 1px solid rgb(222, 230, 239); box-shadow: rgba(35, 62, 91, 0.016) 0px 5px 20px; border-radius: 16px;}
#school-map .school-map-svg{background: transparent;}
.observatory .map-panel-heading h2{color: rgb(45, 64, 88);}
.observatory .map-panel-heading p{color: rgb(115, 128, 147);}
#school-map .map-controls button, .observatory #back-to-taiwan, .observatory .map-results-button{background: rgba(255, 255, 255, 0.92); color: rgb(73, 99, 131); border: 1px solid rgb(223, 231, 241); box-shadow: rgba(39, 63, 93, 0.02) 0px 2px 8px;}
#school-map .map-inset-box{fill: rgba(255, 255, 255, 0.7); stroke: rgb(223, 231, 241);}
#school-map .map-location-status, .observatory .map-data-note{color: rgb(115, 128, 147); background: rgba(255, 255, 255, 0.79);}
#school-map .map-county-label .map-label-name{fill: rgb(52, 76, 101);}
.observatory .chart-card, .observatory .chart-card:nth-child(n){background: rgb(255, 255, 255); border: 1px solid var(--line); border-radius: 16px; box-shadow: rgba(35, 62, 91, 0.016) 0px 5px 20px;}
.observatory .chart-card h2, .observatory .chart-card:nth-child(n) h2{color: rgb(45, 64, 88); font-family: "Dashboard Sans TC", sans-serif; font-weight: 600;}
.observatory .chart-kicker, .observatory .chart-footnote{color: rgb(116, 128, 146);}
.observatory .chart-card > header > button{color: rgb(104, 123, 148);}
.observatory .bar-item, #chart-all-content .bar-item{color: rgb(32, 37, 45);}
#chart-tool .bar-item .bar-fill, #chart-subject .bar-item .bar-fill, #chart-all-content .bar-item .bar-fill{opacity: 1; border-radius: 5px; background: var(--rank-color,#303744) !important;}
#chart-tool .bar-item .bar-label > span:first-child, #chart-subject .bar-item .bar-label > span:first-child, #chart-all-content .bar-item .bar-label > span:first-child, #chart-tool .bar-item b, #chart-subject .bar-item b, #chart-all-content .bar-item b{color: rgb(32, 37, 45) !important;}
.observatory .bar-track{background: rgb(238, 241, 246);}
.observatory .bar-item:hover, .observatory .bar-item.is-active, #chart-all-content .bar-item:hover, #chart-all-content .bar-item.is-active{background: rgb(240, 245, 251); color: rgb(32, 37, 45);}
.observatory .donut-center-number{fill: rgb(41, 59, 82);}
.observatory .donut-center-label{fill: rgb(116, 128, 146);}
.observatory .donut-legend button{color: rgb(53, 68, 89);}
.observatory .donut-legend button:hover, .observatory .donut-legend button.is-active{background: rgb(240, 245, 251);}
.observatory .search-panel{background: rgb(255, 255, 255); border: 1px solid var(--line); box-shadow: rgba(33, 59, 92, 0.125) 0px 16px 55px;}
.observatory .school-row{color: rgb(40, 60, 83); border-bottom-color: rgb(233, 237, 243);}
.observatory .school-row:hover, .observatory .school-row.is-selected{background: rgb(240, 245, 251);}
.observatory .school-row-top strong{color: rgb(40, 60, 83);}
.observatory .school-row-subline, .observatory .school-row-meta, .observatory .row-number{color: rgb(104, 119, 137);}
.observatory .school-type, .observatory .school-type.primary, .observatory .school-type.junior, .observatory .school-type.senior{background: rgb(238, 243, 250); color: rgb(83, 106, 134);}
#school-dialog, #application-dialog{--detail-region: #4a9bd9; border-right: 1px solid rgb(223, 230, 239); border-bottom: 1px solid rgb(223, 230, 239); border-left: 1px solid rgb(223, 230, 239); border-image: none; border-top: 4px solid var(--detail-region); box-shadow: rgba(27, 49, 67, 0.15) 0px -12px 60px;  background: color-mix(in srgb,var(--detail-region) 3%,white) !important;}
#school-backdrop{background: rgba(27, 45, 70, 0.3); backdrop-filter: blur(4px);}
#school-dialog .dialog-topbar, #school-dialog .sheet-footer, #application-dialog .dialog-topbar{border-color: rgb(228, 233, 239); background: color-mix(in srgb,var(--detail-region) 5%,white) !important;}
#school-dialog .school-breadcrumb, #school-dialog .school-breadcrumb button{color: rgb(98, 117, 141);}
#school-dialog .school-breadcrumb strong{color: rgb(45, 64, 88);}
#school-dialog .detail-hero h2, #application-title, #application-content h2{color: rgb(38, 55, 75);}
#school-dialog .detail-metadata, #school-dialog .detail-main h3, #school-dialog .detail-side h3{color: rgb(89, 107, 128);}
#school-dialog .priority-facts, #application-dialog .priority-facts{border: 1px solid color-mix(in srgb,var(--detail-region) 15%,white); border-radius: 12px; background: color-mix(in srgb,var(--detail-region) 7%,white) !important;}
#school-dialog .priority-facts h3, #application-dialog .priority-facts h3{color: rgb(92, 109, 128);}
#school-dialog .priority-facts p, #application-dialog .priority-facts p{color: rgb(40, 60, 83);}
#school-dialog .priority-facts small{color: rgb(113, 128, 148);}
#school-dialog .detail-main, #school-dialog .detail-lead, #school-dialog .story-points{color: rgb(52, 70, 91);}
#school-dialog .story-points li::marker{color: var(--detail-region);}
#school-dialog .detail-side{background: rgb(255, 255, 255); border: 1px solid rgb(227, 233, 240); border-radius: 14px;}
#school-dialog .detail-location-map, #school-dialog .school-mini-map-svg{background: rgb(248, 250, 252); border-color: rgb(227, 233, 240);}
.observatory .school-mini-map-svg .map-mini-county{fill: var(--county-color,#4a9bd9); fill-opacity: 0.4; stroke: var(--county-color,#4a9bd9);}
.observatory .map-mini-district.is-selected{fill: rgb(238, 241, 245); stroke: rgb(140, 156, 175);}
.observatory .map-mini-district-name{fill: rgb(82, 103, 125);}
#school-dialog .participation-list dt{color: rgb(113, 128, 148);}
#school-dialog .participation-list dd{color: rgb(53, 74, 99);}
#school-dialog .participation-note, #school-dialog .location-note, #school-dialog .address{color: rgb(104, 119, 137);}
#school-dialog .school-links a, #school-dialog .school-website{color: rgb(66, 109, 165);}
#school-dialog .detail-switch button, #school-dialog #close-school-dialog, #school-dialog .sheet-footer button, #close-application, .observatory .icon-button{background: rgb(255, 255, 255); border: 1px solid rgb(223, 230, 239); color: rgb(73, 99, 131);}
#school-dialog .sheet-footer{color: rgb(104, 119, 137);}
.observatory .chart-dialog, .observatory .about-dialog{background: rgb(255, 255, 255); border: 1px solid var(--line); box-shadow: rgba(27, 49, 67, 0.17) 0px 20px 80px;}
.observatory .chart-dialog .dialog-topbar, .observatory .about-dialog .dialog-topbar{background: rgb(248, 250, 252); border-color: var(--line);}
.observatory .chart-dialog h2, .observatory .about-content h2{color: rgb(45, 64, 88);}
.observatory #chart-dialog-note, .observatory .about-content, #application-content{color: rgb(89, 107, 128);}
.observatory .chart-dialog::backdrop, .observatory .about-dialog::backdrop, #application-dialog::backdrop{background: rgba(27, 45, 70, 0.35); backdrop-filter: blur(4px);}
#application-content .detail-disclosure, .observatory .about-content .detail-disclosure{background: rgb(255, 255, 255); border: 1px solid var(--line); border-radius: 10px; color: rgb(53, 74, 99);}
#application-content .disclosure-content, .observatory .about-content .disclosure-content{background: rgb(255, 255, 255); color: rgb(70, 88, 110);}
#application-content .content-review-note{background: rgb(255, 249, 237); border-color: rgb(240, 227, 198); color: rgb(132, 109, 64);}
.observatory .review-badge{background: rgb(255, 244, 223); color: rgb(140, 112, 59);}
#application-content .original-values > div{border-color: var(--line);}
@media (prefers-reduced-motion: reduce) {
.observatory{background: rgb(237, 242, 248);}
}
#school-map.school-map-canvas{background: transparent; color: rgb(52, 76, 101);}
#school-map .map-location-status{position: absolute; left: 0px; top: 0px; width: 1px; height: 1px; padding: 0px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; background: none;}
.observatory{background: rgb(238, 242, 247);}
.observatory .chart-kicker, .observatory .chart-footnote, .observatory .chart-card h2 small, .observatory .map-data-note, .observatory #map-description, .observatory .dashboard-footer, .observatory .brand-copy > span, .observatory .people-review-note, .observatory .list-footnote, .observatory .school-row-subline, .observatory .priority-facts small, .observatory .participation-note, .observatory .location-note, .observatory .mini-attribution, .observatory .donut-center-label{display: none !important;}
.observatory #search-feedback{position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);}
.observatory .filter-field > label{font-size: 12px; color: rgb(83, 101, 123);}
.observatory .site-header .count-totals span{font-size: 12px;}
.observatory .chart-card > header > button{font-size: 12px;}
.observatory .dashboard{grid-template-rows: 54px auto minmax(0px, 1fr) 0px; gap: 7px;}
.observatory .filter-status{min-height: 0px;}
.observatory .filter-status:has(.active-filters[hidden]){height: 0px;}
#school-map.school-map-canvas{background: rgb(245, 249, 255);}
#school-map .map-controls{display: grid; grid-template-columns: 31px 31px 45px; gap: 6px; align-items: center;}
#school-map .map-controls #back-to-taiwan{grid-column: 1 / -1; width: 100%; height: 29px; min-height: 29px; font-size: 12px; position: static; margin: 0px;}
#school-map .map-controls button:nth-child(3){width: 45px; font-size: 12px;}
#school-map .map-tooltip:not([hidden]){display:block !important; max-width:280px; white-space:pre-line; line-height:1.55; font-size:14px; padding:10px 14px; border-radius:12px; box-shadow:0 8px 28px rgba(15,40,70,.22); background:rgba(18,42,68,.94); color:#f7fbff; z-index:20;}
#school-map .map-tooltip[hidden]{display:none !important; opacity:0 !important; pointer-events:none !important; width:0 !important; height:0 !important; padding:0 !important; overflow:hidden !important;}
#school-map .map-marker-ripple{transform-box: fill-box; transform-origin: center center; opacity: 0.75; stroke-width: 2.5;}
#school-map .map-marker.is-filtered-out .map-marker-ripple{opacity: 0;}
.observatory .exhibit-toggle{flex: 0 0 auto; border: 1px solid rgb(219, 228, 241); background: rgb(239, 244, 252); color: rgb(61, 96, 141); border-radius: 9px; padding: 8px 12px; font: 500 13px "Dashboard Sans TC", sans-serif; cursor: pointer; white-space: nowrap;}
.observatory .exhibit-toggle[aria-pressed="true"]{background: rgb(65, 108, 159); color: white; border-color: rgb(65, 108, 159); box-shadow: rgba(88, 136, 195, 0.1) 0px 0px 0px 4px;}
@media (min-width: 1050px) and (max-height: 850px) {
.observatory .dashboard{grid-template-rows: 48px auto minmax(0px, 1fr) 0px;}
.observatory .site-header .count-totals{gap: 13px;}
.observatory .exhibit-toggle{font-size: 12px; padding: 7px 9px;}
}
body:not(.school-detail-open) #school-backdrop{display: none !important; pointer-events: none;}
#school-map .map-school-name{font-family: "Dashboard Sans TC", sans-serif; fill: rgb(38, 63, 92); stroke: rgb(255, 255, 255); stroke-opacity: 0.96; paint-order: stroke; stroke-linejoin: round; font-weight: 600; letter-spacing: 0.01em;}
#school-map .map-district-name{font-family: "Dashboard Sans TC", sans-serif; fill: rgb(101, 117, 138); stroke: rgb(244, 248, 253); stroke-opacity: 0.8; letter-spacing: 0.1em;}
#school-map .map-district{stroke: rgb(141, 163, 184); stroke-opacity: 0.5;}
#school-map .map-county.is-neighbor, #school-map .map-county.is-neighbor:hover, #school-map .map-county.is-neighbor:focus{cursor: pointer; stroke: rgb(255, 255, 255); stroke-width: 1.1; filter: none;}
#school-map .map-county.is-neighbor:focus-visible{outline: none; stroke: rgb(120, 147, 176); stroke-width: 2;}
.observatory .exhibit-toggle{position: relative; overflow: hidden;}
.observatory .exhibit-progress{position: absolute; bottom: 0px; left: 0px; height: 3px; width: 100%; background: rgb(183, 214, 255); transform-origin: left center;  pointer-events: none;}
@media (prefers-reduced-motion: reduce) {
.observatory .exhibit-progress{transform: scaleX(1);}
}
.observatory .search-control, .observatory #school-search{caret-color: rgb(0, 0, 0); color: rgb(32, 37, 45); cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='24' viewBox='0 0 16 24'%3E%3Cpath d='M4 2H12M8 2V22M4 22H12' fill='none' stroke='white' stroke-width='4'/%3E%3Cpath d='M4 2H12M8 2V22M4 22H12' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 8 12, text;}
.observatory .search-control svg{color: rgb(32, 37, 45); stroke: rgb(32, 37, 45);}
#chart-tool .bar-fill, #chart-subject .bar-fill{position: relative; overflow: hidden;}
#school-dialog .dialog-topbar, #school-dialog .sheet-footer, #application-dialog .dialog-topbar{background: color-mix(in srgb,var(--detail-region) 10%,white) !important;}
#school-dialog .priority-facts, #application-dialog .priority-facts{border-color: color-mix(in srgb,var(--detail-region) 25%,white); background: color-mix(in srgb,var(--detail-region) 14%,white) !important;}
#school-dialog .detail-location-map, #school-dialog .school-mini-map-svg{background: color-mix(in srgb,var(--detail-region) 6%,white); border-color: color-mix(in srgb,var(--detail-region) 18%,white);}
.observatory .filter-status{padding: 0px; margin: 0px; overflow: hidden; visibility: hidden; height: 0px !important; min-height: 0px !important;}
.observatory .dashboard{grid-template-rows: 54px 0px minmax(0px, 1fr) 0px;}
.observatory .chart-card{position: relative;}
@media (min-width: 1050px) and (max-height: 850px) {
.observatory .dashboard{grid-template-rows: 48px 0px minmax(0px, 1fr) 0px;}
}
#school-dialog .priority-facts, #application-dialog .priority-facts{position: relative; overflow: hidden;}
#school-map.school-map-canvas{background: linear-gradient(125deg, rgb(245, 249, 255) 0%, rgb(214, 231, 252) 38%, rgb(234, 241, 252) 65%, rgb(248, 251, 255) 100%) 0% 0% / 180% 180%;}
#school-dialog{isolation: isolate;}
@media (prefers-reduced-motion: reduce) {
#school-map.school-map-canvas{background-position: 50% 50%;}
}
#school-map.school-map-canvas{background-image: linear-gradient(120deg, rgb(248, 251, 255) 0%, rgb(194, 217, 244) 32%, rgb(226, 237, 252) 60%, rgb(255, 255, 255) 85%); background-size: 220% 220%;}
.observatory .bar-track{background: rgb(234, 240, 247);}
.observatory .brand-copy strong{font-family: "Dashboard Sans TC", sans-serif; font-size: 19px; font-weight: 650; letter-spacing: 0.025em; white-space: nowrap; color: rgb(41, 62, 89);}
.observatory .brand-mark{color: rgb(82, 121, 167); background: rgb(237, 243, 251); border-color: rgb(223, 232, 244);}
.observatory .map-panel-heading h2, .observatory .chart-card h2, #school-dialog .detail-hero h2{font-family: "Dashboard Sans TC", sans-serif; font-weight: 600; letter-spacing: 0.015em;}
.observatory .map-panel-heading h2, .observatory .chart-card h2{font-size: 18px; line-height: 1.45; color: rgb(45, 64, 88);}
.observatory .site-header .count-totals p{display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 65px;}
.observatory .site-header .count-totals strong{font-family: "Dashboard Sans TC", sans-serif; font-size: 23px; line-height: 1.05; font-weight: 600; letter-spacing: -0.015em;}
.observatory .site-header .count-totals span{font-size: 12px; line-height: 1.2; margin: 0px; color: rgb(101, 114, 133); white-space: nowrap;}
.observatory .filter-field select, .observatory .search-control{border: 1px solid rgb(226, 233, 242); background: rgb(255, 255, 255);}
.observatory .filter-field > label{color: rgb(100, 116, 138); font-weight: 500;}
.observatory .chart-card, .observatory .map-panel{border-radius: 14px;}
#school-map.school-map-canvas{background-image: linear-gradient(120deg, rgb(248, 251, 255) 0%, rgb(205, 223, 245) 32%, rgb(232, 240, 252) 60%, rgb(255, 255, 255) 85%);}
@media (min-width: 1050px) and (max-height: 850px) {
.observatory .brand-copy strong{font-size: 18px;}
.observatory .site-header .count-totals strong{font-size: 22px;}
.observatory .site-header .count-totals p{min-width: 62px;}
}

/* Preserve the existing static title accents; these are not animations. */
.observatory .chart-card h2::before { content: ""; display: inline-block; width: 4px; height: 15px; border-radius: 4px; margin-right: 8px; vertical-align: -2px; background: rgb(91, 128, 178); }
.observatory .chart-card:nth-child(2) h2::before { background: rgb(66, 155, 155); }
.observatory .chart-card:nth-child(3) h2::before { background: rgb(171, 131, 194); }


/* donut center number optically centered when label is hidden */
.observatory .donut-center-number{
  font-size: 28px;
  font-weight: 700;
  dominant-baseline: middle;
}
.observatory .donut-chart svg,
#chart-type svg{
  overflow: visible;
}


/* --- responsive scaling for different screen sizes --- */
:root{
  --ui-scale: 1;
}
@media (max-width: 1400px){
  :root{ --ui-scale: 0.94; }
}
@media (max-width: 1200px){
  :root{ --ui-scale: 0.88; }
}
@media (max-width: 992px){
  :root{ --ui-scale: 0.84; }
}
@media (min-width: 1600px){
  :root{ --ui-scale: 1.05; }
}
@media (min-width: 1920px){
  :root{ --ui-scale: 1.1; }
}

.observatory .site-header,
.observatory .dashboard,
.observatory .filter-bar,
.observatory .workspace,
.observatory .chart-card,
.observatory .map-panel{
  font-size: calc(15px * var(--ui-scale));
}
.observatory .count-totals strong,
.observatory #metric-records,
.observatory #metric-cities,
.observatory #metric-school-count,
.observatory #metric-teachers,
.observatory #metric-students{
  font-size: calc(1.55rem * var(--ui-scale)) !important;
}
.observatory .chart-card h2{
  font-size: calc(1.05rem * var(--ui-scale));
}
.observatory .donut-center-number{
  font-size: 32px;
}
.observatory .bar-item b,
.observatory .donut-legend b{
  font-size: calc(0.95rem * var(--ui-scale));
}
.school-map-canvas{
  --map-label-size: calc(13px * var(--ui-scale));
  --map-inset-label-size: calc(14px * var(--ui-scale));
  --map-note-size: calc(12px * var(--ui-scale));
}
.observatory .workspace{
  gap: calc(1rem * var(--ui-scale));
  background: transparent;
  border: 0;
  box-shadow: none;
}
.observatory .filter-bar{
  gap: calc(0.65rem * var(--ui-scale));
}
/* keep main two-column layout readable */
@media (min-width: 1100px){
  .observatory .workspace{
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
    align-items: stretch;
  }
}

/* Right-column sizing follows available card space, not the viewport font scale. */
.observatory .charts-panel{height:100%;align-self:stretch;min-height:0;min-width:0;overflow:hidden}
.observatory .charts-panel .chart-card{min-height:0;min-width:0;padding:clamp(12px,1vw,20px);display:flex;flex-direction:column;gap:0;box-sizing:border-box}
.observatory .charts-panel .chart-card>header{flex:0 0 auto;min-height:26px;gap:8px;align-items:center;flex-wrap:nowrap}
.observatory .charts-panel .chart-card h2{font-size:clamp(18px,1.2vw,23px);line-height:1.35}
.observatory .charts-panel .chart-card>header>button{font-size:clamp(11px,.75vw,14px);white-space:nowrap}
.observatory .charts-panel .chart-content{flex:1 1 0;min-height:0;min-width:0;overflow:hidden;padding:8px 0 0;box-sizing:border-box}
.observatory .charts-panel .bar-chart{height:100%;min-height:0;display:grid;grid-auto-rows:minmax(0,1fr);gap:var(--chart-row-gap,4px);align-content:stretch}
.observatory .charts-panel .bar-item{display:grid;grid-template-columns:minmax(0,1fr) 2.5ch;gap:8px;align-items:center;padding:0;min-height:0;font-size:var(--chart-font,14px);line-height:1.45}
.observatory .charts-panel .bar-label{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--chart-label-gap,3px);align-items:start;min-width:0}
.observatory .charts-panel .bar-label>span:first-child{font-size:var(--chart-font,14px);line-height:1.45;white-space:nowrap;overflow:hidden;text-overflow:clip}
.observatory .charts-panel .bar-item b{font-size:var(--chart-font,14px);line-height:1.45;align-self:center;padding:0;font-variant-numeric:tabular-nums}
.observatory .charts-panel .bar-track{height:var(--chart-bar-height,6px);width:100%;min-width:0;border-radius:8px}
.observatory .charts-panel .bar-fill{height:100%;display:block;border-radius:inherit}
.observatory .charts-panel .donut-layout{display:flex;align-items:center;justify-content:center;gap:clamp(12px,1.4vw,28px);height:100%;min-height:0;min-width:0}
.observatory .charts-panel .donut-svg{flex:0 1 var(--donut-size,180px);width:var(--donut-size,180px);height:var(--donut-size,180px);max-width:56%;max-height:100%;overflow:visible;min-width:0}
.observatory .charts-panel .donut-center-number{font-size:32px}
.observatory .charts-panel .donut-legend{flex:1 1 0;min-width:0;max-width:42%;display:grid;gap:clamp(8px,1.2vh,16px)}
.observatory .charts-panel .donut-legend button{display:grid;grid-template-columns:9px minmax(0,1fr) max-content;align-items:center;gap:8px;min-width:0;padding:4px 0;font-size:var(--legend-font,15px);line-height:1.45}
.observatory .charts-panel .donut-legend button[hidden]{display:none}
.observatory .charts-panel .donut-legend b{font-size:inherit;line-height:inherit;text-align:right;margin:0;min-width:2ch;overflow:visible;white-space:nowrap}
.observatory .charts-panel .donut-legend i{width:8px;height:8px}

/* Wide cards use a compact aligned label column; narrow cards put the label directly above its bar. */
.observatory .charts-panel .chart-content.is-wide-chart .bar-label{grid-template-columns:var(--chart-name-width,120px) minmax(0,1fr);align-items:center;gap:10px}
.observatory .charts-panel .chart-content.is-wide-chart .bar-label>span:first-child{text-align:right}
@media(min-width:1050px) and (min-height:851px){
  .observatory .charts-panel{grid-template-rows:minmax(0,.8fr) minmax(0,1.1fr) minmax(0,1.1fr)}
}
.observatory .charts-panel .bar-chart[hidden],.observatory .charts-panel .chart-empty[hidden]{display:none}
.observatory .charts-panel .chart-empty{height:100%;margin:0;display:grid;place-content:center;color:var(--muted);font-size:clamp(13px,1vw,18px)}

/* Retain fixed category slots, even when the current filters produce zero. */
.charts-panel .bar-item.is-empty-category,.charts-panel .donut-legend button.is-empty-category,#chart-all-content .bar-item.is-empty-category{opacity:.38}
.charts-panel .bar-item.is-empty-category:hover,.charts-panel .donut-legend button.is-empty-category:hover{opacity:.65}

/* Formal, consistent typography for school descriptions and source records. */
:is(#school-dialog, #application-dialog),
:is(#school-dialog, #application-dialog) * {
  font-family: "Dashboard Sans TC", "Microsoft JhengHei", sans-serif;
}
:is(#school-dialog, #application-dialog) :is(h2, h3, h4, summary),
#school-dialog #detail-name {
  font-family: "Dashboard Sans TC", "Microsoft JhengHei", sans-serif;
  font-weight: 600;
  letter-spacing: .015em;
}
:is(#school-dialog, #application-dialog) :is(p, li, dd) {
  font-weight: 400;
}

/* Use the selected school's regional palette for every disclosure state. */
:is(#school-dialog, #application-dialog) .detail-disclosure {
  border-color: color-mix(in srgb, var(--detail-region) 24%, white);
  overflow: hidden;
}
:is(#school-dialog, #application-dialog) .detail-disclosure > summary {
  color: #354a63;
  transition: background-color .15s ease, color .15s ease;
}
:is(#school-dialog, #application-dialog) .detail-disclosure > summary::after {
  color: color-mix(in srgb, var(--detail-region) 60%, #26374b);
}
:is(#school-dialog, #application-dialog) .detail-disclosure > summary:is(:hover, :focus-visible),
:is(#school-dialog, #application-dialog) .detail-disclosure[open] > summary {
  background: color-mix(in srgb, var(--detail-region) 12%, white);
  color: color-mix(in srgb, var(--detail-region) 35%, #26374b);
}
:is(#school-dialog, #application-dialog) .detail-disclosure > summary:focus-visible {
  outline: 2px solid var(--detail-region);
  outline-offset: -3px;
}

/* Fit the controls and map in one viewport; hidden rows take no space. */
html, body.observatory { height: 100%; overflow: hidden; }
body.observatory { min-height: 0; }
.observatory .site-header { flex-shrink: 0; }
.observatory .dashboard {
  height: calc(100dvh - 64px);
  min-height: 0;
  flex: 1 1 auto;
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 8px;
}
.observatory .filter-status, .observatory .dashboard-footer { display: none; }
.observatory .filter-bar {
  height: auto;
  min-height: 0;
  padding: 8px 14px 10px;
  grid-template-columns: minmax(280px, 1.8fr) repeat(4, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}
.observatory .filter-field,
.observatory .filter-field:not(.search-field) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.observatory .filter-field > label {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
  font-size: 15px;
  line-height: 1.4;
  margin: 0;
}
.observatory .filter-field select,
.observatory .search-control,
.observatory .reset-button {
  height: 40px;
  min-height: 40px;
  font-size: 16px;
}
.observatory .search-control input {
  height: 100%;
  min-width: 0;
  font-size: 16px;
}
.observatory .reset-button { white-space: nowrap; padding-inline: 12px; }
@media (min-width: 1050px) and (max-height: 850px) {
  .observatory .dashboard {
    height: calc(100dvh - 54px);
  }
}
@media (max-width: 1240px) {
  .observatory .filter-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .observatory .search-field { grid-column: span 3; }
}
@media (max-width: 1049px) {
  .observatory .dashboard { height: calc(100dvh - 54px); }
}
@media (max-width: 640px) {
  .observatory .dashboard { height: calc(100dvh - 48px); }
  .observatory .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .observatory .search-field { grid-column: 1 / -1; }
  .observatory .reset-button { grid-area: auto / 1 / auto / -1; }
}
