/* Copyright © 2026 Daniel Norton. */

:root {
  color-scheme: light;
  --bg: #f6f3eb;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --surface-soft: #f8f4ea;
  --surface-chip: #efe9db;
  --surface-glass: rgba(255, 253, 248, 0.84);
  --surface-panel: rgba(255, 253, 248, 0.9);
  --surface-panel-strong: rgba(255, 253, 248, 0.98);
  --tile-bg: #ffffff;
  --ink: #1e2528;
  --muted: #657074;
  --line: #ddd7ca;
  --line-strong: rgba(221, 215, 202, 0.94);
  --teal: #1b7f82;
  --teal-dark: #115d61;
  --link: #0d6570;
  --link-hover: #0a5058;
  --coral: #d85f45;
  --coral-dark: #a64031;
  --coral-ink: #73493f;
  --gold: #d89828;
  --green: #4f7d48;
  --input-bg: #ffffff;
  --tooltip-bg: rgba(30, 37, 40, 0.94);
  --tooltip-ink: #ffffff;
  --on-accent: #ffffff;
  --active-bg: #1e2528;
  --active-ink: #ffffff;
  --track-bg: #e8dfce;
  --scrollbar-bg: rgba(236, 230, 216, 0.95);
  --weather-card-bg:
    linear-gradient(120deg, rgba(255, 253, 248, 0.94), rgba(255, 253, 248, 0.8)),
    repeating-linear-gradient(
      105deg,
      rgba(27, 127, 130, 0.08) 0 1px,
      transparent 1px 26px
    );
  --weather-badge-bg:
    linear-gradient(160deg, rgba(216, 95, 69, 0.95), rgba(216, 152, 40, 0.95)),
    #d89828;
  --body-bg:
    radial-gradient(circle at 18% 12%, rgba(216, 152, 40, 0.22), transparent 28rem),
    radial-gradient(circle at 92% 4%, rgba(27, 127, 130, 0.2), transparent 24rem),
    linear-gradient(145deg, #f6f3eb 0%, #eef4f1 48%, #fff7ea 100%);
  --shadow: 0 18px 50px rgba(49, 45, 36, 0.12);
  --max-font-size: 4vw;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111719;
    --surface: #182023;
    --surface-strong: #202a2d;
    --surface-soft: #202a2d;
    --surface-chip: #273337;
    --surface-glass: rgba(24, 32, 35, 0.9);
    --surface-panel: rgba(24, 32, 35, 0.93);
    --surface-panel-strong: rgba(24, 32, 35, 0.98);
    --tile-bg: #202a2d;
    --ink: #eef4f1;
    --muted: #a8b5b8;
    --line: #3a484d;
    --line-strong: rgba(69, 84, 89, 0.94);
    --teal: #4fb8bb;
    --teal-dark: #77d1d1;
    --link: #77d1d1;
    --link-hover: #a0e7e3;
    --coral: #e7775f;
    --coral-dark: #f09a88;
    --coral-ink: #f0b3a6;
    --gold: #e5b659;
    --green: #8eb47a;
    --input-bg: #111719;
    --tooltip-bg: rgba(238, 244, 241, 0.94);
    --tooltip-ink: #111719;
    --on-accent: #111719;
    --active-bg: #eef4f1;
    --active-ink: #111719;
    --track-bg: #344145;
    --scrollbar-bg: rgba(52, 65, 69, 0.95);
    --weather-card-bg:
      linear-gradient(120deg, rgba(24, 32, 35, 0.95), rgba(20, 27, 30, 0.92)),
      repeating-linear-gradient(
        105deg,
        rgba(79, 184, 187, 0.13) 0 1px,
        transparent 1px 26px
      );
    --weather-badge-bg:
      linear-gradient(160deg, rgba(219, 100, 78, 0.98), rgba(216, 152, 40, 0.92)),
      #d89828;
    --body-bg:
      radial-gradient(circle at 18% 12%, rgba(216, 152, 40, 0.16), transparent 28rem),
      radial-gradient(circle at 92% 4%, rgba(27, 127, 130, 0.25), transparent 24rem),
      linear-gradient(145deg, #111719 0%, #172225 52%, #1c211f 100%);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111719;
  --surface: #182023;
  --surface-strong: #202a2d;
  --surface-soft: #202a2d;
  --surface-chip: #273337;
  --surface-glass: rgba(24, 32, 35, 0.9);
  --surface-panel: rgba(24, 32, 35, 0.93);
  --surface-panel-strong: rgba(24, 32, 35, 0.98);
  --tile-bg: #202a2d;
  --ink: #eef4f1;
  --muted: #a8b5b8;
  --line: #3a484d;
  --line-strong: rgba(69, 84, 89, 0.94);
  --teal: #4fb8bb;
  --teal-dark: #77d1d1;
  --link: #77d1d1;
  --link-hover: #a0e7e3;
  --coral: #e7775f;
  --coral-dark: #f09a88;
  --coral-ink: #f0b3a6;
  --gold: #e5b659;
  --green: #8eb47a;
  --input-bg: #111719;
  --tooltip-bg: rgba(238, 244, 241, 0.94);
  --tooltip-ink: #111719;
  --on-accent: #111719;
  --active-bg: #eef4f1;
  --active-ink: #111719;
  --track-bg: #344145;
  --scrollbar-bg: rgba(52, 65, 69, 0.95);
  --weather-card-bg:
    linear-gradient(120deg, rgba(24, 32, 35, 0.95), rgba(20, 27, 30, 0.92)),
    repeating-linear-gradient(
      105deg,
      rgba(79, 184, 187, 0.13) 0 1px,
      transparent 1px 26px
    );
  --weather-badge-bg:
    linear-gradient(160deg, rgba(219, 100, 78, 0.98), rgba(216, 152, 40, 0.92)),
    #d89828;
  --body-bg:
    radial-gradient(circle at 18% 12%, rgba(216, 152, 40, 0.16), transparent 28rem),
    radial-gradient(circle at 92% 4%, rgba(27, 127, 130, 0.25), transparent 24rem),
    linear-gradient(145deg, #111719 0%, #172225 52%, #1c211f 100%);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.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: 28px 0 40px;
}

.topbar,
.content-layout,
.primary-column,
.dashboard,
.forecast-layout {
  display: grid;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  overflow: visible;
  grid-template-columns: minmax(330px, max-content) minmax(320px, 1fr);
  align-items: center;
  padding: 14px;
  background: var(--surface-glass);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-toggle {
  display: none;
  position: relative;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-toggle::before {
  position: absolute;
  width: 17px;
  height: 17px;
  content: "";
  border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent);
  border-top-color: var(--teal);
  border-radius: 50%;
  opacity: 0;
  animation: weather-spin 900ms linear infinite;
}

.is-loading-long .search-toggle::before {
  opacity: 1;
}

.is-loading-long .search-toggle .search-icon {
  opacity: 0;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand > div {
  display: grid;
  min-height: 44px;
  align-content: center;
}

.brand-mark {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #402d10;
  font-size: min(1.55rem, var(--max-font-size));
  background: #f7c95f;
  border: 1px solid rgba(64, 45, 16, 0.14);
  border-radius: 8px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 0.95;
}

.eyebrow,
.status-strip,
.detail-tile span,
.panel-heading span,
.temp-range,
.recent-empty {
  color: var(--muted);
}

.search-panel {
  position: relative;
  z-index: 2;
  overflow: visible;
  display: grid;
  grid-column: 2;
  grid-template-columns: minmax(180px, 1fr) 8px 44px 44px;
  gap: 0;
}

.search-panel input {
  grid-row: 1;
  grid-column: 1;
  min-width: 0;
  height: 44px;
  padding: 0 40px 0 14px;
  color: var(--ink);
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.search-panel input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(27, 127, 130, 0.16);
}

.search-panel input::-webkit-search-cancel-button {
  appearance: none;
}

.clear-input-button {
  position: absolute;
  top: 8px;
  right: 102px;
  z-index: 4;
  display: grid;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  font-size: min(1.15rem, var(--max-font-size));
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.clear-input-button svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.clear-input-button:hover,
.clear-input-button:focus-visible {
  color: var(--ink);
  background: rgba(27, 127, 130, 0.12);
}

.clear-input-button[hidden] {
  display: none;
}

.search-error {
  grid-row: 2;
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 38rem);
  max-height: 0;
  overflow: hidden;
  margin: 0;
  color: var(--coral-dark);
  font-size: min(0.82rem, var(--max-font-size));
  font-weight: 750;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 180ms ease,
    margin-top 180ms ease,
    opacity 160ms ease,
    transform 180ms ease;
}

.search-error.is-active {
  max-height: 4rem;
  margin-top: 6px;
  opacity: 1;
  transform: translateY(0);
}

.primary-button,
.ghost-button,
.unit-button,
.text-button,
.recent-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  grid-row: 1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 14px;
  white-space: nowrap;
}

.icon-button {
  position: relative;
  width: 44px;
  padding: 0;
}

.icon-button #searchButtonText,
.icon-button .button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-button::after {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 100;
  width: max-content;
  max-width: 13rem;
  padding: 5px 7px;
  color: var(--tooltip-ink);
  font-size: min(0.72rem, var(--max-font-size));
  font-weight: 750;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  content: attr(data-tooltip);
  background: var(--tooltip-bg);
  border-radius: 5px;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.primary-button {
  grid-column: 3;
  color: var(--on-accent);
  background: var(--teal);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.search-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.ghost-button {
  grid-column: 4;
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.ghost-button:hover,
.recent-button:hover,
.unit-button:hover,
.text-button:hover {
  border-color: rgba(27, 127, 130, 0.42);
}

.preferences {
  --unit-control-width: 50px;

  display: flex;
  position: relative;
  z-index: 2;
  overflow: visible;
  align-self: center;
  flex-wrap: wrap;
  width: calc((var(--unit-control-width) * 2) + 8px);
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  margin-left: 0;
}

.selector-cluster {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}

.selector-cluster::after {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 100;
  width: max-content;
  max-width: 10rem;
  padding: 5px 7px;
  color: var(--tooltip-ink);
  font-size: min(0.72rem, var(--max-font-size));
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
  content: attr(data-tooltip);
  background: var(--tooltip-bg);
  border-radius: 5px;
  opacity: 0;
  transform: translateY(2px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .selector-cluster:hover::after,
  .selector-cluster:has(.unit-button:focus-visible)::after {
    opacity: 1;
    transform: translateY(0);
  }
}

.unit-toggle {
  --unit-button-width: var(--unit-control-width);

  display: grid;
  grid-template-columns: var(--unit-button-width);
  gap: 0;
  width: var(--unit-button-width);
  min-width: 0;
  justify-self: end;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.unit-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--unit-button-width);
  min-width: var(--unit-button-width);
  max-width: var(--unit-button-width);
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  font-size: min(0.72rem, var(--max-font-size));
  line-height: 1;
  background: var(--surface-chip);
  border-color: var(--line);
  border-radius: 5px;
}

.unit-button.active {
  display: inline-flex;
  color: var(--active-ink);
  background: var(--active-bg);
}

.location-meta-break {
  display: none;
}

.coordinate-pair {
  word-break: normal;
  overflow-wrap: normal;
  white-space: nowrap;
}

.location-meta-grid,
.location-meta-station-id {
  white-space: nowrap;
}

.status-strip {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  min-height: 40px;
  padding: 9px 14px;
  font-size: min(0.92rem, var(--max-font-size));
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
}

.status-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.share-feedback {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 10rem;
  overflow: hidden;
  color: var(--muted);
  font-size: min(0.78rem, var(--max-font-size));
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-feedback:empty {
  display: none;
}

.share-feedback[data-tone="error"] {
  color: var(--coral-dark);
}

.cancel-request-button {
  min-height: 28px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: min(0.78rem, var(--max-font-size));
  font-weight: 750;
  background: transparent;
  border-color: transparent;
}

.cancel-request-button:hover,
.cancel-request-button:focus-visible {
  color: var(--coral-dark);
  background: rgba(216, 95, 69, 0.08);
  border-color: rgba(216, 95, 69, 0.28);
}

.is-loading .cancel-request-button:not([hidden]) {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 120;
  min-height: 32px;
  color: var(--coral-dark);
  background: var(--surface-panel-strong);
  border-color: rgba(216, 95, 69, 0.24);
  box-shadow: 0 12px 28px rgba(49, 45, 36, 0.14);
}

#updatedText {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: min(0.82rem, var(--max-font-size));
  text-overflow: ellipsis;
  white-space: nowrap;
}

#statusText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-location-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: min(0.78rem, var(--max-font-size));
  font-weight: 750;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#statusText[data-tone="error"] {
  color: var(--coral-dark);
  font-weight: 700;
}

.status-strip a {
  color: var(--link);
  font-weight: 750;
  text-underline-offset: 3px;
}

.status-strip a:hover,
.status-strip a:focus-visible {
  color: var(--link-hover);
}

.share-button {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  place-items: center;
  color: var(--teal-dark);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.share-button:hover,
.share-button:focus-visible {
  color: var(--ink);
  border-color: rgba(27, 127, 130, 0.42);
}

.share-icon {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.content-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  margin-top: 16px;
}

.primary-column {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  align-content: start;
}

.dashboard {
  grid-column: 1;
  grid-row: 1;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
}

.current-panel {
  grid-column: 1;
  grid-row: 1;
}

.status-strip {
  grid-column: 1;
  grid-row: 2;
}

.side-panel {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.current-panel,
.side-panel,
.forecast-panel {
  min-width: 0;
  background: var(--surface-panel);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.current-panel {
  min-height: 0;
  padding: 24px;
  overflow: hidden;
  background: var(--weather-card-bg);
}

.current-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.current-main > div:first-child {
  min-width: 0;
}

.weather-control-stack {
  display: grid;
  flex: 0 0 max-content;
  justify-items: center;
  gap: 8px;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: min(0.78rem, var(--max-font-size));
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.65rem);
  line-height: 1.02;
}

.location-context {
  margin-top: 4px;
  color: var(--muted);
  font-size: min(0.82rem, var(--max-font-size));
  font-weight: 750;
}

.location-context:empty {
  display: none;
}

.condition {
  margin-top: 12px;
  color: var(--ink);
  font-size: min(1.1rem, var(--max-font-size));
}

.weather-badge {
  display: grid;
  position: relative;
  flex: 0 0 clamp(76px, 9vw, 112px);
  width: clamp(76px, 9vw, 112px);
  height: clamp(76px, 9vw, 112px);
  place-items: center;
  color: #fff;
  font-size: clamp(2rem, 6.5vw, 4rem);
  line-height: 1;
  background: var(--weather-badge-bg);
  border: 1px solid rgba(64, 45, 16, 0.18);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(216, 95, 69, 0.24);
}

.weather-svg {
  display: block;
  width: 1.6em;
  height: 1.6em;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.weather-badge .weather-svg {
  width: 64%;
  height: 64%;
  stroke-width: 2.35;
  transition: opacity 160ms ease;
}

.busy-spinner {
  display: block;
  position: absolute;
  inset: 0;
  width: 42%;
  height: 42%;
  margin: auto;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 160ms ease;
  animation: weather-spin 900ms linear infinite;
}

.is-loading-long .busy-spinner {
  opacity: 1;
}

.is-loading-long .weather-badge .weather-svg {
  opacity: 0;
}

@keyframes weather-spin {
  to {
    transform: rotate(360deg);
  }
}

.temperature-row {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin-top: 8px;
}

.temperature-stack {
  display: grid;
  gap: 8px;
}

.temperature {
  position: relative;
  display: grid;
  gap: 4px;
  padding-left: 14px;
  font-size: clamp(2.8rem, 4vw, 5rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: 0;
}

.temperature::before {
  position: absolute;
  top: 1px;
  bottom: 3px;
  left: 0;
  width: 4px;
  content: "";
  background: var(--coral);
  border-radius: 999px;
}

.temperature .temp-primary {
  color: var(--ink);
}

.temperature .temp-secondary {
  color: var(--muted);
  font-size: clamp(1.2rem, 0.48em, 1.8rem);
  font-weight: 750;
  line-height: 1;
}

.current-alert-link {
  display: grid;
  align-self: center;
  grid-column: 2;
  min-width: 10.5rem;
  max-width: min(14rem, 100%);
  margin-left: auto;
  padding: 9px 12px;
  color: var(--coral-dark);
  text-decoration: none;
  background: rgba(216, 95, 69, 0.12);
  border: 1px solid rgba(216, 95, 69, 0.28);
  border-left: 4px solid var(--coral);
  border-radius: 8px;
}

.current-alert-link:hover,
.current-alert-link:focus-visible {
  color: var(--coral-dark);
  background: rgba(216, 95, 69, 0.18);
}

.current-alert-link[hidden] {
  display: none;
}

.current-alert-count,
.current-alert-event {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-alert-count {
  font-size: min(0.88rem, var(--max-font-size));
  font-weight: 900;
  line-height: 1.05;
}

.current-alert-event {
  color: var(--coral-ink);
  font-size: min(0.76rem, var(--max-font-size));
  font-weight: 750;
  line-height: 1.1;
}

.temp-range {
  display: grid;
  gap: 7px;
  margin: 0 0 0 14px;
  font-size: min(1rem, var(--max-font-size));
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, 8.35rem);
  gap: 8px;
  margin-top: 16px;
  margin-right: auto;
  margin-left: auto;
  width: max-content;
  max-width: 100%;
}

.detail-tile {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 6px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--tile-bg) 74%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 8px;
}

.detail-tile span {
  display: block;
  font-size: min(0.8rem, var(--max-font-size));
  line-height: 1.05;
}

.detail-tile strong {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 4px;
  font-size: min(1.32rem, var(--max-font-size));
  line-height: 1.05;
  white-space: nowrap;
}

.pressure-trend {
  color: var(--muted);
  font-size: min(0.72rem, var(--max-font-size));
  font-weight: 750;
  line-height: 1.05;
}

.pressure-trend[data-trend="up"] {
  color: var(--teal-dark);
  font-size: min(1.05rem, var(--max-font-size));
  font-weight: 900;
}

.pressure-trend[data-trend="down"] {
  color: var(--coral-dark);
  font-size: min(1.05rem, var(--max-font-size));
  font-weight: 900;
}

.pressure-tile strong {
  gap: 3px;
  font-size: min(1.16rem, var(--max-font-size));
}

.side-panel,
.forecast-panel {
  padding: 18px;
}

.side-panel {
  align-content: start;
  display: grid;
  gap: 18px;
}

.side-section + .side-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.alert-section.has-alerts .panel-heading h3 {
  color: var(--coral-dark);
}

.alert-section.has-alerts #alertCount {
  padding: 4px 8px;
  color: var(--coral-dark);
  font-weight: 800;
  background: rgba(216, 95, 69, 0.12);
  border: 1px solid rgba(216, 95, 69, 0.24);
  border-radius: 999px;
}

h3 {
  font-size: min(1rem, var(--max-font-size));
}

.text-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--teal-dark);
  background: transparent;
}

.recent-list,
.alert-list {
  display: grid;
  gap: 8px;
}

.alert-section {
  scroll-margin-top: 86px;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  overflow: hidden;
  background: var(--tile-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.recent-button {
  display: grid;
  width: 100%;
  min-height: 50px;
  padding: 9px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.recent-delete-button {
  display: grid;
  width: 34px;
  min-height: 50px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  font-size: min(1.15rem, var(--max-font-size));
  font-weight: 850;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.recent-delete-button:hover,
.recent-delete-button:focus-visible {
  color: var(--coral-dark);
  background: rgba(216, 95, 69, 0.1);
}

.recent-button span {
  overflow: hidden;
  color: var(--muted);
  font-size: min(0.82rem, var(--max-font-size));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-empty {
  padding: 18px 2px;
  font-size: min(0.9rem, var(--max-font-size));
}

.alert-item {
  display: grid;
  gap: 0;
  min-height: 64px;
  overflow: hidden;
  background: var(--tile-bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
}

.alert-summary {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 62px;
  padding: 10px 34px 10px 12px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: inherit;
}

.alert-summary:hover,
.alert-summary:focus-visible {
  background: rgba(216, 152, 40, 0.08);
}

.alert-event {
  font-size: min(0.92rem, var(--max-font-size));
}

.alert-area,
.alert-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: min(0.8rem, var(--max-font-size));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-toggle {
  position: absolute;
  right: 11px;
  top: 10px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--coral-dark);
  font-size: min(0.95rem, var(--max-font-size));
  font-weight: 900;
  line-height: 1;
  background: rgba(216, 95, 69, 0.1);
  border-radius: 999px;
}

.alert-details {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  color: color-mix(in srgb, var(--ink) 76%, var(--muted));
  font-size: min(0.8rem, var(--max-font-size));
  line-height: 1.32;
}

.alert-details p {
  margin: 0;
}

.alert-full-area,
.alert-headline,
.alert-detail-label {
  color: var(--ink);
  font-weight: 850;
}

.alert-times {
  font-weight: 750;
}

.alert-details a {
  width: max-content;
  color: var(--link);
  font-weight: 750;
  text-underline-offset: 3px;
}

.severity-severe,
.severity-extreme {
  border-left-color: var(--coral);
}

@media (min-width: 901px) {
  .side-panel {
    position: relative;
    z-index: 20;
  }

  .alert-list,
  .alert-item.is-expanded {
    overflow: visible;
  }

  .alert-item.is-expanded {
    position: relative;
    z-index: 30;
    box-shadow: 0 12px 32px rgba(49, 45, 36, 0.22);
  }

  .alert-section.is-attention {
    outline: 3px solid rgba(216, 95, 69, 0.45);
    outline-offset: 4px;
    animation: alert-attention 1.2s ease;
  }

  .alert-item.is-expanded .alert-details {
    position: static;
    max-height: min(56vh, 28rem);
    overflow-y: auto;
    padding: 12px;
    background: var(--tile-bg);
    border-top: 1px solid var(--line);
  }

  .alert-item.severity-severe.is-expanded .alert-details,
  .alert-item.severity-extreme.is-expanded .alert-details {
    border-top-color: rgba(216, 95, 69, 0.32);
  }
}

@keyframes alert-attention {
  0%,
  100% {
    background: var(--surface-panel);
  }

  45% {
    background: rgba(216, 95, 69, 0.1);
  }
}

.forecast-layout {
  grid-column: 1;
  grid-row: 3;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
}

.attribution {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: min(0.78rem, var(--max-font-size));
}

.theme-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  opacity: 0.76;
  white-space: nowrap;
}

.footer-divider {
  color: var(--line-strong);
  opacity: 0.76;
}

.theme-control select {
  min-height: 22px;
  padding: 0 18px 0 6px;
  color: var(--muted);
  font: inherit;
  background-color: transparent;
  border: 0;
  border-radius: 4px;
}

.theme-control select:focus-visible {
  outline: 2px solid rgba(27, 127, 130, 0.34);
  outline-offset: 2px;
}

.reset-units-button {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 0;
  color: var(--muted);
  font: inherit;
  line-height: inherit;
  vertical-align: baseline;
  background: transparent;
  border: 0;
  border-radius: 4px;
  opacity: 0.76;
}

.reset-units-button:hover,
.reset-units-button:focus-visible {
  color: var(--ink);
  opacity: 1;
}

.reset-units-button:focus-visible {
  outline: 2px solid rgba(27, 127, 130, 0.34);
  outline-offset: 2px;
}

.legal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  flex: 1 0 100%;
  gap: 12px;
  width: 100%;
  padding-inline: clamp(12px, 1.5vw, 18px);
}

.copyright {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  white-space: nowrap;
}

.version {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
}

.hourly-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 9.5rem;
  gap: 8px;
  min-height: 112px;
  overflow-x: auto;
  padding-bottom: 0;
  scrollbar-width: none;
}

.hourly-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.hourly-scrollbar {
  position: relative;
  display: none;
  height: 12px;
  margin-top: 8px;
  overflow: hidden;
  background: var(--scrollbar-bg);
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.hourly-scrollbar.is-active {
  display: block;
}

.hourly-scrollbar span {
  position: absolute;
  inset-block: 0;
  left: var(--thumb-left, 0%);
  width: var(--thumb-width, 28%);
  background: rgba(27, 127, 130, 0.62);
  border-radius: inherit;
  cursor: grab;
}

.hourly-scrollbar.is-dragging span {
  cursor: grabbing;
  background: rgba(17, 93, 97, 0.75);
}

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

.hour-card {
  display: grid;
  min-width: 82px;
  min-height: 100px;
  align-content: center;
  gap: 9px;
  justify-items: stretch;
  overflow: hidden;
  padding: 10px 8px;
}

.hour-card time,
.hour-card span,
.day-row span {
  color: var(--muted);
  font-size: min(0.82rem, var(--max-font-size));
}

.hour-card time {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.hour-card strong {
  font-size: min(1.18rem, var(--max-font-size));
}

.hour-card-meta,
.hour-card-reading {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.hour-card-meta {
  display: grid;
  grid-template-columns: max-content max-content;
  justify-content: space-between;
  gap: 6px;
}

.hour-card-reading {
  justify-content: center;
  gap: 8px;
}

.hour-pop {
  min-width: 0;
  overflow: visible;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

.hour-temp {
  display: grid;
  min-width: 0;
  justify-items: start;
  gap: 1px;
}

.hour-temp .temp-primary {
  color: var(--ink);
  font-size: min(1.18rem, var(--max-font-size));
  font-weight: 800;
  white-space: nowrap;
}

.hour-temp .temp-secondary {
  color: var(--muted);
  font-size: min(0.76rem, var(--max-font-size));
  font-weight: 700;
  white-space: nowrap;
}

.hour-icon {
  display: grid;
  place-items: center;
  color: var(--gold);
  flex: 0 0 auto;
  font-size: min(1.55rem, var(--max-font-size));
  line-height: 1;
}

.hour-icon .weather-svg {
  width: 1.6em;
  height: 1.6em;
}

.daily-list {
  display: grid;
  gap: 8px;
}

.day-row {
  display: grid;
  grid-template-columns: 3.4rem 4.8rem minmax(5.4rem, 1fr);
  grid-template-areas:
    "icon label temps"
    "track track track"
    "forecast forecast forecast";
  align-items: center;
  gap: 7px 10px;
  min-width: 0;
  min-height: 66px;
  padding: 10px;
}

.day-row strong {
  grid-area: label;
  justify-self: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-label {
  justify-self: center;
  width: 100%;
  text-align: center;
}

.day-temps {
  grid-area: temps;
  display: grid;
  min-width: max-content;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.day-temps .temp-primary {
  color: var(--ink);
  font-weight: 800;
}

.day-temps .temp-secondary {
  color: var(--muted);
  font-size: min(0.74rem, var(--max-font-size));
}

.day-forecast {
  grid-area: forecast;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: min(0.76rem, var(--max-font-size));
  font-weight: 650;
  line-height: 1.22;
}

.day-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  color: var(--coral);
  font-size: min(1.35rem, var(--max-font-size));
  line-height: 1;
  text-align: center;
}

.day-icon .weather-svg {
  width: 1.35em;
  height: 1.35em;
}

.range-track {
  grid-area: track;
  position: relative;
  height: 14px;
  overflow: hidden;
  background: var(--track-bg);
  border-radius: 999px;
}

.range-fill {
  position: absolute;
  inset-block: 0;
  left: var(--range-start, 0%);
  width: var(--range-width, 70%);
  background: linear-gradient(90deg, var(--green), var(--gold), var(--coral));
  border-radius: inherit;
}

.is-loading .primary-button {
  background: #7f9494;
}

@media (max-width: 900px) {
  .content-layout,
  .dashboard,
  .forecast-layout {
    grid-template-columns: 1fr;
  }

  .primary-column {
    display: contents;
  }

  .dashboard {
    order: 1;
  }

  .alert-section {
    order: 2;
  }

  .status-strip {
    order: 3;
  }

  .recent-section {
    order: 4;
  }

  .forecast-layout {
    order: 5;
  }

  .side-panel {
    display: contents;
  }

  .side-panel > .side-section {
    width: 100%;
    max-width: 38rem;
    min-width: 0;
    justify-self: center;
    padding: 18px;
    background: var(--surface-panel);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .side-section + .side-section {
    padding-top: 18px;
    border-top: 0;
  }

  .current-panel,
  .status-strip,
  .side-panel > .side-section,
  .forecast-layout,
  .dashboard {
    grid-column: 1;
    grid-row: auto;
  }

  .daily-panel {
    width: 100%;
    max-width: 38rem;
    justify-self: center;
  }

  .preferences {
    justify-self: center;
    justify-content: center;
  }

  .selector-cluster {
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .topbar {
    top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 8px;
  }

  .search-toggle {
    display: grid;
    grid-column: 2;
    grid-row: 1;
  }

  .current-panel,
  .side-panel > .side-section,
  .forecast-panel {
    padding: 12px;
  }

  .current-panel {
    display: grid;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    gap: 10px;
  }

  .brand-mark {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    font-size: min(1.15rem, var(--max-font-size));
  }

  .brand > div {
    min-height: 36px;
  }

  h1 {
    font-size: clamp(1.55rem, 8vw, 2.25rem);
  }

  .search-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 90;
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr);
    box-sizing: border-box;
    width: 100%;
    justify-self: stretch;
    gap: 0;
    padding: 8px;
    background: var(--surface-panel-strong);
    border: 1px solid color-mix(in srgb, var(--line) 96%, transparent);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(49, 45, 36, 0.18);
  }

  .topbar.is-search-open .search-panel {
    display: grid;
  }

  .search-panel input {
    height: 34px;
    padding: 0 96px 0 12px;
  }

  .clear-input-button {
    top: 11px;
    right: 62px;
    width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .primary-button,
  .ghost-button {
    position: absolute;
    top: 3px;
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    font-size: 0;
    gap: 0;
    border-radius: 6px;
  }

  .primary-button {
    right: 32px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .ghost-button {
    right: 4px;
    background: var(--surface-soft);
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  .ghost-button span[aria-hidden="true"] {
    font-size: min(0.95rem, var(--max-font-size));
  }

  .search-icon {
    width: 17px;
    height: 17px;
  }
}

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

  .preferences {
    align-self: start;
    justify-self: center;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
  }

  .weather-control-stack .preferences {
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    margin-top: 0;
  }

  .unit-toggle,
  .pressure-toggle,
  .wind-toggle {
    display: grid;
    grid-template-columns: var(--unit-button-width);
    width: var(--unit-button-width);
    gap: 0;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .unit-button {
    display: none;
    position: relative;
    width: var(--unit-button-width);
    min-width: var(--unit-button-width);
    max-width: var(--unit-button-width);
    min-height: 28px;
    padding: 0 8px;
    font-size: min(0.72rem, var(--max-font-size));
    background: var(--surface-chip);
    border-color: var(--line);
  }

  .unit-button.active {
    display: inline-flex;
  }

  .status-strip {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .status-actions {
    justify-content: space-between;
    width: 100%;
  }

  #statusText {
    overflow: visible;
    white-space: normal;
  }

  .status-location-meta {
    overflow: visible;
    white-space: normal;
  }

  .current-main {
    align-items: flex-start;
  }

  h2 {
    font-size: clamp(1.35rem, 5.8vw, 1.7rem);
    font-weight: 900;
    line-height: 1;
  }

  h2.is-wrapping {
    font-size: clamp(1.16rem, 4.9vw, 1.45rem);
    line-height: 1.04;
  }

  h2.is-very-long {
    font-size: clamp(1rem, 4.4vw, 1.22rem);
    line-height: 1.06;
  }

  .eyebrow {
    margin-bottom: 6px;
    font-size: min(0.72rem, var(--max-font-size));
  }

  .weather-badge {
    flex-basis: 108px;
    width: 108px;
    height: 108px;
    font-size: clamp(2.2rem, 12vw, 2.9rem);
  }

  .temperature-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .temperature-stack {
    grid-column: 1;
    grid-row: 1;
  }

  .current-alert-link {
    grid-column: 1;
    align-self: flex-start;
    min-width: 0;
    margin-left: 0;
  }

  .temp-range {
    margin-bottom: 0;
  }

  .details-grid {
    grid-template-columns: repeat(2, minmax(0, 124px));
    width: min(100%, 264px);
  }

  .detail-tile {
    width: 100%;
    padding-inline: 10px;
  }

  .pressure-tile strong {
    gap: 2px;
    font-size: min(0.98rem, var(--max-font-size));
  }

  .recent-list .recent-item:nth-child(n + 4) {
    display: none;
  }

  .coordinate-pair {
    display: block;
  }

  .location-meta-separator {
    display: none;
  }

  .location-meta-break {
    display: initial;
  }

  .hourly-list {
    grid-auto-columns: 9.5rem;
    max-width: 100%;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .hour-card {
    min-width: 0;
  }

  .hour-icon {
    font-size: clamp(1.4rem, 7vw, 1.75rem);
  }

  .day-row {
    padding: 10px;
  }

  .day-row strong {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  .day-icon {
    justify-self: start;
    font-size: clamp(1.25rem, 6.5vw, 1.6rem);
  }

  .day-icon .weather-svg {
    width: 1.45em;
    height: 1.45em;
  }

  .day-temps {
    justify-self: end;
  }

  .attribution {
    justify-content: flex-start;
  }

  .copyright {
    text-align: left;
  }
}

@media (max-height: 520px) and (max-width: 900px) and (orientation: landscape) {
  .app-shell {
    padding-top: 8px;
  }

  .topbar {
    padding: 6px 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .brand > div {
    min-height: 34px;
  }

  h1 {
    font-size: clamp(1.45rem, 5vw, 2rem);
  }

  .current-panel,
  .side-panel,
  .forecast-panel {
    padding: 10px;
  }
}
