/* Small controls only: preserve homepage spacing, cards, and section order. */
#home #home-change-city {display:inline-flex;align-items:center;gap:7px;max-width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;font-weight:inherit;letter-spacing:inherit;text-align:left;cursor:pointer}
#home #home-change-city #city-name {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#home #home-change-city .home-city-caret {font-size:12px;flex-shrink:0;opacity:.9}
#home #home-change-city:hover #city-name {text-decoration:underline;text-underline-offset:4px}
#home #home-change-city:focus-visible {outline:2px solid var(--appearance-border,#fff);outline-offset:5px}
#home .weather-top>div:first-child {min-width:0}
#home .home-popular-actions {display:flex;align-items:center;gap:16px}
#home #home-customize-cities,#home #home-retry-data {padding:0;border:0;background:none;color:var(--blue);font-size:12px;text-decoration:underline;text-underline-offset:3px}
#home .popular-city[data-current=true] {box-shadow:inset 0 0 0 2px var(--appearance-shadow,#0066ff)}
#home .popular-city h3,#home .popular-city small {overflow:hidden;text-overflow:ellipsis}
#home #home-retry-data {font-size:11px;margin-right:8px}
#home #home-sun-city {max-width:45%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#home .home-live-map {position:relative;overflow:hidden;isolation:isolate}
#home #home-weather-map {position:absolute;inset:0;width:100%;height:100%;border:0;z-index:-1}
#home .home-live-map .map-pin {display:none}
/* Keep the selected city in the header, clear of native map controls. */
#home #weather-map .section-head {align-items:baseline;flex-wrap:wrap;gap:4px 10px}
#home #weather-map .home-map-heading {display:flex;align-items:baseline;flex-wrap:wrap;flex:1 1 160px;min-width:0;gap:2px 8px}
#home #weather-map .home-map-heading h2 {margin:0;white-space:nowrap}
#home #weather-map #map-city {min-width:0;color:var(--blue);font-size:12px;font-weight:500;line-height:1.4;overflow-wrap:anywhere}
#home .home-live-map #map-status {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#home #weather-map .section-head>a {flex:0 0 auto;margin-left:auto;font-size:11px;white-space:nowrap}
#home-location-dialog,#home-popular-dialog {box-sizing:border-box;width:min(560px,calc(100% - 28px));max-height:85vh;padding:24px;margin:auto;border:1px solid var(--appearance-border,#c8dff8);border-radius:10px;color:var(--navy);background:var(--appearance-surface,#fff);box-shadow:0 16px 60px var(--appearance-shadow,#102d6333)}
#home-location-dialog::backdrop,#home-popular-dialog::backdrop {background:var(--appearance-deep,#10254f80)}
.home-dialog-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.home-dialog-heading h2 {font-size:22px;margin:0}
.home-dialog-close {background:none;border:0;padding:0 5px;color:var(--navy);font-size:27px;line-height:1}
#home-location-dialog>p,#home-popular-dialog>p {font-size:14px;line-height:1.5;color:var(--muted);margin:10px 0 14px}
#home-location-dialog>label {display:block;font-size:14px;color:var(--muted);margin-top:15px}
.home-dialog-search {display:flex;gap:8px;margin-top:5px}
#home-city-search {min-width:0;flex:1;width:100%;font-size:16px;padding:10px;border:1px solid var(--appearance-border,#b7d4f8);border-radius:5px;color:var(--navy);background:var(--appearance-surface,white)}
.home-dialog-search button,.home-dialog-actions button {padding:9px 13px;font-size:14px;border:1px solid var(--appearance-border,#bfd7f7);border-radius:5px;background:var(--appearance-raised,#f7fbff);color:var(--blue)}
.home-dialog-search button,.home-dialog-actions .home-primary {background:var(--appearance-primary,var(--blue));color:var(--appearance-inverse,#fff)}
.home-city-results {max-height:310px;overflow:auto;border-top:1px solid var(--appearance-border,#dce9f8)}
.home-city-results button {width:100%;display:flex;flex-direction:column;text-align:left;align-items:flex-start;gap:3px;padding:11px 8px;border:0;border-bottom:1px solid var(--appearance-border,#e4eef9);background:var(--appearance-surface,#fff);color:var(--navy);font-size:15px}
.home-city-results button:hover {background:var(--appearance-raised,#eef7ff)}
.home-city-results small {font-size:13px;color:var(--muted)}
#home-popular-choices {display:grid;grid-template-columns:1fr 1fr;gap:10px}
#home-popular-choices label {display:flex;align-items:center;gap:9px;padding:10px;border:1px solid var(--appearance-border,#d7e6f9);border-radius:6px;font-size:14px;cursor:pointer}
#home-popular-choices input {flex-shrink:0;width:17px;height:17px;accent-color:var(--blue)}
#home-popular-choices small {display:block;font-size:12px;color:var(--muted);margin-top:3px}
.home-dialog-actions {display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:14px}
.home-dialog-actions button:first-child {margin-right:auto}
.home-dialog-actions button:disabled {opacity:.5;cursor:default}
#home-location-dialog :is(button,input):focus-visible,#home-popular-dialog :is(button,input):focus-visible {outline:2px solid var(--appearance-focus,#0066ff);outline-offset:3px}
@media(max-width:600px){
 #home .home-popular-actions {gap:10px;flex-wrap:wrap;justify-content:flex-end}
 #home #home-customize-cities {font-size:11px}
 #home-location-dialog,#home-popular-dialog {padding:18px}
 .home-dialog-heading h2 {font-size:20px}
 #home-popular-choices {grid-template-columns:1fr}
}
/* Five browser-local city snapshots; wrap the grid instead of scrolling it. */
#home #popular-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:1fr;gap:12px;overflow:visible;scroll-snap-type:none;padding-bottom:0;min-width:0}
#home .popular-city{position:relative;display:flex;flex-direction:column;width:100%;min-width:0;height:100%;min-height:0;scroll-snap-align:none;align-items:stretch}
#home .popular-city img{display:block;width:100%;height:8.5rem;min-height:0;object-fit:cover;object-position:center;flex:0 0 8.5rem}
#home .popular-city img[src="cities/new-york.jpg"]{object-position:50% 80%}
#home .popular-city img[src="cities/london.jpg"]{object-position:65% 50%}
#home .popular-city img[src="cities/tokyo.jpg"]{object-position:50% 72%}
#home .popular-city img[src="cities/paris.jpg"]{object-position:50% 53%}
#home .popular-city img[src="cities/sydney.jpg"]{object-position:50% 55%}
#home .popular-city>div{display:flex;flex-direction:column;flex:1;padding:9px 10px 10px;min-width:0}
#home .popular-city h3{font-size:14px;white-space:nowrap;overflow-wrap:normal;margin-bottom:3px}
#home .popular-city small{font-size:12px;white-space:normal;overflow-wrap:anywhere;line-height:1.3}
#home .popular-city strong{display:flex;align-items:center;gap:4px;font-size:22px;line-height:1;margin:0;flex-shrink:0}
#home .popular-city strong span{font-size:20px}
#home .popular-city time{font-size:12px;white-space:nowrap;line-height:1.3;margin:0;padding:0}
#home #popular-grid>p{grid-column:1/-1;font-size:14px;color:var(--muted)}
#home .popular .section-head{flex-wrap:wrap;gap:10px}
#home #home-city-image-credits{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:11px;margin-top:5px;color:var(--muted)}
#home #home-city-image-credits:empty{display:none}
#home-popular-dialog{overflow-y:auto}
#home-popular-dialog>label{display:block;font-size:14px;color:var(--muted);margin-top:15px}
#home-popular-search{min-width:0;flex:1;width:100%;font-size:16px;padding:10px;border:1px solid var(--appearance-border,#b7d4f8);border-radius:5px;color:var(--navy);background:var(--appearance-surface,white)}
#home-popular-choices{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
.home-city-choice{display:flex;justify-content:space-between;align-items:center;gap:10px;border:1px solid var(--appearance-border,#d7e6f9);border-radius:6px;padding:10px;font-size:14px}
.home-city-choice>span{min-width:0;overflow-wrap:anywhere}
.home-city-choice>div{display:flex;gap:6px;flex-shrink:0}
.home-city-choice button{border:1px solid var(--appearance-border,#bfd7f7);background:var(--appearance-raised,#f7fbff);color:var(--blue);padding:7px;border-radius:4px;font-size:12px}
@media(max-width:1199px){#home #popular-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:850px){#home #popular-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
@media(max-width:560px){#home #popular-grid{grid-template-columns:minmax(0,1fr)}.home-city-choice{align-items:flex-start;flex-wrap:wrap}.home-city-choice>div{margin-left:auto}}

/* Independent AQI link sits above the card's city-selection hit area. */
#home .home-city-select{font:inherit;color:inherit;background:none;border:0;padding:0;text-align:left;cursor:pointer}
#home .home-city-select::after{content:"";position:absolute;inset:0;border-radius:9px}
#home .home-city-select:focus-visible{outline:none}
#home .home-city-select:focus-visible::after{outline:2px solid var(--blue);outline-offset:-3px}
#home .home-city-aqi{position:relative;z-index:1;align-self:stretch;display:flex;align-items:center;gap:7px;min-width:0;max-width:100%;margin-top:5px;padding:5px 8px;background:var(--appearance-raised,#f0f6ff);border:1px solid var(--appearance-border,#e3edfb);border-radius:6px;color:var(--navy);font-size:12px;line-height:1.3;text-decoration:none;overflow-wrap:anywhere}
#home .home-city-aqi-dot{flex:0 0 9px;width:9px;height:9px;border-radius:50%}
#home .home-city-aqi:hover{text-decoration:underline}
#home .home-city-aqi:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:2px}

/* Compact destination-card rows, with time alongside the weather. */
#home .popular-city .home-city-region{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
#home .home-city-select{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
#home .home-city-weather{display:flex;align-items:center;gap:5px;min-width:0;margin-top:7px;padding:5px;background:var(--appearance-raised,#f5f9ff);border:1px solid var(--appearance-border,#edf3fc);border-radius:6px}
#home .popular-city .home-city-condition{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;overflow-wrap:normal}
#home .home-city-clock{display:flex;align-items:center;gap:4px;flex-shrink:0;border-left:1px solid var(--appearance-border,#e0eafa);padding-left:5px;color:var(--muted)}
#home .home-city-clock>span{font-size:15px;line-height:1;color:var(--navy)}
#home .home-city-aqi-label{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#home .home-city-aqi-arrow{margin-left:auto;flex-shrink:0;font-size:18px;line-height:12px;color:var(--blue)}

/* Give the selected forecast city a clear home above the existing forecast tabs. */
#home .home-forecast-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 20px;margin-bottom:12px}
#home .home-forecast-heading{flex:1 1 250px;min-width:0}
#home .home-forecast-title-row{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 16px}
#home #home-forecast-title{margin:0;font-size:20px;font-weight:700;line-height:1.3;letter-spacing:-.3px}
#home #home-forecast-city{margin:0;min-width:0;color:var(--blue);font-size:22px;font-weight:700;line-height:1.3;overflow-wrap:anywhere}
#home .home-forecast-subtitle{margin:4px 0 0;color:var(--muted);font-size:13px;line-height:1.4}
#home .home-forecast-link{flex-shrink:0;color:var(--blue);font-size:14px;line-height:1.4;white-space:nowrap}
#home .home-forecast-link:hover{text-decoration:underline;text-underline-offset:3px}
@media(max-width:600px){#home .home-forecast-header{align-items:flex-start;margin-bottom:10px}#home .home-forecast-title-row{flex-direction:column;align-items:flex-start;gap:3px}#home #home-forecast-title{font-size:18px}#home #home-forecast-city{font-size:21px}}

/* Compact clocks and astronomy stay top-aligned beside the taller map. */
#home .lower-grid{align-items:start}
@media(min-width:1025px){
 #home .lower-grid .map-card{display:flex;flex-direction:column;min-height:280px}
 #home .lower-grid .map-card .section-head{flex-shrink:0}
 #home .lower-grid .analog{max-width:88px;margin-inline:auto}
 #home .lower-grid .sun-moon-pair>div{min-width:0}
 #home .lower-grid .map-preview{flex:1;height:auto;min-height:190px}
 #home .lower-grid .map-tabs{flex-shrink:0;margin-top:8px}
}
@media(max-width:1024px){
 #home .lower-grid{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start}
 #home .lower-grid .map-card{grid-column:1/-1}
 #home .lower-grid .map-preview{height:clamp(180px,32vw,240px)}
}
@media(max-width:600px){
 #home .lower-grid{grid-template-columns:minmax(0,1fr)}
 #home .lower-grid .map-card{grid-column:auto}
}

/* The homepage seven-day high and low values have equal visual weight. */
#home .forecast-day-temps{display:flex;justify-content:center;align-items:flex-start;flex-wrap:nowrap;gap:12px;white-space:normal}
#home .forecast-day-temp{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-width:0;gap:2px}
#home .forecast-day-temp .forecast-temp-label{font-size:11px;font-weight:600;line-height:1.1;color:var(--muted)}
#home .forecast-day-temp .forecast-temp-number{display:block;font-size:18px;font-weight:700;line-height:1.2;color:var(--navy)}
