:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --ink: #15202b;
  --muted: #65717d;
  --line: #d8e0e5;
  --nav: #14251f;
  --teal: #007f7a;
  --teal-soft: #d9efec;
  --blue: #386fa4;
  --blue-soft: #e1ecf7;
  --green: #2f7d4e;
  --green-soft: #e2f1e7;
  --amber: #b66a16;
  --amber-soft: #fff0dc;
  --red: #a84235;
  --red-soft: #fde8e5;
  --shadow: 0 18px 42px rgba(25, 37, 44, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  cursor: pointer;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.global-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 76px;
  padding: 14px 24px;
  background: var(--nav);
  color: #f5faf7;
}

.global-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
}

.global-brand strong {
  display: block;
  margin-top: 2px;
  line-height: 1.15;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #24483d;
  color: #e4fff5;
  font-weight: 800;
}

.global-header .eyebrow {
  color: #9eb3aa;
}

.global-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.global-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d4e5dd;
  font-size: 0.9rem;
  font-weight: 800;
}

.global-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.global-nav-menu {
  position: relative;
  display: inline-flex;
}

.global-nav-trigger svg,
.global-nav-dropdown svg {
  width: 16px;
  height: 16px;
}

.global-nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 250px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
  visibility: hidden;
}

.global-nav-menu:hover .global-nav-dropdown,
.global-nav-menu:focus-within .global-nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.global-nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

.global-nav-dropdown a:hover {
  background: var(--surface-soft);
  color: var(--teal);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.weather-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

.weather-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.header-subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented-control {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segment,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.segment {
  min-width: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--teal);
  color: #ffffff;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  border-radius: 8px;
}

.icon-button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.data-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.data-status.live {
  border-color: #a8d5bf;
  background: var(--green-soft);
  color: var(--green);
}

.data-status.static {
  border-color: #b7ddd4;
  background: var(--teal-soft);
  color: var(--teal);
}

.data-status.missing {
  border-color: #f1c997;
  background: var(--amber-soft);
  color: var(--amber);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.outlook-section,
.panel,
.day-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  min-height: 172px;
  padding: 18px;
  overflow: hidden;
}

.metric-card.primary {
  border-color: #f1c997;
  background: #fffaf3;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: 8px;
}

.card-icon svg {
  width: 20px;
  height: 20px;
}

.card-icon.warm {
  background: var(--amber-soft);
  color: var(--amber);
}

.card-icon.rain {
  background: var(--blue-soft);
  color: var(--blue);
}

.card-icon.fresh {
  background: var(--teal-soft);
  color: var(--teal);
}

.card-icon.model {
  background: var(--green-soft);
  color: var(--green);
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 56px;
  font-size: clamp(2.45rem, 5vw, 3.25rem);
  font-weight: 850;
  line-height: 0.95;
}

.metric-value.compact {
  align-items: center;
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  line-height: 1.05;
}

.unit-label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.metric-caption {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.outlook-section {
  padding: 18px;
  margin-bottom: 14px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.run-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.day-card {
  display: grid;
  gap: 10px;
  min-height: 196px;
  padding: 14px;
  box-shadow: none;
}

.day-card.hot {
  border-color: #e3b0a7;
  background: var(--red-soft);
}

.day-card.warm {
  border-color: #f1c997;
  background: var(--amber-soft);
}

.day-card.mild {
  border-color: #b9dfc6;
  background: var(--green-soft);
}

.day-card.cool {
  border-color: #b8d3ee;
  background: var(--blue-soft);
}

.day-card.neutral {
  background: #f8fafb;
}

.day-card-top {
  display: grid;
  gap: 2px;
}

.day-card-top span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.day-card-top strong {
  font-size: 0.92rem;
}

.day-high {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.day-high span {
  font-size: 2.1rem;
  font-weight: 875;
  line-height: 0.95;
}

.day-high small {
  color: var(--muted);
  font-weight: 850;
}

.rain-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.rain-row strong {
  color: var(--ink);
}

.rain-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.rain-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.day-card.quiet .rain-meter span {
  background: var(--teal);
}

.day-card.possible .rain-meter span {
  background: var(--amber);
}

.day-card.wet .rain-meter span {
  background: var(--blue);
}

.day-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.panel-heading svg {
  width: 18px;
  height: 18px;
  color: var(--teal);
}

.fact-list {
  display: grid;
  gap: 10px;
}

.fact-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.fact-list div:last-child {
  border-bottom: 0;
}

.fact-list span {
  color: var(--muted);
  font-weight: 750;
}

.fact-list strong {
  text-align: right;
  font-weight: 850;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(20px);
  padding: 12px 14px;
  border-radius: 8px;
  background: #14211c;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .global-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .global-brand {
    min-width: 0;
  }

  .global-nav {
    justify-content: flex-start;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forecast-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .global-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .global-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .global-nav-menu {
    display: grid;
    justify-content: stretch;
  }

  .global-nav-menu .global-nav-item {
    width: 100%;
  }

  .global-nav-item {
    justify-content: center;
  }

  .global-nav-dropdown {
    position: static;
    display: none;
    min-width: 0;
    margin-top: 6px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    visibility: visible;
  }

  .global-nav-menu:hover .global-nav-dropdown,
  .global-nav-menu:focus-within .global-nav-dropdown {
    display: grid;
  }

  .weather-shell {
    padding: 18px 16px 32px;
  }

  .weather-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .summary-grid,
  .forecast-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 156px;
  }

  .day-card {
    min-height: 168px;
  }

  .fact-list div {
    display: grid;
    gap: 5px;
  }

  .fact-list strong {
    text-align: left;
  }
}
