:root {
  --bg: #f3f7f2;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #17211d;
  --muted: #66736c;
  --line: #d7e0d8;
  --accent: #007f7a;
  --accent-strong: #005f5b;
  --warm: #ffb000;
  --hot: #f05a3e;
  --cool: #2f7fd7;
  --shadow: 0 22px 60px rgba(27, 36, 31, 0.12);
  --sky-top: #e5eee7;
  --sky-mid: #f7efd7;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--sky-top) 0, var(--sky-mid) 280px, var(--bg) 520px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body[data-condition="clear"] {
  --sky-top: #fff0b8;
  --sky-mid: #f9d9a8;
}

body[data-condition="cloud"] {
  --sky-top: #e3ebe7;
  --sky-mid: #f4f0df;
}

body[data-condition="rain"] {
  --sky-top: #dce9ee;
  --sky-mid: #e7eadf;
}

body[data-condition="storm"] {
  --sky-top: #e8e2ef;
  --sky-mid: #efe5d9;
}

body[data-condition="snow"] {
  --sky-top: #f5fbff;
  --sky-mid: #e8f1e9;
}

body[data-condition="fog"] {
  --sky-top: #eef1ec;
  --sky-mid: #f2efe5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

svg {
  display: block;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #2b2d1f;
  background: var(--warm);
  border: 1px solid rgba(23, 33, 29, 0.16);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(255, 176, 0, 0.24);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.search-form {
  position: relative;
  z-index: 5;
}

.input-shell {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 6px 6px 6px 16px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(23, 33, 29, 0.14);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(27, 36, 31, 0.08);
  backdrop-filter: blur(16px);
}

.input-shell:focus-within {
  border-color: rgba(0, 127, 122, 0.56);
  box-shadow: 0 0 0 4px rgba(0, 127, 122, 0.12), 0 12px 30px rgba(27, 36, 31, 0.08);
}

.field-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.input-shell input {
  min-width: 0;
  height: 44px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}

.input-shell input::placeholder {
  color: #7d8982;
}

.search-button,
.location-button,
.suggestion-button,
.recent-button,
.day-card {
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid rgba(23, 33, 29, 0.14);
  border-radius: 8px;
}

.search-button {
  min-height: 44px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 800;
}

.search-button:hover,
.search-button:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.location-button {
  display: inline-flex;
  width: max-content;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  background: rgba(255, 253, 248, 0.92);
  font-weight: 900;
  white-space: nowrap;
}

.location-button svg {
  width: 22px;
  height: 22px;
}

.location-button:hover,
.location-button:focus-visible,
.recent-button:hover,
.recent-button:focus-visible,
.day-card:hover,
.day-card:focus-visible {
  border-color: rgba(0, 127, 122, 0.48);
  box-shadow: 0 0 0 4px rgba(0, 127, 122, 0.12);
}

.suggestions {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  padding: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.suggestion-button {
  display: grid;
  width: 100%;
  min-height: 48px;
  gap: 3px;
  padding: 10px 12px;
  margin: 0;
  text-align: left;
  background: transparent;
  border-color: transparent;
}

.suggestion-button strong,
.suggestion-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-button span {
  color: var(--muted);
  font-size: 0.84rem;
}

.suggestion-button:hover,
.suggestion-button:focus-visible {
  background: rgba(0, 127, 122, 0.08);
  border-color: rgba(0, 127, 122, 0.28);
}

.dashboard {
  display: grid;
  gap: 18px;
}

.status-row {
  width: fit-content;
  max-width: min(680px, 100%);
  padding: 10px 12px;
  color: var(--accent-strong);
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(0, 127, 122, 0.22);
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(27, 36, 31, 0.08);
}

.status-row.error {
  color: #872019;
  background: #fff7f4;
  border-color: rgba(178, 51, 40, 0.28);
}

.current-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 20px;
  min-height: 350px;
  padding: clamp(24px, 3vw, 34px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(248, 242, 222, 0.9));
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.current-section::before {
  position: absolute;
  inset: auto 0 0;
  height: 10px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--warm), var(--hot));
}

.current-copy,
.visual-pane {
  position: relative;
  z-index: 1;
}

.kicker,
.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.current-copy h1 {
  max-width: 850px;
  margin: 8px 0 0;
  font-size: clamp(2.6rem, 6vw, 5.3rem);
  line-height: 0.95;
}

.temperature-readout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 18px;
}

.temperature-readout span:first-child {
  font-size: clamp(4.2rem, 9vw, 7.6rem);
  font-weight: 950;
  line-height: 0.82;
}

.temperature-readout span:last-child {
  margin-top: 8px;
  color: var(--hot);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 950;
}

.condition {
  margin: 12px 0 0;
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  font-weight: 900;
}

.advice {
  max-width: 58ch;
  margin: 10px 0 0;
  color: #3c4741;
  font-size: 1.02rem;
  line-height: 1.6;
}

.current-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  color: var(--muted);
}

.visual-pane {
  display: grid;
  align-content: center;
  gap: 18px;
}

.visual-pane img {
  width: min(100%, 286px);
  aspect-ratio: 1;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 28px 42px rgba(27, 36, 31, 0.2));
}

