:root {
  --paper: #fbfcfb;
  --panel: #ffffff;
  --wash: #eef8f6;
  --wash-strong: #d7f0eb;
  --ink: #17201d;
  --muted: #65706c;
  --line: #dce5e1;
  --teal: #087f8c;
  --teal-dark: #06636d;
  --coral: #d1495b;
  --gold: #edae49;
  --green: #4f772d;
  --shadow: 0 20px 60px rgba(23, 32, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--wash) 0, rgba(238, 248, 246, 0) 480px),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.45;
}

body.is-loading {
  cursor: progress;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

p,
h1,
h2,
h3,
dl,
dd,
figure {
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 28px;
  background: rgba(251, 252, 251, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 780;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
}

.top-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.source-section a:hover,
.source-section a:focus-visible {
  color: var(--teal-dark);
  outline: none;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.weather-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) minmax(360px, 1fr);
  gap: 22px;
  min-height: calc(100svh - 68px);
  padding: 34px 0 28px;
}

.search-panel,
.current-panel,
.forecast-section,
.source-section {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel,
.current-panel {
  min-height: 560px;
}

.search-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px;
}

.intro {
  display: grid;
  gap: 10px;
}

.eyebrow {
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 440px;
  font-size: clamp(2.65rem, 6vw, 5.8rem);
  font-weight: 820;
  line-height: 0.92;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.1;
}

.search-form {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.search-form label,
.unit-toggle legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input[type="search"] {
  min-width: 0;
  height: 52px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

input[type="search"]:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(8, 127, 140, 0.16);
}

.primary-action,
.quiet-action,
.text-action,
.match-button {
  min-height: 44px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
}

.primary-action {
  min-width: 98px;
  padding: 0 18px;
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  outline: none;
}

.quiet-action,
.text-action {
  padding: 0 14px;
}

.quiet-action:hover,
.quiet-action:focus-visible,
.text-action:hover,
.text-action:focus-visible,
.match-button:hover,
.match-button:focus-visible {
  color: var(--teal-dark);
  border-color: var(--teal);
  outline: none;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.unit-toggle {
  display: inline-flex;
  gap: 0;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.unit-toggle legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.unit-toggle label {
  display: grid;
  place-items: center;
  width: 48px;
  height: 42px;
}

.unit-toggle input {
  position: absolute;
  opacity: 0;
}

.unit-toggle span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-weight: 850;
}

.unit-toggle label + label {
  border-left: 1px solid var(--line);
}

.unit-toggle input:checked + span {
  color: white;
  background: var(--ink);
}

.unit-toggle input:focus-visible + span {
  outline: 3px solid rgba(8, 127, 140, 0.18);
  outline-offset: -3px;
}

.privacy-note,
.status-line {
  color: var(--muted);
  font-size: 0.95rem;
}

.status-line {
  min-height: 1.4em;
}

.status-line.is-error {
  color: var(--coral);
  font-weight: 750;
}

.matches {
  display: grid;
  gap: 8px;
}

.matches[hidden] {
  display: none;
}

.match-button {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  text-align: left;
}

.match-detail {
  color: var(--muted);
  font-weight: 650;
}

.current-panel {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 42px;
  color: var(--muted);
  text-align: center;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  color: var(--teal);
  background: var(--wash);
  border: 1px solid var(--wash-strong);
  border-radius: 50%;
  font-size: 4rem;
}

.current-content {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
}

.current-sky {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  padding: 30px;
  background:
    radial-gradient(circle at 78% 28%, rgba(237, 174, 73, 0.22), transparent 120px),
    linear-gradient(135deg, #f7fbff 0%, var(--wash) 68%, #fff8e8 100%);
  border-bottom: 1px solid var(--line);
}

.place-name {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  font-weight: 820;
  line-height: 1.02;
}

.condition {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 700;
}

.weather-icon {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  font-size: 4.2rem;
}

.temperature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: baseline;
  padding: 30px 30px 16px;
}

.temperature {
  font-size: clamp(5.2rem, 13vw, 9.5rem);
  font-weight: 850;
  line-height: 0.84;
}

.feels-like {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 760;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 30px 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metric {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 14px;
  background: var(--panel);
}

.metric dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric dd {
  font-size: 1.34rem;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.current-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 30px 24px;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
}

.forecast-section,
.source-section {
  margin: 0 0 22px;
  padding: 24px;
}

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

.hour-strip {
  display: grid;
  grid-auto-columns: minmax(112px, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-color: var(--teal) transparent;
}

.hour-card,
.day-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hour-card {
  display: grid;
  gap: 8px;
  min-height: 188px;
  padding: 14px;
}

.hour-time,
.day-name {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hour-icon {
  font-size: 2.15rem;
}

.hour-temp {
  font-size: 1.8rem;
  font-weight: 850;
}

.hour-detail {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

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

.day-card {
  display: grid;
  grid-template-columns: minmax(96px, 0.6fr) 44px minmax(110px, 0.9fr) minmax(120px, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 12px 14px;
}

.day-icon {
  font-size: 1.9rem;
}

.day-temp {
  font-weight: 850;
}

.day-condition,
.day-rain {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 28px;
}

.source-section p,
.source-section dd {
  color: var(--muted);
}

.source-section a {
  color: var(--teal-dark);
  font-weight: 750;
}

.source-section dl {
  display: grid;
  gap: 12px;
}

.source-section dt {
  color: var(--ink);
  font-weight: 850;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0 30px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 40;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--coral);
  border-radius: 8px;
}

@media (max-width: 920px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    min-height: 86px;
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
  }

  .weather-workbench,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .weather-workbench {
    min-height: 0;
  }

  .search-panel,
  .current-panel {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  main,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .top-nav {
    gap: 13px;
    font-size: 0.82rem;
  }

  .weather-workbench {
    padding-top: 12px;
  }

  .search-panel,
  .current-panel,
  .forecast-section,
  .source-section {
    border-radius: 7px;
    box-shadow: none;
  }

  .search-panel,
  .current-sky,
  .forecast-section,
  .source-section {
    padding: 18px;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .primary-action {
    min-height: 50px;
  }

  .weather-icon {
    width: 78px;
    font-size: 3rem;
  }

  .temperature-row {
    padding: 24px 18px 12px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
    margin: 12px 18px 18px;
  }

  .current-meta {
    padding: 14px 18px 18px;
  }

  .day-card {
    grid-template-columns: 1fr 38px;
    gap: 8px 12px;
  }

  .day-temp,
  .day-rain {
    grid-column: 1 / -1;
  }
}

@media print {
  .site-header,
  .search-panel,
  .text-action,
  .site-footer,
  .privacy-note,
  .matches {
    display: none;
  }

  body {
    background: white;
  }

  main {
    width: 100%;
  }

  .weather-workbench {
    display: block;
    min-height: 0;
    padding: 0;
  }

  .current-panel,
  .forecast-section,
  .source-section {
    box-shadow: none;
    break-inside: avoid;
  }
}
