/* Map-first navigation. The accent retains its hue/lightness with 20% more saturation. */
:root{--green:#2c715a;--heart:#c63e55;--heart-tint:#fff0f2;--status-waiting:#fff3c4;--status-waiting-ink:#7a570d}
.workspace{--app-nav-height:0px;grid-template-rows:1fr;display:block}
.workspace .app-header{position:absolute;inset:16px auto auto 16px;width:max-content;max-width:calc(100% - 230px);height:52px;min-height:0;padding:0;display:flex;align-items:center;gap:8px;background:transparent;border:0;box-shadow:none;border-radius:0}
.header-toolbar{display:flex;align-items:center;gap:8px;flex:1;min-width:0;height:52px;padding:0;background:transparent;box-shadow:none;border-radius:18px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:none;scroll-padding-inline:12px}
.header-main{display:flex;align-items:center;gap:10px;flex:0 0 auto;min-width:0;height:52px;padding:4px 6px 4px 12px;background:var(--surface);box-shadow:var(--shadow);border-radius:18px}
.header-toolbar::-webkit-scrollbar{display:none}
.header-toolbar :focus-visible{outline-offset:-2px}
.app-header .brand{font-size:18px;flex-shrink:0;min-height:44px}
.app-header .brand span{margin:0;white-space:nowrap}.app-header .brand{gap:4px}
#map-menu-toggle{position:relative;flex:0 0 44px;color:var(--green);background:var(--surface);border:1px solid var(--line);box-shadow:0 2px 6px #314b3920;width:44px;height:44px;border-radius:50%;overflow:visible}
#map-menu-toggle svg{width:21px;height:21px}
.workspace .app-header .search-bar{position:relative;inset:auto;flex:1;min-width:280px;width:auto;max-width:300px;height:44px;padding:0 4px;border:0;border-radius:0;background:transparent;box-shadow:none}
.header-links{display:flex;align-items:center;gap:4px;flex-shrink:0;border:0;padding-left:4px}
.header-links button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 10px;border-radius:10px;background:transparent;font-size:13px;white-space:nowrap;color:var(--green)}
.header-links button:hover{background:var(--tint)}
.header-links svg{width:19px;height:19px;flex-shrink:0}
.about-section-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:22px 0 8px}
#about .about-section-heading h3{flex-shrink:0;margin:0}
.about-section-heading #map-tour-open{white-space:nowrap;flex-shrink:0}
.about-source-heading small{font-size:11px;font-weight:400;color:var(--muted);line-height:1.6}
@media(max-width:700px){#about{width:calc(100vw - 24px);padding:18px 16px}.about-section-heading #map-tour-open{font-size:11px;padding-inline:8px;letter-spacing:-.04em}}
@media(max-width:374px){.about-section-heading{gap:4px}.about-section-heading #map-tour-open{font-size:11px;padding-inline:8px;letter-spacing:-.05em}}
.map-view-actions{position:absolute;top:20px;right:16px;z-index:4;display:flex;align-items:center;gap:8px}
.workspace .header-toolbar .recruitment-map-toggle{position:static;inset:auto;transform:none;display:flex;align-items:center;gap:6px;flex-shrink:0;padding:0 4px}
.workspace .map-view-actions .view-switch{position:static;inset:auto;display:flex;flex-shrink:0;height:44px;min-height:44px;margin-left:auto;padding:0;border-radius:24px}
.map-view-actions #view-toggle{display:flex;align-items:center;width:auto;min-height:44px;padding:0 12px;gap:6px;background:var(--surface);color:var(--muted)}
.map-view-actions #view-toggle::before{content:none}
.map-view-actions #view-toggle svg{flex-shrink:0;color:var(--ink)}
.map-view-actions #view-toggle [data-view-label]{display:inline;color:#858a87;font-size:12px;font-weight:400;white-space:nowrap}
.map-view-actions #view-toggle [data-view-label][data-active=true]{color:var(--green);font-weight:750}
.map-view-actions #view-toggle .view-divider{color:#858a87;font-weight:400}
.workspace #view-toggle [data-view-label]{display:inline-flex;align-items:center;gap:4px}
.workspace #view-toggle [data-view-label] svg{color:inherit}
.workspace .search-bar .icon-button{flex:0 0 44px;width:44px;height:44px;min-width:44px;margin:0}
.workspace .search-bar .icon-button:has(.toolbar-action-label){align-content:center;gap:2px;padding:2px 0}
.toolbar-action-label{font-size:9px;font-weight:450;line-height:1;letter-spacing:-.04em;white-space:nowrap}
.workspace .sidebar,.workspace .detail-panel{position:absolute;top:80px;left:16px;right:auto;bottom:16px;width:360px;height:auto;min-height:0;max-height:calc(100% - 96px);margin:0;overflow:auto}
.workspace .detail-panel{z-index:9}
.workspace .map-controls{top:80px;left:auto;right:16px;width:44px;display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-height:calc(100% - 96px);overflow:visible}
/* Keep the season/shadow tool beside the right-hand controls in both states. */
.workspace .map-controls #sun-time{position:absolute;top:0;left:auto;right:54px;width:44px;margin:0;padding:0;visibility:visible}
.workspace .map-controls #sun-time:not([open]){height:44px;min-height:44px;max-height:44px;overflow:visible;border:0;border-radius:50%;background:var(--surface);box-shadow:var(--shadow)}
.map-controls #sun-time:not([open])>summary{display:grid;place-items:center;min-width:0;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:transparent;box-shadow:none}
.map-controls #sun-time:not([open])>summary::before{content:none}
.map-controls #sun-time:not([open])>summary .sun-icon{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.map-controls #sun-time:not([open])>summary .sun-title,.map-controls #sun-time:not([open])>summary #sun-summary,.map-controls #sun-time:not([open])>summary .sun-toggle{display:none}
.workspace .map-controls #sun-time[open]{top:var(--sun-top,0px);width:min(250px,calc(var(--visible-width,100vw) - 76px));max-height:var(--sun-max-height,calc(100dvh - 88px));overflow:auto;overscroll-behavior:contain}
@media(max-height:520px){.workspace .map-controls #sun-time[open]{width:min(480px,calc(var(--visible-width,100vw) - 76px))}}
.workspace .map-controls #measure-options{left:auto;right:48px}
.workspace .map-quick-action{display:grid;place-content:center;justify-items:center;gap:2px;flex:none;width:74px;min-height:44px;height:46px;padding:3px 2px;border:1px solid var(--line);border-radius:12px;background:var(--tint);color:var(--green);font:700 9px/1.15 system-ui,sans-serif;letter-spacing:-.045em;text-align:center;white-space:nowrap;box-shadow:var(--shadow)}
.workspace .map-quick-action img{display:block;width:24px;height:24px}
.workspace #accepting-housing{background:#fff0c2;color:#725006;border-color:#e1ba53}
.workspace #accepting-housing:hover{background:#ffe5a0}
.workspace #accepting-housing[aria-pressed=true]{background:#9b650d;color:#fffefa;border-color:#9b650d;box-shadow:0 0 0 3px #fff0c2,0 5px 18px #54370e24}
.workspace #my-map-ai-open{background:var(--surface);color:var(--ink)}
.workspace #my-map-ai-open:hover{border-color:var(--green);background:var(--tint)}
.my-map-ai-symbol{display:inline-flex;align-items:flex-start;gap:2px}
.my-map-ai-beta{display:inline-block;padding:2px 3px;border:1px solid var(--line);border-radius:4px;background:var(--tint);color:var(--green);font:800 8px/1 system-ui,sans-serif;letter-spacing:.04em;white-space:nowrap}
.workspace .map-status{top:80px}
.workspace .maplibregl-ctrl-bottom-left{top:80px!important;left:16px!important;bottom:auto!important}
.workspace .maplibregl-ctrl-bottom-right{bottom:0!important}
.workspace .detail-panel h2{display:flex;align-items:center;gap:8px;margin:12px 0 6px}
.detail-panel h2 .housing-map-link,.detail-panel h2 .housing-name{flex:1;min-width:0}
.detail-panel h2>.favorite-heart{position:static;flex:0 0 44px;margin:0;align-self:center}
.detail-panel .location-types{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:max-content;gap:6px;max-height:min(184px,30dvh);margin:12px 0;padding:3px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.detail-panel .location-types button{width:100%;min-width:0;min-height:44px;height:auto;margin:0;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.detail-header .property-notice-types{display:inline;margin:0;padding:0;font:inherit;line-height:inherit}
.detail-header .property-notice-types>small{display:inline;font:inherit}
.detail-header .property-notice-types>small::before{content:' · '}
.favorite-heart,.notice-meta .notice-save{color:var(--heart);background:transparent;border:0;box-shadow:none;border-radius:50%;font-size:28px;line-height:1;min-width:44px;width:44px;height:44px;min-height:44px;padding:0;display:inline-grid;place-items:center}
.favorite-heart:hover,.favorite-heart[aria-pressed=true],.notice-meta .notice-save:hover,.notice-meta .notice-save[aria-pressed=true]{background:var(--heart-tint);color:var(--heart)}
.notice-meta .notice-save span{font-size:28px;line-height:1}
.notice-meta .notice-save{margin-left:auto;flex:0 0 44px}
.housing-status{display:inline-flex;align-items:center;max-width:100%;min-height:30px;padding:5px 10px;border-radius:7px;font-size:12px;line-height:1.5;font-weight:650;background:var(--status-waiting);color:var(--status-waiting-ink);margin:0 0 12px}
.housing-status[data-tone=accepting]{background:#e0f1e7;color:#1f6547}
.housing-status[data-tone=closed]{background:#edf0ef;color:#59655f}
.housing-status[data-tone=result]{background:#e7edf9;color:#375c8c}
.property-notice-types{font-size:13px;line-height:1.6;margin:4px 0 8px;font-weight:650}
.property-notice-types>small{display:block;font-weight:400}
.housing-recruitment-details>.recruitment-row{padding:0;border:0}
.housing-recruitment-details details>summary{cursor:pointer;color:var(--green);font-size:12px;font-weight:600;padding-block:10px;min-height:44px}
.housing-recruitment-details .recruitment-unit{padding:10px 0;background:transparent;border:0}
.housing-recruitment-details h3{font-size:14px}
.housing-recruitment-details .recruitment-actions:empty{display:none}
.recruitment-price-summary{border-block:1px solid var(--line);padding-block:12px;margin-block:8px}
.detail-notice-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.detail-notice-actions>.detail-action{width:100%;gap:8px;align-items:center}
.account-guides button{background:transparent;color:var(--green);min-height:44px;padding:4px 0;text-decoration:underline;text-underline-offset:3px}
#site-menu{position:fixed;inset:0 auto 0 0;margin:0;width:min(380px,calc(100% - 24px));height:100dvh;max-height:100dvh;padding:max(18px,env(safe-area-inset-top)) 18px max(18px,env(safe-area-inset-bottom));border:0;border-radius:0 20px 20px 0;overflow:auto;overscroll-behavior:contain}
#site-menu .dialog-heading{margin-bottom:12px}
#site-menu .dialog-heading h2{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:500;line-height:1.5;letter-spacing:-.04em;color:var(--green)}
#site-menu-title .brand-icon{flex:0 0 32px;object-fit:contain;margin-right:0}
.menu-actions{display:grid;gap:4px;margin-bottom:12px}
.menu-actions>button{text-align:left;min-height:46px;padding:10px 8px;background:transparent;border-radius:12px;font-size:14px;font-weight:450;color:var(--green)}
.menu-actions>button:hover{background:var(--tint)}
.menu-actions>#my-map-ai-menu{display:flex;align-items:center;gap:8px}
.menu-actions [data-saved-count]:not(:empty){display:inline-block;margin-left:6px;padding:2px 6px;border-radius:8px;background:var(--tint);color:var(--green);font-size:11px}
.menu-filter{border-top:1px solid var(--line);padding:6px 0}
.menu-filter>summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;cursor:pointer;font-size:14px;font-weight:550;color:var(--green);list-style:none}
.menu-filter>summary::-webkit-details-marker{display:none}
.menu-filter>summary::after{content:'+';color:var(--muted);font-size:20px;font-weight:400}
.menu-filter[open]>summary::after{content:'−'}
#site-menu .filter-checks,.filter-checks{display:grid;grid-template-columns:1fr;gap:0;align-content:start}
.filter-check{display:flex;align-items:center;gap:8px;min-height:44px;padding:6px 4px;cursor:pointer;font-size:12px;line-height:1.5;border-radius:6px;color:var(--ink)}
.filter-check:hover{background:var(--tint)}
.filter-check:has(:checked){font-weight:650;color:var(--green)}
#site-menu .filter-check{font-weight:400}
#site-menu .filter-check:has(:checked){font-weight:500}
.filter-check input{flex:0 0 18px;width:18px;height:18px;margin:0;accent-color:var(--green);cursor:pointer}
.type-picker .housing-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 8px}
.type-picker .housing-filters .filter-check{font-size:12px;min-width:0;font-weight:400}
.type-picker .housing-filters .filter-check:has(:checked){font-weight:400}
.type-picker .housing-filters.agency-filters{grid-template-columns:1fr}
.region-line .type-picker>summary{font-size:14px;font-weight:400}
.filter-check .agency-icon{width:auto;min-width:33px;height:23px;flex-shrink:0;font-size:10px}
.filter-check .legend-dot{flex:0 0 6px;margin-right:0;background:var(--housing-color)}
#site-menu #map-housing-filters{grid-template-columns:1fr 1fr}
@media(min-width:768px){
 #site-menu #map-agency-filters{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:8px}
 #site-menu{width:min(480px,calc(100% - 24px))}
 #site-menu #map-agency-filters .filter-check{min-width:0;gap:6px;font-size:12px;letter-spacing:-.035em}
 #site-menu #map-agency-filters .filter-check>.agency-icon{min-width:30px;height:22px;padding-inline:3px;font-size:9px;letter-spacing:0}
 #site-menu #map-agency-filters .filter-check>span:last-child{min-width:0;white-space:nowrap;overflow-wrap:normal}
}
.notice-filters.national-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 150px minmax(0,1fr);gap:10px}
.national-filters .notice-search{grid-column:1/-1}
.national-quick-filters{display:contents}
#national-filter-toggle{display:none}
.notice-filters.national-filters .national-accepting-filter{flex-direction:row;justify-content:center;align-self:end;gap:6px;height:44px;padding:0 6px;white-space:nowrap;font-size:13px}
.national-filters .national-date{grid-column:span 1}
.national-filters .national-period{grid-column:span 2}
.national-filters .national-accepting-filter input{flex:0 0 18px;width:18px;height:18px}
@media(max-width:900px){
 .header-main{gap:8px;padding-inline:8px}
 .app-header .brand{font-size:16px;gap:2px}
 .header-links{padding-left:4px}
 .header-links button{padding-inline:8px}
}
@media(max-width:767px){
 /* Keep recruitment visible beside the map view; only secondary links scroll. */
 .workspace .app-header{inset:calc(8px + env(safe-area-inset-top)) 12px auto;width:auto;max-width:none;height:44px;gap:6px}
 .header-toolbar{--mobile-brand-width:44px;height:44px;gap:0;padding:0 2px;background:var(--surface);border-radius:16px;box-shadow:var(--shadow)}
 .header-main{display:contents}
 .app-header .brand{flex:0 0 var(--mobile-brand-width);width:var(--mobile-brand-width);min-width:0;justify-content:center;gap:0}
 .app-header .brand-name,.app-header .brand-product{display:none}
 .app-header .brand-icon{width:28px;height:28px}
 #map-menu-toggle svg{width:18px;height:18px}
 .workspace .app-header .search-bar{flex:0 0 calc(100% - var(--mobile-brand-width));min-width:0;max-width:none;height:44px;padding:0}
 .workspace .search-field{gap:0}
 .workspace .search-field input{min-width:44px;font-size:16px;padding-inline:0;text-overflow:ellipsis}
 .header-toolbar:has(#search:focus) .brand{display:none}
 .workspace .header-toolbar:has(#search:focus) .search-bar{flex-basis:100%}
 .header-links{padding-left:0}
 .header-links button{font-size:11px;padding-inline:8px}
 .header-links svg,.workspace .search-bar .icon-button svg{width:16px;height:16px}
 .map-view-actions{top:calc(60px + env(safe-area-inset-top));left:12px;right:12px;justify-content:space-between}
 .map-view-actions #view-toggle{gap:4px;padding-inline:10px}
 .map-view-actions #view-toggle [data-view-label]{font-size:11px}
 .map-view-actions #view-toggle svg{width:14px;height:14px}
 .workspace .header-toolbar .recruitment-map-toggle{position:fixed;top:calc(60px + env(safe-area-inset-top));left:12px;right:auto;padding:0;z-index:6}
 .workspace .map-quick-action{width:72px;height:44px;font-size:8.5px}
 .workspace .map-quick-action img{width:22px;height:22px}
 .workspace .map-controls{top:calc(112px + env(safe-area-inset-top));left:auto;right:12px;gap:6px;max-height:calc(100% - 120px - env(safe-area-inset-top))}
 .map-controls #current-location svg,.measure-tools>summary svg,.map-controls #sun-time:not([open])>summary .sun-icon{width:16px;height:16px}
 .workspace:has(.detail-panel:not([hidden])) .map-controls,.workspace:has(.sidebar:not([hidden])) .map-controls{visibility:hidden}
 .workspace .maplibregl-ctrl-bottom-left{top:calc(112px + env(safe-area-inset-top))!important;left:12px!important}
 .workspace .sidebar,.workspace .detail-panel{top:calc(112px + env(safe-area-inset-top));left:8px;right:8px;bottom:8px;width:auto;max-height:calc(100% - 120px - env(safe-area-inset-top))}
 .workspace .filter-panel{padding:8px 12px 0}
 .workspace .property-row{padding:12px 14px}
 .workspace .property-row .row-name{font-size:13px}
 .workspace .detail-panel{padding:12px 14px}
 .workspace .detail-panel h2{font-size:17px;line-height:1.4}
 .workspace .map-status{top:calc(112px + env(safe-area-inset-top))}
 #site-menu{width:min(256px,calc(100% - 24px));max-width:calc(100% - 24px);padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom));border-radius:0 16px 16px 0}
 #site-menu .dialog-heading{margin-bottom:4px}
 #site-menu .dialog-heading h2{font-size:14px;gap:6px}
 #site-menu-title .brand-icon{flex-basis:24px;width:24px;height:24px;padding:0}
 #site-menu .menu-actions{gap:0;margin-bottom:8px}
 #site-menu .menu-actions>button{min-height:44px;padding:6px;font-size:12px}
 #site-menu .menu-filter{padding-block:4px}
 #site-menu .menu-filter>summary{min-height:44px;font-size:13px}
 #site-menu .filter-check{gap:6px;padding:4px 2px}
 #site-menu #map-agency-filters .agency-icon{min-width:28px;width:28px;height:20px;flex-basis:28px;padding:0}
 #site-menu #map-agency-filters .filter-check>.agency-icon:is(.agency-wordmark,:has(svg.agency-logo)){min-width:28px;width:28px;height:20px;flex-basis:28px;padding:0}
 #site-menu #map-agency-filters .filter-check>span:last-child{min-width:0;white-space:nowrap}
 .notice-filters.national-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 .national-filters .notice-search{grid-column:1/-1;order:0}
 .national-filters>label{gap:2px}
 .national-quick-filters{display:flex;grid-column:1/-1;order:1;gap:8px;min-width:0}
 .national-quick-filters .national-accepting-filter{flex:1;min-width:0;letter-spacing:-.025em}
 #national-filter-toggle{display:flex;align-items:center;justify-content:center;gap:8px;flex:0 0 auto;min-height:44px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--green);font-size:12px;white-space:nowrap}
 #national-filter-toggle::after{content:'';width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg)}
 #national-filter-toggle[aria-expanded=true]::after{transform:translateY(2px) rotate(225deg)}
 .national-filters>.national-extra-filter{order:2}
 .national-filters:not(.filters-expanded)>.national-extra-filter,.national-filters.national-actionable>.national-date,.national-filters.national-actionable>.national-period{display:none}
 .national-filters .national-accepting-filter,.national-filters .national-period,.national-filters .national-date{grid-column:auto}
}
@media(max-width:374px){.workspace .header-toolbar .recruitment-map-toggle{gap:5px}.workspace .map-quick-action{width:64px;white-space:normal;word-break:keep-all}.workspace .map-quick-action span{max-width:58px}.map-view-actions #view-toggle{padding-inline:8px}}
@media(prefers-reduced-motion:reduce){#site-menu{scroll-behavior:auto}}

.history-table-wrap .history-notice-date{display:block;white-space:nowrap;margin-bottom:4px}
.history-table-wrap .history-notice-title{display:block}
.agency-icon.agency-wordmark{flex:0 0 44px;width:44px;height:24px;padding:0;border:0;background:transparent;border-radius:0}
.agency-icon.agency-wordmark img{display:block;width:100%;height:100%;object-fit:contain}
.filter-check .agency-icon.agency-wordmark,#site-menu #map-agency-filters .filter-check>.agency-icon.agency-wordmark{min-width:44px;width:44px;height:24px;padding:0}

.agency-icon:has(svg.agency-logo),.map-pin .agency-icon:has(svg.agency-logo){flex:0 0 28px;min-width:28px;width:28px;height:24px;padding:2px;border:0;background:#fffefa;border-radius:4px}
#site-menu #map-agency-filters .agency-icon:has(svg.agency-logo){min-width:30px;width:30px;height:24px;padding:2px}

.agency-icon.agency-light-logo:has(svg.agency-logo),.map-pin .agency-icon.agency-light-logo:has(svg.agency-logo){background:var(--ink);border-radius:4px}

/* Keep search navigation usable beside its longer, explicit title. */
#results-panel .list-heading{gap:4px;flex-wrap:wrap}
#results-panel .list-heading h2{flex:1 1 auto;min-width:0;font-size:14px;letter-spacing:-.035em;white-space:nowrap}
#results-panel #list-close{margin:0;order:2}
#results-panel #list-filters-toggle{order:3;margin:0 0 4px auto}
