:root {
  --ink: #151515;
  --muted: #5f6368;
  --line: #cfcfcf;
  --soft-line: #e7e7e7;
  --link: #0645d9;
  --link-hover: #c00;
  --sun: #f5b400;
  --sun-soft: #fff8db;
  --sky: #e9f4ff;
  --max: 1440px;
  --brand-font: Eurostile, "Square 721", "DIN Alternate", "Arial Black", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; font: 16px/1.48 Arial, Helvetica, sans-serif; }
a { color: var(--link); text-decoration: underline; text-underline-offset: .14em; }
a:hover { color: var(--link-hover); }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
code { padding: .08em .28em; border: 1px solid #ddd; background: #f5f5f5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: -5rem; left: 1rem; padding: .55rem .8rem; color: #fff; background: #111; }
.skip-link:focus { top: 1rem; }

.site-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: .55rem 1rem; border-top: 1px solid #ddd; border-bottom: 1px solid #888; background: #fafafa; }
.site-name { display: inline-flex; align-items: center; gap: .6rem; color: #111; font-family: var(--brand-font); font-size: 1.35rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; }
.site-nav { display: flex; align-items: center; gap: 1.2rem; }
.site-nav > a { color: #111; font-weight: 700; }
.site-nav form { display: flex; }
.site-nav input { width: 205px; padding: .42rem .55rem; border: 1px solid #777; background: #fff; }
.site-nav button, .page-search button { padding: .42rem .75rem; border: 1px solid #333; color: #fff; background: #333; font-weight: 700; }
.menu-toggle { display: none; align-items: center; gap: .45rem; padding: .38rem .55rem; border: 1px solid #222; color: #fff; background: #333; font-weight: 700; }
.menu-icon { width: 1.1rem; display: grid; gap: 3px; }
.menu-icon span { display: block; height: 2px; background: #fff; }

main { max-width: var(--max); min-height: 70vh; margin: 0 auto; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding: 1.55rem 1rem 1.2rem; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #fff 0%, #fffdf4 100%); }
.page-intro.compact { padding-top: 1.2rem; }
.page-intro h1 { margin: 0 0 .25rem; font-size: clamp(1.85rem, 4vw, 2.55rem); line-height: 1.12; }
.page-intro p:not(.breadcrumb) { max-width: 760px; margin: .3rem 0 0; color: #333; }
.home-intro h1 { font-size: clamp(2rem, 5vw, 3.15rem); }
.breadcrumb { margin: 0 0 .35rem; color: var(--muted); font-size: .9rem; }
.summary-stats { display: flex; flex: 0 0 auto; margin: 0; border: 1px solid #777; background: #fff; }
.summary-stats div { min-width: 115px; padding: .5rem .75rem; border-right: 1px solid #aaa; }
.summary-stats div:last-child { border-right: 0; }
.summary-stats dt { color: var(--muted); font-size: .78rem; }
.summary-stats dd { margin: 0; font-size: 1.05rem; font-weight: 800; white-space: nowrap; }

.weather-content { padding: 1rem; border-bottom: 1px solid var(--line); }
.current-panel { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(0, 1.75fr); border: 1px solid #555; }
.current-primary { padding: 1.15rem; border-right: 1px solid #777; background: var(--sun-soft); }
.current-primary h2 { margin: 0; font-size: 1.55rem; }
.temperature-line { display: flex; align-items: center; gap: .2rem; margin: .2rem 0 0; }
.temperature-line img { width: 72px; height: 72px; object-fit: contain; }
.temperature-line strong { font-size: 4rem; line-height: 1; letter-spacing: -.06em; }
.temperature-line span { align-self: flex-start; margin-top: .65rem; font-weight: 800; }
.current-primary .condition { margin: .25rem 0 .1rem; font-size: 1.18rem; font-weight: 800; }
.current-primary > p:last-child { margin: .15rem 0 0; color: var(--muted); }
.current-details h3 { margin: 0; padding: .6rem .85rem; border-bottom: 1px solid #aaa; background: #eee; font-size: 1rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.metric-grid div { min-height: 82px; padding: .8rem; border-right: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); }
.metric-grid div:nth-child(4n) { border-right: 0; }
.metric-grid div:nth-last-child(-n+4) { border-bottom: 0; }
.metric-grid dt { color: var(--muted); font-size: .82rem; }
.metric-grid dd { margin: .15rem 0 0; font-size: 1.04rem; font-weight: 800; }
.source-note { margin: .45rem 0 0; color: var(--muted); font-size: .82rem; }
.notice { margin: .5rem 0; padding: .9rem 1rem; border: 1px solid #8a6d00; background: #fff8d6; }
.notice strong, .notice span { display: block; }
.notice-error { border-color: #9d2b21; background: #fff0ee; }
.alerts { margin-top: 1rem; padding: 1rem; border: 2px solid #9d2b21; background: #fff3f0; }
.alerts h2 { margin-top: 0; }
.alerts article + article { border-top: 1px solid #d6aaa5; }

.content-section { margin-top: 1.4rem; }
.section-heading, .results-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 0 0 .55rem; }
.section-heading h2, .results-header h2 { margin: 0; font-size: 1.35rem; }
.results-header p { margin: 0; color: var(--muted); }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid #333; }
.weather-table { width: 100%; border-collapse: collapse; }
.weather-table th { padding: .55rem .65rem; border-bottom: 2px solid #333; background: #eee; text-align: left; white-space: nowrap; }
.weather-table td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.weather-table tbody tr:nth-child(even) { background: #fafafa; }
.weather-table tbody tr:hover { background: #fffbea; }
.weather-table tbody tr:last-child td { border-bottom: 0; }
.weather-table small { display: block; color: var(--muted); }
.hourly-table { min-width: 780px; }
.condition-cell { min-width: 190px; }
.condition-content { display: flex; align-items: center; gap: .45rem; }
.condition-content img { flex: 0 0 auto; }

.forecast-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid #333; }
.forecast-card { min-width: 0; padding: .75rem; border-right: 1px solid var(--line); }
.forecast-card:last-child { border-right: 0; }
.forecast-card h3 { margin: 0 0 .25rem; font-size: .95rem; }
.forecast-card img { width: 58px; height: 58px; }
.forecast-condition { min-height: 2.8em; margin: .1rem 0; font-size: .88rem; }
.high-low { margin: .25rem 0 .6rem; font-size: 1.4rem; }
.high-low span { color: var(--muted); }
.forecast-card dl { margin: 0; border-top: 1px solid var(--soft-line); }
.forecast-card dl div { display: flex; justify-content: space-between; gap: .5rem; padding: .18rem 0; font-size: .8rem; }
.forecast-card dd { margin: 0; font-weight: 700; }

.directory-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.2rem; padding: 1rem; }
.filters { align-self: start; border: 1px solid #555; }
.filters > h2 { margin: 0; padding: .65rem .75rem; color: #fff; background: #333; font-size: 1.05rem; }
.filters section { padding: .5rem .75rem; border-top: 1px solid var(--line); }
.filters h3 { margin: 0 0 .2rem; font-size: .92rem; }
.filters ul { margin: 0; padding: 0; list-style: none; columns: 2; }
.filters li { padding: .1rem 0; break-inside: avoid; font-size: .84rem; }
.directory-results { min-width: 0; }
.area-table td:first-child { width: 42%; }

.page-search { padding: 1rem; border-bottom: 1px solid var(--line); background: #f7f7f7; }
.page-search form { max-width: 650px; }
.page-search label { display: block; margin-bottom: .25rem; font-weight: 800; }
.page-search form > div { display: flex; }
.page-search input { flex: 1; min-width: 0; padding: .55rem .65rem; border: 1px solid #555; }
.area-directory { padding: 1rem; }
.region-map-section { padding: 1rem; border-bottom: 1px solid var(--line); }
.region-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 1rem; align-items: center; }
.region-map-figure { min-width: 0; margin: 0; }
.singapore-map { width: 100%; height: auto; min-height: 260px; border: 1px solid #777; background: #eef7ff; }
.map-region, .map-islet { stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; transition: filter .15s ease, stroke-width .15s ease; }
.map-west { fill: #2f70bd; background: #2f70bd; }
.map-north { fill: #3d9360; background: #3d9360; }
.map-central { fill: #f1a52b; background: #f1a52b; }
.map-northeast { fill: #8159b1; background: #8159b1; }
.map-east { fill: #d94f51; background: #d94f51; }
.singapore-map a:hover .map-region { filter: brightness(.88); stroke-width: 6; }
.singapore-map a:focus .map-region { stroke: #111; stroke-width: 6; outline: none; }
.singapore-map text { fill: #fff; font-size: 18px; font-weight: 800; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 3px; }
.singapore-map .region-label-central { fill: #111; stroke: rgba(255,255,255,.65); }
.region-map-figure figcaption, .area-location-layout figcaption { margin-top: .3rem; color: var(--muted); font-size: .82rem; }
.region-legend { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.region-legend a { display: flex; align-items: center; gap: .55rem; padding: .42rem .5rem; border: 1px solid var(--line); color: #111; text-decoration: none; }
.region-legend a:hover { background: #f5f5f5; }
.legend-swatch { width: 1.35rem; height: 1.35rem; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.35); }
.area-location-section .section-heading p { margin: .15rem 0 0; color: var(--muted); }
.area-location-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(230px, .7fr); gap: 1rem; align-items: stretch; }
.area-location-layout figure { min-width: 0; margin: 0; }
.area-location-map { display: block; width: 100%; height: auto; min-height: 230px; border: 1px solid #777; background: #eef7ff; }
.area-location-map .map-context-region, .area-location-map .map-context-islet { fill: #c7d2da; stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; }
.area-location-map .map-context-region.is-selected.map-west { fill: #2f70bd; }
.area-location-map .map-context-region.is-selected.map-north { fill: #3d9360; }
.area-location-map .map-context-region.is-selected.map-central { fill: #f1a52b; }
.area-location-map .map-context-region.is-selected.map-northeast { fill: #8159b1; }
.area-location-map .map-context-region.is-selected.map-east { fill: #d94f51; }
.pin-halo { fill: #fff; stroke: #111; stroke-width: 3; }
.pin-core { fill: #d71920; stroke: #fff; stroke-width: 2; }
.location-label { fill: #111; font-size: 17px; font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.location-details { align-self: stretch; padding: .9rem; border: 1px solid #777; background: #f7f7f7; }
.location-details h3 { margin: 0 0 .55rem; font-size: 1.08rem; }
.location-details dl { margin: 0 0 1rem; }
.location-details dl div { padding: .5rem 0; border-top: 1px solid var(--line); }
.location-details dt { color: var(--muted); font-size: .82rem; }
.location-details dd { margin: .08rem 0 0; font-weight: 800; }
.location-details .button-link { margin: 0; }
.area-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .7rem; }
.area-card-grid article { padding: .8rem; border: 1px solid #777; background: #fff; }
.area-card-grid article:hover { background: #fffbea; }
.area-card-grid p { margin: 0; color: var(--muted); font-size: .8rem; }
.area-card-grid h3 { margin: .1rem 0 .5rem; font-size: 1.05rem; }
.area-card-grid h3 a { color: var(--ink); }

.air-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid #555; }
.air-grid div { padding: .75rem; border-right: 1px solid var(--line); }
.air-grid div:last-child { border: 0; }
.air-grid dt { color: var(--muted); }
.air-grid dd { margin: .1rem 0 0; font-size: 1.2rem; font-weight: 800; }

.prose-layout { display: grid; grid-template-columns: 230px minmax(0, 780px); gap: 2rem; padding: 1.25rem 1rem 2rem; }
.prose-nav { position: sticky; top: 1rem; align-self: start; display: grid; padding: .75rem; border: 1px solid #777; }
.prose-nav strong { margin-bottom: .35rem; }
.prose-nav a { padding: .2rem 0; }
.prose-content section { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.prose-content h2 { margin-bottom: .35rem; }
.prose-content p, .prose-content li, .simple-prose p { max-width: 72ch; }
.simple-prose { max-width: 850px; padding: 1rem 1rem 2rem; }
.simple-prose h2 { margin: 1.2rem 0 .25rem; }
.simple-prose p { margin-top: 0; }
.climate-pillar { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 1.5rem; padding: 1.25rem 1rem; border-bottom: 1px solid var(--line); }
.pillar-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.pillar-main h2, .climate-summary h2 { margin: 0 0 .35rem; font-size: 1.3rem; }
.pillar-main p { max-width: 68ch; margin: .35rem 0; }
.climate-summary { align-self: start; display: grid; padding: .75rem; border: 1px solid #555; background: #f7f7f7; }
.climate-summary a { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.climate-summary a:last-child { border-bottom: 0; }
.cluster-section { padding: 1rem; border-bottom: 1px solid var(--line); }
.cluster-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.cluster-card, .monthly-card-grid article { padding: .85rem; border: 1px solid #777; background: #fff; }
.cluster-card h3, .monthly-card-grid h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.cluster-card p, .monthly-card-grid article > p { margin: .25rem 0 .65rem; }
.month-link-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid #555; }
.month-link-grid > a { display: grid; gap: .15rem; min-width: 0; padding: .65rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; }
.month-link-grid > a:nth-child(6n) { border-right: 0; }
.month-link-grid > a:nth-last-child(-n+6) { border-bottom: 0; }
.month-link-grid span { color: var(--muted); font-size: .78rem; line-height: 1.25; }
.monthly-intro { padding-bottom: 0; }
.monthly-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.season-name { color: var(--muted); font-size: .85rem; font-weight: 700; }
.climate-article .prose-content { min-width: 0; }
.related-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.related-links > a { display: grid; gap: .2rem; padding: .7rem; border: 1px solid #777; text-decoration: none; }
.related-links span { color: var(--muted); font-size: .86rem; }
.prose-nav a[aria-current="page"] { color: #111; background: #ddd; font-weight: 800; text-decoration: none; }
.empty-state { padding: 2rem 1rem; border: 1px solid #777; text-align: center; }
.empty-state h1, .empty-state h2 { margin: .2rem 0; }
.page-not-found { max-width: 760px; margin: 3rem auto; border: 0; }
.button-link { display: inline-block; margin-right: .8rem; padding: .5rem .75rem; border: 1px solid #222; color: #fff; background: #333; font-weight: 700; text-decoration: none; }
.button-link:hover { color: #fff; background: #555; }

.site-footer { max-width: var(--max); display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; margin: 1.5rem auto 0; padding: 1rem; border-top: 2px solid #333; background: #f6f6f6; font-size: .88rem; }
.site-footer > * { display: grid; align-content: start; gap: .25rem; }
.site-footer strong { color: #111; }
.site-footer span { color: var(--muted); }
.footer-logo-link { display: inline-flex; align-items: center; gap: .55rem; width: fit-content; color: #111; text-decoration: none; }
.footer-logo-link:hover strong { text-decoration: underline; }
.footer-brand-mark { width: 34px; height: 34px; }

@media (max-width: 950px) {
  .site-header { flex-wrap: wrap; gap: .5rem; }
  .menu-toggle { display: flex; }
  .site-nav { width: 100%; display: none; flex-wrap: wrap; gap: .8rem; padding: .65rem 0 .2rem; border-top: 1px solid var(--line); }
  .site-nav.is-open { display: flex; }
  .site-nav form { flex: 1 0 100%; }
  .site-nav input { flex: 1; width: auto; }
  .current-panel { grid-template-columns: 1fr; }
  .current-primary { border-right: 0; border-bottom: 1px solid #777; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid div:nth-child(2n) { border-right: 0; }
  .metric-grid div:nth-last-child(-n+4) { border-bottom: 1px solid var(--soft-line); }
  .metric-grid div:nth-last-child(-n+2) { border-bottom: 0; }
  .forecast-grid { display: flex; overflow-x: auto; }
  .forecast-card { min-width: 170px; }
  .cluster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-link-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .month-link-grid > a:nth-child(6n) { border-right: 1px solid var(--line); }
  .month-link-grid > a:nth-child(4n) { border-right: 0; }
  .month-link-grid > a:nth-last-child(-n+6) { border-bottom: 1px solid var(--line); }
  .month-link-grid > a:nth-last-child(-n+4) { border-bottom: 0; }
}

@media (max-width: 720px) {
  .page-intro { align-items: start; flex-direction: column; gap: .8rem; }
  .summary-stats { width: 100%; overflow-x: auto; }
  .summary-stats div { flex: 1; min-width: 105px; }
  .directory-layout { grid-template-columns: 1fr; }
  .filters ul { columns: 3; }
  .prose-layout { grid-template-columns: 1fr; }
  .prose-nav { position: static; }
  .region-map-layout { grid-template-columns: 1fr; }
  .area-location-layout { grid-template-columns: 1fr; }
  .region-legend { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .region-legend a { justify-content: center; }
  .climate-pillar { grid-template-columns: 1fr; }
  .pillar-main { grid-template-columns: 1fr; }
  .monthly-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer { grid-template-columns: 1fr; gap: 1.2rem; }
}

@media (max-width: 480px) {
  .site-name { font-size: 1.14rem; }
  .brand-mark { width: 36px; height: 36px; }
  .metric-grid div { min-height: 74px; }
  .filters ul { columns: 2; }
  .singapore-map { min-height: 0; }
  .area-location-map { min-height: 0; }
  .region-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .region-legend li:last-child { grid-column: 1 / -1; }
  .air-grid { grid-template-columns: 1fr; }
  .air-grid div { border-right: 0; border-bottom: 1px solid var(--line); }
  .cluster-grid, .monthly-card-grid, .related-links { grid-template-columns: 1fr; }
  .month-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .month-link-grid > a:nth-child(4n) { border-right: 1px solid var(--line); }
  .month-link-grid > a:nth-child(2n) { border-right: 0; }
  .month-link-grid > a:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .month-link-grid > a:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

