:root {
  color-scheme: dark;
  --bg: #08111f;
  --panel: #111d30;
  --panel-2: #17263c;
  --ink: #f7f8fb;
  --muted: #a7b4ca;
  --blue: #63b7ef;
  --orange: #f2a65a;
  --fs-category-1: #f08a4b;
  --fs-category-2: #f2c94c;
  --fs-category-3: #a8d65e;
  --fs-category-4: #49c68b;
  --fs-category-5: #46d3ca;
  --line: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(38, 105, 157, 0.23), transparent 32rem),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; }

.site-header {
  min-height: 68px;
  padding: 0 4vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 31, 0.86);
  backdrop-filter: blur(16px);
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: 0.015em;
}

.site-brand__828 { color: var(--orange); font-size: 1.3rem; }

.se-feelscore-main { width: min(1180px, 92vw); margin: 0 auto; padding: 3.5rem 0 2.5rem; }

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: clamp(3.2rem, 9vw, 6.6rem); line-height: 0.86; letter-spacing: -0.055em; }
.product-name { margin: 0.7rem 0 0; color: #d9e6f5; font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 700; }
.tagline { margin: 0.3rem 0 0; color: var(--blue); font-size: 1.05rem; font-style: italic; }

.forecast-context {
  min-width: 220px;
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(17, 29, 48, 0.82);
}
.forecast-context strong { font-size: 1.05rem; }
.forecast-context span { color: var(--blue); font-weight: 700; }
.forecast-context small { margin-top: 0.35rem; color: var(--muted); }

.map-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.map-heading h2 { margin: 0; font-size: 1.12rem; }
.data-status { margin: 0; color: var(--muted); font-size: 0.8rem; }
.map-heading__tools { display: flex; align-items: center; gap: 0.75rem; }
.debug-toggle { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: var(--muted); cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; padding: .38rem .7rem; }
.debug-toggle:hover, .debug-toggle[aria-pressed="true"] { border-color: rgba(99,183,239,.5); background: rgba(99,183,239,.13); color: var(--ink); }

.map-stage { position: relative; aspect-ratio: 16 / 8.5; min-height: 390px; background: #0b1725; }
#feelscore-map { display: block; width: 100%; height: 100%; }

.map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-align: center;
}
.map-empty[hidden] { display: none; }
.map-empty strong { color: var(--ink); }
.map-empty__mark {
  width: 64px;
  height: 64px;
  margin-bottom: 0.5rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(73, 214, 199, 0.45);
  border-radius: 50%;
  background: rgba(73, 214, 199, 0.12);
  color: #74eadf;
  font-weight: 900;
}

.map-inspector { position: absolute; right: 1rem; bottom: 1rem; width: min(325px, calc(100% - 2rem)); max-height: calc(100% - 2rem); overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: rgba(8, 17, 31, 0.94); box-shadow: 0 12px 35px rgba(0,0,0,.4); }
.inspector-location { margin: 0 0 .25rem; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.map-inspector h3 { margin: 0 0 .7rem; font-size: 1.35rem; }
.category-1 { color: var(--fs-category-1); } .category-2 { color: var(--fs-category-2); } .category-3 { color: var(--fs-category-3); } .category-4 { color: var(--fs-category-4); } .category-5 { color: var(--fs-category-5); } .category-0, .category-missing { color: #c4cbd5; }
.inspector-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem .7rem; color: #d6dfec; font-size: .73rem; }
.inspector-grid em { color: var(--orange); font-size: .64rem; }
.hourly-list { display: grid; gap: .25rem; margin: .7rem 0 0; padding: .65rem 0 0; border-top: 1px solid var(--line); list-style: none; font-size: .72rem; }
.hourly-list li { display: flex; justify-content: space-between; gap: 1rem; }
.hourly-list span { color: var(--muted); }
.map-inspector details { margin-top: .7rem; color: var(--muted); font-size: .7rem; }
.map-inspector pre { max-height: 240px; overflow: auto; white-space: pre-wrap; color: #cfe2f2; font: .62rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }

.legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.7rem 1rem; padding: 1rem 1.25rem 1.15rem; color: #d7dfec; font-size: 0.82rem; }
.legend div { display: flex; align-items: center; gap: 0.5rem; }
.legend span { width: 15px; height: 15px; flex: 0 0 auto; border-radius: 4px; background: var(--swatch); }
.legend__unshaded span { border: 1px dashed #718098; background: transparent; }

.method-note { max-width: 760px; margin: 1rem auto 0; color: var(--muted); text-align: center; font-size: 0.82rem; }
.qa-panel { margin-top: 1.5rem; padding: 1.25rem; border: 1px solid rgba(99,183,239,.25); border-radius: 18px; background: rgba(17,29,48,.82); color: #d7dfec; }
.qa-panel h2 { margin: 0 0 1rem; }
.qa-panel p { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .7rem; }
.qa-grid div { display: grid; gap: .2rem; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; }
.qa-grid strong { font-size: .82rem; overflow-wrap: anywhere; }
.qa-grid span { color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; }
.qa-panel table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.qa-panel th, .qa-panel td { padding: .45rem; border-bottom: 1px solid var(--line); text-align: left; }
.qa-panel th { color: var(--orange); }

@media (max-width: 720px) {
  .site-header { align-items: flex-start; flex-direction: column; padding-block: 0.8rem; }
  .se-feelscore-main { padding-top: 2.2rem; }
  .hero { align-items: stretch; flex-direction: column; }
  .forecast-context { min-width: 0; }
  .map-heading { align-items: flex-start; flex-direction: column; }
  .map-heading__tools { width: 100%; align-items: flex-start; justify-content: space-between; }
  .map-stage { min-height: 430px; aspect-ratio: 4 / 5; }
  .legend { grid-template-columns: 1fr 1fr; }
  .map-inspector { right: .65rem; bottom: .65rem; width: calc(100% - 1.3rem); max-height: 48%; }
  .qa-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 440px) {
  .site-brand { font-size: 0.92rem; }
  .legend { grid-template-columns: 1fr; }
}
