:root{--ink:#102522;--deep:#0c332d;--paper:#f4f3ed;--white:#fffefa;--mint:#4cc7a7;--blue:#287fa3;--gold:#e5a21b;--shadow:0 18px 48px rgba(10,38,33,.2)}
*{box-sizing:border-box}html,body{min-height:100%;margin:0}body{color:var(--ink);background:var(--paper);font-family:"Hiragino Sans","Yu Gothic UI","Yu Gothic",system-ui,sans-serif}button{font:inherit}
.app-shell{min-height:100vh}.topbar{min-height:76px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 22px;color:var(--white);background:var(--deep);z-index:1000}.eyebrow{margin:0 0 2px;color:#98d9c6;font-size:.68rem;font-weight:800;letter-spacing:.16em}h1{margin:0;font-size:clamp(1.15rem,2vw,1.6rem)}
.topbar-actions{display:flex;align-items:center;gap:10px}.mode-switch{position:relative;z-index:950;display:grid;grid-template-columns:repeat(2,minmax(0,360px));justify-content:center;gap:10px;padding:9px 18px;background:#eef2ef;border-bottom:1px solid #cbd7d1;box-shadow:0 4px 14px rgba(10,38,33,.12)}.mode-switch button{min-height:56px;display:flex;align-items:center;justify-content:center;gap:10px;padding:6px 18px;color:#184740;background:#fffefa;border:2px solid #b9cbc3;border-radius:12px;cursor:pointer;text-align:left}.mode-switch button:hover,.mode-switch button:focus-visible{border-color:#007278;outline:none}.mode-switch button.active{color:white;background:#007278;border-color:#007278;box-shadow:0 5px 14px rgba(0,91,96,.24)}.mode-switch button>span:last-child{display:flex;flex-direction:column}.mode-switch strong{font-size:.96rem}.mode-switch small{margin-top:2px;color:#637873;font-size:.63rem;font-weight:700}.mode-switch button.active small{color:rgba(255,255,255,.8)}.mode-number{width:29px;height:29px;display:grid;place-items:center;flex:none;color:#006c72;background:#d9eee8;border-radius:50%;font-size:.76rem;font-weight:900}.mode-switch button.active .mode-number{color:#3b2800;background:#f2b84b}
.menu-button,.floating-menu{color:white;background:transparent;border:1px solid rgba(255,255,255,.38);border-radius:999px;cursor:pointer}.menu-button{min-height:42px;padding:0 16px}.map-stage{position:relative;display:grid;grid-template-columns:360px minmax(0,1fr);align-items:start}.map-stage.panel-closed{grid-template-columns:minmax(0,1fr)}#map{position:sticky;top:0;width:100%;height:calc(100vh - 151px);min-height:600px;background:#dfe8e1}#map.map-pending::after,#map.map-error::after{position:absolute;inset:0;z-index:1000;display:grid;place-items:center;padding:24px;text-align:center;color:#48635d;font-size:.82rem;font-weight:800;background:linear-gradient(135deg,#e7efea,#d5e3dd)}#map.map-pending::after{content:attr(data-loading-label)}#map.map-error::after{content:attr(data-error-label);color:#7a2e28;background:#fbe8e5}.leaflet-container{font:inherit}.leaflet-control-attribution{font-size:.64rem}
.control-panel{position:relative;z-index:900;width:360px;max-width:100%;height:auto;overflow:visible;padding:18px;background:#fffefa;border-right:1px solid rgba(16,37,34,.13);box-shadow:8px 0 28px rgba(10,38,33,.12)}
.panel-heading,.filter-heading{display:flex;align-items:center;justify-content:space-between}.panel-heading div,.filter-heading{gap:8px}.panel-heading div{display:flex;align-items:center}.panel-heading span,.filter-heading span{color:#007278;font-size:.65rem;font-weight:900;letter-spacing:.1em}.panel-heading strong,.filter-heading strong{font-size:.86rem}.panel-heading>button{display:block;width:31px;height:31px;border:0;border-radius:50%;background:#e9efeb;color:var(--ink);cursor:pointer;font-size:1.2rem}
.region-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:11px}.region-button{min-height:38px;padding:6px 4px;color:var(--ink);background:white;border:1px solid #d5ddd8;border-radius:9px;cursor:pointer;font-size:.74rem;font-weight:800}.region-button:hover,.region-button:focus-visible{border-color:#007278;outline:none}.region-button.active{color:white;background:var(--deep);border-color:var(--deep)}
.prefecture-grid{grid-template-columns:repeat(2,1fr)}.prefecture-grid .region-button{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:7px 9px;text-align:left}.prefecture-grid .region-button b{color:#63736f;font-size:.66rem;font-weight:700}.prefecture-grid .region-button.active b{color:rgba(255,255,255,.78)}.prefecture-hint{margin:7px 0 0;color:#61716e;font-size:.67rem;line-height:1.5}
.filter-heading{justify-content:flex-start;margin-top:16px}.filter-heading.first-heading{margin-top:13px}.filter-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:9px}.filter{min-height:44px;display:flex;align-items:center;gap:6px;padding:6px 8px;color:var(--ink);background:white;border:1px solid #d5ddd8;border-radius:10px;cursor:pointer;font-size:.75rem}.filter i{width:9px;height:9px;flex:none;border-radius:50%;background:#aaa}.filter b{margin-left:auto;color:#63736f;font-size:.66rem}.filter.active{color:white;border-color:transparent}.filter.active b{color:rgba(255,255,255,.78)}.filter.hospital.active{background:var(--deep)}.filter.clinic.active{background:var(--blue)}.filter.dental.active{color:#342100;background:var(--gold)}.filter.dental.active b{color:rgba(52,33,0,.7)}.filter.hospital i{background:#0c332d}.filter.clinic i{background:var(--blue)}.filter.dental i{background:var(--gold)}.filter.active i{background:currentColor}
.specialty-heading,.language-heading{margin-top:15px}.specialty-heading small,.language-heading small{color:#71817d;font-size:.62rem;font-weight:600}.specialty-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px}.specialty-grid button,.clear-specialty,.language-grid button,.clear-language{min-height:34px;color:#184740;background:#edf5f1;border:1px solid #cadbd3;border-radius:8px;cursor:pointer;font-size:.7rem;font-weight:800}.specialty-grid button.active,.language-grid button.active{color:white;background:#007278;border-color:#007278}.specialty-form{margin-top:8px}.specialty-form label{display:block;margin-bottom:4px;color:#657773;font-size:.63rem}.specialty-form div{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px}.specialty-form input{min-width:0;height:36px;padding:0 9px;border:1px solid #cad8d2;border-radius:8px;font:inherit;font-size:.72rem}.specialty-form button{padding:0 10px;color:white;background:#007278;border:0;border-radius:8px;font-size:.7rem;font-weight:800;cursor:pointer}.specialty-form .voice-button{color:#005d62;background:#e0f2ed;border:1px solid #aed4c9}.specialty-form .voice-button.listening{color:#352200;background:#f2b84b;border-color:#d89711;animation:pulse 1s ease-in-out infinite}.voice-help{margin:5px 0 0;color:#667773;font-size:.6rem;line-height:1.4}.clear-specialty,.clear-language{width:100%;margin-top:7px}.language-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-top:8px}.language-note{margin:7px 0 0;color:#667773;font-size:.62rem;line-height:1.45}.show-map-button{position:relative;width:100%;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;margin-top:13px;padding:9px 12px;color:white;background:#007278;border:0;border-radius:11px;box-shadow:0 5px 14px rgba(0,91,96,.22);cursor:pointer;font-weight:900}.show-map-button::after{content:"↓";position:absolute;right:14px;font-size:1.15rem}.show-map-button span{font-size:.82rem}.show-map-button small{color:rgba(255,255,255,.78);font-size:.58rem;font-weight:700}@keyframes pulse{50%{box-shadow:0 0 0 4px rgba(242,184,75,.25)}}
.load-note,.data-note{color:#61716e;line-height:1.5}.load-note{margin:8px 0 0;font-size:.66rem}.load-status{margin-top:11px;padding:9px 10px;color:#005d62;background:#e5f6f4;border-radius:9px;font-size:.73rem;font-weight:800}.load-status.loading::before{content:"";display:inline-block;width:10px;height:10px;margin-right:7px;border:2px solid #83c9c4;border-top-color:#007278;border-radius:50%;animation:spin .8s linear infinite}.coverage-note{margin:9px 0 0;padding:9px 10px;color:#684b00;background:#fff3cd;border:1px solid #efd58a;border-radius:9px;font-size:.64rem;line-height:1.5}.coverage-note strong{color:#5a3d00}.data-note{margin:10px 0 0;font-size:.65rem}.source-details{margin-top:8px;color:#61716e;font-size:.65rem;line-height:1.45}.source-details summary{color:#006c72;cursor:pointer;font-weight:800}.source-details p{margin:5px 0}.source-details a{color:#006c72}.data-link{display:inline-block;margin-top:7px;color:#006c72;font-size:.7rem;font-weight:800}@keyframes spin{to{transform:rotate(360deg)}}
.welcome{position:absolute;z-index:700;left:calc(50% + 180px);top:50%;transform:translate(-50%,-50%);width:min(360px,calc(100% - 36px));padding:20px;text-align:center;background:rgba(255,254,250,.94);border:1px solid rgba(16,37,34,.12);border-radius:18px;box-shadow:var(--shadow);pointer-events:none}.map-stage.panel-closed .welcome{left:50%}.welcome span{color:#007278;font-size:.68rem;font-weight:900;letter-spacing:.13em}.welcome strong{display:block;margin:6px 0;font-size:1.15rem;line-height:1.5}.welcome small{color:#667773;font-size:.7rem}.floating-menu{display:none;position:absolute;z-index:850;top:14px;left:14px;padding:10px 14px;background:var(--deep);box-shadow:0 6px 18px rgba(10,38,33,.25)}
.medical-dot{display:grid;place-items:center;cursor:pointer;animation:marker-enter .24s ease-out both}.medical-dot span{display:block;width:13px;height:13px;border:2px solid white;border-radius:50%;box-shadow:0 1px 5px rgba(0,0,0,.4);pointer-events:none;transition:transform .15s ease}.medical-dot:hover span,.medical-dot:focus span{transform:scale(1.25)}.medical-dot.h span{background:var(--deep)}.medical-dot.c span{background:var(--blue)}.medical-dot.d span{background:var(--gold)}
.medical-cluster{display:grid;place-items:center;color:white;background:#176357;border:3px solid rgba(255,255,255,.9);border-radius:50%;box-shadow:0 3px 12px rgba(0,0,0,.3);font-size:.72rem;font-weight:900;animation:marker-enter .24s ease-out both}.medical-cluster.dental{color:#352200;background:var(--gold)}@keyframes marker-enter{from{opacity:0;transform:scale(.88)}to{opacity:1;transform:scale(1)}}@media(prefers-reduced-motion:reduce){.medical-dot,.medical-cluster{animation:none}}
.popup-kind{color:#60736e;font-size:.68rem;font-weight:900;letter-spacing:.07em}.popup-title{margin:4px 0 7px;font-size:.95rem;line-height:1.45}.popup-meta{margin:4px 0;color:#435a55;font-size:.75rem;line-height:1.5}.popup-link{display:inline-block;margin-top:7px;color:#006c72;font-size:.74rem;font-weight:800}
.popup-languages{display:flex;flex-wrap:wrap;gap:4px;margin:7px 0}.popup-languages span{padding:3px 7px;color:#005d62;background:#e4f8f7;border-radius:999px;font-size:.68rem;font-weight:800}.popup-phone{display:inline-block;margin-top:5px;color:#184740;font-size:.78rem;font-weight:800}
.beginner-guide{display:flex;flex-direction:column;gap:3px;margin-top:12px;padding:10px 11px;color:#184740;background:#e9f5f0;border-radius:10px}.beginner-guide strong{font-size:.76rem}.beginner-guide span{font-size:.66rem;line-height:1.45}.stats-button-grid{display:grid;gap:7px;margin-top:9px}.stats-button-grid button{min-height:42px;padding:7px 6px;color:#184740;background:#f4f7f5;border:1px solid #d1ddd7;border-radius:9px;cursor:pointer;font-size:.73rem;font-weight:900}.stats-button-grid button.active{color:white;background:#007278;border-color:#007278}.stats-button-grid button span{display:block;margin-top:2px;color:#71817d;font-size:.58rem;font-weight:700}.stats-button-grid button.active span{color:rgba(255,255,255,.78)}.year-grid,.kind-grid{grid-template-columns:repeat(3,1fr)}.metric-grid{grid-template-columns:1fr}.kind-help{margin:8px 0 0;padding:9px 10px;color:#405d57;background:#f2f7f4;border-left:3px solid #65a99a;border-radius:7px;font-size:.67rem;line-height:1.55}.kind-help strong{color:#184740}.stats-summary{margin-top:13px;padding:12px;color:#fff;background:var(--deep);border-radius:11px;font-size:.72rem;line-height:1.55}.stats-summary strong{display:block;font-size:.94rem;line-height:1.55}.stats-legend-title{margin:11px 0 0;color:#184740;font-size:.68rem;font-weight:900}.stats-legend{display:grid;gap:5px;margin-top:7px}.legend-row{display:flex;align-items:center;gap:7px;color:#596b67;font-size:.65rem}.legend-row i{width:28px;height:10px;border-radius:3px;border:1px solid rgba(16,37,34,.12)}.stats-help{margin:9px 0 0;color:#526763;font-size:.67rem;line-height:1.5}.advanced-stats{margin-top:11px;padding:8px 10px;background:#f5f6f3;border:1px solid #e0e5e1;border-radius:9px;color:#526763;font-size:.67rem}.advanced-stats summary{color:#006c72;cursor:pointer;font-weight:900}.advanced-stats p{margin:7px 0 0}.advanced-stats .metric-grid{margin-top:7px}.stats-popup h2{margin:3px 0 8px;font-size:1rem}.stats-popup table{width:100%;border-collapse:collapse;font-size:.72rem}.stats-popup th,.stats-popup td{padding:4px 5px;border-bottom:1px solid #e2e8e4;text-align:right}.stats-popup th:first-child,.stats-popup td:first-child{text-align:left}.stats-popup .current{color:#005d62;background:#e8f6f2;font-weight:900}.stats-popup-note{margin:7px 0 0;color:#526763;font-size:.67rem}.pref-tooltip{font-weight:900}.prefecture-fill{transition:fill-opacity .15s ease}
@media(max-width:820px){.mode-switch{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:7px 10px}.mode-switch button{min-height:52px;padding:5px 10px;gap:7px}.mode-switch strong{font-size:.82rem}.mode-switch small{font-size:.56rem}}
@media(max-width:680px){.topbar{min-height:68px;padding:9px 13px}.eyebrow{font-size:.58rem}h1{font-size:1.05rem}.menu-button{min-height:32px;padding:0 10px;font-size:.66rem}.topbar-actions{gap:5px}.mode-switch{gap:6px;padding:6px}.mode-switch button{min-height:50px;padding:5px 7px}.mode-switch strong{font-size:.76rem}.mode-switch small{font-size:.52rem}.mode-number{width:25px;height:25px;font-size:.68rem}.map-stage,.map-stage.panel-closed{grid-template-columns:1fr;grid-template-rows:auto 540px;overflow:visible}#map{position:relative;top:auto;height:540px;min-height:540px}.control-panel{width:100%;height:auto;max-height:none;overflow:visible;padding:13px;border-right:0;border-bottom:1px solid rgba(16,37,34,.13);box-shadow:0 8px 22px rgba(10,38,33,.1)}.region-grid{gap:6px}.region-button{min-height:36px;font-size:.7rem}.filter-grid{gap:6px}.filter{padding:5px 6px;font-size:.7rem}.show-map-button{min-height:62px}.welcome,.map-stage.panel-closed .welcome{left:50%;top:auto;bottom:20px;transform:translateX(-50%);padding:14px}.welcome strong{font-size:.96rem}.floating-menu:not([hidden]){display:block}}
