:root {
  --high-bg: #ff6a13;
  --high-fg: #1b0e00;
  --moderate-bg: #ffd447;
  --moderate-fg: #2a2100;
  --low-bg: #dfe6bd;
  --low-fg: #23280f;
  --none-bg: #1e6b46;
  --none-fg: #ffffff;
  --nodata-bg: #d5d7da;
  --nodata-fg: #1c1d1f;

  --sheet-bg: #ffffff;
  --sheet-fg: #1c1d1f;
  --sheet-muted: #5c6066;
  --sheet-line: #e4e5e7;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sheet-bg: #16171a;
    --sheet-fg: #f1f2f3;
    --sheet-muted: #a4a8ae;
    --sheet-line: #2c2e33;
  }
}

body[data-level="high"] { --bg: var(--high-bg); --fg: var(--high-fg); }
body[data-level="moderate"] { --bg: var(--moderate-bg); --fg: var(--moderate-fg); }
body[data-level="low"] { --bg: var(--low-bg); --fg: var(--low-fg); }
body[data-level="none"] { --bg: var(--none-bg); --fg: var(--none-fg); }
body[data-level="nodata"] { --bg: var(--nodata-bg); --fg: var(--nodata-fg); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 34rem;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

button, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }


.hero {
  padding: max(0.75rem, env(safe-area-inset-top)) 1.25rem 1.75rem;
  min-height: 64svh;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.brand {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.region select {
  appearance: none;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 999px;
  padding: 0.4rem 1.9rem 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: 13rem;
  text-overflow: ellipsis;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1rem) 55%, calc(100% - 0.7rem) 55%;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat;
}

.region select option { color: #1c1d1f; background: #fff; }

.datebar {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  align-items: center;
  margin-top: 1.25rem;
}

.arrow {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  display: grid;
  place-items: center;
}

.arrow svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow:active { background: color-mix(in srgb, currentColor 18%, transparent); }

.date {
  background: transparent;
  border: 0;
  padding: 0.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.kicker {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.date-text {
  font-size: 1.3rem;
  font-weight: 700;
}

.status {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 1.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.75rem, 14vw, 5rem);
  overflow-wrap: break-word;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}

.where {
  margin: 0.9rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.summary {
  margin: 0.9rem 0 0;
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 500;
  max-width: 28rem;
}

.today-pill {
  align-self: flex-start;
  margin-top: 1.25rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 0;
  background: var(--fg);
  color: var(--bg);
  font-weight: 800;
  font-size: 0.95rem;
}


.sheet {
  flex: 1;
  background: var(--sheet-bg);
  color: var(--sheet-fg);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 1.5rem 1.25rem max(2rem, env(safe-area-inset-bottom));
}

.sheet section + section { margin-top: 2rem; }

h2 {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sheet-muted);
}

.strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.day {
  border: 0;
  border-radius: 0.6rem;
  padding: 0.45rem 0 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-height: 3.25rem;
}

.day[data-level="high"] { background: var(--high-bg); color: var(--high-fg); }
.day[data-level="moderate"] { background: var(--moderate-bg); color: var(--moderate-fg); }
.day[data-level="low"] { background: var(--low-bg); color: var(--low-fg); }
.day[data-level="none"] { background: var(--none-bg); color: var(--none-fg); }
.day[data-level="nodata"] { background: var(--nodata-bg); color: var(--nodata-fg); }

.day .dow { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.day .num { font-size: 1.1rem; font-weight: 800; }

.day[aria-current="date"] {
  outline: 3px solid var(--sheet-fg);
  outline-offset: 2px;
}

.legend {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--sheet-muted);
}

.legend li { display: flex; align-items: center; gap: 0.35rem; }

.legend i {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.2rem;
  display: inline-block;
}

.legend i[data-level="high"] { background: var(--high-bg); }
.legend i[data-level="moderate"] { background: var(--moderate-bg); }
.legend i[data-level="low"] { background: var(--low-bg); }
.legend i[data-level="none"] { background: var(--none-bg); }

.advice {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.advice li {
  padding-left: 1.6rem;
  position: relative;
}

.advice li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.45em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--sheet-line);
}

.group + .group { margin-top: 1.1rem; }

.group h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 800;
}

.group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--sheet-line);
}

.group li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--sheet-line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.6rem;
}

.group .name { font-weight: 600; }
.group .name::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  background: var(--dot);
  box-shadow: 0 0 0 1px var(--sheet-line);
}
.group li[data-level="high"] { --dot: var(--high-bg); }
.group li[data-level="moderate"] { --dot: var(--moderate-bg); }
.group li[data-level="low"] { --dot: var(--low-bg); }

.group .where-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sheet-muted);
}

.group .note {
  flex-basis: 100%;
  font-size: 0.875rem;
  color: var(--sheet-muted);
  padding-left: 1.1rem;
}

.empty {
  margin: 0;
  color: var(--sheet-muted);
  line-height: 1.45;
}

footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--sheet-line);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--sheet-muted);
}

footer p { margin: 0 0 0.75rem; }
footer a { color: inherit; }

@media (min-width: 36rem) {
  .page { padding-top: 1.5rem; }
  .sheet { border-radius: 1.25rem; margin-bottom: 2rem; flex: none; }
  .hero { min-height: 0; padding-bottom: 2.5rem; }
  .status { padding-top: 2.5rem; }
}
