:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f4f7fb;
  color: #1d2939;
  line-height: 1.6;
}

[data-theme="dark"] {
  color-scheme: dark;
  background-color: #030b32;
  color: #e2e8f0;
}

[data-theme="dark"] body {
  background-color: #030b32;
}

[data-theme="dark"] .page-shell {
  background: #0d1930;
}

[data-theme="dark"] .card,
[data-theme="dark"] .forecast-card,
[data-theme="dark"] .alert-card,
[data-theme="dark"] .modal-content {
  background: #111827;
  border-color: #374151;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .status-bar,
[data-theme="dark"] .modal-overlay {
  background: rgba(15, 23, 42, 0.9);
  border-color: #1f2937;
}

[data-theme="dark"] .search-button,
[data-theme="dark"] button,
[data-theme="dark"] .search-icon-button,
[data-theme="dark"] .theme-toggle-button {
  background: #1f2937;
  color: #f8fafc;
}

[data-theme="dark"] button:hover,
[data-theme="dark"] button:focus-visible,
[data-theme="dark"] .search-icon-button:hover,
[data-theme="dark"] .search-icon-button:focus-visible,
[data-theme="dark"] .theme-toggle-button:hover,
[data-theme="dark"] .theme-toggle-button:focus-visible {
  background: #2d3748;
}

[data-theme="dark"] .status-message,
[data-theme="dark"] .forecast-card h3,
[data-theme="dark"] .alert-card h3,
[data-theme="dark"] .search-name,
[data-theme="dark"] .forecast-summary strong,
[data-theme="dark"] .alert-title,
[data-theme="dark"] .brand-tagline,
[data-theme="dark"] footer {
  color: #e2e8f0;
}

[data-theme="dark"] .brand-tagline {
  color: #cbd5e1;
}

[data-theme="dark"] .forecast-card {
  border-color: #334155;
}

[data-theme="dark"] .current-conditions-card {
  border-color: #3b82f6;
}

[data-theme="dark"] .alert-warning {
  background: linear-gradient(180deg, #7f1d1d, #991b1b);
  border-color: #f87171;
}

[data-theme="dark"] .alert-watch {
  background: linear-gradient(180deg, #78350f, #92400e);
  border-color: #f59e0b;
}

[data-theme="dark"] .alert-statement {
  background: linear-gradient(180deg, #1e3a8a, #1e40af);
  border-color: #60a5fa;
}

[data-theme="dark"] .alert-info {
  background: linear-gradient(180deg, #0f172a, #111827);
  border-color: #64748b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.page-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
}

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

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.theme-toggle-button,
.search-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: #2564eb24;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.theme-toggle-button:hover,
.theme-toggle-button:focus-visible,
.search-icon-button:hover,
.search-icon-button:focus-visible {
  background: #1d4fd85e;
}

.theme-toggle-button:focus-visible,
.search-icon-button:focus-visible {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.brand {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-end;
}

.brand-name {
  margin: 0;
  line-height: 1;
  padding-bottom: 3px;
}

.search-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: #2564eb24;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}

.search-icon-button:hover,
.search-icon-button:focus-visible {
  background: #1d4fd85e;
}

.brand-tagline {
  flex-basis: 100%;
  margin: 2px 0 0 60px;
  color: #475569;
  font-size: 0.75rem;
  line-height: 1.25;
}

h1 {
  margin: 0;
  line-height: 1;
  font-weight: normal;
}

.logo {
  display: inline-flex;
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  flex-shrink: 0;
  font-size: 32px;
  place-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #e2e8f0;
}

.logo-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

h1,
h2 {
  margin: 0;
  font-weight: normal;
}

h1 {
  font-size: clamp(2rem, 2.5vw, 2.6rem);
}

p {
  margin: 0;
}

.card {
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
}

.note-card p {
  margin-top: 12px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 12px;
}

.search-button {
  padding: 12px 16px;
  border-radius: 14px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.search-button:hover,
.search-button:focus-visible {
  background: #1d4ed8;
}

input[type="text"],
input[type="search"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  font-size: 1rem;
}

button {
  padding: 14px 18px;
  border: none;
  border-radius: 14px;
  background: #2563eb;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: #1d4ed8;
}

.status-message {
  margin-top: 16px;
  color: #334155;
}

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 24px;
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #475569;
  z-index: 10;
}

.forecast-container {
  display: grid;
  gap: 18px;
}

.forecast-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 18px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.forecast-card > * {
  position: relative;
  z-index: 1;
}

.themed-card {
  --tone-overlay: none;
  --effect-overlay: none;
  --effect-overlay-2: none;
  --effect-opacity: 0;
  --streak-alpha: 0.18;
  --streak-size: 2px;
  --streak-gap: 20px;
  --flake-alpha: 0.24;
  --flash-alpha: 0.22;
  --flake-color: rgba(226, 232, 240, 0.78);
  --flake-shadow: rgba(148, 163, 184, 0.24);
}

.themed-card::before,
.themed-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.themed-card::before {
  z-index: 0;
  background-image: var(--tone-overlay);
  opacity: 1;
}

.themed-card::after {
  z-index: 0;
  background-image: var(--effect-overlay), var(--effect-overlay-2);
  opacity: var(--effect-opacity);
}

.current-conditions-card {
  border: 2px solid #2563eb;
}

.alert-card {
  background: linear-gradient(180deg, #fff9e8, #fff3cd);
  border: 1px solid #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.15);
}

.alert-card h3 {
  margin: 0;
  color: #92400e;
}

.alert-meta {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7c2d12;
}

.alert-title {
  margin-top: 6px;
  margin-bottom: 8px;
  font-weight: 700;
  color: #1f2937;
}

.alert-card p {
  margin-top: 10px;
}

.alert-link {
  color: #9a3412;
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.alert-warning {
  background: linear-gradient(180deg, #ffe9e7, #ffd8d2);
  border-color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.18);
}

.alert-watch {
  background: linear-gradient(180deg, #fff6df, #ffe9bf);
  border-color: #f59e0b;
}

.alert-statement {
  background: linear-gradient(180deg, #f0f7ff, #dbeafe);
  border-color: #3b82f6;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.16);
}

.alert-info {
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  border-color: #94a3b8;
}

.theme-default {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.theme-sunny {
  background: linear-gradient(180deg, rgba(255, 252, 240, 0.98), rgba(235, 245, 255, 0.94));
  border-color: rgba(245, 158, 11, 0.34);
  --tone-overlay:
    radial-gradient(circle at 86% 18%, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0) 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(59, 130, 246, 0.08));
}

.theme-overcast {
  background: linear-gradient(180deg, rgba(244, 247, 251, 0.98), rgba(229, 235, 242, 0.94));
  border-color: rgba(148, 163, 184, 0.32);
  --tone-overlay:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 78% 30%, rgba(148, 163, 184, 0.28), rgba(148, 163, 184, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(148, 163, 184, 0.12));
}

.theme-rain {
  background: linear-gradient(180deg, rgba(240, 247, 252, 0.98), rgba(219, 234, 254, 0.94));
  border-color: rgba(14, 165, 233, 0.34);
  --tone-overlay:
    linear-gradient(180deg, rgba(15, 23, 42, 0.06), rgba(56, 189, 248, 0.13)),
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 28%);
}

.theme-snow {
  background: linear-gradient(180deg, rgba(249, 251, 253, 0.99), rgba(232, 240, 248, 0.96));
  border-color: rgba(148, 163, 184, 0.3);
  --tone-overlay:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0) 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(191, 219, 254, 0.12));
}

.theme-fog {
  background: linear-gradient(180deg, rgba(245, 247, 249, 0.99), rgba(230, 235, 240, 0.96));
  border-color: rgba(148, 163, 184, 0.3);
  --tone-overlay:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(148, 163, 184, 0.05)),
    linear-gradient(0deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.theme-clear-night {
  background: linear-gradient(180deg, rgba(231, 238, 252, 0.98), rgba(215, 226, 248, 0.95));
  border-color: rgba(71, 85, 105, 0.34);
  --tone-overlay:
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 20%),
    linear-gradient(180deg, rgba(30, 41, 59, 0.1), rgba(37, 99, 235, 0.07));
}

.intensity-light {
  --streak-alpha: 0.12;
  --streak-size: 1px;
  --streak-gap: 26px;
  --flake-alpha: 0.18;
  --flash-alpha: 0.12;
  --flake-color: rgba(226, 232, 240, 0.64);
  --flake-shadow: rgba(148, 163, 184, 0.18);
}

.intensity-medium {
  --streak-alpha: 0.18;
  --streak-size: 2px;
  --streak-gap: 18px;
  --flake-alpha: 0.24;
  --flash-alpha: 0.2;
  --flake-color: rgba(226, 232, 240, 0.8);
  --flake-shadow: rgba(148, 163, 184, 0.24);
}

.intensity-heavy {
  --streak-alpha: 0.24;
  --streak-size: 3px;
  --streak-gap: 12px;
  --flake-alpha: 0.3;
  --flash-alpha: 0.28;
  --flake-color: rgba(241, 245, 249, 0.92);
  --flake-shadow: rgba(100, 116, 139, 0.28);
}

.effect-streaks {
  --effect-opacity: 1;
  --effect-overlay:
    repeating-linear-gradient(
      122deg,
      rgba(255, 255, 255, 0) 0 calc(var(--streak-gap) - var(--streak-size)),
      rgba(255, 255, 255, var(--streak-alpha)) calc(var(--streak-gap) - var(--streak-size)) var(--streak-gap)
    );
}

.effect-thunder {
  --effect-opacity: 1;
  --effect-overlay-2:
    radial-gradient(circle at 78% 18%, rgba(255, 244, 180, var(--flash-alpha)), rgba(255, 244, 180, 0) 22%),
    linear-gradient(112deg, rgba(255, 255, 255, 0) 47%, rgba(255, 248, 204, calc(var(--flash-alpha) * 1.1)) 50%, rgba(255, 255, 255, 0) 53%);
}

.effect-flurries {
  --effect-opacity: 1;
  --effect-overlay:
    radial-gradient(circle at 14% 18%, var(--flake-color) 0 2.4px, rgba(255, 255, 255, 0) 3.8px),
    radial-gradient(circle at 32% 58%, rgba(255, 255, 255, calc(var(--flake-alpha) * 0.98)) 0 2px, rgba(255, 255, 255, 0) 3.5px),
    radial-gradient(circle at 46% 28%, var(--flake-shadow) 0 1.8px, rgba(148, 163, 184, 0) 3.2px),
    radial-gradient(circle at 62% 42%, var(--flake-color) 0 2.6px, rgba(255, 255, 255, 0) 4px),
    radial-gradient(circle at 74% 70%, rgba(255, 255, 255, calc(var(--flake-alpha) * 0.9)) 0 2.2px, rgba(255, 255, 255, 0) 3.8px),
    radial-gradient(circle at 84% 24%, var(--flake-shadow) 0 1.7px, rgba(148, 163, 184, 0) 3px),
    radial-gradient(circle at 90% 52%, var(--flake-color) 0 2.3px, rgba(255, 255, 255, 0) 3.6px),
    linear-gradient(135deg, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, calc(var(--flake-alpha) * 0.14)) 50%, rgba(255, 255, 255, 0) 68%);
  --effect-overlay-2:
    radial-gradient(circle at 24% 34%, rgba(255, 255, 255, calc(var(--flake-alpha) * 0.5)) 0 1.4px, rgba(255, 255, 255, 0) 2.6px),
    radial-gradient(circle at 56% 16%, rgba(255, 255, 255, calc(var(--flake-alpha) * 0.45)) 0 1.2px, rgba(255, 255, 255, 0) 2.4px),
    radial-gradient(circle at 68% 60%, rgba(255, 255, 255, calc(var(--flake-alpha) * 0.48)) 0 1.5px, rgba(255, 255, 255, 0) 2.8px),
    radial-gradient(circle at 18% 76%, rgba(255, 255, 255, calc(var(--flake-alpha) * 0.42)) 0 1.3px, rgba(255, 255, 255, 0) 2.6px);
}

.effect-veil {
  --effect-opacity: 1;
  --effect-overlay:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    linear-gradient(0deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
}

.effect-glow {
  --effect-opacity: 1;
  --effect-overlay:
    radial-gradient(circle at 88% 14%, rgba(255, 214, 102, 0.38), rgba(255, 214, 102, 0) 22%);
}

.effect-stars {
  --effect-opacity: 1;
  --effect-overlay:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.24) 0 1px, rgba(255, 255, 255, 0) 2px),
    radial-gradient(circle at 76% 24%, rgba(255, 255, 255, 0.22) 0 1px, rgba(255, 255, 255, 0) 2px),
    radial-gradient(circle at 58% 12%, rgba(255, 255, 255, 0.2) 0 1px, rgba(255, 255, 255, 0) 2px);
}

.effect-clouds {
  --effect-opacity: 1;
  --effect-overlay:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 72% 26%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 30%);
}

.forecast-card h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.period-name {
  color: #16a34a;
}

.forecast-card p {
  margin: 0;
}

.forecast-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.forecast-summary strong {
  display: block;
  color: #0f172a;
}

.forecast-summary .forecast-label {
  display: none; /* re-enable by removing this rule */
}

footer {
  text-align: center;
  color: #475569;
  font-size: 0.95rem;
  margin-top: 12px;
  margin-bottom: 40px;
}

footer a {
  color: #2563eb;
  text-decoration: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.modal-content {
  width: min(680px, 100%);
  background: #ffffff;
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
  max-height: calc(100vh - 40px);
  overflow: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: #1f2937;
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-search-row {
  margin-top: 18px;
}

.search-status {
  margin-top: 14px;
  color: #475569;
}

.search-results {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.refresh-button {
  position: fixed;
  right: 30px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: #2564eb24;
  color: #fff;
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  z-index: 20;
  transition: transform 0.2s ease, background 0.2s ease;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  background: #1d4fd85e;
  outline: none;
  transform: translateX(-50%) scale(1.02);
}

.refresh-button:focus-visible {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}
.search-item:hover,
.search-item:focus-visible {
  background: #e2e8f0;
  border-color: #93c5fd;
  outline: none;
}

.search-name {
  font-weight: 600;
  color: #0f172a;
}

.search-id {
  color: #64748b;
  font-size: 0.95rem;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .page-shell {
    padding: 16px;
  }

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

  .modal-content {
    padding: 20px;
  }
}
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background-color: #030b32;
}

html[data-theme="dark"] .page-shell {
  background: #0d1930;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .forecast-card,
html[data-theme="dark"] .alert-card,
html[data-theme="dark"] .modal-content {
  background: #111827;
  border-color: #374151;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .status-bar,
html[data-theme="dark"] .modal-overlay {
  background: rgba(15, 23, 42, 0.92);
  border-color: #1f2937;
}

html[data-theme="dark"] .search-button,
html[data-theme="dark"] button,
html[data-theme="dark"] .search-icon-button,
html[data-theme="dark"] .theme-toggle-button {
  background: #1f2937;
  color: #f8fafc;
}

html[data-theme="dark"] button:hover,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] .search-icon-button:hover,
html[data-theme="dark"] .search-icon-button:focus-visible,
html[data-theme="dark"] .theme-toggle-button:hover,
html[data-theme="dark"] .theme-toggle-button:focus-visible {
  background: #2d3748;
}

html[data-theme="dark"] .status-message,
html[data-theme="dark"] .forecast-card h3,
html[data-theme="dark"] .alert-card h3,
html[data-theme="dark"] .search-name,
html[data-theme="dark"] .forecast-summary strong,
html[data-theme="dark"] .alert-title,
html[data-theme="dark"] .brand-tagline,
html[data-theme="dark"] footer {
  color: #e2e8f0;
}

html[data-theme="dark"] .brand-tagline {
  color: #cbd5e1;
}

html[data-theme="dark"] .forecast-card {
  background-color: #6d81a4;
  border-color: #334155;
}

html[data-theme="dark"] .current-conditions-card {
  border-color: #3b82f6;
}

html[data-theme="dark"] .alert-warning {
  background: linear-gradient(180deg, #7f1d1d, #991b1b);
  border-color: #f87171;
}

html[data-theme="dark"] .alert-watch {
  background: linear-gradient(180deg, #78350f, #92400e);
  border-color: #f59e0b;
}

html[data-theme="dark"] .alert-statement {
  background: linear-gradient(180deg, #1e3a8a, #1e40af);
  border-color: #60a5fa;
}

html[data-theme="dark"] .alert-info {
  background: linear-gradient(180deg, #0f172a, #111827);
  border-color: #64748b;
}