.sun-window {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: rgba(23, 33, 29, 0.12);
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
}

.sun-window div {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 253, 248, 0.78);
}

.sun-window span,
.metric-card span,
.hour-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.sun-window strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.recent-section {
  min-width: 0;
}

.recent-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.recent-button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  background: rgba(255, 253, 248, 0.82);
  font-weight: 850;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-width: 0;
  min-height: 118px;
  padding: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(27, 36, 31, 0.07);
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05;
}

.metric-card em {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.forecast-section,
.timeline-section {
  min-width: 0;
  padding-top: 10px;
}

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

.section-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
}

.section-heading > span {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.daily-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.hourly-strip::-webkit-scrollbar {
  height: 10px;
}

.hourly-strip::-webkit-scrollbar-track {
  background: rgba(23, 33, 29, 0.08);
  border-radius: 999px;
}

.hourly-strip::-webkit-scrollbar-thumb {
  background: rgba(0, 127, 122, 0.56);
  border: 2px solid rgba(255, 253, 248, 0.82);
  border-radius: 999px;
}

.day-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-width: 0;
  min-height: 182px;
  padding: 12px;
  text-align: left;
  background: rgba(255, 253, 248, 0.88);
}

.day-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: #f2fbf8;
  box-shadow: inset 0 0 0 2px var(--accent), 0 16px 36px rgba(0, 127, 122, 0.12);
}

.day-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.day-main {
  display: grid;
  grid-template-columns: minmax(48px, 60px) minmax(58px, auto);
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.day-main img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.day-temps {
  display: grid;
  justify-items: end;
  gap: 10px;
  font-weight: 950;
}

.day-temp {
  min-width: 58px;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1;
  text-align: right;
}

.day-temp-min {
  color: var(--cool);
}

.day-temp-max {
  color: var(--hot);
}

.rain-chance {
  color: var(--cool);
  font-size: 0.94rem;
  font-weight: 850;
}

.hourly-strip {
  display: grid;
  grid-auto-columns: 126px;
  grid-auto-flow: column;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.hour-card {
  display: grid;
  gap: 8px;
  min-height: 190px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-snap-align: start;
}

.hour-card img {
  width: 64px;
  height: 64px;
}

.hour-card strong {
  font-size: 1.28rem;
  line-height: 1;
}

.hour-card em {
  color: var(--cool);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 850;
}

.hour-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.hourly-empty {
  display: grid;
  width: min(520px, calc(100vw - 40px));
  min-height: 120px;
  align-content: center;
  gap: 6px;
  padding: 18px;
  background: var(--surface-strong);
  border: 1px dashed rgba(23, 33, 29, 0.22);
  border-radius: 8px;
  scroll-snap-align: start;
}

.hourly-empty strong {
  font-size: 1rem;
}

.hourly-empty span {
  color: var(--muted);
  line-height: 1.45;
}

.app-footer {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(260px, 1.6fr);
  gap: 10px 22px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.footer-brand strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.footer-brand span {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: flex-end;
  line-height: 1.45;
}

.footer-note {
  grid-column: 1 / -1;
  margin: 0;
  color: #78847d;
  line-height: 1.5;
}

.is-loading .current-section,
.is-loading .metric-card,
.is-loading .day-card,
.is-loading .hour-card {
  opacity: 0.72;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .search-form {
    grid-column: 1 / -1;
    order: 3;
  }

  .current-section {
    grid-template-columns: 1fr;
  }

  .visual-pane {
    max-width: 520px;
  }

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

  .daily-list {
    grid-auto-columns: 138px;
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .day-card {
    min-height: 166px;
    padding: 9px;
    scroll-snap-align: start;
  }

  .day-main {
    grid-template-columns: minmax(40px, 48px) minmax(48px, auto);
    gap: 5px;
  }

  .day-main img {
    width: 48px;
    height: 48px;
  }

  .day-temp {
    min-width: 48px;
    font-size: 0.98rem;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: stretch;
  }

  .location-button {
    width: 100%;
  }

  .input-shell {
    grid-template-columns: 20px 1fr;
  }

  .search-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .current-section {
    min-height: auto;
    padding: 22px;
  }

  .current-copy h1 {
    font-size: clamp(2.35rem, 17vw, 4.6rem);
  }

  .temperature-readout span:first-child {
    font-size: clamp(4rem, 26vw, 7rem);
  }

  .sun-window {
    grid-template-columns: 1fr;
  }

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

  .daily-list {
    grid-auto-columns: 128px;
    gap: 8px;
  }

  .day-card {
    min-height: 148px;
    padding: 10px;
  }

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

  .day-main {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }

  .day-main img {
    width: 38px;
    height: 38px;
  }

  .day-temps {
    justify-items: start;
    gap: 5px;
  }

  .day-temp {
    min-width: 0;
    font-size: 0.82rem;
    text-align: left;
  }

  .rain-chance {
    font-size: 0.78rem;
  }

  .section-heading {
    display: grid;
  }

  .section-heading > span {
    text-align: left;
  }

  .app-footer {
    grid-template-columns: 1fr;
  }

  .footer-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
